Skip to content

@openpresentation/opf-editor 0.25.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 18:21
· 7 commits to main since this release
b48042c
  • RR-99 (needs core with FA-33): the layout editor, createLayoutEditor from @openpresentation/opf-editor/layout-editor, a Figma-style GUI for building one layout record (direction plus an ordered regions list of regions and splits). It is a tool palette (Select V, Split into a row R, Split into a column C, Insert region I, Heading regions T, Hand H or Space, Preview P), a canvas (a 16:9 frame with drag-to-resize dividers that snap and show their ratio, double-click to equalize, drag to reorder or move between splits with drop indicators, Delete that collapses a one-child split, and a context menu with wrap in row or column, unwrap, duplicate, delete and rename), a layers tree (role="tree") and an inspector for the layout, splits and regions (auto only in a column, inherited anchors shown as inherited, accepts chips). Core validates live (opf/layout-template and opf/layout-region) and the findings are highlighted on the canvas and in the layers; the editor has its own undo and redo, where one drag is one step; Preview draws sample content with the host's toSvg and fonts handle, or a wireframe. The parts are exported separately (createLayoutToolPalette, createLayoutCanvas, createLayoutTree, createLayoutInspector, createLayoutModel), with getRecord, setRecord, onChange, saveToDeck(editor) (through saveCustomLayout, which now takes { replace: true } to edit a layout the deck already has) and applyToSlide(editor, slideIndex). The pure tree operations are @openpresentation/opf-editor/layout-tree. Keyboard: arrows between siblings, Enter into a split, Esc up, [ and ] to reorder, Cmd or Ctrl+D to duplicate, arrows on a divider; touch density uses 40px controls. The playground has a Layouts view that uses it. This replaces openCustomLayoutEditor (/custom-layout-editor), which is removed with no alias.
  • FA-33 (needs core with FA-33; no editor code changes): the development and test dependency @openpresentation/gallery moves from ^4.0.0 to ^5.0.0 (theme variants, layouts as one list of regions, catalog schema 4), so the suites and the playground read Gallery 5's records. The published package declares no runtime dependency on Gallery; hosts still register the catalogs they choose.
  • FA-33 (needs core with FA-33): layouts are one direction plus an ordered, nestable regions list instead of the areas grid with columns, rows and a regions map. The custom layout editor (openCustomLayoutEditor) now edits that list instead of painting a grid: regions in reading order, each with its name, size and rules (accepted kinds, role, flow), move up and down, remove, a Split button that nests regions the other way for two dimensions, a direction choice, and a live structure preview. layoutFromGrid is replaced by layoutFromRegions (a direction, an optional inherited anchor, and the region and split entries, all checked). The layout picker draws a nested diagram of the record's regions and splits, layoutRegionSummary recognizes a template by its region list, and a gallery layout item is imported in the new form. Slide rendering and PPTX export do not change.
  • RR-98: createPresentButton takes variant: "quiet" | "primary" (and the button has setVariant). The default is now "quiet": a transparent icon button like the toolbar's undo and redo, with the icon in --opf-ui-muted-fg and a hover to --opf-ui-fg on --opf-ui-muted, the same control height and focus ring, so a lone icon next to a primary Export does not compete with it. variant: "primary" keeps the previous filled accent look of the Export trigger. The disabled state, aria-label and title are unchanged.