* chore(packages): publish the @openmaic/* SDK family to npm (#778)
Prepares the @openmaic/{dsl,renderer,importer} family for its first npm
publish, and moves the SDK packages onto the @openmaic scope.
Why the scope move: the @maic org name is unavailable on npm (an unscoped
`maic` package already holds the name), so @maic/* is not claimable. @openmaic
matches the project name, the scope is free, and the repo already ships an
@openmaic/docs package — so the SDK family now lines up with that convention.
- rename @maic/{dsl,renderer,importer} -> @openmaic/* across packages, the
workspace glob, the package dir, and all import sites; lockfile regenerated
- renderer: add publishConfig (public, registry.npmjs.org) — was missing, so
a scoped publish would default to the wrong registry / restricted access
- importer: add a files allowlist (dist, README, LICENSE) and drop the
fragile .npmignore blacklist that shipped src; add an exports map so ESM
consumers resolve dist/index.js instead of falling back to the .cjs main
- all three: add a prepublishOnly build (+ test/typecheck) guard so a publish
can never ship a stale or empty dist
- add a tag-triggered publish workflow with npm provenance, pinned by name to
the three @openmaic packages so the vendored forks (mathml2omml, pptxgenjs)
are never published
Refs #778, #720 (Phase 1).
* fix(packages): address cross-review on the @openmaic publish prep
Cross-review (Claude /code-review + codex) on this PR surfaced:
- renderer's advertised CJS entry was broken: it keeps @openmaic/dsl external
and imports a runtime enum from it, but dsl is ESM-only (no `require`
condition), so `require('@openmaic/renderer')` would throw
ERR_PACKAGE_PATH_NOT_EXPORTED. Make renderer ESM-only: drop the `.cjs`
rollup output, `main` now points at the ESM build, and the `require`
conditions are removed from `exports`. (importer is unaffected — it bundles
dsl, so its CJS build still works.)
- prepublishOnly re-ran the test suite during `pnpm -r publish`, so a flaky
test after dsl had already published gave a non-atomic partial release.
Reduce prepublishOnly to a build-only guard (never ship stale/empty dist)
and move the real test/typecheck gate into the workflow, before any publish.
- document that an @openmaic/* tag publishes the whole family via `pnpm -r`
(pnpm skips already-published versions); the tag is a release marker, not a
per-package gate.
Verified: dsl + renderer + importer build; renderer emits ESM only (0 .cjs),
all exports entries resolve; `npm pack` ships dist + README + LICENSE with no
src leak; frozen-lockfile passes.
Refs #778.
* style: reflow @openmaic/dsl type imports past print-width after rename
The @maic -> @openmaic rename lengthened two single-line type imports past
prettier's 100-col width; prettier --check flagged them. Pure formatting.
Refs #778.
* docs(importer): mark @openmaic/importer browser-only (cr-loop accepted limitation)
codex cross-review flagged that the published @openmaic/importer throws
`XMLHttpRequest is not a constructor` when loaded in a pure Node process —
its rollup build is browser-targeted (`nodeResolve({browser:true})` + a
browser pdf.js build). The app only consumes it client-side ('use client'),
so this is by design. Document it as an accepted limitation: prominent
browser-only note in the README and a `browser` field in the manifest.
Refs #778.
* feat(import): add pptxtojson-pro workspace package and stage-1 PPTX import
Vendor the TypeScript pptxtojson-pro parser as a workspace package, sync its
bundle to public/vendor at install time (avoids Turbopack dynamic require
issues), and wire a home-page import hook that parses files for inspection.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(import): extend pptxtojson-pro with PPTX → Slide[] pipeline
`importPptx` now turns a .pptx file directly into canvas `Slide[]`,
optionally uploading every base64 image and blob-backed media via a
caller-supplied OSS callback before resolving.
- Vendor OpenMAIC slide types and shapes config into `src/openmaic/`
so the bundled dist is self-contained and loadable via `/vendor/`
URL under Turbopack; add stubs for `resolveFont`, `getSvgPathRange`
and `parseVideoCodec` until the real PPTist helpers are ported.
- Move `import-pipeline/` under `src/` and re-export `importPptx`,
`parsedToSlides`, `OssUpload`, `ImportPptxOptions` and `CanvasSlide`
from the package main entry.
- Add `nanoid`, `katex` and `pptxtojson` as runtime deps of the package.
- Update `useImportPptx` to accept `upload` / `onImported` and return
the converted `Slide[]`.
- Document the new API surface, error semantics and Turbopack workaround
in the package README.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(slide-renderer): package skeleton (rollup + tsc + empty index)
Workspace package scaffolding: package.json with peer deps (react/react-dom/motion/tailwindcss),
rollup ESM+CJS config, tsconfig (strict, jsx react-jsx), and empty entrypoints under src/.
Verified: pnpm --filter slide-renderer build produces dist/{index,elements/index,types/index}.{js,cjs,d.ts}
(empty chunks are expected at this stage).
* docs(slide-renderer): DESIGN.md + README.md
* feat(slide-renderer): copy Slide/Element types + add effects types
* feat(slide-renderer): add utils (geometry simplified to elements API, element ranges, cn)
* feat(slide-renderer): shared element hooks (fill/outline/shadow/flip) + ElementOutline
* feat(slide-renderer): BaseTextElement
* feat(slide-renderer): BaseShapeElement + GradientDefs + PatternDefs
* feat(slide-renderer): pure <img> BaseImageElement, decouple OpenMAIC media business
The base component drops:
- useMediaGenerationStore / isMediaPlaceholder (AI media generation polling)
- useSettingsStore (imageGenerationEnabled toggle)
- useMediaStageId / retryMediaTask (classroom-scoped retry orchestration)
- useI18n (placeholder/error/disabled copy)
- skeleton / error / disabled render branches
Retains: clip / filter / outline / shadow / colorMask, output <img src={elementInfo.src}>.
Adds a `renderImage` slot so consumers can re-inject business behavior (placeholders,
retry buttons, custom src resolvers) without modifying the package.
* feat(slide-renderer): Line / Table / Latex / Code base elements
- Line + LinePointMarker: copied with stroke-draw animation intact
- Table + StaticTable + tableUtils: copied with getTableSubThemeColor moved to package utils
- Latex: katex HTML + legacy SVG fallback, no business deps
- Code: shiki-based syntax highlighting (dynamic import); shiki added as optional peer
dependency so consumers without code slides pay zero install cost
* feat(slide-renderer): BaseChartElement + Chart + chartOption (echarts as optional peer)
* feat(slide-renderer): pure <video> BaseVideoElement, decouple OpenMAIC media business
Drops:
- useCanvasStore (playingVideoElementId / pauseVideo)
- useMediaGenerationStore / useMediaStageId / retryMediaTask / getVideoMediaRefForElement
- useSettingsStore (videoGenerationEnabled)
- useI18n, motion/react animate scope
- skeleton / error / disabled / placeholder branches
Retains <video src controls preload=metadata>. Adds a `renderVideo` slot so
consumers can re-inject orchestrator-driven playback or placeholders.
* feat(slide-renderer): canvas hooks (useSlideBackgroundStyle, useViewportSize simplified)
- useSlideBackgroundStyle: copied as-is (no business deps)
- useViewportSize: rewritten to take viewportSize/Ratio/canvasPercentage as args,
drop useCanvasStore, drop editor-only canvasDragged/dragViewport, return fitScale
instead of writing to a store
* feat(slide-renderer): 4 effect overlays (Highlight/Spotlight/Laser/Zoom), props-driven
All overlays now receive element/geometry/options through props instead of reading
useCanvasStore. SpotlightOverlay uses a configurable element-id prefix
(default 'slide-element-') to locate DOM nodes for measurement, matching the
convention SlideElement will set in T14.
HighlightEffectOptions extended with color/opacity/borderWidth/animated to surface
the original visual knobs through the public API.
* feat(slide-renderer): SlideElement dispatcher with renderImage/renderVideo slots
* feat(slide-renderer): SlideCanvas v1 main entry (props-driven, auto-fit viewport)
Mirrors ScreenCanvas structure but reads from props: slide.elements, slide.theme,
props.background ?? slide.background, props.scale ?? autoFit, props.effects.
Auto-fits viewport into container by default via useViewportSize+ResizeObserver;
pass scale=1 to opt out and render at slide-native dimensions.
* feat(slide-renderer): SlideRendererProvider + useSlideContext (props or context)
SlideCanvas now reads from context as a fallback when props are omitted. Allows
the wrap-then-compose pattern from spec §3.2: provider holds shared data,
sibling overlays read via useSlideContext.
* feat(slide-renderer): aggregate public exports
Main entry exposes SlideCanvas, SlideElement, Provider/hooks, effects, hooks,
utils. `slide-renderer/elements` re-exports all 9 Base*Element + shared
ElementOutline/useElementXxx for granular composition. `slide-renderer/types`
already lived in src/types/index.ts.
* docs(slide-renderer): complete README (install / quickstart / API / effects / Tailwind setup)
* feat(demo): /slide-renderer-demo route exercising the workspace package
Hand-written single Slide with shapes + text demonstrates the v1 API end-to-end:
- props-driven SlideCanvas
- auto-fit viewport via parent container
- gradient background, shape outline + text fill
Wires slide-renderer as a workspace dep and registers its dist as a Tailwind
@source so utility classes inside the package get picked up by the host PostCSS
pipeline.
* feat(pptxtojson-pro): align imported Slide JSON with renderer contract
- Drive `viewportWidth` from the deck's actual pixel width (json.size.width
× ratio) instead of the legacy 960 default, so 16:9 widescreen decks no
longer get text element widths clamped to 4:3 dimensions (e.g. titles
truncated to 842px and forced to wrap). Per-slide `viewportSize` now
reports the same value, keeping transform-time and render-time aligned.
- Replace the pass-through font STUB with real resolution: 22-font
self-hosted whitelist + alias map (微软雅黑/等线/宋体/楷体/仿宋/Arial/etc.)
→ 5-category primary font mapping, so unknown PPT fonts fall back to a
rendered open-source equivalent and the pipeline can surface the
replacement via `replacedFonts.fallback`.
- Translate cell `vAlign` from PPT-native (`up`/`mid`/`down`) to CSS-native
(`top`/`middle`/`bottom`) at the importer boundary, so the renderer can
transparently pass it through to `vertical-align` / `justify-content`
without per-component conversion.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(slide-renderer): drop Tailwind defaults, data-drive styles, ship fonts
Three intertwined changes that together make the package self-contained
and align it with the "slide JSON is the single source of visual truth"
contract.
1. Remove Tailwind utility classes from every element renderer.
- Replace `className="absolute ..."` / `className="rounded ..."` etc.
with inline `style={{ position: 'absolute', borderRadius: ... }}`.
- The few rules that can't be expressed inline (descendant selectors,
keyframes, browser-default <p> margin reset) move to a new
`src/styles.ts` injected once by `<SlideCanvas>` via `<style>`.
Named animation classes (`slide-renderer-pulse` / `-ping`) replace
`animate-pulse` / `animate-ping` so consumers don't need Tailwind.
2. Strip renderer-level positive defaults; surface them as data fields.
- `BaseTextElement`: drop hardcoded `overflowWrap: 'break-word'` and
the `paragraphSpace ?? 5` fallback. `--paragraphSpace` is only set
when defined in data; CSS `var()` fallback is 0.
- `StaticTable`: drop hardcoded `padding: '5px'`, `verticalAlign:
'middle'`, `wordBreak: 'break-word'`. Extend `TableCell` with
`padding?: string` and `vAlign?: 'top' | 'middle' | 'bottom'` so
PPT-extracted padding / vertical alignment flow through unchanged.
- `PPTTableElement` gets `rowHeights?: number[]` (per-row min-height;
content can still grow rows).
- Reshape `<td>` to match the classroom Vue layout: outer `<td>` carries
only border + textStyle; inner `slide-renderer-cell-text` <div> is
a flex column with `min-height = rowHeight - 4`, `padding =
cell.padding`, `line-height: 1`, `justify-content` from `cell.vAlign`.
Add `.slide-renderer-cell-text p + p { margin-top: 0.4em }` to give
adjacent paragraphs breathing room without breaking the reset.
3. Self-contained font shipping.
- Move the 22 woff2 files into `packages/slide-renderer/fonts/`.
- Ship a sibling `fonts.css` with @font-face declarations using
relative `./fonts/<name>.woff2` URLs.
- Expose both via `package.json` exports (`./fonts.css`, `./fonts/*`)
and the `files` array.
- Consumer adds one import (`import 'slide-renderer/fonts.css'`); the
bundler resolves the relative URLs against the package and emits
each woff2 as a static asset. Removes the dependency on consumer-
owned `app/globals.css` @font-face blocks and `public/font/` copies.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(demo): wire slide-renderer fonts and swap demo to a table-heavy slide
- Import `slide-renderer/fonts.css` in the root layout so consumer apps
pull the package's self-hosted @font-face declarations and woff2 assets
through Next.js' static-asset pipeline.
- Replace the hardcoded `demoSlides` array (24 mixed-element slides) in
`/slide-renderer-demo` with a single 5×7 table-heavy slide so the demo
exercises the new `TableCell.padding` / `TableCell.vAlign` /
`PPTTableElement.rowHeights` fields and the flex-based cell layout.
Convert the legacy `vAlign: 'up' | 'mid' | 'down'` values to the
CSS-native `'top' | 'middle' | 'bottom'` form the renderer now expects.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(slide-renderer): add slideToPng standalone snapshot util
Exposes a new `slide-renderer/snapshot` sub-export with `slideToPng(slide,
options)`, the foundation for the AI-driven visual diff loop (snapshot
the rendered slide, compare against PowerPoint's own PNG export, decide
whether a discrepancy belongs to the import algorithm or the renderer).
Implementation notes
- Mounts `<SlideCanvas>` into an off-screen container sized exactly to
the slide's native pixels, so `useViewportSize` collapses to a 1:1
render (no scale offset).
- `flushSync` for the initial commit so the snapshot doesn't fire on an
empty container; `requestAnimationFrame` × 2 to let the ResizeObserver
settle; then waits for `document.fonts.ready` and every `<img>` in the
container (with a configurable `timeoutMs`, default 5s).
- Snapshots the SlideCanvas root (`container.firstElementChild`) rather
than the outer wrapper — html2canvas-pro's bounding-box math otherwise
leaves white edges or drops absolutely-positioned children.
- Uses `html2canvas-pro` instead of `html-to-image`: the latter's SVG
`<foreignObject>` path loads embedded woff2 asynchronously, so the
drawImage fires before fonts decode and text re-wraps in the fallback
font. html2canvas-pro walks the DOM and inherits the parent document's
font registry, keeping wrap positions identical to the on-screen render.
- `onclone` hook injects a small CSS reset (`font-kerning: none`,
`font-feature-settings: normal`, `font-variant-east-asian: normal`,
`text-rendering: geometricPrecision`) scoped to the slide tree, to
prevent html2canvas-pro's CJK text measurement from clipping
full-width punctuation (e.g. `(` / `)`) past cell boundaries.
- Default `pixelRatio` follows `window.devicePixelRatio` for retina-sharp
output; consumers can override.
- Optional `debugVisibleMs` briefly shows the off-screen container after
snapshot so callers can compare what was captured vs the live render.
Wiring
- Sub-export added to `package.json` (`./snapshot`) and Rollup `entries`
for tree-shaking — apps that don't use snapshot don't pay the
`html2canvas-pro` bundle cost.
- Demo route adds an "导出 PNG" button that calls `slideToPng` on the
active slide and triggers a browser download.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: build slide-renderer in root postinstall
Without this, fresh installs leave packages/slide-renderer/dist
missing and Next.js fails to resolve the `slide-renderer` import.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(parser+renderer): iteration-0601-002 fidelity fixes
Parser (pptxtojson-pro):
- shapeSerializer: stop painting parent fill on grpFill children; honor
explicit <a:ln><a:noFill/></a:ln> over theme lnRef (master logo dots
were rendering as visible green rings).
- imageSerializer: detect custGeom ellipses and 8-vertex chamfered-rect
photo frames; resolve to 'ellipse'/'octagon' instead of falling back
to 'rect'.
- textSerializer: emit text-shadow from rPr effectLst > outerShdw, and
compensate the half-leading PowerPoint puts above the first line for
unitless lnSpc > 1 (cover-title gap regression).
- border/tableSerializer: pass rgba()/hsla() colors through ensureHex
untouched so '#rgba(...)' never reaches the DOM.
- transformParsedToSlides: drop the 1.1 SAFE_PADDING wrap-fudge and
thread bodyPr@anchor through as vAlign.
- font config: add 思源黑体/思源宋体 + Source Han aliases and a trailing
region/weight suffix stripper so 'SourceHanSerif CN Light' resolves.
Renderer (slide-renderer):
- SlideCanvas: new chrome prop (default true) to opt out of the
preview-only card shadow + rounded corners; snapshot pipeline passes
false so html2canvas output matches PPT edges.
- BaseTextElement: flex-column + justifyContent driven by the new
vAlign field; width/height stay 100% so the box anchors correctly.
- BaseImageElement: maxWidth/maxHeight 'none' to prevent host CSS from
shrinking absolutely-positioned <img>.
- snapshot: render with chrome=false.
Docs: SKILL.md expanded with the iteration workflow + OOXML traps.
* fix(parser+renderer): iteration-0605-001 fidelity fixes
slide-renderer:
- PPTImageElement: add `softEdge` field (feather radius that fades image
alpha to transparent at every edge, per a:softEdge@rad).
- TableCell: add per-side `borders` so cells with partial dividers render
each side independently instead of falling back to the table-level
uniform outline.
- BaseTextElement: hoist `fill`/`opacity` to the outer wrapper so the
background covers the full shape rectangle, matching PowerPoint behavior
for short text inside tall shapes.
- Misc tweaks across image/latex/shape/video base elements, StaticTable
and the standalone snapshot util.
pptxtojson-pro:
- Parser/serializer fidelity improvements for text, math, image, shape
and table (notably ~500 lines in textSerializer and ~127 in
mathSerializer).
- Refinements in GroupNode, MathNode and ShapeNode models; richer Theme,
StyleResolver and RenderContext plumbing.
- Expanded shape presets and customGeometry utilities, plus adapter and
import-pipeline updates to surface the new fields.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: stop tracking local slide-renderer-demo sandbox
`app/slide-renderer-demo/page.tsx` is a personal scratchpad used for
ad-hoc rendering tests; it shouldn't ship with the package. Remove it
from the index (file stays on disk locally) and ignore the directory so
future tweaks don't show up in `git status`.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: rename packages pptxtojson-pro→maic-import and slide-renderer→maic-renderer
Align workspace package names with the MAIC product family:
packages/pptxtojson-pro → packages/maic-import
packages/slide-renderer → packages/maic-renderer
Functional references updated end to end:
- Root package.json: workspace deps + postinstall/sync scripts
- next.config.ts: transpilePackages
- app/globals.css: Tailwind `@source` for renderer dist
- app/layout.tsx: `maic-renderer/fonts.css` import
- lib/import/use-import-pptx.ts: imports + runtime URL
(`/vendor/maic-import/index.js`) + script comment
- scripts/sync-maic-import.mjs: renamed and pointed at the new dist
- .gitignore: vendor path and sync-script comment
- Package package.json `name` fields and cross-link in READMEs
Also re-include the gitignored `app/slide-renderer-demo/` in Tailwind's
source detection via an explicit `@source` so its classes (e.g.
`bg-violet-600`) keep getting generated — Tailwind v4 skips gitignored
paths by default, which was making the demo's import button render
white-on-white after the demo was excluded from version control.
CSS class names (`slide-renderer-prose` / `slide-renderer-cell-text` /
`slide-renderer-pulse` / `slide-renderer-ping` / `slide-renderer-code-
cursor-blink`) and internal source comments that still reference the old
package names are intentionally left untouched to keep the rename
diff minimal; they can be updated separately as the codebase evolves.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(dsl): extract @maic/dsl contract package and adopt @maic/* scope
Establish the SDK family's contract keystone and align package naming with
the planned @maic/* scope, per PR #668 review.
1. New @maic/dsl package (packages/maic-dsl)
- Pure, zero-runtime-dependency spec: the canonical slide object model,
pure type-guards, and DSL version/migration scaffolding.
- Seeded from lib/types/slides.ts but reconciled into a *superset* of the
three previously-drifted copies (app / renderer / importer); merged
fields are annotated @since-merge. README documents the divergence and
the acyclic dependency arrows (renderer/importer -> dsl -> nothing).
- Enums are regular (not const) so consumers compiling with
isolatedModules can import them across the package boundary (TS2748).
2. Wire @maic/importer to @maic/dsl
- Import all slide types from @maic/dsl; delete the vendored
openmaic/types/slides.ts copy.
- Eliminate the Slide drift at the root: transformParsedToSlides now fills
viewportSize/viewportRatio/theme at construction and emits a complete
DSL Slide, removing the partial "draft slide" + post-fill step in
parsedToSlides (no DraftSlide type needed).
- Add @maic/dsl to the root postinstall build chain before the importer.
3. Adopt @maic/* scope (agent-noun names)
- maic-import -> @maic/importer
- maic-renderer -> @maic/renderer
- Update all package-name references (deps, app imports, transpilePackages,
fonts.css subpath import, Tailwind @source node_modules path, READMEs).
- Directory names and /vendor paths are intentionally left unchanged.
Note: @maic/renderer still vendors its own slide types; wiring it to
@maic/dsl is the next step.
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(renderer): consume slide types from @maic/dsl, drop vendored copy
Wire @maic/renderer to the @maic/dsl contract keystone, completing the
de-duplication of the slide object model across the SDK family.
- Delete packages/maic-renderer/src/types/slides.ts (the vendored copy) and
repoint all ~30 internal imports at @maic/dsl. SlideElement's runtime
`ElementTypes` value import now resolves to the DSL enum.
- Re-export the DSL types from src/types/index.ts so the public
`@maic/renderer/types` entry keeps exporting the full slide contract
(alongside the renderer-only effect types).
- Add @maic/dsl as a regular dependency and mark it external in the rollup
build so consumers share a single copy (enum not inlined); the emitted
.d.ts references @maic/dsl directly.
@maic/dsl is a superset of the renderer's former types, so this is
non-breaking; the renderer additionally gains `script` and the
importer-origin fields it didn't previously declare.
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(renderer): serve fonts from OSS, drop the 43.6MB bundled woff2
Move the 22 CJK fonts off the repo and onto object storage to fix the
PR #668 blocking repo-weight concern.
- fonts.css now points every @font-face src at
https://file.maic.chat/fonts/<name>.woff2 instead of bundled local files.
- Extract the CDN origin + font whitelist into fonts.config.mjs (single
source of truth) and generate fonts.css from it via
scripts/generate-fonts-css.mjs. `genfonts` runs first in the build, so the
CSS always reflects the config; changing the domain is now a one-liner.
- Delete packages/maic-renderer/fonts/*.woff2 (22 files, ~43.6MB) and drop
the now-unused "./fonts/*" export and "fonts" files entry from package.json
(fonts.css is kept).
Font names are unchanged, so consumers and the importer font whitelist are
unaffected. Note: this removes the files going forward only; purging them
from git history (LFS / filter-repo) is a separate follow-up.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(home): gate the unwired PPTX import button behind a feature flag
The PPTX import flow is still scaffolding — `useImportPptx` has no
`onImported` consumer, so clicking it only logs the parsed slides. Hide both
PPTX import entry points (and the hidden file input) behind
NEXT_PUBLIC_ENABLE_PPTX_IMPORT (default off) so the UI doesn't expose a
no-op. The classroom import button is unaffected.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(import): harden the runtime URL-loaded PPTX parser
The PPTX parser is loaded at runtime from /vendor/maic-import/index.js — a
gitignored artifact synced into public/vendor during postinstall. If a deploy
skips that step the URL 404s and import() fails with an opaque SyntaxError
(404 HTML parsed as JS). Add guards on both ends plus docs.
- Build-time assertion: scripts/assert-vendor-maic-import.mjs verifies the
bundle exists and is non-empty; wired into `build` so a misconfigured deploy
fails early with an actionable message instead of shipping a broken runtime.
- Runtime guard: use-import-pptx.ts HEAD-probes the URL before import() and,
on a non-ok response, throws a clear error surfaced to the user via the new
import.error.parserUnavailable string (added to all 6 locales).
- Docs: document the postinstall deploy dependency and the pull-without-install
type/runtime drift in @maic/importer's README.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: unify the @maic/* license policy to AGPL-3.0
Pick one license for the SDK family and apply it uniformly, matching the
OpenMAIC root, per PR #668 review.
- @maic/dsl and @maic/importer: relicense MIT -> AGPL-3.0 (package.json +
full AGPL-3.0 LICENSE text).
- @maic/renderer: already AGPL-3.0; add the LICENSE file its package.json
`files` already referenced.
@maic/importer is derived from pptxtojson (MIT); MIT permits relicensing a
derivative under AGPL, and the upstream MIT attribution is retained in the
package README/index.html, so this is compliant.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: rename packages/maic-import dir to maic-importer
Align the importer's directory with its @maic/importer package name and the
maic-* sibling dirs (maic-dsl, maic-renderer). Package name is unchanged, so
imports/transpilePackages/node_modules resolution are unaffected.
- git mv packages/maic-import -> packages/maic-importer (history preserved).
- Rename the vendor sync/assert scripts and the runtime vendor path to match:
scripts/{sync,assert-vendor}-maic-importer.mjs, public/vendor/maic-importer,
URL /vendor/maic-importer/index.js.
- Update all path references: root postinstall/build/sync scripts, .gitignore,
use-import-pptx.ts, and doc links in the dsl/renderer/importer READMEs.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: nest the @maic packages under packages/@maic/
Mirror the @maic/* npm scope in the directory layout: move the three family
packages into packages/@maic/{dsl,importer,renderer}. Package names are
unchanged, so imports / transpilePackages / node_modules resolution are
unaffected.
- git mv packages/maic-{dsl,importer,renderer} -> packages/@maic/* (history
preserved).
- pnpm-workspace.yaml: add packages/@maic/* glob.
- Recompute the root postinstall cd chain for the nested layout.
- Update dir-path references: sync script srcDir, .gitignore comment, the dsl
source comment, and the renderer/importer README/SKILL cross-links.
Unchanged: the @maic/* package names, the runtime vendor path
(public/vendor/maic-importer) and its sync/assert scripts.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(renderer): clear font licenses, drop non-redistributable faces, remove importer font remapping
Address the PR #668 blocking font-license-clearance review.
Font licensing (renderer):
- Reduce the self-hosted whitelist to 6 clearly-redistributable faces:
SourceHanSans/SourceHanSerif/LXGWWenKai/ZhuQueFangSong (SIL OFL 1.1),
ZcoolHappy (ZCOOL free-use), WenDingPLKaiTi = AR PL KaitiM GB (Arphic PL 1999).
- Drop AlibabaPuHuiTi: free to *use* commercially but its license grants no
explicit redistribution/re-host right, unlike OFL — dropped to keep public
CDN serving unambiguous.
- Add FONTS.md (per-face attribution/clearance record, separate from the
package's AGPL LICENSE) and bundle the verbatim license texts under
font-licenses/ (OFL.txt, ZcoolHappy-LICENSE.txt, ARPHIC-PL.txt); ship both via
package.json `files`. Regenerate fonts.css from the trimmed config.
Importer font remapping removed:
- The importer no longer rewrites font-family names (alias -> category ->
primary). It passes each slide's original font-family through unchanged, so
it can never target a face the renderer doesn't ship. Delete configs/font.ts,
the resolveFont/replaceFontFamilyInHtml helpers, and the now-unused
FontReplacementBucket / ImportContext.replacedFonts plumbing.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(renderer): document the CDN font runtime dependency
Add a "Fonts" section to the renderer README per PR #668: the optional
`@maic/renderer/fonts.css` loads woff2 from an external host
(https://file.maic.chat), which must be reachable + CORS-enabled or the
browser silently falls back to system fonts. Note that the import is optional
and that the origin is configurable via fonts.config.mjs + `pnpm run genfonts`.
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs(renderer): verify WenDingPLKaiTi == AR PL KaitiM GB from the font name table
Record the embedded-name-table evidence (Family/Copyright/Trademark/Designer =
Arphic, nameID 13 = the full Arphic Public License) so the
WenDingPLKaiTi ⇄ AR PL KaitiM GB correspondence is provable, and correct the
copyright year to 1994–1999 to match the font metadata.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: fix `pnpm check` (prettier) after merging main
main added a `prettier . --check` CI step that flagged 180 files. Resolve it
consistently with the existing convention (vendored/workspace packages are
excluded from root Prettier):
- .prettierignore: exclude `packages/@maic/` (own rollup/tsc/eslint toolchains;
dist is generated, importer/src1 is a vendored oracle), matching how
pptxgenjs / mathml2omml / docs are already handled.
- Format the three root-level files we added/edited that root Prettier does
cover: lib/import/use-import-pptx.ts and the two scripts/*-maic-importer.mjs.
`pnpm check` now passes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* style: align @maic/{dsl,renderer,importer} source to root Prettier
Per review preference, the @maic packages are our own code and should follow
the repo style rather than be ignored wholesale. Narrow .prettierignore to only
the generated build output (packages/@maic/*/dist/) and the vendored legacy
reference (packages/@maic/importer/src1/), then `prettier --write` the package
sources. Formatting-only; all three packages still build.
`pnpm check` passes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(lint): scope ESLint to @maic source and clear all errors
- eslint.config.mjs: replace blanket packages/** ignore with precise
rules so @maic/{dsl,importer,renderer} source is linted, while skipping
third-party packages, dist output, importer/src1 and public/vendor
(the generated bundle was producing thousands of false errors in CI).
- importer: replace `any` with concrete narrowings/types, fix prefer-const.
- renderer: drop manual useMemo that React Compiler could not preserve.
- remove leftover debug console.log + stale eslint-disable in use-import-pptx.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(i18n): add missing PPTX import keys to pt-BR
pt-BR.json was missing import.{pptx,parsingPptx,pptxSuccess} and
import.error.{invalidPptx,parserUnavailable}, failing the i18n key
alignment check against en-US.json.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>