oasis-editor 0.0.115 → 0.0.117

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 (50) hide show
  1. package/dist/{OasisEditorApp-C1dyjJoH.js → OasisEditorApp-DijR5F-O.js} +2183 -907
  2. package/dist/adapters/react.d.ts +11 -0
  3. package/dist/adapters/ui.d.ts +2 -0
  4. package/dist/adapters/vue.d.ts +23 -0
  5. package/dist/assets/{importDocxWorker-D0F0jbcF.js → importDocxWorker-nIS-zjkj.js} +1 -1
  6. package/dist/core/html/inlineImageParser.d.ts +7 -0
  7. package/dist/core/layoutConstants.d.ts +18 -0
  8. package/dist/{index-Cq3YFYX2.js → index-Comlrue1.js} +779 -738
  9. package/dist/layoutProjection/blocksPaginationTypes.d.ts +2 -0
  10. package/dist/layoutProjection/constants.d.ts +7 -1
  11. package/dist/layoutProjection/footnotePagination.d.ts +0 -1
  12. package/dist/layoutProjection/headerFooterLayoutContext.d.ts +2 -0
  13. package/dist/layoutProjection/paginationTrack.d.ts +2 -0
  14. package/dist/layoutProjection/paragraphPagination.d.ts +8 -3
  15. package/dist/layoutProjection/sectionPagination.d.ts +3 -0
  16. package/dist/layoutProjection/tableRowSlicing.d.ts +2 -1
  17. package/dist/oasis-editor.css +1 -1
  18. package/dist/oasis-editor.js +55 -55
  19. package/dist/oasis-editor.umd.cjs +4 -4
  20. package/dist/react.d.ts +7 -8
  21. package/dist/react.js +18 -22
  22. package/dist/ui/canvas/table/prepareCells.d.ts +1 -1
  23. package/dist/ui/canvas/table/resolveRowHeights.d.ts +1 -1
  24. package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +2 -99
  25. package/dist/ui/components/Dialogs/font-dialog/FontTab.d.ts +2 -1
  26. package/dist/ui/components/Dialogs/table-properties/AltTextTabPanel.d.ts +3 -0
  27. package/dist/ui/components/Dialogs/table-properties/CellTabPanel.d.ts +3 -0
  28. package/dist/ui/components/Dialogs/table-properties/ColumnTabPanel.d.ts +3 -0
  29. package/dist/ui/components/Dialogs/table-properties/RowTabPanel.d.ts +3 -0
  30. package/dist/ui/components/Dialogs/table-properties/TablePropertiesController.d.ts +12 -0
  31. package/dist/ui/components/Dialogs/table-properties/TablePropertiesTypes.d.ts +160 -0
  32. package/dist/ui/components/Dialogs/table-properties/TableTabPanel.d.ts +6 -0
  33. package/dist/ui/components/Dialogs/table-properties/fields.d.ts +9 -0
  34. package/dist/ui/components/Dialogs/table-properties/useTablePropertiesController.d.ts +4 -0
  35. package/dist/ui/components/FindReplace/FindReplaceDialog.d.ts +1 -2
  36. package/dist/ui/components/Menubar/Menubar.d.ts +1 -2
  37. package/dist/ui/components/PageBreak.d.ts +1 -1
  38. package/dist/ui/components/Toolbar/primitives/useSurfaceRect.d.ts +20 -0
  39. package/dist/ui/public/FieldRow.d.ts +13 -0
  40. package/dist/ui/public/NumberField.d.ts +13 -0
  41. package/dist/ui/public/Radio.d.ts +38 -0
  42. package/dist/ui/public/ToggleChip.d.ts +14 -0
  43. package/dist/ui/public/index.d.ts +8 -0
  44. package/dist/ui.d.ts +2 -42
  45. package/dist/ui.js +19 -18
  46. package/dist/utils/performanceMetrics.d.ts +0 -6
  47. package/dist/utils/round.d.ts +7 -0
  48. package/dist/vue.d.ts +22 -8
  49. package/dist/vue.js +18 -24
  50. package/package.json +9 -6
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageContentWidth, b as getPageBodyTop, c as getPageBodyBottom, l as listReferencedEndnotes, f as getFootnoteDisplayMarker, s as setActiveHyphenation, h as getDocumentSections, i as buildFootnoteReservations, M as MAX_FOOTNOTE_LAYOUT_ITERATIONS, r as reservationSignature, j as applyFootnotesToPages, k as getRunField, m as projectBlocksLayout, v as visitRun, n as assertNever, o as createSignal, q as createEditorStateFromDocument, t as createInitialEditorState, S as STANDARD_FONT_SIZES_PT, u as fontSizePxToPt, w as probeLocalFontFamilies, x as createEditorParagraphFromRuns, y as isInlineObjectRun, z as createEditorStyledRun, A as getParagraphLength, B as getParagraphText, C as getActiveZone, D as getActiveSectionIndex, E as getParagraphs, F as normalizeSelection, G as positionToParagraphOffset, H as paragraphOffsetToPosition, I as clampPosition, J as findParagraphIndex, K as createCollapsedSelection, L as isSelectionCollapsed, N as parseFontSizePtToPx, O as formatFontSizePt, P as createEditorParagraph, Q as getBlockParagraphs, R as findParagraphTableLocation, T as buildTableCellLayout, U as PT_PER_PX, V as createEditorTableCell, W as createEditorTableRow, X as createEditorTable, Y as underlineStyleToCssDecorationStyle, Z as resolveImageSrc, _ as listKindForTag, $ as isParagraphTag, a0 as collectInlineRuns, a1 as parseParagraphStyle, a2 as getRunImage, a3 as InlineShell, a4 as BalloonShell, a5 as DocumentShell, a6 as createMemo, a7 as getCaretRectFromSnapshot, a8 as getParagraphRectFromSnapshot, a9 as createComponent, aa as CaretOverlay, ab as Show, ac as createRenderEffect, ad as style, ae as setAttribute, af as setStyleProperty, ag as memo, ah as template, ai as addEventListener, aj as insert, ak as delegateEvents, al as useI18n, am as createEffect, an as use, ao as Dialog, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as createStore, au as reconcile, av as onMount, aw as onCleanup, ax as PluginUiHost, ay as OasisEditorEditor, az as OasisBrandMark, aA as setPreciseFontPreference, aB as setWelcomeSeen, aC as enablePreciseFontMode, aD as TWIPS_PER_POINT, aE as PX_PER_INCH, aF as TWIPS_PER_INCH, aG as normalizeHex6, aH as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aI as TABLE_BORDER_EDGE_KEYS, aJ as resolveEffectiveParagraphStyle, aK as resolveEffectiveTextStyleForParagraph, aL as EMU_PER_PT, aM as OOXML_ROTATION_UNITS, aN as OOXML_PERCENT_DENOMINATOR, aO as parseHexColorToRgb255, aP as EMU_PER_PX, aQ as getRunFootnoteReference, aR as getRunEndnoteReference, aS as iterateFootnoteReferenceRuns, aT as iterateEndnoteReferenceRuns, aU as imageContentTypeDefaults, aV as getRunFieldChar, aW as getRunFieldInstruction, aX as createEditorRun, aY as JSZip, aZ as imageExtensionFromMime, a_ as pxToPt$1, a$ as resolveFloatingObjectRect, b0 as getTextBoxFloatingGeometry, b1 as getPresetPathSegments, b2 as buildListLabels, b3 as PX_PER_POINT, b4 as DEFAULT_FONT_SIZE_PX, b5 as resolveGradientAxis, b6 as isDoubleUnderlineStyle, b7 as isWavyUnderlineStyle, b8 as underlineStyleLineWidthPx, b9 as WAVY_UNDERLINE_WAVELENGTH_PX, ba as WAVY_UNDERLINE_AMPLITUDE_PX, bb as DOUBLE_UNDERLINE_OFFSET_PX, bc as underlineStyleDashArray, bd as EMPHASIS_GLYPH, be as rgb255ToHex, bf as getImageFloatingGeometry, bg as textStyleToFontSizePt, bh as resolveOpenTypeFeatureTags, bi as resolveDecorationLineY, bj as DOUBLE_STRIKE_OFFSET_PX, bk as resolveListLabel, bl as getListLabelInset, bm as getAlignedListLabelInset, bn as getParagraphBorderInsets, bo as buildSegmentTable, bp as buildCanvasTableLayout, bq as resolveCanvasTableWidth, br as resolveFloatingTableRect, bs as normalizeFamily, bt as ROBOTO_FONT_FILES, bu as loadFontAsset, bv as OFFICE_COMPAT_FONT_FAMILIES, bw as BinaryReader, bx as buildSfnt, by as defaultFontDecoderRegistry, bz as SfntFontProgram, bA as collectPdfFontFamilies, bB as outlineFrom, bC as getPageHeaderZoneTop, bD as getPageColumnRects, bE as findFootnoteReference, bF as FOOTNOTE_MARKER_GUTTER_PX, bG as resolveImporterForFile, bH as getDocumentSectionsCanonical, bI as getDocumentParagraphsCanonical, bJ as getDocumentParagraphs, bK as getDocumentPageSettings, bL as getTableCellContentWidthForParagraph, bM as layoutMetricsEpoch, bN as bumpLayoutMetricsEpoch, bO as createCanvasLayoutSnapshotProvider, bP as on, bQ as debounce, bR as unwrap, bS as perfTimer, bT as getRunTextBox, bU as createEditorDocument, bV as resolveResizedDimensions, bW as resolveTextBoxRenderHeight, bX as getToolbarStyleState, bY as getCachedCanvasImage, bZ as measureParagraphMinContentWidthPx, b_ as getEditableBlocksForZone, b$ as findParagraphLocation, c0 as createSectionBoundaryParagraph, c1 as normalizePageSettings, c2 as DEFAULT_EDITOR_PAGE_SETTINGS, c3 as markStart, c4 as markEnd, c5 as getParagraphEntries, c6 as getParagraphById, c7 as createEditorFootnote, c8 as createFootnoteReferenceRun, c9 as renumberFootnotes, ca as getHeadingLevel, cb as preciseFontModeVersion, cc as isPreciseFontModeEnabled, cd as resolveNamedTextStyle, ce as togglePreciseFontMode, cf as nextFontSizePt, cg as previousFontSizePt, ch as fontSizePtToPx, ci as createDefaultToolbarPreset, cj as MenuRegistry, ck as createToolbarRegistry, cl as Editor, cm as resolveCommandRef, cn as commandRefName, co as createOasisEditorClient, cp as createEditorZoom, cq as startLongTaskObserver, cr as installGlobalReport, cs as applyStoredPreciseFontPreference, ct as getWelcomeSeen, cu as isLocalFontAccessSupported, cv as EDITOR_SCROLL_PADDING_PX, cw as Toolbar, cx as OasisEditorLoading, cy as I18nProvider, cz as createTranslator, cA as createEditorLogger, cB as registerDomStatsSurface } from "./index-Cq3YFYX2.js";
4
+ import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, u as useContext, s as splitProps, q as spread, r as mergeProps, t as memo, v as insert, w as createComponent, x as createRenderEffect, y as setAttribute, S as Show, z as className, A as For, B as createContext, C as template, D as createUniqueId, G as style, H as visitRun, I as assertNever, J as createSignal, K as createEditorStateFromDocument, L as createInitialEditorState, M as STANDARD_FONT_SIZES_PT, N as fontSizePxToPt, O as probeLocalFontFamilies, P as createEditorParagraphFromRuns, Q as isInlineObjectRun, R as createEditorStyledRun, T as getParagraphLength, U as getActiveZone, V as getActiveSectionIndex, W as getParagraphs, X as normalizeSelection, Y as positionToParagraphOffset, Z as paragraphOffsetToPosition, _ as clampPosition, $ as findParagraphIndex, a0 as createCollapsedSelection, a1 as isSelectionCollapsed, a2 as parseFontSizePtToPx, a3 as formatFontSizePt, a4 as createEditorParagraph, a5 as findParagraphTableLocation, a6 as buildTableCellLayout, a7 as PT_PER_PX, a8 as createEditorTableCell, a9 as createEditorTableRow, aa as createEditorTable, ab as PX_PER_POINT, ac as underlineStyleToCssDecorationStyle, ad as resolveImageSrc, ae as listKindForTag, af as isParagraphTag, ag as collectInlineRuns, ah as parseParagraphStyle, ai as getRunImage, aj as InlineShell, ak as BalloonShell, al as DocumentShell, am as createMemo, an as getCaretRectFromSnapshot, ao as getParagraphRectFromSnapshot, ap as CaretOverlay, aq as setStyleProperty, ar as Button, as as useI18n, at as createEffect, au as TextField, av as Dialog, aw as SelectField, ax as UNDERLINE_STYLE_OPTIONS, ay as delegateEvents, az as Checkbox, aA as Tabs, aB as FieldRow, aC as NumberField, aD as createStore, aE as reconcile, aF as addEventListener, aG as onMount, aH as onCleanup, aI as use, aJ as PluginUiHost, aK as OasisEditorEditor, aL as OasisBrandMark, aM as setPreciseFontPreference, aN as setWelcomeSeen, aO as enablePreciseFontMode, aP as TWIPS_PER_POINT, aQ as PX_PER_INCH, aR as TWIPS_PER_INCH, aS as normalizeHex6, aT as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aU as TABLE_BORDER_EDGE_KEYS, aV as resolveEffectiveParagraphStyle, aW as resolveEffectiveTextStyleForParagraph, aX as EMU_PER_PT, aY as OOXML_ROTATION_UNITS, aZ as OOXML_PERCENT_DENOMINATOR, a_ as parseHexColorToRgb255, a$ as EMU_PER_PX, b0 as getRunEndnoteReference, b1 as iterateFootnoteReferenceRuns, b2 as iterateEndnoteReferenceRuns, b3 as imageContentTypeDefaults, b4 as getRunFieldChar, b5 as getRunFieldInstruction, b6 as createEditorRun, b7 as JSZip, b8 as imageExtensionFromMime, b9 as pxToPt$1, ba as resolveFloatingObjectRect, bb as getTextBoxFloatingGeometry, bc as getPresetPathSegments, bd as buildListLabels, be as DEFAULT_FONT_SIZE_PX, bf as resolveGradientAxis, bg as isDoubleUnderlineStyle, bh as isWavyUnderlineStyle, bi as underlineStyleLineWidthPx, bj as WAVY_UNDERLINE_WAVELENGTH_PX, bk as WAVY_UNDERLINE_AMPLITUDE_PX, bl as DOUBLE_UNDERLINE_OFFSET_PX, bm as underlineStyleDashArray, bn as EMPHASIS_GLYPH, bo as rgb255ToHex, bp as getImageFloatingGeometry, bq as textStyleToFontSizePt, br as TEXT_BASELINE_RATIO, bs as resolveOpenTypeFeatureTags, bt as resolveDecorationLineY, bu as DOUBLE_STRIKE_OFFSET_PX, bv as resolveListLabel, bw as getListLabelInset, bx as getAlignedListLabelInset, by as getParagraphBorderInsets, bz as buildSegmentTable, bA as buildCanvasTableLayout, bB as resolveCanvasTableWidth, bC as resolveFloatingTableRect, bD as normalizeFamily, bE as ROBOTO_FONT_FILES, bF as loadFontAsset, bG as OFFICE_COMPAT_FONT_FAMILIES, bH as BinaryReader, bI as buildSfnt, bJ as defaultFontDecoderRegistry, bK as SfntFontProgram, bL as collectPdfFontFamilies, bM as outlineFrom, bN as getPageHeaderZoneTop, bO as getPageColumnRects, bP as findFootnoteReference, bQ as resolveImporterForFile, bR as roundTo, bS as getDocumentSectionsCanonical, bT as getDocumentParagraphsCanonical, bU as getDocumentParagraphs, bV as getDocumentPageSettings, bW as getTableCellContentWidthForParagraph, bX as layoutMetricsEpoch, bY as bumpLayoutMetricsEpoch, bZ as createCanvasLayoutSnapshotProvider, b_ as on, b$ as debounce, c0 as unwrap, c1 as perfTimer, c2 as getRunTextBox, c3 as createEditorDocument, c4 as resolveResizedDimensions, c5 as resolveTextBoxRenderHeight, c6 as getToolbarStyleState, c7 as VERTICAL_HIT_WEIGHT, c8 as getCachedCanvasImage, c9 as measureParagraphMinContentWidthPx, ca as getEditableBlocksForZone, cb as findParagraphLocation, cc as createSectionBoundaryParagraph, cd as normalizePageSettings, ce as DEFAULT_EDITOR_PAGE_SETTINGS, cf as markStart, cg as markEnd, ch as getParagraphEntries, ci as getParagraphById, cj as createEditorFootnote, ck as createFootnoteReferenceRun, cl as renumberFootnotes, cm as getHeadingLevel, cn as preciseFontModeVersion, co as isPreciseFontModeEnabled, cp as resolveNamedTextStyle, cq as togglePreciseFontMode, cr as nextFontSizePt, cs as previousFontSizePt, ct as fontSizePtToPx, cu as createDefaultToolbarPreset, cv as MenuRegistry, cw as createToolbarRegistry, cx as Editor, cy as resolveCommandRef, cz as commandRefName, cA as createOasisEditorClient, cB as createEditorZoom, cC as startLongTaskObserver, cD as installGlobalReport, cE as applyStoredPreciseFontPreference, cF as getWelcomeSeen, cG as isLocalFontAccessSupported, cH as EDITOR_SCROLL_PADDING_PX, cI as Toolbar, cJ as OasisEditorLoading, cK as I18nProvider, cL as createTranslator, cM as createEditorLogger, cN as registerDomStatsSurface } from "./index-Comlrue1.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -54,10 +54,20 @@ function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
54
54
  });
55
55
  }
56
56
  function projectHeaderFooterBlocks(blocks, context = {}) {
57
+ const projectionCtx = context.projectionContext ?? EMPTY_PROJECTION_CONTEXT;
57
58
  return projectHeaderFooterBlocksWithDependencies(
58
59
  blocks,
59
60
  {
60
- projectParagraphLayout,
61
+ projectParagraphLayout: (paragraph, pageIndex, totalPages, styles, contentWidth, measurer, defaultTabStop) => projectParagraphLayout(
62
+ paragraph,
63
+ pageIndex,
64
+ totalPages,
65
+ styles,
66
+ contentWidth,
67
+ measurer,
68
+ defaultTabStop,
69
+ projectionCtx
70
+ ),
61
71
  estimateTableBlockHeight,
62
72
  getProjectedParagraphBlockHeight
63
73
  },
@@ -67,6 +77,148 @@ function projectHeaderFooterBlocks(blocks, context = {}) {
67
77
  }
68
78
  );
69
79
  }
80
+ const FOOTNOTE_SEPARATOR_HEIGHT = 10;
81
+ const FOOTNOTE_BLOCK_GAP = 2;
82
+ const MAX_FOOTNOTE_LAYOUT_ITERATIONS = 4;
83
+ function getProjectedBlocksHeight$1(blocks) {
84
+ if (!blocks || blocks.length === 0) {
85
+ return 0;
86
+ }
87
+ return blocks.reduce((sum, block) => sum + block.estimatedHeight, 0);
88
+ }
89
+ function collectFootnoteReferencesFromBlock(block) {
90
+ var _a2, _b2;
91
+ const result = [];
92
+ const appendFromParagraph = (paragraph, startOffset, endOffset) => {
93
+ let runStart = 0;
94
+ for (const run of paragraph.runs) {
95
+ const runEnd = runStart + run.text.length;
96
+ const footnoteReference = getRunFootnoteReference(run);
97
+ if (footnoteReference && runEnd > startOffset && runStart < endOffset) {
98
+ result.push(footnoteReference.footnoteId);
99
+ }
100
+ runStart = runEnd;
101
+ }
102
+ };
103
+ if (block.sourceBlock.type === "paragraph") {
104
+ appendFromParagraph(
105
+ block.sourceBlock,
106
+ ((_a2 = block.layout) == null ? void 0 : _a2.startOffset) ?? 0,
107
+ ((_b2 = block.layout) == null ? void 0 : _b2.endOffset) ?? getParagraphText(block.sourceBlock).length
108
+ );
109
+ return result;
110
+ }
111
+ for (const paragraph of getBlockParagraphs(block.sourceBlock)) {
112
+ appendFromParagraph(paragraph, 0, getParagraphText(paragraph).length);
113
+ }
114
+ return result;
115
+ }
116
+ function collectPageFootnoteReferenceIds(page) {
117
+ const seen = /* @__PURE__ */ new Set();
118
+ const ids = [];
119
+ for (const block of page.blocks) {
120
+ for (const footnoteId of collectFootnoteReferencesFromBlock(block)) {
121
+ if (seen.has(footnoteId)) continue;
122
+ seen.add(footnoteId);
123
+ ids.push(footnoteId);
124
+ }
125
+ }
126
+ return ids;
127
+ }
128
+ function projectFootnoteBlocksForPage(document2, footnoteReferenceIds, page, totalPages, measuredHeights, measuredParagraphLayouts, measurer, projectBlocks) {
129
+ var _a2, _b2, _c;
130
+ const contentWidth = Math.max(
131
+ 24,
132
+ getPageContentWidth(page.pageSettings) - FOOTNOTE_MARKER_GUTTER_PX
133
+ );
134
+ const blocks = [];
135
+ for (const footnoteId of footnoteReferenceIds) {
136
+ const footnote = (_b2 = (_a2 = document2.footnotes) == null ? void 0 : _a2.items) == null ? void 0 : _b2[footnoteId];
137
+ if (!footnote) continue;
138
+ const projected = projectBlocks(footnote.blocks, {
139
+ pageIndex: page.index,
140
+ totalPages,
141
+ measuredHeights,
142
+ measuredParagraphLayouts,
143
+ styles: document2.styles,
144
+ contentWidth,
145
+ measurer,
146
+ defaultTabStop: (_c = document2.settings) == null ? void 0 : _c.defaultTabStop
147
+ });
148
+ for (const block of projected) {
149
+ blocks.push({
150
+ ...block,
151
+ blockId: `${footnoteId}:${block.blockId}`
152
+ });
153
+ }
154
+ }
155
+ return blocks;
156
+ }
157
+ function buildFootnoteReservations(pages, context) {
158
+ const reservations = /* @__PURE__ */ new Map();
159
+ for (const page of pages) {
160
+ const footnoteReferenceIds = collectPageFootnoteReferenceIds(page);
161
+ if (footnoteReferenceIds.length === 0) continue;
162
+ const footnoteBlocks = projectFootnoteBlocksForPage(
163
+ context.document,
164
+ footnoteReferenceIds,
165
+ page,
166
+ context.totalPages,
167
+ context.measuredHeights,
168
+ context.measuredParagraphLayouts,
169
+ context.measurer,
170
+ context.projectBlocks
171
+ );
172
+ if (footnoteBlocks.length === 0) continue;
173
+ const blockGaps = Math.max(0, footnoteBlocks.length - 1) * FOOTNOTE_BLOCK_GAP;
174
+ reservations.set(
175
+ page.index,
176
+ FOOTNOTE_SEPARATOR_HEIGHT + getProjectedBlocksHeight$1(footnoteBlocks) + blockGaps
177
+ );
178
+ }
179
+ return reservations;
180
+ }
181
+ function reservationSignature(reservations) {
182
+ return [...reservations.entries()].sort(([left], [right]) => left - right).map(([pageIndex, height]) => `${pageIndex}:${Math.round(height)}`).join("|");
183
+ }
184
+ function applyFootnotesToPages(pages, context) {
185
+ return pages.map((page) => {
186
+ const footnoteReferenceIds = collectPageFootnoteReferenceIds(page);
187
+ if (footnoteReferenceIds.length === 0) {
188
+ return {
189
+ ...page,
190
+ footnoteBlocks: void 0,
191
+ footnoteReferenceIds: void 0,
192
+ footnoteTop: void 0,
193
+ footnoteSeparatorTop: void 0
194
+ };
195
+ }
196
+ const footnoteBlocks = projectFootnoteBlocksForPage(
197
+ context.document,
198
+ footnoteReferenceIds,
199
+ page,
200
+ context.totalPages,
201
+ context.measuredHeights,
202
+ context.measuredParagraphLayouts,
203
+ context.measurer,
204
+ context.projectBlocks
205
+ );
206
+ const bodyBottom = page.bodyBottom ?? getPageBodyBottom(page.pageSettings);
207
+ const footnoteSeparatorTop = Math.max(
208
+ page.bodyTop ?? getPageBodyTop(page.pageSettings),
209
+ bodyBottom
210
+ );
211
+ const footnoteTop = footnoteSeparatorTop + FOOTNOTE_SEPARATOR_HEIGHT;
212
+ return {
213
+ ...page,
214
+ footnoteBlocks,
215
+ footnoteReferenceIds,
216
+ footnoteSeparatorTop,
217
+ footnoteTop,
218
+ bodyBottom
219
+ };
220
+ });
221
+ }
70
222
  function getProjectedBlocksHeight(blocks) {
71
223
  if (!blocks || blocks.length === 0) {
72
224
  return 0;
@@ -126,7 +278,8 @@ function createHeaderFooterVariantProjector(context) {
126
278
  styles: context.documentStyles,
127
279
  contentWidth,
128
280
  measurer: context.measurer,
129
- defaultTabStop: context.defaultTabStop
281
+ defaultTabStop: context.defaultTabStop,
282
+ projectionContext: context.projectionContext
130
283
  }) : void 0;
131
284
  }
132
285
  function projectTallestHeaderVariant(section, contentWidth, projectHeaderFooterVariant) {
@@ -180,7 +333,8 @@ function calculateTotalPages(context, projectHeaderFooterVariant) {
180
333
  pageOffset: isContinuous ? currentTotal - 1 : currentTotal,
181
334
  existingPages: isContinuous ? [activePages[activePages.length - 1]] : [],
182
335
  measurer: context.measurer,
183
- defaultTabStop: context.defaultTabStop
336
+ defaultTabStop: context.defaultTabStop,
337
+ projectionContext: context.projectionContext
184
338
  });
185
339
  if (isContinuous) {
186
340
  activePages.pop();
@@ -227,7 +381,8 @@ function projectAllPages(context, totalPages, projectHeaderFooterVariant, reserv
227
381
  existingPages: isContinuous ? [allPages[allPages.length - 1]] : [],
228
382
  measurer: context.measurer,
229
383
  reservedHeightByPageIndex,
230
- defaultTabStop: context.defaultTabStop
384
+ defaultTabStop: context.defaultTabStop,
385
+ projectionContext: context.projectionContext
231
386
  });
232
387
  if (isContinuous) {
233
388
  allPages.pop();
@@ -398,7 +553,7 @@ function documentContainsNumPagesField(document2) {
398
553
  function projectDocumentLayout(document2, maxPageHeightOverride, measuredHeights, measuredParagraphLayouts, options = {}) {
399
554
  var _a2, _b2;
400
555
  const measurer = options.measurer ?? domTextMeasurer;
401
- setActiveHyphenation(
556
+ const projectionContext = createProjectionContext(
402
557
  ((_a2 = document2.settings) == null ? void 0 : _a2.autoHyphenation) ? {
403
558
  enabled: true,
404
559
  zone: document2.settings.hyphenationZone,
@@ -419,13 +574,13 @@ function projectDocumentLayout(document2, maxPageHeightOverride, measuredHeights
419
574
  defaultTabStop: (_b2 = document2.settings) == null ? void 0 : _b2.defaultTabStop,
420
575
  needsTotalPages,
421
576
  projectBlocks: projectBlocksLayout,
422
- projectHeaderFooterBlocks
577
+ projectHeaderFooterBlocks,
578
+ projectionContext
423
579
  };
424
580
  const projectedSections = projectDocumentSections(sectionContext);
425
581
  let pages = projectedSections.pages;
426
582
  const totalPages = projectedSections.totalPages;
427
583
  if (!document2.footnotes || Object.keys(document2.footnotes.items).length === 0) {
428
- setActiveHyphenation(void 0);
429
584
  return { pages };
430
585
  }
431
586
  const footnoteContext = {
@@ -447,11 +602,166 @@ function projectDocumentLayout(document2, maxPageHeightOverride, measuredHeights
447
602
  pages = projectDocumentSections(sectionContext, reservations).pages;
448
603
  reservations = buildFootnoteReservations(pages, footnoteContext);
449
604
  }
450
- const result = {
605
+ return {
451
606
  pages: applyFootnotesToPages(pages, footnoteContext)
452
607
  };
453
- setActiveHyphenation(void 0);
454
- return result;
608
+ }
609
+ var _tmpl$$g = /* @__PURE__ */ template(`<span class=oasis-editor-ui-field-description>`), _tmpl$2$4 = /* @__PURE__ */ template(`<label><input type=radio class=oasis-editor-ui-radio-input><span class=oasis-editor-ui-checkbox-copy><span class=oasis-editor-ui-field-label>`), _tmpl$3$3 = /* @__PURE__ */ template(`<span class=oasis-editor-ui-field-label>`), _tmpl$4$1 = /* @__PURE__ */ template(`<div role=radiogroup>`);
610
+ const RadioGroupCtx = createContext();
611
+ function Radio$1(props) {
612
+ const fallbackId = createUniqueId();
613
+ const group = useContext(RadioGroupCtx);
614
+ const [local, others] = splitProps(props, ["label", "description", "value", "onChange", "class", "id", "checked", "name", "disabled"]);
615
+ const id = () => local.id ?? fallbackId;
616
+ const descriptionId = () => `${id()}-description`;
617
+ const checked = () => group ? group.value() === local.value : Boolean(local.checked);
618
+ const disabled = () => Boolean(local.disabled) || (group ? group.disabled() : false);
619
+ return (() => {
620
+ var _el$ = _tmpl$2$4(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
621
+ _el$2.addEventListener("change", (event) => {
622
+ var _a2;
623
+ if (group) group.onSelect(local.value);
624
+ (_a2 = local.onChange) == null ? void 0 : _a2.call(local, event.currentTarget.checked);
625
+ });
626
+ spread(_el$2, mergeProps({
627
+ get id() {
628
+ return id();
629
+ },
630
+ get name() {
631
+ return local.name ?? (group == null ? void 0 : group.name);
632
+ },
633
+ get value() {
634
+ return local.value;
635
+ },
636
+ get checked() {
637
+ return checked();
638
+ },
639
+ get disabled() {
640
+ return disabled();
641
+ },
642
+ get ["aria-describedby"]() {
643
+ return memo(() => !!local.description)() ? descriptionId() : void 0;
644
+ }
645
+ }, others), false, false);
646
+ insert(_el$4, () => local.label);
647
+ insert(_el$3, createComponent(Show, {
648
+ get when() {
649
+ return local.description;
650
+ },
651
+ get children() {
652
+ var _el$5 = _tmpl$$g();
653
+ insert(_el$5, () => local.description);
654
+ createRenderEffect(() => setAttribute(_el$5, "id", descriptionId()));
655
+ return _el$5;
656
+ }
657
+ }), null);
658
+ createRenderEffect((_p$) => {
659
+ var _v$ = `oasis-editor-ui-radio ${local.class ?? ""}`, _v$2 = id();
660
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
661
+ _v$2 !== _p$.t && setAttribute(_el$, "for", _p$.t = _v$2);
662
+ return _p$;
663
+ }, {
664
+ e: void 0,
665
+ t: void 0
666
+ });
667
+ return _el$;
668
+ })();
669
+ }
670
+ function RadioGroup(props) {
671
+ const fallbackName = createUniqueId();
672
+ const ctx = {
673
+ name: props.name ?? fallbackName,
674
+ value: () => props.value,
675
+ onSelect: (value) => {
676
+ var _a2;
677
+ return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, value);
678
+ },
679
+ disabled: () => Boolean(props.disabled)
680
+ };
681
+ return createComponent(RadioGroupCtx.Provider, {
682
+ value: ctx,
683
+ get children() {
684
+ var _el$6 = _tmpl$4$1();
685
+ insert(_el$6, createComponent(Show, {
686
+ get when() {
687
+ return props.label;
688
+ },
689
+ get children() {
690
+ var _el$7 = _tmpl$3$3();
691
+ insert(_el$7, () => props.label);
692
+ return _el$7;
693
+ }
694
+ }), null);
695
+ insert(_el$6, createComponent(Show, {
696
+ get when() {
697
+ return props.options;
698
+ },
699
+ get fallback() {
700
+ return props.children;
701
+ },
702
+ get children() {
703
+ return createComponent(For, {
704
+ get each() {
705
+ return props.options;
706
+ },
707
+ children: (option) => createComponent(Radio$1, {
708
+ get value() {
709
+ return option.value;
710
+ },
711
+ get label() {
712
+ return option.label;
713
+ },
714
+ get description() {
715
+ return option.description;
716
+ },
717
+ get disabled() {
718
+ return option.disabled;
719
+ }
720
+ })
721
+ });
722
+ }
723
+ }), null);
724
+ createRenderEffect((_p$) => {
725
+ var _v$3 = `oasis-editor-ui-radio-group ${props.class ?? ""}`, _v$4 = props.label;
726
+ _v$3 !== _p$.e && className(_el$6, _p$.e = _v$3);
727
+ _v$4 !== _p$.t && setAttribute(_el$6, "aria-label", _p$.t = _v$4);
728
+ return _p$;
729
+ }, {
730
+ e: void 0,
731
+ t: void 0
732
+ });
733
+ return _el$6;
734
+ }
735
+ });
736
+ }
737
+ var _tmpl$$f = /* @__PURE__ */ template(`<label><input type=checkbox class=oasis-editor-ui-toggle-chip-input><span class=oasis-editor-ui-toggle-chip-label>`);
738
+ function ToggleChip(props) {
739
+ const [local, others] = splitProps(props, ["label", "labelStyle", "onChange", "class", "checked"]);
740
+ return (() => {
741
+ var _el$ = _tmpl$$f(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
742
+ _el$2.addEventListener("change", (event) => {
743
+ var _a2;
744
+ return (_a2 = local.onChange) == null ? void 0 : _a2.call(local, event.currentTarget.checked);
745
+ });
746
+ spread(_el$2, mergeProps({
747
+ get checked() {
748
+ return local.checked;
749
+ }
750
+ }, others), false, false);
751
+ insert(_el$3, () => local.label);
752
+ createRenderEffect((_p$) => {
753
+ var _v$ = `oasis-editor-ui-toggle-chip ${local.class ?? ""}`, _v$2 = !!Boolean(local.checked), _v$3 = local.labelStyle;
754
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
755
+ _v$2 !== _p$.t && _el$.classList.toggle("is-active", _p$.t = _v$2);
756
+ _p$.a = style(_el$3, _v$3, _p$.a);
757
+ return _p$;
758
+ }, {
759
+ e: void 0,
760
+ t: void 0,
761
+ a: void 0
762
+ });
763
+ return _el$;
764
+ })();
455
765
  }
456
766
  function cloneStyle(style2) {
457
767
  return style2 ? { ...style2 } : void 0;
@@ -30038,19 +30348,15 @@ function textRunStylesToCss(style2) {
30038
30348
  }
30039
30349
  }
30040
30350
  if (style2.textOutline) {
30041
- const widthPx = style2.textOutline.widthPt * (96 / 72);
30351
+ const widthPx = style2.textOutline.widthPt * PX_PER_POINT;
30042
30352
  const color = style2.textOutline.color ?? "#000000";
30043
30353
  parts.push(`-webkit-text-stroke:${widthPx.toFixed(2)}px ${color}`);
30044
30354
  }
30045
30355
  if (style2.textShadow) {
30046
30356
  const dirRad = style2.textShadow.dirDeg * Math.PI / 180;
30047
- const px = (pt) => (pt * (96 / 72)).toFixed(2);
30048
- const ox = (Math.cos(dirRad) * style2.textShadow.distPt * (96 / 72)).toFixed(
30049
- 2
30050
- );
30051
- const oy = (Math.sin(dirRad) * style2.textShadow.distPt * (96 / 72)).toFixed(
30052
- 2
30053
- );
30357
+ const px = (pt) => (pt * PX_PER_POINT).toFixed(2);
30358
+ const ox = (Math.cos(dirRad) * style2.textShadow.distPt * PX_PER_POINT).toFixed(2);
30359
+ const oy = (Math.sin(dirRad) * style2.textShadow.distPt * PX_PER_POINT).toFixed(2);
30054
30360
  const blur = px(style2.textShadow.blurPt);
30055
30361
  const alpha = style2.textShadow.alpha ?? 1;
30056
30362
  const r = parseInt(style2.textShadow.color.slice(1, 3), 16);
@@ -30060,7 +30366,7 @@ function textRunStylesToCss(style2) {
30060
30366
  `text-shadow:${ox}px ${oy}px ${blur}px rgba(${r},${g},${b},${alpha})`
30061
30367
  );
30062
30368
  } else if (style2.glow) {
30063
- const blur = (style2.glow.radiusPt * (96 / 72)).toFixed(2);
30369
+ const blur = (style2.glow.radiusPt * PX_PER_POINT).toFixed(2);
30064
30370
  const alpha = style2.glow.alpha ?? 0.7;
30065
30371
  const r = parseInt(style2.glow.color.slice(1, 3), 16);
30066
30372
  const g = parseInt(style2.glow.color.slice(3, 5), 16);
@@ -31142,14 +31448,14 @@ function DropCaret(props) {
31142
31448
  })
31143
31449
  });
31144
31450
  }
31145
- var _tmpl$$d = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$7 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$3$4 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
31451
+ var _tmpl$$e = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$3 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
31146
31452
  function EditorDragLayers(props) {
31147
31453
  return [createComponent(Show, {
31148
31454
  get when() {
31149
31455
  return props.tableResize.resizing();
31150
31456
  },
31151
31457
  children: (resizing) => (() => {
31152
- var _el$ = _tmpl$$d();
31458
+ var _el$ = _tmpl$$e();
31153
31459
  createRenderEffect((_p$) => {
31154
31460
  var _v$ = !!(resizing().type === "column"), _v$2 = !!(resizing().type === "row"), _v$3 = {
31155
31461
  ...resizing().type === "column" ? {
@@ -31180,7 +31486,7 @@ function EditorDragLayers(props) {
31180
31486
  return memo(() => !!props.imageOps.dragging())() && props.imageOps.draggedImageInfo();
31181
31487
  },
31182
31488
  children: (info) => (() => {
31183
- var _el$2 = _tmpl$2$7();
31489
+ var _el$2 = _tmpl$2$3();
31184
31490
  createRenderEffect((_p$) => {
31185
31491
  var _v$4 = info().src, _v$5 = `${info().width}px`, _v$6 = `${info().height}px`, _v$7 = `${props.imageOps.mousePos().x - info().offsetX}px`, _v$8 = `${props.imageOps.mousePos().y - info().offsetY}px`;
31186
31492
  _v$4 !== _p$.e && setAttribute(_el$2, "src", _p$.e = _v$4);
@@ -31203,7 +31509,7 @@ function EditorDragLayers(props) {
31203
31509
  return memo(() => !!props.tableDrag.dragging())() && props.tableDrag.draggedTableInfo();
31204
31510
  },
31205
31511
  children: (info) => (() => {
31206
- var _el$3 = _tmpl$3$4();
31512
+ var _el$3 = _tmpl$3$2();
31207
31513
  createRenderEffect((_p$) => {
31208
31514
  var _v$9 = `${info().width}px`, _v$0 = `${info().height}px`, _v$1 = `${props.tableDrag.mousePos().x - info().offsetX}px`, _v$10 = `${props.tableDrag.mousePos().y - info().offsetY}px`;
31209
31515
  _v$9 !== _p$.e && setStyleProperty(_el$3, "width", _p$.e = _v$9);
@@ -31293,24 +31599,31 @@ function EditorDragLayers(props) {
31293
31599
  })
31294
31600
  })];
31295
31601
  }
31296
- var _tmpl$$c = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary">`), _tmpl$2$6 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary">`);
31297
31602
  function DialogFooter(props) {
31298
- return [(() => {
31299
- var _el$ = _tmpl$$c();
31300
- addEventListener(_el$, "click", props.onCancel, true);
31301
- insert(_el$, () => props.cancelLabel);
31302
- createRenderEffect(() => setAttribute(_el$, "data-testid", props.cancelTestId));
31303
- return _el$;
31304
- })(), (() => {
31305
- var _el$2 = _tmpl$2$6();
31306
- addEventListener(_el$2, "click", props.onConfirm, true);
31307
- insert(_el$2, () => props.confirmLabel);
31308
- createRenderEffect(() => setAttribute(_el$2, "data-testid", props.confirmTestId));
31309
- return _el$2;
31310
- })()];
31311
- }
31312
- delegateEvents(["click"]);
31313
- var _tmpl$$b = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=text class=oasis-editor-dialog-input>`);
31603
+ return [createComponent(Button, {
31604
+ variant: "secondary",
31605
+ get onClick() {
31606
+ return props.onCancel;
31607
+ },
31608
+ get ["data-testid"]() {
31609
+ return props.cancelTestId;
31610
+ },
31611
+ get children() {
31612
+ return props.cancelLabel;
31613
+ }
31614
+ }), createComponent(Button, {
31615
+ variant: "primary",
31616
+ get onClick() {
31617
+ return props.onConfirm;
31618
+ },
31619
+ get ["data-testid"]() {
31620
+ return props.confirmTestId;
31621
+ },
31622
+ get children() {
31623
+ return props.confirmLabel;
31624
+ }
31625
+ })];
31626
+ }
31314
31627
  function TextInputDialog(props) {
31315
31628
  const t = useI18n();
31316
31629
  const [value, setValue] = createSignal(props.initialValue);
@@ -31358,28 +31671,30 @@ function TextInputDialog(props) {
31358
31671
  });
31359
31672
  },
31360
31673
  get children() {
31361
- var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
31362
- insert(_el$2, () => props.label);
31363
- _el$3.$$keydown = (e) => e.key === "Enter" && handleConfirm();
31364
- _el$3.$$input = (e) => setValue(e.currentTarget.value);
31365
- var _ref$ = inputRef;
31366
- typeof _ref$ === "function" ? use(_ref$, _el$3) : inputRef = _el$3;
31367
- createRenderEffect((_p$) => {
31368
- var _a2;
31369
- var _v$ = props.placeholder, _v$2 = (_a2 = props.testIds) == null ? void 0 : _a2.input;
31370
- _v$ !== _p$.e && setAttribute(_el$3, "placeholder", _p$.e = _v$);
31371
- _v$2 !== _p$.t && setAttribute(_el$3, "data-testid", _p$.t = _v$2);
31372
- return _p$;
31373
- }, {
31374
- e: void 0,
31375
- t: void 0
31674
+ return createComponent(TextField, {
31675
+ ref(r$) {
31676
+ var _ref$ = inputRef;
31677
+ typeof _ref$ === "function" ? _ref$(r$) : inputRef = r$;
31678
+ },
31679
+ get label() {
31680
+ return props.label;
31681
+ },
31682
+ get value() {
31683
+ return value();
31684
+ },
31685
+ onChange: setValue,
31686
+ onKeyDown: (e) => e.key === "Enter" && handleConfirm(),
31687
+ get placeholder() {
31688
+ return props.placeholder;
31689
+ },
31690
+ get ["data-testid"]() {
31691
+ var _a2;
31692
+ return (_a2 = props.testIds) == null ? void 0 : _a2.input;
31693
+ }
31376
31694
  });
31377
- createRenderEffect(() => _el$3.value = value());
31378
- return _el$;
31379
31695
  }
31380
31696
  });
31381
31697
  }
31382
- delegateEvents(["input", "keydown"]);
31383
31698
  function LinkDialog(props) {
31384
31699
  const t = useI18n();
31385
31700
  return createComponent(TextInputDialog, {
@@ -31790,11 +32105,11 @@ function useFontDialogController(props) {
31790
32105
  handleApply
31791
32106
  };
31792
32107
  }
31793
- var _tmpl$$a = /* @__PURE__ */ template(`<div>`);
32108
+ var _tmpl$$d = /* @__PURE__ */ template(`<div>`);
31794
32109
  function FontPreview(props) {
31795
32110
  const t = useI18n();
31796
32111
  return (() => {
31797
- var _el$ = _tmpl$$a();
32112
+ var _el$ = _tmpl$$d();
31798
32113
  insert(_el$, () => t("dialog.font.previewText"));
31799
32114
  createRenderEffect((_p$) => {
31800
32115
  var _v$ = props.class ?? "oasis-editor-dialog-preview", _v$2 = props.testId, _v$3 = props.style;
@@ -31810,133 +32125,253 @@ function FontPreview(props) {
31810
32125
  return _el$;
31811
32126
  })();
31812
32127
  }
31813
- var _tmpl$$9 = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-font-panel"><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input class=oasis-editor-dialog-input data-testid=editor-font-dialog-family-filter></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-family><option value>—</option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-size-group"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-size><option value>—</option></select></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-custom-size-group"><label class=oasis-editor-dialog-label></label><input class=oasis-editor-dialog-input data-testid=editor-font-dialog-custom-size><span class=oasis-editor-dialog-help-text></span></div><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-style-list-group"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-style-list><option value=regular></option><option value=italic></option><option value=bold></option><option value=boldItalic></option></select></div></div><div class="oasis-editor-dialog-row oasis-editor-font-dialog-color-row"><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-color-mode-group"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-color-mode><option value=automatic></option><option value=custom></option></select><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-highlight></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-shading></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-underline-style><option value=none></option></select></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-underline-color></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-bold><span style=font-weight:700></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-italic><span style=font-style:italic></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-underline><span style=text-decoration:underline></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-strike><span style=text-decoration:line-through></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-double-strike><span></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-superscript><span></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-subscript><span></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-small-caps><span></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-all-caps><span></span></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-font-dialog-hidden><span></span></label></div></div></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label>`), _tmpl$2$5 = /* @__PURE__ */ template(`<option>`);
32128
+ var _tmpl$$c = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-font-panel"><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-custom-size-group"><span class=oasis-editor-dialog-help-text></span></div></div><div class="oasis-editor-dialog-row oasis-editor-font-dialog-color-row"><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-color-mode-group"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-color-mode><option value=automatic></option><option value=custom></option></select><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-highlight></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-shading></div></div><div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-underline-color></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row></div></div></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label>`);
31814
32129
  function FontTab(props) {
31815
32130
  const t = useI18n();
31816
32131
  const {
31817
32132
  ctrl
31818
32133
  } = props;
32134
+ const effectToggles = () => [{
32135
+ testId: "editor-font-dialog-bold",
32136
+ label: t("dialog.font.bold"),
32137
+ labelStyle: {
32138
+ "font-weight": 700
32139
+ },
32140
+ checked: () => ctrl.fontTabValues().bold,
32141
+ onChange: (checked) => ctrl.updateFontTab("bold", checked)
32142
+ }, {
32143
+ testId: "editor-font-dialog-italic",
32144
+ label: t("dialog.font.italic"),
32145
+ labelStyle: {
32146
+ "font-style": "italic"
32147
+ },
32148
+ checked: () => ctrl.fontTabValues().italic,
32149
+ onChange: (checked) => ctrl.updateFontTab("italic", checked)
32150
+ }, {
32151
+ testId: "editor-font-dialog-underline",
32152
+ label: t("dialog.font.underline"),
32153
+ labelStyle: {
32154
+ "text-decoration": "underline"
32155
+ },
32156
+ checked: () => ctrl.fontTabValues().underline,
32157
+ onChange: (checked) => ctrl.setFontTabValues((current) => ({
32158
+ ...current,
32159
+ underline: checked,
32160
+ underlineStyle: checked ? current.underlineStyle === "none" ? "single" : current.underlineStyle : "none"
32161
+ }))
32162
+ }, {
32163
+ testId: "editor-font-dialog-strike",
32164
+ label: t("dialog.font.strike"),
32165
+ labelStyle: {
32166
+ "text-decoration": "line-through"
32167
+ },
32168
+ checked: () => ctrl.fontTabValues().strike,
32169
+ onChange: (checked) => ctrl.setFontTabValues((current) => ({
32170
+ ...current,
32171
+ strike: checked,
32172
+ doubleStrike: checked ? false : current.doubleStrike
32173
+ }))
32174
+ }, {
32175
+ testId: "editor-font-dialog-double-strike",
32176
+ label: t("dialog.font.doubleStrike"),
32177
+ checked: () => ctrl.fontTabValues().doubleStrike,
32178
+ onChange: (checked) => ctrl.setFontTabValues((current) => ({
32179
+ ...current,
32180
+ doubleStrike: checked,
32181
+ strike: checked ? false : current.strike
32182
+ }))
32183
+ }, {
32184
+ testId: "editor-font-dialog-superscript",
32185
+ label: t("toolbar.superscript"),
32186
+ checked: () => ctrl.fontTabValues().superscript,
32187
+ onChange: (checked) => ctrl.setFontTabValues((current) => ({
32188
+ ...current,
32189
+ superscript: checked,
32190
+ subscript: checked ? false : current.subscript
32191
+ }))
32192
+ }, {
32193
+ testId: "editor-font-dialog-subscript",
32194
+ label: t("toolbar.subscript"),
32195
+ checked: () => ctrl.fontTabValues().subscript,
32196
+ onChange: (checked) => ctrl.setFontTabValues((current) => ({
32197
+ ...current,
32198
+ subscript: checked,
32199
+ superscript: checked ? false : current.superscript
32200
+ }))
32201
+ }, {
32202
+ testId: "editor-font-dialog-small-caps",
32203
+ label: t("dialog.font.smallCaps"),
32204
+ checked: () => ctrl.fontTabValues().smallCaps,
32205
+ onChange: (checked) => ctrl.updateFontTab("smallCaps", checked)
32206
+ }, {
32207
+ testId: "editor-font-dialog-all-caps",
32208
+ label: t("dialog.font.allCaps"),
32209
+ checked: () => ctrl.fontTabValues().allCaps,
32210
+ onChange: (checked) => ctrl.updateFontTab("allCaps", checked)
32211
+ }, {
32212
+ testId: "editor-font-dialog-hidden",
32213
+ label: t("dialog.font.hidden"),
32214
+ checked: () => ctrl.fontTabValues().hidden,
32215
+ onChange: (checked) => ctrl.updateFontTab("hidden", checked)
32216
+ }];
31819
32217
  return (() => {
31820
- var _el$ = _tmpl$$9(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$2.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
31821
- _el$9.firstChild;
31822
- var _el$1 = _el$7.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
31823
- _el$11.firstChild;
31824
- var _el$13 = _el$6.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.nextSibling, _el$18 = _el$14.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$22.nextSibling, _el$24 = _el$23.nextSibling, _el$25 = _el$13.nextSibling, _el$26 = _el$25.firstChild, _el$27 = _el$26.firstChild, _el$28 = _el$27.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$28.nextSibling, _el$32 = _el$26.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$32.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$25.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$41.firstChild, _el$43 = _el$39.nextSibling, _el$44 = _el$43.firstChild, _el$45 = _el$44.nextSibling, _el$46 = _el$38.nextSibling, _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling, _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$50.nextSibling, _el$54 = _el$53.firstChild, _el$55 = _el$54.nextSibling, _el$56 = _el$53.nextSibling, _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling, _el$59 = _el$56.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$60.nextSibling, _el$62 = _el$59.nextSibling, _el$63 = _el$62.firstChild, _el$64 = _el$63.nextSibling, _el$65 = _el$62.nextSibling, _el$66 = _el$65.firstChild, _el$67 = _el$66.nextSibling, _el$68 = _el$65.nextSibling, _el$69 = _el$68.firstChild, _el$70 = _el$69.nextSibling, _el$71 = _el$68.nextSibling, _el$72 = _el$71.firstChild, _el$73 = _el$72.nextSibling, _el$74 = _el$71.nextSibling, _el$75 = _el$74.firstChild, _el$76 = _el$75.nextSibling, _el$77 = _el$74.nextSibling, _el$78 = _el$77.firstChild, _el$79 = _el$78.nextSibling, _el$80 = _el$46.nextSibling, _el$81 = _el$80.firstChild;
31825
- insert(_el$4, () => t("dialog.font.familyFilter"));
31826
- _el$5.$$input = (e) => ctrl.updateFontTab("familyFilter", e.currentTarget.value);
31827
- insert(_el$8, () => t("dialog.font.family"));
31828
- _el$9.addEventListener("change", (e) => ctrl.updateFontTab("fontFamily", e.currentTarget.value));
31829
- insert(_el$9, createComponent(For, {
31830
- get each() {
31831
- return ctrl.visibleFamilyOptions();
32218
+ var _el$ = _tmpl$$c(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$0.nextSibling, _el$12 = _el$8.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$7.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$18.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$22.nextSibling, _el$27 = _el$26.firstChild;
32219
+ insert(_el$2, createComponent(TextField, {
32220
+ "class": "oasis-editor-dialog-input-group-grow",
32221
+ get label() {
32222
+ return t("dialog.font.familyFilter");
32223
+ },
32224
+ get value() {
32225
+ return ctrl.fontTabValues().familyFilter;
32226
+ },
32227
+ onChange: (value) => ctrl.updateFontTab("familyFilter", value),
32228
+ "data-testid": "editor-font-dialog-family-filter"
32229
+ }));
32230
+ insert(_el$3, createComponent(SelectField, {
32231
+ "class": "oasis-editor-dialog-input-group-grow",
32232
+ get label() {
32233
+ return t("dialog.font.family");
32234
+ },
32235
+ get value() {
32236
+ return ctrl.fontTabValues().fontFamily;
32237
+ },
32238
+ onChange: (value) => ctrl.updateFontTab("fontFamily", value),
32239
+ "data-testid": "editor-font-dialog-family",
32240
+ get options() {
32241
+ return [{
32242
+ value: "",
32243
+ label: "—"
32244
+ }, ...ctrl.visibleFamilyOptions().map((family) => ({
32245
+ value: family,
32246
+ label: family
32247
+ }))];
32248
+ }
32249
+ }), null);
32250
+ insert(_el$3, createComponent(SelectField, {
32251
+ "class": "oasis-editor-font-dialog-size-group",
32252
+ get label() {
32253
+ return t("dialog.font.size");
32254
+ },
32255
+ get value() {
32256
+ return ctrl.fontTabValues().fontSize;
31832
32257
  },
31833
- children: (family) => (() => {
31834
- var _el$82 = _tmpl$2$5();
31835
- _el$82.value = family;
31836
- insert(_el$82, family);
31837
- return _el$82;
31838
- })()
32258
+ onChange: (value) => ctrl.updateFontTab("fontSize", value),
32259
+ "data-testid": "editor-font-dialog-size",
32260
+ get options() {
32261
+ return [{
32262
+ value: "",
32263
+ label: "—"
32264
+ }, ...ctrl.effectiveSizeOptions().map((size) => ({
32265
+ value: String(size),
32266
+ label: String(size)
32267
+ }))];
32268
+ }
31839
32269
  }), null);
31840
- insert(_el$10, () => t("dialog.font.size"));
31841
- _el$11.addEventListener("change", (e) => ctrl.updateFontTab("fontSize", e.currentTarget.value));
31842
- insert(_el$11, createComponent(For, {
31843
- get each() {
31844
- return ctrl.effectiveSizeOptions();
32270
+ insert(_el$5, createComponent(TextField, {
32271
+ get label() {
32272
+ return t("dialog.font.customSize");
31845
32273
  },
31846
- children: (size) => (() => {
31847
- var _el$83 = _tmpl$2$5();
31848
- insert(_el$83, size);
31849
- createRenderEffect(() => _el$83.value = String(size));
31850
- return _el$83;
31851
- })()
32274
+ get value() {
32275
+ return ctrl.fontTabValues().fontSize;
32276
+ },
32277
+ onChange: (value) => ctrl.updateFontTab("fontSize", value),
32278
+ "data-testid": "editor-font-dialog-custom-size"
32279
+ }), _el$6);
32280
+ insert(_el$6, () => ctrl.customSizeError());
32281
+ insert(_el$4, createComponent(SelectField, {
32282
+ "class": "oasis-editor-font-dialog-style-list-group",
32283
+ get label() {
32284
+ return t("dialog.font.styleList");
32285
+ },
32286
+ get value() {
32287
+ return ctrl.selectedFontStyle();
32288
+ },
32289
+ onChange: (value) => ctrl.applyFontStylePreset(value),
32290
+ "data-testid": "editor-font-dialog-style-list",
32291
+ get options() {
32292
+ return [{
32293
+ value: "regular",
32294
+ label: t("dialog.font.styleRegular")
32295
+ }, {
32296
+ value: "italic",
32297
+ label: t("dialog.font.styleItalic")
32298
+ }, {
32299
+ value: "bold",
32300
+ label: t("dialog.font.styleBold")
32301
+ }, {
32302
+ value: "boldItalic",
32303
+ label: t("dialog.font.styleBoldItalic")
32304
+ }];
32305
+ }
31852
32306
  }), null);
31853
- insert(_el$15, () => t("dialog.font.customSize"));
31854
- _el$16.$$input = (e) => ctrl.updateFontTab("fontSize", e.currentTarget.value);
31855
- insert(_el$17, () => ctrl.customSizeError());
31856
- insert(_el$19, () => t("dialog.font.styleList"));
31857
- _el$20.addEventListener("change", (e) => ctrl.applyFontStylePreset(e.currentTarget.value));
31858
- insert(_el$21, () => t("dialog.font.styleRegular"));
31859
- insert(_el$22, () => t("dialog.font.styleItalic"));
31860
- insert(_el$23, () => t("dialog.font.styleBold"));
31861
- insert(_el$24, () => t("dialog.font.styleBoldItalic"));
31862
- insert(_el$27, () => t("dialog.font.color"));
31863
- _el$28.addEventListener("change", (e) => ctrl.updateFontTab("colorMode", e.currentTarget.value));
31864
- insert(_el$29, () => t("toolbar.colorAutomatic"));
31865
- insert(_el$30, () => t("dialog.font.customColor"));
31866
- _el$31.$$input = (e) => ctrl.setFontTabValues((current) => ({
32307
+ insert(_el$9, () => t("dialog.font.color"));
32308
+ _el$0.addEventListener("change", (e) => ctrl.updateFontTab("colorMode", e.currentTarget.value));
32309
+ insert(_el$1, () => t("toolbar.colorAutomatic"));
32310
+ insert(_el$10, () => t("dialog.font.customColor"));
32311
+ _el$11.$$input = (e) => ctrl.setFontTabValues((current) => ({
31867
32312
  ...current,
31868
32313
  color: e.currentTarget.value,
31869
32314
  colorMode: "custom"
31870
32315
  }));
31871
- insert(_el$33, () => t("dialog.font.highlight"));
31872
- _el$34.$$input = (e) => ctrl.updateFontTab("highlight", e.currentTarget.value);
31873
- insert(_el$36, () => t("dialog.font.shading"));
31874
- _el$37.$$input = (e) => ctrl.updateFontTab("shading", e.currentTarget.value);
31875
- insert(_el$40, () => t("dialog.font.underlineStyle"));
31876
- _el$41.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31877
- ...current,
31878
- underlineStyle: e.currentTarget.value,
31879
- underline: e.currentTarget.value !== "none"
31880
- })));
31881
- insert(_el$42, () => t("toolbar.underlineRemove"));
31882
- insert(_el$41, createComponent(For, {
31883
- each: UNDERLINE_STYLE_OPTIONS,
31884
- children: (option) => (() => {
31885
- var _el$84 = _tmpl$2$5();
31886
- insert(_el$84, () => t(option.labelKey));
31887
- createRenderEffect(() => _el$84.value = option.value);
31888
- return _el$84;
31889
- })()
31890
- }), null);
31891
- insert(_el$44, () => t("dialog.font.underlineColor"));
31892
- _el$45.$$input = (e) => ctrl.setFontTabValues((current) => ({
32316
+ insert(_el$13, () => t("dialog.font.highlight"));
32317
+ _el$14.$$input = (e) => ctrl.updateFontTab("highlight", e.currentTarget.value);
32318
+ insert(_el$16, () => t("dialog.font.shading"));
32319
+ _el$17.$$input = (e) => ctrl.updateFontTab("shading", e.currentTarget.value);
32320
+ insert(_el$18, createComponent(SelectField, {
32321
+ "class": "oasis-editor-dialog-input-group-grow",
32322
+ get label() {
32323
+ return t("dialog.font.underlineStyle");
32324
+ },
32325
+ get value() {
32326
+ return ctrl.fontTabValues().underlineStyle;
32327
+ },
32328
+ onChange: (value) => ctrl.setFontTabValues((current) => ({
32329
+ ...current,
32330
+ underlineStyle: value,
32331
+ underline: value !== "none"
32332
+ })),
32333
+ "data-testid": "editor-font-dialog-underline-style",
32334
+ get options() {
32335
+ return [{
32336
+ value: "none",
32337
+ label: t("toolbar.underlineRemove")
32338
+ }, ...UNDERLINE_STYLE_OPTIONS.map((option) => ({
32339
+ value: option.value,
32340
+ label: t(option.labelKey)
32341
+ }))];
32342
+ }
32343
+ }), _el$19);
32344
+ insert(_el$20, () => t("dialog.font.underlineColor"));
32345
+ _el$21.$$input = (e) => ctrl.setFontTabValues((current) => ({
31893
32346
  ...current,
31894
32347
  underlineColor: e.currentTarget.value,
31895
32348
  underline: current.underlineStyle !== "none"
31896
32349
  }));
31897
- insert(_el$48, () => t("dialog.font.style"));
31898
- _el$51.addEventListener("change", (e) => ctrl.updateFontTab("bold", e.currentTarget.checked));
31899
- insert(_el$52, () => t("dialog.font.bold"));
31900
- _el$54.addEventListener("change", (e) => ctrl.updateFontTab("italic", e.currentTarget.checked));
31901
- insert(_el$55, () => t("dialog.font.italic"));
31902
- _el$57.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31903
- ...current,
31904
- underline: e.currentTarget.checked,
31905
- underlineStyle: e.currentTarget.checked ? current.underlineStyle === "none" ? "single" : current.underlineStyle : "none"
31906
- })));
31907
- insert(_el$58, () => t("dialog.font.underline"));
31908
- _el$60.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31909
- ...current,
31910
- strike: e.currentTarget.checked,
31911
- doubleStrike: e.currentTarget.checked ? false : current.doubleStrike
31912
- })));
31913
- insert(_el$61, () => t("dialog.font.strike"));
31914
- _el$63.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31915
- ...current,
31916
- doubleStrike: e.currentTarget.checked,
31917
- strike: e.currentTarget.checked ? false : current.strike
31918
- })));
31919
- insert(_el$64, () => t("dialog.font.doubleStrike"));
31920
- _el$66.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31921
- ...current,
31922
- superscript: e.currentTarget.checked,
31923
- subscript: e.currentTarget.checked ? false : current.subscript
31924
- })));
31925
- insert(_el$67, () => t("toolbar.superscript"));
31926
- _el$69.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
31927
- ...current,
31928
- subscript: e.currentTarget.checked,
31929
- superscript: e.currentTarget.checked ? false : current.superscript
31930
- })));
31931
- insert(_el$70, () => t("toolbar.subscript"));
31932
- _el$72.addEventListener("change", (e) => ctrl.updateFontTab("smallCaps", e.currentTarget.checked));
31933
- insert(_el$73, () => t("dialog.font.smallCaps"));
31934
- _el$75.addEventListener("change", (e) => ctrl.updateFontTab("allCaps", e.currentTarget.checked));
31935
- insert(_el$76, () => t("dialog.font.allCaps"));
31936
- _el$78.addEventListener("change", (e) => ctrl.updateFontTab("hidden", e.currentTarget.checked));
31937
- insert(_el$79, () => t("dialog.font.hidden"));
31938
- insert(_el$81, () => t("dialog.font.preview"));
31939
- insert(_el$80, createComponent(FontPreview, {
32350
+ insert(_el$24, () => t("dialog.font.style"));
32351
+ insert(_el$25, createComponent(For, {
32352
+ get each() {
32353
+ return effectToggles();
32354
+ },
32355
+ children: (toggle) => createComponent(ToggleChip, {
32356
+ get label() {
32357
+ return toggle.label;
32358
+ },
32359
+ get labelStyle() {
32360
+ return toggle.labelStyle;
32361
+ },
32362
+ get checked() {
32363
+ return toggle.checked();
32364
+ },
32365
+ get onChange() {
32366
+ return toggle.onChange;
32367
+ },
32368
+ get ["data-testid"]() {
32369
+ return toggle.testId;
32370
+ }
32371
+ })
32372
+ }));
32373
+ insert(_el$27, () => t("dialog.font.preview"));
32374
+ insert(_el$26, createComponent(FontPreview, {
31940
32375
  testId: "editor-font-dialog-preview",
31941
32376
  get style() {
31942
32377
  return ctrl.previewStyle();
@@ -31944,154 +32379,248 @@ function FontTab(props) {
31944
32379
  }), null);
31945
32380
  createRenderEffect((_p$) => {
31946
32381
  var _v$ = ctrl.fontTabValues().colorMode === "automatic", _v$2 = ctrl.fontTabValues().underlineStyle === "none";
31947
- _v$ !== _p$.e && (_el$31.disabled = _p$.e = _v$);
31948
- _v$2 !== _p$.t && (_el$45.disabled = _p$.t = _v$2);
32382
+ _v$ !== _p$.e && (_el$11.disabled = _p$.e = _v$);
32383
+ _v$2 !== _p$.t && (_el$21.disabled = _p$.t = _v$2);
31949
32384
  return _p$;
31950
32385
  }, {
31951
32386
  e: void 0,
31952
32387
  t: void 0
31953
32388
  });
31954
- createRenderEffect(() => _el$5.value = ctrl.fontTabValues().familyFilter);
31955
- createRenderEffect(() => _el$9.value = ctrl.fontTabValues().fontFamily);
31956
- createRenderEffect(() => _el$11.value = ctrl.fontTabValues().fontSize);
31957
- createRenderEffect(() => _el$16.value = ctrl.fontTabValues().fontSize);
31958
- createRenderEffect(() => _el$20.value = ctrl.selectedFontStyle());
31959
- createRenderEffect(() => _el$28.value = ctrl.fontTabValues().colorMode);
31960
- createRenderEffect(() => _el$31.value = ctrl.fontTabValues().color);
31961
- createRenderEffect(() => _el$34.value = ctrl.fontTabValues().highlight || DEFAULT_HIGHLIGHT);
31962
- createRenderEffect(() => _el$37.value = ctrl.fontTabValues().shading || DEFAULT_SHADING);
31963
- createRenderEffect(() => _el$41.value = ctrl.fontTabValues().underlineStyle);
31964
- createRenderEffect(() => _el$45.value = ctrl.fontTabValues().underlineColor || DEFAULT_COLOR);
31965
- createRenderEffect(() => _el$51.checked = ctrl.fontTabValues().bold);
31966
- createRenderEffect(() => _el$54.checked = ctrl.fontTabValues().italic);
31967
- createRenderEffect(() => _el$57.checked = ctrl.fontTabValues().underline);
31968
- createRenderEffect(() => _el$60.checked = ctrl.fontTabValues().strike);
31969
- createRenderEffect(() => _el$63.checked = ctrl.fontTabValues().doubleStrike);
31970
- createRenderEffect(() => _el$66.checked = ctrl.fontTabValues().superscript);
31971
- createRenderEffect(() => _el$69.checked = ctrl.fontTabValues().subscript);
31972
- createRenderEffect(() => _el$72.checked = ctrl.fontTabValues().smallCaps);
31973
- createRenderEffect(() => _el$75.checked = ctrl.fontTabValues().allCaps);
31974
- createRenderEffect(() => _el$78.checked = ctrl.fontTabValues().hidden);
32389
+ createRenderEffect(() => _el$0.value = ctrl.fontTabValues().colorMode);
32390
+ createRenderEffect(() => _el$11.value = ctrl.fontTabValues().color);
32391
+ createRenderEffect(() => _el$14.value = ctrl.fontTabValues().highlight || DEFAULT_HIGHLIGHT);
32392
+ createRenderEffect(() => _el$17.value = ctrl.fontTabValues().shading || DEFAULT_SHADING);
32393
+ createRenderEffect(() => _el$21.value = ctrl.fontTabValues().underlineColor || DEFAULT_COLOR);
31975
32394
  return _el$;
31976
32395
  })();
31977
32396
  }
31978
32397
  delegateEvents(["input"]);
31979
- var _tmpl$$8 = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-advanced-panel"><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-scale></select></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-spacing-mode><option value=normal></option><option value=expanded></option><option value=condensed></option></select><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label><input class="oasis-editor-dialog-input oasis-editor-font-dialog-small-input"data-testid=editor-font-dialog-advanced-spacing-amount></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-position-mode><option value=normal></option><option value=raised></option><option value=lowered></option></select><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label><input class="oasis-editor-dialog-input oasis-editor-font-dialog-small-input"data-testid=editor-font-dialog-advanced-position-amount></div><div class="oasis-editor-font-dialog-word-row oasis-editor-font-dialog-kerning-row"><label class="oasis-editor-dialog-style-toggle oasis-editor-font-dialog-kerning-toggle"><input type=checkbox data-testid=editor-font-dialog-advanced-kerning-enabled><span></span></label><input class="oasis-editor-dialog-input oasis-editor-font-dialog-kerning-input"data-testid=editor-font-dialog-advanced-kerning><span class="oasis-editor-dialog-help-text oasis-editor-font-dialog-kerning-suffix"></span></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-ligatures><option value></option><option value=none></option><option value=standard></option><option value=contextual></option><option value=historical></option><option value=standardContextual></option></select></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-number-spacing><option value></option><option value=proportional></option><option value=tabular></option></select></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-number-form><option value></option><option value=lining></option><option value=oldStyle></option></select></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-advanced-stylistic-set><option value></option></select></div><label class="oasis-editor-dialog-style-toggle oasis-editor-font-dialog-contextual-toggle"><input type=checkbox data-testid=editor-font-dialog-advanced-contextual-alternates><span></span></label></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend></fieldset><p class=oasis-editor-dialog-help-text data-testid=editor-font-dialog-advanced-placeholder>`), _tmpl$2$4 = /* @__PURE__ */ template(`<option>%`), _tmpl$3$3 = /* @__PURE__ */ template(`<option>`);
32398
+ var _tmpl$$b = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-advanced-panel"><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label></div><div class="oasis-editor-font-dialog-word-row oasis-editor-font-dialog-kerning-row"><span class="oasis-editor-dialog-help-text oasis-editor-font-dialog-kerning-suffix"></span></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend></fieldset><p class=oasis-editor-dialog-help-text data-testid=editor-font-dialog-advanced-placeholder>`);
31980
32399
  function AdvancedFontTab(props) {
31981
32400
  const t = useI18n();
31982
32401
  const {
31983
32402
  ctrl
31984
32403
  } = props;
31985
32404
  return (() => {
31986
- var _el$ = _tmpl$$8(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$1.nextSibling, _el$11 = _el$9.nextSibling, _el$12 = _el$11.nextSibling, _el$13 = _el$7.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.nextSibling, _el$19 = _el$15.nextSibling, _el$20 = _el$19.nextSibling, _el$21 = _el$13.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$22.nextSibling, _el$26 = _el$25.nextSibling, _el$27 = _el$2.nextSibling, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$33.nextSibling, _el$35 = _el$34.nextSibling, _el$36 = _el$35.nextSibling, _el$37 = _el$36.nextSibling, _el$38 = _el$29.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.nextSibling, _el$41 = _el$40.firstChild, _el$42 = _el$41.nextSibling, _el$43 = _el$42.nextSibling, _el$44 = _el$38.nextSibling, _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling, _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$48.nextSibling, _el$50 = _el$44.nextSibling, _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$50.nextSibling, _el$55 = _el$54.firstChild, _el$56 = _el$55.nextSibling, _el$57 = _el$27.nextSibling, _el$58 = _el$57.firstChild, _el$59 = _el$57.nextSibling;
32405
+ var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$2.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$16.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$18.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$12.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling;
31987
32406
  insert(_el$3, () => t("dialog.font.advancedCharacterSpacingGroup"));
31988
32407
  insert(_el$5, () => t("dialog.font.advancedScale"));
31989
- _el$6.addEventListener("change", (e) => ctrl.updateAdvancedTab("characterScale", e.currentTarget.value));
31990
- insert(_el$6, createComponent(For, {
31991
- each: WORD_CHARACTER_SCALES,
31992
- children: (scale) => (() => {
31993
- var _el$60 = _tmpl$2$4(), _el$61 = _el$60.firstChild;
31994
- insert(_el$60, scale, _el$61);
31995
- createRenderEffect(() => _el$60.value = String(scale));
31996
- return _el$60;
31997
- })()
31998
- }));
31999
- insert(_el$8, () => t("dialog.font.advancedSpacing"));
32000
- _el$9.addEventListener("change", (e) => ctrl.updateAdvancedTab("spacingMode", e.currentTarget.value));
32001
- insert(_el$0, () => t("dialog.font.advancedNormal"));
32002
- insert(_el$1, () => t("dialog.font.advancedExpanded"));
32003
- insert(_el$10, () => t("dialog.font.advancedCondensed"));
32004
- insert(_el$11, () => t("dialog.font.advancedBy"));
32005
- _el$12.$$input = (e) => ctrl.updateAdvancedTab("spacingAmount", e.currentTarget.value);
32006
- insert(_el$14, () => t("dialog.font.advancedPosition"));
32007
- _el$15.addEventListener("change", (e) => ctrl.updateAdvancedTab("positionMode", e.currentTarget.value));
32008
- insert(_el$16, () => t("dialog.font.advancedNormal"));
32009
- insert(_el$17, () => t("dialog.font.advancedRaised"));
32010
- insert(_el$18, () => t("dialog.font.advancedLowered"));
32011
- insert(_el$19, () => t("dialog.font.advancedBy"));
32012
- _el$20.$$input = (e) => ctrl.updateAdvancedTab("positionAmount", e.currentTarget.value);
32013
- _el$23.addEventListener("change", (e) => ctrl.setAdvancedTabValues((current) => ({
32014
- ...current,
32015
- kerningEnabled: e.currentTarget.checked,
32016
- kerningThreshold: e.currentTarget.checked ? current.kerningThreshold || "1" : current.kerningThreshold
32017
- })));
32018
- insert(_el$24, () => t("dialog.font.advancedKerning"));
32019
- _el$25.$$input = (e) => ctrl.updateAdvancedTab("kerningThreshold", e.currentTarget.value);
32020
- insert(_el$26, () => t("dialog.font.advancedKerningAbove"));
32021
- insert(_el$28, () => t("dialog.font.advancedOpenTypeGroup"));
32022
- insert(_el$30, () => t("dialog.font.advancedLigatures"));
32023
- _el$31.addEventListener("change", (e) => ctrl.updateAdvancedTab("ligatures", e.currentTarget.value));
32024
- insert(_el$32, () => t("dialog.font.advancedDefault"));
32025
- insert(_el$33, () => t("dialog.font.advancedLigaturesNone"));
32026
- insert(_el$34, () => t("dialog.font.advancedLigaturesStandard"));
32027
- insert(_el$35, () => t("dialog.font.advancedLigaturesContextual"));
32028
- insert(_el$36, () => t("dialog.font.advancedLigaturesHistorical"));
32029
- insert(_el$37, () => t("dialog.font.advancedLigaturesStandardContextual"));
32030
- insert(_el$39, () => t("dialog.font.advancedNumberSpacing"));
32031
- _el$40.addEventListener("change", (e) => ctrl.updateAdvancedTab("numberSpacing", e.currentTarget.value));
32032
- insert(_el$41, () => t("dialog.font.advancedDefault"));
32033
- insert(_el$42, () => t("dialog.font.advancedNumberSpacingProportional"));
32034
- insert(_el$43, () => t("dialog.font.advancedNumberSpacingTabular"));
32035
- insert(_el$45, () => t("dialog.font.advancedNumberForm"));
32036
- _el$46.addEventListener("change", (e) => ctrl.updateAdvancedTab("numberForm", e.currentTarget.value));
32037
- insert(_el$47, () => t("dialog.font.advancedDefault"));
32038
- insert(_el$48, () => t("dialog.font.advancedNumberFormLining"));
32039
- insert(_el$49, () => t("dialog.font.advancedNumberFormOldStyle"));
32040
- insert(_el$51, () => t("dialog.font.advancedStylisticSet"));
32041
- _el$52.addEventListener("change", (e) => ctrl.updateAdvancedTab("stylisticSet", e.currentTarget.value));
32042
- insert(_el$53, () => t("dialog.font.advancedDefault"));
32043
- insert(_el$52, createComponent(For, {
32044
- get each() {
32045
- return Array.from({
32408
+ insert(_el$4, createComponent(SelectField, {
32409
+ get value() {
32410
+ return ctrl.advancedTabValues().characterScale || "100";
32411
+ },
32412
+ onChange: (value) => ctrl.updateAdvancedTab("characterScale", value),
32413
+ "data-testid": "editor-font-dialog-advanced-scale",
32414
+ get options() {
32415
+ return WORD_CHARACTER_SCALES.map((scale) => ({
32416
+ value: String(scale),
32417
+ label: `${scale}%`
32418
+ }));
32419
+ }
32420
+ }), null);
32421
+ insert(_el$7, () => t("dialog.font.advancedSpacing"));
32422
+ insert(_el$6, createComponent(SelectField, {
32423
+ get value() {
32424
+ return ctrl.advancedTabValues().spacingMode;
32425
+ },
32426
+ onChange: (value) => ctrl.updateAdvancedTab("spacingMode", value),
32427
+ "data-testid": "editor-font-dialog-advanced-spacing-mode",
32428
+ get options() {
32429
+ return [{
32430
+ value: "normal",
32431
+ label: t("dialog.font.advancedNormal")
32432
+ }, {
32433
+ value: "expanded",
32434
+ label: t("dialog.font.advancedExpanded")
32435
+ }, {
32436
+ value: "condensed",
32437
+ label: t("dialog.font.advancedCondensed")
32438
+ }];
32439
+ }
32440
+ }), _el$8);
32441
+ insert(_el$8, () => t("dialog.font.advancedBy"));
32442
+ insert(_el$6, createComponent(TextField, {
32443
+ "class": "oasis-editor-font-dialog-small-input",
32444
+ get value() {
32445
+ return ctrl.advancedTabValues().spacingAmount;
32446
+ },
32447
+ get disabled() {
32448
+ return ctrl.advancedTabValues().spacingMode === "normal";
32449
+ },
32450
+ onChange: (value) => ctrl.updateAdvancedTab("spacingAmount", value),
32451
+ "data-testid": "editor-font-dialog-advanced-spacing-amount"
32452
+ }), null);
32453
+ insert(_el$0, () => t("dialog.font.advancedPosition"));
32454
+ insert(_el$9, createComponent(SelectField, {
32455
+ get value() {
32456
+ return ctrl.advancedTabValues().positionMode;
32457
+ },
32458
+ onChange: (value) => ctrl.updateAdvancedTab("positionMode", value),
32459
+ "data-testid": "editor-font-dialog-advanced-position-mode",
32460
+ get options() {
32461
+ return [{
32462
+ value: "normal",
32463
+ label: t("dialog.font.advancedNormal")
32464
+ }, {
32465
+ value: "raised",
32466
+ label: t("dialog.font.advancedRaised")
32467
+ }, {
32468
+ value: "lowered",
32469
+ label: t("dialog.font.advancedLowered")
32470
+ }];
32471
+ }
32472
+ }), _el$1);
32473
+ insert(_el$1, () => t("dialog.font.advancedBy"));
32474
+ insert(_el$9, createComponent(TextField, {
32475
+ "class": "oasis-editor-font-dialog-small-input",
32476
+ get value() {
32477
+ return ctrl.advancedTabValues().positionAmount;
32478
+ },
32479
+ get disabled() {
32480
+ return ctrl.advancedTabValues().positionMode === "normal";
32481
+ },
32482
+ onChange: (value) => ctrl.updateAdvancedTab("positionAmount", value),
32483
+ "data-testid": "editor-font-dialog-advanced-position-amount"
32484
+ }), null);
32485
+ insert(_el$10, createComponent(Checkbox, {
32486
+ "class": "oasis-editor-font-dialog-kerning-toggle",
32487
+ get label() {
32488
+ return t("dialog.font.advancedKerning");
32489
+ },
32490
+ get checked() {
32491
+ return ctrl.advancedTabValues().kerningEnabled;
32492
+ },
32493
+ onChange: (checked) => ctrl.setAdvancedTabValues((current) => ({
32494
+ ...current,
32495
+ kerningEnabled: checked,
32496
+ kerningThreshold: checked ? current.kerningThreshold || "1" : current.kerningThreshold
32497
+ })),
32498
+ "data-testid": "editor-font-dialog-advanced-kerning-enabled"
32499
+ }), _el$11);
32500
+ insert(_el$10, createComponent(TextField, {
32501
+ "class": "oasis-editor-font-dialog-kerning-input",
32502
+ get value() {
32503
+ return ctrl.advancedTabValues().kerningThreshold;
32504
+ },
32505
+ get disabled() {
32506
+ return !ctrl.advancedTabValues().kerningEnabled;
32507
+ },
32508
+ onChange: (value) => ctrl.updateAdvancedTab("kerningThreshold", value),
32509
+ "data-testid": "editor-font-dialog-advanced-kerning"
32510
+ }), _el$11);
32511
+ insert(_el$11, () => t("dialog.font.advancedKerningAbove"));
32512
+ insert(_el$13, () => t("dialog.font.advancedOpenTypeGroup"));
32513
+ insert(_el$15, () => t("dialog.font.advancedLigatures"));
32514
+ insert(_el$14, createComponent(SelectField, {
32515
+ get value() {
32516
+ return ctrl.advancedTabValues().ligatures;
32517
+ },
32518
+ onChange: (value) => ctrl.updateAdvancedTab("ligatures", value),
32519
+ "data-testid": "editor-font-dialog-advanced-ligatures",
32520
+ get options() {
32521
+ return [{
32522
+ value: "",
32523
+ label: t("dialog.font.advancedDefault")
32524
+ }, {
32525
+ value: "none",
32526
+ label: t("dialog.font.advancedLigaturesNone")
32527
+ }, {
32528
+ value: "standard",
32529
+ label: t("dialog.font.advancedLigaturesStandard")
32530
+ }, {
32531
+ value: "contextual",
32532
+ label: t("dialog.font.advancedLigaturesContextual")
32533
+ }, {
32534
+ value: "historical",
32535
+ label: t("dialog.font.advancedLigaturesHistorical")
32536
+ }, {
32537
+ value: "standardContextual",
32538
+ label: t("dialog.font.advancedLigaturesStandardContextual")
32539
+ }];
32540
+ }
32541
+ }), null);
32542
+ insert(_el$17, () => t("dialog.font.advancedNumberSpacing"));
32543
+ insert(_el$16, createComponent(SelectField, {
32544
+ get value() {
32545
+ return ctrl.advancedTabValues().numberSpacing;
32546
+ },
32547
+ onChange: (value) => ctrl.updateAdvancedTab("numberSpacing", value),
32548
+ "data-testid": "editor-font-dialog-advanced-number-spacing",
32549
+ get options() {
32550
+ return [{
32551
+ value: "",
32552
+ label: t("dialog.font.advancedDefault")
32553
+ }, {
32554
+ value: "proportional",
32555
+ label: t("dialog.font.advancedNumberSpacingProportional")
32556
+ }, {
32557
+ value: "tabular",
32558
+ label: t("dialog.font.advancedNumberSpacingTabular")
32559
+ }];
32560
+ }
32561
+ }), null);
32562
+ insert(_el$19, () => t("dialog.font.advancedNumberForm"));
32563
+ insert(_el$18, createComponent(SelectField, {
32564
+ get value() {
32565
+ return ctrl.advancedTabValues().numberForm;
32566
+ },
32567
+ onChange: (value) => ctrl.updateAdvancedTab("numberForm", value),
32568
+ "data-testid": "editor-font-dialog-advanced-number-form",
32569
+ get options() {
32570
+ return [{
32571
+ value: "",
32572
+ label: t("dialog.font.advancedDefault")
32573
+ }, {
32574
+ value: "lining",
32575
+ label: t("dialog.font.advancedNumberFormLining")
32576
+ }, {
32577
+ value: "oldStyle",
32578
+ label: t("dialog.font.advancedNumberFormOldStyle")
32579
+ }];
32580
+ }
32581
+ }), null);
32582
+ insert(_el$21, () => t("dialog.font.advancedStylisticSet"));
32583
+ insert(_el$20, createComponent(SelectField, {
32584
+ get value() {
32585
+ return ctrl.advancedTabValues().stylisticSet;
32586
+ },
32587
+ onChange: (value) => ctrl.updateAdvancedTab("stylisticSet", value),
32588
+ "data-testid": "editor-font-dialog-advanced-stylistic-set",
32589
+ get options() {
32590
+ return [{
32591
+ value: "",
32592
+ label: t("dialog.font.advancedDefault")
32593
+ }, ...Array.from({
32046
32594
  length: 20
32047
- }, (_, index) => index + 1);
32595
+ }, (_, index) => index + 1).map((set) => ({
32596
+ value: String(set),
32597
+ label: String(set)
32598
+ }))];
32599
+ }
32600
+ }), null);
32601
+ insert(_el$12, createComponent(Checkbox, {
32602
+ "class": "oasis-editor-font-dialog-contextual-toggle",
32603
+ get label() {
32604
+ return t("dialog.font.advancedContextualAlternates");
32605
+ },
32606
+ get checked() {
32607
+ return ctrl.advancedTabValues().contextualAlternates;
32048
32608
  },
32049
- children: (set) => (() => {
32050
- var _el$62 = _tmpl$3$3();
32051
- insert(_el$62, set);
32052
- createRenderEffect(() => _el$62.value = String(set));
32053
- return _el$62;
32054
- })()
32609
+ onChange: (checked) => ctrl.updateAdvancedTab("contextualAlternates", checked),
32610
+ "data-testid": "editor-font-dialog-advanced-contextual-alternates"
32055
32611
  }), null);
32056
- _el$55.addEventListener("change", (e) => ctrl.updateAdvancedTab("contextualAlternates", e.currentTarget.checked));
32057
- insert(_el$56, () => t("dialog.font.advancedContextualAlternates"));
32058
- insert(_el$58, () => t("dialog.font.advancedPreviewGroup"));
32059
- insert(_el$57, createComponent(FontPreview, {
32612
+ insert(_el$23, () => t("dialog.font.advancedPreviewGroup"));
32613
+ insert(_el$22, createComponent(FontPreview, {
32060
32614
  "class": "oasis-editor-dialog-preview oasis-editor-font-dialog-advanced-preview",
32061
32615
  testId: "editor-font-dialog-advanced-preview",
32062
32616
  get style() {
32063
32617
  return ctrl.previewStyle();
32064
32618
  }
32065
32619
  }), null);
32066
- insert(_el$59, () => ctrl.advancedValidationError() || t("dialog.font.advancedPlaceholder"));
32067
- createRenderEffect((_p$) => {
32068
- var _v$ = ctrl.advancedTabValues().spacingMode === "normal", _v$2 = ctrl.advancedTabValues().positionMode === "normal", _v$3 = !ctrl.advancedTabValues().kerningEnabled;
32069
- _v$ !== _p$.e && (_el$12.disabled = _p$.e = _v$);
32070
- _v$2 !== _p$.t && (_el$20.disabled = _p$.t = _v$2);
32071
- _v$3 !== _p$.a && (_el$25.disabled = _p$.a = _v$3);
32072
- return _p$;
32073
- }, {
32074
- e: void 0,
32075
- t: void 0,
32076
- a: void 0
32077
- });
32078
- createRenderEffect(() => _el$6.value = ctrl.advancedTabValues().characterScale || "100");
32079
- createRenderEffect(() => _el$9.value = ctrl.advancedTabValues().spacingMode);
32080
- createRenderEffect(() => _el$12.value = ctrl.advancedTabValues().spacingAmount);
32081
- createRenderEffect(() => _el$15.value = ctrl.advancedTabValues().positionMode);
32082
- createRenderEffect(() => _el$20.value = ctrl.advancedTabValues().positionAmount);
32083
- createRenderEffect(() => _el$23.checked = ctrl.advancedTabValues().kerningEnabled);
32084
- createRenderEffect(() => _el$25.value = ctrl.advancedTabValues().kerningThreshold);
32085
- createRenderEffect(() => _el$31.value = ctrl.advancedTabValues().ligatures);
32086
- createRenderEffect(() => _el$40.value = ctrl.advancedTabValues().numberSpacing);
32087
- createRenderEffect(() => _el$46.value = ctrl.advancedTabValues().numberForm);
32088
- createRenderEffect(() => _el$52.value = ctrl.advancedTabValues().stylisticSet);
32089
- createRenderEffect(() => _el$55.checked = ctrl.advancedTabValues().contextualAlternates);
32620
+ insert(_el$24, () => ctrl.advancedValidationError() || t("dialog.font.advancedPlaceholder"));
32090
32621
  return _el$;
32091
32622
  })();
32092
32623
  }
32093
- delegateEvents(["input"]);
32094
- var _tmpl$$7 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-font-dialog-cancel>`), _tmpl$2$3 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-font-dialog-apply>`);
32095
32624
  function FontDialog(props) {
32096
32625
  const t = useI18n();
32097
32626
  const ctrl = useFontDialogController(props);
@@ -32109,17 +32638,22 @@ function FontDialog(props) {
32109
32638
  bodyClass: "oasis-editor-font-dialog-body",
32110
32639
  size: "font",
32111
32640
  get footer() {
32112
- return [(() => {
32113
- var _el$ = _tmpl$$7();
32114
- addEventListener(_el$, "click", props.onClose, true);
32115
- insert(_el$, () => t("generic.cancel"));
32116
- return _el$;
32117
- })(), (() => {
32118
- var _el$2 = _tmpl$2$3();
32119
- addEventListener(_el$2, "click", ctrl.handleApply, true);
32120
- insert(_el$2, () => t("generic.ok"));
32121
- return _el$2;
32122
- })()];
32641
+ return createComponent(DialogFooter, {
32642
+ get onCancel() {
32643
+ return props.onClose;
32644
+ },
32645
+ get onConfirm() {
32646
+ return ctrl.handleApply;
32647
+ },
32648
+ get cancelLabel() {
32649
+ return t("generic.cancel");
32650
+ },
32651
+ get confirmLabel() {
32652
+ return t("generic.ok");
32653
+ },
32654
+ cancelTestId: "editor-font-dialog-cancel",
32655
+ confirmTestId: "editor-font-dialog-apply"
32656
+ });
32123
32657
  },
32124
32658
  get children() {
32125
32659
  return createComponent(Tabs, {
@@ -32152,8 +32686,7 @@ function FontDialog(props) {
32152
32686
  }
32153
32687
  });
32154
32688
  }
32155
- delegateEvents(["click"]);
32156
- var _tmpl$$6 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-align><option value=left></option><option value=center></option><option value=right></option><option value=justify>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input step=1 data-testid=editor-paragraph-dialog-indent-left></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input step=1 data-testid=editor-paragraph-dialog-indent-right>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-special><option value=none></option><option value=firstLine></option><option value=hanging></option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-special-by>`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-spacing-before></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-spacing-after></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0.5 step=0.05 data-testid=editor-paragraph-dialog-line-height>`), _tmpl$5$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-style><option value=none></option><option value=solid></option><option value=dashed></option><option value=dotted></option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=0.25 data-testid=editor-paragraph-dialog-border-width></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-shading>`), _tmpl$6$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-top></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-right></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-bottom></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-left>`), _tmpl$7$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`);
32689
+ var _tmpl$$a = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-shading>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`);
32157
32690
  const DEFAULT_BORDER_WIDTH_PT$1 = 0.5;
32158
32691
  const DEFAULT_BORDER_COLOR$1 = "#000000";
32159
32692
  function parseNumber$1(value) {
@@ -32164,16 +32697,16 @@ function parseNumber$1(value) {
32164
32697
  function ParagraphDialog(props) {
32165
32698
  const t = useI18n();
32166
32699
  const [align, setAlign] = createSignal("");
32167
- const [indentLeft, setIndentLeft] = createSignal("");
32168
- const [indentRight, setIndentRight] = createSignal("");
32700
+ const [indentLeft, setIndentLeft] = createSignal(null);
32701
+ const [indentRight, setIndentRight] = createSignal(null);
32169
32702
  const [special, setSpecial] = createSignal("none");
32170
- const [specialBy, setSpecialBy] = createSignal("");
32171
- const [spacingBefore, setSpacingBefore] = createSignal("");
32172
- const [spacingAfter, setSpacingAfter] = createSignal("");
32173
- const [lineHeight, setLineHeight] = createSignal("");
32703
+ const [specialBy, setSpecialBy] = createSignal(null);
32704
+ const [spacingBefore, setSpacingBefore] = createSignal(null);
32705
+ const [spacingAfter, setSpacingAfter] = createSignal(null);
32706
+ const [lineHeight, setLineHeight] = createSignal(null);
32174
32707
  const [shading, setShading] = createSignal("");
32175
32708
  const [borderStyle, setBorderStyle] = createSignal("none");
32176
- const [borderWidth, setBorderWidth] = createSignal("");
32709
+ const [borderWidth, setBorderWidth] = createSignal(null);
32177
32710
  const [borderColor, setBorderColor] = createSignal("");
32178
32711
  const [sideTop, setSideTop] = createSignal(false);
32179
32712
  const [sideRight, setSideRight] = createSignal(false);
@@ -32182,15 +32715,15 @@ function ParagraphDialog(props) {
32182
32715
  createEffect(() => {
32183
32716
  if (props.isOpen) {
32184
32717
  setAlign(props.initial.align ?? "");
32185
- setIndentLeft(props.initial.indentLeft ?? "");
32186
- setIndentRight(props.initial.indentRight ?? "");
32187
- setSpacingBefore(props.initial.spacingBefore ?? "");
32188
- setSpacingAfter(props.initial.spacingAfter ?? "");
32189
- setLineHeight(props.initial.lineHeight ?? "");
32718
+ setIndentLeft(parseNumber$1(props.initial.indentLeft ?? ""));
32719
+ setIndentRight(parseNumber$1(props.initial.indentRight ?? ""));
32720
+ setSpacingBefore(parseNumber$1(props.initial.spacingBefore ?? ""));
32721
+ setSpacingAfter(parseNumber$1(props.initial.spacingAfter ?? ""));
32722
+ setLineHeight(parseNumber$1(props.initial.lineHeight ?? ""));
32190
32723
  setShading(props.initial.shading ?? "");
32191
32724
  const initialBorderStyle = props.initial.borderStyle;
32192
32725
  setBorderStyle(initialBorderStyle === "solid" || initialBorderStyle === "dashed" || initialBorderStyle === "dotted" ? initialBorderStyle : "none");
32193
- setBorderWidth(props.initial.borderWidth ?? "");
32726
+ setBorderWidth(parseNumber$1(props.initial.borderWidth ?? ""));
32194
32727
  setBorderColor(props.initial.borderColor ?? "");
32195
32728
  setSideTop(props.initial.borderSideTop ?? false);
32196
32729
  setSideRight(props.initial.borderSideRight ?? false);
@@ -32200,24 +32733,24 @@ function ParagraphDialog(props) {
32200
32733
  const hanging = parseNumber$1(props.initial.indentHanging ?? "");
32201
32734
  if (hanging !== null && hanging > 0) {
32202
32735
  setSpecial("hanging");
32203
- setSpecialBy(props.initial.indentHanging ?? "");
32736
+ setSpecialBy(hanging);
32204
32737
  } else if (firstLine !== null && firstLine > 0) {
32205
32738
  setSpecial("firstLine");
32206
- setSpecialBy(props.initial.indentFirstLine ?? "");
32739
+ setSpecialBy(firstLine);
32207
32740
  } else {
32208
32741
  setSpecial("none");
32209
- setSpecialBy("");
32742
+ setSpecialBy(null);
32210
32743
  }
32211
32744
  }
32212
32745
  });
32213
32746
  const previewStyle = createMemo(() => {
32214
- const lh = parseNumber$1(lineHeight());
32215
- const left = parseNumber$1(indentLeft());
32216
- const right = parseNumber$1(indentRight());
32217
- const firstLine = special() === "firstLine" ? parseNumber$1(specialBy()) : null;
32218
- const hanging = special() === "hanging" ? parseNumber$1(specialBy()) : null;
32747
+ const lh = lineHeight();
32748
+ const left = indentLeft();
32749
+ const right = indentRight();
32750
+ const firstLine = special() === "firstLine" ? specialBy() : null;
32751
+ const hanging = special() === "hanging" ? specialBy() : null;
32219
32752
  const textIndent = firstLine !== null ? firstLine : hanging !== null ? -hanging : null;
32220
- const borderCss = borderStyle() !== "none" ? `${parseNumber$1(borderWidth()) ?? DEFAULT_BORDER_WIDTH_PT$1}pt ${borderStyle()} ${borderColor().trim() || DEFAULT_BORDER_COLOR$1}` : void 0;
32753
+ const borderCss = borderStyle() !== "none" ? `${borderWidth() ?? DEFAULT_BORDER_WIDTH_PT$1}pt ${borderStyle()} ${borderColor().trim() || DEFAULT_BORDER_COLOR$1}` : void 0;
32221
32754
  return {
32222
32755
  "text-align": align() || void 0,
32223
32756
  "line-height": lh !== null && lh > 0 ? String(lh) : void 0,
@@ -32241,7 +32774,7 @@ function ParagraphDialog(props) {
32241
32774
  left: null
32242
32775
  };
32243
32776
  }
32244
- const width = parseNumber$1(borderWidth());
32777
+ const width = borderWidth();
32245
32778
  const border = {
32246
32779
  type: style2,
32247
32780
  width: width !== null && width > 0 ? width : DEFAULT_BORDER_WIDTH_PT$1,
@@ -32255,16 +32788,16 @@ function ParagraphDialog(props) {
32255
32788
  };
32256
32789
  };
32257
32790
  const handleApply = () => {
32258
- const by = parseNumber$1(specialBy());
32791
+ const by = specialBy();
32259
32792
  props.onApply({
32260
32793
  align: align() || null,
32261
- indentLeft: parseNumber$1(indentLeft()),
32262
- indentRight: parseNumber$1(indentRight()),
32794
+ indentLeft: indentLeft(),
32795
+ indentRight: indentRight(),
32263
32796
  indentFirstLine: special() === "firstLine" ? by : null,
32264
32797
  indentHanging: special() === "hanging" ? by : null,
32265
- spacingBefore: parseNumber$1(spacingBefore()),
32266
- spacingAfter: parseNumber$1(spacingAfter()),
32267
- lineHeight: parseNumber$1(lineHeight()),
32798
+ spacingBefore: spacingBefore(),
32799
+ spacingAfter: spacingAfter(),
32800
+ lineHeight: lineHeight(),
32268
32801
  shading: shading().trim() || null,
32269
32802
  borders: resolveBorders()
32270
32803
  }, props.initial);
@@ -32297,137 +32830,271 @@ function ParagraphDialog(props) {
32297
32830
  });
32298
32831
  },
32299
32832
  get children() {
32300
- return [(() => {
32301
- var _el$ = _tmpl$$6(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling;
32302
- insert(_el$3, () => t("paragraph.alignLabel"));
32303
- _el$4.addEventListener("change", (e) => setAlign(e.currentTarget.value));
32304
- insert(_el$5, () => t("paragraph.alignLeft"));
32305
- insert(_el$6, () => t("paragraph.alignCenter"));
32306
- insert(_el$7, () => t("paragraph.alignRight"));
32307
- insert(_el$8, () => t("paragraph.alignJustify"));
32308
- createRenderEffect(() => _el$4.value = align());
32309
- return _el$;
32310
- })(), (() => {
32311
- var _el$9 = _tmpl$2$2(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$0.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
32312
- insert(_el$1, () => t("paragraph.indentLeftLabel"));
32313
- _el$10.$$input = (e) => setIndentLeft(e.currentTarget.value);
32314
- insert(_el$12, () => t("paragraph.indentRightLabel"));
32315
- _el$13.$$input = (e) => setIndentRight(e.currentTarget.value);
32316
- createRenderEffect(() => _el$10.value = indentLeft());
32317
- createRenderEffect(() => _el$13.value = indentRight());
32318
- return _el$9;
32319
- })(), (() => {
32320
- var _el$14 = _tmpl$3$2(), _el$15 = _el$14.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$19.nextSibling, _el$21 = _el$15.nextSibling, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling;
32321
- insert(_el$16, () => t("paragraph.specialLabel"));
32322
- _el$17.addEventListener("change", (e) => {
32323
- const next = e.currentTarget.value;
32324
- setSpecial(next);
32325
- if (next === "none") setSpecialBy("");
32326
- });
32327
- insert(_el$18, () => t("paragraph.specialNone"));
32328
- insert(_el$19, () => t("paragraph.specialFirstLine"));
32329
- insert(_el$20, () => t("paragraph.specialHanging"));
32330
- insert(_el$22, () => t("paragraph.specialByLabel"));
32331
- _el$23.$$input = (e) => setSpecialBy(e.currentTarget.value);
32332
- createRenderEffect(() => _el$23.disabled = special() === "none");
32333
- createRenderEffect(() => _el$17.value = special());
32334
- createRenderEffect(() => _el$23.value = specialBy());
32335
- return _el$14;
32336
- })(), (() => {
32337
- var _el$24 = _tmpl$4$2(), _el$25 = _el$24.firstChild, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$25.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$28.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling;
32338
- insert(_el$26, () => t("paragraph.spacingBeforeLabel"));
32339
- _el$27.$$input = (e) => setSpacingBefore(e.currentTarget.value);
32340
- insert(_el$29, () => t("paragraph.spacingAfterLabel"));
32341
- _el$30.$$input = (e) => setSpacingAfter(e.currentTarget.value);
32342
- insert(_el$32, () => t("paragraph.lineSpacingLabel"));
32343
- _el$33.$$input = (e) => setLineHeight(e.currentTarget.value);
32344
- createRenderEffect(() => _el$27.value = spacingBefore());
32345
- createRenderEffect(() => _el$30.value = spacingAfter());
32346
- createRenderEffect(() => _el$33.value = lineHeight());
32347
- return _el$24;
32348
- })(), (() => {
32349
- var _el$34 = _tmpl$5$2(), _el$35 = _el$34.firstChild, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, _el$40 = _el$39.nextSibling, _el$41 = _el$40.nextSibling, _el$42 = _el$35.nextSibling, _el$43 = _el$42.firstChild, _el$44 = _el$43.nextSibling, _el$45 = _el$42.nextSibling, _el$46 = _el$45.firstChild, _el$47 = _el$46.nextSibling, _el$48 = _el$45.nextSibling, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling;
32350
- insert(_el$36, () => t("paragraph.borderStyleLabel"));
32351
- _el$37.addEventListener("change", (e) => {
32352
- const next = e.currentTarget.value;
32353
- setBorderStyle(next);
32354
- if (next === "none") {
32355
- setSideTop(false);
32356
- setSideRight(false);
32357
- setSideBottom(false);
32358
- setSideLeft(false);
32359
- } else if (!sideTop() && !sideRight() && !sideBottom() && !sideLeft()) {
32360
- setSideTop(true);
32361
- setSideRight(true);
32362
- setSideBottom(true);
32363
- setSideLeft(true);
32833
+ return [createComponent(FieldRow, {
32834
+ get children() {
32835
+ return createComponent(SelectField, {
32836
+ get label() {
32837
+ return t("paragraph.alignLabel");
32838
+ },
32839
+ get value() {
32840
+ return align();
32841
+ },
32842
+ onChange: setAlign,
32843
+ "data-testid": "editor-paragraph-dialog-align",
32844
+ get options() {
32845
+ return [{
32846
+ value: "left",
32847
+ label: t("paragraph.alignLeft")
32848
+ }, {
32849
+ value: "center",
32850
+ label: t("paragraph.alignCenter")
32851
+ }, {
32852
+ value: "right",
32853
+ label: t("paragraph.alignRight")
32854
+ }, {
32855
+ value: "justify",
32856
+ label: t("paragraph.alignJustify")
32857
+ }];
32858
+ }
32859
+ });
32860
+ }
32861
+ }), createComponent(FieldRow, {
32862
+ get children() {
32863
+ return [createComponent(NumberField, {
32864
+ get label() {
32865
+ return t("paragraph.indentLeftLabel");
32866
+ },
32867
+ step: "1",
32868
+ get value() {
32869
+ return indentLeft() ?? "";
32870
+ },
32871
+ onChange: setIndentLeft,
32872
+ "data-testid": "editor-paragraph-dialog-indent-left"
32873
+ }), createComponent(NumberField, {
32874
+ get label() {
32875
+ return t("paragraph.indentRightLabel");
32876
+ },
32877
+ step: "1",
32878
+ get value() {
32879
+ return indentRight() ?? "";
32880
+ },
32881
+ onChange: setIndentRight,
32882
+ "data-testid": "editor-paragraph-dialog-indent-right"
32883
+ })];
32884
+ }
32885
+ }), createComponent(FieldRow, {
32886
+ get children() {
32887
+ return [createComponent(SelectField, {
32888
+ get label() {
32889
+ return t("paragraph.specialLabel");
32890
+ },
32891
+ get value() {
32892
+ return special();
32893
+ },
32894
+ onChange: (value) => {
32895
+ const next = value;
32896
+ setSpecial(next);
32897
+ if (next === "none") setSpecialBy(null);
32898
+ },
32899
+ "data-testid": "editor-paragraph-dialog-special",
32900
+ get options() {
32901
+ return [{
32902
+ value: "none",
32903
+ label: t("paragraph.specialNone")
32904
+ }, {
32905
+ value: "firstLine",
32906
+ label: t("paragraph.specialFirstLine")
32907
+ }, {
32908
+ value: "hanging",
32909
+ label: t("paragraph.specialHanging")
32910
+ }];
32911
+ }
32912
+ }), createComponent(NumberField, {
32913
+ get label() {
32914
+ return t("paragraph.specialByLabel");
32915
+ },
32916
+ min: "0",
32917
+ step: "1",
32918
+ get disabled() {
32919
+ return special() === "none";
32920
+ },
32921
+ get value() {
32922
+ return specialBy() ?? "";
32923
+ },
32924
+ onChange: setSpecialBy,
32925
+ "data-testid": "editor-paragraph-dialog-special-by"
32926
+ })];
32927
+ }
32928
+ }), createComponent(FieldRow, {
32929
+ get children() {
32930
+ return [createComponent(NumberField, {
32931
+ get label() {
32932
+ return t("paragraph.spacingBeforeLabel");
32933
+ },
32934
+ min: "0",
32935
+ step: "1",
32936
+ get value() {
32937
+ return spacingBefore() ?? "";
32938
+ },
32939
+ onChange: setSpacingBefore,
32940
+ "data-testid": "editor-paragraph-dialog-spacing-before"
32941
+ }), createComponent(NumberField, {
32942
+ get label() {
32943
+ return t("paragraph.spacingAfterLabel");
32944
+ },
32945
+ min: "0",
32946
+ step: "1",
32947
+ get value() {
32948
+ return spacingAfter() ?? "";
32949
+ },
32950
+ onChange: setSpacingAfter,
32951
+ "data-testid": "editor-paragraph-dialog-spacing-after"
32952
+ }), createComponent(NumberField, {
32953
+ get label() {
32954
+ return t("paragraph.lineSpacingLabel");
32955
+ },
32956
+ min: "0.5",
32957
+ step: "0.05",
32958
+ get value() {
32959
+ return lineHeight() ?? "";
32960
+ },
32961
+ onChange: setLineHeight,
32962
+ "data-testid": "editor-paragraph-dialog-line-height"
32963
+ })];
32964
+ }
32965
+ }), (() => {
32966
+ var _el$ = _tmpl$$a(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
32967
+ insert(_el$, createComponent(SelectField, {
32968
+ "class": "oasis-editor-dialog-input-group-grow",
32969
+ get label() {
32970
+ return t("paragraph.borderStyleLabel");
32971
+ },
32972
+ get value() {
32973
+ return borderStyle();
32974
+ },
32975
+ onChange: (value) => {
32976
+ const next = value;
32977
+ setBorderStyle(next);
32978
+ if (next === "none") {
32979
+ setSideTop(false);
32980
+ setSideRight(false);
32981
+ setSideBottom(false);
32982
+ setSideLeft(false);
32983
+ } else if (!sideTop() && !sideRight() && !sideBottom() && !sideLeft()) {
32984
+ setSideTop(true);
32985
+ setSideRight(true);
32986
+ setSideBottom(true);
32987
+ setSideLeft(true);
32988
+ }
32989
+ },
32990
+ "data-testid": "editor-paragraph-dialog-border-style",
32991
+ get options() {
32992
+ return [{
32993
+ value: "none",
32994
+ label: t("paragraph.borderNone")
32995
+ }, {
32996
+ value: "solid",
32997
+ label: t("paragraph.borderSolid")
32998
+ }, {
32999
+ value: "dashed",
33000
+ label: t("paragraph.borderDashed")
33001
+ }, {
33002
+ value: "dotted",
33003
+ label: t("paragraph.borderDotted")
33004
+ }];
32364
33005
  }
32365
- });
32366
- insert(_el$38, () => t("paragraph.borderNone"));
32367
- insert(_el$39, () => t("paragraph.borderSolid"));
32368
- insert(_el$40, () => t("paragraph.borderDashed"));
32369
- insert(_el$41, () => t("paragraph.borderDotted"));
32370
- insert(_el$43, () => t("paragraph.borderWidthLabel"));
32371
- _el$44.$$input = (e) => setBorderWidth(e.currentTarget.value);
32372
- insert(_el$46, () => t("paragraph.borderColorLabel"));
32373
- _el$47.$$input = (e) => setBorderColor(e.currentTarget.value);
32374
- insert(_el$49, () => t("paragraph.shadingLabel"));
32375
- _el$50.$$input = (e) => setShading(e.currentTarget.value);
32376
- createRenderEffect((_p$) => {
32377
- var _v$ = borderStyle() === "none", _v$2 = borderStyle() === "none";
32378
- _v$ !== _p$.e && (_el$44.disabled = _p$.e = _v$);
32379
- _v$2 !== _p$.t && (_el$47.disabled = _p$.t = _v$2);
32380
- return _p$;
32381
- }, {
32382
- e: void 0,
32383
- t: void 0
32384
- });
32385
- createRenderEffect(() => _el$37.value = borderStyle());
32386
- createRenderEffect(() => _el$44.value = borderWidth());
32387
- createRenderEffect(() => _el$47.value = borderColor() || DEFAULT_BORDER_COLOR$1);
32388
- createRenderEffect(() => _el$50.value = shading() || "#ffffff");
32389
- return _el$34;
33006
+ }), _el$2);
33007
+ insert(_el$, createComponent(NumberField, {
33008
+ "class": "oasis-editor-dialog-input-group-grow",
33009
+ get label() {
33010
+ return t("paragraph.borderWidthLabel");
33011
+ },
33012
+ min: "0",
33013
+ step: "0.25",
33014
+ get disabled() {
33015
+ return borderStyle() === "none";
33016
+ },
33017
+ get value() {
33018
+ return borderWidth() ?? "";
33019
+ },
33020
+ onChange: setBorderWidth,
33021
+ "data-testid": "editor-paragraph-dialog-border-width"
33022
+ }), _el$2);
33023
+ insert(_el$3, () => t("paragraph.borderColorLabel"));
33024
+ _el$4.$$input = (e) => setBorderColor(e.currentTarget.value);
33025
+ insert(_el$6, () => t("paragraph.shadingLabel"));
33026
+ _el$7.$$input = (e) => setShading(e.currentTarget.value);
33027
+ createRenderEffect(() => _el$4.disabled = borderStyle() === "none");
33028
+ createRenderEffect(() => _el$4.value = borderColor() || DEFAULT_BORDER_COLOR$1);
33029
+ createRenderEffect(() => _el$7.value = shading() || "#ffffff");
33030
+ return _el$;
32390
33031
  })(), (() => {
32391
- var _el$51 = _tmpl$6$2(), _el$52 = _el$51.firstChild, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$56 = _el$55.firstChild, _el$57 = _el$55.nextSibling, _el$58 = _el$57.firstChild, _el$59 = _el$57.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$59.nextSibling, _el$62 = _el$61.firstChild;
32392
- insert(_el$53, () => t("paragraph.borderSidesLabel"));
32393
- _el$56.addEventListener("change", (e) => setSideTop(e.currentTarget.checked));
32394
- insert(_el$55, () => t("paragraph.borderSideTop"), null);
32395
- _el$58.addEventListener("change", (e) => setSideRight(e.currentTarget.checked));
32396
- insert(_el$57, () => t("paragraph.borderSideRight"), null);
32397
- _el$60.addEventListener("change", (e) => setSideBottom(e.currentTarget.checked));
32398
- insert(_el$59, () => t("paragraph.borderSideBottom"), null);
32399
- _el$62.addEventListener("change", (e) => setSideLeft(e.currentTarget.checked));
32400
- insert(_el$61, () => t("paragraph.borderSideLeft"), null);
32401
- createRenderEffect((_p$) => {
32402
- var _v$3 = borderStyle() === "none", _v$4 = borderStyle() === "none", _v$5 = borderStyle() === "none", _v$6 = borderStyle() === "none";
32403
- _v$3 !== _p$.e && (_el$56.disabled = _p$.e = _v$3);
32404
- _v$4 !== _p$.t && (_el$58.disabled = _p$.t = _v$4);
32405
- _v$5 !== _p$.a && (_el$60.disabled = _p$.a = _v$5);
32406
- _v$6 !== _p$.o && (_el$62.disabled = _p$.o = _v$6);
32407
- return _p$;
32408
- }, {
32409
- e: void 0,
32410
- t: void 0,
32411
- a: void 0,
32412
- o: void 0
32413
- });
32414
- createRenderEffect(() => _el$56.checked = sideTop());
32415
- createRenderEffect(() => _el$58.checked = sideRight());
32416
- createRenderEffect(() => _el$60.checked = sideBottom());
32417
- createRenderEffect(() => _el$62.checked = sideLeft());
32418
- return _el$51;
33032
+ var _el$8 = _tmpl$2$2(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
33033
+ insert(_el$0, () => t("paragraph.borderSidesLabel"));
33034
+ insert(_el$1, createComponent(Checkbox, {
33035
+ get label() {
33036
+ return t("paragraph.borderSideTop");
33037
+ },
33038
+ get disabled() {
33039
+ return borderStyle() === "none";
33040
+ },
33041
+ get checked() {
33042
+ return sideTop();
33043
+ },
33044
+ onChange: setSideTop,
33045
+ "data-testid": "editor-paragraph-dialog-border-side-top"
33046
+ }), null);
33047
+ insert(_el$1, createComponent(Checkbox, {
33048
+ get label() {
33049
+ return t("paragraph.borderSideRight");
33050
+ },
33051
+ get disabled() {
33052
+ return borderStyle() === "none";
33053
+ },
33054
+ get checked() {
33055
+ return sideRight();
33056
+ },
33057
+ onChange: setSideRight,
33058
+ "data-testid": "editor-paragraph-dialog-border-side-right"
33059
+ }), null);
33060
+ insert(_el$1, createComponent(Checkbox, {
33061
+ get label() {
33062
+ return t("paragraph.borderSideBottom");
33063
+ },
33064
+ get disabled() {
33065
+ return borderStyle() === "none";
33066
+ },
33067
+ get checked() {
33068
+ return sideBottom();
33069
+ },
33070
+ onChange: setSideBottom,
33071
+ "data-testid": "editor-paragraph-dialog-border-side-bottom"
33072
+ }), null);
33073
+ insert(_el$1, createComponent(Checkbox, {
33074
+ get label() {
33075
+ return t("paragraph.borderSideLeft");
33076
+ },
33077
+ get disabled() {
33078
+ return borderStyle() === "none";
33079
+ },
33080
+ get checked() {
33081
+ return sideLeft();
33082
+ },
33083
+ onChange: setSideLeft,
33084
+ "data-testid": "editor-paragraph-dialog-border-side-left"
33085
+ }), null);
33086
+ return _el$8;
32419
33087
  })(), (() => {
32420
- var _el$63 = _tmpl$7$1(), _el$64 = _el$63.firstChild, _el$65 = _el$64.nextSibling;
32421
- insert(_el$64, () => t("paragraph.preview"));
32422
- insert(_el$65, () => t("paragraph.previewText"));
32423
- createRenderEffect((_$p) => style(_el$65, previewStyle(), _$p));
32424
- return _el$63;
33088
+ var _el$10 = _tmpl$3$1(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling;
33089
+ insert(_el$11, () => t("paragraph.preview"));
33090
+ insert(_el$12, () => t("paragraph.previewText"));
33091
+ createRenderEffect((_$p) => style(_el$12, previewStyle(), _$p));
33092
+ return _el$10;
32425
33093
  })()];
32426
33094
  }
32427
33095
  });
32428
33096
  }
32429
33097
  delegateEvents(["input"]);
32430
- var _tmpl$$5 = /* @__PURE__ */ template(`<div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input step=1>`), _tmpl$2$1 = /* @__PURE__ */ template(`<label class=oasis-editor-dialog-style-toggle><input type=checkbox>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><label class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><span class=oasis-editor-dialog-label></span><select class=oasis-editor-dialog-input data-testid=editor-table-properties-floating-h-anchor><option value=margin></option><option value=page></option><option value=text></option></select></label><label class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><span class=oasis-editor-dialog-label></span><select class=oasis-editor-dialog-input data-testid=editor-table-properties-floating-v-anchor><option value=margin></option><option value=page></option><option value=text>`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><label class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><span class=oasis-editor-dialog-label></span><select class=oasis-editor-dialog-input data-testid=editor-table-properties-floating-x-align><option value></option></select></label><label class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><span class=oasis-editor-dialog-label></span><select class=oasis-editor-dialog-input data-testid=editor-table-properties-floating-y-align><option value>`), _tmpl$5$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row>`), _tmpl$6$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-table-properties-table-width-unit><option value=points></option><option value=percent></option></select></div></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row></div><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row>`), _tmpl$7 = /* @__PURE__ */ template(`<label class=oasis-editor-dialog-style-toggle><input type=radio name=table-align>`), _tmpl$8 = /* @__PURE__ */ template(`<option>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-table-properties-row-height-rule><option value></option><option value=atLeast></option><option value=exact></option></select></div></div><div class=oasis-editor-dialog-style-row>`), _tmpl$0 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row>`), _tmpl$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-table-properties-cell-valign><option value></option><option value=top></option><option value=middle></option><option value=bottom></option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-table-properties-cell-direction><option value></option><option value=lrTb>lrTb</option><option value=tbRl>tbRl</option><option value=btLr>btLr</option><option value=lrTbV>lrTbV</option><option value=tbRlV>tbRlV</option></select></div></div><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-table-properties-border-style><option value=none></option><option value=solid></option><option value=dashed></option><option value=dotted></option></select></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-shading></div></div><div class=oasis-editor-dialog-style-row></div><div class=oasis-editor-table-properties-cell-preview data-testid=editor-table-properties-cell-preview>`), _tmpl$10 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input class=oasis-editor-dialog-input data-testid=editor-table-properties-alt-title></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><textarea class="oasis-editor-dialog-input oasis-editor-table-properties-textarea"data-testid=editor-table-properties-alt-description>`);
32431
33098
  const DEFAULT_BORDER_WIDTH_PT = 0.5;
32432
33099
  const DEFAULT_BORDER_COLOR = "#000000";
32433
33100
  function parseNumber(value) {
@@ -32449,241 +33116,8 @@ function resolveBorder(style2, widthValue, colorValue) {
32449
33116
  color: colorValue.trim() || DEFAULT_BORDER_COLOR
32450
33117
  };
32451
33118
  }
32452
- function numericInput(label, value, setter, testId, disabled = false, allowNegative = false) {
32453
- return (() => {
32454
- var _el$ = _tmpl$$5(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
32455
- insert(_el$2, label);
32456
- _el$3.$$input = (e) => setter(e.currentTarget.value);
32457
- setAttribute(_el$3, "min", allowNegative ? void 0 : "0");
32458
- _el$3.disabled = disabled;
32459
- setAttribute(_el$3, "data-testid", testId);
32460
- createRenderEffect(() => _el$3.value = value());
32461
- return _el$;
32462
- })();
32463
- }
32464
- function checkbox(label, checked, setter, testId, disabled = false) {
32465
- return (() => {
32466
- var _el$4 = _tmpl$2$1(), _el$5 = _el$4.firstChild;
32467
- _el$5.addEventListener("change", (e) => setter(e.currentTarget.checked));
32468
- _el$5.disabled = disabled;
32469
- setAttribute(_el$5, "data-testid", testId);
32470
- insert(_el$4, label, null);
32471
- createRenderEffect(() => _el$5.checked = checked());
32472
- return _el$4;
32473
- })();
32474
- }
32475
- function TableTabPanel(p) {
32476
- const t = useI18n();
32477
- return (() => {
32478
- var _el$6 = _tmpl$6$1(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$7.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$15.nextSibling, _el$17 = _el$13.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
32479
- insert(_el$8, () => t("table.sizeSection"));
32480
- insert(_el$9, () => numericInput(t("table.preferredWidth"), () => p.form.tableWidth, (v) => p.set("tableWidth", v), "editor-table-properties-table-width"), _el$0);
32481
- insert(_el$1, () => t("table.measureIn"));
32482
- _el$10.addEventListener("change", (e) => p.set("tableWidthUnit", e.currentTarget.value));
32483
- insert(_el$11, () => t("table.points"));
32484
- insert(_el$12, () => t("table.percent"));
32485
- insert(_el$14, () => t("table.alignmentSection"));
32486
- insert(_el$15, () => ["left", "center", "right"].map((align) => (() => {
32487
- var _el$43 = _tmpl$7(), _el$44 = _el$43.firstChild;
32488
- _el$44.addEventListener("change", () => p.set("tableAlign", align));
32489
- setAttribute(_el$44, "data-testid", `editor-table-properties-align-${align}`);
32490
- insert(_el$43, () => t(`table.align${align[0].toUpperCase()}${align.slice(1)}`), null);
32491
- createRenderEffect(() => _el$44.checked = p.form.tableAlign === align);
32492
- return _el$43;
32493
- })()));
32494
- insert(_el$16, () => numericInput(t("table.indentFromLeft"), () => p.form.tableIndentLeft, (v) => p.set("tableIndentLeft", v), "editor-table-properties-indent-left"));
32495
- insert(_el$18, () => t("table.textWrappingSection"));
32496
- insert(_el$19, () => checkbox(t("table.wrapNone"), () => p.form.tableWrapping === "none", () => p.set("tableWrapping", "none"), "editor-table-properties-wrap-none"), null);
32497
- insert(_el$19, () => checkbox(t("table.wrapAround"), () => p.form.tableWrapping === "around", () => p.set("tableWrapping", "around"), "editor-table-properties-wrap-around"), null);
32498
- insert(_el$17, createComponent(Show, {
32499
- get when() {
32500
- return p.form.tableWrapping === "around";
32501
- },
32502
- get children() {
32503
- return [(() => {
32504
- var _el$20 = _tmpl$3$1(), _el$21 = _el$20.firstChild, _el$22 = _el$21.firstChild, _el$23 = _el$22.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.nextSibling, _el$27 = _el$21.nextSibling, _el$28 = _el$27.firstChild, _el$29 = _el$28.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$31.nextSibling;
32505
- insert(_el$22, () => t("table.horizontalAnchor"));
32506
- _el$23.addEventListener("change", (e) => p.set("floatingHorizontalAnchor", e.currentTarget.value));
32507
- insert(_el$24, () => t("table.anchorMargin"));
32508
- insert(_el$25, () => t("table.anchorPage"));
32509
- insert(_el$26, () => t("table.anchorText"));
32510
- insert(_el$28, () => t("table.verticalAnchor"));
32511
- _el$29.addEventListener("change", (e) => p.set("floatingVerticalAnchor", e.currentTarget.value));
32512
- insert(_el$30, () => t("table.anchorMargin"));
32513
- insert(_el$31, () => t("table.anchorPage"));
32514
- insert(_el$32, () => t("table.anchorText"));
32515
- createRenderEffect(() => _el$23.value = p.form.floatingHorizontalAnchor);
32516
- createRenderEffect(() => _el$29.value = p.form.floatingVerticalAnchor);
32517
- return _el$20;
32518
- })(), (() => {
32519
- var _el$33 = _tmpl$4$1(), _el$34 = _el$33.firstChild, _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$36.firstChild, _el$38 = _el$34.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.nextSibling, _el$41 = _el$40.firstChild;
32520
- insert(_el$33, () => numericInput(t("table.positionX"), () => p.form.floatingX, (v) => p.set("floatingX", v), "editor-table-properties-floating-x", Boolean(p.form.floatingXAlign), true), _el$34);
32521
- insert(_el$33, () => numericInput(t("table.positionY"), () => p.form.floatingY, (v) => p.set("floatingY", v), "editor-table-properties-floating-y", Boolean(p.form.floatingYAlign), true), _el$34);
32522
- insert(_el$35, () => t("table.horizontalAlignment"));
32523
- _el$36.addEventListener("change", (e) => p.set("floatingXAlign", e.currentTarget.value));
32524
- insert(_el$37, () => t("table.explicitOffset"));
32525
- insert(_el$36, () => ["left", "center", "right", "inside", "outside"].map((value) => (() => {
32526
- var _el$45 = _tmpl$8();
32527
- _el$45.value = value;
32528
- insert(_el$45, value);
32529
- return _el$45;
32530
- })()), null);
32531
- insert(_el$39, () => t("table.verticalAlignment"));
32532
- _el$40.addEventListener("change", (e) => p.set("floatingYAlign", e.currentTarget.value));
32533
- insert(_el$41, () => t("table.explicitOffset"));
32534
- insert(_el$40, () => ["top", "center", "bottom", "inside", "outside"].map((value) => (() => {
32535
- var _el$46 = _tmpl$8();
32536
- _el$46.value = value;
32537
- insert(_el$46, value);
32538
- return _el$46;
32539
- })()), null);
32540
- createRenderEffect(() => _el$36.value = p.form.floatingXAlign);
32541
- createRenderEffect(() => _el$40.value = p.form.floatingYAlign);
32542
- return _el$33;
32543
- })(), (() => {
32544
- var _el$42 = _tmpl$5$1();
32545
- insert(_el$42, () => numericInput(t("table.distanceTop"), () => p.form.floatingDistanceTop, (v) => p.set("floatingDistanceTop", v), "editor-table-properties-floating-distance-top"), null);
32546
- insert(_el$42, () => numericInput(t("table.distanceRight"), () => p.form.floatingDistanceRight, (v) => p.set("floatingDistanceRight", v), "editor-table-properties-floating-distance-right"), null);
32547
- insert(_el$42, () => numericInput(t("table.distanceBottom"), () => p.form.floatingDistanceBottom, (v) => p.set("floatingDistanceBottom", v), "editor-table-properties-floating-distance-bottom"), null);
32548
- insert(_el$42, () => numericInput(t("table.distanceLeft"), () => p.form.floatingDistanceLeft, (v) => p.set("floatingDistanceLeft", v), "editor-table-properties-floating-distance-left"), null);
32549
- return _el$42;
32550
- })(), memo(() => checkbox(t("table.allowOverlap"), () => p.form.floatingOverlap === "overlap", (value) => p.set("floatingOverlap", value ? "overlap" : "never"), "editor-table-properties-floating-overlap"))];
32551
- }
32552
- }), null);
32553
- createRenderEffect(() => _el$10.value = p.form.tableWidthUnit);
32554
- return _el$6;
32555
- })();
32556
- }
32557
- function RowTabPanel(p) {
32558
- const t = useI18n();
32559
- return (() => {
32560
- var _el$47 = _tmpl$9(), _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.firstChild, _el$51 = _el$50.nextSibling, _el$52 = _el$51.firstChild, _el$53 = _el$52.nextSibling, _el$54 = _el$53.nextSibling, _el$55 = _el$48.nextSibling;
32561
- insert(_el$48, () => numericInput(t("table.rowHeight"), () => p.form.rowHeight, (v) => p.set("rowHeight", v), "editor-table-properties-row-height"), _el$49);
32562
- insert(_el$50, () => t("table.rowHeightRule"));
32563
- _el$51.addEventListener("change", (e) => p.set("rowHeightRule", e.currentTarget.value));
32564
- insert(_el$52, () => t("table.rowAuto"));
32565
- insert(_el$53, () => t("table.rowAtLeast"));
32566
- insert(_el$54, () => t("table.rowExactly"));
32567
- insert(_el$55, () => checkbox(t("table.repeatHeader"), () => p.form.repeatHeader, (v) => p.set("repeatHeader", v), "editor-table-properties-repeat-header"), null);
32568
- insert(_el$55, () => checkbox(t("table.allowBreakAcrossPages"), () => p.form.allowBreakAcrossPages, (v) => p.set("allowBreakAcrossPages", v), "editor-table-properties-allow-break"), null);
32569
- insert(_el$55, () => checkbox(t("table.hiddenRow"), () => p.form.hiddenRow, (v) => p.set("hiddenRow", v), "editor-table-properties-hidden-row"), null);
32570
- createRenderEffect(() => _el$51.value = p.form.rowHeightRule);
32571
- return _el$47;
32572
- })();
32573
- }
32574
- function ColumnTabPanel(p) {
32575
- const t = useI18n();
32576
- return (() => {
32577
- var _el$56 = _tmpl$0(), _el$57 = _el$56.firstChild;
32578
- insert(_el$57, () => numericInput(t("table.columnWidth"), () => p.form.columnWidth, (v) => p.set("columnWidth", v), "editor-table-properties-column-width"));
32579
- return _el$56;
32580
- })();
32581
- }
32582
- function CellTabPanel(p) {
32583
- const t = useI18n();
32584
- const borderPreview = createMemo(() => {
32585
- const border = resolveBorder(p.form.borderStyle, p.form.borderWidth, p.form.borderColor);
32586
- const css = border ? `${border.width}pt ${border.type} ${border.color}` : void 0;
32587
- return {
32588
- "background-color": p.form.shading.trim() || void 0,
32589
- "border-top": css && p.form.borderTop ? css : "1px solid #dadce0",
32590
- "border-right": css && p.form.borderRight ? css : "1px solid #dadce0",
32591
- "border-bottom": css && p.form.borderBottom ? css : "1px solid #dadce0",
32592
- "border-left": css && p.form.borderLeft ? css : "1px solid #dadce0"
32593
- };
32594
- });
32595
- return (() => {
32596
- var _el$58 = _tmpl$1(), _el$59 = _el$58.firstChild, _el$60 = _el$59.firstChild, _el$61 = _el$60.firstChild, _el$62 = _el$61.nextSibling, _el$63 = _el$62.firstChild, _el$64 = _el$63.nextSibling, _el$65 = _el$64.nextSibling, _el$66 = _el$65.nextSibling, _el$67 = _el$60.nextSibling, _el$68 = _el$67.firstChild, _el$69 = _el$68.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$59.nextSibling, _el$72 = _el$71.firstChild, _el$73 = _el$72.nextSibling, _el$74 = _el$71.nextSibling, _el$75 = _el$74.firstChild, _el$76 = _el$75.nextSibling, _el$77 = _el$74.nextSibling, _el$78 = _el$77.firstChild, _el$79 = _el$78.nextSibling, _el$80 = _el$79.firstChild, _el$81 = _el$80.firstChild, _el$82 = _el$81.nextSibling, _el$83 = _el$82.firstChild, _el$84 = _el$83.nextSibling, _el$85 = _el$84.nextSibling, _el$86 = _el$85.nextSibling, _el$87 = _el$80.nextSibling, _el$88 = _el$87.firstChild, _el$89 = _el$88.nextSibling, _el$90 = _el$87.nextSibling, _el$91 = _el$90.firstChild, _el$92 = _el$91.nextSibling, _el$93 = _el$79.nextSibling, _el$94 = _el$93.nextSibling;
32597
- insert(_el$59, () => numericInput(t("table.cellWidth"), () => p.form.cellWidth, (v) => p.set("cellWidth", v), "editor-table-properties-cell-width"), _el$60);
32598
- insert(_el$61, () => t("table.verticalAlignment"));
32599
- _el$62.addEventListener("change", (e) => p.set("cellVerticalAlign", e.currentTarget.value));
32600
- insert(_el$63, () => t("table.inherit"));
32601
- insert(_el$64, () => t("table.valignTop"));
32602
- insert(_el$65, () => t("table.valignMiddle"));
32603
- insert(_el$66, () => t("table.valignBottom"));
32604
- insert(_el$68, () => t("table.textDirection"));
32605
- _el$69.addEventListener("change", (e) => p.set("cellTextDirection", e.currentTarget.value));
32606
- insert(_el$70, () => t("table.inherit"));
32607
- insert(_el$72, () => t("table.options"));
32608
- insert(_el$73, () => checkbox(t("table.noWrap"), () => p.form.cellNoWrap, (v) => p.set("cellNoWrap", v), "editor-table-properties-cell-nowrap"), null);
32609
- insert(_el$73, () => checkbox(t("table.fitText"), () => p.form.cellFitText, (v) => p.set("cellFitText", v), "editor-table-properties-cell-fit-text"), null);
32610
- insert(_el$73, () => checkbox(t("table.hideMark"), () => p.form.cellHideMark, (v) => p.set("cellHideMark", v), "editor-table-properties-cell-hide-mark"), null);
32611
- insert(_el$75, () => t("table.cellMargins"));
32612
- insert(_el$76, () => numericInput(t("paragraph.borderSideTop"), () => p.form.marginTop, (v) => p.set("marginTop", v), "editor-table-properties-margin-top"), null);
32613
- insert(_el$76, () => numericInput(t("paragraph.borderSideRight"), () => p.form.marginRight, (v) => p.set("marginRight", v), "editor-table-properties-margin-right"), null);
32614
- insert(_el$76, () => numericInput(t("paragraph.borderSideBottom"), () => p.form.marginBottom, (v) => p.set("marginBottom", v), "editor-table-properties-margin-bottom"), null);
32615
- insert(_el$76, () => numericInput(t("paragraph.borderSideLeft"), () => p.form.marginLeft, (v) => p.set("marginLeft", v), "editor-table-properties-margin-left"), null);
32616
- insert(_el$78, () => t("paragraph.bordersSection"));
32617
- insert(_el$81, () => t("paragraph.borderStyleLabel"));
32618
- _el$82.addEventListener("change", (e) => {
32619
- const next = e.currentTarget.value;
32620
- p.set("borderStyle", next);
32621
- if (next === "none") {
32622
- p.set("borderTop", false);
32623
- p.set("borderRight", false);
32624
- p.set("borderBottom", false);
32625
- p.set("borderLeft", false);
32626
- p.set("borderStart", false);
32627
- p.set("borderEnd", false);
32628
- p.set("borderTlBr", false);
32629
- p.set("borderTrBl", false);
32630
- } else if (!p.form.borderTop && !p.form.borderRight && !p.form.borderBottom && !p.form.borderLeft) {
32631
- p.set("borderTop", true);
32632
- p.set("borderRight", true);
32633
- p.set("borderBottom", true);
32634
- p.set("borderLeft", true);
32635
- }
32636
- });
32637
- insert(_el$83, () => t("paragraph.borderNone"));
32638
- insert(_el$84, () => t("paragraph.borderSolid"));
32639
- insert(_el$85, () => t("paragraph.borderDashed"));
32640
- insert(_el$86, () => t("paragraph.borderDotted"));
32641
- insert(_el$79, () => numericInput(t("paragraph.borderWidthLabel"), () => p.form.borderWidth, (v) => p.set("borderWidth", v), "editor-table-properties-border-width", p.form.borderStyle === "none"), _el$87);
32642
- insert(_el$88, () => t("paragraph.borderColorLabel"));
32643
- _el$89.$$input = (e) => p.set("borderColor", e.currentTarget.value);
32644
- insert(_el$91, () => t("paragraph.shadingLabel"));
32645
- _el$92.$$input = (e) => p.set("shading", e.currentTarget.value);
32646
- insert(_el$93, () => checkbox(t("paragraph.borderSideTop"), () => p.form.borderTop, (v) => p.set("borderTop", v), "editor-table-properties-border-top", p.form.borderStyle === "none"), null);
32647
- insert(_el$93, () => checkbox(t("paragraph.borderSideRight"), () => p.form.borderRight, (v) => p.set("borderRight", v), "editor-table-properties-border-right", p.form.borderStyle === "none"), null);
32648
- insert(_el$93, () => checkbox(t("paragraph.borderSideBottom"), () => p.form.borderBottom, (v) => p.set("borderBottom", v), "editor-table-properties-border-bottom", p.form.borderStyle === "none"), null);
32649
- insert(_el$93, () => checkbox(t("paragraph.borderSideLeft"), () => p.form.borderLeft, (v) => p.set("borderLeft", v), "editor-table-properties-border-left", p.form.borderStyle === "none"), null);
32650
- insert(_el$93, () => checkbox(t("table.borderStart"), () => p.form.borderStart, (v) => p.set("borderStart", v), "editor-table-properties-border-start", p.form.borderStyle === "none"), null);
32651
- insert(_el$93, () => checkbox(t("table.borderEnd"), () => p.form.borderEnd, (v) => p.set("borderEnd", v), "editor-table-properties-border-end", p.form.borderStyle === "none"), null);
32652
- insert(_el$93, () => checkbox(t("table.borderTlBr"), () => p.form.borderTlBr, (v) => p.set("borderTlBr", v), "editor-table-properties-border-tlbr", p.form.borderStyle === "none"), null);
32653
- insert(_el$93, () => checkbox(t("table.borderTrBl"), () => p.form.borderTrBl, (v) => p.set("borderTrBl", v), "editor-table-properties-border-trbl", p.form.borderStyle === "none"), null);
32654
- createRenderEffect((_p$) => {
32655
- var _v$ = p.form.borderStyle === "none", _v$2 = borderPreview();
32656
- _v$ !== _p$.e && (_el$89.disabled = _p$.e = _v$);
32657
- _p$.t = style(_el$94, _v$2, _p$.t);
32658
- return _p$;
32659
- }, {
32660
- e: void 0,
32661
- t: void 0
32662
- });
32663
- createRenderEffect(() => _el$62.value = p.form.cellVerticalAlign);
32664
- createRenderEffect(() => _el$69.value = p.form.cellTextDirection);
32665
- createRenderEffect(() => _el$82.value = p.form.borderStyle);
32666
- createRenderEffect(() => _el$89.value = p.form.borderColor || DEFAULT_BORDER_COLOR);
32667
- createRenderEffect(() => _el$92.value = p.form.shading || "#ffffff");
32668
- return _el$58;
32669
- })();
32670
- }
32671
- function AltTextTabPanel(p) {
32672
- const t = useI18n();
32673
- return (() => {
32674
- var _el$95 = _tmpl$10(), _el$96 = _el$95.firstChild, _el$97 = _el$96.firstChild, _el$98 = _el$97.nextSibling, _el$99 = _el$96.nextSibling, _el$100 = _el$99.firstChild, _el$101 = _el$100.nextSibling;
32675
- insert(_el$97, () => t("table.altTitle"));
32676
- _el$98.$$input = (e) => p.set("altTitle", e.currentTarget.value);
32677
- insert(_el$100, () => t("table.altDescription"));
32678
- _el$101.$$input = (e) => p.set("altDescription", e.currentTarget.value);
32679
- createRenderEffect(() => _el$98.value = p.form.altTitle);
32680
- createRenderEffect(() => _el$101.value = p.form.altDescription);
32681
- return _el$95;
32682
- })();
32683
- }
32684
- function TablePropertiesDialog(props) {
32685
- const t = useI18n();
32686
- const [form, setForm] = createStore({
33119
+ function createDefaultFormState() {
33120
+ return {
32687
33121
  activeTab: "table",
32688
33122
  tableWidth: "",
32689
33123
  tableWidthUnit: "points",
@@ -32731,118 +33165,718 @@ function TablePropertiesDialog(props) {
32731
33165
  shading: "",
32732
33166
  altTitle: "",
32733
33167
  altDescription: ""
32734
- });
33168
+ };
33169
+ }
33170
+ function formStateFromInitial(initial) {
33171
+ return {
33172
+ activeTab: initial.activeTab ?? "table",
33173
+ tableWidth: initial.tableWidth,
33174
+ tableWidthUnit: initial.tableWidthUnit,
33175
+ tableAlign: initial.tableAlign,
33176
+ tableIndentLeft: initial.tableIndentLeft,
33177
+ tableWrapping: initial.tableWrapping,
33178
+ floatingHorizontalAnchor: initial.floatingHorizontalAnchor,
33179
+ floatingVerticalAnchor: initial.floatingVerticalAnchor,
33180
+ floatingX: initial.floatingX,
33181
+ floatingY: initial.floatingY,
33182
+ floatingXAlign: initial.floatingXAlign,
33183
+ floatingYAlign: initial.floatingYAlign,
33184
+ floatingDistanceTop: initial.floatingDistanceTop,
33185
+ floatingDistanceRight: initial.floatingDistanceRight,
33186
+ floatingDistanceBottom: initial.floatingDistanceBottom,
33187
+ floatingDistanceLeft: initial.floatingDistanceLeft,
33188
+ floatingOverlap: initial.floatingOverlap,
33189
+ rowHeight: initial.rowHeight,
33190
+ rowHeightRule: initial.rowHeightRule,
33191
+ repeatHeader: initial.repeatHeader,
33192
+ allowBreakAcrossPages: initial.allowBreakAcrossPages,
33193
+ hiddenRow: initial.hiddenRow,
33194
+ columnWidth: initial.columnWidth,
33195
+ cellWidth: initial.cellWidth,
33196
+ cellVerticalAlign: initial.cellVerticalAlign,
33197
+ cellTextDirection: initial.cellTextDirection,
33198
+ cellNoWrap: initial.cellNoWrap,
33199
+ cellFitText: initial.cellFitText,
33200
+ cellHideMark: initial.cellHideMark,
33201
+ marginTop: initial.marginTop,
33202
+ marginRight: initial.marginRight,
33203
+ marginBottom: initial.marginBottom,
33204
+ marginLeft: initial.marginLeft,
33205
+ borderStyle: initial.borderStyle,
33206
+ borderWidth: initial.borderWidth,
33207
+ borderColor: initial.borderColor,
33208
+ borderTop: initial.borderTop,
33209
+ borderRight: initial.borderRight,
33210
+ borderBottom: initial.borderBottom,
33211
+ borderLeft: initial.borderLeft,
33212
+ borderStart: initial.borderStart,
33213
+ borderEnd: initial.borderEnd,
33214
+ borderTlBr: initial.borderTopLeftToBottomRight,
33215
+ borderTrBl: initial.borderTopRightToBottomLeft,
33216
+ shading: initial.shading,
33217
+ altTitle: initial.altTitle,
33218
+ altDescription: initial.altDescription
33219
+ };
33220
+ }
33221
+ function buildTableApplyValues(form) {
33222
+ const border = resolveBorder(
33223
+ form.borderStyle,
33224
+ form.borderWidth,
33225
+ form.borderColor
33226
+ );
33227
+ return {
33228
+ tableWidth: parseWidth(form.tableWidth, form.tableWidthUnit),
33229
+ tableAlign: form.tableAlign || null,
33230
+ tableIndentLeft: parseWidth(form.tableIndentLeft, "points"),
33231
+ tableFloating: form.tableWrapping === "around" ? {
33232
+ horizontalAnchor: form.floatingHorizontalAnchor,
33233
+ verticalAnchor: form.floatingVerticalAnchor,
33234
+ ...form.floatingXAlign ? {
33235
+ xAlign: form.floatingXAlign
33236
+ } : { x: parseNumber(form.floatingX) ?? 0 },
33237
+ ...form.floatingYAlign ? {
33238
+ yAlign: form.floatingYAlign
33239
+ } : { y: parseNumber(form.floatingY) ?? 0 },
33240
+ distanceTop: parseNumber(form.floatingDistanceTop) ?? 0,
33241
+ distanceRight: parseNumber(form.floatingDistanceRight) ?? 0,
33242
+ distanceBottom: parseNumber(form.floatingDistanceBottom) ?? 0,
33243
+ distanceLeft: parseNumber(form.floatingDistanceLeft) ?? 0
33244
+ } : null,
33245
+ tableOverlap: form.tableWrapping === "around" ? form.floatingOverlap : null,
33246
+ rowHeight: parseWidth(form.rowHeight, "points"),
33247
+ rowHeightRule: form.rowHeightRule || null,
33248
+ repeatHeader: form.repeatHeader,
33249
+ cantSplit: !form.allowBreakAcrossPages,
33250
+ hiddenRow: form.hiddenRow,
33251
+ columnWidth: parseWidth(form.columnWidth, "points"),
33252
+ cellWidth: parseWidth(form.cellWidth, "points"),
33253
+ cellVerticalAlign: form.cellVerticalAlign || null,
33254
+ cellTextDirection: form.cellTextDirection || null,
33255
+ cellNoWrap: form.cellNoWrap,
33256
+ cellFitText: form.cellFitText,
33257
+ cellHideMark: form.cellHideMark,
33258
+ margins: {
33259
+ top: parseNumber(form.marginTop),
33260
+ right: parseNumber(form.marginRight),
33261
+ bottom: parseNumber(form.marginBottom),
33262
+ left: parseNumber(form.marginLeft)
33263
+ },
33264
+ borders: {
33265
+ top: form.borderTop ? border : null,
33266
+ right: form.borderRight ? border : null,
33267
+ bottom: form.borderBottom ? border : null,
33268
+ left: form.borderLeft ? border : null,
33269
+ start: form.borderStart ? border : null,
33270
+ end: form.borderEnd ? border : null,
33271
+ topLeftToBottomRight: form.borderTlBr ? border : null,
33272
+ topRightToBottomLeft: form.borderTrBl ? border : null
33273
+ },
33274
+ shading: form.shading.trim() || null,
33275
+ altTitle: form.altTitle.trim() || null,
33276
+ altDescription: form.altDescription.trim() || null
33277
+ };
33278
+ }
33279
+ function useTablePropertiesController(props) {
33280
+ const [form, setForm] = createStore(createDefaultFormState());
32735
33281
  createEffect(() => {
32736
33282
  if (!props.isOpen) return;
32737
- setForm(reconcile({
32738
- activeTab: props.initial.activeTab ?? "table",
32739
- tableWidth: props.initial.tableWidth,
32740
- tableWidthUnit: props.initial.tableWidthUnit,
32741
- tableAlign: props.initial.tableAlign,
32742
- tableIndentLeft: props.initial.tableIndentLeft,
32743
- tableWrapping: props.initial.tableWrapping,
32744
- floatingHorizontalAnchor: props.initial.floatingHorizontalAnchor,
32745
- floatingVerticalAnchor: props.initial.floatingVerticalAnchor,
32746
- floatingX: props.initial.floatingX,
32747
- floatingY: props.initial.floatingY,
32748
- floatingXAlign: props.initial.floatingXAlign,
32749
- floatingYAlign: props.initial.floatingYAlign,
32750
- floatingDistanceTop: props.initial.floatingDistanceTop,
32751
- floatingDistanceRight: props.initial.floatingDistanceRight,
32752
- floatingDistanceBottom: props.initial.floatingDistanceBottom,
32753
- floatingDistanceLeft: props.initial.floatingDistanceLeft,
32754
- floatingOverlap: props.initial.floatingOverlap,
32755
- rowHeight: props.initial.rowHeight,
32756
- rowHeightRule: props.initial.rowHeightRule,
32757
- repeatHeader: props.initial.repeatHeader,
32758
- allowBreakAcrossPages: props.initial.allowBreakAcrossPages,
32759
- hiddenRow: props.initial.hiddenRow,
32760
- columnWidth: props.initial.columnWidth,
32761
- cellWidth: props.initial.cellWidth,
32762
- cellVerticalAlign: props.initial.cellVerticalAlign,
32763
- cellTextDirection: props.initial.cellTextDirection,
32764
- cellNoWrap: props.initial.cellNoWrap,
32765
- cellFitText: props.initial.cellFitText,
32766
- cellHideMark: props.initial.cellHideMark,
32767
- marginTop: props.initial.marginTop,
32768
- marginRight: props.initial.marginRight,
32769
- marginBottom: props.initial.marginBottom,
32770
- marginLeft: props.initial.marginLeft,
32771
- borderStyle: props.initial.borderStyle,
32772
- borderWidth: props.initial.borderWidth,
32773
- borderColor: props.initial.borderColor,
32774
- borderTop: props.initial.borderTop,
32775
- borderRight: props.initial.borderRight,
32776
- borderBottom: props.initial.borderBottom,
32777
- borderLeft: props.initial.borderLeft,
32778
- borderStart: props.initial.borderStart,
32779
- borderEnd: props.initial.borderEnd,
32780
- borderTlBr: props.initial.borderTopLeftToBottomRight,
32781
- borderTrBl: props.initial.borderTopRightToBottomLeft,
32782
- shading: props.initial.shading,
32783
- altTitle: props.initial.altTitle,
32784
- altDescription: props.initial.altDescription
32785
- }));
33283
+ setForm(reconcile(formStateFromInitial(props.initial)));
32786
33284
  });
32787
33285
  const handleApply = () => {
32788
- const border = resolveBorder(form.borderStyle, form.borderWidth, form.borderColor);
32789
- props.onApply({
32790
- tableWidth: parseWidth(form.tableWidth, form.tableWidthUnit),
32791
- tableAlign: form.tableAlign || null,
32792
- tableIndentLeft: parseWidth(form.tableIndentLeft, "points"),
32793
- tableFloating: form.tableWrapping === "around" ? {
32794
- horizontalAnchor: form.floatingHorizontalAnchor,
32795
- verticalAnchor: form.floatingVerticalAnchor,
32796
- ...form.floatingXAlign ? {
32797
- xAlign: form.floatingXAlign
32798
- } : {
32799
- x: parseNumber(form.floatingX) ?? 0
32800
- },
32801
- ...form.floatingYAlign ? {
32802
- yAlign: form.floatingYAlign
32803
- } : {
32804
- y: parseNumber(form.floatingY) ?? 0
32805
- },
32806
- distanceTop: parseNumber(form.floatingDistanceTop) ?? 0,
32807
- distanceRight: parseNumber(form.floatingDistanceRight) ?? 0,
32808
- distanceBottom: parseNumber(form.floatingDistanceBottom) ?? 0,
32809
- distanceLeft: parseNumber(form.floatingDistanceLeft) ?? 0
32810
- } : null,
32811
- tableOverlap: form.tableWrapping === "around" ? form.floatingOverlap : null,
32812
- rowHeight: parseWidth(form.rowHeight, "points"),
32813
- rowHeightRule: form.rowHeightRule || null,
32814
- repeatHeader: form.repeatHeader,
32815
- cantSplit: !form.allowBreakAcrossPages,
32816
- hiddenRow: form.hiddenRow,
32817
- columnWidth: parseWidth(form.columnWidth, "points"),
32818
- cellWidth: parseWidth(form.cellWidth, "points"),
32819
- cellVerticalAlign: form.cellVerticalAlign || null,
32820
- cellTextDirection: form.cellTextDirection || null,
32821
- cellNoWrap: form.cellNoWrap,
32822
- cellFitText: form.cellFitText,
32823
- cellHideMark: form.cellHideMark,
32824
- margins: {
32825
- top: parseNumber(form.marginTop),
32826
- right: parseNumber(form.marginRight),
32827
- bottom: parseNumber(form.marginBottom),
32828
- left: parseNumber(form.marginLeft)
32829
- },
32830
- borders: {
32831
- top: form.borderTop ? border : null,
32832
- right: form.borderRight ? border : null,
32833
- bottom: form.borderBottom ? border : null,
32834
- left: form.borderLeft ? border : null,
32835
- start: form.borderStart ? border : null,
32836
- end: form.borderEnd ? border : null,
32837
- topLeftToBottomRight: form.borderTlBr ? border : null,
32838
- topRightToBottomLeft: form.borderTrBl ? border : null
32839
- },
32840
- shading: form.shading.trim() || null,
32841
- altTitle: form.altTitle.trim() || null,
32842
- altDescription: form.altDescription.trim() || null
32843
- }, props.initial);
33286
+ props.onApply(buildTableApplyValues(form), props.initial);
32844
33287
  props.onClose();
32845
33288
  };
33289
+ return { form, set: setForm, handleApply };
33290
+ }
33291
+ function NumField(label, value, setter, testId, disabled = false, allowNegative = false) {
33292
+ return createComponent(TextField, {
33293
+ "class": "oasis-editor-dialog-input-group-grow",
33294
+ type: "number",
33295
+ label,
33296
+ min: allowNegative ? void 0 : "0",
33297
+ step: "1",
33298
+ get value() {
33299
+ return value();
33300
+ },
33301
+ disabled,
33302
+ onChange: setter,
33303
+ "data-testid": testId
33304
+ });
33305
+ }
33306
+ var _tmpl$$9 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row>`);
33307
+ function TableTabPanel(props) {
33308
+ const t = useI18n();
33309
+ const form = () => props.ctrl.form;
33310
+ const set = props.ctrl.set;
33311
+ return (() => {
33312
+ var _el$ = _tmpl$2$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
33313
+ insert(_el$3, () => t("table.sizeSection"));
33314
+ insert(_el$4, () => NumField(t("table.preferredWidth"), () => form().tableWidth, (v) => set("tableWidth", v), "editor-table-properties-table-width"), null);
33315
+ insert(_el$4, createComponent(SelectField, {
33316
+ get label() {
33317
+ return t("table.measureIn");
33318
+ },
33319
+ get value() {
33320
+ return form().tableWidthUnit;
33321
+ },
33322
+ onChange: (value) => set("tableWidthUnit", value),
33323
+ "data-testid": "editor-table-properties-table-width-unit",
33324
+ get options() {
33325
+ return [{
33326
+ value: "points",
33327
+ label: t("table.points")
33328
+ }, {
33329
+ value: "percent",
33330
+ label: t("table.percent")
33331
+ }];
33332
+ }
33333
+ }), null);
33334
+ insert(_el$6, () => t("table.alignmentSection"));
33335
+ insert(_el$5, createComponent(RadioGroup, {
33336
+ "class": "oasis-editor-dialog-style-row",
33337
+ name: "table-align",
33338
+ get value() {
33339
+ return form().tableAlign;
33340
+ },
33341
+ onChange: (value) => set("tableAlign", value),
33342
+ get children() {
33343
+ return ["left", "center", "right"].map((align) => createComponent(Radio$1, {
33344
+ value: align,
33345
+ get label() {
33346
+ return t(`table.align${align[0].toUpperCase()}${align.slice(1)}`);
33347
+ },
33348
+ "data-testid": `editor-table-properties-align-${align}`
33349
+ }));
33350
+ }
33351
+ }), _el$7);
33352
+ insert(_el$7, () => NumField(t("table.indentFromLeft"), () => form().tableIndentLeft, (v) => set("tableIndentLeft", v), "editor-table-properties-indent-left"));
33353
+ insert(_el$9, () => t("table.textWrappingSection"));
33354
+ insert(_el$0, createComponent(Checkbox, {
33355
+ get label() {
33356
+ return t("table.wrapNone");
33357
+ },
33358
+ get checked() {
33359
+ return form().tableWrapping === "none";
33360
+ },
33361
+ onChange: () => set("tableWrapping", "none"),
33362
+ "data-testid": "editor-table-properties-wrap-none"
33363
+ }), null);
33364
+ insert(_el$0, createComponent(Checkbox, {
33365
+ get label() {
33366
+ return t("table.wrapAround");
33367
+ },
33368
+ get checked() {
33369
+ return form().tableWrapping === "around";
33370
+ },
33371
+ onChange: () => set("tableWrapping", "around"),
33372
+ "data-testid": "editor-table-properties-wrap-around"
33373
+ }), null);
33374
+ insert(_el$8, createComponent(Show, {
33375
+ get when() {
33376
+ return form().tableWrapping === "around";
33377
+ },
33378
+ get children() {
33379
+ return [(() => {
33380
+ var _el$1 = _tmpl$$9();
33381
+ insert(_el$1, createComponent(SelectField, {
33382
+ "class": "oasis-editor-dialog-input-group-grow",
33383
+ get label() {
33384
+ return t("table.horizontalAnchor");
33385
+ },
33386
+ get value() {
33387
+ return form().floatingHorizontalAnchor;
33388
+ },
33389
+ onChange: (value) => set("floatingHorizontalAnchor", value),
33390
+ "data-testid": "editor-table-properties-floating-h-anchor",
33391
+ get options() {
33392
+ return [{
33393
+ value: "margin",
33394
+ label: t("table.anchorMargin")
33395
+ }, {
33396
+ value: "page",
33397
+ label: t("table.anchorPage")
33398
+ }, {
33399
+ value: "text",
33400
+ label: t("table.anchorText")
33401
+ }];
33402
+ }
33403
+ }), null);
33404
+ insert(_el$1, createComponent(SelectField, {
33405
+ "class": "oasis-editor-dialog-input-group-grow",
33406
+ get label() {
33407
+ return t("table.verticalAnchor");
33408
+ },
33409
+ get value() {
33410
+ return form().floatingVerticalAnchor;
33411
+ },
33412
+ onChange: (value) => set("floatingVerticalAnchor", value),
33413
+ "data-testid": "editor-table-properties-floating-v-anchor",
33414
+ get options() {
33415
+ return [{
33416
+ value: "margin",
33417
+ label: t("table.anchorMargin")
33418
+ }, {
33419
+ value: "page",
33420
+ label: t("table.anchorPage")
33421
+ }, {
33422
+ value: "text",
33423
+ label: t("table.anchorText")
33424
+ }];
33425
+ }
33426
+ }), null);
33427
+ return _el$1;
33428
+ })(), (() => {
33429
+ var _el$10 = _tmpl$$9();
33430
+ insert(_el$10, () => NumField(t("table.positionX"), () => form().floatingX, (v) => set("floatingX", v), "editor-table-properties-floating-x", Boolean(form().floatingXAlign), true), null);
33431
+ insert(_el$10, () => NumField(t("table.positionY"), () => form().floatingY, (v) => set("floatingY", v), "editor-table-properties-floating-y", Boolean(form().floatingYAlign), true), null);
33432
+ insert(_el$10, createComponent(SelectField, {
33433
+ "class": "oasis-editor-dialog-input-group-grow",
33434
+ get label() {
33435
+ return t("table.horizontalAlignment");
33436
+ },
33437
+ get value() {
33438
+ return form().floatingXAlign;
33439
+ },
33440
+ onChange: (value) => set("floatingXAlign", value),
33441
+ "data-testid": "editor-table-properties-floating-x-align",
33442
+ get options() {
33443
+ return [{
33444
+ value: "",
33445
+ label: t("table.explicitOffset")
33446
+ }, ...["left", "center", "right", "inside", "outside"].map((value) => ({
33447
+ value,
33448
+ label: value
33449
+ }))];
33450
+ }
33451
+ }), null);
33452
+ insert(_el$10, createComponent(SelectField, {
33453
+ "class": "oasis-editor-dialog-input-group-grow",
33454
+ get label() {
33455
+ return t("table.verticalAlignment");
33456
+ },
33457
+ get value() {
33458
+ return form().floatingYAlign;
33459
+ },
33460
+ onChange: (value) => set("floatingYAlign", value),
33461
+ "data-testid": "editor-table-properties-floating-y-align",
33462
+ get options() {
33463
+ return [{
33464
+ value: "",
33465
+ label: t("table.explicitOffset")
33466
+ }, ...["top", "center", "bottom", "inside", "outside"].map((value) => ({
33467
+ value,
33468
+ label: value
33469
+ }))];
33470
+ }
33471
+ }), null);
33472
+ return _el$10;
33473
+ })(), (() => {
33474
+ var _el$11 = _tmpl$$9();
33475
+ insert(_el$11, () => NumField(t("table.distanceTop"), () => form().floatingDistanceTop, (v) => set("floatingDistanceTop", v), "editor-table-properties-floating-distance-top"), null);
33476
+ insert(_el$11, () => NumField(t("table.distanceRight"), () => form().floatingDistanceRight, (v) => set("floatingDistanceRight", v), "editor-table-properties-floating-distance-right"), null);
33477
+ insert(_el$11, () => NumField(t("table.distanceBottom"), () => form().floatingDistanceBottom, (v) => set("floatingDistanceBottom", v), "editor-table-properties-floating-distance-bottom"), null);
33478
+ insert(_el$11, () => NumField(t("table.distanceLeft"), () => form().floatingDistanceLeft, (v) => set("floatingDistanceLeft", v), "editor-table-properties-floating-distance-left"), null);
33479
+ return _el$11;
33480
+ })(), createComponent(Checkbox, {
33481
+ get label() {
33482
+ return t("table.allowOverlap");
33483
+ },
33484
+ get checked() {
33485
+ return form().floatingOverlap === "overlap";
33486
+ },
33487
+ onChange: (value) => set("floatingOverlap", value ? "overlap" : "never"),
33488
+ "data-testid": "editor-table-properties-floating-overlap"
33489
+ })];
33490
+ }
33491
+ }), null);
33492
+ return _el$;
33493
+ })();
33494
+ }
33495
+ var _tmpl$$8 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-style-row>`);
33496
+ function RowTabPanel(props) {
33497
+ const t = useI18n();
33498
+ const form = () => props.ctrl.form;
33499
+ const set = props.ctrl.set;
33500
+ return (() => {
33501
+ var _el$ = _tmpl$$8(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
33502
+ insert(_el$2, () => NumField(t("table.rowHeight"), () => form().rowHeight, (v) => set("rowHeight", v), "editor-table-properties-row-height"), null);
33503
+ insert(_el$2, createComponent(SelectField, {
33504
+ "class": "oasis-editor-dialog-input-group-grow",
33505
+ get label() {
33506
+ return t("table.rowHeightRule");
33507
+ },
33508
+ get value() {
33509
+ return form().rowHeightRule;
33510
+ },
33511
+ onChange: (value) => set("rowHeightRule", value),
33512
+ "data-testid": "editor-table-properties-row-height-rule",
33513
+ get options() {
33514
+ return [{
33515
+ value: "",
33516
+ label: t("table.rowAuto")
33517
+ }, {
33518
+ value: "atLeast",
33519
+ label: t("table.rowAtLeast")
33520
+ }, {
33521
+ value: "exact",
33522
+ label: t("table.rowExactly")
33523
+ }];
33524
+ }
33525
+ }), null);
33526
+ insert(_el$3, createComponent(Checkbox, {
33527
+ get label() {
33528
+ return t("table.repeatHeader");
33529
+ },
33530
+ get checked() {
33531
+ return form().repeatHeader;
33532
+ },
33533
+ onChange: (v) => set("repeatHeader", v),
33534
+ "data-testid": "editor-table-properties-repeat-header"
33535
+ }), null);
33536
+ insert(_el$3, createComponent(Checkbox, {
33537
+ get label() {
33538
+ return t("table.allowBreakAcrossPages");
33539
+ },
33540
+ get checked() {
33541
+ return form().allowBreakAcrossPages;
33542
+ },
33543
+ onChange: (v) => set("allowBreakAcrossPages", v),
33544
+ "data-testid": "editor-table-properties-allow-break"
33545
+ }), null);
33546
+ insert(_el$3, createComponent(Checkbox, {
33547
+ get label() {
33548
+ return t("table.hiddenRow");
33549
+ },
33550
+ get checked() {
33551
+ return form().hiddenRow;
33552
+ },
33553
+ onChange: (v) => set("hiddenRow", v),
33554
+ "data-testid": "editor-table-properties-hidden-row"
33555
+ }), null);
33556
+ return _el$;
33557
+ })();
33558
+ }
33559
+ var _tmpl$$7 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row>`);
33560
+ function ColumnTabPanel(props) {
33561
+ const t = useI18n();
33562
+ const form = () => props.ctrl.form;
33563
+ const set = props.ctrl.set;
33564
+ return (() => {
33565
+ var _el$ = _tmpl$$7(), _el$2 = _el$.firstChild;
33566
+ insert(_el$2, () => NumField(t("table.columnWidth"), () => form().columnWidth, (v) => set("columnWidth", v), "editor-table-properties-column-width"));
33567
+ return _el$;
33568
+ })();
33569
+ }
33570
+ var _tmpl$$6 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row></div><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-shading></div></div><div class=oasis-editor-dialog-style-row></div><div class=oasis-editor-table-properties-cell-preview data-testid=editor-table-properties-cell-preview>`);
33571
+ function CellTabPanel(props) {
33572
+ const t = useI18n();
33573
+ const form = () => props.ctrl.form;
33574
+ const set = props.ctrl.set;
33575
+ const borderPreview = createMemo(() => {
33576
+ const border = resolveBorder(form().borderStyle, form().borderWidth, form().borderColor);
33577
+ const css = border ? `${border.width}pt ${border.type} ${border.color}` : void 0;
33578
+ return {
33579
+ "background-color": form().shading.trim() || void 0,
33580
+ "border-top": css && form().borderTop ? css : "1px solid #dadce0",
33581
+ "border-right": css && form().borderRight ? css : "1px solid #dadce0",
33582
+ "border-bottom": css && form().borderBottom ? css : "1px solid #dadce0",
33583
+ "border-left": css && form().borderLeft ? css : "1px solid #dadce0"
33584
+ };
33585
+ });
33586
+ const borderDisabled = () => form().borderStyle === "none";
33587
+ return (() => {
33588
+ var _el$ = _tmpl$$6(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.nextSibling;
33589
+ insert(_el$2, () => NumField(t("table.cellWidth"), () => form().cellWidth, (v) => set("cellWidth", v), "editor-table-properties-cell-width"), null);
33590
+ insert(_el$2, createComponent(SelectField, {
33591
+ "class": "oasis-editor-dialog-input-group-grow",
33592
+ get label() {
33593
+ return t("table.verticalAlignment");
33594
+ },
33595
+ get value() {
33596
+ return form().cellVerticalAlign;
33597
+ },
33598
+ onChange: (value) => set("cellVerticalAlign", value),
33599
+ "data-testid": "editor-table-properties-cell-valign",
33600
+ get options() {
33601
+ return [{
33602
+ value: "",
33603
+ label: t("table.inherit")
33604
+ }, {
33605
+ value: "top",
33606
+ label: t("table.valignTop")
33607
+ }, {
33608
+ value: "middle",
33609
+ label: t("table.valignMiddle")
33610
+ }, {
33611
+ value: "bottom",
33612
+ label: t("table.valignBottom")
33613
+ }];
33614
+ }
33615
+ }), null);
33616
+ insert(_el$2, createComponent(SelectField, {
33617
+ "class": "oasis-editor-dialog-input-group-grow",
33618
+ get label() {
33619
+ return t("table.textDirection");
33620
+ },
33621
+ get value() {
33622
+ return form().cellTextDirection;
33623
+ },
33624
+ onChange: (value) => set("cellTextDirection", value),
33625
+ "data-testid": "editor-table-properties-cell-direction",
33626
+ get options() {
33627
+ return [{
33628
+ value: "",
33629
+ label: t("table.inherit")
33630
+ }, {
33631
+ value: "lrTb",
33632
+ label: "lrTb"
33633
+ }, {
33634
+ value: "tbRl",
33635
+ label: "tbRl"
33636
+ }, {
33637
+ value: "btLr",
33638
+ label: "btLr"
33639
+ }, {
33640
+ value: "lrTbV",
33641
+ label: "lrTbV"
33642
+ }, {
33643
+ value: "tbRlV",
33644
+ label: "tbRlV"
33645
+ }];
33646
+ }
33647
+ }), null);
33648
+ insert(_el$4, () => t("table.options"));
33649
+ insert(_el$5, createComponent(Checkbox, {
33650
+ get label() {
33651
+ return t("table.noWrap");
33652
+ },
33653
+ get checked() {
33654
+ return form().cellNoWrap;
33655
+ },
33656
+ onChange: (v) => set("cellNoWrap", v),
33657
+ "data-testid": "editor-table-properties-cell-nowrap"
33658
+ }), null);
33659
+ insert(_el$5, createComponent(Checkbox, {
33660
+ get label() {
33661
+ return t("table.fitText");
33662
+ },
33663
+ get checked() {
33664
+ return form().cellFitText;
33665
+ },
33666
+ onChange: (v) => set("cellFitText", v),
33667
+ "data-testid": "editor-table-properties-cell-fit-text"
33668
+ }), null);
33669
+ insert(_el$5, createComponent(Checkbox, {
33670
+ get label() {
33671
+ return t("table.hideMark");
33672
+ },
33673
+ get checked() {
33674
+ return form().cellHideMark;
33675
+ },
33676
+ onChange: (v) => set("cellHideMark", v),
33677
+ "data-testid": "editor-table-properties-cell-hide-mark"
33678
+ }), null);
33679
+ insert(_el$7, () => t("table.cellMargins"));
33680
+ insert(_el$8, () => NumField(t("paragraph.borderSideTop"), () => form().marginTop, (v) => set("marginTop", v), "editor-table-properties-margin-top"), null);
33681
+ insert(_el$8, () => NumField(t("paragraph.borderSideRight"), () => form().marginRight, (v) => set("marginRight", v), "editor-table-properties-margin-right"), null);
33682
+ insert(_el$8, () => NumField(t("paragraph.borderSideBottom"), () => form().marginBottom, (v) => set("marginBottom", v), "editor-table-properties-margin-bottom"), null);
33683
+ insert(_el$8, () => NumField(t("paragraph.borderSideLeft"), () => form().marginLeft, (v) => set("marginLeft", v), "editor-table-properties-margin-left"), null);
33684
+ insert(_el$0, () => t("paragraph.bordersSection"));
33685
+ insert(_el$1, createComponent(SelectField, {
33686
+ "class": "oasis-editor-dialog-input-group-grow",
33687
+ get label() {
33688
+ return t("paragraph.borderStyleLabel");
33689
+ },
33690
+ get value() {
33691
+ return form().borderStyle;
33692
+ },
33693
+ onChange: (value) => {
33694
+ const next = value;
33695
+ set("borderStyle", next);
33696
+ if (next === "none") {
33697
+ set("borderTop", false);
33698
+ set("borderRight", false);
33699
+ set("borderBottom", false);
33700
+ set("borderLeft", false);
33701
+ set("borderStart", false);
33702
+ set("borderEnd", false);
33703
+ set("borderTlBr", false);
33704
+ set("borderTrBl", false);
33705
+ } else if (!form().borderTop && !form().borderRight && !form().borderBottom && !form().borderLeft) {
33706
+ set("borderTop", true);
33707
+ set("borderRight", true);
33708
+ set("borderBottom", true);
33709
+ set("borderLeft", true);
33710
+ }
33711
+ },
33712
+ "data-testid": "editor-table-properties-border-style",
33713
+ get options() {
33714
+ return [{
33715
+ value: "none",
33716
+ label: t("paragraph.borderNone")
33717
+ }, {
33718
+ value: "solid",
33719
+ label: t("paragraph.borderSolid")
33720
+ }, {
33721
+ value: "dashed",
33722
+ label: t("paragraph.borderDashed")
33723
+ }, {
33724
+ value: "dotted",
33725
+ label: t("paragraph.borderDotted")
33726
+ }];
33727
+ }
33728
+ }), _el$10);
33729
+ insert(_el$1, () => NumField(t("paragraph.borderWidthLabel"), () => form().borderWidth, (v) => set("borderWidth", v), "editor-table-properties-border-width", borderDisabled()), _el$10);
33730
+ insert(_el$11, () => t("paragraph.borderColorLabel"));
33731
+ _el$12.$$input = (e) => set("borderColor", e.currentTarget.value);
33732
+ insert(_el$14, () => t("paragraph.shadingLabel"));
33733
+ _el$15.$$input = (e) => set("shading", e.currentTarget.value);
33734
+ insert(_el$16, createComponent(Checkbox, {
33735
+ get label() {
33736
+ return t("paragraph.borderSideTop");
33737
+ },
33738
+ get checked() {
33739
+ return form().borderTop;
33740
+ },
33741
+ get disabled() {
33742
+ return borderDisabled();
33743
+ },
33744
+ onChange: (v) => set("borderTop", v),
33745
+ "data-testid": "editor-table-properties-border-top"
33746
+ }), null);
33747
+ insert(_el$16, createComponent(Checkbox, {
33748
+ get label() {
33749
+ return t("paragraph.borderSideRight");
33750
+ },
33751
+ get checked() {
33752
+ return form().borderRight;
33753
+ },
33754
+ get disabled() {
33755
+ return borderDisabled();
33756
+ },
33757
+ onChange: (v) => set("borderRight", v),
33758
+ "data-testid": "editor-table-properties-border-right"
33759
+ }), null);
33760
+ insert(_el$16, createComponent(Checkbox, {
33761
+ get label() {
33762
+ return t("paragraph.borderSideBottom");
33763
+ },
33764
+ get checked() {
33765
+ return form().borderBottom;
33766
+ },
33767
+ get disabled() {
33768
+ return borderDisabled();
33769
+ },
33770
+ onChange: (v) => set("borderBottom", v),
33771
+ "data-testid": "editor-table-properties-border-bottom"
33772
+ }), null);
33773
+ insert(_el$16, createComponent(Checkbox, {
33774
+ get label() {
33775
+ return t("paragraph.borderSideLeft");
33776
+ },
33777
+ get checked() {
33778
+ return form().borderLeft;
33779
+ },
33780
+ get disabled() {
33781
+ return borderDisabled();
33782
+ },
33783
+ onChange: (v) => set("borderLeft", v),
33784
+ "data-testid": "editor-table-properties-border-left"
33785
+ }), null);
33786
+ insert(_el$16, createComponent(Checkbox, {
33787
+ get label() {
33788
+ return t("table.borderStart");
33789
+ },
33790
+ get checked() {
33791
+ return form().borderStart;
33792
+ },
33793
+ get disabled() {
33794
+ return borderDisabled();
33795
+ },
33796
+ onChange: (v) => set("borderStart", v),
33797
+ "data-testid": "editor-table-properties-border-start"
33798
+ }), null);
33799
+ insert(_el$16, createComponent(Checkbox, {
33800
+ get label() {
33801
+ return t("table.borderEnd");
33802
+ },
33803
+ get checked() {
33804
+ return form().borderEnd;
33805
+ },
33806
+ get disabled() {
33807
+ return borderDisabled();
33808
+ },
33809
+ onChange: (v) => set("borderEnd", v),
33810
+ "data-testid": "editor-table-properties-border-end"
33811
+ }), null);
33812
+ insert(_el$16, createComponent(Checkbox, {
33813
+ get label() {
33814
+ return t("table.borderTlBr");
33815
+ },
33816
+ get checked() {
33817
+ return form().borderTlBr;
33818
+ },
33819
+ get disabled() {
33820
+ return borderDisabled();
33821
+ },
33822
+ onChange: (v) => set("borderTlBr", v),
33823
+ "data-testid": "editor-table-properties-border-tlbr"
33824
+ }), null);
33825
+ insert(_el$16, createComponent(Checkbox, {
33826
+ get label() {
33827
+ return t("table.borderTrBl");
33828
+ },
33829
+ get checked() {
33830
+ return form().borderTrBl;
33831
+ },
33832
+ get disabled() {
33833
+ return borderDisabled();
33834
+ },
33835
+ onChange: (v) => set("borderTrBl", v),
33836
+ "data-testid": "editor-table-properties-border-trbl"
33837
+ }), null);
33838
+ createRenderEffect((_p$) => {
33839
+ var _v$ = borderDisabled(), _v$2 = borderPreview();
33840
+ _v$ !== _p$.e && (_el$12.disabled = _p$.e = _v$);
33841
+ _p$.t = style(_el$17, _v$2, _p$.t);
33842
+ return _p$;
33843
+ }, {
33844
+ e: void 0,
33845
+ t: void 0
33846
+ });
33847
+ createRenderEffect(() => _el$12.value = form().borderColor || DEFAULT_BORDER_COLOR);
33848
+ createRenderEffect(() => _el$15.value = form().shading || "#ffffff");
33849
+ return _el$;
33850
+ })();
33851
+ }
33852
+ delegateEvents(["input"]);
33853
+ var _tmpl$$5 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><textarea class="oasis-editor-ui-input oasis-editor-table-properties-textarea"data-testid=editor-table-properties-alt-description>`);
33854
+ function AltTextTabPanel(props) {
33855
+ const t = useI18n();
33856
+ const form = () => props.ctrl.form;
33857
+ const set = props.ctrl.set;
33858
+ return (() => {
33859
+ var _el$ = _tmpl$$5(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
33860
+ insert(_el$, createComponent(TextField, {
33861
+ get label() {
33862
+ return t("table.altTitle");
33863
+ },
33864
+ get value() {
33865
+ return form().altTitle;
33866
+ },
33867
+ onChange: (v) => set("altTitle", v),
33868
+ "data-testid": "editor-table-properties-alt-title"
33869
+ }), _el$2);
33870
+ insert(_el$3, () => t("table.altDescription"));
33871
+ _el$4.$$input = (e) => set("altDescription", e.currentTarget.value);
33872
+ createRenderEffect(() => _el$4.value = form().altDescription);
33873
+ return _el$;
33874
+ })();
33875
+ }
33876
+ delegateEvents(["input"]);
33877
+ function TablePropertiesDialog(props) {
33878
+ const t = useI18n();
33879
+ const ctrl = useTablePropertiesController(props);
32846
33880
  return createComponent(Dialog, {
32847
33881
  get isOpen() {
32848
33882
  return props.isOpen;
@@ -32861,7 +33895,9 @@ function TablePropertiesDialog(props) {
32861
33895
  get onCancel() {
32862
33896
  return props.onClose;
32863
33897
  },
32864
- onConfirm: handleApply,
33898
+ get onConfirm() {
33899
+ return ctrl.handleApply;
33900
+ },
32865
33901
  get cancelLabel() {
32866
33902
  return t("generic.cancel");
32867
33903
  },
@@ -32875,9 +33911,9 @@ function TablePropertiesDialog(props) {
32875
33911
  get children() {
32876
33912
  return createComponent(Tabs, {
32877
33913
  get value() {
32878
- return form.activeTab;
33914
+ return ctrl.form.activeTab;
32879
33915
  },
32880
- onChange: (tab) => setForm("activeTab", tab),
33916
+ onChange: (tab) => ctrl.set("activeTab", tab),
32881
33917
  get ariaLabel() {
32882
33918
  return t("table.propertiesTitle");
32883
33919
  },
@@ -32888,40 +33924,35 @@ function TablePropertiesDialog(props) {
32888
33924
  label: t("table.tabTable"),
32889
33925
  testId: "editor-table-properties-tab-table",
32890
33926
  panel: createComponent(TableTabPanel, {
32891
- form,
32892
- set: setForm
33927
+ ctrl
32893
33928
  })
32894
33929
  }, {
32895
33930
  id: "row",
32896
33931
  label: t("table.tabRow"),
32897
33932
  testId: "editor-table-properties-tab-row",
32898
33933
  panel: createComponent(RowTabPanel, {
32899
- form,
32900
- set: setForm
33934
+ ctrl
32901
33935
  })
32902
33936
  }, {
32903
33937
  id: "column",
32904
33938
  label: t("table.tabColumn"),
32905
33939
  testId: "editor-table-properties-tab-column",
32906
33940
  panel: createComponent(ColumnTabPanel, {
32907
- form,
32908
- set: setForm
33941
+ ctrl
32909
33942
  })
32910
33943
  }, {
32911
33944
  id: "cell",
32912
33945
  label: t("table.tabCell"),
32913
33946
  testId: "editor-table-properties-tab-cell",
32914
33947
  panel: createComponent(CellTabPanel, {
32915
- form,
32916
- set: setForm
33948
+ ctrl
32917
33949
  })
32918
33950
  }, {
32919
33951
  id: "altText",
32920
33952
  label: t("table.tabAltText"),
32921
33953
  testId: "editor-table-properties-tab-alt-text",
32922
33954
  panel: createComponent(AltTextTabPanel, {
32923
- form,
32924
- set: setForm
33955
+ ctrl
32925
33956
  })
32926
33957
  }];
32927
33958
  }
@@ -32929,7 +33960,6 @@ function TablePropertiesDialog(props) {
32929
33960
  }
32930
33961
  });
32931
33962
  }
32932
- delegateEvents(["input"]);
32933
33963
  var _tmpl$$4 = /* @__PURE__ */ template(`<div class=oasis-editor-find-replace-dialog><div class=oasis-editor-fr-header><span></span><button class=oasis-editor-fr-close><i data-lucide=x></i></button></div><div class=oasis-editor-fr-body><div class=oasis-editor-fr-input-group><div class=oasis-editor-fr-input-wrapper><input type=text autofocus class=oasis-editor-fr-input><span class=oasis-editor-fr-counter></span></div><div class=oasis-editor-fr-actions><button><i data-lucide=chevron-up></i></button><button><i data-lucide=chevron-down></i></button></div></div><div class=oasis-editor-fr-input-group><input type=text class=oasis-editor-fr-input><div class=oasis-editor-fr-actions><button class=oasis-editor-fr-btn-text></button><button class=oasis-editor-fr-btn-text></button></div></div><div class=oasis-editor-fr-options><label class=oasis-editor-fr-checkbox><input type=checkbox><span></span></label><label class=oasis-editor-fr-checkbox><input type=checkbox><span>`);
32934
33964
  function FindReplaceDialog(props) {
32935
33965
  const t = useI18n();
@@ -33523,7 +34553,7 @@ function EditorWorkspace(props) {
33523
34553
  }
33524
34554
  })];
33525
34555
  }
33526
- var _tmpl$$1 = /* @__PURE__ */ template(`<div class=oasis-editor-welcome-overlay role=dialog aria-modal=true aria-labelledby=oasis-editor-welcome-title><div class=oasis-editor-welcome-card><h2 id=oasis-editor-welcome-title class=oasis-editor-welcome-title></h2><p class=oasis-editor-welcome-body></p><p class=oasis-editor-welcome-note></p><div class=oasis-editor-welcome-actions><button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-welcome-skip></button><button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-welcome-enable>`);
34556
+ var _tmpl$$1 = /* @__PURE__ */ template(`<div class=oasis-editor-welcome-overlay role=dialog aria-modal=true aria-labelledby=oasis-editor-welcome-title><div class=oasis-editor-welcome-card><h2 id=oasis-editor-welcome-title class=oasis-editor-welcome-title></h2><p class=oasis-editor-welcome-body></p><p class=oasis-editor-welcome-note></p><div class=oasis-editor-welcome-actions>`);
33527
34557
  function WelcomeOverlay(props) {
33528
34558
  const t = useI18n();
33529
34559
  const handleEnable = () => {
@@ -33541,7 +34571,7 @@ function WelcomeOverlay(props) {
33541
34571
  return props.isOpen;
33542
34572
  },
33543
34573
  get children() {
33544
- var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
34574
+ var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
33545
34575
  insert(_el$2, createComponent(OasisBrandMark, {
33546
34576
  height: 72,
33547
34577
  "class": "oasis-editor-welcome-mark"
@@ -33549,15 +34579,26 @@ function WelcomeOverlay(props) {
33549
34579
  insert(_el$3, () => t("welcome.title"));
33550
34580
  insert(_el$4, () => t("welcome.body"));
33551
34581
  insert(_el$5, () => t("welcome.note"));
33552
- _el$7.$$click = handleSkip;
33553
- insert(_el$7, () => t("welcome.skip"));
33554
- _el$8.$$click = handleEnable;
33555
- insert(_el$8, () => t("welcome.enable"));
34582
+ insert(_el$6, createComponent(Button, {
34583
+ variant: "secondary",
34584
+ onClick: handleSkip,
34585
+ "data-testid": "editor-welcome-skip",
34586
+ get children() {
34587
+ return t("welcome.skip");
34588
+ }
34589
+ }), null);
34590
+ insert(_el$6, createComponent(Button, {
34591
+ variant: "primary",
34592
+ onClick: handleEnable,
34593
+ "data-testid": "editor-welcome-enable",
34594
+ get children() {
34595
+ return t("welcome.enable");
34596
+ }
34597
+ }), null);
33556
34598
  return _el$;
33557
34599
  }
33558
34600
  });
33559
34601
  }
33560
- delegateEvents(["click"]);
33561
34602
  const WORD_NS$1 = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
33562
34603
  const PACKAGE_REL_NS = "http://schemas.openxmlformats.org/package/2006/relationships";
33563
34604
  const OFFICE_REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
@@ -34108,10 +35149,9 @@ function serializeFloatingTableProperties(floating) {
34108
35149
  function serializeTableBorders(style2) {
34109
35150
  const borders = style2 == null ? void 0 : style2.borders;
34110
35151
  if (!borders) return "";
34111
- const xml = TABLE_BORDER_EDGE_KEYS.map(([name, key]) => [
34112
- name,
34113
- borders[key]
34114
- ]).filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
35152
+ const xml = TABLE_BORDER_EDGE_KEYS.map(
35153
+ ([name, key]) => [name, borders[key]]
35154
+ ).filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
34115
35155
  return xml ? `<w:tblBorders>${xml}</w:tblBorders>` : "";
34116
35156
  }
34117
35157
  function serializeTableProperties(table) {
@@ -36236,7 +37276,10 @@ function writeNotePart(zip, partName, part) {
36236
37276
  if (part.partContext.images.length > 0 || part.partContext.hyperlinks.length > 0) {
36237
37277
  zip.file(
36238
37278
  `word/_rels/${partName}.xml.rels`,
36239
- buildPartRelationshipsXml(part.partContext.images, part.partContext.hyperlinks)
37279
+ buildPartRelationshipsXml(
37280
+ part.partContext.images,
37281
+ part.partContext.hyperlinks
37282
+ )
36240
37283
  );
36241
37284
  }
36242
37285
  }
@@ -36836,7 +37879,11 @@ function resolveFragmentBounds(line, fragment, fontSizePx) {
36836
37879
  };
36837
37880
  }
36838
37881
  function fragmentRectPt(line, fragment, styles, originX, originY, yOffset, heightShrink) {
36839
- const bounds = resolveFragmentBounds(line, fragment, styles.fontSize ?? DEFAULT_FONT_SIZE_PX);
37882
+ const bounds = resolveFragmentBounds(
37883
+ line,
37884
+ fragment,
37885
+ styles.fontSize ?? DEFAULT_FONT_SIZE_PX
37886
+ );
36840
37887
  if (!bounds) return null;
36841
37888
  return {
36842
37889
  x: pxToPt$1(originX + bounds.left),
@@ -36870,7 +37917,8 @@ function drawFragmentBorder(writer, pageIndex, line, fragment, originX, originY,
36870
37917
  }
36871
37918
  function resolveGradientShadingName(writer, pageIndex, line, fragment, originX, originY, styles) {
36872
37919
  const fill = styles.textFill;
36873
- if (!fill || fill.type !== "gradient" || fill.stops.length < 2) return void 0;
37920
+ if (!fill || fill.type !== "gradient" || fill.stops.length < 2)
37921
+ return void 0;
36874
37922
  const bounds = resolveFragmentBounds(
36875
37923
  line,
36876
37924
  fragment,
@@ -36963,7 +38011,10 @@ function drawTabLeaders(writer, pageIndex, paragraph, line, fragment, document2,
36963
38011
  const slotByOffset = new Map(
36964
38012
  line.slots.map((slot) => [slot.offset, slot])
36965
38013
  );
36966
- const paragraphStyle = resolveEffectiveParagraphStyle(paragraph.style, document2.styles);
38014
+ const paragraphStyle = resolveEffectiveParagraphStyle(
38015
+ paragraph.style,
38016
+ document2.styles
38017
+ );
36967
38018
  const tabs = paragraphStyle.tabs ?? [];
36968
38019
  for (const char of fragment.chars) {
36969
38020
  if (char.char !== " ") continue;
@@ -37082,7 +38133,11 @@ function emitTextChunk(ctx, leftPx, text) {
37082
38133
  y: pxToPt$1(baselineY),
37083
38134
  text,
37084
38135
  color: mainColor,
37085
- ...gradientShadingName ? { gradientShadingName } : textOutline ? { renderMode: 2, strokeColor: textOutline.color ?? mainColor, strokeWidth: textOutline.widthPt } : { renderMode: styles.outline ? 1 : 0 }
38136
+ ...gradientShadingName ? { gradientShadingName } : textOutline ? {
38137
+ renderMode: 2,
38138
+ strokeColor: textOutline.color ?? mainColor,
38139
+ strokeWidth: textOutline.widthPt
38140
+ } : { renderMode: styles.outline ? 1 : 0 }
37086
38141
  });
37087
38142
  }
37088
38143
  function groupSlotChunksByWhitespace(chars) {
@@ -37192,7 +38247,44 @@ function drawFragmentDecoration(writer, pageIndex, line, fragment, originX, orig
37192
38247
  });
37193
38248
  return;
37194
38249
  }
37195
- drawUnderlineWithStyle(writer, pageIndex, x1, x2, y, stroke, styles.underlineStyle);
38250
+ drawUnderlineWithStyle(
38251
+ writer,
38252
+ pageIndex,
38253
+ x1,
38254
+ x2,
38255
+ y,
38256
+ stroke,
38257
+ styles.underlineStyle
38258
+ );
38259
+ }
38260
+ function drawLinkAnnotation(writer, pageIndex, line, fragment, originX, originY, styles) {
38261
+ if (!styles.link) return;
38262
+ const linkBounds = resolveFragmentBounds(
38263
+ line,
38264
+ fragment,
38265
+ styles.fontSize ?? DEFAULT_FONT_SIZE_PX
38266
+ );
38267
+ if (!linkBounds || linkBounds.right <= linkBounds.left) return;
38268
+ const isInternal = styles.link.startsWith("#");
38269
+ writer.addLinkAnnotation(pageIndex, {
38270
+ x: pxToPt$1(originX + linkBounds.left),
38271
+ y: pxToPt$1(originY + line.top),
38272
+ width: pxToPt$1(linkBounds.right - linkBounds.left),
38273
+ height: pxToPt$1(line.height),
38274
+ ...isInternal ? { destName: styles.link.slice(1) } : { uri: styles.link }
38275
+ });
38276
+ }
38277
+ function emitFragmentGlyphs(chunkCtx, chars, originX, styles, line, fragment, paragraphAlign) {
38278
+ const chunks = paragraphAlign === "justify" ? groupSlotChunksByWhitespace(chars) : groupSlotChunksByOffsetGaps(chars);
38279
+ for (const chunk of chunks) {
38280
+ const chunkText = chunk.map((c) => styles.allCaps ? c.char.toUpperCase() : c.char).join("");
38281
+ if (chunkText.length === 0) continue;
38282
+ emitTextChunk(chunkCtx, originX + chunk[0].left, chunkText);
38283
+ }
38284
+ if (line.trailingHyphen && fragment.endOffset >= line.endOffset) {
38285
+ const endSlot = line.slots.find((slot) => slot.offset === line.endOffset) ?? line.slots[line.slots.length - 1];
38286
+ if (endSlot) emitTextChunk(chunkCtx, originX + endSlot.left, "-");
38287
+ }
37196
38288
  }
37197
38289
  async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, document2, originX, originY, fontRegistry, drawers) {
37198
38290
  var _a2, _b2, _c;
@@ -37200,7 +38292,11 @@ async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, do
37200
38292
  if (fragment.image.floating) return;
37201
38293
  const slot = line.slots.find((c) => c.offset === fragment.startOffset) ?? line.slots.find((c) => c.offset >= fragment.startOffset);
37202
38294
  if (!slot) return;
37203
- const resourceName = await registerPdfImageRun(writer, document2, fragment.image);
38295
+ const resourceName = await registerPdfImageRun(
38296
+ writer,
38297
+ document2,
38298
+ fragment.image
38299
+ );
37204
38300
  if (!resourceName) return;
37205
38301
  writer.drawImage(pageIndex, {
37206
38302
  resourceName,
@@ -37241,34 +38337,63 @@ async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, do
37241
38337
  });
37242
38338
  const fontSizePt = styles.smallCaps ? textStyleToFontSizePt(styles) * 0.8 : textStyleToFontSizePt(styles);
37243
38339
  const baselineShiftPx = (styles.baselineShift ?? 0) * PX_PER_POINT;
37244
- const baselineY = originY + line.top + line.height * 0.8 - baselineShiftPx;
38340
+ const baselineY = originY + line.top + line.height * TEXT_BASELINE_RATIO - baselineShiftPx;
37245
38341
  const chars = resolveFragmentSlots(line, fragment);
37246
38342
  const text = chars.map((char) => styles.allCaps ? char.char.toUpperCase() : char.char).join("");
37247
38343
  const firstChar = chars[0];
37248
38344
  if (!firstChar || text.length === 0) return;
37249
- if (styles.link) {
37250
- const linkBounds = resolveFragmentBounds(
37251
- line,
37252
- fragment,
37253
- styles.fontSize ?? DEFAULT_FONT_SIZE_PX
37254
- );
37255
- if (linkBounds && linkBounds.right > linkBounds.left) {
37256
- const isInternal = styles.link.startsWith("#");
37257
- writer.addLinkAnnotation(pageIndex, {
37258
- x: pxToPt$1(originX + linkBounds.left),
37259
- y: pxToPt$1(originY + line.top),
37260
- width: pxToPt$1(linkBounds.right - linkBounds.left),
37261
- height: pxToPt$1(line.height),
37262
- ...isInternal ? { destName: styles.link.slice(1) } : { uri: styles.link }
37263
- });
37264
- }
37265
- }
37266
- drawFragmentShading(writer, pageIndex, line, fragment, originX, originY, styles);
37267
- drawFragmentHighlight(writer, pageIndex, line, fragment, originX, originY, styles);
37268
- drawFragmentBorder(writer, pageIndex, line, fragment, originX, originY, styles);
37269
- drawTabLeaders(writer, pageIndex, paragraph, line, fragment, document2, originX, baselineY, styles.color ?? "#000000");
38345
+ drawLinkAnnotation(
38346
+ writer,
38347
+ pageIndex,
38348
+ line,
38349
+ fragment,
38350
+ originX,
38351
+ originY,
38352
+ styles
38353
+ );
38354
+ drawFragmentShading(
38355
+ writer,
38356
+ pageIndex,
38357
+ line,
38358
+ fragment,
38359
+ originX,
38360
+ originY,
38361
+ styles
38362
+ );
38363
+ drawFragmentHighlight(
38364
+ writer,
38365
+ pageIndex,
38366
+ line,
38367
+ fragment,
38368
+ originX,
38369
+ originY,
38370
+ styles
38371
+ );
38372
+ drawFragmentBorder(
38373
+ writer,
38374
+ pageIndex,
38375
+ line,
38376
+ fragment,
38377
+ originX,
38378
+ originY,
38379
+ styles
38380
+ );
38381
+ drawTabLeaders(
38382
+ writer,
38383
+ pageIndex,
38384
+ paragraph,
38385
+ line,
38386
+ fragment,
38387
+ document2,
38388
+ originX,
38389
+ baselineY,
38390
+ styles.color ?? "#000000"
38391
+ );
37270
38392
  const paragraphAlign = resolveEffectiveParagraphStyle(paragraph.style, document2.styles).align ?? "left";
37271
- const fontFeatures = resolveOpenTypeFeatureTags(styles, textStyleToFontSizePt(styles));
38393
+ const fontFeatures = resolveOpenTypeFeatureTags(
38394
+ styles,
38395
+ textStyleToFontSizePt(styles)
38396
+ );
37272
38397
  const baseTextOptions = {
37273
38398
  fontSize: fontSizePt,
37274
38399
  bold: styles.bold,
@@ -37298,27 +38423,61 @@ async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, do
37298
38423
  styles,
37299
38424
  baseTextOptions
37300
38425
  };
37301
- const chunks = paragraphAlign === "justify" ? groupSlotChunksByWhitespace(chars) : groupSlotChunksByOffsetGaps(chars);
37302
- for (const chunk of chunks) {
37303
- const chunkText = chunk.map((c) => styles.allCaps ? c.char.toUpperCase() : c.char).join("");
37304
- if (chunkText.length === 0) continue;
37305
- emitTextChunk(chunkCtx, originX + chunk[0].left, chunkText);
37306
- }
37307
- if (line.trailingHyphen && fragment.endOffset >= line.endOffset) {
37308
- const endSlot = line.slots.find((slot) => slot.offset === line.endOffset) ?? line.slots[line.slots.length - 1];
37309
- if (endSlot) emitTextChunk(chunkCtx, originX + endSlot.left, "-");
37310
- }
38426
+ emitFragmentGlyphs(
38427
+ chunkCtx,
38428
+ chars,
38429
+ originX,
38430
+ styles,
38431
+ line,
38432
+ fragment,
38433
+ paragraphAlign
38434
+ );
37311
38435
  if (styles.underline) {
37312
- drawFragmentDecoration(writer, pageIndex, line, fragment, originX, originY, styles, "underline");
38436
+ drawFragmentDecoration(
38437
+ writer,
38438
+ pageIndex,
38439
+ line,
38440
+ fragment,
38441
+ originX,
38442
+ originY,
38443
+ styles,
38444
+ "underline"
38445
+ );
37313
38446
  }
37314
38447
  if (styles.strike) {
37315
- drawFragmentDecoration(writer, pageIndex, line, fragment, originX, originY, styles, "strike");
38448
+ drawFragmentDecoration(
38449
+ writer,
38450
+ pageIndex,
38451
+ line,
38452
+ fragment,
38453
+ originX,
38454
+ originY,
38455
+ styles,
38456
+ "strike"
38457
+ );
37316
38458
  }
37317
38459
  if (styles.doubleStrike) {
37318
- drawFragmentDecoration(writer, pageIndex, line, fragment, originX, originY, styles, "doubleStrike");
38460
+ drawFragmentDecoration(
38461
+ writer,
38462
+ pageIndex,
38463
+ line,
38464
+ fragment,
38465
+ originX,
38466
+ originY,
38467
+ styles,
38468
+ "doubleStrike"
38469
+ );
37319
38470
  }
37320
38471
  if (styles.emphasisMark) {
37321
- drawFragmentEmphasis(writer, pageIndex, line, fragment, originX, originY, styles);
38472
+ drawFragmentEmphasis(
38473
+ writer,
38474
+ pageIndex,
38475
+ line,
38476
+ fragment,
38477
+ originX,
38478
+ originY,
38479
+ styles
38480
+ );
37322
38481
  }
37323
38482
  }
37324
38483
  function getListOrdinals(document2) {
@@ -37358,7 +38517,7 @@ function drawListPrefix(writer, pageIndex, paragraph, line, document2, originX,
37358
38517
  );
37359
38518
  writer.drawText(pageIndex, {
37360
38519
  x: pxToPt$1(originX + Math.max(0, alignedInset || labelInset)),
37361
- y: pxToPt$1(originY + line.top + line.height * 0.8),
38520
+ y: pxToPt$1(originY + line.top + line.height * TEXT_BASELINE_RATIO),
37362
38521
  text: prefix,
37363
38522
  fontSize: fontSizePt,
37364
38523
  color: styles.color ?? "#000000",
@@ -38522,12 +39681,20 @@ function parseLayoutTableHeader(reader) {
38522
39681
  function parseLookupList(reader, lookupListOffset, parseSubtable2) {
38523
39682
  reader.seek(lookupListOffset);
38524
39683
  const lookupCount = reader.u16();
38525
- const lookupOffsets = readU16OffsetArray(reader, lookupCount, lookupListOffset);
39684
+ const lookupOffsets = readU16OffsetArray(
39685
+ reader,
39686
+ lookupCount,
39687
+ lookupListOffset
39688
+ );
38526
39689
  return lookupOffsets.map((lookupOffset) => {
38527
39690
  reader.seek(lookupOffset);
38528
39691
  const lookupType = reader.u16();
38529
39692
  reader.skip(2);
38530
- const subtableOffsets = readU16OffsetArray(reader, reader.u16(), lookupOffset);
39693
+ const subtableOffsets = readU16OffsetArray(
39694
+ reader,
39695
+ reader.u16(),
39696
+ lookupOffset
39697
+ );
38531
39698
  const subtables = [];
38532
39699
  for (const subtableOffset of subtableOffsets) {
38533
39700
  try {
@@ -38705,9 +39872,21 @@ function parseChainContextSubst(reader, offset) {
38705
39872
  reader.seek(offset);
38706
39873
  const format = reader.u16();
38707
39874
  if (format === 3) {
38708
- const backtrackCoverageOffsets = readU16OffsetArray(reader, reader.u16(), offset);
38709
- const inputCoverageOffsets = readU16OffsetArray(reader, reader.u16(), offset);
38710
- const lookaheadCoverageOffsets = readU16OffsetArray(reader, reader.u16(), offset);
39875
+ const backtrackCoverageOffsets = readU16OffsetArray(
39876
+ reader,
39877
+ reader.u16(),
39878
+ offset
39879
+ );
39880
+ const inputCoverageOffsets = readU16OffsetArray(
39881
+ reader,
39882
+ reader.u16(),
39883
+ offset
39884
+ );
39885
+ const lookaheadCoverageOffsets = readU16OffsetArray(
39886
+ reader,
39887
+ reader.u16(),
39888
+ offset
39889
+ );
38711
39890
  const substCount = reader.u16();
38712
39891
  const records = readSubstLookupRecords(reader, substCount);
38713
39892
  const backtrack = backtrackCoverageOffsets.map(
@@ -41012,7 +42191,7 @@ function buildImportedDocumentDiagnostics(document2) {
41012
42191
  );
41013
42192
  return {
41014
42193
  index,
41015
- text: getParagraphText(paragraph).slice(0, 160),
42194
+ textLength: getParagraphText(paragraph).length,
41016
42195
  runCount: paragraph.runs.length,
41017
42196
  rawParagraphStyle: paragraph.style,
41018
42197
  align: paragraphStyle.align,
@@ -41053,7 +42232,7 @@ function createDocumentImporter(deps) {
41053
42232
  const arrayBuffer = await readFileBuffer(file);
41054
42233
  deps.logger.info("import:phase", {
41055
42234
  phase: "reading-file",
41056
- durationMs: Math.round((deps.now() - readingStartedAt) * 100) / 100
42235
+ durationMs: roundTo(deps.now() - readingStartedAt, 2)
41057
42236
  });
41058
42237
  let lastProgressStage = null;
41059
42238
  let lastProgressValue = -1;
@@ -41081,7 +42260,7 @@ function createDocumentImporter(deps) {
41081
42260
  }
41082
42261
  }
41083
42262
  );
41084
- deps.logger.info(
42263
+ deps.logger.debug(
41085
42264
  "import:document-diagnostics",
41086
42265
  buildImportedDocumentDiagnostics(document2)
41087
42266
  );
@@ -41093,7 +42272,7 @@ function createDocumentImporter(deps) {
41093
42272
  await deps.stabilizeLayoutAfterImport();
41094
42273
  deps.logger.info("import:phase", {
41095
42274
  phase: "stabilizing-layout",
41096
- durationMs: Math.round((deps.now() - stabilizationStartedAt) * 100) / 100
42275
+ durationMs: roundTo(deps.now() - stabilizationStartedAt, 2)
41097
42276
  });
41098
42277
  const sections = getDocumentSectionsCanonical(document2);
41099
42278
  const canonicalBlocks = sections.reduce(
@@ -41109,7 +42288,7 @@ function createDocumentImporter(deps) {
41109
42288
  format: importer.id,
41110
42289
  blocks: canonicalBlocks,
41111
42290
  paragraphs: canonicalParagraphs,
41112
- durationMs: Math.round((deps.now() - startedAt) * 100) / 100
42291
+ durationMs: roundTo(deps.now() - startedAt, 2)
41113
42292
  });
41114
42293
  deps.focusInput();
41115
42294
  } catch (error) {
@@ -41280,7 +42459,10 @@ function patchSelectedImage(state, updater) {
41280
42459
  return cloneStateWithParagraphs(
41281
42460
  state,
41282
42461
  nextParagraphs,
41283
- preserveSelectionByParagraphOffsets(nextParagraphs, normalizeSelection(state))
42462
+ preserveSelectionByParagraphOffsets(
42463
+ nextParagraphs,
42464
+ normalizeSelection(state)
42465
+ )
41284
42466
  );
41285
42467
  }
41286
42468
  function patchSelectedImageFloating(state, next) {
@@ -42516,9 +43698,17 @@ function putItem(db, storeName, key, value) {
42516
43698
  )
42517
43699
  );
42518
43700
  };
42519
- request.onsuccess = () => {
43701
+ transaction.oncomplete = () => {
42520
43702
  resolve();
42521
43703
  };
43704
+ transaction.onabort = transaction.onerror = () => {
43705
+ var _a2;
43706
+ reject(
43707
+ new Error(
43708
+ `Transaction failed putting item in ${storeName}: ${(_a2 = transaction.error) == null ? void 0 : _a2.message}`
43709
+ )
43710
+ );
43711
+ };
42522
43712
  } catch (err) {
42523
43713
  reject(err);
42524
43714
  }
@@ -42560,9 +43750,17 @@ function deleteItem(db, storeName, key) {
42560
43750
  )
42561
43751
  );
42562
43752
  };
42563
- request.onsuccess = () => {
43753
+ transaction.oncomplete = () => {
42564
43754
  resolve();
42565
43755
  };
43756
+ transaction.onabort = transaction.onerror = () => {
43757
+ var _a2;
43758
+ reject(
43759
+ new Error(
43760
+ `Transaction failed deleting item from ${storeName}: ${(_a2 = transaction.error) == null ? void 0 : _a2.message}`
43761
+ )
43762
+ );
43763
+ };
42566
43764
  } catch (err) {
42567
43765
  reject(err);
42568
43766
  }
@@ -43585,7 +44783,12 @@ function createTableCellSpanOperations(deps) {
43585
44783
  if (!nextParagraph) {
43586
44784
  return current;
43587
44785
  }
43588
- return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
44786
+ return commitTableMutation(
44787
+ current,
44788
+ targetBlocks,
44789
+ range.zone,
44790
+ nextParagraph
44791
+ );
43589
44792
  };
43590
44793
  const mergeSelectedTableRows = (current) => {
43591
44794
  const range = deps.resolveVerticalTableCellRange(current);
@@ -43658,7 +44861,12 @@ function createTableCellSpanOperations(deps) {
43658
44861
  if (!nextParagraph) {
43659
44862
  return current;
43660
44863
  }
43661
- return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
44864
+ return commitTableMutation(
44865
+ current,
44866
+ targetBlocks,
44867
+ range.zone,
44868
+ nextParagraph
44869
+ );
43662
44870
  };
43663
44871
  const mergeSelectedTable = (current) => {
43664
44872
  if (deps.canMergeSelectedTableCells(current)) {
@@ -43726,7 +44934,12 @@ function createTableCellSpanOperations(deps) {
43726
44934
  if (!nextParagraph) {
43727
44935
  return current;
43728
44936
  }
43729
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44937
+ return commitTableMutation(
44938
+ current,
44939
+ targetBlocks,
44940
+ location.zone,
44941
+ nextParagraph
44942
+ );
43730
44943
  };
43731
44944
  const splitSelectedTableCell = (current) => {
43732
44945
  var _a2;
@@ -43779,7 +44992,12 @@ function createTableCellSpanOperations(deps) {
43779
44992
  if (!nextParagraph) {
43780
44993
  return current;
43781
44994
  }
43782
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44995
+ return commitTableMutation(
44996
+ current,
44997
+ targetBlocks,
44998
+ location.zone,
44999
+ nextParagraph
45000
+ );
43783
45001
  };
43784
45002
  const splitSelectedTable = (current) => {
43785
45003
  if (deps.canSplitSelectedTableCellVertically(current)) {
@@ -43870,7 +45088,12 @@ function createTableRowColumnOperations(deps) {
43870
45088
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? ((_a2 = blankRow.cells.find(
43871
45089
  (cell) => cell.vMerge !== "continue" && cell.blocks[0]
43872
45090
  )) == null ? void 0 : _a2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
43873
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
45091
+ return commitTableMutation(
45092
+ current,
45093
+ targetBlocks,
45094
+ location.zone,
45095
+ nextParagraph2
45096
+ );
43874
45097
  }
43875
45098
  blankRow = createEditorTableRow(
43876
45099
  sourceRow.cells.map(
@@ -43894,7 +45117,12 @@ function createTableRowColumnOperations(deps) {
43894
45117
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? ((_b2 = blankRow.cells.find(
43895
45118
  (cell) => cell.vMerge !== "continue" && cell.blocks[0]
43896
45119
  )) == null ? void 0 : _b2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
43897
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
45120
+ return commitTableMutation(
45121
+ current,
45122
+ targetBlocks,
45123
+ location.zone,
45124
+ nextParagraph
45125
+ );
43898
45126
  };
43899
45127
  const deleteSelectedTableRow = (current) => {
43900
45128
  const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
@@ -43955,7 +45183,12 @@ function createTableRowColumnOperations(deps) {
43955
45183
  )
43956
45184
  ) : null;
43957
45185
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
43958
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
45186
+ return commitTableMutation(
45187
+ current,
45188
+ targetBlocks,
45189
+ location.zone,
45190
+ nextParagraph
45191
+ );
43959
45192
  };
43960
45193
  const insertSelectedTableColumn = (current, direction) => {
43961
45194
  var _a2;
@@ -44032,7 +45265,12 @@ function createTableRowColumnOperations(deps) {
44032
45265
  const targetRow2 = tableBlock.rows[location.rowIndex];
44033
45266
  const targetCell2 = targetRow2 ? findCellAtVisualColumn(targetRow2, insertVisualColumn) : null;
44034
45267
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44035
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
45268
+ return commitTableMutation(
45269
+ current,
45270
+ targetBlocks,
45271
+ location.zone,
45272
+ nextParagraph2
45273
+ );
44036
45274
  }
44037
45275
  const insertIndex = Math.max(
44038
45276
  0,
@@ -44056,7 +45294,12 @@ function createTableRowColumnOperations(deps) {
44056
45294
  const targetRow = tableBlock.rows[location.rowIndex];
44057
45295
  const targetCell = targetRow == null ? void 0 : targetRow.cells[insertIndex];
44058
45296
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44059
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
45297
+ return commitTableMutation(
45298
+ current,
45299
+ targetBlocks,
45300
+ location.zone,
45301
+ nextParagraph
45302
+ );
44060
45303
  };
44061
45304
  const deleteSelectedTableColumn = (current) => {
44062
45305
  var _a2;
@@ -44123,7 +45366,12 @@ function createTableRowColumnOperations(deps) {
44123
45366
  )
44124
45367
  );
44125
45368
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44126
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
45369
+ return commitTableMutation(
45370
+ current,
45371
+ targetBlocks,
45372
+ location.zone,
45373
+ nextParagraph2
45374
+ );
44127
45375
  }
44128
45376
  if (((_a2 = tableBlock.rows[0]) == null ? void 0 : _a2.cells.length) <= 1) {
44129
45377
  return current;
@@ -44134,7 +45382,12 @@ function createTableRowColumnOperations(deps) {
44134
45382
  const targetRow = tableBlock.rows[location.rowIndex];
44135
45383
  const targetCell = targetRow == null ? void 0 : targetRow.cells[Math.min(location.cellIndex, targetRow.cells.length - 1)];
44136
45384
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44137
- return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
45385
+ return commitTableMutation(
45386
+ current,
45387
+ targetBlocks,
45388
+ location.zone,
45389
+ nextParagraph
45390
+ );
44138
45391
  };
44139
45392
  return {
44140
45393
  insertSelectedTableRow,
@@ -45100,7 +46353,7 @@ function scoreRectDistance(left, top, width, height, clientX, clientY) {
45100
46353
  const bottom = top + height;
45101
46354
  const verticalDelta = clientY < top ? top - clientY : clientY > bottom ? clientY - bottom : 0;
45102
46355
  const horizontalDelta = clientX < left ? left - clientX : clientX > right ? clientX - right : 0;
45103
- return verticalDelta * 1e3 + horizontalDelta;
46356
+ return verticalDelta * VERTICAL_HIT_WEIGHT + horizontalDelta;
45104
46357
  }
45105
46358
  function resolveZoneFromPage(page, clientY) {
45106
46359
  const localY = clientY - page.top;
@@ -45143,7 +46396,7 @@ function resolveClosestOffsetInLine(line, clientX, clientY) {
45143
46396
  for (const slot of line.slots) {
45144
46397
  const verticalDelta = clientY < slot.top ? slot.top - clientY : clientY > slot.top + slot.height ? clientY - (slot.top + slot.height) : 0;
45145
46398
  const horizontalDelta = Math.abs(clientX - slot.left);
45146
- const score = verticalDelta * 1e3 + horizontalDelta;
46399
+ const score = verticalDelta * VERTICAL_HIT_WEIGHT + horizontalDelta;
45147
46400
  if (score < bestScore) {
45148
46401
  bestScore = score;
45149
46402
  bestOffset = slot.offset;
@@ -46556,11 +47809,10 @@ function createEditorTableDrag(deps) {
46556
47809
  const table = findTable();
46557
47810
  if ((table == null ? void 0 : table.type) === "table" && ((_a2 = table.style) == null ? void 0 : _a2.floating)) {
46558
47811
  const floating = table.style.floating;
46559
- const pointsPerPixel = 72 / 96;
46560
47812
  return setActiveTableStyleValue(current, tableId, "floating", {
46561
47813
  ...floating,
46562
- x: (floating.x ?? 0) + (event.clientX - startClientX()) * pointsPerPixel,
46563
- y: (floating.y ?? 0) + (event.clientY - startClientY()) * pointsPerPixel,
47814
+ x: (floating.x ?? 0) + (event.clientX - startClientX()) * PT_PER_PX,
47815
+ y: (floating.y ?? 0) + (event.clientY - startClientY()) * PT_PER_PX,
46564
47816
  xAlign: void 0,
46565
47817
  yAlign: void 0
46566
47818
  });
@@ -46865,7 +48117,10 @@ function createEditorSurfaceEvents(deps) {
46865
48117
  hit.zone,
46866
48118
  {
46867
48119
  ...state,
46868
- selection: { anchor: { ...hit.position }, focus: { ...hit.position } }
48120
+ selection: {
48121
+ anchor: { ...hit.position },
48122
+ focus: { ...hit.position }
48123
+ }
46869
48124
  },
46870
48125
  hit.position
46871
48126
  );
@@ -46885,9 +48140,20 @@ function createEditorSurfaceEvents(deps) {
46885
48140
  return;
46886
48141
  }
46887
48142
  dragAnchor = null;
46888
- const start = paragraphOffsetToPosition(textBoxParagraph, hit.textBox.startOffset);
46889
- const end = paragraphOffsetToPosition(textBoxParagraph, hit.textBox.endOffset);
46890
- applyWithZone(state, hit.zone, setSelection(state, { anchor: start, focus: end }), start);
48143
+ const start = paragraphOffsetToPosition(
48144
+ textBoxParagraph,
48145
+ hit.textBox.startOffset
48146
+ );
48147
+ const end = paragraphOffsetToPosition(
48148
+ textBoxParagraph,
48149
+ hit.textBox.endOffset
48150
+ );
48151
+ applyWithZone(
48152
+ state,
48153
+ hit.zone,
48154
+ setSelection(state, { anchor: start, focus: end }),
48155
+ start
48156
+ );
46891
48157
  stopDragging();
46892
48158
  deps.focusInputAfterPointerSelection();
46893
48159
  };
@@ -46901,9 +48167,17 @@ function createEditorSurfaceEvents(deps) {
46901
48167
  return;
46902
48168
  }
46903
48169
  dragAnchor = null;
46904
- const start = paragraphOffsetToPosition(imageParagraph, hit.image.startOffset);
48170
+ const start = paragraphOffsetToPosition(
48171
+ imageParagraph,
48172
+ hit.image.startOffset
48173
+ );
46905
48174
  const end = paragraphOffsetToPosition(imageParagraph, hit.image.endOffset);
46906
- applyWithZone(state, hit.zone, setSelection(state, { anchor: start, focus: end }), start);
48175
+ applyWithZone(
48176
+ state,
48177
+ hit.zone,
48178
+ setSelection(state, { anchor: start, focus: end }),
48179
+ start
48180
+ );
46907
48181
  stopDragging();
46908
48182
  deps.imageOps.startImageDrag(
46909
48183
  hit.image.paragraphId,
@@ -46923,7 +48197,10 @@ function createEditorSurfaceEvents(deps) {
46923
48197
  applyWithZone(
46924
48198
  state,
46925
48199
  hit.zone,
46926
- setSelection(state, { anchor: state.selection.anchor, focus: hit.position }),
48200
+ setSelection(state, {
48201
+ anchor: state.selection.anchor,
48202
+ focus: hit.position
48203
+ }),
46927
48204
  hit.position
46928
48205
  );
46929
48206
  window.addEventListener("mousemove", handleWindowMouseMove);
@@ -46944,7 +48221,10 @@ function createEditorSurfaceEvents(deps) {
46944
48221
  };
46945
48222
  const handleDoubleClickDown = (state, hit, paragraph) => {
46946
48223
  dragAnchor = null;
46947
- const word = resolveWordSelection(getParagraphText(paragraph), hit.paragraphOffset);
48224
+ const word = resolveWordSelection(
48225
+ getParagraphText(paragraph),
48226
+ hit.paragraphOffset
48227
+ );
46948
48228
  const startPos = paragraphOffsetToPosition(paragraph, word.start);
46949
48229
  const endPos = paragraphOffsetToPosition(paragraph, word.end);
46950
48230
  applyWithZone(
@@ -49699,7 +50979,7 @@ function buildEntryParagraph(heading, pageNumber, rightTabPositionPt) {
49699
50979
  function rightTabPositionForSection(section) {
49700
50980
  const { width, margins } = section.pageSettings;
49701
50981
  const contentWidthPx = Math.max(0, width - margins.left - margins.right);
49702
- return Math.round(contentWidthPx * PT_PER_PX * 100) / 100;
50982
+ return roundTo(contentWidthPx * PT_PER_PX, 2);
49703
50983
  }
49704
50984
  function buildStartMarkerParagraph() {
49705
50985
  return makeParagraph([
@@ -51612,11 +52892,8 @@ function OasisEditorApp(props = {}) {
51612
52892
  canvasSnapshotProvider
51613
52893
  });
51614
52894
  const {
51615
- selectedImageRun,
51616
52895
  layoutOptionsOverlay,
51617
52896
  fr,
51618
- resolveSurfaceHitAtPoint,
51619
- resolvePositionAtSurfacePoint,
51620
52897
  tableOps,
51621
52898
  imageOps,
51622
52899
  textBoxOps,
@@ -51628,7 +52905,6 @@ function OasisEditorApp(props = {}) {
51628
52905
  textDrag,
51629
52906
  surfaceEventsWithTextDrag,
51630
52907
  textInput,
51631
- navigation,
51632
52908
  handleCopy,
51633
52909
  handleCut,
51634
52910
  handlePaste,