oasis-editor 0.0.71 → 0.0.72

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, i as isInlineObjectRun, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, j as getActiveSectionIndex, p as positionToParagraphOffset, k as paragraphOffsetToPosition, l as clampPosition, m as findParagraphIndex, o as createCollapsedSelection, q as isSelectionCollapsed, E as EMU_PER_PX, r as assertNever, s as createEditorParagraph, t as getBlockParagraphs, u as createEditorFootnote, v as createFootnoteReferenceRun, w as renumberFootnotes, x as iterateFootnoteReferenceRuns, y as getFootnoteDisplayMarker, z as findParagraphTableLocation, A as buildTableCellLayout, B as createSignal, C as createEffect, D as onCleanup, F as buildCanvasLayoutSnapshot, G as on, H as onMount, I as debounce, J as unwrap, K as getDocumentParagraphs, P as PT_PER_PX, L as createEditorTableCell, M as createEditorTableRow, N as createEditorTable, O as getDocumentSectionsCanonical, Q as createEditorDocument, R as getPageContentWidth, S as getDocumentPageSettings, T as getTableCellContentWidthForParagraph, U as resolveResizedDimensions, V as resolveImageSrc, W as resolveTextBoxRenderHeight, X as TWIPS_PER_POINT, Y as PX_PER_INCH, Z as TWIPS_PER_INCH, _ as resolveEffectiveParagraphStyle, $ as resolveEffectiveTextStyleForParagraph, a0 as EMU_PER_PT, a1 as iterateEndnoteReferenceRuns, a2 as imageContentTypeDefaults, a3 as JSZip, a4 as imageExtensionFromMime, a5 as pxToPt$1, a6 as resolveFloatingObjectRect, a7 as getTextBoxFloatingGeometry, a8 as getPresetPathSegments, a9 as projectBlocksLayout, aa as buildListLabels, ab as textStyleToFontSizePt, ac as PX_PER_POINT, ad as DEFAULT_FONT_SIZE_PX, ae as isDoubleUnderlineStyle, af as isWavyUnderlineStyle, ag as underlineStyleLineWidthPx, ah as underlineStyleDashArray, ai as resolveListLabel, aj as getListLabelInset, ak as getAlignedListLabelInset, al as getParagraphBorderInsets, am as buildSegmentTable, an as buildCanvasTableLayout, ao as normalizeFamily, ap as ROBOTO_FONT_FILES, aq as loadFontAsset, ar as OFFICE_COMPAT_FONT_FAMILIES, as as buildSfnt, at as defaultFontDecoderRegistry, au as SfntFontProgram, av as collectPdfFontFamilies, aw as projectDocumentLayout, ax as getPageHeaderZoneTop, ay as getPageBodyTop, az as getPageColumnRects, aA as findFootnoteReference, aB as FOOTNOTE_MARKER_GUTTER_PX, aC as resolveImporterForFile, aD as createEditorStateFromDocument, aE as getDocumentParagraphsCanonical, aF as getToolbarStyleState, aG as STANDARD_FONT_SIZES_PT, aH as fontSizePxToPt, aI as probeLocalFontFamilies, aJ as createInitialEditorState, aK as parseFontSizePtToPx, aL as formatFontSizePt, aM as underlineStyleToCssDecorationStyle, aN as listKindForTag, aO as isParagraphTag, aP as collectInlineRuns, aQ as parseParagraphStyle, aR as getCachedCanvasImage, aS as getHeadingLevel, aT as preciseFontModeVersion, aU as isPreciseFontModeEnabled, aV as togglePreciseFontMode, aW as nextFontSizePt, aX as previousFontSizePt, aY as fontSizePtToPx, aZ as createDefaultToolbarPreset, a_ as MenuRegistry, a$ as createToolbarRegistry, b0 as Editor, b1 as resolveCommandRef, b2 as commandRefName, b3 as InlineShell, b4 as BalloonShell, b5 as DocumentShell, b6 as createMemo, b7 as getCaretRectFromSnapshot, b8 as getParagraphRectFromSnapshot, b9 as createComponent, ba as CaretOverlay, bb as Show, bc as createRenderEffect, bd as style, be as setAttribute, bf as setStyleProperty, bg as memo, bh as template, bi as useI18n, bj as insert, bk as use, bl as addEventListener, bm as Dialog, bn as delegateEvents, bo as className, bp as For, bq as UNDERLINE_STYLE_OPTIONS, br as Tabs, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as PluginUiHost, bD as OasisEditorEditor, bE as perfTimer, bF as OasisBrandMark, bG as setPreciseFontPreference, bH as setWelcomeSeen, bI as enablePreciseFontMode, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createEditorLogger, bV as createTranslator, bW as registerDomStatsSurface } from "./index-BBQr5P8i.js";
4
+ import { n as normalizeSelection, g as getParagraphs, a as assertNever, c as createEditorParagraphFromRuns, b as getParagraphLength, d as createEditorRun, e as getDocumentSections, i as isInlineObjectRun, f as createEditorStyledRun, h as getParagraphText, j as getActiveZone, k as getActiveSectionIndex, p as positionToParagraphOffset, l as paragraphOffsetToPosition, m as clampPosition, o as findParagraphIndex, q as createCollapsedSelection, r as isSelectionCollapsed, E as EMU_PER_PX, s as createEditorParagraph, t as getBlockParagraphs, u as createEditorFootnote, v as createFootnoteReferenceRun, w as renumberFootnotes, x as iterateFootnoteReferenceRuns, y as getFootnoteDisplayMarker, z as findParagraphTableLocation, A as buildTableCellLayout, B as createSignal, C as createEffect, D as onCleanup, F as buildCanvasLayoutSnapshot, G as on, H as onMount, I as debounce, J as unwrap, K as getDocumentParagraphs, P as PT_PER_PX, L as createEditorTableCell, M as createEditorTableRow, N as createEditorTable, O as getDocumentSectionsCanonical, Q as createEditorDocument, R as getPageContentWidth, S as getDocumentPageSettings, T as getTableCellContentWidthForParagraph, U as resolveResizedDimensions, V as resolveImageSrc, W as resolveTextBoxRenderHeight, X as TWIPS_PER_POINT, Y as PX_PER_INCH, Z as TWIPS_PER_INCH, _ as resolveEffectiveParagraphStyle, $ as resolveEffectiveTextStyleForParagraph, a0 as EMU_PER_PT, a1 as iterateEndnoteReferenceRuns, a2 as imageContentTypeDefaults, a3 as JSZip, a4 as imageExtensionFromMime, a5 as pxToPt$1, a6 as resolveFloatingObjectRect, a7 as getTextBoxFloatingGeometry, a8 as getPresetPathSegments, a9 as projectBlocksLayout, aa as buildListLabels, ab as textStyleToFontSizePt, ac as PX_PER_POINT, ad as DEFAULT_FONT_SIZE_PX, ae as isDoubleUnderlineStyle, af as isWavyUnderlineStyle, ag as underlineStyleLineWidthPx, ah as underlineStyleDashArray, ai as resolveListLabel, aj as getListLabelInset, ak as getAlignedListLabelInset, al as getParagraphBorderInsets, am as buildSegmentTable, an as buildCanvasTableLayout, ao as normalizeFamily, ap as ROBOTO_FONT_FILES, aq as loadFontAsset, ar as OFFICE_COMPAT_FONT_FAMILIES, as as buildSfnt, at as defaultFontDecoderRegistry, au as SfntFontProgram, av as collectPdfFontFamilies, aw as projectDocumentLayout, ax as getPageHeaderZoneTop, ay as getPageBodyTop, az as getPageColumnRects, aA as findFootnoteReference, aB as FOOTNOTE_MARKER_GUTTER_PX, aC as resolveImporterForFile, aD as createEditorStateFromDocument, aE as getDocumentParagraphsCanonical, aF as getToolbarStyleState, aG as STANDARD_FONT_SIZES_PT, aH as fontSizePxToPt, aI as probeLocalFontFamilies, aJ as createInitialEditorState, aK as parseFontSizePtToPx, aL as formatFontSizePt, aM as underlineStyleToCssDecorationStyle, aN as listKindForTag, aO as isParagraphTag, aP as collectInlineRuns, aQ as parseParagraphStyle, aR as getCachedCanvasImage, aS as getHeadingLevel, aT as preciseFontModeVersion, aU as isPreciseFontModeEnabled, aV as togglePreciseFontMode, aW as nextFontSizePt, aX as previousFontSizePt, aY as fontSizePtToPx, aZ as createDefaultToolbarPreset, a_ as MenuRegistry, a$ as createToolbarRegistry, b0 as Editor, b1 as resolveCommandRef, b2 as commandRefName, b3 as InlineShell, b4 as BalloonShell, b5 as DocumentShell, b6 as createMemo, b7 as getCaretRectFromSnapshot, b8 as getParagraphRectFromSnapshot, b9 as createComponent, ba as CaretOverlay, bb as Show, bc as createRenderEffect, bd as style, be as setAttribute, bf as setStyleProperty, bg as memo, bh as template, bi as useI18n, bj as insert, bk as use, bl as addEventListener, bm as Dialog, bn as delegateEvents, bo as className, bp as For, bq as UNDERLINE_STYLE_OPTIONS, br as Tabs, bs as measureParagraphMinContentWidthPx, bt as getEditableBlocksForZone, bu as findParagraphLocation, bv as createSectionBoundaryParagraph, bw as normalizePageSettings, bx as DEFAULT_EDITOR_PAGE_SETTINGS, by as markStart, bz as markEnd, bA as getParagraphEntries, bB as getParagraphById, bC as PluginUiHost, bD as OasisEditorEditor, bE as perfTimer, bF as OasisBrandMark, bG as setPreciseFontPreference, bH as setWelcomeSeen, bI as enablePreciseFontMode, bJ as createOasisEditorClient, bK as createEditorZoom, bL as startLongTaskObserver, bM as installGlobalReport, bN as applyStoredPreciseFontPreference, bO as getWelcomeSeen, bP as isLocalFontAccessSupported, bQ as EDITOR_SCROLL_PADDING_PX, bR as Toolbar, bS as OasisEditorLoading, bT as I18nProvider, bU as createEditorLogger, bV as createTranslator, bW as registerDomStatsSurface } from "./index-Ybd6l30Z.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) {
@@ -157,34 +157,38 @@ function cloneParagraphs(paragraphs) {
157
157
  }
158
158
  function cloneBlocks(blocks) {
159
159
  return blocks.map((block) => {
160
- if (block.type === "paragraph") {
161
- return cloneParagraph(block);
162
- }
163
- return {
164
- ...block,
165
- style: block.style ? {
166
- ...block.style,
167
- defaultCellMargins: block.style.defaultCellMargins ? { ...block.style.defaultCellMargins } : void 0,
168
- floating: block.style.floating ? { ...block.style.floating } : void 0,
169
- revisionXml: block.style.revisionXml ? [...block.style.revisionXml] : void 0
170
- } : void 0,
171
- tblGridChangeXml: block.tblGridChangeXml,
172
- rows: block.rows.map((row) => ({
173
- ...row,
174
- style: row.style ? {
175
- ...row.style,
176
- revisionXml: row.style.revisionXml ? [...row.style.revisionXml] : void 0
177
- } : void 0,
178
- cells: row.cells.map((cell) => ({
179
- ...cell,
180
- style: cell.style ? {
181
- ...cell.style,
182
- revisionXml: cell.style.revisionXml ? [...cell.style.revisionXml] : void 0
160
+ switch (block.type) {
161
+ case "paragraph":
162
+ return cloneParagraph(block);
163
+ case "table":
164
+ return {
165
+ ...block,
166
+ style: block.style ? {
167
+ ...block.style,
168
+ defaultCellMargins: block.style.defaultCellMargins ? { ...block.style.defaultCellMargins } : void 0,
169
+ floating: block.style.floating ? { ...block.style.floating } : void 0,
170
+ revisionXml: block.style.revisionXml ? [...block.style.revisionXml] : void 0
183
171
  } : void 0,
184
- blocks: cloneParagraphs(cell.blocks)
185
- }))
186
- }))
187
- };
172
+ tblGridChangeXml: block.tblGridChangeXml,
173
+ rows: block.rows.map((row) => ({
174
+ ...row,
175
+ style: row.style ? {
176
+ ...row.style,
177
+ revisionXml: row.style.revisionXml ? [...row.style.revisionXml] : void 0
178
+ } : void 0,
179
+ cells: row.cells.map((cell) => ({
180
+ ...cell,
181
+ style: cell.style ? {
182
+ ...cell.style,
183
+ revisionXml: cell.style.revisionXml ? [...cell.style.revisionXml] : void 0
184
+ } : void 0,
185
+ blocks: cloneParagraphs(cell.blocks)
186
+ }))
187
+ }))
188
+ };
189
+ default:
190
+ return assertNever(block, "block");
191
+ }
188
192
  });
189
193
  }
190
194
  const IMAGE_CAPTION_STYLE_ID = "Caption";
@@ -306,25 +310,26 @@ function renumberImageCaptionParagraphs(paragraphs) {
306
310
  }
307
311
  function renumberBlocks(blocks, sequence) {
308
312
  return blocks.map((block) => {
309
- if (block.type === "paragraph") {
310
- if (!isImageCaptionParagraph(block)) {
311
- return cloneParagraph(block);
312
- }
313
- return renumberCaptionParagraph(block, sequence.next++);
313
+ switch (block.type) {
314
+ case "paragraph":
315
+ return isImageCaptionParagraph(block) ? renumberCaptionParagraph(block, sequence.next++) : cloneParagraph(block);
316
+ case "table":
317
+ return {
318
+ ...block,
319
+ rows: block.rows.map((row) => ({
320
+ ...row,
321
+ cells: row.cells.map((cell) => ({
322
+ ...cell,
323
+ blocks: renumberBlocks(
324
+ cell.blocks,
325
+ sequence
326
+ )
327
+ }))
328
+ }))
329
+ };
330
+ default:
331
+ return assertNever(block, "block");
314
332
  }
315
- return {
316
- ...block,
317
- rows: block.rows.map((row) => ({
318
- ...row,
319
- cells: row.cells.map((cell) => ({
320
- ...cell,
321
- blocks: renumberBlocks(
322
- cell.blocks,
323
- sequence
324
- )
325
- }))
326
- }))
327
- };
328
333
  });
329
334
  }
330
335
  function renumberImageCaptionsInDocument(document2) {
@@ -2483,7 +2483,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2483
  onCleanup(() => {
2484
2484
  cancelled = true;
2485
2485
  });
2486
- import("./OasisEditorApp-Cy7UGzeb.js").then((m) => {
2486
+ import("./OasisEditorApp-BqiPk81i.js").then((m) => {
2487
2487
  cancelled = true;
2488
2488
  setProgress(1);
2489
2489
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3644,13 +3644,18 @@ function collectNumberingParagraphs(document2) {
3644
3644
  };
3645
3645
  const collectBlocks2 = (blocks) => {
3646
3646
  for (const block of blocks) {
3647
- if (block.type === "paragraph") {
3648
- result.push(block);
3649
- collectTextBoxes(block);
3650
- } else {
3651
- for (const row of block.rows) {
3652
- for (const cell of row.cells) collectBlocks2(cell.blocks);
3653
- }
3647
+ switch (block.type) {
3648
+ case "paragraph":
3649
+ result.push(block);
3650
+ collectTextBoxes(block);
3651
+ break;
3652
+ case "table":
3653
+ for (const row of block.rows) {
3654
+ for (const cell of row.cells) collectBlocks2(cell.blocks);
3655
+ }
3656
+ break;
3657
+ default:
3658
+ assertNever(block, "block");
3654
3659
  }
3655
3660
  }
3656
3661
  };
@@ -3730,7 +3735,7 @@ function getEditableBlocksForZone(state, zone) {
3730
3735
  }
3731
3736
  function getParagraphs(state) {
3732
3737
  return getEditableBlocksForZone(state, getActiveZone(state)).flatMap(
3733
- (block) => block.type === "paragraph" ? [block] : block.rows.flatMap((row) => row.cells.flatMap((cell) => cell.blocks))
3738
+ getBlockParagraphs
3734
3739
  );
3735
3740
  }
3736
3741
  function findParagraphIndex(paragraphs, paragraphId) {
@@ -39971,7 +39976,7 @@ export {
39971
39976
  PX_PER_INCH as Y,
39972
39977
  TWIPS_PER_INCH as Z,
39973
39978
  resolveEffectiveParagraphStyle as _,
39974
- getParagraphLength as a,
39979
+ assertNever as a,
39975
39980
  createToolbarRegistry as a$,
39976
39981
  EMU_PER_PT as a0,
39977
39982
  iterateEndnoteReferenceRuns as a1,
@@ -40036,7 +40041,7 @@ export {
40036
40041
  getPageHeaderZoneTop as ax,
40037
40042
  getPageBodyTop as ay,
40038
40043
  getPageColumnRects as az,
40039
- createEditorRun as b,
40044
+ getParagraphLength as b,
40040
40045
  DEFAULT_PALETTE as b$,
40041
40046
  Editor as b0,
40042
40047
  resolveCommandRef as b1,
@@ -40131,21 +40136,21 @@ export {
40131
40136
  createOasisEditorContainer as cq,
40132
40137
  mount as cr,
40133
40138
  registerToolbarRenderer as cs,
40134
- getDocumentSections as d,
40135
- createEditorStyledRun as e,
40136
- getParagraphText as f,
40139
+ createEditorRun as d,
40140
+ getDocumentSections as e,
40141
+ createEditorStyledRun as f,
40137
40142
  getParagraphs as g,
40138
- getActiveZone as h,
40143
+ getParagraphText as h,
40139
40144
  isInlineObjectRun as i,
40140
- getActiveSectionIndex as j,
40141
- paragraphOffsetToPosition as k,
40142
- clampPosition as l,
40143
- findParagraphIndex as m,
40145
+ getActiveZone as j,
40146
+ getActiveSectionIndex as k,
40147
+ paragraphOffsetToPosition as l,
40148
+ clampPosition as m,
40144
40149
  normalizeSelection as n,
40145
- createCollapsedSelection as o,
40150
+ findParagraphIndex as o,
40146
40151
  positionToParagraphOffset as p,
40147
- isSelectionCollapsed as q,
40148
- assertNever as r,
40152
+ createCollapsedSelection as q,
40153
+ isSelectionCollapsed as r,
40149
40154
  createEditorParagraph as s,
40150
40155
  getBlockParagraphs as t,
40151
40156
  createEditorFootnote as u,
@@ -1,4 +1,4 @@
1
- import { b4, bX, bY, bZ, b_, b$, bm, c0, b5, b0, c1, c2, c3, b3, c4, a_, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, br, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, b2, aZ, co, cp, cq, a$, cr, cs, b1 } from "./index-BBQr5P8i.js";
1
+ import { b4, bX, bY, bZ, b_, b$, bm, c0, b5, b0, c1, c2, c3, b3, c4, a_, c5, c6, c7, c8, c9, bS, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, br, cl, bR, cm, bZ as bZ2, c2 as c22, c4 as c42, cd as cd2, cf as cf2, ck as ck2, cn, b2, aZ, co, cp, cq, a$, cr, cs, b1 } from "./index-Ybd6l30Z.js";
2
2
  export {
3
3
  b4 as BalloonShell,
4
4
  bX as Button,