Repository navigation
Releases: OpenPresentation/opf-editor
Releases · OpenPresentation/opf-editor
Release list
@openpresentation/opf-editor 0.25.3
- RR-98: the source pane's Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z (Ctrl+Y) now undo and redo a
pane.replaceDocumentload, andreplaceDocumentkeeps 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 })acceptssourceas JSON, YAML or Markdown text (formatsays 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; asourcethat is not this document is ignored and an unknownformatthrows aTypeError.mountJsonCodeEditorgainshistoryFallback,resetHistory()andundoDepth().
@openpresentation/opf-editor 0.25.2
- 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
- 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
applyPatchthat the fork-on-edit rule read as an edit of thecatalogs.defaultrecords the two documents share, so slide layouts becamecover-custom,text-customand so on and the picker showed "Current draft". The session has a first-classeditor.replaceDocument(input, meta?)(one undoable change that is never read as a catalog edit) and the source pane haspane.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 andcreatePersistence'srestore()use it.applyPatchstill forks an edited record.
@openpresentation/opf-editor 0.25.0
- RR-99 (needs core with FA-33): the layout editor,
createLayoutEditorfrom@openpresentation/opf-editor/layout-editor, a Figma-style GUI for building one layout record (directionplus an orderedregionslist 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 (autoonly in a column, inherited anchors shown as inherited,acceptschips). Core validates live (opf/layout-templateandopf/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'stoSvgand fonts handle, or a wireframe. The parts are exported separately (createLayoutToolPalette,createLayoutCanvas,createLayoutTree,createLayoutInspector,createLayoutModel), withgetRecord,setRecord,onChange,saveToDeck(editor)(throughsaveCustomLayout, which now takes{ replace: true }to edit a layout the deck already has) andapplyToSlide(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 replacesopenCustomLayoutEditor(/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/gallerymoves from^4.0.0to^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
directionplus an ordered, nestableregionslist instead of theareasgrid withcolumns,rowsand aregionsmap. 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.layoutFromGridis replaced bylayoutFromRegions(adirection, an optional inheritedanchor, and the region and split entries, all checked). The layout picker draws a nested diagram of the record's regions and splits,layoutRegionSummaryrecognizes 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:
createPresentButtontakesvariant: "quiet" | "primary"(and the button hassetVariant). The default is now"quiet": a transparent icon button like the toolbar's undo and redo, with the icon in--opf-ui-muted-fgand a hover to--opf-ui-fgon--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-labeland title are unchanged.
@openpresentation/opf-editor 0.24.3
- RR-98:
@openpresentation/opf-editor/presenteraddscreatePresenter(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)andonSlideChange(index);role="dialog", a focus trap and anaria-liveannouncement),createPresentButton(an icon-only "Present" button, title "Present (F5)", styled like the Export trigger) andbindPresentShortcut(F5, ignored while typing).@openpresentation/opf-editor/read-deck-fileaddsreadDeckFile(file | { name, text })(JSON, YAML or Markdown by extension, with fallbacks, through core'sfromYamlandfromMarkdown; returns{ document, format, name, findings }and throws a typedDeckFileError) andDECK_FILE_ACCEPTfor<input accept>. The example playground has a Present button next to Export, and its Import file tab and drop zone read.yaml,.ymland.mdthroughreadDeckFile. The styles aresrc/styles/presenter.css, instyles.css.
@openpresentation/opf-editor 0.24.2
- RR-98 source pane: JSON now has live completions while you type (
completions: trueby default;completions: falsekeeps 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 (getJsonCompletionsin/json-options;mountJsonCodeEditortakes the samecompletionsoption, 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 setsaria-invalidwhile 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
- RR-98:
@openpresentation/opf-editor/styles.css, one stylesheet for the editor panels.npm run buildgeneratesdist/styles.cssfromsrc/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:rootand.opf-ui, light by default and dark under.dark .opf-ui,.opf-ui.darkand[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 groupedrole="menu"(Slides: PowerPoint, PDF, SVG, PNG; OPF source: JSON, YAML, Markdown; For an agent) with a mobile bottom-sheet mode (mode: "sheet"),density: "touch",itemsto hide groups or formats andsetDisabled(reason). PDF, PNG and SVG useconvert; PowerPoint is injected asexportPptx(deck, { signal, onProgress })because the editor does not import@openpresentation/opf-pptx; YAML and Markdown use core'stoYamlandtoMarkdownand report their notes. Progress, Cancel (anAbortController), a success or failure line announced througharia-live, and downloads through a Blob link oronDownloadare 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), andcreateAgentHandoffDialog(/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.cssandsrc/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-levelbindKeysnavigation, 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-currentand 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-cachewith the same behavior and a newprepare(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.cssandthumbnails.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 (adesign, region keys) and YAML comments that a rewrite drops are reported as warning findings, never silently.mountJsonCodeEditorgainslanguage(json,yaml,markdown),readOnly,setLanguageandsetReadOnly, and no longer throws when an outside update follows deleting the whole text. Adds@codemirror/lang-yaml.
@openpresentation/opf-editor 0.24.0
- RR-96: adopts
@openpresentation/gallery4.0.0 (^4.0.0, still a development dependency; hosts register the catalog): the default catalog has nodarktheme (a dark deck is a theme with a darkdesign.variant, for example{ "theme": "classic", "variant": "dark1" }), andminimal,classicandboldcarryvariants. The editor's behavior is unchanged; its tests selectboldorminimal, orclassicwith a dark variant, where they used thedarktheme.
@openpresentation/opf-editor 0.23.0
- RR-96: chart colors.
setChartOptionsandprepareChartOptionsacceptcolors(chart.colors, the colors by position: a hex color, a scheme slot such asaccent3that keeps following the deck, or avar:color variable;nullor""leaves a position to the deck palette;nullfor the whole value removes the field; at most 24,CHART_COLORS_MAX), as one undoable patch.readChartOptionsreportscolors(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) andstate.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-slotsentry point:readSchemeSlotsreads the deck's resolved scheme slots for swatches. The opf-render preview drawschart.colorsonce opf-render#256 lands. - RR-96 (needs core 0.23 for
design.variant): color variant pickers. New/design-variantsentry point:setDesignVariantandprepareDesignVariantsetdesign.variant(a background slotlight1,light2,dark1ordark2, written as the slot name, or{ background, accents }when the six accents are reordered;nullremoves it) at the deck or on one slide withslideIndex, as one undoable patch, withclearSlideOverridesand ashadowedlist for the slides whose own variant or theme-slot background hides a deck change;readDesignVariantreads the own and the effective variant (core's resolution) andvariantSwatchesthe four variants as colors built from the deck's own scheme slots, like PowerPoint's Variants gallery;normalizeVariantvalidates. 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'snormalizeColorVariant, 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
- RR-93: table cells take a
boldstyle, 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 (nullremoves 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
highlightas its only color-related setting and the editor has nochart.colorscontrol yet (a known gap);chart.colorsis 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.