oasis-editor 0.0.23 → 0.0.25
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/{OasisEditorApp-DsrdPjCM.js → OasisEditorApp-y3iUL8-k.js} +38 -16
- package/dist/app/controllers/useEditorLayout.d.ts +2 -0
- package/dist/app/controllers/useEditorNavigation.d.ts +6 -0
- package/dist/{index-Cok7gHa_.js → index-Df7Ob0Ek.js} +213 -136
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +43 -43
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/OasisEditorEditor.d.ts +3 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +3 -0
- package/dist/ui/app/editorZoom.d.ts +25 -0
- package/dist/ui/app/useCanvasSurfaceHitResolver.d.ts +1 -0
- package/dist/ui/app/useEditorInteractionWiring.d.ts +1 -0
- package/dist/ui/canvas/CanvasHitTestService.d.ts +6 -0
- package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +29 -0
- package/package.json +1 -1
|
@@ -2438,7 +2438,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2438
2438
|
onCleanup(() => {
|
|
2439
2439
|
cancelled = true;
|
|
2440
2440
|
});
|
|
2441
|
-
import("./OasisEditorApp-
|
|
2441
|
+
import("./OasisEditorApp-y3iUL8-k.js").then((m) => {
|
|
2442
2442
|
cancelled = true;
|
|
2443
2443
|
setProgress(1);
|
|
2444
2444
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -18088,6 +18088,7 @@ function buildVerticalCellSnapshotLines(options) {
|
|
|
18088
18088
|
}
|
|
18089
18089
|
function buildCanvasLayoutSnapshot(options) {
|
|
18090
18090
|
const { surface, state } = options;
|
|
18091
|
+
const zoomFactor = options.zoomFactor && options.zoomFactor > 0 ? options.zoomFactor : 1;
|
|
18091
18092
|
const documentLayout = projectDocumentLayout(
|
|
18092
18093
|
state.document,
|
|
18093
18094
|
void 0,
|
|
@@ -18117,7 +18118,13 @@ function buildCanvasLayoutSnapshot(options) {
|
|
|
18117
18118
|
if (!pageElement) {
|
|
18118
18119
|
continue;
|
|
18119
18120
|
}
|
|
18120
|
-
const
|
|
18121
|
+
const rawPageRect = pageElement.getBoundingClientRect();
|
|
18122
|
+
const pageRect = {
|
|
18123
|
+
left: surfaceRect.left + (rawPageRect.left - surfaceRect.left) / zoomFactor,
|
|
18124
|
+
top: surfaceRect.top + (rawPageRect.top - surfaceRect.top) / zoomFactor,
|
|
18125
|
+
width: rawPageRect.width / zoomFactor,
|
|
18126
|
+
height: rawPageRect.height / zoomFactor
|
|
18127
|
+
};
|
|
18121
18128
|
const bodyTop = page.bodyTop ?? getPageBodyTop(page.pageSettings);
|
|
18122
18129
|
const bodyBottom = page.bodyBottom ?? getPageBodyBottom(page.pageSettings);
|
|
18123
18130
|
const headerTop = page.headerTop ?? getPageHeaderZoneTop(page.pageSettings);
|
|
@@ -36497,14 +36504,22 @@ function ResizeHandlesOverlay(props) {
|
|
|
36497
36504
|
})();
|
|
36498
36505
|
}
|
|
36499
36506
|
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>`);
|
|
36501
36507
|
const ZOOM_MIN = 50;
|
|
36502
36508
|
const ZOOM_MAX = 200;
|
|
36503
36509
|
const ZOOM_STEP = 10;
|
|
36510
|
+
const ZOOM_DEFAULT = 100;
|
|
36504
36511
|
function clampZoom(value) {
|
|
36505
|
-
if (!Number.isFinite(value)) return
|
|
36512
|
+
if (!Number.isFinite(value)) return ZOOM_DEFAULT;
|
|
36506
36513
|
return Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, Math.round(value)));
|
|
36507
36514
|
}
|
|
36515
|
+
function createEditorZoom(initial = ZOOM_DEFAULT) {
|
|
36516
|
+
const [zoomPercent, setZoomPercentRaw] = createSignal(clampZoom(initial));
|
|
36517
|
+
const setZoomPercent = (value) => setZoomPercentRaw(clampZoom(value));
|
|
36518
|
+
const adjustZoom = (delta) => setZoomPercentRaw((current) => clampZoom(current + delta));
|
|
36519
|
+
const zoomFactor = createMemo(() => zoomPercent() / 100);
|
|
36520
|
+
return { zoomPercent, setZoomPercent, adjustZoom, zoomFactor };
|
|
36521
|
+
}
|
|
36522
|
+
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><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>`);
|
|
36508
36523
|
function OasisEditorEditor(props) {
|
|
36509
36524
|
const layout = () => props.layout ?? {};
|
|
36510
36525
|
const overlays = () => props.overlays;
|
|
@@ -36539,10 +36554,32 @@ function OasisEditorEditor(props) {
|
|
|
36539
36554
|
const documentForStats = createMemo(() => props.state().document);
|
|
36540
36555
|
const characterCount = createMemo(() => getDocumentCharacterCount(documentForStats()));
|
|
36541
36556
|
const wordCount = createMemo(() => getDocumentWordCount(documentForStats()));
|
|
36542
|
-
const [
|
|
36543
|
-
const
|
|
36544
|
-
|
|
36557
|
+
const [localZoomPercent, setLocalZoomPercent] = createSignal(100);
|
|
36558
|
+
const zoomPercent = () => {
|
|
36559
|
+
var _a, _b;
|
|
36560
|
+
return ((_b = (_a = layout()).zoomPercent) == null ? void 0 : _b.call(_a)) ?? localZoomPercent();
|
|
36561
|
+
};
|
|
36562
|
+
const setZoomPercent = (value) => {
|
|
36563
|
+
const clamped = clampZoom(value);
|
|
36564
|
+
const lift = layout().setZoomPercent;
|
|
36565
|
+
if (lift) lift(clamped);
|
|
36566
|
+
else setLocalZoomPercent(clamped);
|
|
36567
|
+
};
|
|
36568
|
+
const adjustZoom = (delta) => setZoomPercent(zoomPercent() + delta);
|
|
36569
|
+
const fallbackZoomFactor = createMemo(() => clampZoom(zoomPercent()) / 100);
|
|
36570
|
+
const zoomFactor = () => {
|
|
36571
|
+
var _a, _b;
|
|
36572
|
+
return ((_b = (_a = layout()).zoomFactor) == null ? void 0 : _b.call(_a)) ?? fallbackZoomFactor();
|
|
36545
36573
|
};
|
|
36574
|
+
const [measuredContentHeight, setMeasuredContentHeight] = createSignal(0);
|
|
36575
|
+
const [viewportSize, setViewportSize] = createSignal({
|
|
36576
|
+
width: 0,
|
|
36577
|
+
height: 0
|
|
36578
|
+
});
|
|
36579
|
+
const unscaledContentWidth = () => widestPageWidth() + EDITOR_SCROLL_PADDING_PX * 2;
|
|
36580
|
+
const zoomSizerWidth = createMemo(() => Math.max(unscaledContentWidth() * zoomFactor(), viewportSize().width));
|
|
36581
|
+
const zoomSizerHeight = createMemo(() => Math.max(measuredContentHeight() * zoomFactor(), viewportSize().height));
|
|
36582
|
+
const zoomLayerLeft = createMemo(() => Math.max(0, (zoomSizerWidth() - unscaledContentWidth() * zoomFactor()) / 2));
|
|
36546
36583
|
const statusDocumentLayout = createMemo(() => {
|
|
36547
36584
|
var _a, _b, _c, _d;
|
|
36548
36585
|
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 +36633,7 @@ function OasisEditorEditor(props) {
|
|
|
36596
36633
|
queueMicrotask(recomputeViewportPageIndex);
|
|
36597
36634
|
});
|
|
36598
36635
|
return (() => {
|
|
36599
|
-
var _el$ = _tmpl$$m(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.
|
|
36636
|
+
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
36637
|
insert(_el$, createComponent(Show, {
|
|
36601
36638
|
get when() {
|
|
36602
36639
|
return memo(() => !!layout().showHorizontalRuler)() && overlays().toolbarHost;
|
|
@@ -36630,16 +36667,40 @@ function OasisEditorEditor(props) {
|
|
|
36630
36667
|
passive: true
|
|
36631
36668
|
});
|
|
36632
36669
|
queueMicrotask(recomputeViewportPageIndex);
|
|
36670
|
+
const updateViewportSize = () => {
|
|
36671
|
+
setViewportSize({
|
|
36672
|
+
width: el.clientWidth,
|
|
36673
|
+
height: el.clientHeight
|
|
36674
|
+
});
|
|
36675
|
+
};
|
|
36676
|
+
updateViewportSize();
|
|
36677
|
+
let viewportObserver;
|
|
36678
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
36679
|
+
viewportObserver = new ResizeObserver(updateViewportSize);
|
|
36680
|
+
viewportObserver.observe(el);
|
|
36681
|
+
}
|
|
36633
36682
|
onCleanup(() => {
|
|
36634
36683
|
el.removeEventListener("scroll", onScroll);
|
|
36684
|
+
viewportObserver == null ? void 0 : viewportObserver.disconnect();
|
|
36635
36685
|
});
|
|
36636
36686
|
}, _el$2);
|
|
36637
36687
|
use((el) => {
|
|
36638
36688
|
var _a, _b;
|
|
36639
36689
|
scrollContentRef = el;
|
|
36640
36690
|
(_b = (_a = refs()).onSurfaceRef) == null ? void 0 : _b.call(_a, el);
|
|
36641
|
-
|
|
36642
|
-
|
|
36691
|
+
const updateContentHeight = () => {
|
|
36692
|
+
setMeasuredContentHeight(el.offsetHeight);
|
|
36693
|
+
};
|
|
36694
|
+
updateContentHeight();
|
|
36695
|
+
queueMicrotask(updateContentHeight);
|
|
36696
|
+
let contentObserver;
|
|
36697
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
36698
|
+
contentObserver = new ResizeObserver(updateContentHeight);
|
|
36699
|
+
contentObserver.observe(el);
|
|
36700
|
+
}
|
|
36701
|
+
onCleanup(() => contentObserver == null ? void 0 : contentObserver.disconnect());
|
|
36702
|
+
}, _el$4);
|
|
36703
|
+
insert(_el$4, createComponent(CanvasEditorSurface, {
|
|
36643
36704
|
get state() {
|
|
36644
36705
|
return props.state;
|
|
36645
36706
|
},
|
|
@@ -36683,8 +36744,8 @@ function OasisEditorEditor(props) {
|
|
|
36683
36744
|
get onRevisionMouseLeave() {
|
|
36684
36745
|
return surfaceHandlers().onRevisionMouseLeave;
|
|
36685
36746
|
}
|
|
36686
|
-
}), _el$
|
|
36687
|
-
insert(_el$
|
|
36747
|
+
}), _el$5);
|
|
36748
|
+
insert(_el$4, createComponent(Show, {
|
|
36688
36749
|
get when() {
|
|
36689
36750
|
return overlays().hoveredRevision();
|
|
36690
36751
|
},
|
|
@@ -36693,8 +36754,8 @@ function OasisEditorEditor(props) {
|
|
|
36693
36754
|
return revision();
|
|
36694
36755
|
}
|
|
36695
36756
|
})
|
|
36696
|
-
}), _el$
|
|
36697
|
-
insert(_el$
|
|
36757
|
+
}), _el$5);
|
|
36758
|
+
insert(_el$4, createComponent(Show, {
|
|
36698
36759
|
get when() {
|
|
36699
36760
|
return overlays().selectionBoxes().length > 0;
|
|
36700
36761
|
},
|
|
@@ -36705,8 +36766,8 @@ function OasisEditorEditor(props) {
|
|
|
36705
36766
|
}
|
|
36706
36767
|
});
|
|
36707
36768
|
}
|
|
36708
|
-
}), _el$
|
|
36709
|
-
insert(_el$
|
|
36769
|
+
}), _el$5);
|
|
36770
|
+
insert(_el$4, createComponent(Show, {
|
|
36710
36771
|
get when() {
|
|
36711
36772
|
return overlays().commentHighlights().length > 0;
|
|
36712
36773
|
},
|
|
@@ -36718,8 +36779,8 @@ function OasisEditorEditor(props) {
|
|
|
36718
36779
|
commentsById
|
|
36719
36780
|
});
|
|
36720
36781
|
}
|
|
36721
|
-
}), _el$
|
|
36722
|
-
insert(_el$
|
|
36782
|
+
}), _el$5);
|
|
36783
|
+
insert(_el$4, createComponent(ResizeHandlesOverlay, {
|
|
36723
36784
|
box: selectedImage,
|
|
36724
36785
|
get readOnly() {
|
|
36725
36786
|
return Boolean(layout().readOnly);
|
|
@@ -36746,8 +36807,8 @@ function OasisEditorEditor(props) {
|
|
|
36746
36807
|
if (!image) return;
|
|
36747
36808
|
surfaceHandlers().onImageMouseDown(image.paragraphId, image.startOffset, event);
|
|
36748
36809
|
}
|
|
36749
|
-
}), _el$
|
|
36750
|
-
insert(_el$
|
|
36810
|
+
}), _el$5);
|
|
36811
|
+
insert(_el$4, createComponent(ResizeHandlesOverlay, {
|
|
36751
36812
|
box: selectedTextBox,
|
|
36752
36813
|
get readOnly() {
|
|
36753
36814
|
return Boolean(layout().readOnly);
|
|
@@ -36769,8 +36830,8 @@ function OasisEditorEditor(props) {
|
|
|
36769
36830
|
if (!textBox) return;
|
|
36770
36831
|
surfaceHandlers().onTextBoxRotateHandleMouseDown(textBox.paragraphId, textBox.startOffset, event);
|
|
36771
36832
|
}
|
|
36772
|
-
}), _el$
|
|
36773
|
-
insert(_el$
|
|
36833
|
+
}), _el$5);
|
|
36834
|
+
insert(_el$4, createComponent(Show, {
|
|
36774
36835
|
get when() {
|
|
36775
36836
|
return memo(() => !!overlays().toolbarHost)() && overlays().showFloatingTableToolbar;
|
|
36776
36837
|
},
|
|
@@ -36788,8 +36849,8 @@ function OasisEditorEditor(props) {
|
|
|
36788
36849
|
surfaceRef: () => scrollContentRef
|
|
36789
36850
|
});
|
|
36790
36851
|
}
|
|
36791
|
-
}), _el$
|
|
36792
|
-
insert(_el$
|
|
36852
|
+
}), _el$5);
|
|
36853
|
+
insert(_el$4, createComponent(Show, {
|
|
36793
36854
|
get when() {
|
|
36794
36855
|
return overlays().layoutOptions;
|
|
36795
36856
|
},
|
|
@@ -36803,8 +36864,8 @@ function OasisEditorEditor(props) {
|
|
|
36803
36864
|
return Boolean(layout().readOnly);
|
|
36804
36865
|
}
|
|
36805
36866
|
})
|
|
36806
|
-
}), _el$
|
|
36807
|
-
insert(_el$
|
|
36867
|
+
}), _el$5);
|
|
36868
|
+
insert(_el$4, createComponent(Show, {
|
|
36808
36869
|
get when() {
|
|
36809
36870
|
return overlays().showCaret();
|
|
36810
36871
|
},
|
|
@@ -36824,25 +36885,25 @@ function OasisEditorEditor(props) {
|
|
|
36824
36885
|
}
|
|
36825
36886
|
});
|
|
36826
36887
|
}
|
|
36827
|
-
}), _el$
|
|
36828
|
-
addEventListener(_el$
|
|
36829
|
-
addEventListener(_el$
|
|
36830
|
-
addEventListener(_el$
|
|
36831
|
-
addEventListener(_el$
|
|
36832
|
-
addEventListener(_el$
|
|
36833
|
-
addEventListener(_el$
|
|
36834
|
-
addEventListener(_el$
|
|
36835
|
-
addEventListener(_el$
|
|
36836
|
-
addEventListener(_el$
|
|
36888
|
+
}), _el$5);
|
|
36889
|
+
addEventListener(_el$5, "paste", inputHandlers().onPaste);
|
|
36890
|
+
addEventListener(_el$5, "keydown", inputHandlers().onKeyDown, true);
|
|
36891
|
+
addEventListener(_el$5, "input", inputHandlers().onInput, true);
|
|
36892
|
+
addEventListener(_el$5, "focus", inputHandlers().onInputFocus);
|
|
36893
|
+
addEventListener(_el$5, "cut", inputHandlers().onCut);
|
|
36894
|
+
addEventListener(_el$5, "copy", inputHandlers().onCopy);
|
|
36895
|
+
addEventListener(_el$5, "compositionstart", inputHandlers().onCompositionStart);
|
|
36896
|
+
addEventListener(_el$5, "compositionend", inputHandlers().onCompositionEnd);
|
|
36897
|
+
addEventListener(_el$5, "blur", inputHandlers().onInputBlur);
|
|
36837
36898
|
var _ref$ = refs().onTextareaRef;
|
|
36838
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
36839
|
-
setAttribute(_el$
|
|
36840
|
-
addEventListener(_el$
|
|
36899
|
+
typeof _ref$ === "function" ? use(_ref$, _el$5) : refs().onTextareaRef = _el$5;
|
|
36900
|
+
setAttribute(_el$5, "spellcheck", false);
|
|
36901
|
+
addEventListener(_el$6, "change", fileHandlers().onImportInputChange);
|
|
36841
36902
|
var _ref$2 = refs().onImportInputRef;
|
|
36842
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$
|
|
36843
|
-
addEventListener(_el$
|
|
36903
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$6) : refs().onImportInputRef = _el$6;
|
|
36904
|
+
addEventListener(_el$7, "change", fileHandlers().onImageInputChange);
|
|
36844
36905
|
var _ref$3 = refs().onImageInputRef;
|
|
36845
|
-
typeof _ref$3 === "function" ? use(_ref$3, _el$
|
|
36906
|
+
typeof _ref$3 === "function" ? use(_ref$3, _el$7) : refs().onImageInputRef = _el$7;
|
|
36846
36907
|
insert(_el$, createComponent(Show, {
|
|
36847
36908
|
get when() {
|
|
36848
36909
|
var _a, _b;
|
|
@@ -36852,48 +36913,51 @@ function OasisEditorEditor(props) {
|
|
|
36852
36913
|
const isDone = progress().phase === "done";
|
|
36853
36914
|
const isError = progress().phase === "error";
|
|
36854
36915
|
return (() => {
|
|
36855
|
-
var _el$
|
|
36856
|
-
_el$
|
|
36857
|
-
_el$
|
|
36858
|
-
setAttribute(_el$
|
|
36859
|
-
insert(_el$
|
|
36916
|
+
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;
|
|
36917
|
+
_el$16.classList.toggle("oasis-editor-import-overlay-done", !!isDone);
|
|
36918
|
+
_el$16.classList.toggle("oasis-editor-import-overlay-error", !!isError);
|
|
36919
|
+
setAttribute(_el$16, "aria-busy", !isDone && !isError);
|
|
36920
|
+
insert(_el$17, createComponent(OasisBrandMark, {
|
|
36860
36921
|
height: 40,
|
|
36861
36922
|
"class": "oasis-editor-loading-mark"
|
|
36862
|
-
}), _el$
|
|
36863
|
-
insert(_el$
|
|
36864
|
-
insert(_el$
|
|
36865
|
-
_el$
|
|
36866
|
-
_el$
|
|
36867
|
-
insert(_el$
|
|
36868
|
-
var _el$
|
|
36869
|
-
insert(_el$
|
|
36870
|
-
return _el$22;
|
|
36871
|
-
})() : isError ? (() => {
|
|
36872
|
-
var _el$23 = _tmpl$4$8();
|
|
36873
|
-
insert(_el$23, () => t("import.phase.error"));
|
|
36923
|
+
}), _el$18);
|
|
36924
|
+
insert(_el$18, () => t("import.overlay.title"));
|
|
36925
|
+
insert(_el$19, () => t(`import.phase.${progress().phase}`));
|
|
36926
|
+
_el$21.classList.toggle("oasis-editor-import-progress-bar-done", !!isDone);
|
|
36927
|
+
_el$21.classList.toggle("oasis-editor-import-progress-bar-error", !!isError);
|
|
36928
|
+
insert(_el$22, isDone ? (() => {
|
|
36929
|
+
var _el$23 = _tmpl$3$a();
|
|
36930
|
+
insert(_el$23, () => t("import.phase.done"));
|
|
36874
36931
|
return _el$23;
|
|
36932
|
+
})() : isError ? (() => {
|
|
36933
|
+
var _el$24 = _tmpl$4$8();
|
|
36934
|
+
insert(_el$24, () => t("import.phase.error"));
|
|
36935
|
+
return _el$24;
|
|
36875
36936
|
})() : [memo(() => Math.round(progress().progress)), "%"]);
|
|
36876
36937
|
createRenderEffect((_p$) => {
|
|
36877
|
-
var _v$
|
|
36878
|
-
_v$
|
|
36879
|
-
_v$
|
|
36938
|
+
var _v$19 = !!(progress().phase === "applying-editor-state" || progress().phase === "stabilizing-layout"), _v$20 = `${progress().progress}%`;
|
|
36939
|
+
_v$19 !== _p$.e && _el$21.classList.toggle("oasis-editor-import-progress-bar-indeterminate", _p$.e = _v$19);
|
|
36940
|
+
_v$20 !== _p$.t && setStyleProperty(_el$21, "width", _p$.t = _v$20);
|
|
36880
36941
|
return _p$;
|
|
36881
36942
|
}, {
|
|
36882
36943
|
e: void 0,
|
|
36883
36944
|
t: void 0
|
|
36884
36945
|
});
|
|
36885
|
-
return _el$
|
|
36946
|
+
return _el$16;
|
|
36886
36947
|
})();
|
|
36887
36948
|
}
|
|
36888
|
-
}), _el$
|
|
36889
|
-
insert(_el$
|
|
36890
|
-
insert(_el$
|
|
36891
|
-
insert(_el$
|
|
36892
|
-
_el$
|
|
36893
|
-
_el$
|
|
36894
|
-
_el$12
|
|
36895
|
-
|
|
36896
|
-
|
|
36949
|
+
}), _el$8);
|
|
36950
|
+
insert(_el$9, () => t("status.words", [wordCount()]));
|
|
36951
|
+
insert(_el$0, () => t("status.characters", [characterCount()]));
|
|
36952
|
+
insert(_el$1, () => t("status.page", [currentPage(), totalPages()]));
|
|
36953
|
+
_el$11.$$click = () => adjustZoom(-ZOOM_STEP);
|
|
36954
|
+
_el$12.$$input = (event) => setZoomPercent(clampZoom(event.currentTarget.valueAsNumber));
|
|
36955
|
+
setAttribute(_el$12, "min", ZOOM_MIN);
|
|
36956
|
+
setAttribute(_el$12, "max", ZOOM_MAX);
|
|
36957
|
+
setAttribute(_el$12, "step", ZOOM_STEP);
|
|
36958
|
+
_el$13.$$click = () => adjustZoom(ZOOM_STEP);
|
|
36959
|
+
insert(_el$14, zoomPercent, _el$15);
|
|
36960
|
+
insert(_el$8, createComponent(Show, {
|
|
36897
36961
|
get when() {
|
|
36898
36962
|
return overlays().persistenceStatus;
|
|
36899
36963
|
},
|
|
@@ -36905,31 +36969,37 @@ function OasisEditorEditor(props) {
|
|
|
36905
36969
|
return createComponent(Show, {
|
|
36906
36970
|
when: key,
|
|
36907
36971
|
get children() {
|
|
36908
|
-
var _el$
|
|
36909
|
-
insert(_el$
|
|
36910
|
-
createRenderEffect(() => className(_el$
|
|
36911
|
-
return _el$
|
|
36972
|
+
var _el$25 = _tmpl$5$7();
|
|
36973
|
+
insert(_el$25, () => t(key));
|
|
36974
|
+
createRenderEffect(() => className(_el$25, `oasis-editor-statusbar-item oasis-editor-persistence-status oasis-editor-status-${status.replace("...", "ing").replace(".", "")}`));
|
|
36975
|
+
return _el$25;
|
|
36912
36976
|
}
|
|
36913
36977
|
});
|
|
36914
36978
|
})();
|
|
36915
36979
|
}
|
|
36916
36980
|
}), null);
|
|
36917
36981
|
createRenderEffect((_p$) => {
|
|
36918
|
-
var _v$ = `oasis-editor-editor-shell${layout().class ? ` ${layout().class}` : ""}`, _v$2 = shellStyle(), _v$3 = layout().readOnly, _v$
|
|
36982
|
+
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
36983
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
36920
36984
|
_p$.t = style(_el$, _v$2, _p$.t);
|
|
36921
|
-
_v$3 !== _p$.a && (_el$
|
|
36922
|
-
_v$4 !== _p$.o && setStyleProperty(_el$
|
|
36923
|
-
_v$5 !== _p$.i && setStyleProperty(_el$4, "
|
|
36924
|
-
_v$6 !== _p$.n && setStyleProperty(_el$4, "
|
|
36925
|
-
_v$7 !== _p$.s &&
|
|
36926
|
-
_v$8 !== _p$.h &&
|
|
36927
|
-
_v$9 !== _p$.r &&
|
|
36928
|
-
_v$0 !== _p$.d && (_el$
|
|
36929
|
-
_v$1 !== _p$.l &&
|
|
36930
|
-
_v$10 !== _p$.u &&
|
|
36931
|
-
_v$11 !== _p$.c && setAttribute(_el$
|
|
36932
|
-
_v$12 !== _p$.w && (_el$
|
|
36985
|
+
_v$3 !== _p$.a && setStyleProperty(_el$3, "width", _p$.a = _v$3);
|
|
36986
|
+
_v$4 !== _p$.o && setStyleProperty(_el$3, "height", _p$.o = _v$4);
|
|
36987
|
+
_v$5 !== _p$.i && setStyleProperty(_el$4, "left", _p$.i = _v$5);
|
|
36988
|
+
_v$6 !== _p$.n && setStyleProperty(_el$4, "width", _p$.n = _v$6);
|
|
36989
|
+
_v$7 !== _p$.s && setStyleProperty(_el$4, "min-height", _p$.s = _v$7);
|
|
36990
|
+
_v$8 !== _p$.h && setStyleProperty(_el$4, "transform", _p$.h = _v$8);
|
|
36991
|
+
_v$9 !== _p$.r && (_el$5.readOnly = _p$.r = _v$9);
|
|
36992
|
+
_v$0 !== _p$.d && setStyleProperty(_el$5, "left", _p$.d = _v$0);
|
|
36993
|
+
_v$1 !== _p$.l && setStyleProperty(_el$5, "top", _p$.l = _v$1);
|
|
36994
|
+
_v$10 !== _p$.u && setStyleProperty(_el$5, "height", _p$.u = _v$10);
|
|
36995
|
+
_v$11 !== _p$.c && setAttribute(_el$6, "accept", _p$.c = _v$11);
|
|
36996
|
+
_v$12 !== _p$.w && setAttribute(_el$10, "aria-label", _p$.w = _v$12);
|
|
36997
|
+
_v$13 !== _p$.m && setAttribute(_el$11, "aria-label", _p$.m = _v$13);
|
|
36998
|
+
_v$14 !== _p$.f && (_el$11.disabled = _p$.f = _v$14);
|
|
36999
|
+
_v$15 !== _p$.y && setAttribute(_el$12, "aria-label", _p$.y = _v$15);
|
|
37000
|
+
_v$16 !== _p$.g && setAttribute(_el$12, "aria-valuetext", _p$.g = _v$16);
|
|
37001
|
+
_v$17 !== _p$.p && setAttribute(_el$13, "aria-label", _p$.p = _v$17);
|
|
37002
|
+
_v$18 !== _p$.b && (_el$13.disabled = _p$.b = _v$18);
|
|
36933
37003
|
return _p$;
|
|
36934
37004
|
}, {
|
|
36935
37005
|
e: void 0,
|
|
@@ -36945,9 +37015,15 @@ function OasisEditorEditor(props) {
|
|
|
36945
37015
|
l: void 0,
|
|
36946
37016
|
u: void 0,
|
|
36947
37017
|
c: void 0,
|
|
36948
|
-
w: void 0
|
|
37018
|
+
w: void 0,
|
|
37019
|
+
m: void 0,
|
|
37020
|
+
f: void 0,
|
|
37021
|
+
y: void 0,
|
|
37022
|
+
g: void 0,
|
|
37023
|
+
p: void 0,
|
|
37024
|
+
b: void 0
|
|
36949
37025
|
});
|
|
36950
|
-
createRenderEffect(() => _el$
|
|
37026
|
+
createRenderEffect(() => _el$12.value = zoomPercent());
|
|
36951
37027
|
return _el$;
|
|
36952
37028
|
})();
|
|
36953
37029
|
}
|
|
@@ -40104,7 +40180,7 @@ export {
|
|
|
40104
40180
|
probeLocalFontFamilies as ay,
|
|
40105
40181
|
createInitialEditorState as az,
|
|
40106
40182
|
createEditorRun as b,
|
|
40107
|
-
|
|
40183
|
+
Popover as b$,
|
|
40108
40184
|
Show as b0,
|
|
40109
40185
|
createRenderEffect as b1,
|
|
40110
40186
|
style as b2,
|
|
@@ -40115,33 +40191,33 @@ export {
|
|
|
40115
40191
|
insert as b7,
|
|
40116
40192
|
use as b8,
|
|
40117
40193
|
addEventListener as b9,
|
|
40118
|
-
|
|
40119
|
-
|
|
40120
|
-
|
|
40121
|
-
|
|
40122
|
-
|
|
40123
|
-
|
|
40124
|
-
|
|
40125
|
-
|
|
40126
|
-
|
|
40127
|
-
|
|
40128
|
-
|
|
40129
|
-
|
|
40130
|
-
|
|
40131
|
-
|
|
40132
|
-
|
|
40133
|
-
|
|
40134
|
-
|
|
40135
|
-
|
|
40136
|
-
|
|
40137
|
-
|
|
40138
|
-
|
|
40139
|
-
|
|
40140
|
-
|
|
40141
|
-
|
|
40142
|
-
|
|
40143
|
-
|
|
40144
|
-
|
|
40194
|
+
startLongTaskObserver as bA,
|
|
40195
|
+
installGlobalReport as bB,
|
|
40196
|
+
applyStoredPreciseFontPreference as bC,
|
|
40197
|
+
getWelcomeSeen as bD,
|
|
40198
|
+
isLocalFontAccessSupported as bE,
|
|
40199
|
+
EDITOR_SCROLL_PADDING_PX as bF,
|
|
40200
|
+
Toolbar as bG,
|
|
40201
|
+
OasisEditorLoading as bH,
|
|
40202
|
+
createEditorLogger as bI,
|
|
40203
|
+
getCachedCanvasImage as bJ,
|
|
40204
|
+
registerDomStatsSurface as bK,
|
|
40205
|
+
Button as bL,
|
|
40206
|
+
Checkbox as bM,
|
|
40207
|
+
ColorPicker as bN,
|
|
40208
|
+
CommandRegistry as bO,
|
|
40209
|
+
DEFAULT_PALETTE as bP,
|
|
40210
|
+
DialogFooter as bQ,
|
|
40211
|
+
FloatingActionButton as bR,
|
|
40212
|
+
GridPicker as bS,
|
|
40213
|
+
IconButton as bT,
|
|
40214
|
+
Menu as bU,
|
|
40215
|
+
OASIS_BUILTIN_COMMANDS as bV,
|
|
40216
|
+
OASIS_MENU_ITEMS as bW,
|
|
40217
|
+
OASIS_TOOLBAR_ITEMS as bX,
|
|
40218
|
+
OasisEditorAppLazy as bY,
|
|
40219
|
+
OasisEditorContainer as bZ,
|
|
40220
|
+
PluginCollection as b_,
|
|
40145
40221
|
Dialog as ba,
|
|
40146
40222
|
delegateEvents as bb,
|
|
40147
40223
|
className as bc,
|
|
@@ -40167,24 +40243,25 @@ export {
|
|
|
40167
40243
|
enablePreciseFontMode as bw,
|
|
40168
40244
|
createOasisEditorClient as bx,
|
|
40169
40245
|
setLocale as by,
|
|
40170
|
-
|
|
40246
|
+
createEditorZoom as bz,
|
|
40171
40247
|
createEditorParagraphFromRuns as c,
|
|
40172
|
-
|
|
40173
|
-
|
|
40174
|
-
|
|
40175
|
-
|
|
40176
|
-
|
|
40177
|
-
|
|
40178
|
-
|
|
40179
|
-
|
|
40180
|
-
|
|
40181
|
-
|
|
40182
|
-
|
|
40183
|
-
|
|
40184
|
-
|
|
40185
|
-
|
|
40186
|
-
|
|
40187
|
-
|
|
40248
|
+
RIBBON_TABS as c0,
|
|
40249
|
+
RIBBON_TAB_DEFINITIONS as c1,
|
|
40250
|
+
Select as c2,
|
|
40251
|
+
SelectField as c3,
|
|
40252
|
+
Separator as c4,
|
|
40253
|
+
SidePanel as c5,
|
|
40254
|
+
SidePanelBody as c6,
|
|
40255
|
+
SidePanelFooter as c7,
|
|
40256
|
+
SidePanelHeader as c8,
|
|
40257
|
+
SplitButton as c9,
|
|
40258
|
+
TextField as ca,
|
|
40259
|
+
Button$1 as cb,
|
|
40260
|
+
createEditorCommandBus as cc,
|
|
40261
|
+
createOasisEditor as cd,
|
|
40262
|
+
createOasisEditorContainer as ce,
|
|
40263
|
+
mount as cf,
|
|
40264
|
+
registerToolbarRenderer as cg,
|
|
40188
40265
|
getDocumentSections as d,
|
|
40189
40266
|
createEditorStyledRun as e,
|
|
40190
40267
|
getParagraphText as f,
|