oasis-editor 0.0.22 → 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-
|
|
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-
|
|
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,14 @@ 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><span class=oasis-editor-statusbar-item
|
|
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
|
+
const ZOOM_MIN = 50;
|
|
36502
|
+
const ZOOM_MAX = 200;
|
|
36503
|
+
const ZOOM_STEP = 10;
|
|
36504
|
+
function clampZoom(value) {
|
|
36505
|
+
if (!Number.isFinite(value)) return 100;
|
|
36506
|
+
return Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, Math.round(value)));
|
|
36507
|
+
}
|
|
36501
36508
|
function OasisEditorEditor(props) {
|
|
36502
36509
|
const layout = () => props.layout ?? {};
|
|
36503
36510
|
const overlays = () => props.overlays;
|
|
@@ -36532,6 +36539,20 @@ function OasisEditorEditor(props) {
|
|
|
36532
36539
|
const documentForStats = createMemo(() => props.state().document);
|
|
36533
36540
|
const characterCount = createMemo(() => getDocumentCharacterCount(documentForStats()));
|
|
36534
36541
|
const wordCount = createMemo(() => getDocumentWordCount(documentForStats()));
|
|
36542
|
+
const [zoomPercent, setZoomPercent] = createSignal(100);
|
|
36543
|
+
const adjustZoom = (delta) => {
|
|
36544
|
+
setZoomPercent((current) => clampZoom(current + delta));
|
|
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));
|
|
36535
36556
|
const statusDocumentLayout = createMemo(() => {
|
|
36536
36557
|
var _a, _b, _c, _d;
|
|
36537
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));
|
|
@@ -36585,7 +36606,7 @@ function OasisEditorEditor(props) {
|
|
|
36585
36606
|
queueMicrotask(recomputeViewportPageIndex);
|
|
36586
36607
|
});
|
|
36587
36608
|
return (() => {
|
|
36588
|
-
var _el$ = _tmpl$$m(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.
|
|
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;
|
|
36589
36610
|
insert(_el$, createComponent(Show, {
|
|
36590
36611
|
get when() {
|
|
36591
36612
|
return memo(() => !!layout().showHorizontalRuler)() && overlays().toolbarHost;
|
|
@@ -36619,16 +36640,40 @@ function OasisEditorEditor(props) {
|
|
|
36619
36640
|
passive: true
|
|
36620
36641
|
});
|
|
36621
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
|
+
}
|
|
36622
36655
|
onCleanup(() => {
|
|
36623
36656
|
el.removeEventListener("scroll", onScroll);
|
|
36657
|
+
viewportObserver == null ? void 0 : viewportObserver.disconnect();
|
|
36624
36658
|
});
|
|
36625
36659
|
}, _el$2);
|
|
36626
36660
|
use((el) => {
|
|
36627
36661
|
var _a, _b;
|
|
36628
36662
|
scrollContentRef = el;
|
|
36629
36663
|
(_b = (_a = refs()).onSurfaceRef) == null ? void 0 : _b.call(_a, el);
|
|
36630
|
-
|
|
36631
|
-
|
|
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, {
|
|
36632
36677
|
get state() {
|
|
36633
36678
|
return props.state;
|
|
36634
36679
|
},
|
|
@@ -36672,8 +36717,8 @@ function OasisEditorEditor(props) {
|
|
|
36672
36717
|
get onRevisionMouseLeave() {
|
|
36673
36718
|
return surfaceHandlers().onRevisionMouseLeave;
|
|
36674
36719
|
}
|
|
36675
|
-
}), _el$
|
|
36676
|
-
insert(_el$
|
|
36720
|
+
}), _el$5);
|
|
36721
|
+
insert(_el$4, createComponent(Show, {
|
|
36677
36722
|
get when() {
|
|
36678
36723
|
return overlays().hoveredRevision();
|
|
36679
36724
|
},
|
|
@@ -36682,8 +36727,8 @@ function OasisEditorEditor(props) {
|
|
|
36682
36727
|
return revision();
|
|
36683
36728
|
}
|
|
36684
36729
|
})
|
|
36685
|
-
}), _el$
|
|
36686
|
-
insert(_el$
|
|
36730
|
+
}), _el$5);
|
|
36731
|
+
insert(_el$4, createComponent(Show, {
|
|
36687
36732
|
get when() {
|
|
36688
36733
|
return overlays().selectionBoxes().length > 0;
|
|
36689
36734
|
},
|
|
@@ -36694,8 +36739,8 @@ function OasisEditorEditor(props) {
|
|
|
36694
36739
|
}
|
|
36695
36740
|
});
|
|
36696
36741
|
}
|
|
36697
|
-
}), _el$
|
|
36698
|
-
insert(_el$
|
|
36742
|
+
}), _el$5);
|
|
36743
|
+
insert(_el$4, createComponent(Show, {
|
|
36699
36744
|
get when() {
|
|
36700
36745
|
return overlays().commentHighlights().length > 0;
|
|
36701
36746
|
},
|
|
@@ -36707,8 +36752,8 @@ function OasisEditorEditor(props) {
|
|
|
36707
36752
|
commentsById
|
|
36708
36753
|
});
|
|
36709
36754
|
}
|
|
36710
|
-
}), _el$
|
|
36711
|
-
insert(_el$
|
|
36755
|
+
}), _el$5);
|
|
36756
|
+
insert(_el$4, createComponent(ResizeHandlesOverlay, {
|
|
36712
36757
|
box: selectedImage,
|
|
36713
36758
|
get readOnly() {
|
|
36714
36759
|
return Boolean(layout().readOnly);
|
|
@@ -36735,8 +36780,8 @@ function OasisEditorEditor(props) {
|
|
|
36735
36780
|
if (!image) return;
|
|
36736
36781
|
surfaceHandlers().onImageMouseDown(image.paragraphId, image.startOffset, event);
|
|
36737
36782
|
}
|
|
36738
|
-
}), _el$
|
|
36739
|
-
insert(_el$
|
|
36783
|
+
}), _el$5);
|
|
36784
|
+
insert(_el$4, createComponent(ResizeHandlesOverlay, {
|
|
36740
36785
|
box: selectedTextBox,
|
|
36741
36786
|
get readOnly() {
|
|
36742
36787
|
return Boolean(layout().readOnly);
|
|
@@ -36758,8 +36803,8 @@ function OasisEditorEditor(props) {
|
|
|
36758
36803
|
if (!textBox) return;
|
|
36759
36804
|
surfaceHandlers().onTextBoxRotateHandleMouseDown(textBox.paragraphId, textBox.startOffset, event);
|
|
36760
36805
|
}
|
|
36761
|
-
}), _el$
|
|
36762
|
-
insert(_el$
|
|
36806
|
+
}), _el$5);
|
|
36807
|
+
insert(_el$4, createComponent(Show, {
|
|
36763
36808
|
get when() {
|
|
36764
36809
|
return memo(() => !!overlays().toolbarHost)() && overlays().showFloatingTableToolbar;
|
|
36765
36810
|
},
|
|
@@ -36777,8 +36822,8 @@ function OasisEditorEditor(props) {
|
|
|
36777
36822
|
surfaceRef: () => scrollContentRef
|
|
36778
36823
|
});
|
|
36779
36824
|
}
|
|
36780
|
-
}), _el$
|
|
36781
|
-
insert(_el$
|
|
36825
|
+
}), _el$5);
|
|
36826
|
+
insert(_el$4, createComponent(Show, {
|
|
36782
36827
|
get when() {
|
|
36783
36828
|
return overlays().layoutOptions;
|
|
36784
36829
|
},
|
|
@@ -36792,8 +36837,8 @@ function OasisEditorEditor(props) {
|
|
|
36792
36837
|
return Boolean(layout().readOnly);
|
|
36793
36838
|
}
|
|
36794
36839
|
})
|
|
36795
|
-
}), _el$
|
|
36796
|
-
insert(_el$
|
|
36840
|
+
}), _el$5);
|
|
36841
|
+
insert(_el$4, createComponent(Show, {
|
|
36797
36842
|
get when() {
|
|
36798
36843
|
return overlays().showCaret();
|
|
36799
36844
|
},
|
|
@@ -36813,25 +36858,25 @@ function OasisEditorEditor(props) {
|
|
|
36813
36858
|
}
|
|
36814
36859
|
});
|
|
36815
36860
|
}
|
|
36816
|
-
}), _el$
|
|
36817
|
-
addEventListener(_el$
|
|
36818
|
-
addEventListener(_el$
|
|
36819
|
-
addEventListener(_el$
|
|
36820
|
-
addEventListener(_el$
|
|
36821
|
-
addEventListener(_el$
|
|
36822
|
-
addEventListener(_el$
|
|
36823
|
-
addEventListener(_el$
|
|
36824
|
-
addEventListener(_el$
|
|
36825
|
-
addEventListener(_el$
|
|
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);
|
|
36826
36871
|
var _ref$ = refs().onTextareaRef;
|
|
36827
|
-
typeof _ref$ === "function" ? use(_ref$, _el$
|
|
36828
|
-
setAttribute(_el$
|
|
36829
|
-
addEventListener(_el$
|
|
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);
|
|
36830
36875
|
var _ref$2 = refs().onImportInputRef;
|
|
36831
|
-
typeof _ref$2 === "function" ? use(_ref$2, _el$
|
|
36832
|
-
addEventListener(_el$
|
|
36876
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$6) : refs().onImportInputRef = _el$6;
|
|
36877
|
+
addEventListener(_el$7, "change", fileHandlers().onImageInputChange);
|
|
36833
36878
|
var _ref$3 = refs().onImageInputRef;
|
|
36834
|
-
typeof _ref$3 === "function" ? use(_ref$3, _el$
|
|
36879
|
+
typeof _ref$3 === "function" ? use(_ref$3, _el$7) : refs().onImageInputRef = _el$7;
|
|
36835
36880
|
insert(_el$, createComponent(Show, {
|
|
36836
36881
|
get when() {
|
|
36837
36882
|
var _a, _b;
|
|
@@ -36841,45 +36886,48 @@ function OasisEditorEditor(props) {
|
|
|
36841
36886
|
const isDone = progress().phase === "done";
|
|
36842
36887
|
const isError = progress().phase === "error";
|
|
36843
36888
|
return (() => {
|
|
36844
|
-
var _el$
|
|
36845
|
-
_el$
|
|
36846
|
-
_el$
|
|
36847
|
-
setAttribute(_el$
|
|
36848
|
-
insert(_el$
|
|
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, {
|
|
36849
36894
|
height: 40,
|
|
36850
36895
|
"class": "oasis-editor-loading-mark"
|
|
36851
|
-
}), _el$
|
|
36852
|
-
insert(_el$
|
|
36853
|
-
insert(_el$
|
|
36854
|
-
_el$
|
|
36855
|
-
_el$
|
|
36856
|
-
insert(_el$
|
|
36857
|
-
var _el$
|
|
36858
|
-
insert(_el$
|
|
36859
|
-
return _el$
|
|
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"));
|
|
36904
|
+
return _el$23;
|
|
36860
36905
|
})() : isError ? (() => {
|
|
36861
|
-
var _el$
|
|
36862
|
-
insert(_el$
|
|
36863
|
-
return _el$
|
|
36906
|
+
var _el$24 = _tmpl$4$8();
|
|
36907
|
+
insert(_el$24, () => t("import.phase.error"));
|
|
36908
|
+
return _el$24;
|
|
36864
36909
|
})() : [memo(() => Math.round(progress().progress)), "%"]);
|
|
36865
36910
|
createRenderEffect((_p$) => {
|
|
36866
|
-
var _v$
|
|
36867
|
-
_v$
|
|
36868
|
-
_v$
|
|
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);
|
|
36869
36914
|
return _p$;
|
|
36870
36915
|
}, {
|
|
36871
36916
|
e: void 0,
|
|
36872
36917
|
t: void 0
|
|
36873
36918
|
});
|
|
36874
|
-
return _el$
|
|
36919
|
+
return _el$16;
|
|
36875
36920
|
})();
|
|
36876
36921
|
}
|
|
36877
|
-
}), _el$
|
|
36878
|
-
insert(_el$
|
|
36879
|
-
insert(_el$
|
|
36880
|
-
insert(_el$
|
|
36881
|
-
|
|
36882
|
-
|
|
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, {
|
|
36883
36931
|
get when() {
|
|
36884
36932
|
return overlays().persistenceStatus;
|
|
36885
36933
|
},
|
|
@@ -36891,24 +36939,37 @@ function OasisEditorEditor(props) {
|
|
|
36891
36939
|
return createComponent(Show, {
|
|
36892
36940
|
when: key,
|
|
36893
36941
|
get children() {
|
|
36894
|
-
var _el$
|
|
36895
|
-
insert(_el$
|
|
36896
|
-
createRenderEffect(() => className(_el$
|
|
36897
|
-
return _el$
|
|
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;
|
|
36898
36946
|
}
|
|
36899
36947
|
});
|
|
36900
36948
|
})();
|
|
36901
36949
|
}
|
|
36902
36950
|
}), null);
|
|
36903
36951
|
createRenderEffect((_p$) => {
|
|
36904
|
-
var _v$ = `oasis-editor-editor-shell${layout().class ? ` ${layout().class}` : ""}`, _v$2 = shellStyle(), _v$3 = layout().readOnly, _v$
|
|
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;
|
|
36905
36953
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
36906
36954
|
_p$.t = style(_el$, _v$2, _p$.t);
|
|
36907
|
-
_v$3 !== _p$.a && (_el$
|
|
36908
|
-
_v$4 !== _p$.o && setStyleProperty(_el$
|
|
36909
|
-
_v$5 !== _p$.i && setStyleProperty(_el$4, "
|
|
36910
|
-
_v$6 !== _p$.n && setStyleProperty(_el$4, "
|
|
36911
|
-
_v$7 !== _p$.s &&
|
|
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);
|
|
36912
36973
|
return _p$;
|
|
36913
36974
|
}, {
|
|
36914
36975
|
e: void 0,
|
|
@@ -36917,12 +36978,26 @@ function OasisEditorEditor(props) {
|
|
|
36917
36978
|
o: void 0,
|
|
36918
36979
|
i: void 0,
|
|
36919
36980
|
n: void 0,
|
|
36920
|
-
s: void 0
|
|
36981
|
+
s: void 0,
|
|
36982
|
+
h: void 0,
|
|
36983
|
+
r: void 0,
|
|
36984
|
+
d: void 0,
|
|
36985
|
+
l: void 0,
|
|
36986
|
+
u: void 0,
|
|
36987
|
+
c: 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
|
|
36921
36995
|
});
|
|
36996
|
+
createRenderEffect(() => _el$12.value = zoomPercent());
|
|
36922
36997
|
return _el$;
|
|
36923
36998
|
})();
|
|
36924
36999
|
}
|
|
36925
|
-
delegateEvents(["mousedown", "contextmenu", "input", "keydown"]);
|
|
37000
|
+
delegateEvents(["mousedown", "contextmenu", "input", "keydown", "click"]);
|
|
36926
37001
|
var _tmpl$$l = /* @__PURE__ */ template(`<button>`);
|
|
36927
37002
|
function FloatingActionButton(props) {
|
|
36928
37003
|
const [local, others] = splitProps(props, ["type", "icon", "label", "active", "class", "classList"]);
|