oasis-editor 0.0.23 → 0.0.24

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ as registerDomStatsSurface } from "./index-Cok7gHa_.js";
4
+ import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as getPageColumnRects, aq as findFootnoteReference, ar as FOOTNOTE_MARKER_GUTTER_PX, as as resolveImporterForFile, at as createEditorStateFromDocument, au as getDocumentParagraphsCanonical, av as getToolbarStyleState, aw as STANDARD_FONT_SIZES_PT, ax as fontSizePxToPt, ay as probeLocalFontFamilies, az as createInitialEditorState, aA as parseFontSizePtToPx, aB as formatFontSizePt, aC as listKindForTag, aD as isParagraphTag, aE as collectInlineRuns, aF as parseParagraphStyle, aG as t, aH as preciseFontModeVersion, aI as isPreciseFontModeEnabled, aJ as togglePreciseFontMode, aK as nextFontSizePt, aL as previousFontSizePt, aM as fontSizePtToPx, aN as createDefaultToolbarPreset, aO as defaultMenuItems, aP as MenuRegistry, aQ as createToolbarRegistry, aR as Editor, aS as resolveCommandRef, aT as commandRefName, aU as InlineShell, aV as BalloonShell, aW as DocumentShell, aX as createMemo, aY as getCaretRectFromSnapshot, aZ as getParagraphRectFromSnapshot, a_ as createComponent, a$ as CaretOverlay, b0 as Show, b1 as createRenderEffect, b2 as style, b3 as setAttribute, b4 as setStyleProperty, b5 as memo, b6 as template, b7 as insert, b8 as use, b9 as addEventListener, ba as Dialog, bb as delegateEvents, bc as className, bd as For, be as UNDERLINE_STYLE_OPTIONS, bf as Tabs, bg as measureParagraphMinContentWidthPx, bh as getEditableBlocksForZone, bi as findParagraphLocation, bj as createSectionBoundaryParagraph, bk as normalizePageSettings, bl as DEFAULT_EDITOR_PAGE_SETTINGS, bm as markStart, bn as markEnd, bo as getParagraphEntries, bp as getParagraphById, bq as PluginUiHost, br as OasisEditorEditor, bs as perfTimer, bt as OasisBrandMark, bu as setPreciseFontPreference, bv as setWelcomeSeen, bw as enablePreciseFontMode, bx as createOasisEditorClient, by as setLocale, bz as startLongTaskObserver, bA as installGlobalReport, bB as applyStoredPreciseFontPreference, bC as getWelcomeSeen, bD as isLocalFontAccessSupported, bE as EDITOR_SCROLL_PADDING_PX, bF as Toolbar, bG as OasisEditorLoading, bH as createEditorLogger, bI as getCachedCanvasImage, bJ as registerDomStatsSurface } from "./index-WKT6eKMj.js";
5
5
  function getSelectedObjectRun(state, predicate) {
6
6
  const normalized = normalizeSelection(state);
7
7
  if (normalized.isCollapsed || normalized.startIndex !== normalized.endIndex || normalized.endParagraphOffset - normalized.startParagraphOffset !== 1) {
@@ -2438,7 +2438,7 @@ function OasisEditorAppLazy(props = {}) {
2438
2438
  onCleanup(() => {
2439
2439
  cancelled = true;
2440
2440
  });
2441
- import("./OasisEditorApp-DsrdPjCM.js").then((m) => {
2441
+ import("./OasisEditorApp-Ckv1Glbw.js").then((m) => {
2442
2442
  cancelled = true;
2443
2443
  setProgress(1);
2444
2444
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -36497,7 +36497,7 @@ function ResizeHandlesOverlay(props) {
36497
36497
  })();
36498
36498
  }
36499
36499
  delegateEvents(["mousedown"]);
36500
- var _tmpl$$m = /* @__PURE__ */ template(`<div data-testid=editor-editor-shell><div class=oasis-editor-editor data-testid=editor-editor><div class=oasis-editor-editor-scroll-content data-testid=editor-editor-scroll-content><textarea aria-label="Editor input"autocomplete=off autocapitalize=off class=oasis-editor-input data-testid=editor-input value style=pointer-events:none></textarea><input data-testid=editor-import-docx-input type=file style=display:none><input accept="image/png, image/jpeg, image/gif"data-testid=editor-insert-image-input type=file style=display:none></div></div><div class=oasis-editor-statusbar data-testid=editor-statusbar><span class=oasis-editor-statusbar-item data-testid=editor-statusbar-word-count></span><span class=oasis-editor-statusbar-item data-testid=editor-statusbar-character-count></span><span class=oasis-editor-statusbar-item></span><div class=oasis-editor-statusbar-zoom data-testid=editor-statusbar-zoom-control><button type=button class=oasis-editor-zoom-button>−</button><input class=oasis-editor-zoom-slider type=range min=50 max=200 step=10><button type=button class=oasis-editor-zoom-button>+</button><span class="oasis-editor-statusbar-item oasis-editor-zoom-value"data-testid=editor-statusbar-zoom>%`), _tmpl$2$g = /* @__PURE__ */ template(`<div class=oasis-editor-import-overlay data-testid=editor-import-overlay role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-phase data-testid=editor-import-phase></div><div class=oasis-editor-import-progress-track><div class=oasis-editor-import-progress-bar data-testid=editor-import-progress-bar></div></div><div class=oasis-editor-import-progress-label>`), _tmpl$3$a = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>`), _tmpl$4$8 = /* @__PURE__ */ template(`<span class=oasis-editor-import-error-icon>`), _tmpl$5$7 = /* @__PURE__ */ template(`<span>`);
36500
+ var _tmpl$$m = /* @__PURE__ */ template(`<div data-testid=editor-editor-shell><div class=oasis-editor-editor data-testid=editor-editor><div class=oasis-editor-editor-zoom-sizer><div class=oasis-editor-editor-scroll-content data-testid=editor-editor-scroll-content style="position:absolute;top:0px;transform-origin:top left"><textarea aria-label="Editor input"autocomplete=off autocapitalize=off class=oasis-editor-input data-testid=editor-input value style=pointer-events:none></textarea><input data-testid=editor-import-docx-input type=file style=display:none><input accept="image/png, image/jpeg, image/gif"data-testid=editor-insert-image-input type=file style=display:none></div></div></div><div class=oasis-editor-statusbar data-testid=editor-statusbar><span class=oasis-editor-statusbar-item data-testid=editor-statusbar-word-count></span><span class=oasis-editor-statusbar-item data-testid=editor-statusbar-character-count></span><span class=oasis-editor-statusbar-item></span><div class=oasis-editor-statusbar-zoom data-testid=editor-statusbar-zoom-control><button type=button class=oasis-editor-zoom-button>−</button><input class=oasis-editor-zoom-slider type=range min=50 max=200 step=10><button type=button class=oasis-editor-zoom-button>+</button><span class="oasis-editor-statusbar-item oasis-editor-zoom-value"data-testid=editor-statusbar-zoom>%`), _tmpl$2$g = /* @__PURE__ */ template(`<div class=oasis-editor-import-overlay data-testid=editor-import-overlay role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-phase data-testid=editor-import-phase></div><div class=oasis-editor-import-progress-track><div class=oasis-editor-import-progress-bar data-testid=editor-import-progress-bar></div></div><div class=oasis-editor-import-progress-label>`), _tmpl$3$a = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>`), _tmpl$4$8 = /* @__PURE__ */ template(`<span class=oasis-editor-import-error-icon>`), _tmpl$5$7 = /* @__PURE__ */ template(`<span>`);
36501
36501
  const ZOOM_MIN = 50;
36502
36502
  const ZOOM_MAX = 200;
36503
36503
  const ZOOM_STEP = 10;
@@ -36543,6 +36543,16 @@ function OasisEditorEditor(props) {
36543
36543
  const adjustZoom = (delta) => {
36544
36544
  setZoomPercent((current) => clampZoom(current + delta));
36545
36545
  };
36546
+ const zoomFactor = createMemo(() => clampZoom(zoomPercent()) / 100);
36547
+ const [measuredContentHeight, setMeasuredContentHeight] = createSignal(0);
36548
+ const [viewportSize, setViewportSize] = createSignal({
36549
+ width: 0,
36550
+ height: 0
36551
+ });
36552
+ const unscaledContentWidth = () => widestPageWidth() + EDITOR_SCROLL_PADDING_PX * 2;
36553
+ const zoomSizerWidth = createMemo(() => Math.max(unscaledContentWidth() * zoomFactor(), viewportSize().width));
36554
+ const zoomSizerHeight = createMemo(() => Math.max(measuredContentHeight() * zoomFactor(), viewportSize().height));
36555
+ const zoomLayerLeft = createMemo(() => Math.max(0, (zoomSizerWidth() - unscaledContentWidth() * zoomFactor()) / 2));
36546
36556
  const statusDocumentLayout = createMemo(() => {
36547
36557
  var _a, _b, _c, _d;
36548
36558
  return projectDocumentLayout(documentForStats(), void 0, (_b = (_a = layout()).measuredBlockHeights) == null ? void 0 : _b.call(_a), (_d = (_c = layout()).measuredParagraphLayouts) == null ? void 0 : _d.call(_c));
@@ -36596,7 +36606,7 @@ function OasisEditorEditor(props) {
36596
36606
  queueMicrotask(recomputeViewportPageIndex);
36597
36607
  });
36598
36608
  return (() => {
36599
- var _el$ = _tmpl$$m(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$2.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.firstChild;
36609
+ var _el$ = _tmpl$$m(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$2.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.nextSibling, _el$14 = _el$13.nextSibling, _el$15 = _el$14.firstChild;
36600
36610
  insert(_el$, createComponent(Show, {
36601
36611
  get when() {
36602
36612
  return memo(() => !!layout().showHorizontalRuler)() && overlays().toolbarHost;
@@ -36630,16 +36640,40 @@ function OasisEditorEditor(props) {
36630
36640
  passive: true
36631
36641
  });
36632
36642
  queueMicrotask(recomputeViewportPageIndex);
36643
+ const updateViewportSize = () => {
36644
+ setViewportSize({
36645
+ width: el.clientWidth,
36646
+ height: el.clientHeight
36647
+ });
36648
+ };
36649
+ updateViewportSize();
36650
+ let viewportObserver;
36651
+ if (typeof ResizeObserver !== "undefined") {
36652
+ viewportObserver = new ResizeObserver(updateViewportSize);
36653
+ viewportObserver.observe(el);
36654
+ }
36633
36655
  onCleanup(() => {
36634
36656
  el.removeEventListener("scroll", onScroll);
36657
+ viewportObserver == null ? void 0 : viewportObserver.disconnect();
36635
36658
  });
36636
36659
  }, _el$2);
36637
36660
  use((el) => {
36638
36661
  var _a, _b;
36639
36662
  scrollContentRef = el;
36640
36663
  (_b = (_a = refs()).onSurfaceRef) == null ? void 0 : _b.call(_a, el);
36641
- }, _el$3);
36642
- insert(_el$3, createComponent(CanvasEditorSurface, {
36664
+ const updateContentHeight = () => {
36665
+ setMeasuredContentHeight(el.offsetHeight);
36666
+ };
36667
+ updateContentHeight();
36668
+ queueMicrotask(updateContentHeight);
36669
+ let contentObserver;
36670
+ if (typeof ResizeObserver !== "undefined") {
36671
+ contentObserver = new ResizeObserver(updateContentHeight);
36672
+ contentObserver.observe(el);
36673
+ }
36674
+ onCleanup(() => contentObserver == null ? void 0 : contentObserver.disconnect());
36675
+ }, _el$4);
36676
+ insert(_el$4, createComponent(CanvasEditorSurface, {
36643
36677
  get state() {
36644
36678
  return props.state;
36645
36679
  },
@@ -36683,8 +36717,8 @@ function OasisEditorEditor(props) {
36683
36717
  get onRevisionMouseLeave() {
36684
36718
  return surfaceHandlers().onRevisionMouseLeave;
36685
36719
  }
36686
- }), _el$4);
36687
- insert(_el$3, createComponent(Show, {
36720
+ }), _el$5);
36721
+ insert(_el$4, createComponent(Show, {
36688
36722
  get when() {
36689
36723
  return overlays().hoveredRevision();
36690
36724
  },
@@ -36693,8 +36727,8 @@ function OasisEditorEditor(props) {
36693
36727
  return revision();
36694
36728
  }
36695
36729
  })
36696
- }), _el$4);
36697
- insert(_el$3, createComponent(Show, {
36730
+ }), _el$5);
36731
+ insert(_el$4, createComponent(Show, {
36698
36732
  get when() {
36699
36733
  return overlays().selectionBoxes().length > 0;
36700
36734
  },
@@ -36705,8 +36739,8 @@ function OasisEditorEditor(props) {
36705
36739
  }
36706
36740
  });
36707
36741
  }
36708
- }), _el$4);
36709
- insert(_el$3, createComponent(Show, {
36742
+ }), _el$5);
36743
+ insert(_el$4, createComponent(Show, {
36710
36744
  get when() {
36711
36745
  return overlays().commentHighlights().length > 0;
36712
36746
  },
@@ -36718,8 +36752,8 @@ function OasisEditorEditor(props) {
36718
36752
  commentsById
36719
36753
  });
36720
36754
  }
36721
- }), _el$4);
36722
- insert(_el$3, createComponent(ResizeHandlesOverlay, {
36755
+ }), _el$5);
36756
+ insert(_el$4, createComponent(ResizeHandlesOverlay, {
36723
36757
  box: selectedImage,
36724
36758
  get readOnly() {
36725
36759
  return Boolean(layout().readOnly);
@@ -36746,8 +36780,8 @@ function OasisEditorEditor(props) {
36746
36780
  if (!image) return;
36747
36781
  surfaceHandlers().onImageMouseDown(image.paragraphId, image.startOffset, event);
36748
36782
  }
36749
- }), _el$4);
36750
- insert(_el$3, createComponent(ResizeHandlesOverlay, {
36783
+ }), _el$5);
36784
+ insert(_el$4, createComponent(ResizeHandlesOverlay, {
36751
36785
  box: selectedTextBox,
36752
36786
  get readOnly() {
36753
36787
  return Boolean(layout().readOnly);
@@ -36769,8 +36803,8 @@ function OasisEditorEditor(props) {
36769
36803
  if (!textBox) return;
36770
36804
  surfaceHandlers().onTextBoxRotateHandleMouseDown(textBox.paragraphId, textBox.startOffset, event);
36771
36805
  }
36772
- }), _el$4);
36773
- insert(_el$3, createComponent(Show, {
36806
+ }), _el$5);
36807
+ insert(_el$4, createComponent(Show, {
36774
36808
  get when() {
36775
36809
  return memo(() => !!overlays().toolbarHost)() && overlays().showFloatingTableToolbar;
36776
36810
  },
@@ -36788,8 +36822,8 @@ function OasisEditorEditor(props) {
36788
36822
  surfaceRef: () => scrollContentRef
36789
36823
  });
36790
36824
  }
36791
- }), _el$4);
36792
- insert(_el$3, createComponent(Show, {
36825
+ }), _el$5);
36826
+ insert(_el$4, createComponent(Show, {
36793
36827
  get when() {
36794
36828
  return overlays().layoutOptions;
36795
36829
  },
@@ -36803,8 +36837,8 @@ function OasisEditorEditor(props) {
36803
36837
  return Boolean(layout().readOnly);
36804
36838
  }
36805
36839
  })
36806
- }), _el$4);
36807
- insert(_el$3, createComponent(Show, {
36840
+ }), _el$5);
36841
+ insert(_el$4, createComponent(Show, {
36808
36842
  get when() {
36809
36843
  return overlays().showCaret();
36810
36844
  },
@@ -36824,25 +36858,25 @@ function OasisEditorEditor(props) {
36824
36858
  }
36825
36859
  });
36826
36860
  }
36827
- }), _el$4);
36828
- addEventListener(_el$4, "paste", inputHandlers().onPaste);
36829
- addEventListener(_el$4, "keydown", inputHandlers().onKeyDown, true);
36830
- addEventListener(_el$4, "input", inputHandlers().onInput, true);
36831
- addEventListener(_el$4, "focus", inputHandlers().onInputFocus);
36832
- addEventListener(_el$4, "cut", inputHandlers().onCut);
36833
- addEventListener(_el$4, "copy", inputHandlers().onCopy);
36834
- addEventListener(_el$4, "compositionstart", inputHandlers().onCompositionStart);
36835
- addEventListener(_el$4, "compositionend", inputHandlers().onCompositionEnd);
36836
- addEventListener(_el$4, "blur", inputHandlers().onInputBlur);
36861
+ }), _el$5);
36862
+ addEventListener(_el$5, "paste", inputHandlers().onPaste);
36863
+ addEventListener(_el$5, "keydown", inputHandlers().onKeyDown, true);
36864
+ addEventListener(_el$5, "input", inputHandlers().onInput, true);
36865
+ addEventListener(_el$5, "focus", inputHandlers().onInputFocus);
36866
+ addEventListener(_el$5, "cut", inputHandlers().onCut);
36867
+ addEventListener(_el$5, "copy", inputHandlers().onCopy);
36868
+ addEventListener(_el$5, "compositionstart", inputHandlers().onCompositionStart);
36869
+ addEventListener(_el$5, "compositionend", inputHandlers().onCompositionEnd);
36870
+ addEventListener(_el$5, "blur", inputHandlers().onInputBlur);
36837
36871
  var _ref$ = refs().onTextareaRef;
36838
- typeof _ref$ === "function" ? use(_ref$, _el$4) : refs().onTextareaRef = _el$4;
36839
- setAttribute(_el$4, "spellcheck", false);
36840
- addEventListener(_el$5, "change", fileHandlers().onImportInputChange);
36872
+ typeof _ref$ === "function" ? use(_ref$, _el$5) : refs().onTextareaRef = _el$5;
36873
+ setAttribute(_el$5, "spellcheck", false);
36874
+ addEventListener(_el$6, "change", fileHandlers().onImportInputChange);
36841
36875
  var _ref$2 = refs().onImportInputRef;
36842
- typeof _ref$2 === "function" ? use(_ref$2, _el$5) : refs().onImportInputRef = _el$5;
36843
- addEventListener(_el$6, "change", fileHandlers().onImageInputChange);
36876
+ typeof _ref$2 === "function" ? use(_ref$2, _el$6) : refs().onImportInputRef = _el$6;
36877
+ addEventListener(_el$7, "change", fileHandlers().onImageInputChange);
36844
36878
  var _ref$3 = refs().onImageInputRef;
36845
- typeof _ref$3 === "function" ? use(_ref$3, _el$6) : refs().onImageInputRef = _el$6;
36879
+ typeof _ref$3 === "function" ? use(_ref$3, _el$7) : refs().onImageInputRef = _el$7;
36846
36880
  insert(_el$, createComponent(Show, {
36847
36881
  get when() {
36848
36882
  var _a, _b;
@@ -36852,48 +36886,48 @@ function OasisEditorEditor(props) {
36852
36886
  const isDone = progress().phase === "done";
36853
36887
  const isError = progress().phase === "error";
36854
36888
  return (() => {
36855
- var _el$15 = _tmpl$2$g(), _el$16 = _el$15.firstChild, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling, _el$19 = _el$18.nextSibling, _el$20 = _el$19.firstChild, _el$21 = _el$19.nextSibling;
36856
- _el$15.classList.toggle("oasis-editor-import-overlay-done", !!isDone);
36857
- _el$15.classList.toggle("oasis-editor-import-overlay-error", !!isError);
36858
- setAttribute(_el$15, "aria-busy", !isDone && !isError);
36859
- insert(_el$16, createComponent(OasisBrandMark, {
36889
+ var _el$16 = _tmpl$2$g(), _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$19.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$20.nextSibling;
36890
+ _el$16.classList.toggle("oasis-editor-import-overlay-done", !!isDone);
36891
+ _el$16.classList.toggle("oasis-editor-import-overlay-error", !!isError);
36892
+ setAttribute(_el$16, "aria-busy", !isDone && !isError);
36893
+ insert(_el$17, createComponent(OasisBrandMark, {
36860
36894
  height: 40,
36861
36895
  "class": "oasis-editor-loading-mark"
36862
- }), _el$17);
36863
- insert(_el$17, () => t("import.overlay.title"));
36864
- insert(_el$18, () => t(`import.phase.${progress().phase}`));
36865
- _el$20.classList.toggle("oasis-editor-import-progress-bar-done", !!isDone);
36866
- _el$20.classList.toggle("oasis-editor-import-progress-bar-error", !!isError);
36867
- insert(_el$21, isDone ? (() => {
36868
- var _el$22 = _tmpl$3$a();
36869
- insert(_el$22, () => t("import.phase.done"));
36870
- return _el$22;
36871
- })() : isError ? (() => {
36872
- var _el$23 = _tmpl$4$8();
36873
- insert(_el$23, () => t("import.phase.error"));
36896
+ }), _el$18);
36897
+ insert(_el$18, () => t("import.overlay.title"));
36898
+ insert(_el$19, () => t(`import.phase.${progress().phase}`));
36899
+ _el$21.classList.toggle("oasis-editor-import-progress-bar-done", !!isDone);
36900
+ _el$21.classList.toggle("oasis-editor-import-progress-bar-error", !!isError);
36901
+ insert(_el$22, isDone ? (() => {
36902
+ var _el$23 = _tmpl$3$a();
36903
+ insert(_el$23, () => t("import.phase.done"));
36874
36904
  return _el$23;
36905
+ })() : isError ? (() => {
36906
+ var _el$24 = _tmpl$4$8();
36907
+ insert(_el$24, () => t("import.phase.error"));
36908
+ return _el$24;
36875
36909
  })() : [memo(() => Math.round(progress().progress)), "%"]);
36876
36910
  createRenderEffect((_p$) => {
36877
- var _v$13 = !!(progress().phase === "applying-editor-state" || progress().phase === "stabilizing-layout"), _v$14 = `${progress().progress}%`;
36878
- _v$13 !== _p$.e && _el$20.classList.toggle("oasis-editor-import-progress-bar-indeterminate", _p$.e = _v$13);
36879
- _v$14 !== _p$.t && setStyleProperty(_el$20, "width", _p$.t = _v$14);
36911
+ var _v$19 = !!(progress().phase === "applying-editor-state" || progress().phase === "stabilizing-layout"), _v$20 = `${progress().progress}%`;
36912
+ _v$19 !== _p$.e && _el$21.classList.toggle("oasis-editor-import-progress-bar-indeterminate", _p$.e = _v$19);
36913
+ _v$20 !== _p$.t && setStyleProperty(_el$21, "width", _p$.t = _v$20);
36880
36914
  return _p$;
36881
36915
  }, {
36882
36916
  e: void 0,
36883
36917
  t: void 0
36884
36918
  });
36885
- return _el$15;
36919
+ return _el$16;
36886
36920
  })();
36887
36921
  }
36888
- }), _el$7);
36889
- insert(_el$8, () => t("status.words", [wordCount()]));
36890
- insert(_el$9, () => t("status.characters", [characterCount()]));
36891
- insert(_el$0, () => t("status.page", [currentPage(), totalPages()]));
36892
- _el$10.$$click = () => adjustZoom(-ZOOM_STEP);
36893
- _el$11.$$input = (event) => setZoomPercent(clampZoom(event.currentTarget.valueAsNumber));
36894
- _el$12.$$click = () => adjustZoom(ZOOM_STEP);
36895
- insert(_el$13, zoomPercent, _el$14);
36896
- insert(_el$7, createComponent(Show, {
36922
+ }), _el$8);
36923
+ insert(_el$9, () => t("status.words", [wordCount()]));
36924
+ insert(_el$0, () => t("status.characters", [characterCount()]));
36925
+ insert(_el$1, () => t("status.page", [currentPage(), totalPages()]));
36926
+ _el$11.$$click = () => adjustZoom(-ZOOM_STEP);
36927
+ _el$12.$$input = (event) => setZoomPercent(clampZoom(event.currentTarget.valueAsNumber));
36928
+ _el$13.$$click = () => adjustZoom(ZOOM_STEP);
36929
+ insert(_el$14, zoomPercent, _el$15);
36930
+ insert(_el$8, createComponent(Show, {
36897
36931
  get when() {
36898
36932
  return overlays().persistenceStatus;
36899
36933
  },
@@ -36905,31 +36939,37 @@ function OasisEditorEditor(props) {
36905
36939
  return createComponent(Show, {
36906
36940
  when: key,
36907
36941
  get children() {
36908
- var _el$24 = _tmpl$5$7();
36909
- insert(_el$24, () => t(key));
36910
- createRenderEffect(() => className(_el$24, `oasis-editor-statusbar-item oasis-editor-persistence-status oasis-editor-status-${status.replace("...", "ing").replace(".", "")}`));
36911
- return _el$24;
36942
+ var _el$25 = _tmpl$5$7();
36943
+ insert(_el$25, () => t(key));
36944
+ createRenderEffect(() => className(_el$25, `oasis-editor-statusbar-item oasis-editor-persistence-status oasis-editor-status-${status.replace("...", "ing").replace(".", "")}`));
36945
+ return _el$25;
36912
36946
  }
36913
36947
  });
36914
36948
  })();
36915
36949
  }
36916
36950
  }), null);
36917
36951
  createRenderEffect((_p$) => {
36918
- var _v$ = `oasis-editor-editor-shell${layout().class ? ` ${layout().class}` : ""}`, _v$2 = shellStyle(), _v$3 = layout().readOnly, _v$4 = `${overlays().inputBox().left}px`, _v$5 = `${overlays().inputBox().top}px`, _v$6 = `${overlays().inputBox().height}px`, _v$7 = importFileAccept(), _v$8 = t("status.zoom"), _v$9 = `${t("status.zoom")} -`, _v$0 = zoomPercent() <= ZOOM_MIN, _v$1 = t("status.zoom"), _v$10 = `${zoomPercent()}%`, _v$11 = `${t("status.zoom")} +`, _v$12 = zoomPercent() >= ZOOM_MAX;
36952
+ var _v$ = `oasis-editor-editor-shell${layout().class ? ` ${layout().class}` : ""}`, _v$2 = shellStyle(), _v$3 = `${zoomSizerWidth()}px`, _v$4 = `${zoomSizerHeight()}px`, _v$5 = `${zoomLayerLeft()}px`, _v$6 = `${unscaledContentWidth()}px`, _v$7 = `${viewportSize().height / zoomFactor()}px`, _v$8 = `scale(${zoomFactor()})`, _v$9 = layout().readOnly, _v$0 = `${overlays().inputBox().left}px`, _v$1 = `${overlays().inputBox().top}px`, _v$10 = `${overlays().inputBox().height}px`, _v$11 = importFileAccept(), _v$12 = t("status.zoom"), _v$13 = `${t("status.zoom")} -`, _v$14 = zoomPercent() <= ZOOM_MIN, _v$15 = t("status.zoom"), _v$16 = `${zoomPercent()}%`, _v$17 = `${t("status.zoom")} +`, _v$18 = zoomPercent() >= ZOOM_MAX;
36919
36953
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
36920
36954
  _p$.t = style(_el$, _v$2, _p$.t);
36921
- _v$3 !== _p$.a && (_el$4.readOnly = _p$.a = _v$3);
36922
- _v$4 !== _p$.o && setStyleProperty(_el$4, "left", _p$.o = _v$4);
36923
- _v$5 !== _p$.i && setStyleProperty(_el$4, "top", _p$.i = _v$5);
36924
- _v$6 !== _p$.n && setStyleProperty(_el$4, "height", _p$.n = _v$6);
36925
- _v$7 !== _p$.s && setAttribute(_el$5, "accept", _p$.s = _v$7);
36926
- _v$8 !== _p$.h && setAttribute(_el$1, "aria-label", _p$.h = _v$8);
36927
- _v$9 !== _p$.r && setAttribute(_el$10, "aria-label", _p$.r = _v$9);
36928
- _v$0 !== _p$.d && (_el$10.disabled = _p$.d = _v$0);
36929
- _v$1 !== _p$.l && setAttribute(_el$11, "aria-label", _p$.l = _v$1);
36930
- _v$10 !== _p$.u && setAttribute(_el$11, "aria-valuetext", _p$.u = _v$10);
36931
- _v$11 !== _p$.c && setAttribute(_el$12, "aria-label", _p$.c = _v$11);
36932
- _v$12 !== _p$.w && (_el$12.disabled = _p$.w = _v$12);
36955
+ _v$3 !== _p$.a && setStyleProperty(_el$3, "width", _p$.a = _v$3);
36956
+ _v$4 !== _p$.o && setStyleProperty(_el$3, "height", _p$.o = _v$4);
36957
+ _v$5 !== _p$.i && setStyleProperty(_el$4, "left", _p$.i = _v$5);
36958
+ _v$6 !== _p$.n && setStyleProperty(_el$4, "width", _p$.n = _v$6);
36959
+ _v$7 !== _p$.s && setStyleProperty(_el$4, "min-height", _p$.s = _v$7);
36960
+ _v$8 !== _p$.h && setStyleProperty(_el$4, "transform", _p$.h = _v$8);
36961
+ _v$9 !== _p$.r && (_el$5.readOnly = _p$.r = _v$9);
36962
+ _v$0 !== _p$.d && setStyleProperty(_el$5, "left", _p$.d = _v$0);
36963
+ _v$1 !== _p$.l && setStyleProperty(_el$5, "top", _p$.l = _v$1);
36964
+ _v$10 !== _p$.u && setStyleProperty(_el$5, "height", _p$.u = _v$10);
36965
+ _v$11 !== _p$.c && setAttribute(_el$6, "accept", _p$.c = _v$11);
36966
+ _v$12 !== _p$.w && setAttribute(_el$10, "aria-label", _p$.w = _v$12);
36967
+ _v$13 !== _p$.m && setAttribute(_el$11, "aria-label", _p$.m = _v$13);
36968
+ _v$14 !== _p$.f && (_el$11.disabled = _p$.f = _v$14);
36969
+ _v$15 !== _p$.y && setAttribute(_el$12, "aria-label", _p$.y = _v$15);
36970
+ _v$16 !== _p$.g && setAttribute(_el$12, "aria-valuetext", _p$.g = _v$16);
36971
+ _v$17 !== _p$.p && setAttribute(_el$13, "aria-label", _p$.p = _v$17);
36972
+ _v$18 !== _p$.b && (_el$13.disabled = _p$.b = _v$18);
36933
36973
  return _p$;
36934
36974
  }, {
36935
36975
  e: void 0,
@@ -36945,9 +36985,15 @@ function OasisEditorEditor(props) {
36945
36985
  l: void 0,
36946
36986
  u: void 0,
36947
36987
  c: void 0,
36948
- w: void 0
36988
+ w: void 0,
36989
+ m: void 0,
36990
+ f: void 0,
36991
+ y: void 0,
36992
+ g: void 0,
36993
+ p: void 0,
36994
+ b: void 0
36949
36995
  });
36950
- createRenderEffect(() => _el$11.value = zoomPercent());
36996
+ createRenderEffect(() => _el$12.value = zoomPercent());
36951
36997
  return _el$;
36952
36998
  })();
36953
36999
  }