oasis-editor 0.0.40 → 0.0.41
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-rHCQJW6I.js → OasisEditorApp-C9aMLBum.js} +51 -17
- package/dist/{index-XgdC48U9.js → index-CEIWNJ4A.js} +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +3 -3
- package/dist/ui/app/createEditorTableContextMenuActions.d.ts +20 -0
- package/dist/ui/app/useEditorContextMenuClipboard.d.ts +23 -17
- package/package.json +1 -1
|
@@ -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 createEditorTableRow, w as createEditorTable, 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 resolveFloatingObjectRect, a0 as getTextBoxFloatingGeometry, a1 as getPresetPathSegments, a2 as projectBlocksLayout, a3 as buildListLabels, a4 as textStyleToFontSizePt, a5 as PX_PER_POINT, a6 as DEFAULT_FONT_SIZE_PX, a7 as isDoubleUnderlineStyle, a8 as isWavyUnderlineStyle, a9 as underlineStyleLineWidthPx, aa as underlineStyleDashArray, ab as resolveListLabel, ac as getListLabelInset, ad as getAlignedListLabelInset, ae as getParagraphBorderInsets, af as buildSegmentTable, ag as buildCanvasTableLayout, ah as normalizeFamily, ai as ROBOTO_FONT_FILES, aj as loadFontAsset, ak as OFFICE_COMPAT_FONT_FAMILIES, al as buildSfnt, am as defaultFontDecoderRegistry, an as SfntFontProgram, ao as collectPdfFontFamilies, ap as projectDocumentLayout, aq as getPageHeaderZoneTop, ar as getPageBodyTop, as as getPageColumnRects, at as findFootnoteReference, au as FOOTNOTE_MARKER_GUTTER_PX, av as resolveImporterForFile, aw as createEditorStateFromDocument, ax as getDocumentParagraphsCanonical, ay as getToolbarStyleState, az as STANDARD_FONT_SIZES_PT, aA as fontSizePxToPt, aB as probeLocalFontFamilies, aC as createInitialEditorState, aD as parseFontSizePtToPx, aE as formatFontSizePt, aF as listKindForTag, aG as isParagraphTag, aH as collectInlineRuns, aI as parseParagraphStyle, aJ as getHeadingLevel, aK as preciseFontModeVersion, aL as isPreciseFontModeEnabled, aM as togglePreciseFontMode, aN as nextFontSizePt, aO as previousFontSizePt, aP as fontSizePtToPx, aQ as createDefaultToolbarPreset, aR as MenuRegistry, aS as createToolbarRegistry, aT as Editor, aU as resolveCommandRef, aV as commandRefName, aW as InlineShell, aX as BalloonShell, aY as DocumentShell, aZ as createMemo, a_ as getCaretRectFromSnapshot, a$ as getParagraphRectFromSnapshot, b0 as createComponent, b1 as CaretOverlay, b2 as Show, b3 as createRenderEffect, b4 as style, b5 as setAttribute, b6 as setStyleProperty, b7 as memo, b8 as template, b9 as useI18n, ba as insert, bb as use, bc as addEventListener, bd as Dialog, be as delegateEvents, bf as className, bg as For, bh as UNDERLINE_STYLE_OPTIONS, bi as Tabs, bj as measureParagraphMinContentWidthPx, bk as getEditableBlocksForZone, bl as findParagraphLocation, bm as createSectionBoundaryParagraph, bn as normalizePageSettings, bo as DEFAULT_EDITOR_PAGE_SETTINGS, bp as markStart, bq as markEnd, br as getParagraphEntries, bs as getParagraphById, bt as PluginUiHost, bu as OasisEditorEditor, bv as perfTimer, bw as OasisBrandMark, bx as setPreciseFontPreference, by as setWelcomeSeen, bz as enablePreciseFontMode, bA as createOasisEditorClient, bB as createEditorZoom, bC as startLongTaskObserver, bD as installGlobalReport, bE as applyStoredPreciseFontPreference, bF as getWelcomeSeen, bG as isLocalFontAccessSupported, bH as EDITOR_SCROLL_PADDING_PX, bI as Toolbar, bJ as OasisEditorLoading, bK as I18nProvider, bL as createEditorLogger, bM as createTranslator, bN as getCachedCanvasImage, bO 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 createEditorTableRow, w as createEditorTable, 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 resolveFloatingObjectRect, a0 as getTextBoxFloatingGeometry, a1 as getPresetPathSegments, a2 as projectBlocksLayout, a3 as buildListLabels, a4 as textStyleToFontSizePt, a5 as PX_PER_POINT, a6 as DEFAULT_FONT_SIZE_PX, a7 as isDoubleUnderlineStyle, a8 as isWavyUnderlineStyle, a9 as underlineStyleLineWidthPx, aa as underlineStyleDashArray, ab as resolveListLabel, ac as getListLabelInset, ad as getAlignedListLabelInset, ae as getParagraphBorderInsets, af as buildSegmentTable, ag as buildCanvasTableLayout, ah as normalizeFamily, ai as ROBOTO_FONT_FILES, aj as loadFontAsset, ak as OFFICE_COMPAT_FONT_FAMILIES, al as buildSfnt, am as defaultFontDecoderRegistry, an as SfntFontProgram, ao as collectPdfFontFamilies, ap as projectDocumentLayout, aq as getPageHeaderZoneTop, ar as getPageBodyTop, as as getPageColumnRects, at as findFootnoteReference, au as FOOTNOTE_MARKER_GUTTER_PX, av as resolveImporterForFile, aw as createEditorStateFromDocument, ax as getDocumentParagraphsCanonical, ay as getToolbarStyleState, az as STANDARD_FONT_SIZES_PT, aA as fontSizePxToPt, aB as probeLocalFontFamilies, aC as createInitialEditorState, aD as parseFontSizePtToPx, aE as formatFontSizePt, aF as listKindForTag, aG as isParagraphTag, aH as collectInlineRuns, aI as parseParagraphStyle, aJ as getHeadingLevel, aK as preciseFontModeVersion, aL as isPreciseFontModeEnabled, aM as togglePreciseFontMode, aN as nextFontSizePt, aO as previousFontSizePt, aP as fontSizePtToPx, aQ as createDefaultToolbarPreset, aR as MenuRegistry, aS as createToolbarRegistry, aT as Editor, aU as resolveCommandRef, aV as commandRefName, aW as InlineShell, aX as BalloonShell, aY as DocumentShell, aZ as createMemo, a_ as getCaretRectFromSnapshot, a$ as getParagraphRectFromSnapshot, b0 as createComponent, b1 as CaretOverlay, b2 as Show, b3 as createRenderEffect, b4 as style, b5 as setAttribute, b6 as setStyleProperty, b7 as memo, b8 as template, b9 as useI18n, ba as insert, bb as use, bc as addEventListener, bd as Dialog, be as delegateEvents, bf as className, bg as For, bh as UNDERLINE_STYLE_OPTIONS, bi as Tabs, bj as measureParagraphMinContentWidthPx, bk as getEditableBlocksForZone, bl as findParagraphLocation, bm as createSectionBoundaryParagraph, bn as normalizePageSettings, bo as DEFAULT_EDITOR_PAGE_SETTINGS, bp as markStart, bq as markEnd, br as getParagraphEntries, bs as getParagraphById, bt as PluginUiHost, bu as OasisEditorEditor, bv as perfTimer, bw as OasisBrandMark, bx as setPreciseFontPreference, by as setWelcomeSeen, bz as enablePreciseFontMode, bA as createOasisEditorClient, bB as createEditorZoom, bC as startLongTaskObserver, bD as installGlobalReport, bE as applyStoredPreciseFontPreference, bF as getWelcomeSeen, bG as isLocalFontAccessSupported, bH as EDITOR_SCROLL_PADDING_PX, bI as Toolbar, bJ as OasisEditorLoading, bK as I18nProvider, bL as createEditorLogger, bM as createTranslator, bN as getCachedCanvasImage, bO as registerDomStatsSurface } from "./index-CEIWNJ4A.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) {
|
|
@@ -40872,6 +40872,50 @@ function createEditorContextMenuClipboard(deps) {
|
|
|
40872
40872
|
programmaticPaste
|
|
40873
40873
|
};
|
|
40874
40874
|
}
|
|
40875
|
+
function createEditorTableContextMenuActions(deps) {
|
|
40876
|
+
const { state, tableOps, applyTableContextCommand } = deps;
|
|
40877
|
+
return {
|
|
40878
|
+
isInsideTable: deps.isInsideTable,
|
|
40879
|
+
canMerge: () => tableOps.canMergeSelectedTable(state()),
|
|
40880
|
+
canSplit: () => tableOps.canSplitSelectedTable(state()),
|
|
40881
|
+
canEditColumn: () => tableOps.canEditSelectedTableColumn(state()),
|
|
40882
|
+
canEditRow: () => tableOps.canEditSelectedTableRow(state()),
|
|
40883
|
+
openProperties: () => deps.openTablePropertiesDialog("table"),
|
|
40884
|
+
openBordersAndShading: () => deps.openTablePropertiesDialog("cell"),
|
|
40885
|
+
merge: () => applyTableContextCommand(
|
|
40886
|
+
(current) => tableOps.mergeSelectedTable(current),
|
|
40887
|
+
"mergeTable"
|
|
40888
|
+
),
|
|
40889
|
+
split: () => applyTableContextCommand(
|
|
40890
|
+
(current) => tableOps.splitSelectedTable(current),
|
|
40891
|
+
"splitTable"
|
|
40892
|
+
),
|
|
40893
|
+
insertColumnBefore: () => applyTableContextCommand(
|
|
40894
|
+
(current) => tableOps.insertSelectedTableColumn(current, -1),
|
|
40895
|
+
"insertTableColumn"
|
|
40896
|
+
),
|
|
40897
|
+
insertColumnAfter: () => applyTableContextCommand(
|
|
40898
|
+
(current) => tableOps.insertSelectedTableColumn(current, 1),
|
|
40899
|
+
"insertTableColumn"
|
|
40900
|
+
),
|
|
40901
|
+
deleteColumn: () => applyTableContextCommand(
|
|
40902
|
+
(current) => tableOps.deleteSelectedTableColumn(current),
|
|
40903
|
+
"deleteTableColumn"
|
|
40904
|
+
),
|
|
40905
|
+
insertRowBefore: () => applyTableContextCommand(
|
|
40906
|
+
(current) => tableOps.insertSelectedTableRow(current, -1),
|
|
40907
|
+
"insertTableRow"
|
|
40908
|
+
),
|
|
40909
|
+
insertRowAfter: () => applyTableContextCommand(
|
|
40910
|
+
(current) => tableOps.insertSelectedTableRow(current, 1),
|
|
40911
|
+
"insertTableRow"
|
|
40912
|
+
),
|
|
40913
|
+
deleteRow: () => applyTableContextCommand(
|
|
40914
|
+
(current) => tableOps.deleteSelectedTableRow(current),
|
|
40915
|
+
"deleteTableRow"
|
|
40916
|
+
)
|
|
40917
|
+
};
|
|
40918
|
+
}
|
|
40875
40919
|
const DEFAULT_TOC_MAX_LEVEL = 3;
|
|
40876
40920
|
const TOC_INSTRUCTION = ' TOC \\o "1-3" \\h \\z \\u ';
|
|
40877
40921
|
const PX_TO_PT = 72 / 96;
|
|
@@ -47501,23 +47545,13 @@ function OasisEditorApp(props = {}) {
|
|
|
47501
47545
|
promptForLink: commandsController.promptForLink,
|
|
47502
47546
|
openFontDialog,
|
|
47503
47547
|
openParagraphDialog,
|
|
47504
|
-
table: {
|
|
47548
|
+
table: createEditorTableContextMenuActions({
|
|
47549
|
+
state: () => state,
|
|
47550
|
+
tableOps,
|
|
47505
47551
|
isInsideTable: tablePropertiesDialogBridge.isInsideTable,
|
|
47506
|
-
|
|
47507
|
-
|
|
47508
|
-
|
|
47509
|
-
canEditRow: () => tableOps.canEditSelectedTableRow(state),
|
|
47510
|
-
openProperties: () => openTablePropertiesDialog("table"),
|
|
47511
|
-
openBordersAndShading: () => openTablePropertiesDialog("cell"),
|
|
47512
|
-
merge: () => applyTableContextCommand((current) => tableOps.mergeSelectedTable(current), "mergeTable"),
|
|
47513
|
-
split: () => applyTableContextCommand((current) => tableOps.splitSelectedTable(current), "splitTable"),
|
|
47514
|
-
insertColumnBefore: () => applyTableContextCommand((current) => tableOps.insertSelectedTableColumn(current, -1), "insertTableColumn"),
|
|
47515
|
-
insertColumnAfter: () => applyTableContextCommand((current) => tableOps.insertSelectedTableColumn(current, 1), "insertTableColumn"),
|
|
47516
|
-
deleteColumn: () => applyTableContextCommand((current) => tableOps.deleteSelectedTableColumn(current), "deleteTableColumn"),
|
|
47517
|
-
insertRowBefore: () => applyTableContextCommand((current) => tableOps.insertSelectedTableRow(current, -1), "insertTableRow"),
|
|
47518
|
-
insertRowAfter: () => applyTableContextCommand((current) => tableOps.insertSelectedTableRow(current, 1), "insertTableRow"),
|
|
47519
|
-
deleteRow: () => applyTableContextCommand((current) => tableOps.deleteSelectedTableRow(current), "deleteTableRow")
|
|
47520
|
-
}
|
|
47552
|
+
openTablePropertiesDialog,
|
|
47553
|
+
applyTableContextCommand
|
|
47554
|
+
})
|
|
47521
47555
|
});
|
|
47522
47556
|
const buildContextMenuItems = contextMenuClipboard.buildContextMenuItems;
|
|
47523
47557
|
const handleEditorContextMenu = contextMenuClipboard.handleEditorContextMenu;
|
|
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2483
2483
|
onCleanup(() => {
|
|
2484
2484
|
cancelled = true;
|
|
2485
2485
|
});
|
|
2486
|
-
import("./OasisEditorApp-
|
|
2486
|
+
import("./OasisEditorApp-C9aMLBum.js").then((m) => {
|
|
2487
2487
|
cancelled = true;
|
|
2488
2488
|
setProgress(1);
|
|
2489
2489
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
package/dist/oasis-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aX, bP, bQ, bR, bS, bT, bd, bU, aY, aT, bV, bW, bX, aW, bY, aR, bZ, b_, b$, c0, c1, bJ, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, bi, cd, bI, ce, bR as bR2, bW as bW2, bY as bY2, c5 as c52, c7 as c72, cc as cc2, cf, aV, aQ, cg, ch, ci, aS, cj, ck, aU } from "./index-
|
|
1
|
+
import { aX, bP, bQ, bR, bS, bT, bd, bU, aY, aT, bV, bW, bX, aW, bY, aR, bZ, b_, b$, c0, c1, bJ, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, bi, cd, bI, ce, bR as bR2, bW as bW2, bY as bY2, c5 as c52, c7 as c72, cc as cc2, cf, aV, aQ, cg, ch, ci, aS, cj, ck, aU } from "./index-CEIWNJ4A.js";
|
|
2
2
|
export {
|
|
3
3
|
aX as BalloonShell,
|
|
4
4
|
bP as Button,
|