oasis-editor 0.0.87 → 0.0.89

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.
Files changed (46) hide show
  1. package/dist/{OasisEditorApp-CE15GH_N.js → OasisEditorApp-cKm4OFIF.js} +1383 -179
  2. package/dist/app/controllers/EditorCommandsController.d.ts +1 -1
  3. package/dist/app/controllers/useEditorStyle.d.ts +1 -1
  4. package/dist/assets/{importDocxWorker-C94l6-O5.js → importDocxWorker-DVDyiqYf.js} +1 -1
  5. package/dist/core/commands/builtinCommands.d.ts +1 -1
  6. package/dist/core/commands/publicCommandTypes.d.ts +1 -0
  7. package/dist/core/commands/table/tableCommandUtils.d.ts +2 -1
  8. package/dist/core/commands/table/tableFloatingCommands.d.ts +5 -0
  9. package/dist/core/commands/table.d.ts +1 -0
  10. package/dist/core/model/index.d.ts +2 -2
  11. package/dist/core/model/types/layout.d.ts +4 -0
  12. package/dist/core/model/types/nodes.d.ts +23 -7
  13. package/dist/core/model/types/primitives.d.ts +17 -0
  14. package/dist/core/model/types/styles.d.ts +51 -6
  15. package/dist/core/model.d.ts +1 -0
  16. package/dist/core/tableStyleResolver.d.ts +20 -0
  17. package/dist/core/textStyle/textStyleKeys.d.ts +1 -1
  18. package/dist/export/docx/tableXml.d.ts +1 -0
  19. package/dist/export/pdf/draw/drawFragment.d.ts +13 -1
  20. package/dist/export/pdf/draw/drawTextBoxShape.d.ts +1 -0
  21. package/dist/i18n/locales/en.d.ts +18 -0
  22. package/dist/i18n/locales/pt-BR.d.ts +18 -0
  23. package/dist/import/docx/tableProperties.d.ts +2 -1
  24. package/dist/import/docx/tables.d.ts +1 -1
  25. package/dist/{index-DFKc0jbc.js → index-BICQTKCZ.js} +1657 -896
  26. package/dist/index.d.ts +3 -1
  27. package/dist/layoutProjection/floatingObjects.d.ts +15 -1
  28. package/dist/layoutProjection/paginationTrack.d.ts +2 -0
  29. package/dist/layoutProjection/paragraphPagination.d.ts +2 -2
  30. package/dist/oasis-editor.css +1 -1
  31. package/dist/oasis-editor.js +50 -49
  32. package/dist/oasis-editor.umd.cjs +4 -4
  33. package/dist/plugins/internal/essentialsCapabilities.d.ts +10 -0
  34. package/dist/ui/app/createAppCommandsController.d.ts +2 -2
  35. package/dist/ui/app/createEditorCommandRuntime.d.ts +1 -1
  36. package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -1
  37. package/dist/ui/canvas/CanvasLayoutSnapshot.d.ts +1 -1
  38. package/dist/ui/canvas/CanvasTableLayout.d.ts +7 -1
  39. package/dist/ui/canvas/canvasBorders.d.ts +2 -0
  40. package/dist/ui/canvas/canvasSnapshotTypes.d.ts +12 -0
  41. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +22 -1
  42. package/dist/ui/components/Toolbar/StyleGallery.d.ts +9 -0
  43. package/dist/ui/components/Toolbar/schema/items.d.ts +17 -1
  44. package/dist/ui/editorUiTypes.d.ts +1 -1
  45. package/dist/ui/toolbarStyleState.d.ts +2 -1
  46. package/package.json +1 -1
@@ -1495,7 +1495,7 @@ const en = {
1495
1495
  "toolbar.formatBullet": "Bullet",
1496
1496
  "toolbar.moreTools": "More tools",
1497
1497
  // Style
1498
- "toolbar.style": "Paragraph Style",
1498
+ "toolbar.style": "Styles",
1499
1499
  "toolbar.fontFamily": "Font Family",
1500
1500
  "toolbar.font": "Font",
1501
1501
  "toolbar.fontSize": "Font Size",
@@ -1650,6 +1650,24 @@ const en = {
1650
1650
  "table.wrapAround": "Around",
1651
1651
  "table.positioning": "Positioning...",
1652
1652
  "table.positioningReadOnly": "Floating table positioning is preserved for DOCX round-trip and is not editable yet.",
1653
+ "table.horizontalAnchor": "Horizontal relative to",
1654
+ "table.verticalAnchor": "Vertical relative to",
1655
+ "table.anchorMargin": "Margin",
1656
+ "table.anchorPage": "Page",
1657
+ "table.anchorText": "Text",
1658
+ "table.positionX": "Horizontal position (pt)",
1659
+ "table.positionY": "Vertical position (pt)",
1660
+ "table.horizontalAlignment": "Horizontal alignment",
1661
+ "table.explicitOffset": "Explicit offset",
1662
+ "table.distanceTop": "Top distance (pt)",
1663
+ "table.distanceRight": "Right distance (pt)",
1664
+ "table.distanceBottom": "Bottom distance (pt)",
1665
+ "table.distanceLeft": "Left distance (pt)",
1666
+ "table.allowOverlap": "Allow overlap",
1667
+ "table.borderStart": "Start",
1668
+ "table.borderEnd": "End",
1669
+ "table.borderTlBr": "Diagonal down",
1670
+ "table.borderTrBl": "Diagonal up",
1653
1671
  "table.rowHeight": "Preferred height",
1654
1672
  "table.rowHeightRule": "Row height is",
1655
1673
  "table.rowAuto": "Auto",
@@ -1953,7 +1971,7 @@ const ptBR = {
1953
1971
  "toolbar.formatBullet": "Marcador",
1954
1972
  "toolbar.moreTools": "Mais ferramentas",
1955
1973
  // Style
1956
- "toolbar.style": "Estilo de Parágrafo",
1974
+ "toolbar.style": "Estilos",
1957
1975
  "toolbar.fontFamily": "Família da Fonte",
1958
1976
  "toolbar.font": "Fonte",
1959
1977
  "toolbar.fontSize": "Tamanho da Fonte",
@@ -2108,6 +2126,24 @@ const ptBR = {
2108
2126
  "table.wrapAround": "Ao redor",
2109
2127
  "table.positioning": "Posicionamento...",
2110
2128
  "table.positioningReadOnly": "O posicionamento de tabela flutuante é preservado no DOCX e ainda não é editável.",
2129
+ "table.horizontalAnchor": "Horizontal relativo a",
2130
+ "table.verticalAnchor": "Vertical relativo a",
2131
+ "table.anchorMargin": "Margem",
2132
+ "table.anchorPage": "Página",
2133
+ "table.anchorText": "Texto",
2134
+ "table.positionX": "Posição horizontal (pt)",
2135
+ "table.positionY": "Posição vertical (pt)",
2136
+ "table.horizontalAlignment": "Alinhamento horizontal",
2137
+ "table.explicitOffset": "Deslocamento explícito",
2138
+ "table.distanceTop": "Distância superior (pt)",
2139
+ "table.distanceRight": "Distância direita (pt)",
2140
+ "table.distanceBottom": "Distância inferior (pt)",
2141
+ "table.distanceLeft": "Distância esquerda (pt)",
2142
+ "table.allowOverlap": "Permitir sobreposição",
2143
+ "table.borderStart": "Início",
2144
+ "table.borderEnd": "Fim",
2145
+ "table.borderTlBr": "Diagonal descendente",
2146
+ "table.borderTrBl": "Diagonal ascendente",
2111
2147
  "table.rowHeight": "Altura preferencial",
2112
2148
  "table.rowHeightRule": "Altura da linha",
2113
2149
  "table.rowAuto": "Automática",
@@ -2384,14 +2420,14 @@ function I18nProvider(props) {
2384
2420
  });
2385
2421
  }
2386
2422
  const oasisMarkBase64 = "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";
2387
- var _tmpl$$R = /* @__PURE__ */ template(`<img alt aria-hidden=true>`);
2423
+ var _tmpl$$S = /* @__PURE__ */ template(`<img alt aria-hidden=true>`);
2388
2424
  const OASIS_MARK_DATA_URI = `data:image/webp;base64,${oasisMarkBase64}`;
2389
2425
  const MARK_ASPECT = 3 / 4;
2390
2426
  function OasisBrandMark(props) {
2391
2427
  const height = () => props.height ?? 64;
2392
2428
  const width = () => Math.round(height() * MARK_ASPECT);
2393
2429
  return (() => {
2394
- var _el$ = _tmpl$$R();
2430
+ var _el$ = _tmpl$$S();
2395
2431
  setAttribute(_el$, "src", OASIS_MARK_DATA_URI);
2396
2432
  setAttribute(_el$, "draggable", false);
2397
2433
  createRenderEffect((_p$) => {
@@ -2408,7 +2444,7 @@ function OasisBrandMark(props) {
2408
2444
  return _el$;
2409
2445
  })();
2410
2446
  }
2411
- var _tmpl$$Q = /* @__PURE__ */ template(`<div class=oasis-editor-import-progress-label>`), _tmpl$2$z = /* @__PURE__ */ template(`<div role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-progress-track><div>`), _tmpl$3$n = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>Done`);
2447
+ var _tmpl$$R = /* @__PURE__ */ template(`<div class=oasis-editor-import-progress-label>`), _tmpl$2$A = /* @__PURE__ */ template(`<div role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-progress-track><div>`), _tmpl$3$o = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>Done`);
2412
2448
  function OasisEditorLoading(props) {
2413
2449
  const t = useI18n();
2414
2450
  const variant = () => props.variant ?? "overlay";
@@ -2418,7 +2454,7 @@ function OasisEditorLoading(props) {
2418
2454
  };
2419
2455
  const isDone = () => (pct() ?? 0) >= 100;
2420
2456
  return (() => {
2421
- var _el$ = _tmpl$2$z(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild;
2457
+ var _el$ = _tmpl$2$A(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild;
2422
2458
  insert(_el$2, createComponent(OasisBrandMark, {
2423
2459
  height: 40,
2424
2460
  "class": "oasis-editor-loading-mark"
@@ -2429,10 +2465,10 @@ function OasisEditorLoading(props) {
2429
2465
  return pct() != null;
2430
2466
  },
2431
2467
  get children() {
2432
- var _el$6 = _tmpl$$Q();
2468
+ var _el$6 = _tmpl$$R();
2433
2469
  insert(_el$6, (() => {
2434
2470
  var _c$ = memo(() => !!isDone());
2435
- return () => _c$() ? _tmpl$3$n() : `${pct()}%`;
2471
+ return () => _c$() ? _tmpl$3$o() : `${pct()}%`;
2436
2472
  })());
2437
2473
  return _el$6;
2438
2474
  }
@@ -2483,7 +2519,7 @@ function OasisEditorAppLazy(props = {}) {
2483
2519
  onCleanup(() => {
2484
2520
  cancelled = true;
2485
2521
  });
2486
- import("./OasisEditorApp-CE15GH_N.js").then((m) => {
2522
+ import("./OasisEditorApp-cKm4OFIF.js").then((m) => {
2487
2523
  cancelled = true;
2488
2524
  setProgress(1);
2489
2525
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3771,6 +3807,198 @@ function getParagraphs(state) {
3771
3807
  getBlockParagraphs
3772
3808
  );
3773
3809
  }
3810
+ function resolveEffectiveTableStyle(table, styles) {
3811
+ var _a;
3812
+ const named = resolveNamedTableStyle((_a = table.style) == null ? void 0 : _a.styleId, styles);
3813
+ return mergeTableStyles(named.tableStyle, table.style);
3814
+ }
3815
+ function resolveTableParagraphInheritance(tableStyle, paragraphStyleId, styles) {
3816
+ if (!tableStyle) return void 0;
3817
+ const effectiveStyleId = paragraphStyleId ?? resolveDefaultParagraphStyleId(styles);
3818
+ const named = resolveNamedParagraphStyle(effectiveStyleId, styles);
3819
+ const inherited = {};
3820
+ for (const [key, value] of Object.entries(tableStyle)) {
3821
+ if (!(key in named)) {
3822
+ inherited[key] = value;
3823
+ }
3824
+ }
3825
+ return Object.keys(inherited).length > 0 ? inherited : void 0;
3826
+ }
3827
+ function mergeTableStyles(base, next) {
3828
+ const conditionalFormats = {
3829
+ ...(base == null ? void 0 : base.conditionalFormats) ?? {}
3830
+ };
3831
+ for (const [key, incoming] of Object.entries(
3832
+ (next == null ? void 0 : next.conditionalFormats) ?? {}
3833
+ )) {
3834
+ const previous = conditionalFormats[key];
3835
+ conditionalFormats[key] = {
3836
+ ...previous ?? {},
3837
+ ...incoming,
3838
+ textStyle: { ...previous == null ? void 0 : previous.textStyle, ...incoming.textStyle },
3839
+ paragraphStyle: {
3840
+ ...previous == null ? void 0 : previous.paragraphStyle,
3841
+ ...incoming.paragraphStyle
3842
+ },
3843
+ rowStyle: { ...previous == null ? void 0 : previous.rowStyle, ...incoming.rowStyle },
3844
+ cellStyle: { ...previous == null ? void 0 : previous.cellStyle, ...incoming.cellStyle },
3845
+ borders: { ...previous == null ? void 0 : previous.borders, ...incoming.borders },
3846
+ tableStyle: mergeTableStyles(previous == null ? void 0 : previous.tableStyle, incoming.tableStyle)
3847
+ };
3848
+ }
3849
+ return {
3850
+ ...base ?? {},
3851
+ ...next ?? {},
3852
+ defaultCellMargins: {
3853
+ ...(base == null ? void 0 : base.defaultCellMargins) ?? {},
3854
+ ...(next == null ? void 0 : next.defaultCellMargins) ?? {}
3855
+ },
3856
+ borders: { ...(base == null ? void 0 : base.borders) ?? {}, ...(next == null ? void 0 : next.borders) ?? {} },
3857
+ ...Object.keys(conditionalFormats).length > 0 ? { conditionalFormats } : {}
3858
+ };
3859
+ }
3860
+ function resolveNamedTableStyle(styleId, styles, seen = /* @__PURE__ */ new Set()) {
3861
+ var _a;
3862
+ if (!styles) return { tableStyle: {} };
3863
+ const effectiveId = styleId ?? ((_a = Object.values(styles).find(
3864
+ (style2) => style2.type === "table" && style2.isDefault
3865
+ )) == null ? void 0 : _a.id);
3866
+ if (!effectiveId || seen.has(effectiveId)) return { tableStyle: {} };
3867
+ const named = styles[effectiveId];
3868
+ if (!named || named.type !== "table") return { tableStyle: {} };
3869
+ seen.add(effectiveId);
3870
+ const parent = resolveNamedTableStyle(named.basedOn, styles, seen);
3871
+ return {
3872
+ tableStyle: mergeTableStyles(parent.tableStyle, named.tableStyle),
3873
+ paragraphStyle: {
3874
+ ...parent.paragraphStyle ?? {},
3875
+ ...named.paragraphStyle ?? {}
3876
+ },
3877
+ textStyle: {
3878
+ ...parent.textStyle ?? {},
3879
+ ...named.textStyle ?? {}
3880
+ }
3881
+ };
3882
+ }
3883
+ function conditionalKeys(options) {
3884
+ const { rowIndex, columnIndex, rowCount, columnCount, tableStyle } = options;
3885
+ const look = tableStyle.tblLook ?? {
3886
+ firstRow: true,
3887
+ lastRow: false,
3888
+ firstCol: true,
3889
+ lastCol: false,
3890
+ noHBand: false,
3891
+ noVBand: false
3892
+ };
3893
+ const firstRow = look.firstRow && rowIndex === 0;
3894
+ const lastRow = look.lastRow && rowIndex === rowCount - 1 && rowIndex !== 0;
3895
+ const firstCol = look.firstCol && columnIndex === 0;
3896
+ const lastCol = look.lastCol && columnIndex === columnCount - 1 && columnIndex !== 0;
3897
+ const keys = ["wholeTable"];
3898
+ if (!look.noHBand && !firstRow && !lastRow) {
3899
+ const body = rowIndex - (look.firstRow ? 1 : 0);
3900
+ keys.push(
3901
+ Math.floor(body / Math.max(1, tableStyle.rowBandSize ?? 1)) % 2 === 0 ? "band1Horz" : "band2Horz"
3902
+ );
3903
+ }
3904
+ if (!look.noVBand && !firstCol && !lastCol) {
3905
+ const body = columnIndex - (look.firstCol ? 1 : 0);
3906
+ keys.push(
3907
+ Math.floor(body / Math.max(1, tableStyle.colBandSize ?? 1)) % 2 === 0 ? "band1Vert" : "band2Vert"
3908
+ );
3909
+ }
3910
+ if (lastCol) keys.push("lastCol");
3911
+ if (firstCol) keys.push("firstCol");
3912
+ if (lastRow) keys.push("lastRow");
3913
+ if (firstRow) keys.push("firstRow");
3914
+ if (firstRow && firstCol) keys.push("nwCell");
3915
+ if (firstRow && lastCol) keys.push("neCell");
3916
+ if (lastRow && firstCol) keys.push("swCell");
3917
+ if (lastRow && lastCol) keys.push("seCell");
3918
+ for (const flags of [options.rowFlags, options.cellFlags]) {
3919
+ for (const [key, enabled2] of Object.entries(flags ?? {})) {
3920
+ if (enabled2 && !keys.includes(key)) keys.push(key);
3921
+ if (enabled2 === false) {
3922
+ const index = keys.indexOf(key);
3923
+ if (index >= 0) keys.splice(index, 1);
3924
+ }
3925
+ }
3926
+ }
3927
+ return keys;
3928
+ }
3929
+ function mergeConditionals(keys, formats) {
3930
+ const merged = {};
3931
+ for (const key of keys) {
3932
+ const next = formats == null ? void 0 : formats[key];
3933
+ if (!next) continue;
3934
+ if (next.shading) merged.shading = next.shading;
3935
+ if (next.textStyle)
3936
+ merged.textStyle = { ...merged.textStyle, ...next.textStyle };
3937
+ if (next.paragraphStyle)
3938
+ merged.paragraphStyle = {
3939
+ ...merged.paragraphStyle,
3940
+ ...next.paragraphStyle
3941
+ };
3942
+ if (next.rowStyle)
3943
+ merged.rowStyle = { ...merged.rowStyle, ...next.rowStyle };
3944
+ if (next.cellStyle)
3945
+ merged.cellStyle = { ...merged.cellStyle, ...next.cellStyle };
3946
+ if (next.borders) merged.borders = { ...merged.borders, ...next.borders };
3947
+ if (next.tableStyle)
3948
+ merged.tableStyle = mergeTableStyles(merged.tableStyle, next.tableStyle);
3949
+ }
3950
+ return merged;
3951
+ }
3952
+ function resolveEffectiveTableCellFormatting(options) {
3953
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
3954
+ const { table, rowIndex, cellIndex, visualColumnIndex, columnCount, styles } = options;
3955
+ const named = resolveNamedTableStyle((_a = table.style) == null ? void 0 : _a.styleId, styles);
3956
+ const baseTableStyle = mergeTableStyles(named.tableStyle, table.style);
3957
+ const row = table.rows[rowIndex];
3958
+ const cell = row == null ? void 0 : row.cells[cellIndex];
3959
+ const keys = conditionalKeys({
3960
+ rowIndex,
3961
+ columnIndex: visualColumnIndex,
3962
+ rowCount: table.rows.length,
3963
+ columnCount,
3964
+ tableStyle: baseTableStyle,
3965
+ rowFlags: row == null ? void 0 : row.conditionalStyle,
3966
+ cellFlags: cell == null ? void 0 : cell.conditionalStyle
3967
+ });
3968
+ const conditional = mergeConditionals(
3969
+ keys,
3970
+ baseTableStyle.conditionalFormats
3971
+ );
3972
+ const conditionalCell = {
3973
+ ...((_b = baseTableStyle.defaultCellMargins) == null ? void 0 : _b.top) !== void 0 ? { paddingTop: baseTableStyle.defaultCellMargins.top } : {},
3974
+ ...((_c = baseTableStyle.defaultCellMargins) == null ? void 0 : _c.right) !== void 0 ? { paddingRight: baseTableStyle.defaultCellMargins.right } : {},
3975
+ ...((_d = baseTableStyle.defaultCellMargins) == null ? void 0 : _d.bottom) !== void 0 ? { paddingBottom: baseTableStyle.defaultCellMargins.bottom } : {},
3976
+ ...((_e = baseTableStyle.defaultCellMargins) == null ? void 0 : _e.left) !== void 0 ? { paddingLeft: baseTableStyle.defaultCellMargins.left } : {},
3977
+ ...((_f = baseTableStyle.defaultCellMargins) == null ? void 0 : _f.start) !== void 0 ? { paddingStart: baseTableStyle.defaultCellMargins.start } : {},
3978
+ ...((_g = baseTableStyle.defaultCellMargins) == null ? void 0 : _g.end) !== void 0 ? { paddingEnd: baseTableStyle.defaultCellMargins.end } : {},
3979
+ ...rowIndex === 0 && ((_h = baseTableStyle.borders) == null ? void 0 : _h.borderTop) ? { borderTop: baseTableStyle.borders.borderTop } : rowIndex > 0 && ((_i = baseTableStyle.borders) == null ? void 0 : _i.borderInsideH) ? { borderTop: baseTableStyle.borders.borderInsideH } : {},
3980
+ ...rowIndex === table.rows.length - 1 && ((_j = baseTableStyle.borders) == null ? void 0 : _j.borderBottom) ? { borderBottom: baseTableStyle.borders.borderBottom } : rowIndex < table.rows.length - 1 && ((_k = baseTableStyle.borders) == null ? void 0 : _k.borderInsideH) ? { borderBottom: baseTableStyle.borders.borderInsideH } : {},
3981
+ ...visualColumnIndex === 0 && ((_l = baseTableStyle.borders) == null ? void 0 : _l.borderLeft) ? { borderLeft: baseTableStyle.borders.borderLeft } : visualColumnIndex > 0 && ((_m = baseTableStyle.borders) == null ? void 0 : _m.borderInsideV) ? { borderLeft: baseTableStyle.borders.borderInsideV } : {},
3982
+ ...visualColumnIndex === columnCount - 1 && ((_n = baseTableStyle.borders) == null ? void 0 : _n.borderRight) ? { borderRight: baseTableStyle.borders.borderRight } : visualColumnIndex < columnCount - 1 && ((_o = baseTableStyle.borders) == null ? void 0 : _o.borderInsideV) ? { borderRight: baseTableStyle.borders.borderInsideV } : {},
3983
+ ...conditional.cellStyle ?? {},
3984
+ ...conditional.borders ?? {},
3985
+ ...conditional.shading ? { shading: conditional.shading } : {}
3986
+ };
3987
+ return {
3988
+ tableStyle: mergeTableStyles(baseTableStyle, conditional.tableStyle),
3989
+ rowStyle: { ...conditional.rowStyle ?? {}, ...(row == null ? void 0 : row.style) ?? {} },
3990
+ cellStyle: { ...conditionalCell, ...(cell == null ? void 0 : cell.style) ?? {} },
3991
+ paragraphStyle: {
3992
+ ...named.paragraphStyle ?? {},
3993
+ ...conditional.paragraphStyle ?? {}
3994
+ },
3995
+ textStyle: {
3996
+ ...named.textStyle ?? {},
3997
+ ...conditional.textStyle ?? {}
3998
+ },
3999
+ conditionalKeys: keys
4000
+ };
4001
+ }
3774
4002
  function findParagraphIndex(paragraphs, paragraphId) {
3775
4003
  const index = paragraphs.findIndex(
3776
4004
  (paragraph) => paragraph.id === paragraphId
@@ -3957,6 +4185,8 @@ const DEFAULT_EDITOR_STYLES = {
3957
4185
  id: "normal",
3958
4186
  name: "Normal",
3959
4187
  type: "paragraph",
4188
+ qFormat: true,
4189
+ uiPriority: 0,
3960
4190
  paragraphStyle: {
3961
4191
  spacingAfter: 8,
3962
4192
  lineHeight: 1.15
@@ -3971,6 +4201,7 @@ const DEFAULT_EDITOR_STYLES = {
3971
4201
  id: "header",
3972
4202
  name: "Header",
3973
4203
  type: "paragraph",
4204
+ semiHidden: true,
3974
4205
  basedOn: "normal",
3975
4206
  nextStyle: "header",
3976
4207
  paragraphStyle: {
@@ -3981,6 +4212,7 @@ const DEFAULT_EDITOR_STYLES = {
3981
4212
  id: "footer",
3982
4213
  name: "Footer",
3983
4214
  type: "paragraph",
4215
+ semiHidden: true,
3984
4216
  basedOn: "normal",
3985
4217
  nextStyle: "footer",
3986
4218
  paragraphStyle: {
@@ -3991,6 +4223,8 @@ const DEFAULT_EDITOR_STYLES = {
3991
4223
  id: "heading1",
3992
4224
  name: "Heading 1",
3993
4225
  type: "paragraph",
4226
+ qFormat: true,
4227
+ uiPriority: 10,
3994
4228
  basedOn: "normal",
3995
4229
  nextStyle: "normal",
3996
4230
  paragraphStyle: {
@@ -4007,6 +4241,8 @@ const DEFAULT_EDITOR_STYLES = {
4007
4241
  id: "heading2",
4008
4242
  name: "Heading 2",
4009
4243
  type: "paragraph",
4244
+ qFormat: true,
4245
+ uiPriority: 11,
4010
4246
  basedOn: "normal",
4011
4247
  nextStyle: "normal",
4012
4248
  paragraphStyle: {
@@ -4023,6 +4259,8 @@ const DEFAULT_EDITOR_STYLES = {
4023
4259
  id: "heading3",
4024
4260
  name: "Heading 3",
4025
4261
  type: "paragraph",
4262
+ qFormat: true,
4263
+ uiPriority: 12,
4026
4264
  basedOn: "normal",
4027
4265
  nextStyle: "normal",
4028
4266
  paragraphStyle: {
@@ -4039,6 +4277,7 @@ const DEFAULT_EDITOR_STYLES = {
4039
4277
  id: "footnoteText",
4040
4278
  name: "Footnote Text",
4041
4279
  type: "paragraph",
4280
+ semiHidden: true,
4042
4281
  basedOn: "normal",
4043
4282
  nextStyle: "footnoteText",
4044
4283
  paragraphStyle: {
@@ -4053,6 +4292,7 @@ const DEFAULT_EDITOR_STYLES = {
4053
4292
  id: "footnoteReference",
4054
4293
  name: "Footnote Reference",
4055
4294
  type: "character",
4295
+ semiHidden: true,
4056
4296
  basedOn: "normal",
4057
4297
  textStyle: {
4058
4298
  superscript: true
@@ -4062,6 +4302,8 @@ const DEFAULT_EDITOR_STYLES = {
4062
4302
  id: "Caption",
4063
4303
  name: "Caption",
4064
4304
  type: "paragraph",
4305
+ qFormat: true,
4306
+ uiPriority: 35,
4065
4307
  basedOn: "normal",
4066
4308
  nextStyle: "normal",
4067
4309
  paragraphStyle: {
@@ -4657,6 +4899,7 @@ const OASIS_BUILTIN_COMMANDS = [
4657
4899
  "setHighlight",
4658
4900
  "setTextShading",
4659
4901
  "setStyleId",
4902
+ "setCharacterStyleId",
4660
4903
  "setUnderlineStyle",
4661
4904
  "documentStyles",
4662
4905
  "print",
@@ -4726,9 +4969,9 @@ function mount(target, props = {}) {
4726
4969
  unmount: () => client.dispose()
4727
4970
  });
4728
4971
  }
4729
- var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$y = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"aria-hidden=true><g fill=currentColor><path d="M3.375 4.875 L7.125 8.625 L3.375 12.375 L2.25 11.25 L4.875 8.625 L2.25 6 Z"></path><rect x=10.125 y=6 width=9 height=1.6875 rx=0.25></rect><rect x=5.625 y=10.875 width=13.5 height=1.6875 rx=0.25></rect><rect x=5.625 y=15.75 width=13.5 height=1.6875 rx=0.25>`), _tmpl$3$m = /* @__PURE__ */ template(`<i>`);
4730
- const FootnoteIcon = () => _tmpl$$P();
4731
- const SpecialIndentFirstLineIcon = () => _tmpl$2$y();
4972
+ var _tmpl$$Q = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$z = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"aria-hidden=true><g fill=currentColor><path d="M3.375 4.875 L7.125 8.625 L3.375 12.375 L2.25 11.25 L4.875 8.625 L2.25 6 Z"></path><rect x=10.125 y=6 width=9 height=1.6875 rx=0.25></rect><rect x=5.625 y=10.875 width=13.5 height=1.6875 rx=0.25></rect><rect x=5.625 y=15.75 width=13.5 height=1.6875 rx=0.25>`), _tmpl$3$n = /* @__PURE__ */ template(`<i>`);
4973
+ const FootnoteIcon = () => _tmpl$$Q();
4974
+ const SpecialIndentFirstLineIcon = () => _tmpl$2$z();
4732
4975
  const CUSTOM_ICONS = {
4733
4976
  footnote: FootnoteIcon,
4734
4977
  specialIndentFirstLine: SpecialIndentFirstLineIcon
@@ -4743,7 +4986,7 @@ function ToolIcon(props) {
4743
4986
  },
4744
4987
  get fallback() {
4745
4988
  return (() => {
4746
- var _el$3 = _tmpl$3$m();
4989
+ var _el$3 = _tmpl$3$n();
4747
4990
  createRenderEffect(() => setAttribute(_el$3, "data-lucide", props.name));
4748
4991
  return _el$3;
4749
4992
  })();
@@ -4751,7 +4994,7 @@ function ToolIcon(props) {
4751
4994
  children: (render2) => render2()()
4752
4995
  });
4753
4996
  }
4754
- var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$x = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$l = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$f = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$e = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$7 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4997
+ var _tmpl$$P = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$y = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$m = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$h = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$e = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$7 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4755
4998
  function Menubar(props) {
4756
4999
  const t = useI18n();
4757
5000
  const [activeMenu, setActiveMenu] = createSignal(null);
@@ -4819,13 +5062,13 @@ function Menubar(props) {
4819
5062
  });
4820
5063
  const topLevelItems = () => pruneTree(menuTree());
4821
5064
  return (() => {
4822
- var _el$ = _tmpl$$O();
5065
+ var _el$ = _tmpl$$P();
4823
5066
  insert(_el$, createComponent(For, {
4824
5067
  get each() {
4825
5068
  return topLevelItems();
4826
5069
  },
4827
5070
  children: (topLevel) => (() => {
4828
- var _el$2 = _tmpl$3$l(), _el$3 = _el$2.firstChild;
5071
+ var _el$2 = _tmpl$3$m(), _el$3 = _el$2.firstChild;
4829
5072
  _el$2.addEventListener("mouseenter", () => {
4830
5073
  if (activeMenu() && activeMenu() !== topLevel.id) {
4831
5074
  setActiveMenu(topLevel.id);
@@ -4845,7 +5088,7 @@ function Menubar(props) {
4845
5088
  return activeMenu() === topLevel.id;
4846
5089
  },
4847
5090
  get children() {
4848
- var _el$4 = _tmpl$2$x();
5091
+ var _el$4 = _tmpl$2$y();
4849
5092
  insert(_el$4, createComponent(For, {
4850
5093
  get each() {
4851
5094
  return topLevel.children;
@@ -4885,7 +5128,7 @@ function MenuNode(props) {
4885
5128
  } = props;
4886
5129
  const isSeparator = (_a = node.item) == null ? void 0 : _a.separator;
4887
5130
  if (isSeparator) {
4888
- return _tmpl$4$f();
5131
+ return _tmpl$4$h();
4889
5132
  }
4890
5133
  const hasChildren = node.children.length > 0;
4891
5134
  const [showSub, setShowSub] = createSignal(false);
@@ -4973,10 +5216,10 @@ function MenuNode(props) {
4973
5216
  })();
4974
5217
  }
4975
5218
  delegateEvents(["click"]);
4976
- var _tmpl$$N = /* @__PURE__ */ template(`<div class=oasis-titlebar><div class=oasis-titlebar-left><div class=oasis-titlebar-menubar-slot>`);
5219
+ var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-titlebar><div class=oasis-titlebar-left><div class=oasis-titlebar-menubar-slot>`);
4977
5220
  function TitleBar(props) {
4978
5221
  return (() => {
4979
- var _el$ = _tmpl$$N(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
5222
+ var _el$ = _tmpl$$O(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
4980
5223
  insert(_el$3, () => props.children);
4981
5224
  return _el$;
4982
5225
  })();
@@ -11815,7 +12058,7 @@ function emuToPx$1(value) {
11815
12058
  function clampFinite(value, fallback) {
11816
12059
  return Number.isFinite(value) ? value : fallback;
11817
12060
  }
11818
- function resolveAlignedOffset(align, containerSize, boxSize) {
12061
+ function resolveAlignedOffset(align, containerSize, boxSize, pageIndex = 0) {
11819
12062
  switch (align) {
11820
12063
  case "left":
11821
12064
  case "top":
@@ -11826,10 +12069,52 @@ function resolveAlignedOffset(align, containerSize, boxSize) {
11826
12069
  case "right":
11827
12070
  case "bottom":
11828
12071
  return containerSize - boxSize;
12072
+ case "inside":
12073
+ return pageIndex % 2 === 0 ? 0 : containerSize - boxSize;
12074
+ case "outside":
12075
+ return pageIndex % 2 === 0 ? containerSize - boxSize : 0;
11829
12076
  default:
11830
12077
  return null;
11831
12078
  }
11832
12079
  }
12080
+ function resolveFloatingTableRect(options) {
12081
+ const {
12082
+ floating,
12083
+ pageSettings,
12084
+ contentLeft,
12085
+ contentTop,
12086
+ contentWidth,
12087
+ anchorTop,
12088
+ width,
12089
+ height,
12090
+ pageIndex
12091
+ } = options;
12092
+ const horizontalPage = floating.horizontalAnchor === "page";
12093
+ const verticalPage = floating.verticalAnchor === "page";
12094
+ const verticalMargin = floating.verticalAnchor === "margin";
12095
+ const hBase = horizontalPage ? 0 : contentLeft;
12096
+ const hSize = horizontalPage ? pageSettings.width : contentWidth;
12097
+ const vBase = verticalPage ? 0 : verticalMargin ? contentTop : anchorTop;
12098
+ const vSize = verticalPage ? pageSettings.height : verticalMargin ? Math.max(1, pageSettings.height - contentTop) : Math.max(1, pageSettings.height - anchorTop);
12099
+ const alignedX = resolveAlignedOffset(
12100
+ floating.xAlign,
12101
+ hSize,
12102
+ width,
12103
+ pageIndex
12104
+ );
12105
+ const alignedY = resolveAlignedOffset(
12106
+ floating.yAlign,
12107
+ vSize,
12108
+ height,
12109
+ pageIndex
12110
+ );
12111
+ return {
12112
+ x: hBase + (alignedX ?? (floating.x ?? 0) * PX_PER_POINT),
12113
+ y: vBase + (alignedY ?? (floating.y ?? 0) * PX_PER_POINT),
12114
+ width: Math.max(1, width),
12115
+ height: Math.max(1, height)
12116
+ };
12117
+ }
11833
12118
  function getTextBoxFloatingGeometry(textBox, heightOverride) {
11834
12119
  return {
11835
12120
  width: textBox.width,
@@ -12153,7 +12438,7 @@ function projectParagraphLayout(paragraph, pageIndex, totalPages, styles, conten
12153
12438
  cacheForParagraph.set(cacheKey, result);
12154
12439
  return result;
12155
12440
  }
12156
- function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWidth, measurer = domTextMeasurer, pageIndex, totalPages, styles, defaultTabStop, resolveTextBoxHeight) {
12441
+ function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWidth, measurer = domTextMeasurer, pageIndex, totalPages, styles, defaultTabStop, resolveTextBoxHeight, externalExclusions = []) {
12157
12442
  const preliminary = projectParagraphLayout(
12158
12443
  paragraph,
12159
12444
  pageIndex,
@@ -12172,7 +12457,7 @@ function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWi
12172
12457
  return (((_a = f.textBox) == null ? void 0 : _a.floating) ?? ((_b = f.image) == null ? void 0 : _b.floating)) !== void 0;
12173
12458
  }
12174
12459
  );
12175
- if (!hasFloatingObject && !paragraph.dropCap) {
12460
+ if (!hasFloatingObject && !paragraph.dropCap && externalExclusions.length === 0) {
12176
12461
  return preliminary;
12177
12462
  }
12178
12463
  const fontSize = estimateParagraphFontSize(paragraph, styles);
@@ -12184,6 +12469,7 @@ function projectParagraphLayoutWithExclusions(paragraph, pageSettings, contentWi
12184
12469
  contentWidth,
12185
12470
  resolveTextBoxHeight
12186
12471
  }) : [];
12472
+ exclusions.push(...externalExclusions);
12187
12473
  if (paragraph.dropCap) {
12188
12474
  const dropCapExclusion = resolveDropCapExclusion({
12189
12475
  dropCap: paragraph.dropCap,
@@ -12609,12 +12895,65 @@ function getCachedTableColumnGeometry(table, contentWidthPx) {
12609
12895
  }
12610
12896
  function estimateTableRowHeight(row, styles, measurer, defaultTabStop, contentWidth, table, rowIndex) {
12611
12897
  var _a, _b;
12612
- if ((_a = row.style) == null ? void 0 : _a.hidden) {
12898
+ const tableEntries = table ? buildTableCellLayout(table) : [];
12899
+ const columnCount = Math.max(
12900
+ 1,
12901
+ ...tableEntries.map(
12902
+ (entry) => entry.visualColumnIndex + Math.max(1, entry.colSpan)
12903
+ )
12904
+ );
12905
+ const rowFormatting = table && rowIndex !== void 0 ? (() => {
12906
+ const entry = tableEntries.find(
12907
+ (candidate) => candidate.rowIndex === rowIndex
12908
+ );
12909
+ return entry ? resolveEffectiveTableCellFormatting({
12910
+ table,
12911
+ rowIndex,
12912
+ cellIndex: entry.cellIndex,
12913
+ visualColumnIndex: entry.visualColumnIndex,
12914
+ columnCount,
12915
+ styles
12916
+ }) : void 0;
12917
+ })() : void 0;
12918
+ if ((_a = (rowFormatting == null ? void 0 : rowFormatting.rowStyle) ?? row.style) == null ? void 0 : _a.hidden) {
12613
12919
  return 0;
12614
12920
  }
12615
12921
  const geometry = table && typeof contentWidth === "number" ? getCachedTableColumnGeometry(table, contentWidth) : null;
12616
- const cellHeights = row.cells.map((cell, cellIndex) => {
12922
+ const cellHeights = row.cells.map((sourceCell, cellIndex) => {
12617
12923
  var _a2;
12924
+ const entry = rowIndex !== void 0 ? tableEntries.find(
12925
+ (candidate) => candidate.rowIndex === rowIndex && candidate.cellIndex === cellIndex
12926
+ ) : void 0;
12927
+ const formatting = table && rowIndex !== void 0 && entry ? resolveEffectiveTableCellFormatting({
12928
+ table,
12929
+ rowIndex,
12930
+ cellIndex,
12931
+ visualColumnIndex: entry.visualColumnIndex,
12932
+ columnCount,
12933
+ styles
12934
+ }) : void 0;
12935
+ const cell = {
12936
+ ...sourceCell,
12937
+ style: (formatting == null ? void 0 : formatting.cellStyle) ?? sourceCell.style,
12938
+ blocks: sourceCell.blocks.map((paragraph) => {
12939
+ var _a3;
12940
+ return {
12941
+ ...paragraph,
12942
+ style: {
12943
+ ...resolveTableParagraphInheritance(
12944
+ formatting == null ? void 0 : formatting.paragraphStyle,
12945
+ (_a3 = paragraph.style) == null ? void 0 : _a3.styleId,
12946
+ styles
12947
+ ),
12948
+ ...paragraph.style
12949
+ },
12950
+ runs: paragraph.runs.map((run) => ({
12951
+ ...run,
12952
+ styles: { ...formatting == null ? void 0 : formatting.textStyle, ...run.styles }
12953
+ }))
12954
+ };
12955
+ })
12956
+ };
12618
12957
  if (cell.vMerge === "continue") return 0;
12619
12958
  let columnWidthPx;
12620
12959
  if (geometry && typeof rowIndex === "number") {
@@ -12671,13 +13010,16 @@ function estimateTableRowHeight(row, styles, measurer, defaultTabStop, contentWi
12671
13010
  ...cellHeights,
12672
13011
  DEFAULT_FONT_SIZE$1 * DEFAULT_LINE_HEIGHT
12673
13012
  );
12674
- const explicitHeight = parseTableRowHeightToPx((_b = row.style) == null ? void 0 : _b.height);
13013
+ const explicitHeight = parseTableRowHeightToPx(
13014
+ (_b = (rowFormatting == null ? void 0 : rowFormatting.rowStyle) ?? row.style) == null ? void 0 : _b.height
13015
+ );
12675
13016
  return Math.max(contentHeight, explicitHeight ?? 0) + DEFAULT_TABLE_ROW_VERTICAL_SPACING;
12676
13017
  }
12677
13018
  function getTableHeaderRowCount(table) {
13019
+ var _a;
12678
13020
  let count = 0;
12679
13021
  for (const row of table.rows) {
12680
- if (!row.isHeader) {
13022
+ if (!(((_a = row.style) == null ? void 0 : _a.isHeader) ?? row.isHeader)) {
12681
13023
  break;
12682
13024
  }
12683
13025
  count += 1;
@@ -12786,6 +13128,7 @@ function projectHeaderFooterBlocksWithDependencies(blocks, deps, context2 = {})
12786
13128
  defaultTabStop
12787
13129
  } = context2;
12788
13130
  return blocks.map((block, index) => {
13131
+ var _a, _b;
12789
13132
  if (block.type === "paragraph") {
12790
13133
  const layout = deps.projectParagraphLayout(
12791
13134
  block,
@@ -12807,18 +13150,20 @@ function projectHeaderFooterBlocksWithDependencies(blocks, deps, context2 = {})
12807
13150
  sourceBlock: block
12808
13151
  };
12809
13152
  }
13153
+ const tableHeight = (measuredHeights == null ? void 0 : measuredHeights[block.id]) ?? deps.estimateTableBlockHeight(
13154
+ block,
13155
+ styles,
13156
+ contentWidth,
13157
+ measurer,
13158
+ defaultTabStop
13159
+ );
12810
13160
  return {
12811
13161
  blockId: block.id,
12812
13162
  sourceBlockId: block.id,
12813
13163
  blockType: block.type,
12814
13164
  globalIndex: index,
12815
- estimatedHeight: (measuredHeights == null ? void 0 : measuredHeights[block.id]) ?? deps.estimateTableBlockHeight(
12816
- block,
12817
- styles,
12818
- contentWidth,
12819
- measurer,
12820
- defaultTabStop
12821
- ),
13165
+ estimatedHeight: ((_a = block.style) == null ? void 0 : _a.floating) ? 0 : tableHeight,
13166
+ floatingTableHeight: ((_b = block.style) == null ? void 0 : _b.floating) ? tableHeight : void 0,
12822
13167
  sourceBlock: block
12823
13168
  };
12824
13169
  });
@@ -12918,6 +13263,7 @@ class PaginationTrack {
12918
13263
  __publicField(this, "pages");
12919
13264
  __publicField(this, "blocks");
12920
13265
  __publicField(this, "height");
13266
+ __publicField(this, "floatingExclusions", []);
12921
13267
  this.pageOffset = pageOffset;
12922
13268
  this.maxPageHeight = maxPageHeight;
12923
13269
  this.reservedHeightByPageIndex = reservedHeightByPageIndex;
@@ -12962,6 +13308,7 @@ class PaginationTrack {
12962
13308
  });
12963
13309
  this.blocks = [];
12964
13310
  this.height = 0;
13311
+ this.floatingExclusions = [];
12965
13312
  }
12966
13313
  /** Flushes the trailing track and guarantees at least one page exists. */
12967
13314
  finalize() {
@@ -12981,6 +13328,21 @@ class PaginationTrack {
12981
13328
  }
12982
13329
  }
12983
13330
  const TEXT_BOX_AUTOFIT_SAFETY_PX$1 = 2;
13331
+ function registerParagraphFloatingExclusions(options) {
13332
+ const exclusions = collectParagraphFloatingExclusions({
13333
+ fragments: options.layout.fragments,
13334
+ preliminaryLines: options.layout.lines,
13335
+ pageSettings: options.params.pageSettings,
13336
+ contentWidth: options.params.contentWidth,
13337
+ resolveTextBoxHeight: options.resolveTextBoxHeight
13338
+ });
13339
+ options.track.floatingExclusions.push(
13340
+ ...exclusions.map((exclusion) => ({
13341
+ ...exclusion,
13342
+ y: exclusion.y + options.blockTop
13343
+ }))
13344
+ );
13345
+ }
12984
13346
  function estimateTextBoxAutoFitHeight(textBox, styles, measurer, pageIndex, totalPages, defaultTabStop) {
12985
13347
  var _a, _b, _c, _d, _e;
12986
13348
  if (!((_a = textBox.body) == null ? void 0 : _a.autoFit)) {
@@ -13037,6 +13399,14 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
13037
13399
  measuredParagraphLayouts
13038
13400
  } = params;
13039
13401
  const pageIndex = track.pageIndex;
13402
+ const resolveTextBoxHeight = (textBox) => estimateTextBoxAutoFitHeight(
13403
+ textBox,
13404
+ styles,
13405
+ measurer,
13406
+ pageIndex,
13407
+ totalPages,
13408
+ defaultTabStop
13409
+ );
13040
13410
  const projectedParagraphLayout = projectParagraphLayoutWithExclusions(
13041
13411
  sourceBlock,
13042
13412
  pageSettings,
@@ -13046,14 +13416,11 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
13046
13416
  totalPages,
13047
13417
  styles,
13048
13418
  defaultTabStop,
13049
- (textBox) => estimateTextBoxAutoFitHeight(
13050
- textBox,
13051
- styles,
13052
- measurer,
13053
- pageIndex,
13054
- totalPages,
13055
- defaultTabStop
13056
- )
13419
+ resolveTextBoxHeight,
13420
+ track.floatingExclusions.map((exclusion) => ({
13421
+ ...exclusion,
13422
+ y: exclusion.y - track.height
13423
+ }))
13057
13424
  );
13058
13425
  const measuredParagraphLayout = measuredParagraphLayouts == null ? void 0 : measuredParagraphLayouts[sourceBlock.id];
13059
13426
  const paragraphLayout = measuredParagraphLayout && isMeasuredLayoutCurrent(projectedParagraphLayout, measuredParagraphLayout) ? applyMeasuredLineGeometry(
@@ -13135,6 +13502,13 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
13135
13502
  sourceBlock
13136
13503
  });
13137
13504
  track.height += measuredHeight;
13505
+ registerParagraphFloatingExclusions({
13506
+ track,
13507
+ layout: paragraphLayout,
13508
+ blockTop: track.height - measuredHeight + (paragraphStyle.spacingBefore ?? 0),
13509
+ params,
13510
+ resolveTextBoxHeight
13511
+ });
13138
13512
  return;
13139
13513
  }
13140
13514
  let startLineIndex = 0;
@@ -13246,6 +13620,15 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
13246
13620
  sourceBlock
13247
13621
  });
13248
13622
  track.height += measuredHeight;
13623
+ if (startLineIndex === 0) {
13624
+ registerParagraphFloatingExclusions({
13625
+ track,
13626
+ layout: segmentLayout,
13627
+ blockTop: track.height - measuredHeight + (paragraphStyle.spacingBefore ?? 0),
13628
+ params,
13629
+ resolveTextBoxHeight
13630
+ });
13631
+ }
13249
13632
  startLineIndex = lineEndIndex;
13250
13633
  segmentIndex += 1;
13251
13634
  if (startLineIndex < paragraphLayout.lines.length) {
@@ -13438,7 +13821,21 @@ function positionsFinishedRow(row, ends) {
13438
13821
  }
13439
13822
  );
13440
13823
  }
13824
+ function resolveFloatingTableWidth(table, contentWidth) {
13825
+ var _a, _b;
13826
+ const width = (_a = table.style) == null ? void 0 : _a.width;
13827
+ if (typeof width === "number") return width * PX_PER_POINT;
13828
+ if (typeof width === "string" && width.endsWith("%")) {
13829
+ const percent = Number.parseFloat(width);
13830
+ if (Number.isFinite(percent)) return contentWidth * (percent / 100);
13831
+ }
13832
+ if ((_b = table.gridCols) == null ? void 0 : _b.length) {
13833
+ return table.gridCols.reduce((sum, value) => sum + value, 0) * PX_PER_POINT;
13834
+ }
13835
+ return contentWidth;
13836
+ }
13441
13837
  function paginateTableBlock(track, params, sourceBlock, index) {
13838
+ var _a;
13442
13839
  const { contentWidth, measurer, styles, defaultTabStop, measuredHeights } = params;
13443
13840
  const tableHeight = (measuredHeights == null ? void 0 : measuredHeights[sourceBlock.id]) ?? estimateTableBlockHeight(
13444
13841
  sourceBlock,
@@ -13447,6 +13844,60 @@ function paginateTableBlock(track, params, sourceBlock, index) {
13447
13844
  measurer,
13448
13845
  defaultTabStop
13449
13846
  );
13847
+ if ((_a = sourceBlock.style) == null ? void 0 : _a.floating) {
13848
+ track.blocks.push({
13849
+ blockId: sourceBlock.id,
13850
+ sourceBlockId: sourceBlock.id,
13851
+ blockType: sourceBlock.type,
13852
+ globalIndex: index,
13853
+ estimatedHeight: 0,
13854
+ floatingTableHeight: tableHeight,
13855
+ sourceBlock
13856
+ });
13857
+ const pageContentLeft = params.pageSettings.margins.left + params.pageSettings.margins.gutter;
13858
+ const pageContentTop = getPageBodyTop(params.pageSettings);
13859
+ const raw = resolveFloatingTableRect({
13860
+ floating: sourceBlock.style.floating,
13861
+ pageSettings: params.pageSettings,
13862
+ contentLeft: pageContentLeft,
13863
+ contentTop: pageContentTop,
13864
+ contentWidth,
13865
+ anchorTop: pageContentTop + track.height,
13866
+ width: resolveFloatingTableWidth(sourceBlock, contentWidth),
13867
+ height: tableHeight,
13868
+ pageIndex: track.pageIndex
13869
+ });
13870
+ const exclusion = {
13871
+ x: raw.x - pageContentLeft - (sourceBlock.style.floating.distanceLeft ?? 0) * PX_PER_POINT,
13872
+ y: raw.y - pageContentTop - (sourceBlock.style.floating.distanceTop ?? 0) * PX_PER_POINT,
13873
+ width: raw.width + ((sourceBlock.style.floating.distanceLeft ?? 0) + (sourceBlock.style.floating.distanceRight ?? 0)) * PX_PER_POINT,
13874
+ height: raw.height + ((sourceBlock.style.floating.distanceTop ?? 0) + (sourceBlock.style.floating.distanceBottom ?? 0)) * PX_PER_POINT,
13875
+ wrap: "square",
13876
+ sourceRunId: `table:${sourceBlock.id}`
13877
+ };
13878
+ let collisionOffsetY = 0;
13879
+ if (sourceBlock.style.tblOverlap === "never") {
13880
+ for (const existing of track.floatingExclusions) {
13881
+ if (!existing.sourceRunId.startsWith("table:")) continue;
13882
+ const overlaps = exclusion.x < existing.x + existing.width && exclusion.x + exclusion.width > existing.x && exclusion.y + collisionOffsetY < existing.y + existing.height && exclusion.y + collisionOffsetY + exclusion.height > existing.y;
13883
+ if (overlaps) {
13884
+ collisionOffsetY = Math.max(
13885
+ collisionOffsetY,
13886
+ existing.y + existing.height - exclusion.y
13887
+ );
13888
+ }
13889
+ }
13890
+ }
13891
+ const layoutBlock = track.blocks.at(-1);
13892
+ if (layoutBlock && collisionOffsetY > 0) {
13893
+ layoutBlock.floatingTableOffsetY = collisionOffsetY;
13894
+ }
13895
+ track.floatingExclusions.push({
13896
+ ...exclusion,
13897
+ y: exclusion.y + collisionOffsetY
13898
+ });
13899
+ return;
13900
+ }
13450
13901
  const maxHeightForCurrentPage = track.currentMaxHeight;
13451
13902
  const firstRow = sourceBlock.rows[0];
13452
13903
  const canSplitSingleRow = canSplitTableRow(firstRow);
@@ -14690,7 +15141,7 @@ function parseDimensionToPx(value) {
14690
15141
  const parsed = Number.parseFloat(trimmed);
14691
15142
  return Number.isFinite(parsed) ? parsed : null;
14692
15143
  }
14693
- function resolveTableWidth(table, contentWidth) {
15144
+ function resolveCanvasTableWidth(table, contentWidth) {
14694
15145
  var _a;
14695
15146
  const raw = (_a = table.style) == null ? void 0 : _a.width;
14696
15147
  if (typeof raw === "number") return Math.max(24, toPx(raw));
@@ -14769,9 +15220,9 @@ function resolveVerticalContentOffset(cell, contentHeightPx, contentNaturalHeigh
14769
15220
  return 0;
14770
15221
  }
14771
15222
  function buildCanvasTableLayout(options) {
14772
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
15223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
14773
15224
  const {
14774
- table,
15225
+ table: sourceTable,
14775
15226
  state,
14776
15227
  pageIndex,
14777
15228
  originX,
@@ -14779,7 +15230,11 @@ function buildCanvasTableLayout(options) {
14779
15230
  contentWidth,
14780
15231
  estimatedHeight
14781
15232
  } = options;
14782
- const tableWidth = resolveTableWidth(table, contentWidth);
15233
+ const table = {
15234
+ ...sourceTable,
15235
+ style: resolveEffectiveTableStyle(sourceTable, state.document.styles)
15236
+ };
15237
+ const tableWidth = resolveCanvasTableWidth(table, contentWidth);
14783
15238
  const tableLeft = originX + resolveTableIndentLeft(table);
14784
15239
  const tableEntries = buildTableCellLayout(table);
14785
15240
  const unsupported = [];
@@ -14827,15 +15282,62 @@ function buildCanvasTableLayout(options) {
14827
15282
  (entry) => [`${entry.rowIndex}:${entry.cellIndex}`, entry]
14828
15283
  )
14829
15284
  );
15285
+ const effectiveRowStyles = table.rows.map((row, rowIndex) => {
15286
+ const entry = tableEntries.find(
15287
+ (candidate) => candidate.rowIndex === rowIndex
15288
+ );
15289
+ return entry ? resolveEffectiveTableCellFormatting({
15290
+ table: sourceTable,
15291
+ rowIndex,
15292
+ cellIndex: entry.cellIndex,
15293
+ visualColumnIndex: entry.visualColumnIndex,
15294
+ columnCount: visualColumnCount,
15295
+ styles: state.document.styles
15296
+ }).rowStyle : row.style;
15297
+ });
14830
15298
  const prepared = [];
14831
15299
  for (let rowIndex = 0; rowIndex < table.rows.length; rowIndex += 1) {
14832
15300
  const row = table.rows[rowIndex];
14833
- if ((_f = row.style) == null ? void 0 : _f.hidden) {
15301
+ if ((_f = effectiveRowStyles[rowIndex]) == null ? void 0 : _f.hidden) {
14834
15302
  continue;
14835
15303
  }
14836
15304
  for (let cellIndex = 0; cellIndex < row.cells.length; cellIndex += 1) {
14837
- const cell = row.cells[cellIndex];
15305
+ const sourceCell = row.cells[cellIndex];
14838
15306
  const entry = cellEntriesByKey.get(`${rowIndex}:${cellIndex}`);
15307
+ if (!entry) {
15308
+ continue;
15309
+ }
15310
+ const formatting = resolveEffectiveTableCellFormatting({
15311
+ table: sourceTable,
15312
+ rowIndex,
15313
+ cellIndex,
15314
+ visualColumnIndex: entry.visualColumnIndex,
15315
+ columnCount: visualColumnCount,
15316
+ styles: state.document.styles
15317
+ });
15318
+ const cell = {
15319
+ ...sourceCell,
15320
+ style: formatting.cellStyle,
15321
+ blocks: sourceCell.blocks.map((paragraph) => {
15322
+ var _a2;
15323
+ return {
15324
+ ...paragraph,
15325
+ style: {
15326
+ ...resolveTableParagraphInheritance(
15327
+ formatting.paragraphStyle,
15328
+ (_a2 = paragraph.style) == null ? void 0 : _a2.styleId,
15329
+ state.document.styles
15330
+ ),
15331
+ ...paragraph.style
15332
+ },
15333
+ runs: paragraph.runs.map((run) => ({
15334
+ ...run,
15335
+ styles: { ...formatting.textStyle, ...run.styles }
15336
+ }))
15337
+ };
15338
+ })
15339
+ };
15340
+ const effectiveRow = formatting.rowStyle;
14839
15341
  const rowSpan = Math.max(1, cell.rowSpan ?? 1);
14840
15342
  if (rowSpan > 1) {
14841
15343
  unsupported.push("unsupported:v-span");
@@ -14843,9 +15345,6 @@ function buildCanvasTableLayout(options) {
14843
15345
  if (cell.vMerge === "continue" || cell.vMerge === "restart") {
14844
15346
  unsupported.push("unsupported:v-merge");
14845
15347
  }
14846
- if (!entry) {
14847
- continue;
14848
- }
14849
15348
  const visualCol = entry.visualColumnIndex;
14850
15349
  const colSpan = Math.max(1, entry.colSpan);
14851
15350
  const width = Math.max(
@@ -14853,11 +15352,23 @@ function buildCanvasTableLayout(options) {
14853
15352
  (columnOffsets[visualCol + colSpan] ?? tableWidth) - (columnOffsets[visualCol] ?? 0)
14854
15353
  );
14855
15354
  const padding = resolveCellPadding(cell);
15355
+ const logicalLeft = ((_g = table.style) == null ? void 0 : _g.bidiVisual) ? (_h = cell.style) == null ? void 0 : _h.borderEnd : (_i = cell.style) == null ? void 0 : _i.borderStart;
15356
+ const logicalRight = ((_j = table.style) == null ? void 0 : _j.bidiVisual) ? (_k = cell.style) == null ? void 0 : _k.borderStart : (_l = cell.style) == null ? void 0 : _l.borderEnd;
14856
15357
  const borders = {
14857
- top: resolveBorder((_g = cell.style) == null ? void 0 : _g.borderTop),
14858
- right: resolveBorder(((_h = cell.style) == null ? void 0 : _h.borderRight) ?? ((_i = cell.style) == null ? void 0 : _i.borderEnd)),
14859
- bottom: resolveBorder((_j = cell.style) == null ? void 0 : _j.borderBottom),
14860
- left: resolveBorder(((_k = cell.style) == null ? void 0 : _k.borderLeft) ?? ((_l = cell.style) == null ? void 0 : _l.borderStart))
15358
+ top: resolveBorder((_m = cell.style) == null ? void 0 : _m.borderTop),
15359
+ right: resolveBorder(((_n = cell.style) == null ? void 0 : _n.borderRight) ?? logicalRight),
15360
+ bottom: resolveBorder((_o = cell.style) == null ? void 0 : _o.borderBottom),
15361
+ left: resolveBorder(((_p = cell.style) == null ? void 0 : _p.borderLeft) ?? logicalLeft),
15362
+ ...((_q = cell.style) == null ? void 0 : _q.borderTopLeftToBottomRight) ? {
15363
+ topLeftToBottomRight: resolveBorder(
15364
+ cell.style.borderTopLeftToBottomRight
15365
+ )
15366
+ } : {},
15367
+ ...((_r = cell.style) == null ? void 0 : _r.borderTopRightToBottomLeft) ? {
15368
+ topRightToBottomLeft: resolveBorder(
15369
+ cell.style.borderTopRightToBottomLeft
15370
+ )
15371
+ } : {}
14861
15372
  };
14862
15373
  const contentWidthPx = Math.max(
14863
15374
  MIN_TABLE_CELL_CONTENT_WIDTH_PX,
@@ -14866,8 +15377,8 @@ function buildCanvasTableLayout(options) {
14866
15377
  const verticalMode = resolveCellVerticalMode(cell);
14867
15378
  const isRotated = verticalMode === "rotate-cw" || verticalMode === "rotate-ccw";
14868
15379
  const isStacked = verticalMode === "stack";
14869
- const explicitRowHeightPx = parseDimensionToPx((_m = row.style) == null ? void 0 : _m.height);
14870
- const wrapWidth = isRotated || ((_n = cell.style) == null ? void 0 : _n.noWrap) ? isRotated && explicitRowHeightPx !== null && explicitRowHeightPx > 0 ? Math.max(
15380
+ const explicitRowHeightPx = parseDimensionToPx(effectiveRow.height);
15381
+ const wrapWidth = isRotated || ((_s = cell.style) == null ? void 0 : _s.noWrap) ? isRotated && explicitRowHeightPx !== null && explicitRowHeightPx > 0 ? Math.max(
14871
15382
  MIN_TABLE_CELL_CONTENT_WIDTH_PX,
14872
15383
  explicitRowHeightPx - borders.top.width - borders.bottom.width - padding.top - padding.bottom
14873
15384
  ) : NO_WRAP_WIDTH_PX : contentWidthPx;
@@ -14891,7 +15402,7 @@ function buildCanvasTableLayout(options) {
14891
15402
  spacingAfter
14892
15403
  });
14893
15404
  const hasExplicitRowHeight = explicitRowHeightPx !== null && explicitRowHeightPx > 0;
14894
- const paragraphStyleSize = ((_p = (_o = paragraph.runs[0]) == null ? void 0 : _o.styles) == null ? void 0 : _p.fontSize) ?? 14.6667;
15405
+ const paragraphStyleSize = ((_u = (_t = paragraph.runs[0]) == null ? void 0 : _t.styles) == null ? void 0 : _u.fontSize) ?? 14.6667;
14895
15406
  contentNaturalHeightPx = Math.max(
14896
15407
  contentNaturalHeightPx,
14897
15408
  hasExplicitRowHeight ? paragraphStyleSize * 1.25 : stackLength
@@ -14905,7 +15416,7 @@ function buildCanvasTableLayout(options) {
14905
15416
  state.document.styles,
14906
15417
  wrapWidth,
14907
15418
  void 0,
14908
- (_q = state.document.settings) == null ? void 0 : _q.defaultTabStop
15419
+ (_v = state.document.settings) == null ? void 0 : _v.defaultTabStop
14909
15420
  );
14910
15421
  const linesBottom = projected.lines.length > 0 ? Math.max(...projected.lines.map((line) => line.top + line.height)) : 1;
14911
15422
  let effectiveSpacingBefore = spacingBefore;
@@ -14972,17 +15483,18 @@ function buildCanvasTableLayout(options) {
14972
15483
  }
14973
15484
  const rowCount = Math.max(1, table.rows.length);
14974
15485
  const explicitRowHeights = table.rows.map((row) => {
14975
- var _a2, _b2;
14976
- if ((_a2 = row.style) == null ? void 0 : _a2.hidden) {
15486
+ const rowIndex = table.rows.indexOf(row);
15487
+ const effective = effectiveRowStyles[rowIndex];
15488
+ if (effective == null ? void 0 : effective.hidden) {
14977
15489
  return 0;
14978
15490
  }
14979
- const explicit = parseDimensionToPx((_b2 = row.style) == null ? void 0 : _b2.height);
15491
+ const explicit = parseDimensionToPx(effective == null ? void 0 : effective.height);
14980
15492
  return explicit !== null && explicit > 0 ? explicit : null;
14981
15493
  });
14982
15494
  const fallbackPerRow = estimatedHeight > 0 ? estimatedHeight / rowCount : DEFAULT_TABLE_ROW_HEIGHT;
14983
15495
  const rowHeights = [];
14984
15496
  for (let rowIndex = 0; rowIndex < table.rows.length; rowIndex += 1) {
14985
- if ((_s = (_r = table.rows[rowIndex]) == null ? void 0 : _r.style) == null ? void 0 : _s.hidden) {
15497
+ if ((_w = effectiveRowStyles[rowIndex]) == null ? void 0 : _w.hidden) {
14986
15498
  rowHeights[rowIndex] = 0;
14987
15499
  continue;
14988
15500
  }
@@ -15066,12 +15578,13 @@ function buildCanvasTableLayout(options) {
15066
15578
  contentTop,
15067
15579
  contentWidth: contentWidthPx,
15068
15580
  contentHeight: contentHeightPx,
15069
- shading: (_t = cell.style) == null ? void 0 : _t.shading,
15581
+ shading: (_x = cell.style) == null ? void 0 : _x.shading,
15070
15582
  anchorPosition,
15071
15583
  padding,
15072
15584
  borders,
15073
15585
  paragraphs,
15074
- verticalMode: cellEntry.verticalMode
15586
+ verticalMode: cellEntry.verticalMode,
15587
+ revision: ((_y = cell.style) == null ? void 0 : _y.revision) ?? (((_z = cell.style) == null ? void 0 : _z.propertyRevision) ? { ...cell.style.propertyRevision, type: "property" } : void 0)
15075
15588
  });
15076
15589
  }
15077
15590
  return {
@@ -15428,6 +15941,7 @@ function buildCanvasLayoutSnapshot(options) {
15428
15941
  const floatingImages = [];
15429
15942
  const inlineTextBoxes = [];
15430
15943
  const floatingTextBoxes = [];
15944
+ const floatingTables = [];
15431
15945
  const unsupportedRegions = [];
15432
15946
  for (const page of documentLayout.pages) {
15433
15947
  const pageElement = canvasPages.find(
@@ -15463,7 +15977,7 @@ function buildCanvasLayoutSnapshot(options) {
15463
15977
  const contentLeft = pageRect.left + page.pageSettings.margins.left + page.pageSettings.margins.gutter;
15464
15978
  const contentWidth = getPageContentWidth(page.pageSettings);
15465
15979
  const collectParagraphBlock = (zone, blocks, startTop, options2 = {}) => {
15466
- var _a;
15980
+ var _a, _b, _c;
15467
15981
  let cursorY = startTop;
15468
15982
  let blockContentLeft = options2.contentLeft ?? contentLeft;
15469
15983
  let blockContentWidth = options2.contentWidth ?? contentWidth;
@@ -15577,15 +16091,45 @@ function buildCanvasLayoutSnapshot(options) {
15577
16091
  })
15578
16092
  );
15579
16093
  } else if (block.sourceBlock.type === "table") {
16094
+ const floating = (_b = block.sourceBlock.style) == null ? void 0 : _b.floating;
16095
+ const floatingRect = floating ? resolveFloatingTableRect({
16096
+ floating,
16097
+ pageSettings: page.pageSettings,
16098
+ contentLeft: blockContentLeft - pageRect.left,
16099
+ contentTop: startTop - pageRect.top,
16100
+ contentWidth: blockContentWidth,
16101
+ anchorTop: cursorY - pageRect.top,
16102
+ width: resolveCanvasTableWidth(
16103
+ block.sourceBlock,
16104
+ blockContentWidth
16105
+ ),
16106
+ height: block.floatingTableHeight ?? 1,
16107
+ pageIndex: page.index
16108
+ }) : void 0;
16109
+ if (floatingRect) {
16110
+ floatingRect.y += block.floatingTableOffsetY ?? 0;
16111
+ }
16112
+ if (floatingRect) {
16113
+ floatingTables.push({
16114
+ tableId: block.sourceBlock.id,
16115
+ zone,
16116
+ footnoteId: blockFootnoteId,
16117
+ pageIndex: page.index,
16118
+ left: pageRect.left + floatingRect.x,
16119
+ top: pageRect.top + floatingRect.y,
16120
+ width: floatingRect.width,
16121
+ height: floatingRect.height
16122
+ });
16123
+ }
15580
16124
  const segmentTable = block.tableSegment ? buildSegmentTable(block.sourceBlock, block.tableSegment) : block.sourceBlock;
15581
16125
  const tableLayout = buildCanvasTableLayout({
15582
16126
  table: segmentTable,
15583
16127
  state,
15584
16128
  pageIndex: page.index,
15585
- originX: blockContentLeft,
15586
- originY: cursorY,
16129
+ originX: floatingRect ? pageRect.left + floatingRect.x : blockContentLeft,
16130
+ originY: floatingRect ? pageRect.top + floatingRect.y : cursorY,
15587
16131
  contentWidth: blockContentWidth,
15588
- estimatedHeight: block.estimatedHeight
16132
+ estimatedHeight: block.floatingTableHeight ?? block.estimatedHeight
15589
16133
  });
15590
16134
  for (const reason of tableLayout.unsupported) {
15591
16135
  unsupportedRegions.push({
@@ -15663,7 +16207,8 @@ function buildCanvasLayoutSnapshot(options) {
15663
16207
  top: cell.top,
15664
16208
  width: cell.width,
15665
16209
  height: cell.height,
15666
- anchorPosition: cell.anchorPosition
16210
+ anchorPosition: cell.anchorPosition,
16211
+ revisionId: (_c = cell.revision) == null ? void 0 : _c.id
15667
16212
  }
15668
16213
  });
15669
16214
  inlineImages.push(
@@ -15786,6 +16331,7 @@ function buildCanvasLayoutSnapshot(options) {
15786
16331
  floatingImages,
15787
16332
  inlineTextBoxes,
15788
16333
  floatingTextBoxes,
16334
+ floatingTables,
15789
16335
  unsupportedRegions
15790
16336
  };
15791
16337
  }
@@ -15841,7 +16387,7 @@ function getCaretRectFromSnapshot(snapshot, position2, paragraphOffset) {
15841
16387
  );
15842
16388
  return rectFromBox(slot.left, slot.top, 1, slot.height || line.height);
15843
16389
  }
15844
- var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$w = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$k = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$d = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16390
+ var _tmpl$$N = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$x = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$l = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$g = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$d = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
15845
16391
  function OutlinePanel(props) {
15846
16392
  const t = useI18n();
15847
16393
  const [collapsed, setCollapsed] = createSignal(props.defaultCollapsed ?? false);
@@ -15910,13 +16456,13 @@ function OutlinePanel(props) {
15910
16456
  }
15911
16457
  });
15912
16458
  return (() => {
15913
- var _el$ = _tmpl$3$k(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16459
+ var _el$ = _tmpl$3$l(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
15914
16460
  insert(_el$2, createComponent(Show, {
15915
16461
  get when() {
15916
16462
  return !collapsed();
15917
16463
  },
15918
16464
  get children() {
15919
- var _el$3 = _tmpl$$M();
16465
+ var _el$3 = _tmpl$$N();
15920
16466
  insert(_el$3, () => t("menu.view.outline") || "Outline");
15921
16467
  return _el$3;
15922
16468
  }
@@ -15927,14 +16473,14 @@ function OutlinePanel(props) {
15927
16473
  return !collapsed();
15928
16474
  },
15929
16475
  get children() {
15930
- var _el$6 = _tmpl$2$w();
16476
+ var _el$6 = _tmpl$2$x();
15931
16477
  insert(_el$6, createComponent(Show, {
15932
16478
  get when() {
15933
16479
  return items().length > 0;
15934
16480
  },
15935
16481
  get fallback() {
15936
16482
  return (() => {
15937
- var _el$7 = _tmpl$4$e();
16483
+ var _el$7 = _tmpl$4$g();
15938
16484
  insert(_el$7, () => t("outline.empty"));
15939
16485
  return _el$7;
15940
16486
  })();
@@ -15984,7 +16530,7 @@ function OutlinePanel(props) {
15984
16530
  })();
15985
16531
  }
15986
16532
  delegateEvents(["click"]);
15987
- var _tmpl$$L = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-overflow-manager style="display:flex;align-items:center;flex:1 1 0%;min-width:0;position:relative;margin-right:8px"><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown oasis-editor-toolbar-more-measure"aria-hidden=true tabindex=-1 style=position:absolute;visibility:hidden;pointer-events:none;right:0><i data-lucide=ellipsis></i></button><div style="display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;overflow:hidden"></div><div style=flex-shrink:0;padding-left:8px;padding-right:16px;align-items:center><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"data-testid=editor-toolbar-overflow-dropdown><i data-lucide=ellipsis></i></button></div><div class="oasis-editor-toolbar-overflow-dropdown-menu oasis-editor-toolbar-overflow-menu"style="flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;background:var(--oasis-paper);border:1px solid var(--oasis-toolbar-border);border-radius:var(--oasis-radius);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);max-width:calc(100vw - 16px);overflow-x:hidden;overflow-y:auto">`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item-wrapper style=display:flex;align-items:center;flex-shrink:0>`);
16533
+ var _tmpl$$M = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-overflow-manager style="display:flex;align-items:center;flex:1 1 0%;min-width:0;position:relative;margin-right:8px"><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown oasis-editor-toolbar-more-measure"aria-hidden=true tabindex=-1 style=position:absolute;visibility:hidden;pointer-events:none;right:0><i data-lucide=ellipsis></i></button><div style="display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;overflow:hidden"></div><div style=flex-shrink:0;padding-left:8px;padding-right:16px;align-items:center><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"data-testid=editor-toolbar-overflow-dropdown><i data-lucide=ellipsis></i></button></div><div class="oasis-editor-toolbar-overflow-dropdown-menu oasis-editor-toolbar-overflow-menu"style="flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;background:var(--oasis-paper);border:1px solid var(--oasis-toolbar-border);border-radius:var(--oasis-radius);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);max-width:calc(100vw - 16px);overflow-x:hidden;overflow-y:auto">`), _tmpl$2$w = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item-wrapper style=display:flex;align-items:center;flex-shrink:0>`);
15988
16534
  function ToolbarOverflowManager(props) {
15989
16535
  const t = useI18n();
15990
16536
  const [overflowCount, setOverflowCount] = createSignal(0);
@@ -16128,7 +16674,7 @@ function ToolbarOverflowManager(props) {
16128
16674
  };
16129
16675
  };
16130
16676
  return (() => {
16131
- var _el$ = _tmpl$$L(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling;
16677
+ var _el$ = _tmpl$$M(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling;
16132
16678
  var _ref$ = containerRef;
16133
16679
  typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
16134
16680
  var _ref$2 = moreMeasureRef;
@@ -16140,7 +16686,7 @@ function ToolbarOverflowManager(props) {
16140
16686
  return items();
16141
16687
  },
16142
16688
  children: (item) => (() => {
16143
- var _el$7 = _tmpl$2$v();
16689
+ var _el$7 = _tmpl$2$w();
16144
16690
  insert(_el$7, item);
16145
16691
  return _el$7;
16146
16692
  })()
@@ -16216,12 +16762,12 @@ function resolveLabel(item, api) {
16216
16762
  if (item.labelKey) return api.t(item.labelKey);
16217
16763
  return void 0;
16218
16764
  }
16219
- var _tmpl$$K = /* @__PURE__ */ template(`<span>`), _tmpl$2$u = /* @__PURE__ */ template(`<button type=button>`);
16765
+ var _tmpl$$L = /* @__PURE__ */ template(`<span>`), _tmpl$2$v = /* @__PURE__ */ template(`<button type=button>`);
16220
16766
  function Button$1(props) {
16221
16767
  const [local, others] = splitProps(props, ["icon", "label", "active", "tooltip", "wide", "ribbonSize", "aria-label", "class", "classList"]);
16222
16768
  const ariaLabel = () => local["aria-label"] || local.tooltip || local.label || "";
16223
16769
  return (() => {
16224
- var _el$ = _tmpl$2$u();
16770
+ var _el$ = _tmpl$2$v();
16225
16771
  spread(_el$, mergeProps({
16226
16772
  get ["class"]() {
16227
16773
  return `oasis-editor-tool-button ${local.class || ""}`;
@@ -16258,7 +16804,7 @@ function Button$1(props) {
16258
16804
  return local.label;
16259
16805
  },
16260
16806
  get children() {
16261
- var _el$2 = _tmpl$$K();
16807
+ var _el$2 = _tmpl$$L();
16262
16808
  insert(_el$2, () => local.label);
16263
16809
  return _el$2;
16264
16810
  }
@@ -16340,7 +16886,7 @@ function useDismiss(options) {
16340
16886
  });
16341
16887
  });
16342
16888
  }
16343
- var _tmpl$$J = /* @__PURE__ */ template(`<div>`);
16889
+ var _tmpl$$K = /* @__PURE__ */ template(`<div>`);
16344
16890
  function Popover(props) {
16345
16891
  let anchorRef;
16346
16892
  let panelRef;
@@ -16357,7 +16903,7 @@ function Popover(props) {
16357
16903
  closeOnEscape: props.closeOnEscape
16358
16904
  });
16359
16905
  const panel = (portalled) => (() => {
16360
- var _el$ = _tmpl$$J();
16906
+ var _el$ = _tmpl$$K();
16361
16907
  addEventListener(_el$, "mouseleave", props.onPanelMouseLeave);
16362
16908
  var _ref$ = panelRef;
16363
16909
  typeof _ref$ === "function" ? use(_ref$, _el$) : panelRef = _el$;
@@ -16409,12 +16955,12 @@ function Popover(props) {
16409
16955
  }
16410
16956
  })];
16411
16957
  }
16412
- var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$t = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$j = /* @__PURE__ */ template(`<i>`), _tmpl$4$d = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$c = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$6 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
16958
+ var _tmpl$$J = /* @__PURE__ */ template(`<div>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$k = /* @__PURE__ */ template(`<i>`), _tmpl$4$f = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$c = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$6 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
16413
16959
  function Menu(props) {
16414
16960
  const [open, setOpen] = createSignal(false);
16415
16961
  const ariaLabel = () => props.tooltip || props.label || "";
16416
16962
  return (() => {
16417
- var _el$ = _tmpl$2$t();
16963
+ var _el$ = _tmpl$2$u();
16418
16964
  insert(_el$, createComponent(Popover, {
16419
16965
  get open() {
16420
16966
  return open();
@@ -16437,7 +16983,7 @@ function Menu(props) {
16437
16983
  return props.icon;
16438
16984
  },
16439
16985
  get children() {
16440
- var _el$4 = _tmpl$3$j();
16986
+ var _el$4 = _tmpl$3$k();
16441
16987
  createRenderEffect(() => setAttribute(_el$4, "data-lucide", props.icon));
16442
16988
  return _el$4;
16443
16989
  }
@@ -16447,7 +16993,7 @@ function Menu(props) {
16447
16993
  return props.label;
16448
16994
  },
16449
16995
  get children() {
16450
- var _el$5 = _tmpl$4$d();
16996
+ var _el$5 = _tmpl$4$f();
16451
16997
  insert(_el$5, () => props.label);
16452
16998
  return _el$5;
16453
16999
  }
@@ -16482,7 +17028,7 @@ function Menu(props) {
16482
17028
  return _el$3;
16483
17029
  })(),
16484
17030
  get children() {
16485
- var _el$2 = _tmpl$$I();
17031
+ var _el$2 = _tmpl$$J();
16486
17032
  _el$2.$$click = (event) => {
16487
17033
  const el = event.target;
16488
17034
  if (el.closest("button") && !el.closest(".oasis-editor-tool-button-dropdown") && !el.closest(".oasis-editor-toolbar-list-options")) {
@@ -16497,7 +17043,7 @@ function Menu(props) {
16497
17043
  })();
16498
17044
  }
16499
17045
  delegateEvents(["click"]);
16500
- var _tmpl$$H = /* @__PURE__ */ template(`<select>`);
17046
+ var _tmpl$$I = /* @__PURE__ */ template(`<select>`);
16501
17047
  function Select(props) {
16502
17048
  let selectRef;
16503
17049
  const [local, others] = splitProps(props, ["wide", "small", "class", "tooltip", "aria-label", "value"]);
@@ -16513,7 +17059,7 @@ function Select(props) {
16513
17059
  }
16514
17060
  });
16515
17061
  return (() => {
16516
- var _el$ = _tmpl$$H();
17062
+ var _el$ = _tmpl$$I();
16517
17063
  var _ref$ = selectRef;
16518
17064
  typeof _ref$ === "function" ? use(_ref$, _el$) : selectRef = _el$;
16519
17065
  spread(_el$, mergeProps({
@@ -16540,15 +17086,15 @@ function Select(props) {
16540
17086
  return _el$;
16541
17087
  })();
16542
17088
  }
16543
- var _tmpl$$G = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-separator>`);
17089
+ var _tmpl$$H = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-separator>`);
16544
17090
  function Separator(props) {
16545
17091
  return (() => {
16546
- var _el$ = _tmpl$$G();
17092
+ var _el$ = _tmpl$$H();
16547
17093
  createRenderEffect((_$p) => setStyleProperty(_el$, "display", props.hidden ? "none" : void 0));
16548
17094
  return _el$;
16549
17095
  })();
16550
17096
  }
16551
- var _tmpl$$F = /* @__PURE__ */ template(`<div><button type=button class=oasis-editor-color-split-main></button><button type=button class=oasis-editor-color-split-menu-button aria-haspopup=menu><i data-lucide=chevron-down>`);
17097
+ var _tmpl$$G = /* @__PURE__ */ template(`<div><button type=button class=oasis-editor-color-split-main></button><button type=button class=oasis-editor-color-split-menu-button aria-haspopup=menu><i data-lucide=chevron-down>`);
16552
17098
  function SplitButton(props) {
16553
17099
  return createComponent(Popover, {
16554
17100
  get open() {
@@ -16567,7 +17113,7 @@ function SplitButton(props) {
16567
17113
  return props.onPanelMouseLeave;
16568
17114
  },
16569
17115
  trigger: (api) => (() => {
16570
- var _el$ = _tmpl$$F(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17116
+ var _el$ = _tmpl$$G(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
16571
17117
  use((el) => api.ref(el), _el$);
16572
17118
  _el$2.$$click = () => props.onMain();
16573
17119
  insert(_el$2, () => props.mainContent);
@@ -16605,7 +17151,7 @@ function SplitButton(props) {
16605
17151
  });
16606
17152
  }
16607
17153
  delegateEvents(["click"]);
16608
- var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$s = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$i = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$c = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$b = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$5 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17154
+ var _tmpl$$F = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$t = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$b = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$5 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
16609
17155
  const normalizeColor = (value) => (value == null ? void 0 : value.trim().toLowerCase()) ?? "";
16610
17156
  function ColorPicker(props) {
16611
17157
  const [isOpen, setIsOpen] = createSignal(false);
@@ -16670,7 +17216,7 @@ function ColorPicker(props) {
16670
17216
  return clearLabel();
16671
17217
  },
16672
17218
  get children() {
16673
- var _el$ = _tmpl$2$s(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
17219
+ var _el$ = _tmpl$2$t(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
16674
17220
  _el$.$$click = () => applyColor(null);
16675
17221
  insert(_el$2, createComponent(Show, {
16676
17222
  get when() {
@@ -16680,7 +17226,7 @@ function ColorPicker(props) {
16680
17226
  return _tmpl$8$1();
16681
17227
  },
16682
17228
  get children() {
16683
- return _tmpl$$E();
17229
+ return _tmpl$$F();
16684
17230
  }
16685
17231
  }));
16686
17232
  insert(_el$4, clearLabel);
@@ -16688,7 +17234,7 @@ function ColorPicker(props) {
16688
17234
  return _el$;
16689
17235
  }
16690
17236
  }), (() => {
16691
- var _el$5 = _tmpl$3$i(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17237
+ var _el$5 = _tmpl$3$j(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
16692
17238
  insert(_el$6, () => props.themeColorsLabel);
16693
17239
  insert(_el$7, createComponent(For, {
16694
17240
  get each() {
@@ -16728,7 +17274,7 @@ function ColorPicker(props) {
16728
17274
  }));
16729
17275
  return _el$5;
16730
17276
  })(), (() => {
16731
- var _el$8 = _tmpl$4$c(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
17277
+ var _el$8 = _tmpl$4$e(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
16732
17278
  insert(_el$9, () => props.standardColorsLabel);
16733
17279
  insert(_el$0, createComponent(For, {
16734
17280
  get each() {
@@ -16793,7 +17339,7 @@ function ColorPicker(props) {
16793
17339
  });
16794
17340
  }
16795
17341
  delegateEvents(["click", "input"]);
16796
- var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$h = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$b = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17342
+ var _tmpl$$E = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$s = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$i = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$d = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
16797
17343
  function GridPicker(props) {
16798
17344
  const t = useI18n();
16799
17345
  const [isOpen, setIsOpen] = createSignal(false);
@@ -16868,7 +17414,7 @@ function GridPicker(props) {
16868
17414
  return h.row === 0 || h.col === 0 ? t("toolbar.table") : `${h.row} × ${h.col}`;
16869
17415
  };
16870
17416
  return (() => {
16871
- var _el$ = _tmpl$3$h();
17417
+ var _el$ = _tmpl$3$i();
16872
17418
  insert(_el$, createComponent(Popover, {
16873
17419
  get open() {
16874
17420
  return isOpen();
@@ -16880,7 +17426,7 @@ function GridPicker(props) {
16880
17426
  col: 0
16881
17427
  }),
16882
17428
  trigger: (api) => (() => {
16883
- var _el$4 = _tmpl$4$b(), _el$5 = _el$4.firstChild;
17429
+ var _el$4 = _tmpl$4$d(), _el$5 = _el$4.firstChild;
16884
17430
  _el$4.$$click = () => api.toggle();
16885
17431
  use((el) => api.ref(el), _el$4);
16886
17432
  createRenderEffect((_p$) => {
@@ -16902,11 +17448,11 @@ function GridPicker(props) {
16902
17448
  })(),
16903
17449
  get children() {
16904
17450
  return [(() => {
16905
- var _el$2 = _tmpl$$D();
17451
+ var _el$2 = _tmpl$$E();
16906
17452
  insert(_el$2, statusLabel);
16907
17453
  return _el$2;
16908
17454
  })(), (() => {
16909
- var _el$3 = _tmpl$2$r();
17455
+ var _el$3 = _tmpl$2$s();
16910
17456
  insert(_el$3, createComponent(For, {
16911
17457
  get each() {
16912
17458
  return rows();
@@ -17006,6 +17552,174 @@ const DEFAULT_PALETTE = {
17006
17552
  standardColors: STANDARD_COLORS,
17007
17553
  allowCustom: true
17008
17554
  };
17555
+ var _tmpl$$D = /* @__PURE__ */ template(`<button type=button class=oasis-editor-style-gallery-card role=option><span>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-style-gallery-grid>`), _tmpl$3$h = /* @__PURE__ */ template(`<div class=oasis-editor-style-gallery><div class=oasis-editor-style-gallery-ribbon><div class=oasis-editor-style-gallery-strip role=listbox></div><button type=button class=oasis-editor-style-gallery-expand aria-haspopup=listbox><i data-lucide=chevron-down>`), _tmpl$4$c = /* @__PURE__ */ template(`<option>`);
17556
+ function getQuickStyles(styles) {
17557
+ const applicable = styles.filter((style2) => style2.type !== "table" && (!style2.semiHidden || style2.unhideWhenUsed && style2.isUsed));
17558
+ const hasQuickStyles = applicable.some((style2) => style2.qFormat === true);
17559
+ return applicable.filter((style2) => !hasQuickStyles || style2.qFormat === true).map((style2, index) => ({
17560
+ style: style2,
17561
+ index
17562
+ })).sort((a, b) => (a.style.uiPriority ?? Number.MAX_SAFE_INTEGER) - (b.style.uiPriority ?? Number.MAX_SAFE_INTEGER) || a.index - b.index).map(({
17563
+ style: style2
17564
+ }) => style2);
17565
+ }
17566
+ function previewStyle(style2) {
17567
+ const fontSize = Math.min(28, Math.max(12, style2.fontSize ?? 14));
17568
+ return {
17569
+ "font-family": style2.fontFamily,
17570
+ "font-size": `${fontSize}px`,
17571
+ color: style2.color,
17572
+ "font-weight": style2.bold ? "700" : "400",
17573
+ "font-style": style2.italic ? "italic" : "normal"
17574
+ };
17575
+ }
17576
+ function StyleGallery(props) {
17577
+ const [open, setOpen] = createSignal(false);
17578
+ const panelTestId = `${props.item.testId ?? props.item.id}-panel`;
17579
+ const expandTestId = `${props.item.testId ?? props.item.id}-expand`;
17580
+ const styles = createMemo(() => getQuickStyles(props.item.styles(props.api)));
17581
+ const paragraphStyleId = () => String(props.api.commands.state(props.item.paragraphCommand).value ?? "");
17582
+ const characterStyleId = () => String(props.api.commands.state(props.item.characterCommand).value ?? "");
17583
+ createEffect(() => {
17584
+ if (!open()) return;
17585
+ queueMicrotask(() => {
17586
+ const panel = document.querySelector(`[data-testid="${panelTestId}"]`);
17587
+ const target = (panel == null ? void 0 : panel.querySelector(".oasis-editor-style-gallery-card-active")) ?? (panel == null ? void 0 : panel.querySelector(".oasis-editor-style-gallery-card"));
17588
+ target == null ? void 0 : target.focus();
17589
+ });
17590
+ });
17591
+ const isActive = (style2) => style2.type === "character" ? characterStyleId() === style2.id : paragraphStyleId() === style2.id;
17592
+ const apply = (style2) => {
17593
+ const command = style2.type === "character" ? props.item.characterCommand : props.item.paragraphCommand;
17594
+ if (props.api.commands.canExecute(command)) {
17595
+ props.api.commands.execute(command, style2.id);
17596
+ setOpen(false);
17597
+ props.api.focusEditor();
17598
+ }
17599
+ };
17600
+ const onPanelKeyDown = (event) => {
17601
+ var _a;
17602
+ if (event.key === "Escape") {
17603
+ event.preventDefault();
17604
+ event.stopPropagation();
17605
+ setOpen(false);
17606
+ window.setTimeout(() => {
17607
+ var _a2;
17608
+ return (_a2 = document.querySelector(`[data-testid="${expandTestId}"]`)) == null ? void 0 : _a2.focus();
17609
+ }, 0);
17610
+ return;
17611
+ }
17612
+ const buttons = Array.from(event.currentTarget.querySelectorAll(".oasis-editor-style-gallery-card"));
17613
+ const current = buttons.indexOf(document.activeElement);
17614
+ if (current < 0 || buttons.length === 0) return;
17615
+ const renderedColumns = getComputedStyle(event.currentTarget).gridTemplateColumns.split(" ").filter(Boolean).length;
17616
+ const columns = renderedColumns > 0 ? renderedColumns : 6;
17617
+ const moves = {
17618
+ ArrowLeft: current - 1,
17619
+ ArrowRight: current + 1,
17620
+ ArrowUp: current - columns,
17621
+ ArrowDown: current + columns,
17622
+ Home: 0,
17623
+ End: buttons.length - 1
17624
+ };
17625
+ const next = moves[event.key];
17626
+ if (next === void 0) return;
17627
+ event.preventDefault();
17628
+ (_a = buttons[Math.min(buttons.length - 1, Math.max(0, next))]) == null ? void 0 : _a.focus();
17629
+ };
17630
+ const cards = () => createComponent(For, {
17631
+ get each() {
17632
+ return styles();
17633
+ },
17634
+ children: (style$1) => (() => {
17635
+ var _el$ = _tmpl$$D(), _el$2 = _el$.firstChild;
17636
+ _el$.$$click = () => apply(style$1);
17637
+ insert(_el$2, () => style$1.name);
17638
+ createRenderEffect((_p$) => {
17639
+ var _v$ = !!isActive(style$1), _v$2 = previewStyle(style$1), _v$3 = style$1.name, _v$4 = isActive(style$1), _v$5 = style$1.id;
17640
+ _v$ !== _p$.e && _el$.classList.toggle("oasis-editor-style-gallery-card-active", _p$.e = _v$);
17641
+ _p$.t = style(_el$, _v$2, _p$.t);
17642
+ _v$3 !== _p$.a && setAttribute(_el$, "title", _p$.a = _v$3);
17643
+ _v$4 !== _p$.o && setAttribute(_el$, "aria-selected", _p$.o = _v$4);
17644
+ _v$5 !== _p$.i && setAttribute(_el$, "data-style-id", _p$.i = _v$5);
17645
+ return _p$;
17646
+ }, {
17647
+ e: void 0,
17648
+ t: void 0,
17649
+ a: void 0,
17650
+ o: void 0,
17651
+ i: void 0
17652
+ });
17653
+ return _el$;
17654
+ })()
17655
+ });
17656
+ return createComponent(Popover, {
17657
+ get open() {
17658
+ return open();
17659
+ },
17660
+ onOpenChange: setOpen,
17661
+ placement: "bottom-end",
17662
+ panelClass: "oasis-editor-style-gallery-panel",
17663
+ panelRole: "listbox",
17664
+ panelTestId,
17665
+ trigger: (popover) => (() => {
17666
+ var _el$4 = _tmpl$3$h(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17667
+ var _ref$ = popover.ref;
17668
+ typeof _ref$ === "function" ? use(_ref$, _el$4) : popover.ref = _el$4;
17669
+ insert(_el$4, createComponent(Select, {
17670
+ "class": "oasis-editor-style-gallery-compact",
17671
+ get value() {
17672
+ return characterStyleId() || paragraphStyleId();
17673
+ },
17674
+ get ["data-testid"]() {
17675
+ return props.item.testId;
17676
+ },
17677
+ get tooltip() {
17678
+ return props.api.t("toolbar.style");
17679
+ },
17680
+ onChange: (event) => {
17681
+ const style2 = styles().find((candidate) => candidate.id === event.currentTarget.value);
17682
+ if (style2) apply(style2);
17683
+ },
17684
+ get children() {
17685
+ return createComponent(For, {
17686
+ get each() {
17687
+ return styles();
17688
+ },
17689
+ children: (style2) => (() => {
17690
+ var _el$8 = _tmpl$4$c();
17691
+ insert(_el$8, () => style2.name);
17692
+ createRenderEffect(() => _el$8.value = style2.id);
17693
+ return _el$8;
17694
+ })()
17695
+ });
17696
+ }
17697
+ }), _el$5);
17698
+ insert(_el$6, cards);
17699
+ _el$7.$$click = () => popover.toggle();
17700
+ setAttribute(_el$7, "data-testid", expandTestId);
17701
+ createRenderEffect((_p$) => {
17702
+ var _v$6 = props.api.t("toolbar.style"), _v$7 = props.api.t("toolbar.style"), _v$8 = popover.open;
17703
+ _v$6 !== _p$.e && setAttribute(_el$7, "title", _p$.e = _v$6);
17704
+ _v$7 !== _p$.t && setAttribute(_el$7, "aria-label", _p$.t = _v$7);
17705
+ _v$8 !== _p$.a && setAttribute(_el$7, "aria-expanded", _p$.a = _v$8);
17706
+ return _p$;
17707
+ }, {
17708
+ e: void 0,
17709
+ t: void 0,
17710
+ a: void 0
17711
+ });
17712
+ return _el$4;
17713
+ })(),
17714
+ get children() {
17715
+ var _el$3 = _tmpl$2$r();
17716
+ _el$3.$$keydown = onPanelKeyDown;
17717
+ insert(_el$3, cards);
17718
+ return _el$3;
17719
+ }
17720
+ });
17721
+ }
17722
+ delegateEvents(["click", "keydown"]);
17009
17723
  var _tmpl$$C = /* @__PURE__ */ template(`<option value>`), _tmpl$2$q = /* @__PURE__ */ template(`<option>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item style=align-items:center>`);
17010
17724
  function renderMenuContent(content, api) {
17011
17725
  if (content.kind === "custom") {
@@ -17206,6 +17920,16 @@ function RenderSelect(props) {
17206
17920
  }
17207
17921
  });
17208
17922
  }
17923
+ function RenderStyleGallery(props) {
17924
+ return createComponent(StyleGallery, {
17925
+ get item() {
17926
+ return props.item;
17927
+ },
17928
+ get api() {
17929
+ return props.api;
17930
+ }
17931
+ });
17932
+ }
17209
17933
  function RenderColorPicker(props) {
17210
17934
  const [lastValue, setLastValue] = createSignal(props.item.defaultValue);
17211
17935
  const b = bindItem(props.item, props.api);
@@ -17307,6 +18031,7 @@ const TOOLBAR_RENDERERS = {
17307
18031
  split: RenderSplit,
17308
18032
  menu: RenderMenu,
17309
18033
  select: RenderSelect,
18034
+ styleGallery: RenderStyleGallery,
17310
18035
  colorPicker: RenderColorPicker,
17311
18036
  gridPicker: RenderGridPicker,
17312
18037
  separator: RenderSeparator,
@@ -20407,6 +21132,8 @@ function drawBorderBox(ctx, left, top, width, height, borders) {
20407
21132
  drawEdge(ctx, borders.right, right, top, right, bottom);
20408
21133
  drawEdge(ctx, borders.bottom, left, bottom, right, bottom);
20409
21134
  drawEdge(ctx, borders.left, left, top, left, bottom);
21135
+ drawEdge(ctx, borders.topLeftToBottomRight, left, top, right, bottom);
21136
+ drawEdge(ctx, borders.topRightToBottomLeft, right, top, left, bottom);
20410
21137
  }
20411
21138
  const __vite_import_meta_env__ = { "DEV": false };
20412
21139
  function drawVerticalCell(ctx, cell, state, pageIndex, onUpdate, painters) {
@@ -20481,6 +21208,20 @@ function drawTable(ctx, table, tableSegment, state, originX, originY, contentWid
20481
21208
  cell.height,
20482
21209
  cell.borders
20483
21210
  );
21211
+ if (cell.revision) {
21212
+ const color = cell.revision.type === "insert" ? "#059669" : cell.revision.type === "delete" ? "#dc2626" : "#d97706";
21213
+ ctx.save();
21214
+ ctx.strokeStyle = color;
21215
+ ctx.lineWidth = 2;
21216
+ ctx.setLineDash([5, 3]);
21217
+ ctx.strokeRect(
21218
+ cell.left + 1,
21219
+ cell.top + 1,
21220
+ cell.width - 2,
21221
+ cell.height - 2
21222
+ );
21223
+ ctx.restore();
21224
+ }
20484
21225
  if (cell.verticalMode === "horizontal") {
20485
21226
  for (const paragraphLayout of cell.paragraphs) {
20486
21227
  drawParagraph(
@@ -20576,6 +21317,7 @@ function drawParagraphDecorations(ctx, paragraphStyle, lines, originX, contentTo
20576
21317
  }
20577
21318
  }
20578
21319
  function renderBlockList(ctx, state, blocks, originX, originY, contentWidth, pageIndex, onUpdate, pageSettings) {
21320
+ var _a;
20579
21321
  let cursorY = originY;
20580
21322
  for (const block of blocks) {
20581
21323
  if (block.sourceBlock.type === "paragraph" && block.layout) {
@@ -20671,6 +21413,37 @@ function renderBlockList(ctx, state, blocks, originX, originY, contentWidth, pag
20671
21413
  });
20672
21414
  }
20673
21415
  } else if (block.sourceBlock.type === "table") {
21416
+ const floating = (_a = block.sourceBlock.style) == null ? void 0 : _a.floating;
21417
+ if (floating && pageSettings) {
21418
+ const width = resolveCanvasTableWidth(block.sourceBlock, contentWidth);
21419
+ const rect = resolveFloatingTableRect({
21420
+ floating,
21421
+ pageSettings,
21422
+ contentLeft: originX,
21423
+ contentTop: originY,
21424
+ contentWidth,
21425
+ anchorTop: cursorY,
21426
+ width,
21427
+ height: block.floatingTableHeight ?? 1,
21428
+ pageIndex
21429
+ });
21430
+ rect.y += block.floatingTableOffsetY ?? 0;
21431
+ drawTable(
21432
+ ctx,
21433
+ block.sourceBlock,
21434
+ void 0,
21435
+ state,
21436
+ rect.x,
21437
+ rect.y,
21438
+ contentWidth,
21439
+ rect.height,
21440
+ pageIndex,
21441
+ onUpdate,
21442
+ canvasBlockPainters
21443
+ );
21444
+ cursorY += Math.max(0, block.estimatedHeight);
21445
+ continue;
21446
+ }
20674
21447
  drawTable(
20675
21448
  ctx,
20676
21449
  block.sourceBlock,
@@ -21026,7 +21799,7 @@ function createCanvasPageRenderer(options) {
21026
21799
  }
21027
21800
  };
21028
21801
  }
21029
- var _tmpl$$v = /* @__PURE__ */ template(`<div class="oasis-editor-paper-stack oasis-editor-canvas-stack"style=position:relative>`), _tmpl$2$m = /* @__PURE__ */ template(`<div class=oasis-editor-canvas-page-slot style=position:relative>`), _tmpl$3$f = /* @__PURE__ */ template(`<div class=oasis-editor-paper data-renderer=canvas data-testid=editor-page style=position:relative;z-index:1><canvas>`);
21802
+ var _tmpl$$v = /* @__PURE__ */ template(`<div class="oasis-editor-paper-stack oasis-editor-canvas-stack"style=position:relative>`), _tmpl$2$m = /* @__PURE__ */ template(`<div class=oasis-editor-canvas-page-slot style=position:relative>`), _tmpl$3$f = /* @__PURE__ */ template(`<div class=oasis-editor-paper data-renderer=canvas data-testid=editor-page style=position:relative;z-index:1><canvas>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-table-revision-hit style=position:absolute;pointer-events:auto;background:transparent>`);
21030
21803
  const canvasTextMeasurer = {
21031
21804
  composeMeasuredParagraphLines: (options) => domTextMeasurer.composeMeasuredParagraphLines(options),
21032
21805
  resolveRenderedLineHeightPx: (styles, lineHeightMultiple) => domTextMeasurer.resolveRenderedLineHeightPx(styles, lineHeightMultiple)
@@ -21138,6 +21911,12 @@ function CanvasEditorSurface(props) {
21138
21911
  },
21139
21912
  get onSurfaceDblClick() {
21140
21913
  return props.onSurfaceDblClick;
21914
+ },
21915
+ get onRevisionMouseEnter() {
21916
+ return props.onRevisionMouseEnter;
21917
+ },
21918
+ get onRevisionMouseLeave() {
21919
+ return props.onRevisionMouseLeave;
21141
21920
  }
21142
21921
  }), null);
21143
21922
  return _el$2;
@@ -21154,6 +21933,57 @@ function CanvasPage(props) {
21154
21933
  getPage: () => props.page,
21155
21934
  getState: () => props.state
21156
21935
  });
21936
+ const revisionCells = createMemo(() => {
21937
+ var _a;
21938
+ const result = [];
21939
+ let cursorY = props.page.bodyTop ?? props.page.pageSettings.margins.top;
21940
+ const columns = getPageColumnRects(props.page.pageSettings);
21941
+ for (const block of props.page.blocks) {
21942
+ if (block.sourceBlock.type === "table") {
21943
+ const column = columns[block.columnIndex ?? 0] ?? columns[0];
21944
+ const sourceTable = block.tableSegment ? buildSegmentTable(block.sourceBlock, block.tableSegment) : block.sourceBlock;
21945
+ let originX = column.left;
21946
+ let originY = cursorY;
21947
+ const floating = (_a = sourceTable.style) == null ? void 0 : _a.floating;
21948
+ if (floating) {
21949
+ const rect = resolveFloatingTableRect({
21950
+ floating,
21951
+ pageSettings: props.page.pageSettings,
21952
+ contentLeft: column.left,
21953
+ contentTop: props.page.bodyTop ?? props.page.pageSettings.margins.top,
21954
+ contentWidth: column.width,
21955
+ anchorTop: cursorY,
21956
+ width: resolveCanvasTableWidth(sourceTable, column.width),
21957
+ height: block.floatingTableHeight ?? 1,
21958
+ pageIndex: props.page.index
21959
+ });
21960
+ originX = rect.x;
21961
+ originY = rect.y + (block.floatingTableOffsetY ?? 0);
21962
+ }
21963
+ const layout = buildCanvasTableLayout({
21964
+ table: sourceTable,
21965
+ state: props.state,
21966
+ pageIndex: props.page.index,
21967
+ originX,
21968
+ originY,
21969
+ contentWidth: column.width,
21970
+ estimatedHeight: block.floatingTableHeight ?? block.estimatedHeight
21971
+ });
21972
+ for (const cell of layout.cells) {
21973
+ if (!cell.revision) continue;
21974
+ result.push({
21975
+ id: cell.revision.id,
21976
+ left: cell.left,
21977
+ top: cell.top,
21978
+ width: cell.width,
21979
+ height: cell.height
21980
+ });
21981
+ }
21982
+ }
21983
+ cursorY += Math.max(0, block.estimatedHeight);
21984
+ }
21985
+ return result;
21986
+ });
21157
21987
  createEffect(() => {
21158
21988
  props.page;
21159
21989
  props.state.document;
@@ -21187,6 +22017,36 @@ function CanvasPage(props) {
21187
22017
  addEventListener(_el$3, "mousedown", props.onSurfaceMouseDown, true);
21188
22018
  var _ref$ = canvasRef;
21189
22019
  typeof _ref$ === "function" ? use(_ref$, _el$4) : canvasRef = _el$4;
22020
+ insert(_el$3, createComponent(For, {
22021
+ get each() {
22022
+ return revisionCells();
22023
+ },
22024
+ children: (revision) => (() => {
22025
+ var _el$5 = _tmpl$4$b();
22026
+ addEventListener(_el$5, "mousedown", props.onSurfaceMouseDown, true);
22027
+ _el$5.addEventListener("mouseleave", (event) => {
22028
+ var _a;
22029
+ return (_a = props.onRevisionMouseLeave) == null ? void 0 : _a.call(props, revision.id, event);
22030
+ });
22031
+ _el$5.addEventListener("mouseenter", (event) => props.onRevisionMouseEnter(revision.id, event));
22032
+ createRenderEffect((_p$) => {
22033
+ var _v$4 = revision.id, _v$5 = `${revision.left}px`, _v$6 = `${revision.top}px`, _v$7 = `${revision.width}px`, _v$8 = `${revision.height}px`;
22034
+ _v$4 !== _p$.e && setAttribute(_el$5, "data-revision-id", _p$.e = _v$4);
22035
+ _v$5 !== _p$.t && setStyleProperty(_el$5, "left", _p$.t = _v$5);
22036
+ _v$6 !== _p$.a && setStyleProperty(_el$5, "top", _p$.a = _v$6);
22037
+ _v$7 !== _p$.o && setStyleProperty(_el$5, "width", _p$.o = _v$7);
22038
+ _v$8 !== _p$.i && setStyleProperty(_el$5, "height", _p$.i = _v$8);
22039
+ return _p$;
22040
+ }, {
22041
+ e: void 0,
22042
+ t: void 0,
22043
+ a: void 0,
22044
+ o: void 0,
22045
+ i: void 0
22046
+ });
22047
+ return _el$5;
22048
+ })()
22049
+ }), null);
21190
22050
  createRenderEffect((_p$) => {
21191
22051
  var _v$ = props.index, _v$2 = `${props.page.pageSettings.width}px`, _v$3 = `${props.page.pageSettings.height}px`;
21192
22052
  _v$ !== _p$.e && setAttribute(_el$3, "data-page-index", _p$.e = _v$);
@@ -21410,6 +22270,7 @@ function getToolbarStyleState(state) {
21410
22270
  textEffect: resolveUniformStyleValue(styles, "textEffect"),
21411
22271
  link: resolveUniformStyleValue(styles, "link"),
21412
22272
  styleId: resolveUniformParagraphStyleValue(paragraphStyles, "styleId"),
22273
+ characterStyleId: resolveUniformStyleValue(styles, "styleId"),
21413
22274
  align: resolveUniformParagraphStyleValue(paragraphStyles, "align"),
21414
22275
  lineHeight: resolveUniformParagraphStyleValue(
21415
22276
  paragraphStyles,
@@ -21880,7 +22741,11 @@ function RevisionOverlay(props) {
21880
22741
  return "Data desconhecida";
21881
22742
  }
21882
22743
  };
21883
- const label = () => props.box.type === "insert" ? "Inserido por" : "Excluído por";
22744
+ const label = () => {
22745
+ if (props.box.type === "insert") return "Inserido por";
22746
+ if (props.box.type === "delete") return "Excluído por";
22747
+ return "Alterado por";
22748
+ };
21884
22749
  return (() => {
21885
22750
  var _el$ = _tmpl$$r(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
21886
22751
  _el$4.nextSibling;
@@ -32283,23 +33148,508 @@ function parseParagraphStyle$1(paragraphProperties) {
32283
33148
  }
32284
33149
  return emptyOrUndefined(style2);
32285
33150
  }
32286
- function parseConditionalRowStyle(trPr) {
32287
- if (!trPr) return void 0;
33151
+ function parseDocxWidthValue(element) {
33152
+ if (!element) {
33153
+ return void 0;
33154
+ }
33155
+ const type = getAttributeValue(element, "type");
33156
+ const raw = getAttributeValue(element, "w");
33157
+ if (type === "auto") {
33158
+ return "auto";
33159
+ }
33160
+ if (type === "pct") {
33161
+ if (!raw) {
33162
+ return void 0;
33163
+ }
33164
+ const pct = raw.trim().endsWith("%") ? Number.parseFloat(raw) : Number(raw) / 50;
33165
+ return Number.isFinite(pct) ? `${Math.round(pct * 1e4) / 1e4}%` : void 0;
33166
+ }
33167
+ return twipsToPoints(raw);
33168
+ }
33169
+ function parsePositiveIntegerProperty(parent, localName) {
33170
+ const element = getFirstChildByTagNameNS(parent, WORD_NS, localName);
33171
+ const raw = getAttributeValue(element, "val");
33172
+ const parsed = raw ? Number(raw) : Number.NaN;
33173
+ return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : void 0;
33174
+ }
33175
+ function parseTableConditionalFlags(properties) {
33176
+ const element = getFirstChildByTagNameNS(properties, WORD_NS, "cnfStyle");
33177
+ if (!element) return void 0;
33178
+ const names = [
33179
+ ["firstRow", "firstRow"],
33180
+ ["lastRow", "lastRow"],
33181
+ ["firstColumn", "firstCol"],
33182
+ ["lastColumn", "lastCol"],
33183
+ ["oddVBand", "band1Vert"],
33184
+ ["evenVBand", "band2Vert"],
33185
+ ["oddHBand", "band1Horz"],
33186
+ ["evenHBand", "band2Horz"],
33187
+ ["firstRowFirstColumn", "nwCell"],
33188
+ ["firstRowLastColumn", "neCell"],
33189
+ ["lastRowFirstColumn", "swCell"],
33190
+ ["lastRowLastColumn", "seCell"]
33191
+ ];
33192
+ const rawBits = getAttributeValue(element, "val") ?? "";
33193
+ const flags = {};
33194
+ names.forEach(([attribute, key], index) => {
33195
+ const explicit = getAttributeValue(element, attribute);
33196
+ if (explicit === "1" || explicit === "true" || explicit === "on") {
33197
+ flags[key] = true;
33198
+ } else if (explicit === "0" || explicit === "false" || explicit === "off") {
33199
+ flags[key] = false;
33200
+ } else if (rawBits.length === 12 && rawBits[index] === "1") {
33201
+ flags[key] = true;
33202
+ }
33203
+ });
33204
+ return Object.keys(flags).length > 0 ? flags : void 0;
33205
+ }
33206
+ function parseRevisionMetadata(element) {
33207
+ const rawDate = getAttributeValue(element, "date");
33208
+ const parsedDate = rawDate ? Date.parse(rawDate) : Number.NaN;
33209
+ return {
33210
+ id: getAttributeValue(element, "id") ?? `revision:${element.localName}`,
33211
+ author: getAttributeValue(element, "author") ?? "Unknown",
33212
+ date: Number.isFinite(parsedDate) ? parsedDate : 0
33213
+ };
33214
+ }
33215
+ function parseFloatingTableProperties(tblPr) {
33216
+ const tblpPr = getFirstChildByTagNameNS(tblPr, WORD_NS, "tblpPr");
33217
+ if (!tblpPr || !tblpPr.attributes || tblpPr.attributes.length === 0) {
33218
+ return void 0;
33219
+ }
33220
+ const attrs = {};
33221
+ for (let index = 0; index < tblpPr.attributes.length; index += 1) {
33222
+ const attr = tblpPr.attributes.item(index);
33223
+ if ((attr == null ? void 0 : attr.namespaceURI) === WORD_NS || (attr == null ? void 0 : attr.prefix) === "w") {
33224
+ attrs[attr.localName || attr.name.replace(/^w:/, "")] = attr.value;
33225
+ }
33226
+ }
33227
+ const point = (name) => twipsToPoints(attrs[name] ?? null);
33228
+ const horizontalAnchor = attrs.horzAnchor === "margin" || attrs.horzAnchor === "page" || attrs.horzAnchor === "text" ? attrs.horzAnchor : void 0;
33229
+ const verticalAnchor = attrs.vertAnchor === "margin" || attrs.vertAnchor === "page" || attrs.vertAnchor === "text" ? attrs.vertAnchor : void 0;
33230
+ const xAlign = attrs.tblpXSpec === "left" || attrs.tblpXSpec === "center" || attrs.tblpXSpec === "right" || attrs.tblpXSpec === "inside" || attrs.tblpXSpec === "outside" ? attrs.tblpXSpec : void 0;
33231
+ const yAlign = attrs.tblpYSpec === "top" || attrs.tblpYSpec === "center" || attrs.tblpYSpec === "bottom" || attrs.tblpYSpec === "inside" || attrs.tblpYSpec === "outside" ? attrs.tblpYSpec : void 0;
33232
+ return {
33233
+ ...horizontalAnchor ? { horizontalAnchor } : {},
33234
+ ...verticalAnchor ? { verticalAnchor } : {},
33235
+ ...point("tblpX") !== void 0 ? { x: point("tblpX") } : {},
33236
+ ...point("tblpY") !== void 0 ? { y: point("tblpY") } : {},
33237
+ ...xAlign ? { xAlign } : {},
33238
+ ...yAlign ? { yAlign } : {},
33239
+ ...point("topFromText") !== void 0 ? { distanceTop: point("topFromText") } : {},
33240
+ ...point("rightFromText") !== void 0 ? { distanceRight: point("rightFromText") } : {},
33241
+ ...point("bottomFromText") !== void 0 ? { distanceBottom: point("bottomFromText") } : {},
33242
+ ...point("leftFromText") !== void 0 ? { distanceLeft: point("leftFromText") } : {}
33243
+ };
33244
+ }
33245
+ function parseCellMargins(container) {
33246
+ if (!container) {
33247
+ return void 0;
33248
+ }
33249
+ const edgePt = (edge) => twipsToPoints(
33250
+ getAttributeValue(
33251
+ getFirstChildByTagNameNS(container, WORD_NS, edge),
33252
+ "w"
33253
+ )
33254
+ );
33255
+ const margins = {};
33256
+ const top = edgePt("top");
33257
+ const right = edgePt("right");
33258
+ const bottom = edgePt("bottom");
33259
+ const left = edgePt("left");
33260
+ const start = edgePt("start");
33261
+ const end = edgePt("end");
33262
+ if (top !== void 0) margins.top = top;
33263
+ if (right !== void 0) margins.right = right;
33264
+ if (bottom !== void 0) margins.bottom = bottom;
33265
+ if (left !== void 0) margins.left = left;
33266
+ if (start !== void 0) margins.start = start;
33267
+ if (end !== void 0) margins.end = end;
33268
+ return Object.keys(margins).length > 0 ? margins : void 0;
33269
+ }
33270
+ function parseTableLayout(tblPr) {
33271
+ const value = getAttributeValue(
33272
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblLayout"),
33273
+ "type"
33274
+ );
33275
+ return value === "fixed" || value === "autofit" ? value : void 0;
33276
+ }
33277
+ function parseTableStyle(tblPr, tableStyleId) {
33278
+ const style2 = {};
33279
+ if (tableStyleId) {
33280
+ style2.styleId = tableStyleId;
33281
+ }
33282
+ const altTitle = getAttributeValue(
33283
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCaption"),
33284
+ "val"
33285
+ );
33286
+ if (altTitle) {
33287
+ style2.altTitle = altTitle;
33288
+ }
33289
+ const altDescription = getAttributeValue(
33290
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblDescription"),
33291
+ "val"
33292
+ );
33293
+ if (altDescription) {
33294
+ style2.altDescription = altDescription;
33295
+ }
33296
+ const width = parseDocxWidthValue(
33297
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblW")
33298
+ );
33299
+ if (width !== void 0) {
33300
+ style2.width = width;
33301
+ }
33302
+ const indentLeft = parseDocxWidthValue(
33303
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblInd")
33304
+ );
33305
+ if (indentLeft !== void 0) {
33306
+ style2.indentLeft = indentLeft;
33307
+ }
33308
+ const jc = getAttributeValue(
33309
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "jc"),
33310
+ "val"
33311
+ );
33312
+ if (jc === "left" || jc === "center" || jc === "right") {
33313
+ style2.align = jc;
33314
+ }
33315
+ const layout = parseTableLayout(tblPr);
33316
+ if (layout) {
33317
+ style2.layout = layout;
33318
+ }
33319
+ const cellSpacing = parseDocxWidthValue(
33320
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCellSpacing")
33321
+ );
33322
+ if (cellSpacing !== void 0) {
33323
+ style2.cellSpacing = cellSpacing;
33324
+ }
33325
+ const borders = parseDocxTableBorders(
33326
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblBorders")
33327
+ );
33328
+ if (Object.keys(borders).length > 0) style2.borders = borders;
33329
+ const defaultCellMargins = parseCellMargins(
33330
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCellMar")
33331
+ );
33332
+ if (defaultCellMargins) {
33333
+ style2.defaultCellMargins = defaultCellMargins;
33334
+ }
33335
+ const bidiVisual = tblPr ? parseOnOffProperty(tblPr, "bidiVisual") : void 0;
33336
+ if (bidiVisual !== void 0) {
33337
+ style2.bidiVisual = bidiVisual;
33338
+ }
33339
+ const tblOverlap = getAttributeValue(
33340
+ getFirstChildByTagNameNS(tblPr, WORD_NS, "tblOverlap"),
33341
+ "val"
33342
+ );
33343
+ if (tblOverlap === "overlap" || tblOverlap === "never") {
33344
+ style2.tblOverlap = tblOverlap;
33345
+ }
33346
+ const floating = parseFloatingTableProperties(tblPr);
33347
+ if (floating) {
33348
+ style2.floating = floating;
33349
+ }
33350
+ const rowBandSize = parsePositiveIntegerProperty(
33351
+ tblPr,
33352
+ "tblStyleRowBandSize"
33353
+ );
33354
+ if (rowBandSize !== void 0) style2.rowBandSize = rowBandSize;
33355
+ const colBandSize = parsePositiveIntegerProperty(
33356
+ tblPr,
33357
+ "tblStyleColBandSize"
33358
+ );
33359
+ if (colBandSize !== void 0) style2.colBandSize = colBandSize;
33360
+ const tblLook = getFirstChildByTagNameNS(tblPr, WORD_NS, "tblLook");
33361
+ if (tblLook) {
33362
+ const raw = getAttributeValue(tblLook, "val");
33363
+ const mask = raw ? Number.parseInt(raw, 16) : Number.NaN;
33364
+ const flag = (name, bit, fallback) => {
33365
+ const value = getAttributeValue(tblLook, name);
33366
+ if (value !== null && value !== "") {
33367
+ return value === "1" || value === "true" || value === "on";
33368
+ }
33369
+ return Number.isFinite(mask) ? (mask & bit) !== 0 : fallback;
33370
+ };
33371
+ style2.tblLook = {
33372
+ firstRow: flag("firstRow", 32, true),
33373
+ lastRow: flag("lastRow", 64, false),
33374
+ firstCol: flag("firstColumn", 128, true),
33375
+ lastCol: flag("lastColumn", 256, false),
33376
+ noHBand: flag("noHBand", 512, false),
33377
+ noVBand: flag("noVBand", 1024, false)
33378
+ };
33379
+ }
33380
+ const change = getFirstChildByTagNameNS(tblPr, WORD_NS, "tblPrChange");
33381
+ const previousProperties = getFirstChildByTagNameNS(change, WORD_NS, "tblPr");
33382
+ if (change && previousProperties) {
33383
+ style2.revision = {
33384
+ ...parseRevisionMetadata(change),
33385
+ type: "property",
33386
+ previous: parseTableStyle(previousProperties) ?? {}
33387
+ };
33388
+ }
33389
+ return emptyOrUndefined(style2);
33390
+ }
33391
+ function parseTableRowStyle(rowProperties) {
33392
+ if (!rowProperties) {
33393
+ return void 0;
33394
+ }
32288
33395
  const style2 = {};
32289
- const trHeight = getFirstChildByTagNameNS(trPr, WORD_NS, "trHeight");
32290
- if (trHeight) {
32291
- const height = twipsToPoints(getAttributeValue(trHeight, "val"));
32292
- if (height !== void 0) style2.height = height;
32293
- const hRule = getAttributeValue(trHeight, "hRule");
32294
- if (hRule === "auto" || hRule === "exact" || hRule === "atLeast") {
32295
- style2.heightRule = hRule;
33396
+ const isHeader = parseOnOffProperty(rowProperties, "tblHeader");
33397
+ if (isHeader !== void 0) style2.isHeader = isHeader;
33398
+ const gridBefore = parsePositiveIntegerProperty(rowProperties, "gridBefore");
33399
+ if (gridBefore !== void 0) {
33400
+ style2.gridBefore = gridBefore;
33401
+ }
33402
+ const gridAfter = parsePositiveIntegerProperty(rowProperties, "gridAfter");
33403
+ if (gridAfter !== void 0) {
33404
+ style2.gridAfter = gridAfter;
33405
+ }
33406
+ const widthBefore = parseDocxWidthValue(
33407
+ getFirstChildByTagNameNS(rowProperties, WORD_NS, "wBefore")
33408
+ );
33409
+ if (widthBefore !== void 0) {
33410
+ style2.widthBefore = widthBefore;
33411
+ }
33412
+ const widthAfter = parseDocxWidthValue(
33413
+ getFirstChildByTagNameNS(rowProperties, WORD_NS, "wAfter")
33414
+ );
33415
+ if (widthAfter !== void 0) {
33416
+ style2.widthAfter = widthAfter;
33417
+ }
33418
+ const trHeight = getFirstChildByTagNameNS(rowProperties, WORD_NS, "trHeight");
33419
+ const height = twipsToPoints(getAttributeValue(trHeight, "val"));
33420
+ if (height !== void 0) {
33421
+ style2.height = height;
33422
+ }
33423
+ const hRule = getAttributeValue(trHeight, "hRule");
33424
+ if (hRule === "auto" || hRule === "exact" || hRule === "atLeast") {
33425
+ style2.heightRule = hRule;
33426
+ }
33427
+ const cellSpacing = parseDocxWidthValue(
33428
+ getFirstChildByTagNameNS(rowProperties, WORD_NS, "tblCellSpacing")
33429
+ );
33430
+ if (cellSpacing !== void 0) {
33431
+ style2.cellSpacing = cellSpacing;
33432
+ }
33433
+ const cantSplit = parseOnOffProperty(rowProperties, "cantSplit");
33434
+ if (cantSplit !== void 0) {
33435
+ style2.cantSplit = cantSplit;
33436
+ }
33437
+ const hidden = parseOnOffProperty(rowProperties, "hidden");
33438
+ if (hidden !== void 0) {
33439
+ style2.hidden = hidden;
33440
+ }
33441
+ const change = getFirstChildByTagNameNS(rowProperties, WORD_NS, "trPrChange");
33442
+ const previousProperties = getFirstChildByTagNameNS(change, WORD_NS, "trPr");
33443
+ if (change && previousProperties) {
33444
+ style2.propertyRevision = {
33445
+ ...parseRevisionMetadata(change),
33446
+ type: "property",
33447
+ previous: parseTableRowStyle(previousProperties) ?? {}
33448
+ };
33449
+ }
33450
+ const inserted = getFirstChildByTagNameNS(rowProperties, WORD_NS, "ins");
33451
+ const deleted = getFirstChildByTagNameNS(rowProperties, WORD_NS, "del");
33452
+ const structural = inserted ?? deleted;
33453
+ if (structural) {
33454
+ style2.revision = {
33455
+ ...parseRevisionMetadata(structural),
33456
+ type: inserted ? "insert" : "delete"
33457
+ };
33458
+ }
33459
+ return emptyOrUndefined(style2);
33460
+ }
33461
+ function getTableCellColSpan(cellProperties) {
33462
+ if (!cellProperties) {
33463
+ return 1;
33464
+ }
33465
+ const gridSpan = getFirstChildByTagNameNS(
33466
+ cellProperties,
33467
+ WORD_NS,
33468
+ "gridSpan"
33469
+ );
33470
+ const value = getAttributeValue(gridSpan, "val");
33471
+ const parsed = value ? Number(value) : 1;
33472
+ return Number.isFinite(parsed) && parsed > 1 ? Math.floor(parsed) : 1;
33473
+ }
33474
+ function getTableCellVMerge(cellProperties) {
33475
+ if (!cellProperties) {
33476
+ return void 0;
33477
+ }
33478
+ const vMerge = getFirstChildByTagNameNS(cellProperties, WORD_NS, "vMerge");
33479
+ if (!vMerge) {
33480
+ return void 0;
33481
+ }
33482
+ const value = getAttributeValue(vMerge, "val");
33483
+ return value === "restart" ? "restart" : "continue";
33484
+ }
33485
+ function parseTableCellVerticalAlign(cellProperties) {
33486
+ if (!cellProperties) {
33487
+ return void 0;
33488
+ }
33489
+ const vAlign = getFirstChildByTagNameNS(cellProperties, WORD_NS, "vAlign");
33490
+ const value = getAttributeValue(vAlign, "val");
33491
+ if (value === "top" || value === "bottom") {
33492
+ return value;
33493
+ }
33494
+ if (value === "center") {
33495
+ return "middle";
33496
+ }
33497
+ return void 0;
33498
+ }
33499
+ function parseTableCellBorders(cellProperties) {
33500
+ if (!cellProperties) {
33501
+ return {};
33502
+ }
33503
+ return parseDocxBoxBorders(
33504
+ getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcBorders")
33505
+ );
33506
+ }
33507
+ function parseTableCellStyle(cellProperties, tableDefaultMargins) {
33508
+ if (!cellProperties) {
33509
+ {
33510
+ return void 0;
33511
+ }
33512
+ }
33513
+ const style2 = {
33514
+ ...{},
33515
+ ...{},
33516
+ ...{},
33517
+ ...{},
33518
+ ...{},
33519
+ ...{}
33520
+ };
33521
+ const shading = getFirstChildByTagNameNS(cellProperties, WORD_NS, "shd");
33522
+ const fill = parseShdFill(shading);
33523
+ if (fill) {
33524
+ style2.shading = fill;
33525
+ }
33526
+ const cellWidth = getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcW");
33527
+ const cellWidthType = getAttributeValue(cellWidth, "type");
33528
+ const cellWidthValue = getAttributeValue(cellWidth, "w");
33529
+ if (cellWidthType === "dxa") {
33530
+ const width = twipsToPoints(cellWidthValue);
33531
+ if (width !== void 0) {
33532
+ style2.width = width;
33533
+ }
33534
+ } else if (cellWidthType === "pct" && cellWidthValue) {
33535
+ const pct = Number(cellWidthValue);
33536
+ if (Number.isFinite(pct)) {
33537
+ style2.width = `${Math.round(pct / 50 * 1e4) / 1e4}%`;
33538
+ }
33539
+ }
33540
+ const tcMar = parseCellMargins(
33541
+ getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcMar")
33542
+ );
33543
+ if (tcMar) {
33544
+ if (tcMar.top !== void 0) style2.paddingTop = tcMar.top;
33545
+ if (tcMar.bottom !== void 0) style2.paddingBottom = tcMar.bottom;
33546
+ if (tcMar.left !== void 0) style2.paddingLeft = tcMar.left;
33547
+ if (tcMar.right !== void 0) style2.paddingRight = tcMar.right;
33548
+ if (tcMar.start !== void 0) style2.paddingStart = tcMar.start;
33549
+ if (tcMar.end !== void 0) style2.paddingEnd = tcMar.end;
33550
+ }
33551
+ const verticalAlign = parseTableCellVerticalAlign(cellProperties);
33552
+ if (verticalAlign) {
33553
+ style2.verticalAlign = verticalAlign;
33554
+ }
33555
+ const textDirection = parseTextDirection(
33556
+ getAttributeValue(
33557
+ getFirstChildByTagNameNS(cellProperties, WORD_NS, "textDirection"),
33558
+ "val"
33559
+ )
33560
+ );
33561
+ if (textDirection) {
33562
+ style2.textDirection = textDirection;
33563
+ }
33564
+ const noWrap = parseOnOffProperty(cellProperties, "noWrap");
33565
+ if (noWrap !== void 0) {
33566
+ style2.noWrap = noWrap;
33567
+ }
33568
+ const fitText = parseOnOffProperty(cellProperties, "tcFitText");
33569
+ if (fitText !== void 0) {
33570
+ style2.fitText = fitText;
33571
+ }
33572
+ const hideMark = parseOnOffProperty(cellProperties, "hideMark");
33573
+ if (hideMark !== void 0) {
33574
+ style2.hideMark = hideMark;
33575
+ }
33576
+ const headers = getAttributeValue(
33577
+ getFirstChildByTagNameNS(cellProperties, WORD_NS, "headers"),
33578
+ "val"
33579
+ );
33580
+ if (headers) {
33581
+ style2.headers = headers;
33582
+ }
33583
+ const change = getFirstChildByTagNameNS(
33584
+ cellProperties,
33585
+ WORD_NS,
33586
+ "tcPrChange"
33587
+ );
33588
+ const previousProperties = getFirstChildByTagNameNS(change, WORD_NS, "tcPr");
33589
+ if (change && previousProperties) {
33590
+ style2.propertyRevision = {
33591
+ ...parseRevisionMetadata(change),
33592
+ type: "property",
33593
+ previous: parseTableCellStyle(previousProperties) ?? {}
33594
+ };
33595
+ }
33596
+ const inserted = getFirstChildByTagNameNS(cellProperties, WORD_NS, "cellIns");
33597
+ const deleted = getFirstChildByTagNameNS(cellProperties, WORD_NS, "cellDel");
33598
+ const merged = getFirstChildByTagNameNS(cellProperties, WORD_NS, "cellMerge");
33599
+ const structural = inserted ?? deleted ?? merged;
33600
+ if (structural) {
33601
+ const originalMerge = getAttributeValue(structural, "vMergeOrig");
33602
+ style2.revision = {
33603
+ ...parseRevisionMetadata(structural),
33604
+ type: inserted ? "insert" : deleted ? "delete" : "merge",
33605
+ ...merged && originalMerge ? {
33606
+ previous: {
33607
+ vMerge: originalMerge === "restart" ? "restart" : "continue"
33608
+ }
33609
+ } : {}
33610
+ };
33611
+ }
33612
+ for (const [key, border] of Object.entries(
33613
+ parseTableCellBorders(cellProperties)
33614
+ )) {
33615
+ if (border) {
33616
+ style2[key] = border;
33617
+ }
33618
+ }
33619
+ return emptyOrUndefined(style2);
33620
+ }
33621
+ function isTableHeaderRow(rowNode) {
33622
+ const rowProperties = getFirstChildByTagNameNS(rowNode, WORD_NS, "trPr");
33623
+ return rowProperties ? parseOnOffProperty(rowProperties, "tblHeader") === true : false;
33624
+ }
33625
+ function collapseCellAutospacing(paragraphs, flags) {
33626
+ var _a, _b;
33627
+ const styleOf = (paragraph) => paragraph.style ?? (paragraph.style = {});
33628
+ const lastIndex = paragraphs.length - 1;
33629
+ for (let index = 0; index < paragraphs.length; index += 1) {
33630
+ const flag = flags[index];
33631
+ if (!flag) {
33632
+ continue;
33633
+ }
33634
+ if (index === 0 && flag.before) {
33635
+ styleOf(paragraphs[index]).spacingBefore = 0;
33636
+ }
33637
+ if (index === lastIndex && flag.after) {
33638
+ styleOf(paragraphs[index]).spacingAfter = 0;
33639
+ }
33640
+ }
33641
+ for (let index = 0; index < lastIndex; index += 1) {
33642
+ if (!((_a = flags[index]) == null ? void 0 : _a.after) || !((_b = flags[index + 1]) == null ? void 0 : _b.before)) {
33643
+ continue;
33644
+ }
33645
+ const prev = styleOf(paragraphs[index]);
33646
+ const next = styleOf(paragraphs[index + 1]);
33647
+ if ((prev.spacingAfter ?? 0) >= (next.spacingBefore ?? 0)) {
33648
+ next.spacingBefore = 0;
33649
+ } else {
33650
+ prev.spacingAfter = 0;
32296
33651
  }
32297
33652
  }
32298
- const cantSplit = parseOnOffProperty(trPr, "cantSplit");
32299
- if (cantSplit !== void 0) style2.cantSplit = cantSplit;
32300
- const hidden = parseOnOffProperty(trPr, "hidden");
32301
- if (hidden !== void 0) style2.hidden = hidden;
32302
- return Object.keys(style2).length > 0 ? style2 : void 0;
32303
33653
  }
32304
33654
  function parseImportedStyles(stylesXml, theme) {
32305
33655
  if (!stylesXml) {
@@ -32350,6 +33700,15 @@ function parseImportedStyles(stylesXml, theme) {
32350
33700
  getFirstChildByTagNameNS(styleElement, WORD_NS, "next"),
32351
33701
  "val"
32352
33702
  ) ?? void 0;
33703
+ const qFormat = parseOnOffProperty(styleElement, "qFormat");
33704
+ const semiHidden = parseOnOffProperty(styleElement, "semiHidden");
33705
+ const unhideWhenUsed = parseOnOffProperty(styleElement, "unhideWhenUsed");
33706
+ const rawUiPriority = getAttributeValue(
33707
+ getFirstChildByTagNameNS(styleElement, WORD_NS, "uiPriority"),
33708
+ "val"
33709
+ );
33710
+ const parsedUiPriority = rawUiPriority === null ? NaN : Number(rawUiPriority);
33711
+ const uiPriority = Number.isInteger(parsedUiPriority) && parsedUiPriority >= 0 ? parsedUiPriority : void 0;
32353
33712
  const paragraphStyle = withDocxImplicitSingleLineHeight(
32354
33713
  parseParagraphStyle$1(
32355
33714
  getFirstChildByTagNameNS(styleElement, WORD_NS, "pPr")
@@ -32362,8 +33721,6 @@ function parseImportedStyles(stylesXml, theme) {
32362
33721
  let tableStyle;
32363
33722
  if (type === "table") {
32364
33723
  const tblPr = getFirstChildByTagNameNS(styleElement, WORD_NS, "tblPr");
32365
- const tblInd = getFirstChildByTagNameNS(tblPr, WORD_NS, "tblInd");
32366
- const indentLeft = twipsToPoints(getAttributeValue(tblInd, "w"));
32367
33724
  const parseBandSize = (localName) => {
32368
33725
  const raw = getAttributeValue(
32369
33726
  getFirstChildByTagNameNS(tblPr, WORD_NS, localName),
@@ -32383,6 +33740,10 @@ function parseImportedStyles(stylesXml, theme) {
32383
33740
  const condType = getAttributeValue(tblStylePr, "type");
32384
33741
  if (!condType) continue;
32385
33742
  const tcPr = getFirstChildByTagNameNS(tblStylePr, WORD_NS, "tcPr");
33743
+ const conditionalCellStyle = parseTableCellStyle(tcPr);
33744
+ const conditionalTableStyle = parseTableStyle(
33745
+ getFirstChildByTagNameNS(tblStylePr, WORD_NS, "tblPr")
33746
+ );
32386
33747
  const shd = getFirstChildByTagNameNS(tcPr, WORD_NS, "shd");
32387
33748
  const fill = parseShdFill(shd);
32388
33749
  const condTextStyle = parseRunStyle(
@@ -32397,22 +33758,23 @@ function parseImportedStyles(stylesXml, theme) {
32397
33758
  const condParagraphStyle = parseParagraphStyle$1(
32398
33759
  getFirstChildByTagNameNS(tblStylePr, WORD_NS, "pPr")
32399
33760
  );
32400
- const condRowStyle = parseConditionalRowStyle(
33761
+ const condRowStyle = parseTableRowStyle(
32401
33762
  getFirstChildByTagNameNS(tblStylePr, WORD_NS, "trPr")
32402
33763
  );
32403
- if (fill || condTextStyle || condBorders || condParagraphStyle || condRowStyle) {
33764
+ if (fill || condTextStyle || condBorders || condParagraphStyle || condRowStyle || conditionalCellStyle || conditionalTableStyle) {
32404
33765
  conditionalFormats[condType] = {
32405
33766
  ...fill ? { shading: fill } : {},
32406
33767
  ...condTextStyle ? { textStyle: condTextStyle } : {},
32407
33768
  ...condBorders ? { borders: condBorders } : {},
32408
33769
  ...condParagraphStyle ? { paragraphStyle: condParagraphStyle } : {},
32409
- ...condRowStyle ? { rowStyle: condRowStyle } : {}
33770
+ ...condRowStyle ? { rowStyle: condRowStyle } : {},
33771
+ ...conditionalCellStyle ? { cellStyle: conditionalCellStyle } : {},
33772
+ ...conditionalTableStyle ? { tableStyle: conditionalTableStyle } : {}
32410
33773
  };
32411
33774
  }
32412
33775
  }
32413
33776
  tableStyle = {
32414
- styleId: id,
32415
- indentLeft,
33777
+ ...parseTableStyle(tblPr, id) ?? { styleId: id },
32416
33778
  ...rowBandSize !== void 0 ? { rowBandSize } : {},
32417
33779
  ...colBandSize !== void 0 ? { colBandSize } : {},
32418
33780
  ...Object.keys(conditionalFormats).length > 0 ? { conditionalFormats } : {}
@@ -32426,8 +33788,13 @@ function parseImportedStyles(stylesXml, theme) {
32426
33788
  id,
32427
33789
  name,
32428
33790
  type,
33791
+ isDefault: isWordTrue(getAttributeValue(styleElement, "default")),
32429
33792
  basedOn,
32430
33793
  nextStyle,
33794
+ qFormat,
33795
+ uiPriority,
33796
+ semiHidden,
33797
+ unhideWhenUsed,
32431
33798
  paragraphStyle: type === "paragraph" && isDefaultParagraph ? mergeStyles(defaultParagraphStyle, paragraphStyle) : paragraphStyle,
32432
33799
  textStyle: type === "paragraph" && isDefaultParagraph ? mergeStyles(defaultTextStyle, textStyle) : textStyle,
32433
33800
  tableStyle
@@ -33849,7 +35216,7 @@ async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, a
33849
35216
  };
33850
35217
  }
33851
35218
  const paragraphStyle = normalizeImportedParagraphStyle(
33852
- inheritedStyle ? { ...inheritedStyle, ...styleWithListIndent ?? {} } : styleWithListIndent
35219
+ styleWithListIndent
33853
35220
  );
33854
35221
  const dropCapFrame = parseDropCapFrame(paragraphProperties, runs);
33855
35222
  if (dropCapFrame) {
@@ -33893,8 +35260,7 @@ async function parseParagraphNode(paragraphNode, numberingMaps, zip, relsMap, as
33893
35260
  relsMap,
33894
35261
  assets,
33895
35262
  theme,
33896
- parseNestedBlocks,
33897
- inheritedStyle
35263
+ parseNestedBlocks
33898
35264
  );
33899
35265
  return parsed.paragraphs[0] ?? createEditorParagraphFromRuns([{ text: "" }]);
33900
35266
  }
@@ -33916,521 +35282,7 @@ function parseTableLook(tblPr) {
33916
35282
  noVBand: attr("noVBand") ?? bit(1024) ?? false
33917
35283
  };
33918
35284
  }
33919
- function resolveCellConditionalKeys(rowIndex, colIndex, rowCount, colCount, look, rowBandSize, colBandSize) {
33920
- const isFirstRow = look.firstRow && rowIndex === 0;
33921
- const isLastRow = look.lastRow && rowIndex === rowCount - 1 && rowIndex !== 0;
33922
- const isFirstCol = look.firstCol && colIndex === 0;
33923
- const isLastCol = look.lastCol && colIndex === colCount - 1 && colIndex !== 0;
33924
- const keys = [];
33925
- if (!look.noHBand && !isFirstRow && !isLastRow) {
33926
- const bodyRow = rowIndex - (look.firstRow ? 1 : 0);
33927
- const band = Math.floor(bodyRow / Math.max(1, rowBandSize)) % 2;
33928
- keys.push(band === 0 ? "band1Horz" : "band2Horz");
33929
- }
33930
- if (!look.noVBand && !isFirstCol && !isLastCol) {
33931
- const bodyCol = colIndex - (look.firstCol ? 1 : 0);
33932
- const band = Math.floor(bodyCol / Math.max(1, colBandSize)) % 2;
33933
- keys.push(band === 0 ? "band1Vert" : "band2Vert");
33934
- }
33935
- if (isLastCol) keys.push("lastCol");
33936
- if (isFirstCol) keys.push("firstCol");
33937
- if (isLastRow) keys.push("lastRow");
33938
- if (isFirstRow) keys.push("firstRow");
33939
- if (isFirstRow && isFirstCol) keys.push("nwCell");
33940
- if (isFirstRow && isLastCol) keys.push("neCell");
33941
- if (isLastRow && isFirstCol) keys.push("swCell");
33942
- if (isLastRow && isLastCol) keys.push("seCell");
33943
- return keys;
33944
- }
33945
- function mergeConditionalFormats(keys, conditionals) {
33946
- const merged = {};
33947
- if (!conditionals) {
33948
- return merged;
33949
- }
33950
- for (const key of keys) {
33951
- const cond = conditionals[key];
33952
- if (!cond) continue;
33953
- if (cond.shading) merged.shading = cond.shading;
33954
- if (cond.textStyle) {
33955
- merged.textStyle = { ...merged.textStyle, ...cond.textStyle };
33956
- }
33957
- if (cond.borders) {
33958
- merged.borders = { ...merged.borders, ...cond.borders };
33959
- }
33960
- if (cond.paragraphStyle) {
33961
- merged.paragraphStyle = {
33962
- ...merged.paragraphStyle,
33963
- ...cond.paragraphStyle
33964
- };
33965
- }
33966
- if (cond.rowStyle) {
33967
- merged.rowStyle = { ...merged.rowStyle, ...cond.rowStyle };
33968
- }
33969
- }
33970
- return merged;
33971
- }
33972
- function applyConditionalTextStyle(paragraphs, textStyle) {
33973
- if (!textStyle || Object.keys(textStyle).length === 0) {
33974
- return;
33975
- }
33976
- for (const paragraph of paragraphs) {
33977
- for (const run of paragraph.runs) {
33978
- run.styles = { ...textStyle, ...run.styles };
33979
- }
33980
- }
33981
- }
33982
- function tableStyleParagraphInheritance(tableStylePPr, paragraphStyleId, styles) {
33983
- if (!tableStylePPr) {
33984
- return void 0;
33985
- }
33986
- const effectiveStyleId = paragraphStyleId ?? resolveDefaultParagraphStyleId(styles);
33987
- const paragraphStyleDelta = resolveNamedParagraphStyle(
33988
- effectiveStyleId,
33989
- styles
33990
- );
33991
- const definedByParagraphStyle = new Set(Object.keys(paragraphStyleDelta));
33992
- const filtered = {};
33993
- for (const [key, value] of Object.entries(tableStylePPr)) {
33994
- if (!definedByParagraphStyle.has(key)) {
33995
- filtered[key] = value;
33996
- }
33997
- }
33998
- return emptyOrUndefined(filtered);
33999
- }
34000
- function parseDocxWidthValue(element) {
34001
- if (!element) {
34002
- return void 0;
34003
- }
34004
- const type = getAttributeValue(element, "type");
34005
- const raw = getAttributeValue(element, "w");
34006
- if (type === "auto") {
34007
- return "auto";
34008
- }
34009
- if (type === "pct") {
34010
- if (!raw) {
34011
- return void 0;
34012
- }
34013
- const pct = raw.trim().endsWith("%") ? Number.parseFloat(raw) : Number(raw) / 50;
34014
- return Number.isFinite(pct) ? `${Math.round(pct * 1e4) / 1e4}%` : void 0;
34015
- }
34016
- return twipsToPoints(raw);
34017
- }
34018
- function parsePositiveIntegerProperty(parent, localName) {
34019
- const element = getFirstChildByTagNameNS(parent, WORD_NS, localName);
34020
- const raw = getAttributeValue(element, "val");
34021
- const parsed = raw ? Number(raw) : Number.NaN;
34022
- return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : void 0;
34023
- }
34024
- function serializeChildXml(parent, localNames) {
34025
- if (!parent) {
34026
- return void 0;
34027
- }
34028
- const names = new Set(localNames);
34029
- const serializer = new XMLSerializer();
34030
- const result = [];
34031
- const children2 = parent.childNodes;
34032
- for (let index = 0; index < children2.length; index += 1) {
34033
- const node = children2[index];
34034
- if ((node == null ? void 0 : node.nodeType) === node.ELEMENT_NODE && node.namespaceURI === WORD_NS && names.has(node.localName ?? "")) {
34035
- result.push(serializer.serializeToString(node));
34036
- }
34037
- }
34038
- return result.length > 0 ? result : void 0;
34039
- }
34040
- function parseFloatingTableProperties(tblPr) {
34041
- const tblpPr = getFirstChildByTagNameNS(tblPr, WORD_NS, "tblpPr");
34042
- if (!tblpPr || !tblpPr.attributes || tblpPr.attributes.length === 0) {
34043
- return void 0;
34044
- }
34045
- const floating = {};
34046
- for (let index = 0; index < tblpPr.attributes.length; index += 1) {
34047
- const attr = tblpPr.attributes.item(index);
34048
- if ((attr == null ? void 0 : attr.namespaceURI) === WORD_NS || (attr == null ? void 0 : attr.prefix) === "w") {
34049
- floating[attr.localName || attr.name.replace(/^w:/, "")] = attr.value;
34050
- }
34051
- }
34052
- return Object.keys(floating).length > 0 ? floating : void 0;
34053
- }
34054
- function parseCellMargins(container) {
34055
- if (!container) {
34056
- return void 0;
34057
- }
34058
- const edgePt = (edge) => twipsToPoints(
34059
- getAttributeValue(getFirstChildByTagNameNS(container, WORD_NS, edge), "w")
34060
- );
34061
- const margins = {};
34062
- const top = edgePt("top");
34063
- const right = edgePt("right");
34064
- const bottom = edgePt("bottom");
34065
- const left = edgePt("left");
34066
- const start = edgePt("start");
34067
- const end = edgePt("end");
34068
- if (top !== void 0) margins.top = top;
34069
- if (right !== void 0) margins.right = right;
34070
- if (bottom !== void 0) margins.bottom = bottom;
34071
- if (left !== void 0) margins.left = left;
34072
- if (start !== void 0) margins.start = start;
34073
- if (end !== void 0) margins.end = end;
34074
- return Object.keys(margins).length > 0 ? margins : void 0;
34075
- }
34076
- function parseTableLayout(tblPr) {
34077
- const value = getAttributeValue(
34078
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblLayout"),
34079
- "type"
34080
- );
34081
- return value === "fixed" || value === "autofit" ? value : void 0;
34082
- }
34083
- function parseTableStyle(tblPr, tableStyleId) {
34084
- const style2 = {};
34085
- if (tableStyleId) {
34086
- style2.styleId = tableStyleId;
34087
- }
34088
- const altTitle = getAttributeValue(
34089
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCaption"),
34090
- "val"
34091
- );
34092
- if (altTitle) {
34093
- style2.altTitle = altTitle;
34094
- }
34095
- const altDescription = getAttributeValue(
34096
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblDescription"),
34097
- "val"
34098
- );
34099
- if (altDescription) {
34100
- style2.altDescription = altDescription;
34101
- }
34102
- const width = parseDocxWidthValue(
34103
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblW")
34104
- );
34105
- if (width !== void 0) {
34106
- style2.width = width;
34107
- }
34108
- const indentLeft = parseDocxWidthValue(
34109
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblInd")
34110
- );
34111
- if (indentLeft !== void 0) {
34112
- style2.indentLeft = indentLeft;
34113
- }
34114
- const jc = getAttributeValue(
34115
- getFirstChildByTagNameNS(tblPr, WORD_NS, "jc"),
34116
- "val"
34117
- );
34118
- if (jc === "left" || jc === "center" || jc === "right") {
34119
- style2.align = jc;
34120
- }
34121
- const layout = parseTableLayout(tblPr);
34122
- if (layout) {
34123
- style2.layout = layout;
34124
- }
34125
- const cellSpacing = parseDocxWidthValue(
34126
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCellSpacing")
34127
- );
34128
- if (cellSpacing !== void 0) {
34129
- style2.cellSpacing = cellSpacing;
34130
- }
34131
- const defaultCellMargins = parseCellMargins(
34132
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblCellMar")
34133
- );
34134
- if (defaultCellMargins) {
34135
- style2.defaultCellMargins = defaultCellMargins;
34136
- }
34137
- const bidiVisual = tblPr ? parseOnOffProperty(tblPr, "bidiVisual") : void 0;
34138
- if (bidiVisual !== void 0) {
34139
- style2.bidiVisual = bidiVisual;
34140
- }
34141
- const tblOverlap = getAttributeValue(
34142
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblOverlap"),
34143
- "val"
34144
- );
34145
- if (tblOverlap) {
34146
- style2.tblOverlap = tblOverlap;
34147
- }
34148
- const floating = parseFloatingTableProperties(tblPr);
34149
- if (floating) {
34150
- style2.floating = floating;
34151
- }
34152
- const revisionXml = serializeChildXml(tblPr, ["tblPrChange"]);
34153
- if (revisionXml) {
34154
- style2.revisionXml = revisionXml;
34155
- }
34156
- return emptyOrUndefined(style2);
34157
- }
34158
- function parseTableRowStyle(rowProperties) {
34159
- if (!rowProperties) {
34160
- return void 0;
34161
- }
34162
- const style2 = {};
34163
- const gridBefore = parsePositiveIntegerProperty(rowProperties, "gridBefore");
34164
- if (gridBefore !== void 0) {
34165
- style2.gridBefore = gridBefore;
34166
- }
34167
- const gridAfter = parsePositiveIntegerProperty(rowProperties, "gridAfter");
34168
- if (gridAfter !== void 0) {
34169
- style2.gridAfter = gridAfter;
34170
- }
34171
- const widthBefore = parseDocxWidthValue(
34172
- getFirstChildByTagNameNS(rowProperties, WORD_NS, "wBefore")
34173
- );
34174
- if (widthBefore !== void 0) {
34175
- style2.widthBefore = widthBefore;
34176
- }
34177
- const widthAfter = parseDocxWidthValue(
34178
- getFirstChildByTagNameNS(rowProperties, WORD_NS, "wAfter")
34179
- );
34180
- if (widthAfter !== void 0) {
34181
- style2.widthAfter = widthAfter;
34182
- }
34183
- const trHeight = getFirstChildByTagNameNS(rowProperties, WORD_NS, "trHeight");
34184
- const height = twipsToPoints(getAttributeValue(trHeight, "val"));
34185
- if (height !== void 0) {
34186
- style2.height = height;
34187
- }
34188
- const hRule = getAttributeValue(trHeight, "hRule");
34189
- if (hRule === "auto" || hRule === "exact" || hRule === "atLeast") {
34190
- style2.heightRule = hRule;
34191
- }
34192
- const cellSpacing = parseDocxWidthValue(
34193
- getFirstChildByTagNameNS(rowProperties, WORD_NS, "tblCellSpacing")
34194
- );
34195
- if (cellSpacing !== void 0) {
34196
- style2.cellSpacing = cellSpacing;
34197
- }
34198
- const cantSplit = parseOnOffProperty(rowProperties, "cantSplit");
34199
- if (cantSplit !== void 0) {
34200
- style2.cantSplit = cantSplit;
34201
- }
34202
- const hidden = parseOnOffProperty(rowProperties, "hidden");
34203
- if (hidden !== void 0) {
34204
- style2.hidden = hidden;
34205
- }
34206
- const revisionXml = serializeChildXml(rowProperties, [
34207
- "trPrChange",
34208
- "ins",
34209
- "del"
34210
- ]);
34211
- if (revisionXml) {
34212
- style2.revisionXml = revisionXml;
34213
- }
34214
- return emptyOrUndefined(style2);
34215
- }
34216
- function getTableCellColSpan(cellProperties) {
34217
- if (!cellProperties) {
34218
- return 1;
34219
- }
34220
- const gridSpan = getFirstChildByTagNameNS(
34221
- cellProperties,
34222
- WORD_NS,
34223
- "gridSpan"
34224
- );
34225
- const value = getAttributeValue(gridSpan, "val");
34226
- const parsed = value ? Number(value) : 1;
34227
- return Number.isFinite(parsed) && parsed > 1 ? Math.floor(parsed) : 1;
34228
- }
34229
- function getTableCellVMerge(cellProperties) {
34230
- if (!cellProperties) {
34231
- return void 0;
34232
- }
34233
- const vMerge = getFirstChildByTagNameNS(cellProperties, WORD_NS, "vMerge");
34234
- if (!vMerge) {
34235
- return void 0;
34236
- }
34237
- const value = getAttributeValue(vMerge, "val");
34238
- return value === "restart" ? "restart" : "continue";
34239
- }
34240
- function parseTableCellVerticalAlign(cellProperties) {
34241
- if (!cellProperties) {
34242
- return void 0;
34243
- }
34244
- const vAlign = getFirstChildByTagNameNS(cellProperties, WORD_NS, "vAlign");
34245
- const value = getAttributeValue(vAlign, "val");
34246
- if (value === "top" || value === "bottom") {
34247
- return value;
34248
- }
34249
- if (value === "center") {
34250
- return "middle";
34251
- }
34252
- return void 0;
34253
- }
34254
- function parseTableCellBorders(cellProperties) {
34255
- if (!cellProperties) {
34256
- return {};
34257
- }
34258
- return parseDocxBoxBorders(
34259
- getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcBorders")
34260
- );
34261
- }
34262
- function parseTableCellStyle(cellProperties, tableDefaultMargins) {
34263
- if (!cellProperties) {
34264
- if (!tableDefaultMargins) {
34265
- return void 0;
34266
- }
34267
- return emptyOrUndefined({
34268
- paddingTop: tableDefaultMargins.top,
34269
- paddingRight: tableDefaultMargins.right,
34270
- paddingBottom: tableDefaultMargins.bottom,
34271
- paddingLeft: tableDefaultMargins.left,
34272
- paddingStart: tableDefaultMargins.start,
34273
- paddingEnd: tableDefaultMargins.end
34274
- });
34275
- }
34276
- const style2 = {
34277
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.top) !== void 0 ? { paddingTop: tableDefaultMargins.top } : {},
34278
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.right) !== void 0 ? { paddingRight: tableDefaultMargins.right } : {},
34279
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.bottom) !== void 0 ? { paddingBottom: tableDefaultMargins.bottom } : {},
34280
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.left) !== void 0 ? { paddingLeft: tableDefaultMargins.left } : {},
34281
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.start) !== void 0 ? { paddingStart: tableDefaultMargins.start } : {},
34282
- ...(tableDefaultMargins == null ? void 0 : tableDefaultMargins.end) !== void 0 ? { paddingEnd: tableDefaultMargins.end } : {}
34283
- };
34284
- const shading = getFirstChildByTagNameNS(cellProperties, WORD_NS, "shd");
34285
- const fill = parseShdFill(shading);
34286
- if (fill) {
34287
- style2.shading = fill;
34288
- }
34289
- const cellWidth = getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcW");
34290
- const cellWidthType = getAttributeValue(cellWidth, "type");
34291
- const cellWidthValue = getAttributeValue(cellWidth, "w");
34292
- if (cellWidthType === "dxa") {
34293
- const width = twipsToPoints(cellWidthValue);
34294
- if (width !== void 0) {
34295
- style2.width = width;
34296
- }
34297
- } else if (cellWidthType === "pct" && cellWidthValue) {
34298
- const pct = Number(cellWidthValue);
34299
- if (Number.isFinite(pct)) {
34300
- style2.width = `${Math.round(pct / 50 * 1e4) / 1e4}%`;
34301
- }
34302
- }
34303
- const tcMar = parseCellMargins(
34304
- getFirstChildByTagNameNS(cellProperties, WORD_NS, "tcMar")
34305
- );
34306
- if (tcMar) {
34307
- if (tcMar.top !== void 0) style2.paddingTop = tcMar.top;
34308
- if (tcMar.bottom !== void 0) style2.paddingBottom = tcMar.bottom;
34309
- if (tcMar.left !== void 0) style2.paddingLeft = tcMar.left;
34310
- if (tcMar.right !== void 0) style2.paddingRight = tcMar.right;
34311
- if (tcMar.start !== void 0) style2.paddingStart = tcMar.start;
34312
- if (tcMar.end !== void 0) style2.paddingEnd = tcMar.end;
34313
- }
34314
- const verticalAlign = parseTableCellVerticalAlign(cellProperties);
34315
- if (verticalAlign) {
34316
- style2.verticalAlign = verticalAlign;
34317
- }
34318
- const textDirection = parseTextDirection(
34319
- getAttributeValue(
34320
- getFirstChildByTagNameNS(cellProperties, WORD_NS, "textDirection"),
34321
- "val"
34322
- )
34323
- );
34324
- if (textDirection) {
34325
- style2.textDirection = textDirection;
34326
- }
34327
- const noWrap = parseOnOffProperty(cellProperties, "noWrap");
34328
- if (noWrap !== void 0) {
34329
- style2.noWrap = noWrap;
34330
- }
34331
- const fitText = parseOnOffProperty(cellProperties, "tcFitText");
34332
- if (fitText !== void 0) {
34333
- style2.fitText = fitText;
34334
- }
34335
- const hideMark = parseOnOffProperty(cellProperties, "hideMark");
34336
- if (hideMark !== void 0) {
34337
- style2.hideMark = hideMark;
34338
- }
34339
- const headers = getAttributeValue(
34340
- getFirstChildByTagNameNS(cellProperties, WORD_NS, "headers"),
34341
- "val"
34342
- );
34343
- if (headers) {
34344
- style2.headers = headers;
34345
- }
34346
- const revisionXml = serializeChildXml(cellProperties, [
34347
- "tcPrChange",
34348
- "cellIns",
34349
- "cellDel",
34350
- "cellMerge"
34351
- ]);
34352
- if (revisionXml) {
34353
- style2.revisionXml = revisionXml;
34354
- }
34355
- for (const [key, border] of Object.entries(
34356
- parseTableCellBorders(cellProperties)
34357
- )) {
34358
- if (border) {
34359
- style2[key] = border;
34360
- }
34361
- }
34362
- return emptyOrUndefined(style2);
34363
- }
34364
- function isTableHeaderRow(rowNode) {
34365
- const rowProperties = getFirstChildByTagNameNS(rowNode, WORD_NS, "trPr");
34366
- return rowProperties ? parseOnOffProperty(rowProperties, "tblHeader") === true : false;
34367
- }
34368
- function collapseCellAutospacing(paragraphs, flags) {
34369
- var _a, _b;
34370
- const styleOf = (paragraph) => paragraph.style ?? (paragraph.style = {});
34371
- const lastIndex = paragraphs.length - 1;
34372
- for (let index = 0; index < paragraphs.length; index += 1) {
34373
- const flag = flags[index];
34374
- if (!flag) {
34375
- continue;
34376
- }
34377
- if (index === 0 && flag.before) {
34378
- styleOf(paragraphs[index]).spacingBefore = 0;
34379
- }
34380
- if (index === lastIndex && flag.after) {
34381
- styleOf(paragraphs[index]).spacingAfter = 0;
34382
- }
34383
- }
34384
- for (let index = 0; index < lastIndex; index += 1) {
34385
- if (!((_a = flags[index]) == null ? void 0 : _a.after) || !((_b = flags[index + 1]) == null ? void 0 : _b.before)) {
34386
- continue;
34387
- }
34388
- const prev = styleOf(paragraphs[index]);
34389
- const next = styleOf(paragraphs[index + 1]);
34390
- if ((prev.spacingAfter ?? 0) >= (next.spacingBefore ?? 0)) {
34391
- next.spacingBefore = 0;
34392
- } else {
34393
- prev.spacingAfter = 0;
34394
- }
34395
- }
34396
- }
34397
- function applyTableBordersToRows(rows, tblBorders) {
34398
- if (Object.keys(tblBorders).length === 0) {
34399
- return;
34400
- }
34401
- const lastRowIndex = rows.length - 1;
34402
- for (let rowIndex = 0; rowIndex <= lastRowIndex; rowIndex += 1) {
34403
- const row = rows[rowIndex];
34404
- const lastColIndex = row.cells.length - 1;
34405
- for (let colIndex = 0; colIndex <= lastColIndex; colIndex += 1) {
34406
- const cell = row.cells[colIndex];
34407
- const style2 = cell.style ?? {};
34408
- if (rowIndex === 0 && style2.borderTop === void 0 && tblBorders.borderTop) {
34409
- style2.borderTop = tblBorders.borderTop;
34410
- }
34411
- if (rowIndex === lastRowIndex && style2.borderBottom === void 0 && tblBorders.borderBottom) {
34412
- style2.borderBottom = tblBorders.borderBottom;
34413
- }
34414
- if (colIndex === 0 && style2.borderLeft === void 0 && tblBorders.borderLeft) {
34415
- style2.borderLeft = tblBorders.borderLeft;
34416
- }
34417
- if (colIndex === lastColIndex && style2.borderRight === void 0 && tblBorders.borderRight) {
34418
- style2.borderRight = tblBorders.borderRight;
34419
- }
34420
- if (rowIndex < lastRowIndex && style2.borderBottom === void 0 && tblBorders.borderInsideH) {
34421
- style2.borderBottom = tblBorders.borderInsideH;
34422
- }
34423
- if (colIndex < lastColIndex && style2.borderRight === void 0 && tblBorders.borderInsideV) {
34424
- style2.borderRight = tblBorders.borderInsideV;
34425
- }
34426
- if (Object.keys(style2).length > 0 && cell.style !== style2) {
34427
- cell.style = style2;
34428
- }
34429
- }
34430
- }
34431
- }
34432
- async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, theme, parseNestedBlocks, styles) {
34433
- var _a, _b;
35285
+ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, theme, parseNestedBlocks, _styles) {
34434
35286
  const gridCols = [];
34435
35287
  const tblGrid = getFirstChildByTagNameNS(tableNode, WORD_NS, "tblGrid");
34436
35288
  if (tblGrid) {
@@ -34452,39 +35304,14 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34452
35304
  getFirstChildByTagNameNS(tblPr, WORD_NS, "tblStyle"),
34453
35305
  "val"
34454
35306
  );
34455
- const inheritedParagraphStyle = tableStyleId && ((_a = styles == null ? void 0 : styles[tableStyleId]) == null ? void 0 : _a.paragraphStyle) ? styles[tableStyleId].paragraphStyle : void 0;
34456
- const tblBorders = parseDocxTableBorders(
34457
- getFirstChildByTagNameNS(tblPr, WORD_NS, "tblBorders")
34458
- );
34459
- const tableStyleDef = tableStyleId ? (_b = styles == null ? void 0 : styles[tableStyleId]) == null ? void 0 : _b.tableStyle : void 0;
34460
35307
  const directTableStyle = parseTableStyle(tblPr, tableStyleId ?? void 0);
34461
- const tableDefaultMargins = directTableStyle == null ? void 0 : directTableStyle.defaultCellMargins;
34462
- const tblConditionals = (tableStyleDef == null ? void 0 : tableStyleDef.conditionalFormats) ?? void 0;
34463
35308
  const look = parseTableLook(tblPr);
34464
- const rowBandSize = (tableStyleDef == null ? void 0 : tableStyleDef.rowBandSize) ?? 1;
34465
- const colBandSize = (tableStyleDef == null ? void 0 : tableStyleDef.colBandSize) ?? 1;
34466
35309
  const rowNodes = getChildrenByTagNameNS(tableNode, WORD_NS, "tr");
34467
- const rowCount = rowNodes.length;
34468
- const colCount = gridCols.length > 0 ? gridCols.length : rowNodes.reduce(
34469
- (max, node) => Math.max(max, getChildrenByTagNameNS(node, WORD_NS, "tc").length),
34470
- 0
34471
- );
34472
35310
  const rows = [];
34473
35311
  for (let rowIndex = 0; rowIndex < rowNodes.length; rowIndex += 1) {
34474
35312
  const rowNode = rowNodes[rowIndex];
34475
35313
  const rowProperties = getFirstChildByTagNameNS(rowNode, WORD_NS, "trPr");
34476
- const cnfStyle = getFirstChildByTagNameNS(
34477
- rowProperties,
34478
- WORD_NS,
34479
- "cnfStyle"
34480
- );
34481
- const explicitRowKeys = [];
34482
- if (getAttributeValue(cnfStyle, "firstRow") === "1") {
34483
- explicitRowKeys.push("firstRow");
34484
- }
34485
- if (getAttributeValue(cnfStyle, "lastRow") === "1") {
34486
- explicitRowKeys.push("lastRow");
34487
- }
35314
+ const rowConditionalStyle = parseTableConditionalFlags(rowProperties);
34488
35315
  const cellNodes = getChildrenByTagNameNS(rowNode, WORD_NS, "tc");
34489
35316
  const cells = [];
34490
35317
  for (let colIndex = 0; colIndex < cellNodes.length; colIndex += 1) {
@@ -34501,19 +35328,6 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34501
35328
  WORD_NS,
34502
35329
  "p"
34503
35330
  )) {
34504
- const paragraphStyleId = getAttributeValue(
34505
- getFirstChildByTagNameNS(
34506
- getFirstChildByTagNameNS(paragraphNode, WORD_NS, "pPr"),
34507
- WORD_NS,
34508
- "pStyle"
34509
- ),
34510
- "val"
34511
- ) ?? void 0;
34512
- const cellInheritedStyle = tableStyleParagraphInheritance(
34513
- inheritedParagraphStyle,
34514
- paragraphStyleId,
34515
- styles
34516
- );
34517
35331
  paragraphs.push(
34518
35332
  await parseParagraphNode(
34519
35333
  paragraphNode,
@@ -34522,8 +35336,7 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34522
35336
  relsMap,
34523
35337
  assets,
34524
35338
  theme,
34525
- parseNestedBlocks,
34526
- cellInheritedStyle
35339
+ parseNestedBlocks
34527
35340
  )
34528
35341
  );
34529
35342
  autospacingFlags.push(
@@ -34535,55 +35348,14 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34535
35348
  collapseCellAutospacing(paragraphs, autospacingFlags);
34536
35349
  const colSpan = getTableCellColSpan(cellProperties);
34537
35350
  const vMerge = getTableCellVMerge(cellProperties);
34538
- const cellStyle = parseTableCellStyle(cellProperties, tableDefaultMargins);
34539
- const conditional = mergeConditionalFormats(
34540
- [
34541
- ...resolveCellConditionalKeys(
34542
- rowIndex,
34543
- colIndex,
34544
- rowCount,
34545
- colCount,
34546
- look,
34547
- rowBandSize,
34548
- colBandSize
34549
- ),
34550
- ...explicitRowKeys
34551
- ],
34552
- tblConditionals
34553
- );
34554
- applyConditionalTextStyle(paragraphs, conditional.textStyle);
34555
- if (conditional.paragraphStyle) {
34556
- const condPStyle = conditional.paragraphStyle;
34557
- for (const paragraph of paragraphs) {
34558
- paragraph.style = { ...condPStyle, ...paragraph.style };
34559
- }
34560
- }
35351
+ const cellStyle = parseTableCellStyle(cellProperties);
34561
35352
  const cell = createEditorTableCell(
34562
35353
  paragraphs.length > 0 ? paragraphs : [createEditorParagraphFromRuns([{ text: "" }])],
34563
35354
  colSpan,
34564
35355
  vMerge === "restart" ? { rowSpan: 1, vMerge } : vMerge ? { vMerge } : void 0
34565
35356
  );
34566
- const mergedStyle = { ...cellStyle ?? {} };
34567
- const resolvedShading = (cellStyle == null ? void 0 : cellStyle.shading) ?? conditional.shading;
34568
- if (resolvedShading) {
34569
- mergedStyle.shading = resolvedShading;
34570
- }
34571
- if (conditional.borders) {
34572
- for (const edge of [
34573
- "borderTop",
34574
- "borderRight",
34575
- "borderBottom",
34576
- "borderLeft"
34577
- ]) {
34578
- const border = conditional.borders[edge];
34579
- if (mergedStyle[edge] === void 0 && border) {
34580
- mergedStyle[edge] = border;
34581
- }
34582
- }
34583
- }
34584
- if (Object.keys(mergedStyle).length > 0) {
34585
- cell.style = mergedStyle;
34586
- }
35357
+ if (cellStyle) cell.style = cellStyle;
35358
+ cell.conditionalStyle = parseTableConditionalFlags(cellProperties);
34587
35359
  if (vMerge === "continue") {
34588
35360
  cell.blocks = [];
34589
35361
  }
@@ -34597,33 +35369,13 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34597
35369
  if (rowStyle) {
34598
35370
  row.style = rowStyle;
34599
35371
  }
34600
- if (tblConditionals) {
34601
- const rowKeys = resolveCellConditionalKeys(
34602
- rowIndex,
34603
- 0,
34604
- rowCount,
34605
- Math.max(1, colCount),
34606
- look,
34607
- rowBandSize,
34608
- colBandSize
34609
- ).filter(
34610
- (k) => k === "firstRow" || k === "lastRow" || k === "band1Horz" || k === "band2Horz"
34611
- );
34612
- const mergedRowConditional = mergeConditionalFormats(
34613
- [...explicitRowKeys, ...rowKeys],
34614
- tblConditionals
34615
- );
34616
- if (mergedRowConditional.rowStyle) {
34617
- row.style = { ...mergedRowConditional.rowStyle, ...row.style };
34618
- }
34619
- }
35372
+ row.conditionalStyle = rowConditionalStyle;
34620
35373
  const tblPrEx = getFirstChildByTagNameNS(rowNode, WORD_NS, "tblPrEx");
34621
35374
  if (tblPrEx) {
34622
35375
  row.tblPrExXml = new XMLSerializer().serializeToString(tblPrEx);
34623
35376
  }
34624
35377
  rows.push(row);
34625
35378
  }
34626
- applyTableBordersToRows(rows, tblBorders);
34627
35379
  for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
34628
35380
  const row = rows[rowIndex];
34629
35381
  for (let cellIndex = 0; cellIndex < row.cells.length; cellIndex += 1) {
@@ -34657,9 +35409,21 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
34657
35409
  table.style = { tblLook: look };
34658
35410
  }
34659
35411
  if (tblGridChangeXml) {
34660
- table.tblGridChangeXml = new XMLSerializer().serializeToString(
34661
- tblGridChangeXml
35412
+ const previousGrid = getFirstChildByTagNameNS(
35413
+ tblGridChangeXml,
35414
+ WORD_NS,
35415
+ "tblGrid"
34662
35416
  );
35417
+ const previous = previousGrid ? getChildrenByTagNameNS(previousGrid, WORD_NS, "gridCol").map((gridCol) => twipsToPoints(getAttributeValue(gridCol, "w"))).filter((width) => width !== void 0) : [];
35418
+ const rawDate = getAttributeValue(tblGridChangeXml, "date");
35419
+ const parsedDate = rawDate ? Date.parse(rawDate) : Number.NaN;
35420
+ table.gridRevision = {
35421
+ id: getAttributeValue(tblGridChangeXml, "id") ?? "revision:grid",
35422
+ author: getAttributeValue(tblGridChangeXml, "author") ?? "Unknown",
35423
+ date: Number.isFinite(parsedDate) ? parsedDate : 0,
35424
+ type: "grid",
35425
+ previous
35426
+ };
34663
35427
  }
34664
35428
  return table;
34665
35429
  }
@@ -34764,8 +35528,7 @@ async function parseHeaderFooterXml(xmlContent, numberingMaps, zip, relsMap, ass
34764
35528
  relsMap,
34765
35529
  assets,
34766
35530
  theme,
34767
- parseNestedBlocks,
34768
- styles
35531
+ parseNestedBlocks
34769
35532
  )
34770
35533
  );
34771
35534
  }
@@ -34833,8 +35596,7 @@ async function parseDocxNotesXml(kind, xmlContent, numberingMaps, zip, relsMap,
34833
35596
  relsMap,
34834
35597
  assets,
34835
35598
  theme,
34836
- parseNestedBlocks,
34837
- styles
35599
+ parseNestedBlocks
34838
35600
  )
34839
35601
  );
34840
35602
  }
@@ -34875,8 +35637,7 @@ async function parseFootnotesXml(xmlContent, numberingMaps, zip, relsMap, assets
34875
35637
  zip,
34876
35638
  relsMap,
34877
35639
  assets,
34878
- theme,
34879
- styles
35640
+ theme
34880
35641
  );
34881
35642
  return {
34882
35643
  byDocxId: parsed.byDocxId,
@@ -34893,8 +35654,7 @@ async function parseEndnotesXml(xmlContent, numberingMaps, zip, relsMap, assets,
34893
35654
  zip,
34894
35655
  relsMap,
34895
35656
  assets,
34896
- theme,
34897
- styles
35657
+ theme
34898
35658
  );
34899
35659
  return {
34900
35660
  byDocxId: parsed.byDocxId,
@@ -35273,8 +36033,7 @@ async function importDocxToEditorDocument(buffer, options = {}) {
35273
36033
  relsMap,
35274
36034
  assets,
35275
36035
  theme,
35276
- parseNestedBlocks,
35277
- importedStyles
36036
+ parseNestedBlocks
35278
36037
  )
35279
36038
  );
35280
36039
  reportBodyProgress();
@@ -35342,8 +36101,7 @@ async function importDocxToEditorDocument(buffer, options = {}) {
35342
36101
  zip,
35343
36102
  partRelsMap,
35344
36103
  assets,
35345
- theme,
35346
- importedStyles
36104
+ theme
35347
36105
  );
35348
36106
  applyDocGridLinePitch(
35349
36107
  partBlocks,
@@ -35403,8 +36161,7 @@ async function importDocxToEditorDocument(buffer, options = {}) {
35403
36161
  zip,
35404
36162
  footnotesPartRels,
35405
36163
  assets,
35406
- theme,
35407
- importedStyles
36164
+ theme
35408
36165
  );
35409
36166
  if (docSettings.footnoteSettings) {
35410
36167
  parsedFootnotes.footnotes.settings = docSettings.footnoteSettings;
@@ -35419,8 +36176,7 @@ async function importDocxToEditorDocument(buffer, options = {}) {
35419
36176
  zip,
35420
36177
  endnotesPartRels,
35421
36178
  assets,
35422
- theme,
35423
- importedStyles
36179
+ theme
35424
36180
  );
35425
36181
  if (docSettings.endnoteSettings) {
35426
36182
  parsedEndnotes.endnotes.settings = docSettings.endnoteSettings;
@@ -35633,7 +36389,7 @@ function importDocxInWorker(buffer, options = {}) {
35633
36389
  const worker = new Worker(
35634
36390
  new URL(
35635
36391
  /* @vite-ignore */
35636
- "" + new URL("assets/importDocxWorker-C94l6-O5.js", import.meta.url).href,
36392
+ "" + new URL("assets/importDocxWorker-DVDyiqYf.js", import.meta.url).href,
35637
36393
  import.meta.url
35638
36394
  ),
35639
36395
  {
@@ -38451,7 +39207,7 @@ function LineSpacingDialog(props) {
38451
39207
  const num = Number(value);
38452
39208
  return Number.isFinite(num) ? num : null;
38453
39209
  };
38454
- const previewStyle = createMemo(() => {
39210
+ const previewStyle2 = createMemo(() => {
38455
39211
  const lh = parseNumber(lineHeight());
38456
39212
  return {
38457
39213
  "line-height": lh !== null && lh > 0 ? String(lh) : void 0
@@ -38509,7 +39265,7 @@ function LineSpacingDialog(props) {
38509
39265
  insert(_el$11, () => t("lineSpacing.preview"));
38510
39266
  insert(_el$12, () => t("lineSpacing.previewText"), _el$13);
38511
39267
  insert(_el$12, () => t("lineSpacing.previewText"), null);
38512
- createRenderEffect((_$p) => style(_el$12, previewStyle(), _$p));
39268
+ createRenderEffect((_$p) => style(_el$12, previewStyle2(), _$p));
38513
39269
  return _el$10;
38514
39270
  })()];
38515
39271
  }
@@ -39263,7 +40019,6 @@ const fontSizeOptions = (api) => {
39263
40019
  if (Number.isFinite(current) && current > 0) values.add(current);
39264
40020
  return Array.from(values).sort((a, b) => a - b).map((n) => ({ value: String(n), label: String(n) }));
39265
40021
  };
39266
- const styleOptions = (api) => documentStyles(api).map((s) => ({ value: s.id, label: s.name }));
39267
40022
  const ALIGN_BUTTONS = [
39268
40023
  {
39269
40024
  command: "alignLeft",
@@ -39455,13 +40210,14 @@ function createDefaultToolbarPreset(t) {
39455
40210
  });
39456
40211
  items.push({ type: "separator", id: "sep-history" });
39457
40212
  items.push({
39458
- type: "select",
40213
+ type: "styleGallery",
39459
40214
  id: "editor-toolbar-style",
39460
40215
  testId: "editor-toolbar-style",
39461
- width: "wide",
39462
40216
  tooltipKey: "toolbar.style",
39463
- command: "setStyleId",
39464
- options: styleOptions
40217
+ ribbonSize: "large",
40218
+ styles: documentStyles,
40219
+ paragraphCommand: "setStyleId",
40220
+ characterCommand: "setCharacterStyleId"
39465
40221
  });
39466
40222
  items.push({
39467
40223
  type: "select",
@@ -39998,7 +40754,7 @@ export {
39998
40754
  createRenderEffect as Z,
39999
40755
  style as _,
40000
40756
  assertNever as a,
40001
- defaultFontDecoderRegistry as a$,
40757
+ loadFontAsset as a$,
40002
40758
  setStyleProperty as a0,
40003
40759
  memo as a1,
40004
40760
  template as a2,
@@ -40018,24 +40774,24 @@ export {
40018
40774
  getPresetPathSegments as aG,
40019
40775
  projectBlocksLayout as aH,
40020
40776
  buildListLabels as aI,
40021
- textStyleToFontSizePt as aJ,
40022
- PX_PER_POINT as aK,
40023
- DEFAULT_FONT_SIZE_PX as aL,
40024
- isDoubleUnderlineStyle as aM,
40025
- isWavyUnderlineStyle as aN,
40026
- underlineStyleLineWidthPx as aO,
40027
- underlineStyleDashArray as aP,
40028
- resolveListLabel as aQ,
40029
- getListLabelInset as aR,
40030
- getAlignedListLabelInset as aS,
40031
- getParagraphBorderInsets as aT,
40032
- buildSegmentTable as aU,
40033
- buildCanvasTableLayout as aV,
40034
- normalizeFamily as aW,
40035
- ROBOTO_FONT_FILES as aX,
40036
- loadFontAsset as aY,
40037
- OFFICE_COMPAT_FONT_FAMILIES as aZ,
40038
- buildSfnt as a_,
40777
+ getImageFloatingGeometry as aJ,
40778
+ textStyleToFontSizePt as aK,
40779
+ PX_PER_POINT as aL,
40780
+ DEFAULT_FONT_SIZE_PX as aM,
40781
+ isDoubleUnderlineStyle as aN,
40782
+ isWavyUnderlineStyle as aO,
40783
+ underlineStyleLineWidthPx as aP,
40784
+ underlineStyleDashArray as aQ,
40785
+ resolveListLabel as aR,
40786
+ getListLabelInset as aS,
40787
+ getAlignedListLabelInset as aT,
40788
+ getParagraphBorderInsets as aU,
40789
+ buildSegmentTable as aV,
40790
+ buildCanvasTableLayout as aW,
40791
+ resolveCanvasTableWidth as aX,
40792
+ resolveFloatingTableRect as aY,
40793
+ normalizeFamily as aZ,
40794
+ ROBOTO_FONT_FILES as a_,
40039
40795
  className as aa,
40040
40796
  For as ab,
40041
40797
  UNDERLINE_STYLE_OPTIONS as ac,
@@ -40063,107 +40819,112 @@ export {
40063
40819
  getRunFieldChar as ay,
40064
40820
  getRunFieldInstruction as az,
40065
40821
  createEditorStateFromDocument as b,
40066
- createTranslator as b$,
40067
- SfntFontProgram as b0,
40068
- collectPdfFontFamilies as b1,
40069
- projectDocumentLayout as b2,
40070
- getPageContentWidth as b3,
40071
- getPageHeaderZoneTop as b4,
40072
- getPageBodyTop as b5,
40073
- getPageColumnRects as b6,
40074
- findFootnoteReference as b7,
40075
- FOOTNOTE_MARKER_GUTTER_PX as b8,
40076
- resolveImporterForFile as b9,
40077
- createFootnoteReferenceRun as bA,
40078
- renumberFootnotes as bB,
40079
- getFootnoteDisplayMarker as bC,
40080
- getHeadingLevel as bD,
40081
- preciseFontModeVersion as bE,
40082
- isPreciseFontModeEnabled as bF,
40083
- togglePreciseFontMode as bG,
40084
- nextFontSizePt as bH,
40085
- previousFontSizePt as bI,
40086
- fontSizePtToPx as bJ,
40087
- createDefaultToolbarPreset as bK,
40088
- MenuRegistry as bL,
40089
- createToolbarRegistry as bM,
40090
- Editor as bN,
40091
- resolveCommandRef as bO,
40092
- commandRefName as bP,
40093
- createOasisEditorClient as bQ,
40094
- createEditorZoom as bR,
40095
- startLongTaskObserver as bS,
40096
- installGlobalReport as bT,
40097
- applyStoredPreciseFontPreference as bU,
40098
- getWelcomeSeen as bV,
40099
- isLocalFontAccessSupported as bW,
40100
- EDITOR_SCROLL_PADDING_PX as bX,
40101
- Toolbar as bY,
40102
- OasisEditorLoading as bZ,
40103
- I18nProvider as b_,
40104
- getDocumentSectionsCanonical as ba,
40105
- getDocumentParagraphsCanonical as bb,
40106
- getDocumentParagraphs as bc,
40107
- getDocumentPageSettings as bd,
40108
- getTableCellContentWidthForParagraph as be,
40109
- on as bf,
40110
- debounce as bg,
40111
- unwrap as bh,
40112
- perfTimer as bi,
40113
- getRunTextBox as bj,
40114
- createEditorDocument as bk,
40115
- resolveResizedDimensions as bl,
40116
- resolveTextBoxRenderHeight as bm,
40117
- getToolbarStyleState as bn,
40118
- getCachedCanvasImage as bo,
40119
- measureParagraphMinContentWidthPx as bp,
40120
- getEditableBlocksForZone as bq,
40121
- findParagraphLocation as br,
40122
- createSectionBoundaryParagraph as bs,
40123
- normalizePageSettings as bt,
40124
- DEFAULT_EDITOR_PAGE_SETTINGS as bu,
40125
- markStart as bv,
40126
- markEnd as bw,
40127
- getParagraphEntries as bx,
40128
- getParagraphById as by,
40129
- createEditorFootnote as bz,
40822
+ EDITOR_SCROLL_PADDING_PX as b$,
40823
+ OFFICE_COMPAT_FONT_FAMILIES as b0,
40824
+ buildSfnt as b1,
40825
+ defaultFontDecoderRegistry as b2,
40826
+ SfntFontProgram as b3,
40827
+ collectPdfFontFamilies as b4,
40828
+ projectDocumentLayout as b5,
40829
+ getPageContentWidth as b6,
40830
+ getPageHeaderZoneTop as b7,
40831
+ getPageBodyTop as b8,
40832
+ getPageColumnRects as b9,
40833
+ getParagraphEntries as bA,
40834
+ getParagraphById as bB,
40835
+ createEditorFootnote as bC,
40836
+ createFootnoteReferenceRun as bD,
40837
+ renumberFootnotes as bE,
40838
+ getFootnoteDisplayMarker as bF,
40839
+ getHeadingLevel as bG,
40840
+ preciseFontModeVersion as bH,
40841
+ isPreciseFontModeEnabled as bI,
40842
+ resolveNamedTextStyle as bJ,
40843
+ togglePreciseFontMode as bK,
40844
+ nextFontSizePt as bL,
40845
+ previousFontSizePt as bM,
40846
+ fontSizePtToPx as bN,
40847
+ createDefaultToolbarPreset as bO,
40848
+ MenuRegistry as bP,
40849
+ createToolbarRegistry as bQ,
40850
+ Editor as bR,
40851
+ resolveCommandRef as bS,
40852
+ commandRefName as bT,
40853
+ createOasisEditorClient as bU,
40854
+ createEditorZoom as bV,
40855
+ startLongTaskObserver as bW,
40856
+ installGlobalReport as bX,
40857
+ applyStoredPreciseFontPreference as bY,
40858
+ getWelcomeSeen as bZ,
40859
+ isLocalFontAccessSupported as b_,
40860
+ findFootnoteReference as ba,
40861
+ FOOTNOTE_MARKER_GUTTER_PX as bb,
40862
+ resolveImporterForFile as bc,
40863
+ getDocumentSectionsCanonical as bd,
40864
+ getDocumentParagraphsCanonical as be,
40865
+ getDocumentParagraphs as bf,
40866
+ getDocumentPageSettings as bg,
40867
+ getTableCellContentWidthForParagraph as bh,
40868
+ on as bi,
40869
+ debounce as bj,
40870
+ unwrap as bk,
40871
+ perfTimer as bl,
40872
+ getRunTextBox as bm,
40873
+ createEditorDocument as bn,
40874
+ resolveResizedDimensions as bo,
40875
+ resolveTextBoxRenderHeight as bp,
40876
+ getToolbarStyleState as bq,
40877
+ getCachedCanvasImage as br,
40878
+ measureParagraphMinContentWidthPx as bs,
40879
+ getEditableBlocksForZone as bt,
40880
+ findParagraphLocation as bu,
40881
+ createSectionBoundaryParagraph as bv,
40882
+ normalizePageSettings as bw,
40883
+ DEFAULT_EDITOR_PAGE_SETTINGS as bx,
40884
+ markStart as by,
40885
+ markEnd as bz,
40130
40886
  createSignal as c,
40131
- createEditorLogger as c0,
40132
- registerDomStatsSurface as c1,
40133
- Button as c2,
40134
- Checkbox as c3,
40135
- ColorPicker as c4,
40136
- CommandRegistry as c5,
40137
- DEFAULT_PALETTE as c6,
40138
- DialogFooter as c7,
40139
- FloatingActionButton as c8,
40140
- GridPicker as c9,
40141
- IconButton as ca,
40142
- Menu as cb,
40143
- OASIS_BUILTIN_COMMANDS as cc,
40144
- OASIS_MENU_ITEMS as cd,
40145
- OASIS_TOOLBAR_ITEMS as ce,
40146
- OasisEditorAppLazy as cf,
40147
- OasisEditorContainer as cg,
40148
- PluginCollection as ch,
40149
- Popover as ci,
40150
- RIBBON_TABS as cj,
40151
- Select as ck,
40152
- SelectField as cl,
40153
- Separator as cm,
40154
- SidePanel as cn,
40155
- SidePanelBody as co,
40156
- SidePanelFooter as cp,
40157
- SidePanelHeader as cq,
40158
- SplitButton as cr,
40159
- TextField as cs,
40160
- Button$1 as ct,
40161
- buildRibbonTabDefinitions as cu,
40162
- createEditorCommandBus as cv,
40163
- createOasisEditor as cw,
40164
- createOasisEditorContainer as cx,
40165
- mount as cy,
40166
- registerToolbarRenderer as cz,
40887
+ Toolbar as c0,
40888
+ OasisEditorLoading as c1,
40889
+ I18nProvider as c2,
40890
+ createTranslator as c3,
40891
+ createEditorLogger as c4,
40892
+ registerDomStatsSurface as c5,
40893
+ Button as c6,
40894
+ Checkbox as c7,
40895
+ ColorPicker as c8,
40896
+ CommandRegistry as c9,
40897
+ createEditorCommandBus as cA,
40898
+ createOasisEditor as cB,
40899
+ createOasisEditorContainer as cC,
40900
+ mount as cD,
40901
+ registerToolbarRenderer as cE,
40902
+ DEFAULT_PALETTE as ca,
40903
+ DialogFooter as cb,
40904
+ FloatingActionButton as cc,
40905
+ GridPicker as cd,
40906
+ IconButton as ce,
40907
+ Menu as cf,
40908
+ OASIS_BUILTIN_COMMANDS as cg,
40909
+ OASIS_MENU_ITEMS as ch,
40910
+ OASIS_TOOLBAR_ITEMS as ci,
40911
+ OasisEditorAppLazy as cj,
40912
+ OasisEditorContainer as ck,
40913
+ PluginCollection as cl,
40914
+ Popover as cm,
40915
+ RIBBON_TABS as cn,
40916
+ Select as co,
40917
+ SelectField as cp,
40918
+ Separator as cq,
40919
+ SidePanel as cr,
40920
+ SidePanelBody as cs,
40921
+ SidePanelFooter as ct,
40922
+ SidePanelHeader as cu,
40923
+ SplitButton as cv,
40924
+ StyleGallery as cw,
40925
+ TextField as cx,
40926
+ Button$1 as cy,
40927
+ buildRibbonTabDefinitions as cz,
40167
40928
  createInitialEditorState as d,
40168
40929
  createEditorParagraphFromRuns as e,
40169
40930
  fontSizePxToPt as f,