@openleaf-editor/ui 0.1.0-beta.3 → 0.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/css.d.ts CHANGED
@@ -19,5 +19,5 @@
19
19
  * `dist/openleaf.css` is generated from this constant by `scripts/emit-css.mjs`,
20
20
  * so the constructable-stylesheet path and the linked-file path cannot drift.
21
21
  */
22
- export declare const CSS = "\n.ol-editor {\n /* Two families, named before either is public API. A singular\n `--openleaf-font` implies \"the\" font, and source view already has a\n monospace surface -- bolting a mono token on beside a singular name later\n is the awkward outcome worth avoiding now. `--openleaf-font` is still\n honoured as a fallback. */\n --ol-font: var(--openleaf-font-ui, var(--openleaf-font, system-ui, -apple-system, \"Segoe UI\", sans-serif));\n --ol-font-mono: var(--openleaf-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n --ol-font-size: var(--openleaf-font-size, 14px);\n --ol-radius: var(--openleaf-radius, 4px);\n --ol-text: var(--openleaf-color-text, #1f2328);\n --ol-text-muted: var(--openleaf-color-text-muted, #59636e);\n --ol-surface: var(--openleaf-color-surface, #ffffff);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #f0f1f3);\n --ol-surface-active: var(--openleaf-color-surface-active, #dbe9ff);\n --ol-border: var(--openleaf-color-border, #d1d9e0);\n /* Control boundaries, not decoration. See \"Two border tokens\" above. */\n --ol-border-strong: var(--openleaf-color-border-strong, #6e7781);\n --ol-accent: var(--openleaf-color-accent, #0550ae);\n --ol-focus: var(--openleaf-color-focus, #0969da);\n --ol-danger: var(--openleaf-color-danger, #cf222e);\n --ol-button-size: var(--openleaf-button-size, 32px);\n --ol-icon-size: var(--openleaf-icon-size, 16px);\n --ol-gap: var(--openleaf-gap, 2px);\n /* A 2009 WordPress admin bar sits at z-index 99999 and Drupal's toolbar plays\n similar games. Without a sanctioned escape hatch integrators fix a toolbar\n rendered behind a sticky host header with !important -- the exact thing the\n token API exists to prevent. */\n --ol-z: var(--openleaf-z-index, 1);\n /* Thickness and offset, not just colour: \"you can change the colour but not\n the thickness\" is a poor answer to a Section 508 team citing WCAG 2.2\n Focus Appearance. */\n --ol-focus-width: var(--openleaf-focus-width, 2px);\n --ol-focus-offset: var(--openleaf-focus-offset, 1px);\n\n display: block;\n position: relative;\n color: var(--ol-text);\n}\n\n/* Three ways into the dark palette, and one way out of it.\n `data-ol-scheme` is set from the applied skin's declared scheme, and a skin\n that declares one outranks both the attribute and the system -- it has to,\n because its tokens have already replaced the palette outright. Without the\n `:not()` guards a light skin on a dark machine would take these fallbacks for\n every token it did not itself set, which is a light surface carrying dark-mode\n muted text. */\n@media (prefers-color-scheme: dark) {\n .ol-editor:not([data-ol-theme=\"light\"]):not([data-ol-scheme]) {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n}\n\n.ol-editor[data-ol-theme=\"dark\"]:not([data-ol-scheme]) {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n\n.ol-editor[data-ol-scheme=\"dark\"] {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n\n/* Native widget chrome -- the popup a `select` opens, scrollbars, the caret,\n form control backgrounds -- is painted by the browser from `color-scheme`,\n not from any property we can hand an integrator. Left alone it follows the\n page, which is right while the editor's own palette also follows the page and\n wrong the moment either attribute pins the editor to one world. So it is set\n exactly when the editor stops following along, and inherited from the host\n otherwise. */\n.ol-editor[data-ol-theme=\"light\"] { color-scheme: light; }\n.ol-editor[data-ol-theme=\"dark\"] { color-scheme: dark; }\n.ol-editor[data-ol-scheme=\"light\"] { color-scheme: light; }\n.ol-editor[data-ol-scheme=\"dark\"] { color-scheme: dark; }\n\n/* Wrapping, not scrolling and not an overflow menu. Both of those hide\n controls -- one off-screen, one behind a click -- and a formatting control\n the author cannot see is a control they do not have. */\n.ol-editor .ol-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--ol-gap);\n box-sizing: border-box;\n margin: 0;\n padding: 4px;\n border: 1px solid var(--ol-border-strong);\n border-bottom: 0;\n border-radius: var(--ol-radius) var(--ol-radius) 0 0;\n background: var(--ol-surface);\n font: inherit;\n position: relative;\n z-index: var(--ol-z);\n}\n\n.ol-editor .ol-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--ol-gap);\n}\n\n/* The divider is a BORDER on the group, not a standalone flex item.\n As its own element it could wrap onto the trailing edge of a row with nothing\n after it -- a stranded line floating at the end of a row. Wrapping begins\n around 690-740px, well inside ordinary desktop widths (a CMS sidebar, a\n half-width split pane), so this was not a 360px-only edge case.\n border-inline-start rather than border-left, so it flips under RTL.\n\n This selector is why the renderer emits NO element between groups. It used to\n emit an .ol-sep div, which made the two groups non-adjacent and stopped this\n rule from ever matching -- so no divider rendered in any theme, and every bar\n carried inert empty divs. Adding a separator element back here breaks this. */\n.ol-editor .ol-group + .ol-group {\n border-inline-start: 1px solid var(--ol-border);\n padding-inline-start: 5px;\n margin-inline-start: 1px;\n}\n\n/* Every property a host reset or `button {}` rule is likely to touch is set\n here explicitly. Specificity is (0,2,0) via the descendant selector, which\n beats a bare element or single-class host rule without resorting to\n !important. */\n.ol-editor .ol-btn {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: var(--ol-button-size);\n height: var(--ol-button-size);\n min-width: var(--ol-button-size);\n min-height: var(--ol-button-size);\n max-width: none;\n padding: 0;\n margin: 0;\n border: 1px solid transparent;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n font-weight: 400;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n box-shadow: none;\n opacity: 1;\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n outline-offset: var(--ol-focus-offset);\n -webkit-tap-highlight-color: transparent;\n transition: background-color 120ms ease, border-color 120ms ease;\n}\n\n.ol-editor .ol-btn:hover {\n background: var(--ol-surface-hover);\n}\n\n/* :focus-visible only, so a mouse click does not leave a ring behind, but the\n ring is never removed for keyboard users. */\n.ol-editor .ol-btn:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n\n/* Pressed state is distinguished from hover by THREE signals, not just colour:\n a filled background, a visible border, and an inset shadow that reads as\n physically depressed. Colour alone would fail for a colour-blind author and\n would be invisible in forced-colours mode. */\n.ol-editor .ol-btn[aria-pressed=\"true\"] {\n background: var(--ol-surface-active);\n border-color: var(--ol-accent);\n color: var(--ol-accent);\n box-shadow: inset 0 1px 2px rgb(0 0 0 / 12%);\n}\n\n.ol-editor .ol-btn[aria-pressed=\"true\"]:hover {\n background: var(--ol-surface-active);\n border-color: var(--ol-accent);\n}\n\n/* aria-disabled rather than the disabled attribute: a disabled button is\n removed from the roving tabindex and cannot be reached or announced, so an\n author using a screen reader cannot discover that the control exists. */\n.ol-editor .ol-btn[aria-disabled=\"true\"] {\n opacity: 0.55;\n cursor: default;\n}\n\n.ol-editor .ol-btn[aria-disabled=\"true\"]:hover {\n background: transparent;\n}\n\n.ol-editor .ol-icon {\n width: var(--ol-icon-size);\n height: var(--ol-icon-size);\n display: block;\n pointer-events: none;\n flex: 0 0 auto;\n}\n\n/* Block-type select. Sized and coloured to sit level with the icon buttons so\n it does not read as bolted on, but it stays a native <select> -- a custom\n listbox is a large amount of ARIA that would then owe real screen reader\n testing to be worth anything. */\n.ol-editor .ol-select {\n box-sizing: border-box;\n height: var(--ol-button-size);\n max-width: 11em;\n padding: 0 22px 0 6px;\n margin: 0;\n border: 1px solid var(--ol-border-strong);\n border-radius: var(--ol-radius);\n background-color: transparent;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: right 10px center, right 6px center;\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n color: var(--ol-text);\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n font-weight: 400;\n line-height: 1;\n text-transform: none;\n letter-spacing: normal;\n box-shadow: none;\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n}\n\n.ol-editor .ol-select--wide {\n max-width: 14em;\n}\n\n.ol-editor .ol-select:hover {\n background-color: var(--ol-surface-hover);\n}\n\n.ol-editor .ol-select:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n\n/* The option list is painted by the OS, which does not inherit our tokens, so\n give it explicit colours or dark mode shows black text on black. */\n.ol-editor .ol-select option {\n background: var(--ol-surface);\n color: var(--ol-text);\n}\n\n.ol-editor .ol-content {\n box-sizing: border-box;\n border: 1px solid var(--ol-border-strong);\n border-radius: 0 0 var(--ol-radius) var(--ol-radius);\n background: var(--ol-surface);\n}\n\n/* Deliberately minimal: the content area inherits the host's typography, which\n is the entire reason this project does not use Shadow DOM. Only padding and\n the focus ring are ours. */\n.ol-editor .ol-content .ProseMirror {\n padding: 12px;\n min-height: 8rem;\n outline: none;\n}\n\n.ol-editor .ol-content:focus-within {\n outline: 2px solid var(--ol-focus);\n outline-offset: -1px;\n}\n\n/* Tables.\n These styles live in core, not in the opt-in table plugin, because table\n NODES live in core: every deployment reads and renders tables even where\n editing them is switched off. Unstyled tables would render as runs of\n undelimited text. */\n.ol-editor .ol-content .ProseMirror table {\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n margin: 0 0 1em;\n overflow: hidden;\n}\n\n.ol-editor .ol-content .ProseMirror td,\n.ol-editor .ol-content .ProseMirror th {\n border: 1px solid var(--ol-border);\n padding: 6px 8px;\n vertical-align: top;\n /* A zero-width cell cannot be clicked into, so it cannot be repaired. */\n min-width: 2em;\n position: relative;\n}\n\n/* Presentational valign is otherwise beaten by the rule above, which would\n make the cell-properties dialog a no-op on screen. */\n.ol-editor .ol-content .ProseMirror td[valign=\"middle\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"middle\"] { vertical-align: middle; }\n.ol-editor .ol-content .ProseMirror td[valign=\"bottom\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"bottom\"] { vertical-align: bottom; }\n.ol-editor .ol-content .ProseMirror td[valign=\"baseline\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"baseline\"] { vertical-align: baseline; }\n\n.ol-editor .ol-content .ProseMirror th {\n background: var(--ol-surface-hover);\n font-weight: 600;\n text-align: start;\n}\n\n/* prosemirror-tables marks cells in a rectangular selection with this class.\n An ::after overlay rather than a background so it composes with a cell that\n already has one, and so a header cell still reads as a header.\n\n The ring, not the tint, is the indicator -- see \"Cell selection\" above. */\n.ol-editor .ol-content .ProseMirror .selectedCell {\n outline: 2px solid var(--ol-accent);\n outline-offset: -2px;\n}\n.ol-editor .ol-content .ProseMirror .selectedCell::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: var(--ol-surface-active);\n opacity: 0.4;\n pointer-events: none;\n}\n\n/* The column resize handle, drawn by prosemirror-tables' columnResizing. */\n.ol-editor .ol-content .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px;\n top: 0;\n bottom: 0;\n width: 4px;\n background: var(--ol-accent);\n pointer-events: none;\n z-index: 20;\n}\n\n.ol-editor .ol-content .ProseMirror.resize-cursor {\n cursor: col-resize;\n}\n\n.ol-editor .ol-content .ProseMirror img.ol-float-left {\n float: left;\n margin: 0 1em 0.5em 0;\n}\n.ol-editor .ol-content .ProseMirror img.ol-float-right {\n float: right;\n margin: 0 0 0.5em 1em;\n}\n.ol-editor .ol-content .ProseMirror img.ol-align-center {\n display: block;\n margin: 0 auto 0.5em;\n}\n.ol-editor .ol-content .ProseMirror figure {\n margin: 0 0 1em;\n}\n.ol-editor .ol-content .ProseMirror figcaption {\n font-size: .9em;\n opacity: .8;\n margin-top: .35em;\n}\n.ol-editor .ol-content .ProseMirror details {\n border: 1px solid var(--ol-border);\n border-radius: var(--ol-radius);\n padding: .5em .75em;\n margin: 0 0 1em;\n}\n.ol-editor .ol-content .ProseMirror summary {\n cursor: pointer;\n font-weight: 600;\n}\n.ol-editor .ol-content .ProseMirror hr.ol-pagebreak {\n border: 0;\n border-top: 2px dashed var(--ol-border);\n margin: 1.5em 0;\n}\n.ol-editor .ol-content .ProseMirror iframe,\n.ol-editor .ol-content .ProseMirror video,\n.ol-editor .ol-content .ProseMirror audio {\n max-width: 100%;\n}\n\n/* Preserved-but-unrecognised markup, surfaced rather than hidden. */\n.ol-editor .ol-content .ProseMirror-selectednode {\n outline: 2px solid var(--ol-focus);\n outline-offset: 2px;\n border-radius: 2px;\n}\n\n.ol-editor .ol-source {\n box-sizing: border-box;\n display: block;\n width: 100%;\n min-height: 12rem;\n padding: 12px;\n border: 1px solid var(--ol-border-strong);\n border-radius: 0 0 var(--ol-radius) var(--ol-radius);\n background: var(--ol-surface);\n color: var(--ol-text);\n font-family: var(--ol-font-mono);\n font-size: 13px;\n line-height: 1.5;\n resize: vertical;\n white-space: pre-wrap;\n}\n\n/* Directional icons under RTL.\n Group order reverses for free with flexbox, but a curved undo arrow does not:\n in an RTL document \"back\" points the other way. Only genuinely directional\n icons are flipped -- bold and italic must not be mirrored. */\n.ol-editor[dir=\"rtl\"] .ol-icon--directional,\n[dir=\"rtl\"] .ol-editor .ol-icon--directional {\n transform: scaleX(-1);\n}\n\n/* The announcement region. Visually hidden but not display:none, which would\n remove it from the accessibility tree and silence it. */\n.ol-editor .ol-live {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* Menubar, menus, floating chrome, visual aids, fullscreen, inline. */\n.ol-editor .ol-menubar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--ol-gap);\n box-sizing: border-box;\n margin: 0;\n padding: 2px 4px;\n border: 1px solid var(--ol-border-strong);\n border-bottom: 0;\n border-radius: var(--ol-radius) var(--ol-radius) 0 0;\n background: var(--ol-surface);\n position: relative;\n z-index: var(--ol-z);\n}\n.ol-editor .ol-menubar + .ol-toolbar {\n border-radius: 0;\n}\n.ol-editor .ol-menu-trigger {\n box-sizing: border-box;\n margin: 0;\n padding: 4px 8px;\n border: 1px solid transparent;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n cursor: pointer;\n appearance: none;\n}\n.ol-editor .ol-menu-trigger:hover,\n.ol-editor .ol-menu-trigger[aria-expanded=\"true\"] {\n background: var(--ol-surface-hover);\n}\n.ol-editor .ol-menu-trigger:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n.ol-editor .ol-menu {\n position: absolute;\n z-index: calc(var(--ol-z) + 20);\n min-width: 12rem;\n /* Capped, so a deep menu opened low on a short window can be flipped above\n its trigger instead of running off the bottom of the page. */\n max-height: 60vh;\n overflow-y: auto;\n margin: 0;\n padding: 4px;\n border: 1px solid var(--ol-border-strong);\n border-radius: var(--ol-radius);\n background: var(--ol-surface);\n box-shadow: 0 8px 24px rgb(0 0 0 / 12%);\n}\n.ol-editor .ol-menu-item {\n display: block;\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n padding: 6px 10px;\n border: 0;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n text-align: start;\n cursor: pointer;\n appearance: none;\n}\n.ol-editor .ol-menu-item:hover {\n background: var(--ol-surface-hover);\n}\n/* Was outline:none plus a 1.13:1 background swap. See \"Menu focus\" above. */\n.ol-editor .ol-menu-item:focus-visible {\n background: var(--ol-surface-hover);\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: -2px;\n}\n/* 0.55, not 0.4: see \"Disabled is not invisible\" above. */\n.ol-editor .ol-menu-item[aria-disabled=\"true\"] {\n opacity: 0.55;\n cursor: default;\n}\n.ol-editor .ol-menu-sep {\n height: 1px;\n margin: 4px 0;\n background: var(--ol-border);\n}\n/* `display: flex` on .ol-toolbar above outranks the UA's `[hidden]` rule --\n a class selector beats an attribute selector on specificity -- so setting\n `el.hidden = true` in floating.ts styled a hidden bar and showed it anyway.\n Both floating bars sat over the prose at rest, with no selection to format.\n The overflow panel needed the same rule for the same reason; see below. */\n.ol-editor .ol-toolbar.ol-floating[hidden] {\n display: none;\n}\n.ol-editor .ol-toolbar.ol-floating {\n position: absolute;\n flex-wrap: nowrap;\n border: 1px solid var(--ol-border);\n border-radius: var(--ol-radius);\n box-shadow: 0 8px 24px rgb(0 0 0 / 12%);\n z-index: calc(var(--ol-z) + 10);\n}\n.ol-editor .ol-toolbar.ol-toolbar--overflow {\n flex-wrap: nowrap;\n overflow: hidden;\n}\n/* The More panel. Positioned in viewport coordinates from script, because the\n bar it belongs to may live inside a host with `overflow: hidden` -- which is\n the situation the whole feature exists for. */\n.ol-editor .ol-overflow-menu {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: var(--ol-gap);\n max-height: 70vh;\n overflow-y: auto;\n}\n.ol-editor .ol-overflow-menu[hidden] {\n display: none;\n}\n/* Vertical: the panel exists because there is no horizontal room left. */\n.ol-editor .ol-overflow-menu .ol-group {\n flex-direction: column;\n align-items: stretch;\n}\n.ol-editor .ol-overflow-menu .ol-group + .ol-group {\n border-inline-start: 0;\n border-block-start: 1px solid var(--ol-border);\n padding-inline-start: 0;\n margin-inline-start: 0;\n padding-block-start: 4px;\n margin-block-start: 3px;\n}\n.ol-editor.ol-visual-aids .ol-empty-block {\n outline: 1px dashed var(--ol-border);\n outline-offset: 2px;\n min-height: 1.2em;\n}\n.ol-editor.ol-visual-aids .ol-nbsp {\n background: color-mix(in srgb, var(--ol-accent) 25%, transparent);\n box-shadow: inset 0 -1px 0 var(--ol-accent);\n}\n.ol-editor.ol-visual-aids .ol-hidden-structure {\n outline: 1px dotted var(--ol-accent);\n outline-offset: 2px;\n}\n.ol-editor .ol-noneditable {\n cursor: default;\n background: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent 6px,\n color-mix(in srgb, var(--ol-border) 35%, transparent) 6px,\n color-mix(in srgb, var(--ol-border) 35%, transparent) 7px\n );\n}\n.ol-editor.ol-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n margin: 0;\n border-radius: 0;\n background: var(--ol-surface);\n display: flex;\n flex-direction: column;\n}\n.ol-editor.ol-fullscreen .ol-content,\n.ol-editor.ol-fullscreen .ol-source {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n}\n.ol-editor.ol-autoresize .ol-content .ProseMirror {\n overflow: hidden;\n}\n.ol-editor.ol-inline:not(.ol-inline-active) .ol-toolbar,\n.ol-editor.ol-inline:not(.ol-inline-active) .ol-menubar {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n}\n.ol-editor.ol-inline .ol-content {\n border-radius: var(--ol-radius);\n}\n.ol-help-table {\n width: 100%;\n border-collapse: collapse;\n font: inherit;\n}\n.ol-help-table th,\n.ol-help-table td {\n padding: 4px 8px;\n text-align: start;\n vertical-align: top;\n border-bottom: 1px solid var(--openleaf-color-border, #d1d9e0);\n}\n.ol-help-table th {\n font-weight: 600;\n white-space: nowrap;\n}\n\n/* Coarse pointers get a larger target. WCAG 2.2 SC 2.5.8 asks for 24x24 CSS px\n minimum; 32 clears that on a mouse and 40 is comfortable on a thumb. */\n@media (pointer: coarse) {\n .ol-editor {\n --ol-button-size: var(--openleaf-button-size, 40px);\n --ol-gap: var(--openleaf-gap, 4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ol-editor .ol-btn {\n transition: none;\n }\n}\n\n/* Forced colours (Windows high contrast) replaces our palette wholesale. The\n pressed state must not depend on a background we no longer control, so it is\n re-expressed as a border, which the mode preserves. */\n@media (forced-colors: active) {\n .ol-editor .ol-btn {\n border-color: ButtonBorder;\n color: ButtonText;\n }\n .ol-editor .ol-btn[aria-pressed=\"true\"] {\n border-color: Highlight;\n color: Highlight;\n box-shadow: none;\n }\n .ol-editor .ol-btn:focus-visible {\n outline-color: Highlight;\n }\n .ol-editor .ol-btn[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n .ol-editor .ol-menu-item:focus-visible {\n outline-color: Highlight;\n }\n .ol-editor .ol-menu-item[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n .ol-editor .ol-menu-trigger[aria-expanded=\"true\"] {\n border-color: Highlight;\n color: Highlight;\n }\n .ol-editor .ol-content .ProseMirror .selectedCell {\n outline-color: Highlight;\n }\n .ol-editor .ol-content .ProseMirror .selectedCell::after {\n background: transparent;\n }\n .ol-editor .ol-content .ProseMirror .column-resize-handle {\n background: Highlight;\n }\n .ol-editor.ol-visual-aids .ol-nbsp {\n background: transparent;\n box-shadow: inset 0 -2px 0 Highlight;\n }\n .ol-editor.ol-visual-aids .ol-hidden-structure {\n outline-color: Highlight;\n }\n .ol-editor.ol-visual-aids .ol-empty-block {\n outline-color: GrayText;\n }\n .ol-editor .ol-noneditable {\n background: transparent;\n outline: 1px dashed GrayText;\n }\n}\n";
22
+ export declare const CSS = "\n.ol-editor {\n /* Two families, named before either is public API. A singular\n `--openleaf-font` implies \"the\" font, and source view already has a\n monospace surface -- bolting a mono token on beside a singular name later\n is the awkward outcome worth avoiding now. `--openleaf-font` is still\n honoured as a fallback. */\n --ol-font: var(--openleaf-font-ui, var(--openleaf-font, system-ui, -apple-system, \"Segoe UI\", sans-serif));\n --ol-font-mono: var(--openleaf-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n --ol-font-size: var(--openleaf-font-size, 14px);\n --ol-radius: var(--openleaf-radius, 4px);\n --ol-text: var(--openleaf-color-text, #1f2328);\n --ol-text-muted: var(--openleaf-color-text-muted, #59636e);\n --ol-surface: var(--openleaf-color-surface, #ffffff);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #f0f1f3);\n --ol-surface-active: var(--openleaf-color-surface-active, #dbe9ff);\n --ol-border: var(--openleaf-color-border, #d1d9e0);\n /* Control boundaries, not decoration. See \"Two border tokens\" above. */\n --ol-border-strong: var(--openleaf-color-border-strong, #6e7781);\n --ol-accent: var(--openleaf-color-accent, #0550ae);\n --ol-focus: var(--openleaf-color-focus, #0969da);\n --ol-danger: var(--openleaf-color-danger, #cf222e);\n --ol-button-size: var(--openleaf-button-size, 32px);\n --ol-icon-size: var(--openleaf-icon-size, 16px);\n --ol-gap: var(--openleaf-gap, 2px);\n /* A 2009 WordPress admin bar sits at z-index 99999 and Drupal's toolbar plays\n similar games. Without a sanctioned escape hatch integrators fix a toolbar\n rendered behind a sticky host header with !important -- the exact thing the\n token API exists to prevent. */\n --ol-z: var(--openleaf-z-index, 1);\n /* Thickness and offset, not just colour: \"you can change the colour but not\n the thickness\" is a poor answer to a Section 508 team citing WCAG 2.2\n Focus Appearance. */\n --ol-focus-width: var(--openleaf-focus-width, 2px);\n --ol-focus-offset: var(--openleaf-focus-offset, 1px);\n\n display: block;\n position: relative;\n color: var(--ol-text);\n}\n\n/* Three ways into the dark palette, and one way out of it.\n `data-ol-scheme` is set from the applied skin's declared scheme, and a skin\n that declares one outranks both the attribute and the system -- it has to,\n because its tokens have already replaced the palette outright. Without the\n `:not()` guards a light skin on a dark machine would take these fallbacks for\n every token it did not itself set, which is a light surface carrying dark-mode\n muted text. */\n@media (prefers-color-scheme: dark) {\n .ol-editor:not([data-ol-theme=\"light\"]):not([data-ol-scheme]) {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n}\n\n.ol-editor[data-ol-theme=\"dark\"]:not([data-ol-scheme]) {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n\n.ol-editor[data-ol-scheme=\"dark\"] {\n --ol-text: var(--openleaf-color-text, #e6edf3);\n --ol-text-muted: var(--openleaf-color-text-muted, #9198a1);\n --ol-surface: var(--openleaf-color-surface, #0d1117);\n --ol-surface-hover: var(--openleaf-color-surface-hover, #21262d);\n --ol-surface-active: var(--openleaf-color-surface-active, #1f3a5f);\n --ol-border: var(--openleaf-color-border, #3d444d);\n --ol-border-strong: var(--openleaf-color-border-strong, #8b949e);\n --ol-accent: var(--openleaf-color-accent, #79c0ff);\n --ol-focus: var(--openleaf-color-focus, #79c0ff);\n --ol-danger: var(--openleaf-color-danger, #ff8182);\n}\n\n/* Native widget chrome -- the popup a `select` opens, scrollbars, the caret,\n form control backgrounds -- is painted by the browser from `color-scheme`,\n not from any property we can hand an integrator. Left alone it follows the\n page, which is right while the editor's own palette also follows the page and\n wrong the moment either attribute pins the editor to one world. So it is set\n exactly when the editor stops following along, and inherited from the host\n otherwise. */\n.ol-editor[data-ol-theme=\"light\"] { color-scheme: light; }\n.ol-editor[data-ol-theme=\"dark\"] { color-scheme: dark; }\n.ol-editor[data-ol-scheme=\"light\"] { color-scheme: light; }\n.ol-editor[data-ol-scheme=\"dark\"] { color-scheme: dark; }\n\n/* Wrapping, not scrolling and not an overflow menu. Both of those hide\n controls -- one off-screen, one behind a click -- and a formatting control\n the author cannot see is a control they do not have. */\n.ol-editor .ol-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--ol-gap);\n box-sizing: border-box;\n margin: 0;\n padding: 4px;\n border: 1px solid var(--ol-border-strong);\n border-bottom: 0;\n border-radius: var(--ol-radius) var(--ol-radius) 0 0;\n background: var(--ol-surface);\n font: inherit;\n position: relative;\n z-index: var(--ol-z);\n}\n\n.ol-editor .ol-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--ol-gap);\n}\n\n/* The divider is a BORDER on the group, not a standalone flex item.\n As its own element it could wrap onto the trailing edge of a row with nothing\n after it -- a stranded line floating at the end of a row. Wrapping begins\n around 690-740px, well inside ordinary desktop widths (a CMS sidebar, a\n half-width split pane), so this was not a 360px-only edge case.\n border-inline-start rather than border-left, so it flips under RTL.\n\n This selector is why the renderer emits NO element between groups. It used to\n emit an .ol-sep div, which made the two groups non-adjacent and stopped this\n rule from ever matching -- so no divider rendered in any theme, and every bar\n carried inert empty divs. Adding a separator element back here breaks this. */\n.ol-editor .ol-group + .ol-group {\n border-inline-start: 1px solid var(--ol-border);\n padding-inline-start: 5px;\n margin-inline-start: 1px;\n}\n\n/* Every property a host reset or `button {}` rule is likely to touch is set\n here explicitly. Specificity is (0,2,0) via the descendant selector, which\n beats a bare element or single-class host rule without resorting to\n !important. */\n.ol-editor .ol-btn {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: var(--ol-button-size);\n height: var(--ol-button-size);\n min-width: var(--ol-button-size);\n min-height: var(--ol-button-size);\n max-width: none;\n padding: 0;\n margin: 0;\n border: 1px solid transparent;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n font-weight: 400;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n box-shadow: none;\n opacity: 1;\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n outline-offset: var(--ol-focus-offset);\n -webkit-tap-highlight-color: transparent;\n transition: background-color 120ms ease, border-color 120ms ease;\n}\n\n.ol-editor .ol-btn:hover {\n background: var(--ol-surface-hover);\n}\n\n/* :focus-visible only, so a mouse click does not leave a ring behind, but the\n ring is never removed for keyboard users. */\n.ol-editor .ol-btn:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n\n/* Pressed state is distinguished from hover by THREE signals, not just colour:\n a filled background, a visible border, and an inset shadow that reads as\n physically depressed. Colour alone would fail for a colour-blind author and\n would be invisible in forced-colours mode. */\n.ol-editor .ol-btn[aria-pressed=\"true\"] {\n background: var(--ol-surface-active);\n border-color: var(--ol-accent);\n color: var(--ol-accent);\n box-shadow: inset 0 1px 2px rgb(0 0 0 / 12%);\n}\n\n.ol-editor .ol-btn[aria-pressed=\"true\"]:hover {\n background: var(--ol-surface-active);\n border-color: var(--ol-accent);\n}\n\n/* aria-disabled rather than the disabled attribute: a disabled button is\n removed from the roving tabindex and cannot be reached or announced, so an\n author using a screen reader cannot discover that the control exists. */\n.ol-editor .ol-btn[aria-disabled=\"true\"] {\n opacity: 0.55;\n cursor: default;\n}\n\n.ol-editor .ol-btn[aria-disabled=\"true\"]:hover {\n background: transparent;\n}\n\n.ol-editor .ol-icon {\n width: var(--ol-icon-size);\n height: var(--ol-icon-size);\n display: block;\n pointer-events: none;\n flex: 0 0 auto;\n}\n\n/* Block-type select. Sized and coloured to sit level with the icon buttons so\n it does not read as bolted on, but it stays a native <select> -- a custom\n listbox is a large amount of ARIA that would then owe real screen reader\n testing to be worth anything. */\n.ol-editor .ol-select {\n box-sizing: border-box;\n height: var(--ol-button-size);\n max-width: 11em;\n padding: 0 22px 0 6px;\n margin: 0;\n border: 1px solid var(--ol-border-strong);\n border-radius: var(--ol-radius);\n background-color: transparent;\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: right 10px center, right 6px center;\n background-size: 4px 4px, 4px 4px;\n background-repeat: no-repeat;\n color: var(--ol-text);\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n font-weight: 400;\n line-height: 1;\n text-transform: none;\n letter-spacing: normal;\n box-shadow: none;\n cursor: pointer;\n appearance: none;\n -webkit-appearance: none;\n}\n\n.ol-editor .ol-select--wide {\n max-width: 14em;\n}\n\n.ol-editor .ol-select:hover {\n background-color: var(--ol-surface-hover);\n}\n\n.ol-editor .ol-select:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n\n/* The option list is painted by the OS, which does not inherit our tokens, so\n give it explicit colours or dark mode shows black text on black. */\n.ol-editor .ol-select option {\n background: var(--ol-surface);\n color: var(--ol-text);\n}\n\n.ol-editor .ol-content {\n box-sizing: border-box;\n border: 1px solid var(--ol-border-strong);\n border-radius: 0 0 var(--ol-radius) var(--ol-radius);\n background: var(--ol-surface);\n}\n\n/* Deliberately minimal: the content area inherits the host's typography, which\n is the entire reason this project does not use Shadow DOM. Only padding and\n the focus ring are ours. */\n.ol-editor .ol-content .ProseMirror {\n padding: 12px;\n min-height: 8rem;\n outline: none;\n}\n\n.ol-editor .ol-content:focus-within {\n outline: 2px solid var(--ol-focus);\n outline-offset: -1px;\n}\n\n/* Tables.\n These styles live in core, not in the opt-in table plugin, because table\n NODES live in core: every deployment reads and renders tables even where\n editing them is switched off. Unstyled tables would render as runs of\n undelimited text. */\n.ol-editor .ol-content .ProseMirror table {\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n margin: 0 0 1em;\n overflow: hidden;\n}\n\n.ol-editor .ol-content .ProseMirror td,\n.ol-editor .ol-content .ProseMirror th {\n border: 1px solid var(--ol-border);\n padding: 6px 8px;\n vertical-align: top;\n /* A zero-width cell cannot be clicked into, so it cannot be repaired. */\n min-width: 2em;\n position: relative;\n}\n\n/* Presentational valign is otherwise beaten by the rule above, which would\n make the cell-properties dialog a no-op on screen. */\n.ol-editor .ol-content .ProseMirror td[valign=\"middle\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"middle\"] { vertical-align: middle; }\n.ol-editor .ol-content .ProseMirror td[valign=\"bottom\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"bottom\"] { vertical-align: bottom; }\n.ol-editor .ol-content .ProseMirror td[valign=\"baseline\"],\n.ol-editor .ol-content .ProseMirror th[valign=\"baseline\"] { vertical-align: baseline; }\n\n.ol-editor .ol-content .ProseMirror th {\n background: var(--ol-surface-hover);\n font-weight: 600;\n text-align: start;\n}\n\n/* prosemirror-tables marks cells in a rectangular selection with this class.\n An ::after overlay rather than a background so it composes with a cell that\n already has one, and so a header cell still reads as a header.\n\n The ring, not the tint, is the indicator -- see \"Cell selection\" above. */\n.ol-editor .ol-content .ProseMirror .selectedCell {\n outline: 2px solid var(--ol-accent);\n outline-offset: -2px;\n}\n.ol-editor .ol-content .ProseMirror .selectedCell::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: var(--ol-surface-active);\n opacity: 0.4;\n pointer-events: none;\n}\n\n/* The column resize handle, drawn by prosemirror-tables' columnResizing. */\n.ol-editor .ol-content .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px;\n top: 0;\n bottom: 0;\n width: 4px;\n background: var(--ol-accent);\n pointer-events: none;\n z-index: 20;\n}\n\n.ol-editor .ol-content .ProseMirror.resize-cursor {\n cursor: col-resize;\n}\n\n.ol-editor .ol-content .ProseMirror img.ol-float-left {\n float: left;\n margin: 0 1em 0.5em 0;\n}\n.ol-editor .ol-content .ProseMirror img.ol-float-right {\n float: right;\n margin: 0 0 0.5em 1em;\n}\n.ol-editor .ol-content .ProseMirror img.ol-align-center {\n display: block;\n margin: 0 auto 0.5em;\n}\n.ol-editor .ol-content .ProseMirror figure {\n margin: 0 0 1em;\n}\n.ol-editor .ol-content .ProseMirror figcaption {\n font-size: .9em;\n opacity: .8;\n margin-top: .35em;\n}\n.ol-editor .ol-content .ProseMirror details {\n border: 1px solid var(--ol-border);\n border-radius: var(--ol-radius);\n padding: .5em .75em;\n margin: 0 0 1em;\n}\n.ol-editor .ol-content .ProseMirror summary {\n cursor: pointer;\n font-weight: 600;\n}\n.ol-editor .ol-content .ProseMirror hr.ol-pagebreak {\n border: 0;\n border-top: 2px dashed var(--ol-border);\n margin: 1.5em 0;\n}\n.ol-editor .ol-content .ProseMirror iframe,\n.ol-editor .ol-content .ProseMirror video,\n.ol-editor .ol-content .ProseMirror audio {\n max-width: 100%;\n}\n\n/* Preserved-but-unrecognised markup, surfaced rather than hidden. */\n.ol-editor .ol-content .ProseMirror-selectednode {\n outline: 2px solid var(--ol-focus);\n outline-offset: 2px;\n border-radius: 2px;\n}\n\n/* Gap cursor: the caret beside a block atom or isolating node, where no\n textblock exists. Hidden until the view is focused so it cannot paint over\n an inactive canvas. */\n.ol-editor .ol-content .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n.ol-editor .ol-content .ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid var(--ol-text);\n animation: ol-gapcursor-blink 1.1s steps(2, start) infinite;\n}\n@keyframes ol-gapcursor-blink {\n to { visibility: hidden; }\n}\n.ol-editor .ol-content .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.ol-editor .ol-source {\n box-sizing: border-box;\n display: block;\n width: 100%;\n min-height: 12rem;\n padding: 12px;\n border: 1px solid var(--ol-border-strong);\n border-radius: 0 0 var(--ol-radius) var(--ol-radius);\n background: var(--ol-surface);\n color: var(--ol-text);\n font-family: var(--ol-font-mono);\n font-size: 13px;\n line-height: 1.5;\n resize: vertical;\n white-space: pre-wrap;\n}\n\n/* Directional icons under RTL.\n Group order reverses for free with flexbox, but a curved undo arrow does not:\n in an RTL document \"back\" points the other way. Only genuinely directional\n icons are flipped -- bold and italic must not be mirrored. */\n.ol-editor[dir=\"rtl\"] .ol-icon--directional,\n[dir=\"rtl\"] .ol-editor .ol-icon--directional {\n transform: scaleX(-1);\n}\n\n/* The announcement region. Visually hidden but not display:none, which would\n remove it from the accessibility tree and silence it. */\n.ol-editor .ol-live {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* Menubar, menus, floating chrome, visual aids, fullscreen, inline. */\n.ol-editor .ol-menubar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--ol-gap);\n box-sizing: border-box;\n margin: 0;\n padding: 2px 4px;\n border: 1px solid var(--ol-border-strong);\n border-bottom: 0;\n border-radius: var(--ol-radius) var(--ol-radius) 0 0;\n background: var(--ol-surface);\n position: relative;\n z-index: var(--ol-z);\n}\n.ol-editor .ol-menubar + .ol-toolbar {\n border-radius: 0;\n}\n.ol-editor .ol-menu-trigger {\n box-sizing: border-box;\n margin: 0;\n padding: 4px 8px;\n border: 1px solid transparent;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n cursor: pointer;\n appearance: none;\n}\n.ol-editor .ol-menu-trigger:hover,\n.ol-editor .ol-menu-trigger[aria-expanded=\"true\"] {\n background: var(--ol-surface-hover);\n}\n.ol-editor .ol-menu-trigger:focus-visible {\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: var(--ol-focus-offset);\n}\n.ol-editor .ol-menu {\n position: absolute;\n z-index: calc(var(--ol-z) + 20);\n min-width: 12rem;\n /* Capped, so a deep menu opened low on a short window can be flipped above\n its trigger instead of running off the bottom of the page. */\n max-height: 60vh;\n overflow-y: auto;\n margin: 0;\n padding: 4px;\n border: 1px solid var(--ol-border-strong);\n border-radius: var(--ol-radius);\n background: var(--ol-surface);\n box-shadow: 0 8px 24px rgb(0 0 0 / 12%);\n}\n.ol-editor .ol-menu-item {\n display: block;\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n padding: 6px 10px;\n border: 0;\n border-radius: var(--ol-radius);\n background: transparent;\n color: var(--ol-text);\n font: inherit;\n font-family: var(--ol-font);\n font-size: var(--ol-font-size);\n text-align: start;\n cursor: pointer;\n appearance: none;\n}\n.ol-editor .ol-menu-item:hover {\n background: var(--ol-surface-hover);\n}\n/* Was outline:none plus a 1.13:1 background swap. See \"Menu focus\" above. */\n.ol-editor .ol-menu-item:focus-visible {\n background: var(--ol-surface-hover);\n outline: var(--ol-focus-width) solid var(--ol-focus);\n outline-offset: -2px;\n}\n/* 0.55, not 0.4: see \"Disabled is not invisible\" above. */\n.ol-editor .ol-menu-item[aria-disabled=\"true\"] {\n opacity: 0.55;\n cursor: default;\n}\n/* Third time for the same specificity trap, after the floating bar and the\n overflow panel below: `.ol-editor .ol-btn` is (0,2,0) and its\n `display: inline-flex` outranks the UA's `[hidden]` rule, so\n `button.hidden = true` set the attribute and painted the button anyway. A bar\n wide enough to need no overflow still showed its More trigger, and pressing\n it opened an empty panel. */\n.ol-editor .ol-btn[hidden] {\n display: none;\n}\n.ol-editor .ol-menu-sep {\n height: 1px;\n margin: 4px 0;\n background: var(--ol-border);\n}\n/* `display: flex` on .ol-toolbar above outranks the UA's `[hidden]` rule --\n a class selector beats an attribute selector on specificity -- so setting\n `el.hidden = true` in floating.ts styled a hidden bar and showed it anyway.\n Both floating bars sat over the prose at rest, with no selection to format.\n The overflow panel needed the same rule for the same reason; see below. */\n.ol-editor .ol-toolbar.ol-floating[hidden] {\n display: none;\n}\n.ol-editor .ol-toolbar.ol-floating {\n position: absolute;\n flex-wrap: nowrap;\n border: 1px solid var(--ol-border);\n border-radius: var(--ol-radius);\n box-shadow: 0 8px 24px rgb(0 0 0 / 12%);\n z-index: calc(var(--ol-z) + 10);\n}\n.ol-editor .ol-toolbar.ol-toolbar--overflow {\n flex-wrap: nowrap;\n overflow: hidden;\n}\n/* The More panel. Positioned in viewport coordinates from script, because the\n bar it belongs to may live inside a host with `overflow: hidden` -- which is\n the situation the whole feature exists for. */\n.ol-editor .ol-overflow-menu {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: var(--ol-gap);\n max-height: 70vh;\n overflow-y: auto;\n}\n.ol-editor .ol-overflow-menu[hidden] {\n display: none;\n}\n/* Vertical: the panel exists because there is no horizontal room left. */\n.ol-editor .ol-overflow-menu .ol-group {\n flex-direction: column;\n align-items: stretch;\n}\n.ol-editor .ol-overflow-menu .ol-group + .ol-group {\n border-inline-start: 0;\n border-block-start: 1px solid var(--ol-border);\n padding-inline-start: 0;\n margin-inline-start: 0;\n padding-block-start: 4px;\n margin-block-start: 3px;\n}\n.ol-editor.ol-visual-aids .ol-empty-block {\n outline: 1px dashed var(--ol-border);\n outline-offset: 2px;\n min-height: 1.2em;\n}\n.ol-editor.ol-visual-aids .ol-nbsp {\n background: color-mix(in srgb, var(--ol-accent) 25%, transparent);\n box-shadow: inset 0 -1px 0 var(--ol-accent);\n}\n.ol-editor.ol-visual-aids .ol-hidden-structure {\n outline: 1px dotted var(--ol-accent);\n outline-offset: 2px;\n}\n.ol-editor .ol-noneditable {\n cursor: default;\n background: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent 6px,\n color-mix(in srgb, var(--ol-border) 35%, transparent) 6px,\n color-mix(in srgb, var(--ol-border) 35%, transparent) 7px\n );\n}\n.ol-editor.ol-fullscreen {\n position: fixed;\n inset: 0;\n z-index: 2147483000;\n margin: 0;\n border-radius: 0;\n background: var(--ol-surface);\n display: flex;\n flex-direction: column;\n}\n.ol-editor.ol-fullscreen .ol-content,\n.ol-editor.ol-fullscreen .ol-source {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n}\n.ol-editor.ol-autoresize .ol-content .ProseMirror {\n overflow: hidden;\n}\n.ol-editor.ol-inline:not(.ol-inline-active) .ol-toolbar,\n.ol-editor.ol-inline:not(.ol-inline-active) .ol-menubar {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n}\n.ol-editor.ol-inline .ol-content {\n border-radius: var(--ol-radius);\n}\n.ol-help-table {\n width: 100%;\n border-collapse: collapse;\n font: inherit;\n}\n.ol-help-table th,\n.ol-help-table td {\n padding: 4px 8px;\n text-align: start;\n vertical-align: top;\n border-bottom: 1px solid var(--openleaf-color-border, #d1d9e0);\n}\n.ol-help-table th {\n font-weight: 600;\n white-space: nowrap;\n}\n\n/* Coarse pointers get a larger target. WCAG 2.2 SC 2.5.8 asks for 24x24 CSS px\n minimum; 32 clears that on a mouse and 40 is comfortable on a thumb. */\n@media (pointer: coarse) {\n .ol-editor {\n --ol-button-size: var(--openleaf-button-size, 40px);\n --ol-gap: var(--openleaf-gap, 4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .ol-editor .ol-btn {\n transition: none;\n }\n}\n\n/* Forced colours (Windows high contrast) replaces our palette wholesale. The\n pressed state must not depend on a background we no longer control, so it is\n re-expressed as a border, which the mode preserves. */\n@media (forced-colors: active) {\n .ol-editor .ol-btn {\n border-color: ButtonBorder;\n color: ButtonText;\n }\n .ol-editor .ol-btn[aria-pressed=\"true\"] {\n border-color: Highlight;\n color: Highlight;\n box-shadow: none;\n }\n .ol-editor .ol-btn:focus-visible {\n outline-color: Highlight;\n }\n .ol-editor .ol-btn[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n .ol-editor .ol-menu-item:focus-visible {\n outline-color: Highlight;\n }\n .ol-editor .ol-menu-item[aria-disabled=\"true\"] {\n color: GrayText;\n opacity: 1;\n }\n .ol-editor .ol-menu-trigger[aria-expanded=\"true\"] {\n border-color: Highlight;\n color: Highlight;\n }\n .ol-editor .ol-content .ProseMirror .selectedCell {\n outline-color: Highlight;\n }\n .ol-editor .ol-content .ProseMirror .selectedCell::after {\n background: transparent;\n }\n .ol-editor .ol-content .ProseMirror .column-resize-handle {\n background: Highlight;\n }\n .ol-editor.ol-visual-aids .ol-nbsp {\n background: transparent;\n box-shadow: inset 0 -2px 0 Highlight;\n }\n .ol-editor.ol-visual-aids .ol-hidden-structure {\n outline-color: Highlight;\n }\n .ol-editor.ol-visual-aids .ol-empty-block {\n outline-color: GrayText;\n }\n .ol-editor .ol-noneditable {\n background: transparent;\n outline: 1px dashed GrayText;\n }\n}\n";
23
23
  //# sourceMappingURL=css.d.ts.map
package/dist/css.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkFH,eAAO,MAAM,GAAG,k2wBAwsBf,CAAA"}
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkFH,eAAO,MAAM,GAAG,++yBAyuBf,CAAA"}
package/dist/css.js CHANGED
@@ -489,6 +489,30 @@ export const CSS = `
489
489
  border-radius: 2px;
490
490
  }
491
491
 
492
+ /* Gap cursor: the caret beside a block atom or isolating node, where no
493
+ textblock exists. Hidden until the view is focused so it cannot paint over
494
+ an inactive canvas. */
495
+ .ol-editor .ol-content .ProseMirror-gapcursor {
496
+ display: none;
497
+ pointer-events: none;
498
+ position: absolute;
499
+ }
500
+ .ol-editor .ol-content .ProseMirror-gapcursor:after {
501
+ content: "";
502
+ display: block;
503
+ position: absolute;
504
+ top: -2px;
505
+ width: 20px;
506
+ border-top: 1px solid var(--ol-text);
507
+ animation: ol-gapcursor-blink 1.1s steps(2, start) infinite;
508
+ }
509
+ @keyframes ol-gapcursor-blink {
510
+ to { visibility: hidden; }
511
+ }
512
+ .ol-editor .ol-content .ProseMirror-focused .ProseMirror-gapcursor {
513
+ display: block;
514
+ }
515
+
492
516
  .ol-editor .ol-source {
493
517
  box-sizing: border-box;
494
518
  display: block;
@@ -616,6 +640,15 @@ export const CSS = `
616
640
  opacity: 0.55;
617
641
  cursor: default;
618
642
  }
643
+ /* Third time for the same specificity trap, after the floating bar and the
644
+ overflow panel below: \`.ol-editor .ol-btn\` is (0,2,0) and its
645
+ \`display: inline-flex\` outranks the UA's \`[hidden]\` rule, so
646
+ \`button.hidden = true\` set the attribute and painted the button anyway. A bar
647
+ wide enough to need no overflow still showed its More trigger, and pressing
648
+ it opened an empty panel. */
649
+ .ol-editor .ol-btn[hidden] {
650
+ display: none;
651
+ }
619
652
  .ol-editor .ol-menu-sep {
620
653
  height: 1px;
621
654
  margin: 4px 0;
package/dist/css.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;GAOG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,MAAM,WAAW,GAAG;;;;;;;;;;;CAWnB,CAAA;AAED,MAAM,CAAC,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAiDgD,WAAW;;;0DAGpB,WAAW;;qCAEhC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmrB/C,CAAA"}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,6 @@ export { ensureStyles, markStylesExternal, registerStyles } from './styles.js';
12
12
  export { DIRECTIONAL, ensureSprite, iconElement, iconNames, registerIcons, type IconName, } from './icons.js';
13
13
  export { promptFields, promptForImage, promptForLink, promptForMedia, type FieldOption, type FieldSpec, type ImagePromptOptions, type ImageResult, type LinkResult, type MediaPromptOptions, type MediaResult, type MediaSourceResult, type PromptFormOptions, } from './dialog.js';
14
14
  export { filePickerFor, listedImageClasses, listedImages, listedLinks, registerFilePicker, registerImageClasses, registerImageList, registerLinkList, type FilePicker, type FilePickerKind, type ListedResource, type PickedResource, } from './pickers.js';
15
- export { IMAGE_ACCEPT, canUploadImages, imageFilesFrom, imageUploaderFor, isUploadableImage, isUploadableImageType, registerImageUploader, runUploader, type ImageUploadResult, type ImageUploader, } from './upload.js';
15
+ export { IMAGE_ACCEPT, canUploadImages, imageFilesFrom, imageUploaderFor, isHeicImage, isUploadableImage, isUploadableImageType, registerImageUploader, runUploader, type ImageUploadResult, type ImageUploader, } from './upload.js';
16
16
  export { BUILT_IN_SKINS, applyColourScheme, applySkin, availableSkins, ensureSkins, registerSkin, type ColourScheme, type Skin, } from './skins.js';
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAA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,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,IAAI,GACV,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACzH,OAAO,EACL,CAAC,EACD,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,SAAS,EAGd,KAAK,WAAW,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,E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YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -12,6 +12,6 @@ export { ensureStyles, markStylesExternal, registerStyles } from './styles.js';
12
12
  export { DIRECTIONAL, ensureSprite, iconElement, iconNames, registerIcons, } from './icons.js';
13
13
  export { promptFields, promptForImage, promptForLink, promptForMedia, } from './dialog.js';
14
14
  export { filePickerFor, listedImageClasses, listedImages, listedLinks, registerFilePicker, registerImageClasses, registerImageList, registerLinkList, } from './pickers.js';
15
- export { IMAGE_ACCEPT, canUploadImages, imageFilesFrom, imageUploaderFor, isUploadableImage, isUploadableImageType, registerImageUploader, runUploader, } from './upload.js';
15
+ export { IMAGE_ACCEPT, canUploadImages, imageFilesFrom, imageUploaderFor, isHeicImage, isUploadableImage, isUploadableImageType, registerImageUploader, runUploader, } from './upload.js';
16
16
  export { BUILT_IN_SKINS, applyColourScheme, applySkin, availableSkins, ensureSkins, registerSkin, } from './skins.js';
17
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2C,MAAM,cAAc,CAAA;AAC/E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,mBAAmB,GAKpB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACzH,OAAO,EACL,CAAC,EACD,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,cAAc,EACd,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GAMpB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,E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,"file":"items.d.ts","sourceRoot":"","sources":["../src/items.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgDH,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,uBAAuB,+BAA+B,CAAA;AACnE,eAAO,MAAM,wBAAwB,gCAAgC,CAAA;AAmFrE,wBAAgB,oBAAoB,IAAI,IAAI,CAyZ3C"}
1
+ {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../src/items.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkDH,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,uBAAuB,+BAA+B,CAAA;AACnE,eAAO,MAAM,wBAAwB,gCAAgC,CAAA;AAoErE,wBAAgB,oBAAoB,IAAI,IAAI,CA0Z3C"}
package/dist/items.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * document, that knowledge belongs in `@openleaf-editor/core` where a keyboard
7
7
  * shortcut and a test can reach it too.
8
8
  */
9
- import { activeFontFamily, activeFontSize, activeLineHeight, activeLink, FONT_FAMILIES, FONT_SIZE_PRESETS, indent, insertHorizontalRule, insertImage, isMarkActive, isNodeActive, LINE_HEIGHT_PRESETS, outdent, redo, safeFontFamily, selectedImage, setFontFamily, setFontSize, setLineHeight, setLink, toggleBlockquote, toggleBold, toggleBulletList, toggleCodeBlock, toggleInlineCode, toggleItalic, toggleOrderedList, toggleStrike, toggleTextAlign, toggleUnderline, undo, unsetLink, updateImage, } from '@openleaf-editor/core';
9
+ import { activeFontFamily, activeFontSize, activeLineHeight, activeLink, activeTextAlign, FONT_FAMILIES, FONT_SIZE_PRESETS, indent, insertHorizontalRule, insertImage, isMarkActive, isNodeActive, LINE_HEIGHT_PRESETS, outdent, redo, safeFontFamily, selectedImage, setFontFamily, setFontSize, setLineHeight, setLink, setTextAlign, toggleBlockquote, toggleBold, toggleBulletList, toggleCodeBlock, toggleInlineCode, toggleItalic, toggleOrderedList, toggleStrike, toggleTextAlign, toggleUnderline, undo, unsetLink, updateImage, } from '@openleaf-editor/core';
10
10
  import { TextSelection } from 'prosemirror-state';
11
11
  import { promptForImage, promptForLink } from './dialog.js';
12
12
  import { promptHelp } from './help.js';
@@ -28,35 +28,18 @@ const alignCache = new WeakMap();
28
28
  * that was ~48,000 wasted node visits inside `dispatchTransaction`.
29
29
  *
30
30
  * Keyed on the state, so the second, third and fourth toolbar reading the same
31
- * transaction pay nothing. Membership is "carries an align attribute", exactly
32
- * as core decides it, so a plugin block that opts in still works.
31
+ * transaction pay nothing. Answers come from core (`setTextAlign` /
32
+ * `activeTextAlign`) so a selected image lights the same button the command
33
+ * will write, rather than a second walk that only saw textblocks.
33
34
  */
34
35
  function alignFacts(state) {
35
36
  const hit = alignCache.get(state);
36
37
  if (hit)
37
38
  return hit;
38
- let any = false;
39
- let mixed = false;
40
- let align = null;
41
- const { from, to } = state.selection;
42
- state.doc.nodesBetween(from, to, (node) => {
43
- if (!node.isTextblock)
44
- return true;
45
- if (Object.hasOwn(node.attrs, 'align')) {
46
- const value = node.attrs['align'] ?? null;
47
- if (!any) {
48
- any = true;
49
- align = value;
50
- }
51
- else if (value !== align) {
52
- // Mixed reports null, like core: showing the first block's value as the
53
- // state of all of them is a lie the author acts on.
54
- mixed = true;
55
- }
56
- }
57
- return false;
58
- });
59
- const facts = { any, align: mixed ? null : align };
39
+ const facts = {
40
+ any: setTextAlign('left')(state),
41
+ align: activeTextAlign(state),
42
+ };
60
43
  alignCache.set(state, facts);
61
44
  return facts;
62
45
  }
@@ -380,6 +363,8 @@ export function registerDefaultItems() {
380
363
  : {}),
381
364
  };
382
365
  void promptForImage(host.ownerDocument, options).then((result) => {
366
+ if (view.isDestroyed)
367
+ return;
383
368
  if (!result) {
384
369
  view.focus();
385
370
  return;
package/dist/items.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"items.js","sourceRoot":"","sources":["../src/items.ts"],"names":[],"mappings":"AAAA;;;;;;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wB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QAClG,CAAC;KACF,CAAC,CAAA;IAEF,mBAAmB,CAAC;QAClB,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YAChB,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;QACtC,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
package/dist/openleaf.css CHANGED
@@ -422,6 +422,30 @@
422
422
  border-radius: 2px;
423
423
  }
424
424
 
425
+ /* Gap cursor: the caret beside a block atom or isolating node, where no
426
+ textblock exists. Hidden until the view is focused so it cannot paint over
427
+ an inactive canvas. */
428
+ .ol-editor .ol-content .ProseMirror-gapcursor {
429
+ display: none;
430
+ pointer-events: none;
431
+ position: absolute;
432
+ }
433
+ .ol-editor .ol-content .ProseMirror-gapcursor:after {
434
+ content: "";
435
+ display: block;
436
+ position: absolute;
437
+ top: -2px;
438
+ width: 20px;
439
+ border-top: 1px solid var(--ol-text);
440
+ animation: ol-gapcursor-blink 1.1s steps(2, start) infinite;
441
+ }
442
+ @keyframes ol-gapcursor-blink {
443
+ to { visibility: hidden; }
444
+ }
445
+ .ol-editor .ol-content .ProseMirror-focused .ProseMirror-gapcursor {
446
+ display: block;
447
+ }
448
+
425
449
  .ol-editor .ol-source {
426
450
  box-sizing: border-box;
427
451
  display: block;
@@ -549,6 +573,15 @@
549
573
  opacity: 0.55;
550
574
  cursor: default;
551
575
  }
576
+ /* Third time for the same specificity trap, after the floating bar and the
577
+ overflow panel below: `.ol-editor .ol-btn` is (0,2,0) and its
578
+ `display: inline-flex` outranks the UA's `[hidden]` rule, so
579
+ `button.hidden = true` set the attribute and painted the button anyway. A bar
580
+ wide enough to need no overflow still showed its More trigger, and pressing
581
+ it opened an empty panel. */
582
+ .ol-editor .ol-btn[hidden] {
583
+ display: none;
584
+ }
552
585
  .ol-editor .ol-menu-sep {
553
586
  height: 1px;
554
587
  margin: 4px 0;
@@ -39,6 +39,22 @@ export declare class ToolbarOverflow {
39
39
  /** Re-home the trigger after the toolbar rebuilt its children. */
40
40
  reattach(): void;
41
41
  destroy(): void;
42
+ /**
43
+ * Lay the bar out without stealing focus.
44
+ *
45
+ * `#reflow` moves real controls -- the trigger included -- between the bar and
46
+ * the panel, and `appendChild` of an already-connected node is a removal
47
+ * followed by an insertion. Every engine resets focus to the body when a
48
+ * focused element is moved that way (chromium, firefox and webkit alike; it is
49
+ * not a WebKit quirk, WebKit just loses the race more often on a loaded
50
+ * machine). A ResizeObserver fires whenever the bar changes size -- a font
51
+ * finishing, `--openleaf-button-size` changing density, a CMS sidebar
52
+ * animating open -- so a keyboard user standing on More could have the button
53
+ * pulled out from under them between focusing it and pressing Enter, and the
54
+ * Enter went to the document.
55
+ *
56
+ * So the layout records what it is about to move focus off, and puts it back.
57
+ */
42
58
  layout(): void;
43
59
  }
44
60
  //# sourceMappingURL=overflow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overflow.d.ts","sourceRoot":"","sources":["../src/overflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAUH,qBAAa,eAAe;;gBAiBd,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IA+CzF,kEAAkE;IAClE,QAAQ,IAAI,IAAI;IA6BhB,OAAO,IAAI,IAAI;IAcf,MAAM,IAAI,IAAI;CAyLf"}
1
+ {"version":3,"file":"overflow.d.ts","sourceRoot":"","sources":["../src/overflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAUH,qBAAa,eAAe;;gBAuBd,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IA+CzF,kEAAkE;IAClE,QAAQ,IAAI,IAAI;IAiChB,OAAO,IAAI,IAAI;IAgBf;;;;;;;;;;;;;;;OAeG;IACH,MAAM,IAAI,IAAI;CAsOf"}
package/dist/overflow.js CHANGED
@@ -54,6 +54,12 @@ export class ToolbarOverflow {
54
54
  * cancelled on destroy so a queued layout cannot run against a torn-down bar.
55
55
  */
56
56
  #frame = null;
57
+ /**
58
+ * A layout that arrived while the panel was open, and the guard that keeps
59
+ * `#close` from re-entering the reflow that called it.
60
+ */
61
+ #deferred = false;
62
+ #reflowing = false;
57
63
  constructor(toolbar, host, doc, onLayout) {
58
64
  this.#toolbar = toolbar;
59
65
  this.#host = host;
@@ -102,6 +108,10 @@ export class ToolbarOverflow {
102
108
  }
103
109
  /** Re-home the trigger after the toolbar rebuilt its children. */
104
110
  reattach() {
111
+ // Closed first: the panel is about to be emptied, and an open panel would
112
+ // both defer the layout below and leave the author holding an empty one.
113
+ this.#deferred = false;
114
+ this.#close();
105
115
  // The groups in the panel belong to the render that was just thrown away.
106
116
  // Restoring them would put two of every control in the bar.
107
117
  this.#panel.replaceChildren();
@@ -137,13 +147,64 @@ export class ToolbarOverflow {
137
147
  this.#frame = null;
138
148
  }
139
149
  this.#observer?.disconnect();
150
+ // Dropped before the close, or the close would lay out a bar being torn down.
151
+ this.#deferred = false;
140
152
  this.#close();
141
153
  this.#restore();
142
154
  this.#more.remove();
143
155
  this.#panel.remove();
144
156
  this.#toolbar.classList.remove('ol-toolbar--overflow');
145
157
  }
158
+ /**
159
+ * Lay the bar out without stealing focus.
160
+ *
161
+ * `#reflow` moves real controls -- the trigger included -- between the bar and
162
+ * the panel, and `appendChild` of an already-connected node is a removal
163
+ * followed by an insertion. Every engine resets focus to the body when a
164
+ * focused element is moved that way (chromium, firefox and webkit alike; it is
165
+ * not a WebKit quirk, WebKit just loses the race more often on a loaded
166
+ * machine). A ResizeObserver fires whenever the bar changes size -- a font
167
+ * finishing, `--openleaf-button-size` changing density, a CMS sidebar
168
+ * animating open -- so a keyboard user standing on More could have the button
169
+ * pulled out from under them between focusing it and pressing Enter, and the
170
+ * Enter went to the document.
171
+ *
172
+ * So the layout records what it is about to move focus off, and puts it back.
173
+ */
146
174
  layout() {
175
+ // Never reflow under an open panel. Measuring means putting every group
176
+ // back in the bar, which means closing the panel the author is reading --
177
+ // so a ResizeObserver pass that lands just after they opened it took it
178
+ // away again, along with the focus inside it. A real viewport resize still
179
+ // closes the panel through `#onViewportChange`, and that close runs the
180
+ // deferred layout immediately; a font or a density change simply waits
181
+ // until the author is done with the panel.
182
+ if (!this.#panel.hidden) {
183
+ this.#deferred = true;
184
+ return;
185
+ }
186
+ const active = this.#doc.activeElement;
187
+ const held = active instanceof HTMLElement &&
188
+ (this.#toolbar.contains(active) || this.#panel.contains(active))
189
+ ? active
190
+ : null;
191
+ this.#reflowing = true;
192
+ try {
193
+ this.#reflow();
194
+ }
195
+ finally {
196
+ this.#reflowing = false;
197
+ }
198
+ if (!held || this.#doc.activeElement === held)
199
+ return;
200
+ // A control the reflow pushed into the panel cannot hold focus: the panel is
201
+ // hidden by now. The trigger is where the panel's own Escape sends focus, so
202
+ // it is the honest destination for a control that just went behind it.
203
+ const target = held.isConnected && !this.#panel.contains(held) ? held : this.#more;
204
+ if (!target.hidden && target.isConnected)
205
+ target.focus();
206
+ }
207
+ #reflow() {
147
208
  this.#restore();
148
209
  // Revealed BEFORE the reads, not after the compute. The trigger takes a
149
210
  // width and a gap in the row the moment it is shown, and it cannot be
@@ -238,6 +299,11 @@ export class ToolbarOverflow {
238
299
  this.#doc.defaultView?.removeEventListener('resize', this.#onViewportChange);
239
300
  if (returnFocus)
240
301
  this.#more.focus();
302
+ // The reflow's own `#close` must not turn round and call it again.
303
+ if (this.#deferred && !this.#reflowing) {
304
+ this.#deferred = false;
305
+ this.layout();
306
+ }
241
307
  }
242
308
  /**
243
309
  * Under the trigger, in viewport coordinates and clamped to it.
@@ -312,9 +378,13 @@ export class ToolbarOverflow {
312
378
  for (const group of [...this.#panel.children])
313
379
  this.#toolbar.appendChild(group);
314
380
  // Overflow always takes a suffix of the groups, so appending in panel order
315
- // puts them back where they were. The trigger stays last.
316
- if (this.#more.isConnected)
381
+ // puts them back where they were. The trigger stays last -- but only if it
382
+ // is not already there. An unconditional `appendChild` re-inserts it on
383
+ // every pass, and a re-insertion is what drops focus, so the steady-state
384
+ // layout of a bar that fits now moves nothing at all.
385
+ if (this.#more.isConnected && this.#toolbar.lastElementChild !== this.#more) {
317
386
  this.#toolbar.appendChild(this.#more);
387
+ }
318
388
  }
319
389
  #groups() {
320
390
  return [...this.#toolbar.querySelectorAll(':scope > .ol-group')];
@@ -1 +1 @@
1
- {"version":3,"file":"overflow.js","sourceRoot":"","sources":["../src/overflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,wEAAwE;AACxE,MAAM,SAAS,GAAG,iCAAiC,CAAA;AAEnD,IAAI,YAAY,GAAG,CAAC,CAAA;AAEpB,MAAM,OAAO,eAAe;IAC1B,QAAQ,CAAa;IACrB,KAAK,CAAa;IAClB,IAAI,CAAU;IACd,KAAK,CAAmB;IACxB,MAAM,CAAgB;IACtB,SAAS,GAA0B,IAAI,CAAA;IACvC,SAAS,CAA0B;IACnC;;;;;;OAMG;IACH,MAAM,GAAkB,IAAI,CAAA;IAE5B,YAAY,OAAoB,EAAE,IAAiB,EAAE,GAAa,EAAE,QAAqB;QACvF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,IAA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;QAC3E,wEAAwE;QACxE,0EAA0E;QAC1E,sDAAsD;QACtD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5E,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAc,oBAAoB,CAAC,CAAC,CAAA;IAC/E,CAAC;CACF"}
package/dist/upload.d.ts CHANGED
@@ -66,16 +66,29 @@ export declare function imageUploaderFor(host: HTMLElement | null | undefined):
66
66
  /** Can this editor upload at all? Drives whether a file picker is offered. */
67
67
  export declare function canUploadImages(host: HTMLElement | null | undefined): boolean;
68
68
  /** What the file picker offers. Advisory: a picker's accept list is not a check. */
69
- export declare const IMAGE_ACCEPT = "image/png,image/jpeg,image/gif,image/webp,image/avif";
69
+ export declare const IMAGE_ACCEPT = "image/png,image/jpeg,image/gif,image/webp,image/avif,.jfif";
70
+ /**
71
+ * HEIC/HEIF, including the live-photo sequence types, or an empty type with
72
+ * a `.heic` / `.heif` name.
73
+ *
74
+ * Refused rather than converted or passed through. `image/heic` is `image/*`,
75
+ * so a type-only check used to send it to the uploader even though the picker
76
+ * never offered it.
77
+ */
78
+ export declare function isHeicImage(file: File): boolean;
70
79
  /**
71
80
  * Is this a file the image flow will accept?
72
81
  *
73
- * Any `image/*` except SVG, which is deliberately excluded. An SVG is a document,
74
- * not a bitmap: it can carry `<script>` and event handlers, and while those do
75
- * not execute in an `<img>`, the same file opened directly -- or embedded with
76
- * `<object>` by some other part of the CMS -- is a stored XSS. Deciding an SVG is
77
- * safe requires sanitizing its interior, which is a job for the server that
78
- * accepts the upload, not for a drop handler.
82
+ * Any `image/*` except SVG and HEIC. An SVG is a document, not a bitmap: it can
83
+ * carry `<script>` and event handlers, and while those do not execute in an
84
+ * `<img>`, the same file opened directly -- or embedded with `<object>` by some
85
+ * other part of the CMS -- is a stored XSS. Deciding an SVG is safe requires
86
+ * sanitizing its interior, which is a job for the server that accepts the
87
+ * upload, not for a drop handler.
88
+ *
89
+ * HEIC is refused because this editor has no decoder and no server; converting
90
+ * it would be a lie about what the host can store. When `type` is empty -- iOS
91
+ * and some file managers -- the filename is the fallback, still never for SVG.
79
92
  */
80
93
  export declare function isUploadableImage(file: File): boolean;
81
94
  /**
@@ -86,7 +99,8 @@ export declare function isUploadableImage(file: File): boolean;
86
99
  * and that content type comes from the document, which is to say from whoever
87
100
  * sent it. The import path has to make the same decision about it that the drop
88
101
  * handler makes about a dropped file, and two copies of "except SVG" is how one
89
- * of them ends up missing.
102
+ * of them ends up missing. Filename fallback does not apply here: there is no
103
+ * name. Empty and null still return false.
90
104
  */
91
105
  export declare function isUploadableImageType(type: string | null | undefined): boolean;
92
106
  /** The uploadable images in a drop or a paste, in the order they arrived. */
@@ -1 +1 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,KAC3B,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAA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iB,CAAC,CAW5B;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAIlF"}
package/dist/upload.js CHANGED
@@ -56,19 +56,58 @@ export function canUploadImages(host) {
56
56
  return imageUploaderFor(host) !== null;
57
57
  }
58
58
  /** What the file picker offers. Advisory: a picker's accept list is not a check. */
59
- export const IMAGE_ACCEPT = 'image/png,image/jpeg,image/gif,image/webp,image/avif';
59
+ export const IMAGE_ACCEPT = 'image/png,image/jpeg,image/gif,image/webp,image/avif,.jfif';
60
+ /**
61
+ * Bitmap names we will trust when the browser left `file.type` empty.
62
+ *
63
+ * `.jfif` is JPEG. SVG is deliberately absent: an extension is not a decoder.
64
+ * HEIC is absent because it is refused, not converted -- OpenLeaf has no
65
+ * decoder and no server.
66
+ */
67
+ const IMAGE_NAME = /\.(png|jpe?g|jfif|gif|webp|avif)$/i;
68
+ const HEIC_TYPE = /^image\/hei[cf](?:-sequence)?$/;
69
+ const HEIC_NAME = /\.hei[cf]$/i;
70
+ function mediaType(type) {
71
+ return (type ?? '').split(';')[0].trim().toLowerCase();
72
+ }
73
+ /**
74
+ * HEIC/HEIF, including the live-photo sequence types, or an empty type with
75
+ * a `.heic` / `.heif` name.
76
+ *
77
+ * Refused rather than converted or passed through. `image/heic` is `image/*`,
78
+ * so a type-only check used to send it to the uploader even though the picker
79
+ * never offered it.
80
+ */
81
+ export function isHeicImage(file) {
82
+ const media = mediaType(file.type);
83
+ if (HEIC_TYPE.test(media))
84
+ return true;
85
+ if (media)
86
+ return false;
87
+ return HEIC_NAME.test(file.name);
88
+ }
60
89
  /**
61
90
  * Is this a file the image flow will accept?
62
91
  *
63
- * Any `image/*` except SVG, which is deliberately excluded. An SVG is a document,
64
- * not a bitmap: it can carry `<script>` and event handlers, and while those do
65
- * not execute in an `<img>`, the same file opened directly -- or embedded with
66
- * `<object>` by some other part of the CMS -- is a stored XSS. Deciding an SVG is
67
- * safe requires sanitizing its interior, which is a job for the server that
68
- * accepts the upload, not for a drop handler.
92
+ * Any `image/*` except SVG and HEIC. An SVG is a document, not a bitmap: it can
93
+ * carry `<script>` and event handlers, and while those do not execute in an
94
+ * `<img>`, the same file opened directly -- or embedded with `<object>` by some
95
+ * other part of the CMS -- is a stored XSS. Deciding an SVG is safe requires
96
+ * sanitizing its interior, which is a job for the server that accepts the
97
+ * upload, not for a drop handler.
98
+ *
99
+ * HEIC is refused because this editor has no decoder and no server; converting
100
+ * it would be a lie about what the host can store. When `type` is empty -- iOS
101
+ * and some file managers -- the filename is the fallback, still never for SVG.
69
102
  */
70
103
  export function isUploadableImage(file) {
71
- return isUploadableImageType(file.type);
104
+ if (isHeicImage(file))
105
+ return false;
106
+ if (isUploadableImageType(file.type))
107
+ return true;
108
+ if (file.type)
109
+ return false;
110
+ return IMAGE_NAME.test(file.name);
72
111
  }
73
112
  /**
74
113
  * The same rule, against a media type on its own.
@@ -78,10 +117,13 @@ export function isUploadableImage(file) {
78
117
  * and that content type comes from the document, which is to say from whoever
79
118
  * sent it. The import path has to make the same decision about it that the drop
80
119
  * handler makes about a dropped file, and two copies of "except SVG" is how one
81
- * of them ends up missing.
120
+ * of them ends up missing. Filename fallback does not apply here: there is no
121
+ * name. Empty and null still return false.
82
122
  */
83
123
  export function isUploadableImageType(type) {
84
- const media = (type ?? '').split(';')[0].trim().toLowerCase();
124
+ const media = mediaType(type);
125
+ if (HEIC_TYPE.test(media))
126
+ return false;
85
127
  return media.startsWith('image/') && media !== 'image/svg+xml';
86
128
  }
87
129
  /** The uploadable images in a drop or a paste, in the order they arrived. */
@@ -1 +1 @@
1
- {"version":3,"file":"upload.js","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AA6BjD,IAAI,cA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UAAU,SAAS,CAAC,KAAyC;IACjE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IACtE,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IAC3E,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openleaf-editor/ui",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "OpenLeaf toolbar and UI primitives. Plain CSS, no framework, themeable by custom properties.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -40,12 +40,12 @@
40
40
  ],
41
41
  "peerDependencies": {
42
42
  "prosemirror-state": "^1.4.3",
43
- "@openleaf-editor/core": "^0.1.0-beta.3"
43
+ "@openleaf-editor/core": "^0.1.0-beta.4"
44
44
  },
45
45
  "devDependencies": {
46
46
  "prosemirror-state": "^1.4.3",
47
47
  "prosemirror-view": "^1.37.0",
48
- "@openleaf-editor/core": "0.1.0-beta.3"
48
+ "@openleaf-editor/core": "0.1.0-beta.4"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc -p tsconfig.json && node scripts/emit-css.mjs"