oasis-editor 0.0.71 → 0.0.73

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.
@@ -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-BkJmlejJ.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) {
@@ -14073,32 +14078,41 @@ function renumberFootnotes(document2) {
14073
14078
  if (!blocks) return blocks;
14074
14079
  let blockChanged = false;
14075
14080
  const nextBlocks = blocks.map((block) => {
14076
- if (block.type === "paragraph") {
14077
- const updated = rewriteParagraphMarkers$1(block, markerByFootnoteId);
14078
- if (updated !== block) blockChanged = true;
14079
- return updated;
14080
- }
14081
- let tableChanged = false;
14082
- const nextRows = block.rows.map((row) => {
14083
- let rowChanged = false;
14084
- const nextCells = row.cells.map((cell) => {
14085
- let cellChanged = false;
14086
- const nextCellBlocks = cell.blocks.map((p) => {
14087
- const updated = rewriteParagraphMarkers$1(p, markerByFootnoteId);
14088
- if (updated !== p) cellChanged = true;
14089
- return updated;
14081
+ switch (block.type) {
14082
+ case "paragraph": {
14083
+ const updated = rewriteParagraphMarkers$1(block, markerByFootnoteId);
14084
+ if (updated !== block) blockChanged = true;
14085
+ return updated;
14086
+ }
14087
+ case "table": {
14088
+ let tableChanged = false;
14089
+ const nextRows = block.rows.map((row) => {
14090
+ let rowChanged = false;
14091
+ const nextCells = row.cells.map((cell) => {
14092
+ let cellChanged = false;
14093
+ const nextCellBlocks = cell.blocks.map((p) => {
14094
+ const updated = rewriteParagraphMarkers$1(
14095
+ p,
14096
+ markerByFootnoteId
14097
+ );
14098
+ if (updated !== p) cellChanged = true;
14099
+ return updated;
14100
+ });
14101
+ if (!cellChanged) return cell;
14102
+ rowChanged = true;
14103
+ return { ...cell, blocks: nextCellBlocks };
14104
+ });
14105
+ if (!rowChanged) return row;
14106
+ tableChanged = true;
14107
+ return { ...row, cells: nextCells };
14090
14108
  });
14091
- if (!cellChanged) return cell;
14092
- rowChanged = true;
14093
- return { ...cell, blocks: nextCellBlocks };
14094
- });
14095
- if (!rowChanged) return row;
14096
- tableChanged = true;
14097
- return { ...row, cells: nextCells };
14098
- });
14099
- if (!tableChanged) return block;
14100
- blockChanged = true;
14101
- return { ...block, rows: nextRows };
14109
+ if (!tableChanged) return block;
14110
+ blockChanged = true;
14111
+ return { ...block, rows: nextRows };
14112
+ }
14113
+ default:
14114
+ return assertNever(block, "block");
14115
+ }
14102
14116
  });
14103
14117
  if (!blockChanged) return blocks;
14104
14118
  mutatedSections = true;
@@ -14227,32 +14241,38 @@ function renumberEndnotes(document2) {
14227
14241
  if (!blocks) return blocks;
14228
14242
  let blockChanged = false;
14229
14243
  const nextBlocks = blocks.map((block) => {
14230
- if (block.type === "paragraph") {
14231
- const updated = rewriteParagraphMarkers(block, markerByEndnoteId);
14232
- if (updated !== block) blockChanged = true;
14233
- return updated;
14234
- }
14235
- let tableChanged = false;
14236
- const nextRows = block.rows.map((row) => {
14237
- let rowChanged = false;
14238
- const nextCells = row.cells.map((cell) => {
14239
- let cellChanged = false;
14240
- const nextCellBlocks = cell.blocks.map((p) => {
14241
- const updated = rewriteParagraphMarkers(p, markerByEndnoteId);
14242
- if (updated !== p) cellChanged = true;
14243
- return updated;
14244
+ switch (block.type) {
14245
+ case "paragraph": {
14246
+ const updated = rewriteParagraphMarkers(block, markerByEndnoteId);
14247
+ if (updated !== block) blockChanged = true;
14248
+ return updated;
14249
+ }
14250
+ case "table": {
14251
+ let tableChanged = false;
14252
+ const nextRows = block.rows.map((row) => {
14253
+ let rowChanged = false;
14254
+ const nextCells = row.cells.map((cell) => {
14255
+ let cellChanged = false;
14256
+ const nextCellBlocks = cell.blocks.map((p) => {
14257
+ const updated = rewriteParagraphMarkers(p, markerByEndnoteId);
14258
+ if (updated !== p) cellChanged = true;
14259
+ return updated;
14260
+ });
14261
+ if (!cellChanged) return cell;
14262
+ rowChanged = true;
14263
+ return { ...cell, blocks: nextCellBlocks };
14264
+ });
14265
+ if (!rowChanged) return row;
14266
+ tableChanged = true;
14267
+ return { ...row, cells: nextCells };
14244
14268
  });
14245
- if (!cellChanged) return cell;
14246
- rowChanged = true;
14247
- return { ...cell, blocks: nextCellBlocks };
14248
- });
14249
- if (!rowChanged) return row;
14250
- tableChanged = true;
14251
- return { ...row, cells: nextCells };
14252
- });
14253
- if (!tableChanged) return block;
14254
- blockChanged = true;
14255
- return { ...block, rows: nextRows };
14269
+ if (!tableChanged) return block;
14270
+ blockChanged = true;
14271
+ return { ...block, rows: nextRows };
14272
+ }
14273
+ default:
14274
+ return assertNever(block, "block");
14275
+ }
14256
14276
  });
14257
14277
  if (!blockChanged) return blocks;
14258
14278
  mutatedSections = true;
@@ -35607,7 +35627,7 @@ function importDocxInWorker(buffer, options = {}) {
35607
35627
  const worker = new Worker(
35608
35628
  new URL(
35609
35629
  /* @vite-ignore */
35610
- "" + new URL("assets/importDocxWorker-Bn1fun73.js", import.meta.url).href,
35630
+ "" + new URL("assets/importDocxWorker-CmygfpkG.js", import.meta.url).href,
35611
35631
  import.meta.url
35612
35632
  ),
35613
35633
  {
@@ -39971,7 +39991,7 @@ export {
39971
39991
  PX_PER_INCH as Y,
39972
39992
  TWIPS_PER_INCH as Z,
39973
39993
  resolveEffectiveParagraphStyle as _,
39974
- getParagraphLength as a,
39994
+ assertNever as a,
39975
39995
  createToolbarRegistry as a$,
39976
39996
  EMU_PER_PT as a0,
39977
39997
  iterateEndnoteReferenceRuns as a1,
@@ -40036,7 +40056,7 @@ export {
40036
40056
  getPageHeaderZoneTop as ax,
40037
40057
  getPageBodyTop as ay,
40038
40058
  getPageColumnRects as az,
40039
- createEditorRun as b,
40059
+ getParagraphLength as b,
40040
40060
  DEFAULT_PALETTE as b$,
40041
40061
  Editor as b0,
40042
40062
  resolveCommandRef as b1,
@@ -40131,21 +40151,21 @@ export {
40131
40151
  createOasisEditorContainer as cq,
40132
40152
  mount as cr,
40133
40153
  registerToolbarRenderer as cs,
40134
- getDocumentSections as d,
40135
- createEditorStyledRun as e,
40136
- getParagraphText as f,
40154
+ createEditorRun as d,
40155
+ getDocumentSections as e,
40156
+ createEditorStyledRun as f,
40137
40157
  getParagraphs as g,
40138
- getActiveZone as h,
40158
+ getParagraphText as h,
40139
40159
  isInlineObjectRun as i,
40140
- getActiveSectionIndex as j,
40141
- paragraphOffsetToPosition as k,
40142
- clampPosition as l,
40143
- findParagraphIndex as m,
40160
+ getActiveZone as j,
40161
+ getActiveSectionIndex as k,
40162
+ paragraphOffsetToPosition as l,
40163
+ clampPosition as m,
40144
40164
  normalizeSelection as n,
40145
- createCollapsedSelection as o,
40165
+ findParagraphIndex as o,
40146
40166
  positionToParagraphOffset as p,
40147
- isSelectionCollapsed as q,
40148
- assertNever as r,
40167
+ createCollapsedSelection as q,
40168
+ isSelectionCollapsed as r,
40149
40169
  createEditorParagraph as s,
40150
40170
  getBlockParagraphs as t,
40151
40171
  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-ByZZP8TQ.js";
2
2
  export {
3
3
  b4 as BalloonShell,
4
4
  bX as Button,