oasis-editor 0.0.59 → 0.0.61

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, E as EMU_PER_PX, q as createEditorParagraph, r as getBlockParagraphs, s as createEditorFootnote, t as createFootnoteReferenceRun, u as renumberFootnotes, v as iterateFootnoteReferenceRuns, w as getFootnoteDisplayMarker, x as findParagraphTableLocation, y as buildTableCellLayout, z as createSignal, A as createEffect, B as onCleanup, C as buildCanvasLayoutSnapshot, D as on, F as onMount, G as debounce, H as unwrap, I as getDocumentParagraphs, P as PT_PER_PX, J as createEditorTableCell, K as createEditorTableRow, L as createEditorTable, M as getDocumentSectionsCanonical, N as createEditorDocument, O as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveImageSrc, U as resolveTextBoxRenderHeight, V as TWIPS_PER_POINT, W as PX_PER_INCH, X as TWIPS_PER_INCH, Y as resolveEffectiveParagraphStyle, Z as resolveEffectiveTextStyleForParagraph, _ as EMU_PER_PT, $ as iterateEndnoteReferenceRuns, a0 as imageContentTypeDefaults, a1 as JSZip, a2 as imageExtensionFromMime, a3 as pxToPt$1, a4 as resolveFloatingObjectRect, a5 as getTextBoxFloatingGeometry, a6 as getPresetPathSegments, a7 as projectBlocksLayout, a8 as buildListLabels, a9 as textStyleToFontSizePt, aa as PX_PER_POINT, ab as DEFAULT_FONT_SIZE_PX, ac as isDoubleUnderlineStyle, ad as isWavyUnderlineStyle, ae as underlineStyleLineWidthPx, af as underlineStyleDashArray, ag as resolveListLabel, ah as getListLabelInset, ai as getAlignedListLabelInset, aj as getParagraphBorderInsets, ak as buildSegmentTable, al as buildCanvasTableLayout, am as normalizeFamily, an as ROBOTO_FONT_FILES, ao as loadFontAsset, ap as OFFICE_COMPAT_FONT_FAMILIES, aq as buildSfnt, ar as defaultFontDecoderRegistry, as as SfntFontProgram, at as collectPdfFontFamilies, au as projectDocumentLayout, av as getPageHeaderZoneTop, aw as getPageBodyTop, ax as getPageColumnRects, ay as findFootnoteReference, az as FOOTNOTE_MARKER_GUTTER_PX, aA as resolveImporterForFile, aB as createEditorStateFromDocument, aC as getDocumentParagraphsCanonical, aD as getToolbarStyleState, aE as STANDARD_FONT_SIZES_PT, aF as fontSizePxToPt, aG as probeLocalFontFamilies, aH as createInitialEditorState, aI as parseFontSizePtToPx, aJ as formatFontSizePt, aK as underlineStyleToCssDecorationStyle, aL as listKindForTag, aM as isParagraphTag, aN as collectInlineRuns, aO as parseParagraphStyle, aP as getCachedCanvasImage, aQ as getHeadingLevel, aR as preciseFontModeVersion, aS as isPreciseFontModeEnabled, aT as togglePreciseFontMode, aU as nextFontSizePt, aV as previousFontSizePt, aW as fontSizePtToPx, aX as createDefaultToolbarPreset, aY as MenuRegistry, aZ as createToolbarRegistry, a_ as Editor, a$ as resolveCommandRef, b0 as commandRefName, b1 as InlineShell, b2 as BalloonShell, b3 as DocumentShell, b4 as createMemo, b5 as getCaretRectFromSnapshot, b6 as getParagraphRectFromSnapshot, b7 as createComponent, b8 as CaretOverlay, b9 as Show, ba as createRenderEffect, bb as style, bc as setAttribute, bd as setStyleProperty, be as memo, bf as template, bg as useI18n, bh as insert, bi as use, bj as addEventListener, bk as Dialog, bl as delegateEvents, bm as className, bn as For, bo as UNDERLINE_STYLE_OPTIONS, bp as Tabs, bq as measureParagraphMinContentWidthPx, br as getEditableBlocksForZone, bs as findParagraphLocation, bt as createSectionBoundaryParagraph, bu as normalizePageSettings, bv as DEFAULT_EDITOR_PAGE_SETTINGS, bw as markStart, bx as markEnd, by as getParagraphEntries, bz as getParagraphById, bA as PluginUiHost, bB as OasisEditorEditor, bC as perfTimer, bD as OasisBrandMark, bE as setPreciseFontPreference, bF as setWelcomeSeen, bG as enablePreciseFontMode, bH as createOasisEditorClient, bI as createEditorZoom, bJ as startLongTaskObserver, bK as installGlobalReport, bL as applyStoredPreciseFontPreference, bM as getWelcomeSeen, bN as isLocalFontAccessSupported, bO as EDITOR_SCROLL_PADDING_PX, bP as Toolbar, bQ as OasisEditorLoading, bR as I18nProvider, bS as createEditorLogger, bT as createTranslator, bU as registerDomStatsSurface } from "./index-DiZU2BUt.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, E as EMU_PER_PX, q as createEditorParagraph, r as getBlockParagraphs, s as createEditorFootnote, t as createFootnoteReferenceRun, u as renumberFootnotes, v as iterateFootnoteReferenceRuns, w as getFootnoteDisplayMarker, x as findParagraphTableLocation, y as buildTableCellLayout, z as createSignal, A as createEffect, B as onCleanup, C as buildCanvasLayoutSnapshot, D as on, F as onMount, G as debounce, H as unwrap, I as getDocumentParagraphs, P as PT_PER_PX, J as createEditorTableCell, K as createEditorTableRow, L as createEditorTable, M as getDocumentSectionsCanonical, N as createEditorDocument, O as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveImageSrc, U as resolveTextBoxRenderHeight, V as TWIPS_PER_POINT, W as PX_PER_INCH, X as TWIPS_PER_INCH, Y as resolveEffectiveParagraphStyle, Z as resolveEffectiveTextStyleForParagraph, _ as EMU_PER_PT, $ as iterateEndnoteReferenceRuns, a0 as imageContentTypeDefaults, a1 as JSZip, a2 as imageExtensionFromMime, a3 as pxToPt$1, a4 as resolveFloatingObjectRect, a5 as getTextBoxFloatingGeometry, a6 as getPresetPathSegments, a7 as projectBlocksLayout, a8 as buildListLabels, a9 as textStyleToFontSizePt, aa as PX_PER_POINT, ab as DEFAULT_FONT_SIZE_PX, ac as isDoubleUnderlineStyle, ad as isWavyUnderlineStyle, ae as underlineStyleLineWidthPx, af as underlineStyleDashArray, ag as resolveListLabel, ah as getListLabelInset, ai as getAlignedListLabelInset, aj as getParagraphBorderInsets, ak as buildSegmentTable, al as buildCanvasTableLayout, am as normalizeFamily, an as ROBOTO_FONT_FILES, ao as loadFontAsset, ap as OFFICE_COMPAT_FONT_FAMILIES, aq as buildSfnt, ar as defaultFontDecoderRegistry, as as SfntFontProgram, at as collectPdfFontFamilies, au as projectDocumentLayout, av as getPageHeaderZoneTop, aw as getPageBodyTop, ax as getPageColumnRects, ay as findFootnoteReference, az as FOOTNOTE_MARKER_GUTTER_PX, aA as resolveImporterForFile, aB as createEditorStateFromDocument, aC as getDocumentParagraphsCanonical, aD as getToolbarStyleState, aE as STANDARD_FONT_SIZES_PT, aF as fontSizePxToPt, aG as probeLocalFontFamilies, aH as createInitialEditorState, aI as parseFontSizePtToPx, aJ as formatFontSizePt, aK as underlineStyleToCssDecorationStyle, aL as listKindForTag, aM as isParagraphTag, aN as collectInlineRuns, aO as parseParagraphStyle, aP as getCachedCanvasImage, aQ as getHeadingLevel, aR as preciseFontModeVersion, aS as isPreciseFontModeEnabled, aT as togglePreciseFontMode, aU as nextFontSizePt, aV as previousFontSizePt, aW as fontSizePtToPx, aX as createDefaultToolbarPreset, aY as MenuRegistry, aZ as createToolbarRegistry, a_ as Editor, a$ as resolveCommandRef, b0 as commandRefName, b1 as InlineShell, b2 as BalloonShell, b3 as DocumentShell, b4 as createMemo, b5 as getCaretRectFromSnapshot, b6 as getParagraphRectFromSnapshot, b7 as createComponent, b8 as CaretOverlay, b9 as Show, ba as createRenderEffect, bb as style, bc as setAttribute, bd as setStyleProperty, be as memo, bf as template, bg as useI18n, bh as insert, bi as use, bj as addEventListener, bk as Dialog, bl as delegateEvents, bm as className, bn as For, bo as UNDERLINE_STYLE_OPTIONS, bp as Tabs, bq as measureParagraphMinContentWidthPx, br as getEditableBlocksForZone, bs as findParagraphLocation, bt as createSectionBoundaryParagraph, bu as normalizePageSettings, bv as DEFAULT_EDITOR_PAGE_SETTINGS, bw as markStart, bx as markEnd, by as getParagraphEntries, bz as getParagraphById, bA as PluginUiHost, bB as OasisEditorEditor, bC as perfTimer, bD as OasisBrandMark, bE as setPreciseFontPreference, bF as setWelcomeSeen, bG as enablePreciseFontMode, bH as createOasisEditorClient, bI as createEditorZoom, bJ as startLongTaskObserver, bK as installGlobalReport, bL as applyStoredPreciseFontPreference, bM as getWelcomeSeen, bN as isLocalFontAccessSupported, bO as EDITOR_SCROLL_PADDING_PX, bP as Toolbar, bQ as OasisEditorLoading, bR as I18nProvider, bS as createEditorLogger, bT as createTranslator, bU as registerDomStatsSurface } from "./index-HQssEsOZ.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) {
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-BQ5KeU1o.js").then((m) => {
2486
+ import("./OasisEditorApp-qFxkruJO.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -15077,83 +15077,6 @@ function resolveTextBoxRenderHeight(textBox, state, pageIndex) {
15077
15077
  }
15078
15078
  return measureTextBoxNaturalHeight(textBox, state, pageIndex);
15079
15079
  }
15080
- function getCanvasPageElements(surface) {
15081
- const pages = Array.from(
15082
- surface.querySelectorAll(
15083
- '[data-renderer="canvas"][data-page-index]'
15084
- )
15085
- );
15086
- return pages.sort((a, b) => {
15087
- const left = Number(a.dataset.pageIndex ?? "0");
15088
- const right = Number(b.dataset.pageIndex ?? "0");
15089
- return left - right;
15090
- });
15091
- }
15092
- function collectInlineImagesFromLines(options) {
15093
- const inlineImages = [];
15094
- for (const line of options.lines) {
15095
- for (const fragment of line.fragments) {
15096
- if (!fragment.image || fragment.image.floating) {
15097
- continue;
15098
- }
15099
- const imageStartOffset = fragment.startOffset;
15100
- const imageEndOffset = fragment.endOffset > imageStartOffset ? fragment.endOffset : imageStartOffset + 1;
15101
- const slot = line.slots.find((candidate) => candidate.offset === imageStartOffset) ?? line.slots.find((candidate) => candidate.offset >= imageStartOffset);
15102
- if (!slot) {
15103
- continue;
15104
- }
15105
- inlineImages.push({
15106
- paragraphId: options.paragraphId,
15107
- paragraphIndex: options.paragraphIndex,
15108
- zone: options.zone,
15109
- footnoteId: options.footnoteId,
15110
- pageIndex: options.pageIndex,
15111
- startOffset: imageStartOffset,
15112
- endOffset: imageEndOffset,
15113
- left: options.lineLeftOffset + slot.left,
15114
- top: options.lineTopOffset + line.top + line.height - fragment.image.height,
15115
- width: fragment.image.width,
15116
- height: fragment.image.height,
15117
- rotation: fragment.image.rotation
15118
- });
15119
- }
15120
- }
15121
- return inlineImages;
15122
- }
15123
- function collectInlineTextBoxesFromLines(options) {
15124
- const inlineTextBoxes = [];
15125
- for (const line of options.lines) {
15126
- for (const fragment of line.fragments) {
15127
- if (!fragment.textBox || fragment.textBox.floating) {
15128
- continue;
15129
- }
15130
- const startOffset = fragment.startOffset;
15131
- const endOffset = fragment.endOffset > startOffset ? fragment.endOffset : startOffset + 1;
15132
- const slot = line.slots.find((candidate) => candidate.offset === startOffset) ?? line.slots.find((candidate) => candidate.offset >= startOffset);
15133
- if (!slot) {
15134
- continue;
15135
- }
15136
- const height = options.resolveHeight(
15137
- fragment.textBox
15138
- );
15139
- inlineTextBoxes.push({
15140
- paragraphId: options.paragraphId,
15141
- paragraphIndex: options.paragraphIndex,
15142
- zone: options.zone,
15143
- footnoteId: options.footnoteId,
15144
- pageIndex: options.pageIndex,
15145
- startOffset,
15146
- endOffset,
15147
- left: options.lineLeftOffset + slot.left,
15148
- top: options.lineTopOffset + line.top + line.height - height,
15149
- width: fragment.textBox.width,
15150
- height,
15151
- rotation: fragment.textBox.rotation
15152
- });
15153
- }
15154
- }
15155
- return inlineTextBoxes;
15156
- }
15157
15080
  function resolveFloatingTopLeft(floating, opts) {
15158
15081
  const emuToPx2 = (value) => value === void 0 ? 0 : value / EMU_PER_PX;
15159
15082
  const h = floating.positionH;
@@ -15258,6 +15181,83 @@ function collectFloatingTextBoxesFromLines(options) {
15258
15181
  }
15259
15182
  return result;
15260
15183
  }
15184
+ function getCanvasPageElements(surface) {
15185
+ const pages = Array.from(
15186
+ surface.querySelectorAll(
15187
+ '[data-renderer="canvas"][data-page-index]'
15188
+ )
15189
+ );
15190
+ return pages.sort((a, b) => {
15191
+ const left = Number(a.dataset.pageIndex ?? "0");
15192
+ const right = Number(b.dataset.pageIndex ?? "0");
15193
+ return left - right;
15194
+ });
15195
+ }
15196
+ function collectInlineImagesFromLines(options) {
15197
+ const inlineImages = [];
15198
+ for (const line of options.lines) {
15199
+ for (const fragment of line.fragments) {
15200
+ if (!fragment.image || fragment.image.floating) {
15201
+ continue;
15202
+ }
15203
+ const imageStartOffset = fragment.startOffset;
15204
+ const imageEndOffset = fragment.endOffset > imageStartOffset ? fragment.endOffset : imageStartOffset + 1;
15205
+ const slot = line.slots.find((candidate) => candidate.offset === imageStartOffset) ?? line.slots.find((candidate) => candidate.offset >= imageStartOffset);
15206
+ if (!slot) {
15207
+ continue;
15208
+ }
15209
+ inlineImages.push({
15210
+ paragraphId: options.paragraphId,
15211
+ paragraphIndex: options.paragraphIndex,
15212
+ zone: options.zone,
15213
+ footnoteId: options.footnoteId,
15214
+ pageIndex: options.pageIndex,
15215
+ startOffset: imageStartOffset,
15216
+ endOffset: imageEndOffset,
15217
+ left: options.lineLeftOffset + slot.left,
15218
+ top: options.lineTopOffset + line.top + line.height - fragment.image.height,
15219
+ width: fragment.image.width,
15220
+ height: fragment.image.height,
15221
+ rotation: fragment.image.rotation
15222
+ });
15223
+ }
15224
+ }
15225
+ return inlineImages;
15226
+ }
15227
+ function collectInlineTextBoxesFromLines(options) {
15228
+ const inlineTextBoxes = [];
15229
+ for (const line of options.lines) {
15230
+ for (const fragment of line.fragments) {
15231
+ if (!fragment.textBox || fragment.textBox.floating) {
15232
+ continue;
15233
+ }
15234
+ const startOffset = fragment.startOffset;
15235
+ const endOffset = fragment.endOffset > startOffset ? fragment.endOffset : startOffset + 1;
15236
+ const slot = line.slots.find((candidate) => candidate.offset === startOffset) ?? line.slots.find((candidate) => candidate.offset >= startOffset);
15237
+ if (!slot) {
15238
+ continue;
15239
+ }
15240
+ const height = options.resolveHeight(
15241
+ fragment.textBox
15242
+ );
15243
+ inlineTextBoxes.push({
15244
+ paragraphId: options.paragraphId,
15245
+ paragraphIndex: options.paragraphIndex,
15246
+ zone: options.zone,
15247
+ footnoteId: options.footnoteId,
15248
+ pageIndex: options.pageIndex,
15249
+ startOffset,
15250
+ endOffset,
15251
+ left: options.lineLeftOffset + slot.left,
15252
+ top: options.lineTopOffset + line.top + line.height - height,
15253
+ width: fragment.textBox.width,
15254
+ height,
15255
+ rotation: fragment.textBox.rotation
15256
+ });
15257
+ }
15258
+ }
15259
+ return inlineTextBoxes;
15260
+ }
15261
15261
  function buildVerticalCellSnapshotLines(options) {
15262
15262
  const box = {
15263
15263
  x: options.cell.contentLeft,
@@ -1,4 +1,4 @@
1
- import { b2, bV, bW, bX, bY, bZ, bk, b_, b3, a_, b$, c0, c1, b1, c2, aY, c3, c4, c5, c6, c7, bQ, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, bp, cj, bP, ck, bX as bX2, c0 as c02, c2 as c22, cb as cb2, cd as cd2, ci as ci2, cl, b0, aX, cm, cn, co, aZ, cp, cq, a$ } from "./index-DiZU2BUt.js";
1
+ import { b2, bV, bW, bX, bY, bZ, bk, b_, b3, a_, b$, c0, c1, b1, c2, aY, c3, c4, c5, c6, c7, bQ, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, bp, cj, bP, ck, bX as bX2, c0 as c02, c2 as c22, cb as cb2, cd as cd2, ci as ci2, cl, b0, aX, cm, cn, co, aZ, cp, cq, a$ } from "./index-HQssEsOZ.js";
2
2
  export {
3
3
  b2 as BalloonShell,
4
4
  bV as Button,