Skip to content

Releases: OpenPresentation/opf-editor

@openpresentation/opf-editor 0.25.3

Choose a tag to compare

@github-actions github-actions released this 22 Oct 06:10
4f66349
  • RR-98: the source pane's Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z (Ctrl+Y) now undo and redo a pane.replaceDocument load, and replaceDocument keeps the original YAML or Markdown text. The keys first undo the text typed in the pane with CodeMirror's history (which a load, and a session Undo, Redo or restore, now clear); when that has nothing left they step the session over the whole-document replace, as the Undo and Redo buttons do, so the previous text comes back byte for byte (an edit made elsewhere stops the key). replaceDocument(document, { source, format }) accepts source as JSON, YAML or Markdown text (format says which; inferred as the first of JSON, the pane's format, YAML and Markdown that reads as exactly the document) and shows those bytes, comments included, in a pane in that format, in Undo and Redo and when the format is switched to it; a source that is not this document is ignored and an unknown format throws a TypeError. mountJsonCodeEditor gains historyFallback, resetHistory() and undoDepth().

@openpresentation/opf-editor 0.25.2

Choose a tag to compare

@github-actions github-actions released this 22 Oct 04:21
8f6657f
  • RR-98: closing the presenter before the browser answered its full screen request no longer leaves the page in full screen behind a hidden presentation. A quick Esc or close, or F5 followed straight by Esc, ran stop() while the request was still pending, so there was no full screen to leave; the request then resolved and the page stayed full screen with nothing shown (and, in Chromium on macOS, the window stuck in a state where the page took no clicks until the next exit). The presenter now exits full screen as soon as a late request resolves for a presentation that was already closed, and returns focus to the opener afterwards.

@openpresentation/opf-editor 0.25.1

Choose a tag to compare

@github-actions github-actions released this 22 Oct 00:32
f6c7bfc
  • RR-98: opening a document no longer forks its catalog records. Loading an example over another (a host's example menu), File > Open, the gallery handoff and restoring a stored copy replaced the document with an applyPatch that the fork-on-edit rule read as an edit of the catalogs.default records the two documents share, so slide layouts became cover-custom, text-custom and so on and the picker showed "Current draft". The session has a first-class editor.replaceDocument(input, meta?) (one undoable change that is never read as a catalog edit) and the source pane has pane.replaceDocument(document, { source, name }), which keeps the opened JSON as written and brings each document's text back exactly on Undo and Redo, also in YAML and Markdown. The playground's Open as a presentation, the gallery handoff and createPersistence's restore() use it. applyPatch still forks an edited record.

@openpresentation/opf-editor 0.25.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 18:21
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.

@openpresentation/opf-editor 0.24.3

Choose a tag to compare

@github-actions github-actions released this 21 Oct 10:18
c2beb4f
  • RR-98: @openpresentation/opf-editor/presenter adds createPresenter (full screen through the Fullscreen API with a fixed-overlay fallback, slides drawn with the canvas's renderer, fonts handle and catalogs and letterboxed on black, the neighbors drawn ahead; Right, Space, PageDown, Enter, Left, PageUp, Backspace, Home, End, Esc, click zones and touch swipes; hidden slides skipped as the exports skip them; a "03 / 12" counter on pointer move; onExit(index) and onSlideChange(index); role="dialog", a focus trap and an aria-live announcement), createPresentButton (an icon-only "Present" button, title "Present (F5)", styled like the Export trigger) and bindPresentShortcut (F5, ignored while typing). @openpresentation/opf-editor/read-deck-file adds readDeckFile(file | { name, text }) (JSON, YAML or Markdown by extension, with fallbacks, through core's fromYaml and fromMarkdown; returns { document, format, name, findings } and throws a typed DeckFileError) and DECK_FILE_ACCEPT for <input accept>. The example playground has a Present button next to Export, and its Import file tab and drop zone read .yaml, .yml and .md through readDeckFile. The styles are src/styles/presenter.css, in styles.css.

@openpresentation/opf-editor 0.24.2

Choose a tag to compare

@github-actions github-actions released this 20 Oct 22:07
9672a38
  • RR-98 source pane: JSON now has live completions while you type (completions: true by default; completions: false keeps the field menu only), offering the property names the schema allows at the cursor's object and the enum, boolean and catalog values of the field, from the same data as the field menu (getJsonCompletions in /json-options; mountJsonCodeEditor takes the same completions option, off by default there; Ctrl+Space still opens the field menu). When the session refuses a draft the pane lists every issue of the rejection, each with its JSON pointer path and line, instead of only the first. The code editor no longer draws the standalone editor's border and radius inside the pane frame. The editor sets aria-invalid while the findings include an error (a syntax error, a refused draft or the session's own errors) and clears it with them.

@openpresentation/opf-editor 0.24.1

Choose a tag to compare

@github-actions github-actions released this 20 Oct 19:33
ebdd085
  • RR-98: @openpresentation/opf-editor/styles.css, one stylesheet for the editor panels. npm run build generates dist/styles.css from src/styles/*.css (the --opf-ui-* token layer first, then the other files in alphabetical order; plain CSS, no preprocessor, nothing fetched). The tokens (surfaces, text, one ink-blue accent, borders, status colors, type, radii, control height, shadow and motion) apply on :root and .opf-ui, light by default and dark under .dark .opf-ui, .opf-ui.dark and [data-theme="dark"]; .opf-ui[data-density="touch"] makes controls 40px. The design controls, review, slide manager, find, fill template, numbering, chart options, data grid, crop, custom layout editor, JSON editor and restore banner are styled with the tokens only, and the block controls on the canvas follow the theme through CSS variables with their old values as fallbacks. The playground now loads the stylesheet and keeps only its page layout. See the README section "Styling and theming (RR-98)".
  • RR-98: createExportMenu (@openpresentation/opf-editor/export-menu), the Export menu of the playground redesign: a button and a grouped role="menu" (Slides: PowerPoint, PDF, SVG, PNG; OPF source: JSON, YAML, Markdown; For an agent) with a mobile bottom-sheet mode (mode: "sheet"), density: "touch", items to hide groups or formats and setDisabled(reason). PDF, PNG and SVG use convert; PowerPoint is injected as exportPptx(deck, { signal, onProgress }) because the editor does not import @openpresentation/opf-pptx; YAML and Markdown use core's toYaml and toMarkdown and report their notes. Progress, Cancel (an AbortController), a success or failure line announced through aria-live, and downloads through a Blob link or onDownload are built in. buildAgentHandoff(document, { target, fileName, specUrl, agentGuideUrl }) (/agent-handoff) writes the prompt for a coding agent (install the CLI, npx opf validate, npx opf convert, report, with the exact deck JSON), and createAgentHandoffDialog (/agent-handoff-dialog) is its modal (target switch, Copy prompt, focus trap). The playground's separate PowerPoint and PDF / PNG / SVG dialogs are replaced by the menu. Styles: src/styles/export-menu.css and src/styles/handoff.css, --opf-ui-* tokens only.
  • RR-98: @openpresentation/opf-editor/slide-navigator (createSlideNavigator: previous and next buttons around a zero-padded "01 / 03" counter, arrow-key and optional page-level bindKeys navigation, disabled ends, comfortable or touch density) and @openpresentation/opf-editor/thumbnail-strip (createThumbnailStrip: lazy, cached real slide renders with a mono index and title, aria-current and an accent ring on the active slide scrolled into view, horizontal or vertical). The thumbnail cache moved from the playground example into @openpresentation/opf-editor/thumbnail-cache with the same behavior and a new prepare(deck, indices) that renders only the listed slides. The playground shows both under the slide, next to the existing slide list. Styles: src/styles/navigator.css and thumbnails.css, on the --opf-ui-* tokens.
  • RR-98: createSourcePane (@openpresentation/opf-editor/source-pane), the OPF source as JSON, YAML or Markdown with a renamable file name, a real format menu, Format, Copy and Download, line numbers and a collapsible findings list under the code whose rows move the cursor to their line (focusPath). JSON keeps its authored bytes; YAML and Markdown use core's converters, and every edit reaches the editor session as a patch. Markdown parts with no syntax (a design, region keys) and YAML comments that a rewrite drops are reported as warning findings, never silently. mountJsonCodeEditor gains language (json, yaml, markdown), readOnly, setLanguage and setReadOnly, and no longer throws when an outside update follows deleting the whole text. Adds @codemirror/lang-yaml.

@openpresentation/opf-editor 0.24.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 04:36
404afdb
  • RR-96: adopts @openpresentation/gallery 4.0.0 (^4.0.0, still a development dependency; hosts register the catalog): the default catalog has no dark theme (a dark deck is a theme with a dark design.variant, for example { "theme": "classic", "variant": "dark1" }), and minimal, classic and bold carry variants. The editor's behavior is unchanged; its tests select bold or minimal, or classic with a dark variant, where they used the dark theme.

@openpresentation/opf-editor 0.23.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 19:21
fe0aa34
  • RR-96: chart colors. setChartOptions and prepareChartOptions accept colors (chart.colors, the colors by position: a hex color, a scheme slot such as accent3 that keeps following the deck, or a var: color variable; null or "" leaves a position to the deck palette; null for the whole value removes the field; at most 24, CHART_COLORS_MAX), as one undoable patch. readChartOptions reports colors (what a position means: the plotted series, the slices or rows of a pie, doughnut, treemap or funnel, or the colors of a histogram, pareto or waterfall, and the scheme slots to offer) and state.colors. The chart options panel gains a "Colors" group with the deck's accent swatches, a "Default" choice and a hex field per position, and "Reset to deck palette". New /color-slots entry point: readSchemeSlots reads the deck's resolved scheme slots for swatches. The opf-render preview draws chart.colors once opf-render#256 lands.
  • RR-96 (needs core 0.23 for design.variant): color variant pickers. New /design-variants entry point: setDesignVariant and prepareDesignVariant set design.variant (a background slot light1, light2, dark1 or dark2, written as the slot name, or { background, accents } when the six accents are reordered; null removes it) at the deck or on one slide with slideIndex, as one undoable patch, with clearSlideOverrides and a shadowed list for the slides whose own variant or theme-slot background hides a deck change; readDesignVariant reads the own and the effective variant (core's resolution) and variantSwatches the four variants as colors built from the deck's own scheme slots, like PowerPoint's Variants gallery; normalizeVariant validates. The design controls gain a "Color variant" section (four swatches, "Same as presentation" on a slide, an accent order control and "Reset accent order"); the editor imports core's normalizeColorVariant, so it needs core 0.23. The preview and the PowerPoint export read the variant from core's roles.

@openpresentation/opf-editor 0.22.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 05:10
30ae52e
  • RR-93: table cells take a bold style, so a number cell can be bold without rich runs, which dropped the column's number format and alignment. setTableCellStyle(editor, tablePath, cell, { bold: true }) sets it (null removes it, a non-boolean is refused), a table style keeps it, and the design panel's table section has a Bold checkbox beside the cell fill and alignment. Needs core 0.22.0 (TableCellStyle.bold); the core floor is now ^0.22.0.
  • RR-95: README note that the chart options panel edits highlight as its only color-related setting and the editor has no chart.colors control yet (a known gap); chart.colors is set in the document directly.
  • RR-87: the example playground forwards a refused canvas commit to autosave, so an invalid active draft reports a persistence error and still warns before leaving even when the stored document is unchanged. This changes the example host integration only; library APIs and npm payloads are unchanged.