oasis-editor 0.0.112 → 0.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { 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 useI18n, aj as createEffect, ak as insert, al as use, am as addEventListener, an as Dialog, ao as delegateEvents, ap as className, aq as For, ar as UNDERLINE_STYLE_OPTIONS, as as Tabs, at as onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as normalizeHex6, aF as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aG as TABLE_BORDER_EDGE_KEYS, aH as resolveEffectiveParagraphStyle, aI as resolveEffectiveTextStyleForParagraph, aJ as EMU_PER_PT, aK as OOXML_ROTATION_UNITS, aL as OOXML_PERCENT_DENOMINATOR, aM as parseHexColorToRgb255, aN as EMU_PER_PX, aO as getRunFootnoteReference, aP as getRunEndnoteReference, aQ as iterateFootnoteReferenceRuns, aR as iterateEndnoteReferenceRuns, aS as imageContentTypeDefaults, aT as getRunFieldChar, aU as getRunFieldInstruction, aV as createEditorRun, aW as JSZip, aX as imageExtensionFromMime, aY as pxToPt$1, aZ as resolveFloatingObjectRect, a_ as getTextBoxFloatingGeometry, a$ as getPresetPathSegments, b0 as buildListLabels, b1 as getImageFloatingGeometry, b2 as textStyleToFontSizePt, b3 as PX_PER_POINT, b4 as DEFAULT_FONT_SIZE_PX, b5 as resolveOpenTypeFeatureTags, b6 as rgb255ToHex, b7 as isDoubleUnderlineStyle, b8 as isWavyUnderlineStyle, b9 as underlineStyleLineWidthPx, ba as underlineStyleDashArray, bb as resolveListLabel, bc as getListLabelInset, bd as getAlignedListLabelInset, be as getParagraphBorderInsets, bf as buildSegmentTable, bg as buildCanvasTableLayout, bh as resolveCanvasTableWidth, bi as resolveFloatingTableRect, bj as normalizeFamily, bk as ROBOTO_FONT_FILES, bl as loadFontAsset, bm as OFFICE_COMPAT_FONT_FAMILIES, bn as BinaryReader, bo as buildSfnt, bp as defaultFontDecoderRegistry, bq as SfntFontProgram, br as collectPdfFontFamilies, bs as outlineFrom, bt as getPageHeaderZoneTop, bu as getPageColumnRects, bv as findFootnoteReference, bw as FOOTNOTE_MARKER_GUTTER_PX, bx as resolveImporterForFile, by as getDocumentSectionsCanonical, bz as getDocumentParagraphsCanonical, bA as getDocumentParagraphs, bB as getDocumentPageSettings, bC as getTableCellContentWidthForParagraph, bD as layoutMetricsEpoch, bE as bumpLayoutMetricsEpoch, bF as createCanvasLayoutSnapshotProvider, bG as on, bH as debounce, bI as unwrap, bJ as perfTimer, bK as getRunTextBox, bL as createEditorDocument, bM as resolveResizedDimensions, bN as resolveTextBoxRenderHeight, bO as getToolbarStyleState, bP as getCachedCanvasImage, bQ as measureParagraphMinContentWidthPx, bR as getEditableBlocksForZone, bS as findParagraphLocation, bT as createSectionBoundaryParagraph, bU as normalizePageSettings, bV as DEFAULT_EDITOR_PAGE_SETTINGS, bW as markStart, bX as markEnd, bY as getParagraphEntries, bZ as getParagraphById, b_ as createEditorFootnote, b$ as createFootnoteReferenceRun, c0 as renumberFootnotes, c1 as getHeadingLevel, c2 as preciseFontModeVersion, c3 as isPreciseFontModeEnabled, c4 as resolveNamedTextStyle, c5 as togglePreciseFontMode, c6 as nextFontSizePt, c7 as previousFontSizePt, c8 as fontSizePtToPx, c9 as createDefaultToolbarPreset, ca as MenuRegistry, cb as createToolbarRegistry, cc as Editor, cd as resolveCommandRef, ce as commandRefName, cf as createOasisEditorClient, cg as createEditorZoom, ch as startLongTaskObserver, ci as installGlobalReport, cj as applyStoredPreciseFontPreference, ck as getWelcomeSeen, cl as isLocalFontAccessSupported, cm as EDITOR_SCROLL_PADDING_PX, cn as Toolbar, co as OasisEditorLoading, cp as I18nProvider, cq as createTranslator, cr as createEditorLogger, cs as registerDomStatsSurface } from "./index-AX7m_SeX.js";
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 onMount, au as onCleanup, av as PluginUiHost, aw as OasisEditorEditor, ax as OasisBrandMark, ay as setPreciseFontPreference, az as setWelcomeSeen, aA as enablePreciseFontMode, aB as TWIPS_PER_POINT, aC as PX_PER_INCH, aD as TWIPS_PER_INCH, aE as normalizeHex6, aF as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aG as TABLE_BORDER_EDGE_KEYS, aH as resolveEffectiveParagraphStyle, aI as resolveEffectiveTextStyleForParagraph, aJ as EMU_PER_PT, aK as OOXML_ROTATION_UNITS, aL as OOXML_PERCENT_DENOMINATOR, aM as parseHexColorToRgb255, aN as EMU_PER_PX, aO as getRunFootnoteReference, aP as getRunEndnoteReference, aQ as iterateFootnoteReferenceRuns, aR as iterateEndnoteReferenceRuns, aS as imageContentTypeDefaults, aT as getRunFieldChar, aU as getRunFieldInstruction, aV as createEditorRun, aW as JSZip, aX as imageExtensionFromMime, aY as pxToPt$1, aZ as resolveFloatingObjectRect, a_ as getTextBoxFloatingGeometry, a$ as getPresetPathSegments, b0 as buildListLabels, b1 as getImageFloatingGeometry, b2 as textStyleToFontSizePt, b3 as PX_PER_POINT, b4 as DEFAULT_FONT_SIZE_PX, b5 as resolveOpenTypeFeatureTags, b6 as rgb255ToHex, b7 as isDoubleUnderlineStyle, b8 as isWavyUnderlineStyle, b9 as underlineStyleLineWidthPx, ba as underlineStyleDashArray, bb as resolveListLabel, bc as getListLabelInset, bd as getAlignedListLabelInset, be as getParagraphBorderInsets, bf as buildSegmentTable, bg as buildCanvasTableLayout, bh as resolveCanvasTableWidth, bi as resolveFloatingTableRect, bj as normalizeFamily, bk as ROBOTO_FONT_FILES, bl as loadFontAsset, bm as OFFICE_COMPAT_FONT_FAMILIES, bn as BinaryReader, bo as buildSfnt, bp as defaultFontDecoderRegistry, bq as SfntFontProgram, br as collectPdfFontFamilies, bs as outlineFrom, bt as getPageHeaderZoneTop, bu as getPageColumnRects, bv as findFootnoteReference, bw as FOOTNOTE_MARKER_GUTTER_PX, bx as resolveImporterForFile, by as getDocumentSectionsCanonical, bz as getDocumentParagraphsCanonical, bA as getDocumentParagraphs, bB as getDocumentPageSettings, bC as getTableCellContentWidthForParagraph, bD as layoutMetricsEpoch, bE as bumpLayoutMetricsEpoch, bF as createCanvasLayoutSnapshotProvider, bG as on, bH as debounce, bI as unwrap, bJ as perfTimer, bK as getRunTextBox, bL as createEditorDocument, bM as resolveResizedDimensions, bN as resolveTextBoxRenderHeight, bO as getToolbarStyleState, bP as getCachedCanvasImage, bQ as measureParagraphMinContentWidthPx, bR as getEditableBlocksForZone, bS as findParagraphLocation, bT as createSectionBoundaryParagraph, bU as normalizePageSettings, bV as DEFAULT_EDITOR_PAGE_SETTINGS, bW as markStart, bX as markEnd, bY as getParagraphEntries, bZ as getParagraphById, b_ as createEditorFootnote, b$ as createFootnoteReferenceRun, c0 as renumberFootnotes, c1 as getHeadingLevel, c2 as preciseFontModeVersion, c3 as isPreciseFontModeEnabled, c4 as resolveNamedTextStyle, c5 as togglePreciseFontMode, c6 as nextFontSizePt, c7 as previousFontSizePt, c8 as fontSizePtToPx, c9 as createDefaultToolbarPreset, ca as MenuRegistry, cb as createToolbarRegistry, cc as Editor, cd as resolveCommandRef, ce as commandRefName, cf as createOasisEditorClient, cg as createEditorZoom, ch as startLongTaskObserver, ci as installGlobalReport, cj as applyStoredPreciseFontPreference, ck as getWelcomeSeen, cl as isLocalFontAccessSupported, cm as EDITOR_SCROLL_PADDING_PX, cn as Toolbar, co as OasisEditorLoading, cp as I18nProvider, cq as createTranslator, cr as createEditorLogger, cs as registerDomStatsSurface } from "./index-DSDwe-yy.js";
5
5
  function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
6
6
  const {
7
7
  pageIndex,
@@ -31142,14 +31142,14 @@ function DropCaret(props) {
31142
31142
  })
31143
31143
  });
31144
31144
  }
31145
- var _tmpl$$e = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$9 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$3$7 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
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>`);
31146
31146
  function EditorDragLayers(props) {
31147
31147
  return [createComponent(Show, {
31148
31148
  get when() {
31149
31149
  return props.tableResize.resizing();
31150
31150
  },
31151
31151
  children: (resizing) => (() => {
31152
- var _el$ = _tmpl$$e();
31152
+ var _el$ = _tmpl$$d();
31153
31153
  createRenderEffect((_p$) => {
31154
31154
  var _v$ = !!(resizing().type === "column"), _v$2 = !!(resizing().type === "row"), _v$3 = {
31155
31155
  ...resizing().type === "column" ? {
@@ -31180,7 +31180,7 @@ function EditorDragLayers(props) {
31180
31180
  return memo(() => !!props.imageOps.dragging())() && props.imageOps.draggedImageInfo();
31181
31181
  },
31182
31182
  children: (info) => (() => {
31183
- var _el$2 = _tmpl$2$9();
31183
+ var _el$2 = _tmpl$2$7();
31184
31184
  createRenderEffect((_p$) => {
31185
31185
  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
31186
  _v$4 !== _p$.e && setAttribute(_el$2, "src", _p$.e = _v$4);
@@ -31203,7 +31203,7 @@ function EditorDragLayers(props) {
31203
31203
  return memo(() => !!props.tableDrag.dragging())() && props.tableDrag.draggedTableInfo();
31204
31204
  },
31205
31205
  children: (info) => (() => {
31206
- var _el$3 = _tmpl$3$7();
31206
+ var _el$3 = _tmpl$3$4();
31207
31207
  createRenderEffect((_p$) => {
31208
31208
  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
31209
  _v$9 !== _p$.e && setStyleProperty(_el$3, "width", _p$.e = _v$9);
@@ -31293,19 +31293,36 @@ function EditorDragLayers(props) {
31293
31293
  })
31294
31294
  })];
31295
31295
  }
31296
- var _tmpl$$d = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=text class=oasis-editor-dialog-input data-testid=editor-link-dialog-input>`), _tmpl$2$8 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-link-dialog-cancel>`), _tmpl$3$6 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-link-dialog-apply>`);
31297
- function LinkDialog(props) {
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
+ 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>`);
31314
+ function TextInputDialog(props) {
31298
31315
  const t = useI18n();
31299
- const [href, setHref] = createSignal(props.initialHref);
31316
+ const [value, setValue] = createSignal(props.initialValue);
31300
31317
  let inputRef;
31301
31318
  createEffect(() => {
31302
31319
  if (props.isOpen) {
31303
- setHref(props.initialHref);
31320
+ setValue(props.initialValue);
31304
31321
  setTimeout(() => inputRef == null ? void 0 : inputRef.focus(), 50);
31305
31322
  }
31306
31323
  });
31307
31324
  const handleConfirm = () => {
31308
- props.onConfirm(href());
31325
+ props.onConfirm(value());
31309
31326
  props.onClose();
31310
31327
  };
31311
31328
  return createComponent(Dialog, {
@@ -31313,142 +31330,148 @@ function LinkDialog(props) {
31313
31330
  return props.isOpen;
31314
31331
  },
31315
31332
  get title() {
31316
- return t("dialog.link.title");
31333
+ return props.title;
31317
31334
  },
31318
31335
  get onClose() {
31319
31336
  return props.onClose;
31320
31337
  },
31321
31338
  get footer() {
31322
- return [(() => {
31323
- var _el$4 = _tmpl$2$8();
31324
- addEventListener(_el$4, "click", props.onClose, true);
31325
- insert(_el$4, () => t("generic.cancel"));
31326
- return _el$4;
31327
- })(), (() => {
31328
- var _el$5 = _tmpl$3$6();
31329
- _el$5.$$click = handleConfirm;
31330
- insert(_el$5, () => t("generic.apply"));
31331
- return _el$5;
31332
- })()];
31339
+ return createComponent(DialogFooter, {
31340
+ get onCancel() {
31341
+ return props.onClose;
31342
+ },
31343
+ onConfirm: handleConfirm,
31344
+ get cancelLabel() {
31345
+ return t("generic.cancel");
31346
+ },
31347
+ get confirmLabel() {
31348
+ return props.confirmLabel;
31349
+ },
31350
+ get cancelTestId() {
31351
+ var _a2;
31352
+ return (_a2 = props.testIds) == null ? void 0 : _a2.cancel;
31353
+ },
31354
+ get confirmTestId() {
31355
+ var _a2;
31356
+ return (_a2 = props.testIds) == null ? void 0 : _a2.confirm;
31357
+ }
31358
+ });
31333
31359
  },
31334
31360
  get children() {
31335
- var _el$ = _tmpl$$d(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
31336
- insert(_el$2, () => t("dialog.link.label"));
31361
+ var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
31362
+ insert(_el$2, () => props.label);
31337
31363
  _el$3.$$keydown = (e) => e.key === "Enter" && handleConfirm();
31338
- _el$3.$$input = (e) => setHref(e.currentTarget.value);
31364
+ _el$3.$$input = (e) => setValue(e.currentTarget.value);
31339
31365
  var _ref$ = inputRef;
31340
31366
  typeof _ref$ === "function" ? use(_ref$, _el$3) : inputRef = _el$3;
31341
- createRenderEffect(() => setAttribute(_el$3, "placeholder", t("dialog.link.placeholder")));
31342
- createRenderEffect(() => _el$3.value = href());
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
31376
+ });
31377
+ createRenderEffect(() => _el$3.value = value());
31343
31378
  return _el$;
31344
31379
  }
31345
31380
  });
31346
31381
  }
31347
- delegateEvents(["input", "keydown", "click"]);
31348
- var _tmpl$$c = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=text class=oasis-editor-dialog-input>`), _tmpl$2$7 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary">`), _tmpl$3$5 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary">`);
31349
- function ImageAltDialog(props) {
31382
+ delegateEvents(["input", "keydown"]);
31383
+ function LinkDialog(props) {
31350
31384
  const t = useI18n();
31351
- const [alt, setAlt] = createSignal(props.initialAlt);
31352
- let inputRef;
31353
- createEffect(() => {
31354
- if (props.isOpen) {
31355
- setAlt(props.initialAlt);
31356
- setTimeout(() => inputRef == null ? void 0 : inputRef.focus(), 50);
31385
+ return createComponent(TextInputDialog, {
31386
+ get isOpen() {
31387
+ return props.isOpen;
31388
+ },
31389
+ get title() {
31390
+ return t("dialog.link.title");
31391
+ },
31392
+ get label() {
31393
+ return t("dialog.link.label");
31394
+ },
31395
+ get placeholder() {
31396
+ return t("dialog.link.placeholder");
31397
+ },
31398
+ get initialValue() {
31399
+ return props.initialHref;
31400
+ },
31401
+ get confirmLabel() {
31402
+ return t("generic.apply");
31403
+ },
31404
+ get onClose() {
31405
+ return props.onClose;
31406
+ },
31407
+ get onConfirm() {
31408
+ return props.onConfirm;
31409
+ },
31410
+ testIds: {
31411
+ input: "editor-link-dialog-input",
31412
+ cancel: "editor-link-dialog-cancel",
31413
+ confirm: "editor-link-dialog-apply"
31357
31414
  }
31358
31415
  });
31359
- const handleConfirm = () => {
31360
- props.onConfirm(alt());
31361
- props.onClose();
31362
- };
31363
- return createComponent(Dialog, {
31416
+ }
31417
+ function ImageAltDialog(props) {
31418
+ const t = useI18n();
31419
+ return createComponent(TextInputDialog, {
31364
31420
  get isOpen() {
31365
31421
  return props.isOpen;
31366
31422
  },
31367
31423
  get title() {
31368
31424
  return t("dialog.imageAlt.title");
31369
31425
  },
31426
+ get label() {
31427
+ return t("dialog.imageAlt.label");
31428
+ },
31429
+ get placeholder() {
31430
+ return t("dialog.imageAlt.placeholder");
31431
+ },
31432
+ get initialValue() {
31433
+ return props.initialAlt;
31434
+ },
31435
+ get confirmLabel() {
31436
+ return t("generic.save");
31437
+ },
31370
31438
  get onClose() {
31371
31439
  return props.onClose;
31372
31440
  },
31373
- get footer() {
31374
- return [(() => {
31375
- var _el$4 = _tmpl$2$7();
31376
- addEventListener(_el$4, "click", props.onClose, true);
31377
- insert(_el$4, () => t("generic.cancel"));
31378
- return _el$4;
31379
- })(), (() => {
31380
- var _el$5 = _tmpl$3$5();
31381
- _el$5.$$click = handleConfirm;
31382
- insert(_el$5, () => t("generic.save"));
31383
- return _el$5;
31384
- })()];
31385
- },
31386
- get children() {
31387
- var _el$ = _tmpl$$c(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
31388
- insert(_el$2, () => t("dialog.imageAlt.label"));
31389
- _el$3.$$keydown = (e) => e.key === "Enter" && handleConfirm();
31390
- _el$3.$$input = (e) => setAlt(e.currentTarget.value);
31391
- var _ref$ = inputRef;
31392
- typeof _ref$ === "function" ? use(_ref$, _el$3) : inputRef = _el$3;
31393
- createRenderEffect(() => setAttribute(_el$3, "placeholder", t("dialog.imageAlt.placeholder")));
31394
- createRenderEffect(() => _el$3.value = alt());
31395
- return _el$;
31441
+ get onConfirm() {
31442
+ return props.onConfirm;
31396
31443
  }
31397
31444
  });
31398
31445
  }
31399
- delegateEvents(["input", "keydown", "click"]);
31400
- 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>`), _tmpl$2$6 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary">`), _tmpl$3$4 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary">`);
31401
31446
  function ImageCaptionDialog(props) {
31402
31447
  const t = useI18n();
31403
- const [caption, setCaption] = createSignal(props.initialCaption);
31404
- let inputRef;
31405
- createEffect(() => {
31406
- if (props.isOpen) {
31407
- setCaption(props.initialCaption);
31408
- setTimeout(() => inputRef == null ? void 0 : inputRef.focus(), 50);
31409
- }
31410
- });
31411
- const handleConfirm = () => {
31412
- props.onConfirm(caption());
31413
- props.onClose();
31414
- };
31415
- return createComponent(Dialog, {
31448
+ return createComponent(TextInputDialog, {
31416
31449
  get isOpen() {
31417
31450
  return props.isOpen;
31418
31451
  },
31419
31452
  get title() {
31420
31453
  return t("dialog.imageCaption.title");
31421
31454
  },
31455
+ get label() {
31456
+ return t("dialog.imageCaption.label");
31457
+ },
31458
+ get placeholder() {
31459
+ return t("dialog.imageCaption.placeholder");
31460
+ },
31461
+ get initialValue() {
31462
+ return props.initialCaption;
31463
+ },
31464
+ get confirmLabel() {
31465
+ return t("generic.save");
31466
+ },
31422
31467
  get onClose() {
31423
31468
  return props.onClose;
31424
31469
  },
31425
- get footer() {
31426
- return [(() => {
31427
- var _el$4 = _tmpl$2$6();
31428
- addEventListener(_el$4, "click", props.onClose, true);
31429
- insert(_el$4, () => t("generic.cancel"));
31430
- return _el$4;
31431
- })(), (() => {
31432
- var _el$5 = _tmpl$3$4();
31433
- _el$5.$$click = handleConfirm;
31434
- insert(_el$5, () => t("generic.save"));
31435
- return _el$5;
31436
- })()];
31437
- },
31438
- get children() {
31439
- var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
31440
- insert(_el$2, () => t("dialog.imageCaption.label"));
31441
- _el$3.$$keydown = (e) => e.key === "Enter" && handleConfirm();
31442
- _el$3.$$input = (e) => setCaption(e.currentTarget.value);
31443
- var _ref$ = inputRef;
31444
- typeof _ref$ === "function" ? use(_ref$, _el$3) : inputRef = _el$3;
31445
- createRenderEffect(() => setAttribute(_el$3, "placeholder", t("dialog.imageCaption.placeholder")));
31446
- createRenderEffect(() => _el$3.value = caption());
31447
- return _el$;
31470
+ get onConfirm() {
31471
+ return props.onConfirm;
31448
31472
  }
31449
31473
  });
31450
31474
  }
31451
- delegateEvents(["input", "keydown", "click"]);
31452
31475
  const DEFAULT_COLOR = "#111827";
31453
31476
  const DEFAULT_HIGHLIGHT = "#fef08a";
31454
31477
  const DEFAULT_SHADING = "#fef3c7";
@@ -32130,7 +32153,7 @@ function FontDialog(props) {
32130
32153
  });
32131
32154
  }
32132
32155
  delegateEvents(["click"]);
32133
- 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>`), _tmpl$8$1 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-paragraph-dialog-cancel>`), _tmpl$9$1 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-paragraph-dialog-apply>`);
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>`);
32134
32157
  const DEFAULT_BORDER_WIDTH_PT$1 = 0.5;
32135
32158
  const DEFAULT_BORDER_COLOR$1 = "#000000";
32136
32159
  function parseNumber$1(value) {
@@ -32258,17 +32281,20 @@ function ParagraphDialog(props) {
32258
32281
  return props.onClose;
32259
32282
  },
32260
32283
  get footer() {
32261
- return [(() => {
32262
- var _el$66 = _tmpl$8$1();
32263
- addEventListener(_el$66, "click", props.onClose, true);
32264
- insert(_el$66, () => t("generic.cancel"));
32265
- return _el$66;
32266
- })(), (() => {
32267
- var _el$67 = _tmpl$9$1();
32268
- _el$67.$$click = handleApply;
32269
- insert(_el$67, () => t("generic.apply"));
32270
- return _el$67;
32271
- })()];
32284
+ return createComponent(DialogFooter, {
32285
+ get onCancel() {
32286
+ return props.onClose;
32287
+ },
32288
+ onConfirm: handleApply,
32289
+ get cancelLabel() {
32290
+ return t("generic.cancel");
32291
+ },
32292
+ get confirmLabel() {
32293
+ return t("generic.apply");
32294
+ },
32295
+ cancelTestId: "editor-paragraph-dialog-cancel",
32296
+ confirmTestId: "editor-paragraph-dialog-apply"
32297
+ });
32272
32298
  },
32273
32299
  get children() {
32274
32300
  return [(() => {
@@ -32400,8 +32426,8 @@ function ParagraphDialog(props) {
32400
32426
  }
32401
32427
  });
32402
32428
  }
32403
- delegateEvents(["input", "click"]);
32404
- 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(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-table-properties-cancel>`), _tmpl$4$1 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-table-properties-apply>`), _tmpl$5$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$6$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$7 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row>`), _tmpl$8 = /* @__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$9 = /* @__PURE__ */ template(`<label class=oasis-editor-dialog-style-toggle><input type=radio name=table-align>`), _tmpl$0 = /* @__PURE__ */ template(`<option>`), _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-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$10 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row>`), _tmpl$11 = /* @__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$12 = /* @__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>`);
32429
+ 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>`);
32405
32431
  const DEFAULT_BORDER_WIDTH_PT = 0.5;
32406
32432
  const DEFAULT_BORDER_COLOR = "#000000";
32407
32433
  function parseNumber(value) {
@@ -32625,17 +32651,20 @@ function TablePropertiesDialog(props) {
32625
32651
  "class": "oasis-editor-table-properties-dialog",
32626
32652
  bodyClass: "oasis-editor-table-properties-body",
32627
32653
  get footer() {
32628
- return [(() => {
32629
- var _el$6 = _tmpl$3$1();
32630
- addEventListener(_el$6, "click", props.onClose, true);
32631
- insert(_el$6, () => t("generic.cancel"));
32632
- return _el$6;
32633
- })(), (() => {
32634
- var _el$7 = _tmpl$4$1();
32635
- _el$7.$$click = handleApply;
32636
- insert(_el$7, () => t("generic.ok"));
32637
- return _el$7;
32638
- })()];
32654
+ return createComponent(DialogFooter, {
32655
+ get onCancel() {
32656
+ return props.onClose;
32657
+ },
32658
+ onConfirm: handleApply,
32659
+ get cancelLabel() {
32660
+ return t("generic.cancel");
32661
+ },
32662
+ get confirmLabel() {
32663
+ return t("generic.ok");
32664
+ },
32665
+ cancelTestId: "editor-table-properties-cancel",
32666
+ confirmTestId: "editor-table-properties-apply"
32667
+ });
32639
32668
  },
32640
32669
  get children() {
32641
32670
  return createComponent(Tabs, {
@@ -32653,139 +32682,139 @@ function TablePropertiesDialog(props) {
32653
32682
  label: t("table.tabTable"),
32654
32683
  testId: "editor-table-properties-tab-table",
32655
32684
  panel: (() => {
32656
- var _el$8 = _tmpl$8(), _el$9 = _el$8.firstChild, _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$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$9.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.firstChild, _el$21 = _el$20.nextSibling;
32657
- insert(_el$0, () => t("table.sizeSection"));
32658
- insert(_el$1, () => numericInput(t("table.preferredWidth"), tableWidth, setTableWidth, "editor-table-properties-table-width"), _el$10);
32659
- insert(_el$11, () => t("table.measureIn"));
32660
- _el$12.addEventListener("change", (e) => setTableWidthUnit(e.currentTarget.value));
32661
- insert(_el$13, () => t("table.points"));
32662
- insert(_el$14, () => t("table.percent"));
32663
- insert(_el$16, () => t("table.alignmentSection"));
32664
- insert(_el$17, () => ["left", "center", "right"].map((align) => (() => {
32665
- var _el$45 = _tmpl$9(), _el$46 = _el$45.firstChild;
32666
- _el$46.addEventListener("change", () => setTableAlign(align));
32667
- setAttribute(_el$46, "data-testid", `editor-table-properties-align-${align}`);
32668
- insert(_el$45, () => t(`table.align${align[0].toUpperCase()}${align.slice(1)}`), null);
32669
- createRenderEffect(() => _el$46.checked = tableAlign() === align);
32670
- return _el$45;
32685
+ 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;
32686
+ insert(_el$8, () => t("table.sizeSection"));
32687
+ insert(_el$9, () => numericInput(t("table.preferredWidth"), tableWidth, setTableWidth, "editor-table-properties-table-width"), _el$0);
32688
+ insert(_el$1, () => t("table.measureIn"));
32689
+ _el$10.addEventListener("change", (e) => setTableWidthUnit(e.currentTarget.value));
32690
+ insert(_el$11, () => t("table.points"));
32691
+ insert(_el$12, () => t("table.percent"));
32692
+ insert(_el$14, () => t("table.alignmentSection"));
32693
+ insert(_el$15, () => ["left", "center", "right"].map((align) => (() => {
32694
+ var _el$43 = _tmpl$7(), _el$44 = _el$43.firstChild;
32695
+ _el$44.addEventListener("change", () => setTableAlign(align));
32696
+ setAttribute(_el$44, "data-testid", `editor-table-properties-align-${align}`);
32697
+ insert(_el$43, () => t(`table.align${align[0].toUpperCase()}${align.slice(1)}`), null);
32698
+ createRenderEffect(() => _el$44.checked = tableAlign() === align);
32699
+ return _el$43;
32671
32700
  })()));
32672
- insert(_el$18, () => numericInput(t("table.indentFromLeft"), tableIndentLeft, setTableIndentLeft, "editor-table-properties-indent-left"));
32673
- insert(_el$20, () => t("table.textWrappingSection"));
32674
- insert(_el$21, () => checkbox(t("table.wrapNone"), () => tableWrapping() === "none", () => setTableWrapping("none"), "editor-table-properties-wrap-none"), null);
32675
- insert(_el$21, () => checkbox(t("table.wrapAround"), () => tableWrapping() === "around", () => setTableWrapping("around"), "editor-table-properties-wrap-around"), null);
32676
- insert(_el$19, createComponent(Show, {
32701
+ insert(_el$16, () => numericInput(t("table.indentFromLeft"), tableIndentLeft, setTableIndentLeft, "editor-table-properties-indent-left"));
32702
+ insert(_el$18, () => t("table.textWrappingSection"));
32703
+ insert(_el$19, () => checkbox(t("table.wrapNone"), () => tableWrapping() === "none", () => setTableWrapping("none"), "editor-table-properties-wrap-none"), null);
32704
+ insert(_el$19, () => checkbox(t("table.wrapAround"), () => tableWrapping() === "around", () => setTableWrapping("around"), "editor-table-properties-wrap-around"), null);
32705
+ insert(_el$17, createComponent(Show, {
32677
32706
  get when() {
32678
32707
  return tableWrapping() === "around";
32679
32708
  },
32680
32709
  get children() {
32681
32710
  return [(() => {
32682
- var _el$22 = _tmpl$5$1(), _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$27.nextSibling, _el$29 = _el$23.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;
32683
- insert(_el$24, () => t("table.horizontalAnchor"));
32684
- _el$25.addEventListener("change", (e) => setFloatingHorizontalAnchor(e.currentTarget.value));
32685
- insert(_el$26, () => t("table.anchorMargin"));
32686
- insert(_el$27, () => t("table.anchorPage"));
32687
- insert(_el$28, () => t("table.anchorText"));
32688
- insert(_el$30, () => t("table.verticalAnchor"));
32689
- _el$31.addEventListener("change", (e) => setFloatingVerticalAnchor(e.currentTarget.value));
32690
- insert(_el$32, () => t("table.anchorMargin"));
32691
- insert(_el$33, () => t("table.anchorPage"));
32692
- insert(_el$34, () => t("table.anchorText"));
32693
- createRenderEffect(() => _el$25.value = floatingHorizontalAnchor());
32694
- createRenderEffect(() => _el$31.value = floatingVerticalAnchor());
32695
- return _el$22;
32711
+ 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;
32712
+ insert(_el$22, () => t("table.horizontalAnchor"));
32713
+ _el$23.addEventListener("change", (e) => setFloatingHorizontalAnchor(e.currentTarget.value));
32714
+ insert(_el$24, () => t("table.anchorMargin"));
32715
+ insert(_el$25, () => t("table.anchorPage"));
32716
+ insert(_el$26, () => t("table.anchorText"));
32717
+ insert(_el$28, () => t("table.verticalAnchor"));
32718
+ _el$29.addEventListener("change", (e) => setFloatingVerticalAnchor(e.currentTarget.value));
32719
+ insert(_el$30, () => t("table.anchorMargin"));
32720
+ insert(_el$31, () => t("table.anchorPage"));
32721
+ insert(_el$32, () => t("table.anchorText"));
32722
+ createRenderEffect(() => _el$23.value = floatingHorizontalAnchor());
32723
+ createRenderEffect(() => _el$29.value = floatingVerticalAnchor());
32724
+ return _el$20;
32696
32725
  })(), (() => {
32697
- var _el$35 = _tmpl$6$1(), _el$36 = _el$35.firstChild, _el$37 = _el$36.firstChild, _el$38 = _el$37.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$36.nextSibling, _el$41 = _el$40.firstChild, _el$42 = _el$41.nextSibling, _el$43 = _el$42.firstChild;
32698
- insert(_el$35, () => numericInput(t("table.positionX"), floatingX, setFloatingX, "editor-table-properties-floating-x", Boolean(floatingXAlign()), true), _el$36);
32699
- insert(_el$35, () => numericInput(t("table.positionY"), floatingY, setFloatingY, "editor-table-properties-floating-y", Boolean(floatingYAlign()), true), _el$36);
32700
- insert(_el$37, () => t("table.horizontalAlignment"));
32701
- _el$38.addEventListener("change", (e) => setFloatingXAlign(e.currentTarget.value));
32702
- insert(_el$39, () => t("table.explicitOffset"));
32703
- insert(_el$38, () => ["left", "center", "right", "inside", "outside"].map((value) => (() => {
32704
- var _el$47 = _tmpl$0();
32705
- _el$47.value = value;
32706
- insert(_el$47, value);
32707
- return _el$47;
32726
+ 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;
32727
+ insert(_el$33, () => numericInput(t("table.positionX"), floatingX, setFloatingX, "editor-table-properties-floating-x", Boolean(floatingXAlign()), true), _el$34);
32728
+ insert(_el$33, () => numericInput(t("table.positionY"), floatingY, setFloatingY, "editor-table-properties-floating-y", Boolean(floatingYAlign()), true), _el$34);
32729
+ insert(_el$35, () => t("table.horizontalAlignment"));
32730
+ _el$36.addEventListener("change", (e) => setFloatingXAlign(e.currentTarget.value));
32731
+ insert(_el$37, () => t("table.explicitOffset"));
32732
+ insert(_el$36, () => ["left", "center", "right", "inside", "outside"].map((value) => (() => {
32733
+ var _el$45 = _tmpl$8();
32734
+ _el$45.value = value;
32735
+ insert(_el$45, value);
32736
+ return _el$45;
32708
32737
  })()), null);
32709
- insert(_el$41, () => t("table.verticalAlignment"));
32710
- _el$42.addEventListener("change", (e) => setFloatingYAlign(e.currentTarget.value));
32711
- insert(_el$43, () => t("table.explicitOffset"));
32712
- insert(_el$42, () => ["top", "center", "bottom", "inside", "outside"].map((value) => (() => {
32713
- var _el$48 = _tmpl$0();
32714
- _el$48.value = value;
32715
- insert(_el$48, value);
32716
- return _el$48;
32738
+ insert(_el$39, () => t("table.verticalAlignment"));
32739
+ _el$40.addEventListener("change", (e) => setFloatingYAlign(e.currentTarget.value));
32740
+ insert(_el$41, () => t("table.explicitOffset"));
32741
+ insert(_el$40, () => ["top", "center", "bottom", "inside", "outside"].map((value) => (() => {
32742
+ var _el$46 = _tmpl$8();
32743
+ _el$46.value = value;
32744
+ insert(_el$46, value);
32745
+ return _el$46;
32717
32746
  })()), null);
32718
- createRenderEffect(() => _el$38.value = floatingXAlign());
32719
- createRenderEffect(() => _el$42.value = floatingYAlign());
32720
- return _el$35;
32747
+ createRenderEffect(() => _el$36.value = floatingXAlign());
32748
+ createRenderEffect(() => _el$40.value = floatingYAlign());
32749
+ return _el$33;
32721
32750
  })(), (() => {
32722
- var _el$44 = _tmpl$7();
32723
- insert(_el$44, () => numericInput(t("table.distanceTop"), floatingDistanceTop, setFloatingDistanceTop, "editor-table-properties-floating-distance-top"), null);
32724
- insert(_el$44, () => numericInput(t("table.distanceRight"), floatingDistanceRight, setFloatingDistanceRight, "editor-table-properties-floating-distance-right"), null);
32725
- insert(_el$44, () => numericInput(t("table.distanceBottom"), floatingDistanceBottom, setFloatingDistanceBottom, "editor-table-properties-floating-distance-bottom"), null);
32726
- insert(_el$44, () => numericInput(t("table.distanceLeft"), floatingDistanceLeft, setFloatingDistanceLeft, "editor-table-properties-floating-distance-left"), null);
32727
- return _el$44;
32751
+ var _el$42 = _tmpl$5$1();
32752
+ insert(_el$42, () => numericInput(t("table.distanceTop"), floatingDistanceTop, setFloatingDistanceTop, "editor-table-properties-floating-distance-top"), null);
32753
+ insert(_el$42, () => numericInput(t("table.distanceRight"), floatingDistanceRight, setFloatingDistanceRight, "editor-table-properties-floating-distance-right"), null);
32754
+ insert(_el$42, () => numericInput(t("table.distanceBottom"), floatingDistanceBottom, setFloatingDistanceBottom, "editor-table-properties-floating-distance-bottom"), null);
32755
+ insert(_el$42, () => numericInput(t("table.distanceLeft"), floatingDistanceLeft, setFloatingDistanceLeft, "editor-table-properties-floating-distance-left"), null);
32756
+ return _el$42;
32728
32757
  })(), memo(() => checkbox(t("table.allowOverlap"), () => floatingOverlap() === "overlap", (value) => setFloatingOverlap(value ? "overlap" : "never"), "editor-table-properties-floating-overlap"))];
32729
32758
  }
32730
32759
  }), null);
32731
- createRenderEffect(() => _el$12.value = tableWidthUnit());
32732
- return _el$8;
32760
+ createRenderEffect(() => _el$10.value = tableWidthUnit());
32761
+ return _el$6;
32733
32762
  })()
32734
32763
  }, {
32735
32764
  id: "row",
32736
32765
  label: t("table.tabRow"),
32737
32766
  testId: "editor-table-properties-tab-row",
32738
32767
  panel: (() => {
32739
- var _el$49 = _tmpl$1(), _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$51.firstChild, _el$53 = _el$52.nextSibling, _el$54 = _el$53.firstChild, _el$55 = _el$54.nextSibling, _el$56 = _el$55.nextSibling, _el$57 = _el$50.nextSibling;
32740
- insert(_el$50, () => numericInput(t("table.rowHeight"), rowHeight, setRowHeight, "editor-table-properties-row-height"), _el$51);
32741
- insert(_el$52, () => t("table.rowHeightRule"));
32742
- _el$53.addEventListener("change", (e) => setRowHeightRule(e.currentTarget.value));
32743
- insert(_el$54, () => t("table.rowAuto"));
32744
- insert(_el$55, () => t("table.rowAtLeast"));
32745
- insert(_el$56, () => t("table.rowExactly"));
32746
- insert(_el$57, () => checkbox(t("table.repeatHeader"), repeatHeader, setRepeatHeader, "editor-table-properties-repeat-header"), null);
32747
- insert(_el$57, () => checkbox(t("table.allowBreakAcrossPages"), allowBreakAcrossPages, setAllowBreakAcrossPages, "editor-table-properties-allow-break"), null);
32748
- insert(_el$57, () => checkbox(t("table.hiddenRow"), hiddenRow, setHiddenRow, "editor-table-properties-hidden-row"), null);
32749
- createRenderEffect(() => _el$53.value = rowHeightRule());
32750
- return _el$49;
32768
+ 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;
32769
+ insert(_el$48, () => numericInput(t("table.rowHeight"), rowHeight, setRowHeight, "editor-table-properties-row-height"), _el$49);
32770
+ insert(_el$50, () => t("table.rowHeightRule"));
32771
+ _el$51.addEventListener("change", (e) => setRowHeightRule(e.currentTarget.value));
32772
+ insert(_el$52, () => t("table.rowAuto"));
32773
+ insert(_el$53, () => t("table.rowAtLeast"));
32774
+ insert(_el$54, () => t("table.rowExactly"));
32775
+ insert(_el$55, () => checkbox(t("table.repeatHeader"), repeatHeader, setRepeatHeader, "editor-table-properties-repeat-header"), null);
32776
+ insert(_el$55, () => checkbox(t("table.allowBreakAcrossPages"), allowBreakAcrossPages, setAllowBreakAcrossPages, "editor-table-properties-allow-break"), null);
32777
+ insert(_el$55, () => checkbox(t("table.hiddenRow"), hiddenRow, setHiddenRow, "editor-table-properties-hidden-row"), null);
32778
+ createRenderEffect(() => _el$51.value = rowHeightRule());
32779
+ return _el$47;
32751
32780
  })()
32752
32781
  }, {
32753
32782
  id: "column",
32754
32783
  label: t("table.tabColumn"),
32755
32784
  testId: "editor-table-properties-tab-column",
32756
32785
  panel: (() => {
32757
- var _el$58 = _tmpl$10(), _el$59 = _el$58.firstChild;
32758
- insert(_el$59, () => numericInput(t("table.columnWidth"), columnWidth, setColumnWidth, "editor-table-properties-column-width"));
32759
- return _el$58;
32786
+ var _el$56 = _tmpl$0(), _el$57 = _el$56.firstChild;
32787
+ insert(_el$57, () => numericInput(t("table.columnWidth"), columnWidth, setColumnWidth, "editor-table-properties-column-width"));
32788
+ return _el$56;
32760
32789
  })()
32761
32790
  }, {
32762
32791
  id: "cell",
32763
32792
  label: t("table.tabCell"),
32764
32793
  testId: "editor-table-properties-tab-cell",
32765
32794
  panel: (() => {
32766
- var _el$60 = _tmpl$11(), _el$61 = _el$60.firstChild, _el$62 = _el$61.firstChild, _el$63 = _el$62.firstChild, _el$64 = _el$63.nextSibling, _el$65 = _el$64.firstChild, _el$66 = _el$65.nextSibling, _el$67 = _el$66.nextSibling, _el$68 = _el$67.nextSibling, _el$69 = _el$62.nextSibling, _el$70 = _el$69.firstChild, _el$71 = _el$70.nextSibling, _el$72 = _el$71.firstChild, _el$73 = _el$61.nextSibling, _el$74 = _el$73.firstChild, _el$75 = _el$74.nextSibling, _el$76 = _el$73.nextSibling, _el$77 = _el$76.firstChild, _el$78 = _el$77.nextSibling, _el$79 = _el$76.nextSibling, _el$80 = _el$79.firstChild, _el$81 = _el$80.nextSibling, _el$82 = _el$81.firstChild, _el$83 = _el$82.firstChild, _el$84 = _el$83.nextSibling, _el$85 = _el$84.firstChild, _el$86 = _el$85.nextSibling, _el$87 = _el$86.nextSibling, _el$88 = _el$87.nextSibling, _el$89 = _el$82.nextSibling, _el$90 = _el$89.firstChild, _el$91 = _el$90.nextSibling, _el$92 = _el$89.nextSibling, _el$93 = _el$92.firstChild, _el$94 = _el$93.nextSibling, _el$95 = _el$81.nextSibling, _el$96 = _el$95.nextSibling;
32767
- insert(_el$61, () => numericInput(t("table.cellWidth"), cellWidth, setCellWidth, "editor-table-properties-cell-width"), _el$62);
32768
- insert(_el$63, () => t("table.verticalAlignment"));
32769
- _el$64.addEventListener("change", (e) => setCellVerticalAlign(e.currentTarget.value));
32770
- insert(_el$65, () => t("table.inherit"));
32771
- insert(_el$66, () => t("table.valignTop"));
32772
- insert(_el$67, () => t("table.valignMiddle"));
32773
- insert(_el$68, () => t("table.valignBottom"));
32774
- insert(_el$70, () => t("table.textDirection"));
32775
- _el$71.addEventListener("change", (e) => setCellTextDirection(e.currentTarget.value));
32776
- insert(_el$72, () => t("table.inherit"));
32777
- insert(_el$74, () => t("table.options"));
32778
- insert(_el$75, () => checkbox(t("table.noWrap"), cellNoWrap, setCellNoWrap, "editor-table-properties-cell-nowrap"), null);
32779
- insert(_el$75, () => checkbox(t("table.fitText"), cellFitText, setCellFitText, "editor-table-properties-cell-fit-text"), null);
32780
- insert(_el$75, () => checkbox(t("table.hideMark"), cellHideMark, setCellHideMark, "editor-table-properties-cell-hide-mark"), null);
32781
- insert(_el$77, () => t("table.cellMargins"));
32782
- insert(_el$78, () => numericInput(t("paragraph.borderSideTop"), marginTop, setMarginTop, "editor-table-properties-margin-top"), null);
32783
- insert(_el$78, () => numericInput(t("paragraph.borderSideRight"), marginRight, setMarginRight, "editor-table-properties-margin-right"), null);
32784
- insert(_el$78, () => numericInput(t("paragraph.borderSideBottom"), marginBottom, setMarginBottom, "editor-table-properties-margin-bottom"), null);
32785
- insert(_el$78, () => numericInput(t("paragraph.borderSideLeft"), marginLeft, setMarginLeft, "editor-table-properties-margin-left"), null);
32786
- insert(_el$80, () => t("paragraph.bordersSection"));
32787
- insert(_el$83, () => t("paragraph.borderStyleLabel"));
32788
- _el$84.addEventListener("change", (e) => {
32795
+ 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;
32796
+ insert(_el$59, () => numericInput(t("table.cellWidth"), cellWidth, setCellWidth, "editor-table-properties-cell-width"), _el$60);
32797
+ insert(_el$61, () => t("table.verticalAlignment"));
32798
+ _el$62.addEventListener("change", (e) => setCellVerticalAlign(e.currentTarget.value));
32799
+ insert(_el$63, () => t("table.inherit"));
32800
+ insert(_el$64, () => t("table.valignTop"));
32801
+ insert(_el$65, () => t("table.valignMiddle"));
32802
+ insert(_el$66, () => t("table.valignBottom"));
32803
+ insert(_el$68, () => t("table.textDirection"));
32804
+ _el$69.addEventListener("change", (e) => setCellTextDirection(e.currentTarget.value));
32805
+ insert(_el$70, () => t("table.inherit"));
32806
+ insert(_el$72, () => t("table.options"));
32807
+ insert(_el$73, () => checkbox(t("table.noWrap"), cellNoWrap, setCellNoWrap, "editor-table-properties-cell-nowrap"), null);
32808
+ insert(_el$73, () => checkbox(t("table.fitText"), cellFitText, setCellFitText, "editor-table-properties-cell-fit-text"), null);
32809
+ insert(_el$73, () => checkbox(t("table.hideMark"), cellHideMark, setCellHideMark, "editor-table-properties-cell-hide-mark"), null);
32810
+ insert(_el$75, () => t("table.cellMargins"));
32811
+ insert(_el$76, () => numericInput(t("paragraph.borderSideTop"), marginTop, setMarginTop, "editor-table-properties-margin-top"), null);
32812
+ insert(_el$76, () => numericInput(t("paragraph.borderSideRight"), marginRight, setMarginRight, "editor-table-properties-margin-right"), null);
32813
+ insert(_el$76, () => numericInput(t("paragraph.borderSideBottom"), marginBottom, setMarginBottom, "editor-table-properties-margin-bottom"), null);
32814
+ insert(_el$76, () => numericInput(t("paragraph.borderSideLeft"), marginLeft, setMarginLeft, "editor-table-properties-margin-left"), null);
32815
+ insert(_el$78, () => t("paragraph.bordersSection"));
32816
+ insert(_el$81, () => t("paragraph.borderStyleLabel"));
32817
+ _el$82.addEventListener("change", (e) => {
32789
32818
  const next = e.currentTarget.value;
32790
32819
  setBorderStyle(next);
32791
32820
  if (next === "none") {
@@ -32804,52 +32833,52 @@ function TablePropertiesDialog(props) {
32804
32833
  setBorderLeft(true);
32805
32834
  }
32806
32835
  });
32807
- insert(_el$85, () => t("paragraph.borderNone"));
32808
- insert(_el$86, () => t("paragraph.borderSolid"));
32809
- insert(_el$87, () => t("paragraph.borderDashed"));
32810
- insert(_el$88, () => t("paragraph.borderDotted"));
32811
- insert(_el$81, () => numericInput(t("paragraph.borderWidthLabel"), borderWidth, setBorderWidth, "editor-table-properties-border-width", borderStyle() === "none"), _el$89);
32812
- insert(_el$90, () => t("paragraph.borderColorLabel"));
32813
- _el$91.$$input = (e) => setBorderColor(e.currentTarget.value);
32814
- insert(_el$93, () => t("paragraph.shadingLabel"));
32815
- _el$94.$$input = (e) => setShading(e.currentTarget.value);
32816
- insert(_el$95, () => checkbox(t("paragraph.borderSideTop"), borderTop, setBorderTop, "editor-table-properties-border-top", borderStyle() === "none"), null);
32817
- insert(_el$95, () => checkbox(t("paragraph.borderSideRight"), borderRight, setBorderRight, "editor-table-properties-border-right", borderStyle() === "none"), null);
32818
- insert(_el$95, () => checkbox(t("paragraph.borderSideBottom"), borderBottom, setBorderBottom, "editor-table-properties-border-bottom", borderStyle() === "none"), null);
32819
- insert(_el$95, () => checkbox(t("paragraph.borderSideLeft"), borderLeft, setBorderLeft, "editor-table-properties-border-left", borderStyle() === "none"), null);
32820
- insert(_el$95, () => checkbox(t("table.borderStart"), borderStart, setBorderStart, "editor-table-properties-border-start", borderStyle() === "none"), null);
32821
- insert(_el$95, () => checkbox(t("table.borderEnd"), borderEnd, setBorderEnd, "editor-table-properties-border-end", borderStyle() === "none"), null);
32822
- insert(_el$95, () => checkbox(t("table.borderTlBr"), borderTlBr, setBorderTlBr, "editor-table-properties-border-tlbr", borderStyle() === "none"), null);
32823
- insert(_el$95, () => checkbox(t("table.borderTrBl"), borderTrBl, setBorderTrBl, "editor-table-properties-border-trbl", borderStyle() === "none"), null);
32836
+ insert(_el$83, () => t("paragraph.borderNone"));
32837
+ insert(_el$84, () => t("paragraph.borderSolid"));
32838
+ insert(_el$85, () => t("paragraph.borderDashed"));
32839
+ insert(_el$86, () => t("paragraph.borderDotted"));
32840
+ insert(_el$79, () => numericInput(t("paragraph.borderWidthLabel"), borderWidth, setBorderWidth, "editor-table-properties-border-width", borderStyle() === "none"), _el$87);
32841
+ insert(_el$88, () => t("paragraph.borderColorLabel"));
32842
+ _el$89.$$input = (e) => setBorderColor(e.currentTarget.value);
32843
+ insert(_el$91, () => t("paragraph.shadingLabel"));
32844
+ _el$92.$$input = (e) => setShading(e.currentTarget.value);
32845
+ insert(_el$93, () => checkbox(t("paragraph.borderSideTop"), borderTop, setBorderTop, "editor-table-properties-border-top", borderStyle() === "none"), null);
32846
+ insert(_el$93, () => checkbox(t("paragraph.borderSideRight"), borderRight, setBorderRight, "editor-table-properties-border-right", borderStyle() === "none"), null);
32847
+ insert(_el$93, () => checkbox(t("paragraph.borderSideBottom"), borderBottom, setBorderBottom, "editor-table-properties-border-bottom", borderStyle() === "none"), null);
32848
+ insert(_el$93, () => checkbox(t("paragraph.borderSideLeft"), borderLeft, setBorderLeft, "editor-table-properties-border-left", borderStyle() === "none"), null);
32849
+ insert(_el$93, () => checkbox(t("table.borderStart"), borderStart, setBorderStart, "editor-table-properties-border-start", borderStyle() === "none"), null);
32850
+ insert(_el$93, () => checkbox(t("table.borderEnd"), borderEnd, setBorderEnd, "editor-table-properties-border-end", borderStyle() === "none"), null);
32851
+ insert(_el$93, () => checkbox(t("table.borderTlBr"), borderTlBr, setBorderTlBr, "editor-table-properties-border-tlbr", borderStyle() === "none"), null);
32852
+ insert(_el$93, () => checkbox(t("table.borderTrBl"), borderTrBl, setBorderTrBl, "editor-table-properties-border-trbl", borderStyle() === "none"), null);
32824
32853
  createRenderEffect((_p$) => {
32825
32854
  var _v$ = borderStyle() === "none", _v$2 = borderPreview();
32826
- _v$ !== _p$.e && (_el$91.disabled = _p$.e = _v$);
32827
- _p$.t = style(_el$96, _v$2, _p$.t);
32855
+ _v$ !== _p$.e && (_el$89.disabled = _p$.e = _v$);
32856
+ _p$.t = style(_el$94, _v$2, _p$.t);
32828
32857
  return _p$;
32829
32858
  }, {
32830
32859
  e: void 0,
32831
32860
  t: void 0
32832
32861
  });
32833
- createRenderEffect(() => _el$64.value = cellVerticalAlign());
32834
- createRenderEffect(() => _el$71.value = cellTextDirection());
32835
- createRenderEffect(() => _el$84.value = borderStyle());
32836
- createRenderEffect(() => _el$91.value = borderColor() || DEFAULT_BORDER_COLOR);
32837
- createRenderEffect(() => _el$94.value = shading() || "#ffffff");
32838
- return _el$60;
32862
+ createRenderEffect(() => _el$62.value = cellVerticalAlign());
32863
+ createRenderEffect(() => _el$69.value = cellTextDirection());
32864
+ createRenderEffect(() => _el$82.value = borderStyle());
32865
+ createRenderEffect(() => _el$89.value = borderColor() || DEFAULT_BORDER_COLOR);
32866
+ createRenderEffect(() => _el$92.value = shading() || "#ffffff");
32867
+ return _el$58;
32839
32868
  })()
32840
32869
  }, {
32841
32870
  id: "altText",
32842
32871
  label: t("table.tabAltText"),
32843
32872
  testId: "editor-table-properties-tab-alt-text",
32844
32873
  panel: (() => {
32845
- var _el$97 = _tmpl$12(), _el$98 = _el$97.firstChild, _el$99 = _el$98.firstChild, _el$100 = _el$99.nextSibling, _el$101 = _el$98.nextSibling, _el$102 = _el$101.firstChild, _el$103 = _el$102.nextSibling;
32846
- insert(_el$99, () => t("table.altTitle"));
32847
- _el$100.$$input = (e) => setAltTitle(e.currentTarget.value);
32848
- insert(_el$102, () => t("table.altDescription"));
32849
- _el$103.$$input = (e) => setAltDescription(e.currentTarget.value);
32850
- createRenderEffect(() => _el$100.value = altTitle());
32851
- createRenderEffect(() => _el$103.value = altDescription());
32852
- return _el$97;
32874
+ 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;
32875
+ insert(_el$97, () => t("table.altTitle"));
32876
+ _el$98.$$input = (e) => setAltTitle(e.currentTarget.value);
32877
+ insert(_el$100, () => t("table.altDescription"));
32878
+ _el$101.$$input = (e) => setAltDescription(e.currentTarget.value);
32879
+ createRenderEffect(() => _el$98.value = altTitle());
32880
+ createRenderEffect(() => _el$101.value = altDescription());
32881
+ return _el$95;
32853
32882
  })()
32854
32883
  }];
32855
32884
  }
@@ -32857,7 +32886,7 @@ function TablePropertiesDialog(props) {
32857
32886
  }
32858
32887
  });
32859
32888
  }
32860
- delegateEvents(["input", "click"]);
32889
+ delegateEvents(["input"]);
32861
32890
  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>`);
32862
32891
  function FindReplaceDialog(props) {
32863
32892
  const t = useI18n();
@@ -43417,6 +43446,29 @@ const applyTableAwareParagraphEdit = (current, getTargetBlocks, edit) => {
43417
43446
  selection: tempResult.selection
43418
43447
  };
43419
43448
  };
43449
+ function resolveLocationTableMutation(current, getTargetBlocks) {
43450
+ const location = findParagraphTableLocation(
43451
+ current.document,
43452
+ current.selection.focus.paragraphId,
43453
+ getActiveSectionIndex(current)
43454
+ );
43455
+ if (!location) return null;
43456
+ const targetBlocks = getTargetBlocks(current, location.zone).map(cloneBlock);
43457
+ const tableBlock = targetBlocks[location.blockIndex];
43458
+ if (!tableBlock || tableBlock.type !== "table") return null;
43459
+ return { tableBlock, location, targetBlocks };
43460
+ }
43461
+ function commitTableMutation(current, targetBlocks, zone, nextParagraph) {
43462
+ const nextState = updateBlocksInCurrentSection(current, targetBlocks, zone);
43463
+ if (!nextParagraph) return nextState;
43464
+ return {
43465
+ ...nextState,
43466
+ selection: {
43467
+ anchor: paragraphOffsetToPosition(nextParagraph, 0),
43468
+ focus: paragraphOffsetToPosition(nextParagraph, 0)
43469
+ }
43470
+ };
43471
+ }
43420
43472
  function createTableOpsGuards(deps) {
43421
43473
  const canMergeSelectedTableCells = (current) => {
43422
43474
  const range = deps.resolveHorizontalTableCellRange(current);
@@ -43768,18 +43820,7 @@ function createTableCellSpanOperations(deps) {
43768
43820
  if (!nextParagraph) {
43769
43821
  return current;
43770
43822
  }
43771
- const nextState = updateBlocksInCurrentSection(
43772
- current,
43773
- targetBlocks,
43774
- range.zone
43775
- );
43776
- return {
43777
- ...nextState,
43778
- selection: {
43779
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
43780
- focus: paragraphOffsetToPosition(nextParagraph, 0)
43781
- }
43782
- };
43823
+ return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
43783
43824
  };
43784
43825
  const mergeSelectedTableRows = (current) => {
43785
43826
  const range = deps.resolveVerticalTableCellRange(current);
@@ -43852,18 +43893,7 @@ function createTableCellSpanOperations(deps) {
43852
43893
  if (!nextParagraph) {
43853
43894
  return current;
43854
43895
  }
43855
- const nextState = updateBlocksInCurrentSection(
43856
- current,
43857
- targetBlocks,
43858
- range.zone
43859
- );
43860
- return {
43861
- ...nextState,
43862
- selection: {
43863
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
43864
- focus: paragraphOffsetToPosition(nextParagraph, 0)
43865
- }
43866
- };
43896
+ return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
43867
43897
  };
43868
43898
  const mergeSelectedTable = (current) => {
43869
43899
  if (deps.canMergeSelectedTableCells(current)) {
@@ -43876,19 +43906,9 @@ function createTableCellSpanOperations(deps) {
43876
43906
  };
43877
43907
  const splitSelectedTableCellVertically = (current) => {
43878
43908
  var _a2;
43879
- const location = findParagraphTableLocation(
43880
- current.document,
43881
- current.selection.focus.paragraphId,
43882
- getActiveSectionIndex(current)
43883
- );
43884
- if (!location) {
43885
- return current;
43886
- }
43887
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
43888
- const tableBlock = targetBlocks[location.blockIndex];
43889
- if (!tableBlock || tableBlock.type !== "table") {
43890
- return current;
43891
- }
43909
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
43910
+ if (!mut) return current;
43911
+ const { tableBlock, location, targetBlocks } = mut;
43892
43912
  const cell = (_a2 = tableBlock.rows[location.rowIndex]) == null ? void 0 : _a2.cells[location.cellIndex];
43893
43913
  const span = Math.max(1, (cell == null ? void 0 : cell.rowSpan) ?? 1);
43894
43914
  if (!cell || span <= 1 || cell.vMerge !== "restart") {
@@ -43941,34 +43961,13 @@ function createTableCellSpanOperations(deps) {
43941
43961
  if (!nextParagraph) {
43942
43962
  return current;
43943
43963
  }
43944
- const nextState = updateBlocksInCurrentSection(
43945
- current,
43946
- targetBlocks,
43947
- location.zone
43948
- );
43949
- return {
43950
- ...nextState,
43951
- selection: {
43952
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
43953
- focus: paragraphOffsetToPosition(nextParagraph, 0)
43954
- }
43955
- };
43964
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
43956
43965
  };
43957
43966
  const splitSelectedTableCell = (current) => {
43958
43967
  var _a2;
43959
- const location = findParagraphTableLocation(
43960
- current.document,
43961
- current.selection.focus.paragraphId,
43962
- getActiveSectionIndex(current)
43963
- );
43964
- if (!location) {
43965
- return current;
43966
- }
43967
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
43968
- const tableBlock = targetBlocks[location.blockIndex];
43969
- if (!tableBlock || tableBlock.type !== "table") {
43970
- return current;
43971
- }
43968
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
43969
+ if (!mut) return current;
43970
+ const { tableBlock, location, targetBlocks } = mut;
43972
43971
  const row = tableBlock.rows[location.rowIndex];
43973
43972
  const cell = row == null ? void 0 : row.cells[location.cellIndex];
43974
43973
  const span = Math.max(1, (cell == null ? void 0 : cell.colSpan) ?? 1);
@@ -44015,18 +44014,7 @@ function createTableCellSpanOperations(deps) {
44015
44014
  if (!nextParagraph) {
44016
44015
  return current;
44017
44016
  }
44018
- const nextState = updateBlocksInCurrentSection(
44019
- current,
44020
- targetBlocks,
44021
- location.zone
44022
- );
44023
- return {
44024
- ...nextState,
44025
- selection: {
44026
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
44027
- focus: paragraphOffsetToPosition(nextParagraph, 0)
44028
- }
44029
- };
44017
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44030
44018
  };
44031
44019
  const splitSelectedTable = (current) => {
44032
44020
  if (deps.canSplitSelectedTableCellVertically(current)) {
@@ -44049,19 +44037,9 @@ function createTableCellSpanOperations(deps) {
44049
44037
  function createTableRowColumnOperations(deps) {
44050
44038
  const insertSelectedTableRow = (current, direction) => {
44051
44039
  var _a2, _b2;
44052
- const location = findParagraphTableLocation(
44053
- current.document,
44054
- current.selection.focus.paragraphId,
44055
- getActiveSectionIndex(current)
44056
- );
44057
- if (!location) {
44058
- return current;
44059
- }
44060
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
44061
- const tableBlock = targetBlocks[location.blockIndex];
44062
- if (!tableBlock || tableBlock.type !== "table") {
44063
- return current;
44064
- }
44040
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
44041
+ if (!mut) return current;
44042
+ const { tableBlock, location, targetBlocks } = mut;
44065
44043
  const sourceRow = tableBlock.rows[location.rowIndex];
44066
44044
  if (!sourceRow) {
44067
44045
  return current;
@@ -44127,25 +44105,7 @@ function createTableRowColumnOperations(deps) {
44127
44105
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? ((_a2 = blankRow.cells.find(
44128
44106
  (cell) => cell.vMerge !== "continue" && cell.blocks[0]
44129
44107
  )) == null ? void 0 : _a2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44130
- if (!nextParagraph2) {
44131
- return updateBlocksInCurrentSection(
44132
- current,
44133
- targetBlocks,
44134
- location.zone
44135
- );
44136
- }
44137
- const nextState2 = updateBlocksInCurrentSection(
44138
- current,
44139
- targetBlocks,
44140
- location.zone
44141
- );
44142
- return {
44143
- ...nextState2,
44144
- selection: {
44145
- anchor: paragraphOffsetToPosition(nextParagraph2, 0),
44146
- focus: paragraphOffsetToPosition(nextParagraph2, 0)
44147
- }
44148
- };
44108
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
44149
44109
  }
44150
44110
  blankRow = createEditorTableRow(
44151
44111
  sourceRow.cells.map(
@@ -44169,36 +44129,12 @@ function createTableRowColumnOperations(deps) {
44169
44129
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? ((_b2 = blankRow.cells.find(
44170
44130
  (cell) => cell.vMerge !== "continue" && cell.blocks[0]
44171
44131
  )) == null ? void 0 : _b2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44172
- if (!nextParagraph) {
44173
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44174
- }
44175
- const nextState = updateBlocksInCurrentSection(
44176
- current,
44177
- targetBlocks,
44178
- location.zone
44179
- );
44180
- return {
44181
- ...nextState,
44182
- selection: {
44183
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
44184
- focus: paragraphOffsetToPosition(nextParagraph, 0)
44185
- }
44186
- };
44132
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44187
44133
  };
44188
44134
  const deleteSelectedTableRow = (current) => {
44189
- const location = findParagraphTableLocation(
44190
- current.document,
44191
- current.selection.focus.paragraphId,
44192
- getActiveSectionIndex(current)
44193
- );
44194
- if (!location) {
44195
- return current;
44196
- }
44197
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
44198
- const tableBlock = targetBlocks[location.blockIndex];
44199
- if (!tableBlock || tableBlock.type !== "table") {
44200
- return current;
44201
- }
44135
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
44136
+ if (!mut) return current;
44137
+ const { tableBlock, location, targetBlocks } = mut;
44202
44138
  if (tableBlock.rows.length <= 1 && !current.trackChangesEnabled) {
44203
44139
  return current;
44204
44140
  }
@@ -44214,7 +44150,7 @@ function createTableRowColumnOperations(deps) {
44214
44150
  type: "delete"
44215
44151
  }
44216
44152
  };
44217
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44153
+ return commitTableMutation(current, targetBlocks, location.zone, null);
44218
44154
  }
44219
44155
  const blockedByRestartCell = rowToDelete.cells.some(
44220
44156
  (cell) => cell.vMerge !== "continue" && Math.max(1, cell.rowSpan ?? 1) > 1
@@ -44254,37 +44190,13 @@ function createTableRowColumnOperations(deps) {
44254
44190
  )
44255
44191
  ) : null;
44256
44192
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44257
- if (!nextParagraph) {
44258
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44259
- }
44260
- const nextState = updateBlocksInCurrentSection(
44261
- current,
44262
- targetBlocks,
44263
- location.zone
44264
- );
44265
- return {
44266
- ...nextState,
44267
- selection: {
44268
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
44269
- focus: paragraphOffsetToPosition(nextParagraph, 0)
44270
- }
44271
- };
44193
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44272
44194
  };
44273
44195
  const insertSelectedTableColumn = (current, direction) => {
44274
44196
  var _a2;
44275
- const location = findParagraphTableLocation(
44276
- current.document,
44277
- current.selection.focus.paragraphId,
44278
- getActiveSectionIndex(current)
44279
- );
44280
- if (!location) {
44281
- return current;
44282
- }
44283
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
44284
- const tableBlock = targetBlocks[location.blockIndex];
44285
- if (!tableBlock || tableBlock.type !== "table") {
44286
- return current;
44287
- }
44197
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
44198
+ if (!mut) return current;
44199
+ const { tableBlock, location, targetBlocks } = mut;
44288
44200
  const hasHorizontalSpansInTable = tableBlock.rows.some(
44289
44201
  (row) => row.cells.some((cell) => Math.max(1, cell.colSpan ?? 1) > 1)
44290
44202
  );
@@ -44355,25 +44267,7 @@ function createTableRowColumnOperations(deps) {
44355
44267
  const targetRow2 = tableBlock.rows[location.rowIndex];
44356
44268
  const targetCell2 = targetRow2 ? findCellAtVisualColumn(targetRow2, insertVisualColumn) : null;
44357
44269
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44358
- if (!nextParagraph2) {
44359
- return updateBlocksInCurrentSection(
44360
- current,
44361
- targetBlocks,
44362
- location.zone
44363
- );
44364
- }
44365
- const nextState2 = updateBlocksInCurrentSection(
44366
- current,
44367
- targetBlocks,
44368
- location.zone
44369
- );
44370
- return {
44371
- ...nextState2,
44372
- selection: {
44373
- anchor: paragraphOffsetToPosition(nextParagraph2, 0),
44374
- focus: paragraphOffsetToPosition(nextParagraph2, 0)
44375
- }
44376
- };
44270
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
44377
44271
  }
44378
44272
  const insertIndex = Math.max(
44379
44273
  0,
@@ -44397,37 +44291,13 @@ function createTableRowColumnOperations(deps) {
44397
44291
  const targetRow = tableBlock.rows[location.rowIndex];
44398
44292
  const targetCell = targetRow == null ? void 0 : targetRow.cells[insertIndex];
44399
44293
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44400
- if (!nextParagraph) {
44401
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44402
- }
44403
- const nextState = updateBlocksInCurrentSection(
44404
- current,
44405
- targetBlocks,
44406
- location.zone
44407
- );
44408
- return {
44409
- ...nextState,
44410
- selection: {
44411
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
44412
- focus: paragraphOffsetToPosition(nextParagraph, 0)
44413
- }
44414
- };
44294
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44415
44295
  };
44416
44296
  const deleteSelectedTableColumn = (current) => {
44417
44297
  var _a2;
44418
- const location = findParagraphTableLocation(
44419
- current.document,
44420
- current.selection.focus.paragraphId,
44421
- getActiveSectionIndex(current)
44422
- );
44423
- if (!location) {
44424
- return current;
44425
- }
44426
- const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
44427
- const tableBlock = targetBlocks[location.blockIndex];
44428
- if (!tableBlock || tableBlock.type !== "table") {
44429
- return current;
44430
- }
44298
+ const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
44299
+ if (!mut) return current;
44300
+ const { tableBlock, location, targetBlocks } = mut;
44431
44301
  if (getTableVisualWidth(tableBlock) <= 1) {
44432
44302
  return current;
44433
44303
  }
@@ -44449,7 +44319,7 @@ function createTableRowColumnOperations(deps) {
44449
44319
  };
44450
44320
  }
44451
44321
  }
44452
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44322
+ return commitTableMutation(current, targetBlocks, location.zone, null);
44453
44323
  }
44454
44324
  const hasHorizontalSpansInTable = tableBlock.rows.some(
44455
44325
  (row) => row.cells.some((cell) => Math.max(1, cell.colSpan ?? 1) > 1)
@@ -44488,25 +44358,7 @@ function createTableRowColumnOperations(deps) {
44488
44358
  )
44489
44359
  );
44490
44360
  const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44491
- if (!nextParagraph2) {
44492
- return updateBlocksInCurrentSection(
44493
- current,
44494
- targetBlocks,
44495
- location.zone
44496
- );
44497
- }
44498
- const nextState2 = updateBlocksInCurrentSection(
44499
- current,
44500
- targetBlocks,
44501
- location.zone
44502
- );
44503
- return {
44504
- ...nextState2,
44505
- selection: {
44506
- anchor: paragraphOffsetToPosition(nextParagraph2, 0),
44507
- focus: paragraphOffsetToPosition(nextParagraph2, 0)
44508
- }
44509
- };
44361
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
44510
44362
  }
44511
44363
  if (((_a2 = tableBlock.rows[0]) == null ? void 0 : _a2.cells.length) <= 1) {
44512
44364
  return current;
@@ -44517,21 +44369,7 @@ function createTableRowColumnOperations(deps) {
44517
44369
  const targetRow = tableBlock.rows[location.rowIndex];
44518
44370
  const targetCell = targetRow == null ? void 0 : targetRow.cells[Math.min(location.cellIndex, targetRow.cells.length - 1)];
44519
44371
  const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
44520
- if (!nextParagraph) {
44521
- return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
44522
- }
44523
- const nextState = updateBlocksInCurrentSection(
44524
- current,
44525
- targetBlocks,
44526
- location.zone
44527
- );
44528
- return {
44529
- ...nextState,
44530
- selection: {
44531
- anchor: paragraphOffsetToPosition(nextParagraph, 0),
44532
- focus: paragraphOffsetToPosition(nextParagraph, 0)
44533
- }
44534
- };
44372
+ return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
44535
44373
  };
44536
44374
  return {
44537
44375
  insertSelectedTableRow,
@@ -49043,6 +48881,30 @@ function createEditorCommandsController(deps) {
49043
48881
  selectionCollapsed,
49044
48882
  selectedImageRun
49045
48883
  } = deps;
48884
+ const execState = (next) => {
48885
+ clearPreferredColumn();
48886
+ resetTransactionGrouping();
48887
+ applyState(next);
48888
+ focusInput();
48889
+ };
48890
+ const execText = (producer) => {
48891
+ clearPreferredColumn();
48892
+ resetTransactionGrouping();
48893
+ applySelectionAwareTextCommand(producer);
48894
+ focusInput();
48895
+ };
48896
+ const execParagraph = (producer) => {
48897
+ clearPreferredColumn();
48898
+ resetTransactionGrouping();
48899
+ applySelectionAwareParagraphCommand(producer);
48900
+ focusInput();
48901
+ };
48902
+ const execTransactional = (producer, options) => {
48903
+ clearPreferredColumn();
48904
+ resetTransactionGrouping();
48905
+ applyTransactionalState(producer, options);
48906
+ focusInput();
48907
+ };
49046
48908
  const getSelectedParagraphRange = () => {
49047
48909
  const normalized = normalizeSelection(state);
49048
48910
  return getParagraphs(state).slice(
@@ -49068,12 +48930,9 @@ function createEditorCommandsController(deps) {
49068
48930
  if (!selectionTouchesList()) {
49069
48931
  return false;
49070
48932
  }
49071
- clearPreferredColumn();
49072
- resetTransactionGrouping();
49073
- applySelectionAwareParagraphCommand(
48933
+ execParagraph(
49074
48934
  (current) => direction === "indent" ? indentParagraphList(current) : outdentParagraphList(current)
49075
48935
  );
49076
- focusInput();
49077
48936
  return true;
49078
48937
  };
49079
48938
  const handleListEnter = () => {
@@ -49146,10 +49005,7 @@ function createEditorCommandsController(deps) {
49146
49005
  logger.info(
49147
49006
  `toggleStyle:${key} at ${sel.anchor.paragraphId}:${sel.anchor.runId}[${sel.anchor.offset}..${sel.focus.offset}]${selectionTableLocation()}`
49148
49007
  );
49149
- clearPreferredColumn();
49150
- resetTransactionGrouping();
49151
- applySelectionAwareTextCommand((current) => toggleTextStyle(current, key));
49152
- focusInput();
49008
+ execText((current) => toggleTextStyle(current, key));
49153
49009
  };
49154
49010
  const applyValueStyleCommand = (key, value) => {
49155
49011
  if (selectionCollapsed()) {
@@ -49159,117 +49015,64 @@ function createEditorCommandsController(deps) {
49159
49015
  logger.info(
49160
49016
  `setStyle:${key}=${JSON.stringify(value)} at ${sel.anchor.paragraphId}:${sel.anchor.runId}[${sel.anchor.offset}..${sel.focus.offset}]${selectionTableLocation()}`
49161
49017
  );
49162
- clearPreferredColumn();
49163
- resetTransactionGrouping();
49164
- applySelectionAwareTextCommand(
49165
- (current) => setTextStyleValue(current, key, value)
49166
- );
49167
- focusInput();
49018
+ execText((current) => setTextStyleValue(current, key, value));
49168
49019
  };
49169
49020
  const applyChangeTextCaseCommand = (mode) => {
49170
49021
  if (selectionCollapsed()) {
49171
49022
  return;
49172
49023
  }
49173
- clearPreferredColumn();
49174
- resetTransactionGrouping();
49175
- applySelectionAwareTextCommand(
49176
- (current) => changeSelectedTextCase(current, mode)
49177
- );
49178
- focusInput();
49024
+ execText((current) => changeSelectedTextCase(current, mode));
49179
49025
  };
49180
49026
  const applyClearFormattingCommand = () => {
49181
49027
  if (selectionCollapsed()) {
49182
49028
  return;
49183
49029
  }
49184
- clearPreferredColumn();
49185
- resetTransactionGrouping();
49186
- applySelectionAwareTextCommand(
49187
- (current) => clearSelectedTextFormatting(current)
49188
- );
49189
- focusInput();
49030
+ execText((current) => clearSelectedTextFormatting(current));
49190
49031
  };
49191
49032
  const applyParagraphStyleCommand = (key, value) => {
49192
- clearPreferredColumn();
49193
- resetTransactionGrouping();
49194
- applySelectionAwareParagraphCommand(
49195
- (current) => setParagraphStyle(current, key, value)
49196
- );
49197
- focusInput();
49033
+ execParagraph((current) => setParagraphStyle(current, key, value));
49198
49034
  };
49199
49035
  const toggleParagraphFlagCommand = (key) => {
49200
49036
  const nextValue = !toolbarStyleState()[key];
49201
49037
  applyParagraphStyleCommand(key, nextValue ? true : null);
49202
49038
  };
49203
49039
  const applyParagraphListCommand = (kind) => {
49204
- clearPreferredColumn();
49205
- resetTransactionGrouping();
49206
- applySelectionAwareParagraphCommand(
49207
- (current) => toggleParagraphList(current, kind)
49208
- );
49209
- focusInput();
49040
+ execParagraph((current) => toggleParagraphList(current, kind));
49210
49041
  };
49211
49042
  const handleListFormatChange = (format) => {
49212
- clearPreferredColumn();
49213
- resetTransactionGrouping();
49214
- applySelectionAwareParagraphCommand(
49215
- (current) => setParagraphListFormat(current, format)
49216
- );
49217
- focusInput();
49043
+ execParagraph((current) => setParagraphListFormat(current, format));
49218
49044
  };
49219
49045
  const handleListStartAtChange = (startAt) => {
49220
- clearPreferredColumn();
49221
- resetTransactionGrouping();
49222
- applySelectionAwareParagraphCommand(
49223
- (current) => setParagraphListStartAt(current, startAt)
49224
- );
49225
- focusInput();
49046
+ execParagraph((current) => setParagraphListStartAt(current, startAt));
49226
49047
  };
49227
49048
  const applyInsertSectionBreakCommand = (breakType) => {
49228
- clearPreferredColumn();
49229
- resetTransactionGrouping();
49230
- applyState(insertSectionBreakAtSelection(state, breakType));
49231
- focusInput();
49049
+ execState(insertSectionBreakAtSelection(state, breakType));
49232
49050
  };
49233
49051
  const applyInsertPageBreakCommand = () => {
49234
- clearPreferredColumn();
49235
- resetTransactionGrouping();
49236
- applyTransactionalState(
49052
+ execTransactional(
49237
49053
  (current) => applyTableAwareParagraphEdit2(
49238
49054
  current,
49239
49055
  (temp) => insertPageBreakAtSelection(temp)
49240
49056
  )
49241
49057
  );
49242
- focusInput();
49243
49058
  };
49244
49059
  const canInsertFootnoteCommand = () => (state.activeZone ?? "main") === "main";
49245
49060
  const applyInsertFootnoteCommand = () => {
49246
49061
  if (!canInsertFootnoteCommand()) {
49247
49062
  return;
49248
49063
  }
49249
- clearPreferredColumn();
49250
- resetTransactionGrouping();
49251
- applyTransactionalState((current) => insertFootnote(current));
49252
- focusInput();
49064
+ execTransactional((current) => insertFootnote(current));
49253
49065
  };
49254
49066
  const handleStyleChange = (styleId) => {
49255
- clearPreferredColumn();
49256
- resetTransactionGrouping();
49257
- applySelectionAwareParagraphCommand(
49067
+ execParagraph(
49258
49068
  (current) => setParagraphNamedStyle(current, styleId || null)
49259
49069
  );
49260
- focusInput();
49261
49070
  };
49262
49071
  const applyUpdateSectionSettingsCommand = (sectionIndex, settings) => {
49263
- clearPreferredColumn();
49264
- resetTransactionGrouping();
49265
- applyState(updateSectionSettings(state, sectionIndex, settings));
49266
- focusInput();
49072
+ execState(updateSectionSettings(state, sectionIndex, settings));
49267
49073
  };
49268
49074
  const applyToggleTrackChangesCommand = () => {
49269
- clearPreferredColumn();
49270
- resetTransactionGrouping();
49271
- applyState(toggleTrackChanges(state));
49272
- focusInput();
49075
+ execState(toggleTrackChanges(state));
49273
49076
  };
49274
49077
  const applyToggleShowMarginsCommand = () => {
49275
49078
  applyState({ ...state, showMargins: !state.showMargins });
@@ -49280,28 +49083,19 @@ function createEditorCommandsController(deps) {
49280
49083
  focusInput();
49281
49084
  };
49282
49085
  const applyAcceptRevisionsCommand = () => {
49283
- clearPreferredColumn();
49284
- resetTransactionGrouping();
49285
- applyState(acceptRevisionsInSelection(state));
49286
- focusInput();
49086
+ execState(acceptRevisionsInSelection(state));
49287
49087
  };
49288
49088
  const applyRejectRevisionsCommand = () => {
49289
- clearPreferredColumn();
49290
- resetTransactionGrouping();
49291
- applyState(rejectRevisionsInSelection(state));
49292
- focusInput();
49089
+ execState(rejectRevisionsInSelection(state));
49293
49090
  };
49294
49091
  const applyLinkCommand = (href) => {
49295
49092
  const activeLink = getLinkAtSelection(state);
49296
49093
  if (selectionCollapsed() && !activeLink) {
49297
49094
  return;
49298
49095
  }
49299
- clearPreferredColumn();
49300
- resetTransactionGrouping();
49301
- applyTransactionalState((current) => setLinkAtSelection(current, href), {
49096
+ execTransactional((current) => setLinkAtSelection(current, href), {
49302
49097
  mergeKey: MERGE_KEYS.link
49303
49098
  });
49304
- focusInput();
49305
49099
  };
49306
49100
  const promptForLink = () => {
49307
49101
  const activeLink = getLinkAtSelection(state) ?? "";
@@ -49318,12 +49112,9 @@ function createEditorCommandsController(deps) {
49318
49112
  if (!run) {
49319
49113
  return;
49320
49114
  }
49321
- clearPreferredColumn();
49322
- resetTransactionGrouping();
49323
- applyTransactionalState((current) => setSelectedImageAlt(current, alt), {
49115
+ execTransactional((current) => setSelectedImageAlt(current, alt), {
49324
49116
  mergeKey: MERGE_KEYS.imageAlt
49325
49117
  });
49326
- focusInput();
49327
49118
  };
49328
49119
  const promptForImageAlt = () => {
49329
49120
  var _a2;
@@ -49339,13 +49130,10 @@ function createEditorCommandsController(deps) {
49339
49130
  if (!run) {
49340
49131
  return;
49341
49132
  }
49342
- clearPreferredColumn();
49343
- resetTransactionGrouping();
49344
- applyTransactionalState(
49133
+ execTransactional(
49345
49134
  (current) => setSelectedImageCaption(current, caption, deps.imageCaptionLabel()),
49346
49135
  { mergeKey: MERGE_KEYS.imageCaption }
49347
49136
  );
49348
- focusInput();
49349
49137
  };
49350
49138
  const promptForImageCaption = () => {
49351
49139
  const run = selectedImageRun();