oasis-editor 0.0.111 → 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.
- package/dist/{OasisEditorApp-MEaOb4ut.js → OasisEditorApp-BKPrQtm5.js} +429 -750
- package/dist/app/controllers/tableOpsMutationCommands.d.ts +8 -1
- package/dist/assets/{importDocxWorker-DyYGjoXG.js → importDocxWorker-Bz2kZOBO.js} +1 -1
- package/dist/core/docxTableMaps.d.ts +11 -0
- package/dist/core/editorState.d.ts +5 -14
- package/dist/{index-mocSBySQ.js → index-DSDwe-yy.js} +526 -475
- package/dist/layoutProjection/paginationSegmentEngine.d.ts +40 -0
- package/dist/oasis-editor.js +51 -51
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/canvas/canvasFontResolution.d.ts +19 -0
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +1 -1
- package/dist/ui/components/Dialogs/DialogFooter.d.ts +12 -0
- package/dist/ui/components/Dialogs/TextInputDialog.d.ts +16 -0
- package/package.json +1 -1
|
@@ -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
|
|
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$$
|
|
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$$
|
|
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$
|
|
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$
|
|
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$$
|
|
31297
|
-
function
|
|
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 [
|
|
31316
|
+
const [value, setValue] = createSignal(props.initialValue);
|
|
31300
31317
|
let inputRef;
|
|
31301
31318
|
createEffect(() => {
|
|
31302
31319
|
if (props.isOpen) {
|
|
31303
|
-
|
|
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(
|
|
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
|
|
31333
|
+
return props.title;
|
|
31317
31334
|
},
|
|
31318
31335
|
get onClose() {
|
|
31319
31336
|
return props.onClose;
|
|
31320
31337
|
},
|
|
31321
31338
|
get footer() {
|
|
31322
|
-
return
|
|
31323
|
-
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31330
|
-
|
|
31331
|
-
|
|
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$$
|
|
31336
|
-
insert(_el$2, () =>
|
|
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) =>
|
|
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(() =>
|
|
31342
|
-
|
|
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"
|
|
31348
|
-
|
|
31349
|
-
function ImageAltDialog(props) {
|
|
31382
|
+
delegateEvents(["input", "keydown"]);
|
|
31383
|
+
function LinkDialog(props) {
|
|
31350
31384
|
const t = useI18n();
|
|
31351
|
-
|
|
31352
|
-
|
|
31353
|
-
|
|
31354
|
-
|
|
31355
|
-
|
|
31356
|
-
|
|
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
|
-
|
|
31360
|
-
|
|
31361
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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>`)
|
|
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
|
-
|
|
32263
|
-
|
|
32264
|
-
|
|
32265
|
-
|
|
32266
|
-
|
|
32267
|
-
|
|
32268
|
-
|
|
32269
|
-
|
|
32270
|
-
|
|
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"
|
|
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(`<
|
|
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
|
-
|
|
32630
|
-
|
|
32631
|
-
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
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$
|
|
32657
|
-
insert(_el$
|
|
32658
|
-
insert(_el$
|
|
32659
|
-
insert(_el$
|
|
32660
|
-
_el$
|
|
32661
|
-
insert(_el$
|
|
32662
|
-
insert(_el$
|
|
32663
|
-
insert(_el$
|
|
32664
|
-
insert(_el$
|
|
32665
|
-
var _el$
|
|
32666
|
-
_el$
|
|
32667
|
-
setAttribute(_el$
|
|
32668
|
-
insert(_el$
|
|
32669
|
-
createRenderEffect(() => _el$
|
|
32670
|
-
return _el$
|
|
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$
|
|
32673
|
-
insert(_el$
|
|
32674
|
-
insert(_el$
|
|
32675
|
-
insert(_el$
|
|
32676
|
-
insert(_el$
|
|
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$
|
|
32683
|
-
insert(_el$
|
|
32684
|
-
_el$
|
|
32685
|
-
insert(_el$
|
|
32686
|
-
insert(_el$
|
|
32687
|
-
insert(_el$
|
|
32688
|
-
insert(_el$
|
|
32689
|
-
_el$
|
|
32690
|
-
insert(_el$
|
|
32691
|
-
insert(_el$
|
|
32692
|
-
insert(_el$
|
|
32693
|
-
createRenderEffect(() => _el$
|
|
32694
|
-
createRenderEffect(() => _el$
|
|
32695
|
-
return _el$
|
|
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$
|
|
32698
|
-
insert(_el$
|
|
32699
|
-
insert(_el$
|
|
32700
|
-
insert(_el$
|
|
32701
|
-
_el$
|
|
32702
|
-
insert(_el$
|
|
32703
|
-
insert(_el$
|
|
32704
|
-
var _el$
|
|
32705
|
-
_el$
|
|
32706
|
-
insert(_el$
|
|
32707
|
-
return _el$
|
|
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$
|
|
32710
|
-
_el$
|
|
32711
|
-
insert(_el$
|
|
32712
|
-
insert(_el$
|
|
32713
|
-
var _el$
|
|
32714
|
-
_el$
|
|
32715
|
-
insert(_el$
|
|
32716
|
-
return _el$
|
|
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$
|
|
32719
|
-
createRenderEffect(() => _el$
|
|
32720
|
-
return _el$
|
|
32747
|
+
createRenderEffect(() => _el$36.value = floatingXAlign());
|
|
32748
|
+
createRenderEffect(() => _el$40.value = floatingYAlign());
|
|
32749
|
+
return _el$33;
|
|
32721
32750
|
})(), (() => {
|
|
32722
|
-
var _el$
|
|
32723
|
-
insert(_el$
|
|
32724
|
-
insert(_el$
|
|
32725
|
-
insert(_el$
|
|
32726
|
-
insert(_el$
|
|
32727
|
-
return _el$
|
|
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$
|
|
32732
|
-
return _el$
|
|
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$
|
|
32740
|
-
insert(_el$
|
|
32741
|
-
insert(_el$
|
|
32742
|
-
_el$
|
|
32743
|
-
insert(_el$
|
|
32744
|
-
insert(_el$
|
|
32745
|
-
insert(_el$
|
|
32746
|
-
insert(_el$
|
|
32747
|
-
insert(_el$
|
|
32748
|
-
insert(_el$
|
|
32749
|
-
createRenderEffect(() => _el$
|
|
32750
|
-
return _el$
|
|
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$
|
|
32758
|
-
insert(_el$
|
|
32759
|
-
return _el$
|
|
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$
|
|
32767
|
-
insert(_el$
|
|
32768
|
-
insert(_el$
|
|
32769
|
-
_el$
|
|
32770
|
-
insert(_el$
|
|
32771
|
-
insert(_el$
|
|
32772
|
-
insert(_el$
|
|
32773
|
-
insert(_el$
|
|
32774
|
-
insert(_el$
|
|
32775
|
-
_el$
|
|
32776
|
-
insert(_el$
|
|
32777
|
-
insert(_el$
|
|
32778
|
-
insert(_el$
|
|
32779
|
-
insert(_el$
|
|
32780
|
-
insert(_el$
|
|
32781
|
-
insert(_el$
|
|
32782
|
-
insert(_el$
|
|
32783
|
-
insert(_el$
|
|
32784
|
-
insert(_el$
|
|
32785
|
-
insert(_el$
|
|
32786
|
-
insert(_el$
|
|
32787
|
-
insert(_el$
|
|
32788
|
-
_el$
|
|
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$
|
|
32808
|
-
insert(_el$
|
|
32809
|
-
insert(_el$
|
|
32810
|
-
insert(_el$
|
|
32811
|
-
insert(_el$
|
|
32812
|
-
insert(_el$
|
|
32813
|
-
_el$
|
|
32814
|
-
insert(_el$
|
|
32815
|
-
_el$
|
|
32816
|
-
insert(_el$
|
|
32817
|
-
insert(_el$
|
|
32818
|
-
insert(_el$
|
|
32819
|
-
insert(_el$
|
|
32820
|
-
insert(_el$
|
|
32821
|
-
insert(_el$
|
|
32822
|
-
insert(_el$
|
|
32823
|
-
insert(_el$
|
|
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$
|
|
32827
|
-
_p$.t = style(_el$
|
|
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$
|
|
32834
|
-
createRenderEffect(() => _el$
|
|
32835
|
-
createRenderEffect(() => _el$
|
|
32836
|
-
createRenderEffect(() => _el$
|
|
32837
|
-
createRenderEffect(() => _el$
|
|
32838
|
-
return _el$
|
|
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$
|
|
32846
|
-
insert(_el$
|
|
32847
|
-
_el$
|
|
32848
|
-
insert(_el$
|
|
32849
|
-
_el$
|
|
32850
|
-
createRenderEffect(() => _el$
|
|
32851
|
-
createRenderEffect(() => _el$
|
|
32852
|
-
return _el$
|
|
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"
|
|
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();
|
|
@@ -33729,21 +33758,9 @@ function serializeRevisionAttrs(revision) {
|
|
|
33729
33758
|
}
|
|
33730
33759
|
function serializeConditionalFlags(flags) {
|
|
33731
33760
|
if (!flags || Object.keys(flags).length === 0) return "";
|
|
33732
|
-
const
|
|
33733
|
-
[
|
|
33734
|
-
|
|
33735
|
-
["firstColumn", "firstCol"],
|
|
33736
|
-
["lastColumn", "lastCol"],
|
|
33737
|
-
["oddVBand", "band1Vert"],
|
|
33738
|
-
["evenVBand", "band2Vert"],
|
|
33739
|
-
["oddHBand", "band1Horz"],
|
|
33740
|
-
["evenHBand", "band2Horz"],
|
|
33741
|
-
["firstRowFirstColumn", "nwCell"],
|
|
33742
|
-
["firstRowLastColumn", "neCell"],
|
|
33743
|
-
["lastRowFirstColumn", "swCell"],
|
|
33744
|
-
["lastRowLastColumn", "seCell"]
|
|
33745
|
-
];
|
|
33746
|
-
const xml = attributes.filter(([, key]) => flags[key] !== void 0).map(([name, key]) => `w:${name}="${flags[key] ? "1" : "0"}"`).join(" ");
|
|
33761
|
+
const xml = TABLE_CONDITIONAL_FLAG_ATTRIBUTES.filter(
|
|
33762
|
+
([, key]) => flags[key] !== void 0
|
|
33763
|
+
).map(([name, key]) => `w:${name}="${flags[key] ? "1" : "0"}"`).join(" ");
|
|
33747
33764
|
return xml ? `<w:cnfStyle ${xml}/>` : "";
|
|
33748
33765
|
}
|
|
33749
33766
|
function serializeOnOffElement(tag, value) {
|
|
@@ -34048,15 +34065,10 @@ function serializeFloatingTableProperties(floating) {
|
|
|
34048
34065
|
function serializeTableBorders(style2) {
|
|
34049
34066
|
const borders = style2 == null ? void 0 : style2.borders;
|
|
34050
34067
|
if (!borders) return "";
|
|
34051
|
-
const
|
|
34052
|
-
|
|
34053
|
-
[
|
|
34054
|
-
|
|
34055
|
-
["right", borders.borderRight],
|
|
34056
|
-
["insideH", borders.borderInsideH],
|
|
34057
|
-
["insideV", borders.borderInsideV]
|
|
34058
|
-
];
|
|
34059
|
-
const xml = edges.filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
|
|
34068
|
+
const xml = TABLE_BORDER_EDGE_KEYS.map(([name, key]) => [
|
|
34069
|
+
name,
|
|
34070
|
+
borders[key]
|
|
34071
|
+
]).filter((entry) => !!entry[1]).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
|
|
34060
34072
|
return xml ? `<w:tblBorders>${xml}</w:tblBorders>` : "";
|
|
34061
34073
|
}
|
|
34062
34074
|
function serializeTableProperties(table) {
|
|
@@ -35529,18 +35541,11 @@ function serializeTableStyleProperties(style2) {
|
|
|
35529
35541
|
if (margins) parts.push(`<w:tblCellMar>${margins}</w:tblCellMar>`);
|
|
35530
35542
|
}
|
|
35531
35543
|
if (style2.borders) {
|
|
35532
|
-
const
|
|
35533
|
-
|
|
35534
|
-
[
|
|
35535
|
-
|
|
35536
|
-
|
|
35537
|
-
["insideH", style2.borders.borderInsideH],
|
|
35538
|
-
["insideV", style2.borders.borderInsideV]
|
|
35539
|
-
];
|
|
35540
|
-
const borders = edges.filter(
|
|
35541
|
-
(entry) => !!entry[1]
|
|
35542
|
-
).map(([name, border]) => `<w:${name} ${serializeDocxBorderAttrs(border)}`).join("");
|
|
35543
|
-
if (borders) parts.push(`<w:tblBorders>${borders}</w:tblBorders>`);
|
|
35544
|
+
const { borders } = style2;
|
|
35545
|
+
const xml = TABLE_BORDER_EDGE_KEYS.filter(([, key]) => !!borders[key]).map(
|
|
35546
|
+
([name, key]) => `<w:${name} ${serializeDocxBorderAttrs(borders[key])}`
|
|
35547
|
+
).join("");
|
|
35548
|
+
if (xml) parts.push(`<w:tblBorders>${xml}</w:tblBorders>`);
|
|
35544
35549
|
}
|
|
35545
35550
|
return parts.length > 0 ? `<w:tblPr>${parts.join("")}</w:tblPr>` : "";
|
|
35546
35551
|
}
|
|
@@ -41456,38 +41461,11 @@ function insertImageAtSelection(state, image) {
|
|
|
41456
41461
|
);
|
|
41457
41462
|
}
|
|
41458
41463
|
function resizeSelectedImage(state, width, height) {
|
|
41459
|
-
|
|
41460
|
-
|
|
41461
|
-
|
|
41462
|
-
|
|
41463
|
-
|
|
41464
|
-
const { paragraphIndex, run: targetRun } = selectedImage;
|
|
41465
|
-
const nextParagraphs = paragraphs.map((candidate, candidateIndex) => {
|
|
41466
|
-
if (candidateIndex !== paragraphIndex) {
|
|
41467
|
-
return cloneParagraph(candidate);
|
|
41468
|
-
}
|
|
41469
|
-
return {
|
|
41470
|
-
...cloneParagraph(candidate),
|
|
41471
|
-
runs: candidate.runs.map(
|
|
41472
|
-
(run) => run.id === targetRun.id && run.kind === "image" ? {
|
|
41473
|
-
...run,
|
|
41474
|
-
image: {
|
|
41475
|
-
...run.image,
|
|
41476
|
-
width: Math.max(24, Math.round(width)),
|
|
41477
|
-
height: Math.max(24, Math.round(height))
|
|
41478
|
-
}
|
|
41479
|
-
} : cloneRun(run)
|
|
41480
|
-
)
|
|
41481
|
-
};
|
|
41482
|
-
});
|
|
41483
|
-
return cloneStateWithParagraphs(
|
|
41484
|
-
state,
|
|
41485
|
-
nextParagraphs,
|
|
41486
|
-
preserveSelectionByParagraphOffsets(
|
|
41487
|
-
nextParagraphs,
|
|
41488
|
-
normalizeSelection(state)
|
|
41489
|
-
)
|
|
41490
|
-
);
|
|
41464
|
+
return patchSelectedImage(state, (image) => ({
|
|
41465
|
+
...image,
|
|
41466
|
+
width: Math.max(24, Math.round(width)),
|
|
41467
|
+
height: Math.max(24, Math.round(height))
|
|
41468
|
+
}));
|
|
41491
41469
|
}
|
|
41492
41470
|
function normalizeRotation$1(rotation) {
|
|
41493
41471
|
if (!Number.isFinite(rotation)) {
|
|
@@ -41497,38 +41475,11 @@ function normalizeRotation$1(rotation) {
|
|
|
41497
41475
|
return normalized === 0 ? void 0 : normalized;
|
|
41498
41476
|
}
|
|
41499
41477
|
function rotateSelectedImage(state, rotation) {
|
|
41500
|
-
const selectedImage = getSelectedImageRun(state);
|
|
41501
|
-
if (!selectedImage) {
|
|
41502
|
-
return state;
|
|
41503
|
-
}
|
|
41504
41478
|
const nextRotation = normalizeRotation$1(rotation);
|
|
41505
|
-
|
|
41506
|
-
|
|
41507
|
-
|
|
41508
|
-
|
|
41509
|
-
return cloneParagraph(candidate);
|
|
41510
|
-
}
|
|
41511
|
-
return {
|
|
41512
|
-
...cloneParagraph(candidate),
|
|
41513
|
-
runs: candidate.runs.map(
|
|
41514
|
-
(run) => run.id === targetRun.id && run.kind === "image" ? {
|
|
41515
|
-
...run,
|
|
41516
|
-
image: {
|
|
41517
|
-
...run.image,
|
|
41518
|
-
rotation: nextRotation
|
|
41519
|
-
}
|
|
41520
|
-
} : cloneRun(run)
|
|
41521
|
-
)
|
|
41522
|
-
};
|
|
41523
|
-
});
|
|
41524
|
-
return cloneStateWithParagraphs(
|
|
41525
|
-
state,
|
|
41526
|
-
nextParagraphs,
|
|
41527
|
-
preserveSelectionByParagraphOffsets(
|
|
41528
|
-
nextParagraphs,
|
|
41529
|
-
normalizeSelection(state)
|
|
41530
|
-
)
|
|
41531
|
-
);
|
|
41479
|
+
return patchSelectedImage(state, (image) => ({
|
|
41480
|
+
...image,
|
|
41481
|
+
rotation: nextRotation
|
|
41482
|
+
}));
|
|
41532
41483
|
}
|
|
41533
41484
|
function getSelectedImageWrapPreset(state) {
|
|
41534
41485
|
const selectedImage = getSelectedImageRun(state);
|
|
@@ -41543,7 +41494,7 @@ function isSelectedImageFixedPosition(state) {
|
|
|
41543
41494
|
const image = selectedImage && getRunImage(selectedImage.run);
|
|
41544
41495
|
return isFloatingFixedPosition(image == null ? void 0 : image.floating);
|
|
41545
41496
|
}
|
|
41546
|
-
function
|
|
41497
|
+
function patchSelectedImage(state, updater) {
|
|
41547
41498
|
const selectedImage = getSelectedImageRun(state);
|
|
41548
41499
|
if (!selectedImage || !getRunImage(selectedImage.run)) {
|
|
41549
41500
|
return state;
|
|
@@ -41556,30 +41507,25 @@ function patchSelectedImageFloating(state, next) {
|
|
|
41556
41507
|
}
|
|
41557
41508
|
return {
|
|
41558
41509
|
...cloneParagraph(candidate),
|
|
41559
|
-
runs: candidate.runs.map(
|
|
41560
|
-
|
|
41561
|
-
|
|
41562
|
-
}
|
|
41563
|
-
const floating = next(run.image.floating);
|
|
41564
|
-
const image = { ...run.image };
|
|
41565
|
-
if (floating) {
|
|
41566
|
-
image.floating = floating;
|
|
41567
|
-
} else {
|
|
41568
|
-
delete image.floating;
|
|
41569
|
-
}
|
|
41570
|
-
return { ...run, image };
|
|
41571
|
-
})
|
|
41510
|
+
runs: candidate.runs.map(
|
|
41511
|
+
(run) => run.id === targetRun.id && run.kind === "image" ? { ...run, image: updater(run.image) } : cloneRun(run)
|
|
41512
|
+
)
|
|
41572
41513
|
};
|
|
41573
41514
|
});
|
|
41574
41515
|
return cloneStateWithParagraphs(
|
|
41575
41516
|
state,
|
|
41576
41517
|
nextParagraphs,
|
|
41577
|
-
preserveSelectionByParagraphOffsets(
|
|
41578
|
-
nextParagraphs,
|
|
41579
|
-
normalizeSelection(state)
|
|
41580
|
-
)
|
|
41518
|
+
preserveSelectionByParagraphOffsets(nextParagraphs, normalizeSelection(state))
|
|
41581
41519
|
);
|
|
41582
41520
|
}
|
|
41521
|
+
function patchSelectedImageFloating(state, next) {
|
|
41522
|
+
return patchSelectedImage(state, (image) => {
|
|
41523
|
+
const floating = next(image.floating);
|
|
41524
|
+
if (floating) return { ...image, floating };
|
|
41525
|
+
const { floating: _removed, ...rest } = image;
|
|
41526
|
+
return rest;
|
|
41527
|
+
});
|
|
41528
|
+
}
|
|
41583
41529
|
function setSelectedImageWrapPreset(state, preset) {
|
|
41584
41530
|
return patchSelectedImageFloating(
|
|
41585
41531
|
state,
|
|
@@ -41629,36 +41575,10 @@ function setImageWrapPolygon(state, runId, polygon) {
|
|
|
41629
41575
|
);
|
|
41630
41576
|
}
|
|
41631
41577
|
function setSelectedImageAlt(state, alt) {
|
|
41632
|
-
|
|
41633
|
-
|
|
41634
|
-
|
|
41635
|
-
}
|
|
41636
|
-
const paragraphs = getParagraphs(state);
|
|
41637
|
-
const nextParagraphs = paragraphs.map((candidate, candidateIndex) => {
|
|
41638
|
-
if (candidateIndex !== selectedImage.paragraphIndex) {
|
|
41639
|
-
return cloneParagraph(candidate);
|
|
41640
|
-
}
|
|
41641
|
-
return {
|
|
41642
|
-
...cloneParagraph(candidate),
|
|
41643
|
-
runs: candidate.runs.map(
|
|
41644
|
-
(run) => run.id === selectedImage.run.id && run.kind === "image" ? {
|
|
41645
|
-
...run,
|
|
41646
|
-
image: {
|
|
41647
|
-
...run.image,
|
|
41648
|
-
alt: alt ?? void 0
|
|
41649
|
-
}
|
|
41650
|
-
} : cloneRun(run)
|
|
41651
|
-
)
|
|
41652
|
-
};
|
|
41653
|
-
});
|
|
41654
|
-
return cloneStateWithParagraphs(
|
|
41655
|
-
state,
|
|
41656
|
-
nextParagraphs,
|
|
41657
|
-
preserveSelectionByParagraphOffsets(
|
|
41658
|
-
nextParagraphs,
|
|
41659
|
-
normalizeSelection(state)
|
|
41660
|
-
)
|
|
41661
|
-
);
|
|
41578
|
+
return patchSelectedImage(state, (image) => ({
|
|
41579
|
+
...image,
|
|
41580
|
+
alt: alt ?? void 0
|
|
41581
|
+
}));
|
|
41662
41582
|
}
|
|
41663
41583
|
function getSelectedImageCaption(state) {
|
|
41664
41584
|
const selectedImage = getSelectedImageRun(state);
|
|
@@ -43526,6 +43446,29 @@ const applyTableAwareParagraphEdit = (current, getTargetBlocks, edit) => {
|
|
|
43526
43446
|
selection: tempResult.selection
|
|
43527
43447
|
};
|
|
43528
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
|
+
}
|
|
43529
43472
|
function createTableOpsGuards(deps) {
|
|
43530
43473
|
const canMergeSelectedTableCells = (current) => {
|
|
43531
43474
|
const range = deps.resolveHorizontalTableCellRange(current);
|
|
@@ -43877,18 +43820,7 @@ function createTableCellSpanOperations(deps) {
|
|
|
43877
43820
|
if (!nextParagraph) {
|
|
43878
43821
|
return current;
|
|
43879
43822
|
}
|
|
43880
|
-
|
|
43881
|
-
current,
|
|
43882
|
-
targetBlocks,
|
|
43883
|
-
range.zone
|
|
43884
|
-
);
|
|
43885
|
-
return {
|
|
43886
|
-
...nextState,
|
|
43887
|
-
selection: {
|
|
43888
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
43889
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
43890
|
-
}
|
|
43891
|
-
};
|
|
43823
|
+
return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
|
|
43892
43824
|
};
|
|
43893
43825
|
const mergeSelectedTableRows = (current) => {
|
|
43894
43826
|
const range = deps.resolveVerticalTableCellRange(current);
|
|
@@ -43961,18 +43893,7 @@ function createTableCellSpanOperations(deps) {
|
|
|
43961
43893
|
if (!nextParagraph) {
|
|
43962
43894
|
return current;
|
|
43963
43895
|
}
|
|
43964
|
-
|
|
43965
|
-
current,
|
|
43966
|
-
targetBlocks,
|
|
43967
|
-
range.zone
|
|
43968
|
-
);
|
|
43969
|
-
return {
|
|
43970
|
-
...nextState,
|
|
43971
|
-
selection: {
|
|
43972
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
43973
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
43974
|
-
}
|
|
43975
|
-
};
|
|
43896
|
+
return commitTableMutation(current, targetBlocks, range.zone, nextParagraph);
|
|
43976
43897
|
};
|
|
43977
43898
|
const mergeSelectedTable = (current) => {
|
|
43978
43899
|
if (deps.canMergeSelectedTableCells(current)) {
|
|
@@ -43985,19 +43906,9 @@ function createTableCellSpanOperations(deps) {
|
|
|
43985
43906
|
};
|
|
43986
43907
|
const splitSelectedTableCellVertically = (current) => {
|
|
43987
43908
|
var _a2;
|
|
43988
|
-
const
|
|
43989
|
-
|
|
43990
|
-
|
|
43991
|
-
getActiveSectionIndex(current)
|
|
43992
|
-
);
|
|
43993
|
-
if (!location) {
|
|
43994
|
-
return current;
|
|
43995
|
-
}
|
|
43996
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
43997
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
43998
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
43999
|
-
return current;
|
|
44000
|
-
}
|
|
43909
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
43910
|
+
if (!mut) return current;
|
|
43911
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44001
43912
|
const cell = (_a2 = tableBlock.rows[location.rowIndex]) == null ? void 0 : _a2.cells[location.cellIndex];
|
|
44002
43913
|
const span = Math.max(1, (cell == null ? void 0 : cell.rowSpan) ?? 1);
|
|
44003
43914
|
if (!cell || span <= 1 || cell.vMerge !== "restart") {
|
|
@@ -44050,34 +43961,13 @@ function createTableCellSpanOperations(deps) {
|
|
|
44050
43961
|
if (!nextParagraph) {
|
|
44051
43962
|
return current;
|
|
44052
43963
|
}
|
|
44053
|
-
|
|
44054
|
-
current,
|
|
44055
|
-
targetBlocks,
|
|
44056
|
-
location.zone
|
|
44057
|
-
);
|
|
44058
|
-
return {
|
|
44059
|
-
...nextState,
|
|
44060
|
-
selection: {
|
|
44061
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44062
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44063
|
-
}
|
|
44064
|
-
};
|
|
43964
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44065
43965
|
};
|
|
44066
43966
|
const splitSelectedTableCell = (current) => {
|
|
44067
43967
|
var _a2;
|
|
44068
|
-
const
|
|
44069
|
-
|
|
44070
|
-
|
|
44071
|
-
getActiveSectionIndex(current)
|
|
44072
|
-
);
|
|
44073
|
-
if (!location) {
|
|
44074
|
-
return current;
|
|
44075
|
-
}
|
|
44076
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
44077
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
44078
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
44079
|
-
return current;
|
|
44080
|
-
}
|
|
43968
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
43969
|
+
if (!mut) return current;
|
|
43970
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44081
43971
|
const row = tableBlock.rows[location.rowIndex];
|
|
44082
43972
|
const cell = row == null ? void 0 : row.cells[location.cellIndex];
|
|
44083
43973
|
const span = Math.max(1, (cell == null ? void 0 : cell.colSpan) ?? 1);
|
|
@@ -44124,18 +44014,7 @@ function createTableCellSpanOperations(deps) {
|
|
|
44124
44014
|
if (!nextParagraph) {
|
|
44125
44015
|
return current;
|
|
44126
44016
|
}
|
|
44127
|
-
|
|
44128
|
-
current,
|
|
44129
|
-
targetBlocks,
|
|
44130
|
-
location.zone
|
|
44131
|
-
);
|
|
44132
|
-
return {
|
|
44133
|
-
...nextState,
|
|
44134
|
-
selection: {
|
|
44135
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44136
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44137
|
-
}
|
|
44138
|
-
};
|
|
44017
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44139
44018
|
};
|
|
44140
44019
|
const splitSelectedTable = (current) => {
|
|
44141
44020
|
if (deps.canSplitSelectedTableCellVertically(current)) {
|
|
@@ -44158,19 +44037,9 @@ function createTableCellSpanOperations(deps) {
|
|
|
44158
44037
|
function createTableRowColumnOperations(deps) {
|
|
44159
44038
|
const insertSelectedTableRow = (current, direction) => {
|
|
44160
44039
|
var _a2, _b2;
|
|
44161
|
-
const
|
|
44162
|
-
|
|
44163
|
-
|
|
44164
|
-
getActiveSectionIndex(current)
|
|
44165
|
-
);
|
|
44166
|
-
if (!location) {
|
|
44167
|
-
return current;
|
|
44168
|
-
}
|
|
44169
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
44170
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
44171
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
44172
|
-
return current;
|
|
44173
|
-
}
|
|
44040
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
44041
|
+
if (!mut) return current;
|
|
44042
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44174
44043
|
const sourceRow = tableBlock.rows[location.rowIndex];
|
|
44175
44044
|
if (!sourceRow) {
|
|
44176
44045
|
return current;
|
|
@@ -44236,25 +44105,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44236
44105
|
const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? ((_a2 = blankRow.cells.find(
|
|
44237
44106
|
(cell) => cell.vMerge !== "continue" && cell.blocks[0]
|
|
44238
44107
|
)) == null ? void 0 : _a2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44239
|
-
|
|
44240
|
-
return updateBlocksInCurrentSection(
|
|
44241
|
-
current,
|
|
44242
|
-
targetBlocks,
|
|
44243
|
-
location.zone
|
|
44244
|
-
);
|
|
44245
|
-
}
|
|
44246
|
-
const nextState2 = updateBlocksInCurrentSection(
|
|
44247
|
-
current,
|
|
44248
|
-
targetBlocks,
|
|
44249
|
-
location.zone
|
|
44250
|
-
);
|
|
44251
|
-
return {
|
|
44252
|
-
...nextState2,
|
|
44253
|
-
selection: {
|
|
44254
|
-
anchor: paragraphOffsetToPosition(nextParagraph2, 0),
|
|
44255
|
-
focus: paragraphOffsetToPosition(nextParagraph2, 0)
|
|
44256
|
-
}
|
|
44257
|
-
};
|
|
44108
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
|
|
44258
44109
|
}
|
|
44259
44110
|
blankRow = createEditorTableRow(
|
|
44260
44111
|
sourceRow.cells.map(
|
|
@@ -44278,36 +44129,12 @@ function createTableRowColumnOperations(deps) {
|
|
|
44278
44129
|
const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? ((_b2 = blankRow.cells.find(
|
|
44279
44130
|
(cell) => cell.vMerge !== "continue" && cell.blocks[0]
|
|
44280
44131
|
)) == null ? void 0 : _b2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44281
|
-
|
|
44282
|
-
return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
|
|
44283
|
-
}
|
|
44284
|
-
const nextState = updateBlocksInCurrentSection(
|
|
44285
|
-
current,
|
|
44286
|
-
targetBlocks,
|
|
44287
|
-
location.zone
|
|
44288
|
-
);
|
|
44289
|
-
return {
|
|
44290
|
-
...nextState,
|
|
44291
|
-
selection: {
|
|
44292
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44293
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44294
|
-
}
|
|
44295
|
-
};
|
|
44132
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44296
44133
|
};
|
|
44297
44134
|
const deleteSelectedTableRow = (current) => {
|
|
44298
|
-
const
|
|
44299
|
-
|
|
44300
|
-
|
|
44301
|
-
getActiveSectionIndex(current)
|
|
44302
|
-
);
|
|
44303
|
-
if (!location) {
|
|
44304
|
-
return current;
|
|
44305
|
-
}
|
|
44306
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
44307
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
44308
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
44309
|
-
return current;
|
|
44310
|
-
}
|
|
44135
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
44136
|
+
if (!mut) return current;
|
|
44137
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44311
44138
|
if (tableBlock.rows.length <= 1 && !current.trackChangesEnabled) {
|
|
44312
44139
|
return current;
|
|
44313
44140
|
}
|
|
@@ -44323,7 +44150,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44323
44150
|
type: "delete"
|
|
44324
44151
|
}
|
|
44325
44152
|
};
|
|
44326
|
-
return
|
|
44153
|
+
return commitTableMutation(current, targetBlocks, location.zone, null);
|
|
44327
44154
|
}
|
|
44328
44155
|
const blockedByRestartCell = rowToDelete.cells.some(
|
|
44329
44156
|
(cell) => cell.vMerge !== "continue" && Math.max(1, cell.rowSpan ?? 1) > 1
|
|
@@ -44363,37 +44190,13 @@ function createTableRowColumnOperations(deps) {
|
|
|
44363
44190
|
)
|
|
44364
44191
|
) : null;
|
|
44365
44192
|
const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44366
|
-
|
|
44367
|
-
return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
|
|
44368
|
-
}
|
|
44369
|
-
const nextState = updateBlocksInCurrentSection(
|
|
44370
|
-
current,
|
|
44371
|
-
targetBlocks,
|
|
44372
|
-
location.zone
|
|
44373
|
-
);
|
|
44374
|
-
return {
|
|
44375
|
-
...nextState,
|
|
44376
|
-
selection: {
|
|
44377
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44378
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44379
|
-
}
|
|
44380
|
-
};
|
|
44193
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44381
44194
|
};
|
|
44382
44195
|
const insertSelectedTableColumn = (current, direction) => {
|
|
44383
44196
|
var _a2;
|
|
44384
|
-
const
|
|
44385
|
-
|
|
44386
|
-
|
|
44387
|
-
getActiveSectionIndex(current)
|
|
44388
|
-
);
|
|
44389
|
-
if (!location) {
|
|
44390
|
-
return current;
|
|
44391
|
-
}
|
|
44392
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
44393
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
44394
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
44395
|
-
return current;
|
|
44396
|
-
}
|
|
44197
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
44198
|
+
if (!mut) return current;
|
|
44199
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44397
44200
|
const hasHorizontalSpansInTable = tableBlock.rows.some(
|
|
44398
44201
|
(row) => row.cells.some((cell) => Math.max(1, cell.colSpan ?? 1) > 1)
|
|
44399
44202
|
);
|
|
@@ -44464,25 +44267,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44464
44267
|
const targetRow2 = tableBlock.rows[location.rowIndex];
|
|
44465
44268
|
const targetCell2 = targetRow2 ? findCellAtVisualColumn(targetRow2, insertVisualColumn) : null;
|
|
44466
44269
|
const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44467
|
-
|
|
44468
|
-
return updateBlocksInCurrentSection(
|
|
44469
|
-
current,
|
|
44470
|
-
targetBlocks,
|
|
44471
|
-
location.zone
|
|
44472
|
-
);
|
|
44473
|
-
}
|
|
44474
|
-
const nextState2 = updateBlocksInCurrentSection(
|
|
44475
|
-
current,
|
|
44476
|
-
targetBlocks,
|
|
44477
|
-
location.zone
|
|
44478
|
-
);
|
|
44479
|
-
return {
|
|
44480
|
-
...nextState2,
|
|
44481
|
-
selection: {
|
|
44482
|
-
anchor: paragraphOffsetToPosition(nextParagraph2, 0),
|
|
44483
|
-
focus: paragraphOffsetToPosition(nextParagraph2, 0)
|
|
44484
|
-
}
|
|
44485
|
-
};
|
|
44270
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
|
|
44486
44271
|
}
|
|
44487
44272
|
const insertIndex = Math.max(
|
|
44488
44273
|
0,
|
|
@@ -44506,37 +44291,13 @@ function createTableRowColumnOperations(deps) {
|
|
|
44506
44291
|
const targetRow = tableBlock.rows[location.rowIndex];
|
|
44507
44292
|
const targetCell = targetRow == null ? void 0 : targetRow.cells[insertIndex];
|
|
44508
44293
|
const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44509
|
-
|
|
44510
|
-
return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
|
|
44511
|
-
}
|
|
44512
|
-
const nextState = updateBlocksInCurrentSection(
|
|
44513
|
-
current,
|
|
44514
|
-
targetBlocks,
|
|
44515
|
-
location.zone
|
|
44516
|
-
);
|
|
44517
|
-
return {
|
|
44518
|
-
...nextState,
|
|
44519
|
-
selection: {
|
|
44520
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44521
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44522
|
-
}
|
|
44523
|
-
};
|
|
44294
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44524
44295
|
};
|
|
44525
44296
|
const deleteSelectedTableColumn = (current) => {
|
|
44526
44297
|
var _a2;
|
|
44527
|
-
const
|
|
44528
|
-
|
|
44529
|
-
|
|
44530
|
-
getActiveSectionIndex(current)
|
|
44531
|
-
);
|
|
44532
|
-
if (!location) {
|
|
44533
|
-
return current;
|
|
44534
|
-
}
|
|
44535
|
-
const targetBlocks = deps.getTargetBlocks(current, location.zone).map(cloneBlock);
|
|
44536
|
-
const tableBlock = targetBlocks[location.blockIndex];
|
|
44537
|
-
if (!tableBlock || tableBlock.type !== "table") {
|
|
44538
|
-
return current;
|
|
44539
|
-
}
|
|
44298
|
+
const mut = resolveLocationTableMutation(current, deps.getTargetBlocks);
|
|
44299
|
+
if (!mut) return current;
|
|
44300
|
+
const { tableBlock, location, targetBlocks } = mut;
|
|
44540
44301
|
if (getTableVisualWidth(tableBlock) <= 1) {
|
|
44541
44302
|
return current;
|
|
44542
44303
|
}
|
|
@@ -44558,7 +44319,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44558
44319
|
};
|
|
44559
44320
|
}
|
|
44560
44321
|
}
|
|
44561
|
-
return
|
|
44322
|
+
return commitTableMutation(current, targetBlocks, location.zone, null);
|
|
44562
44323
|
}
|
|
44563
44324
|
const hasHorizontalSpansInTable = tableBlock.rows.some(
|
|
44564
44325
|
(row) => row.cells.some((cell) => Math.max(1, cell.colSpan ?? 1) > 1)
|
|
@@ -44597,25 +44358,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44597
44358
|
)
|
|
44598
44359
|
);
|
|
44599
44360
|
const nextParagraph2 = (targetCell2 == null ? void 0 : targetCell2.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44600
|
-
|
|
44601
|
-
return updateBlocksInCurrentSection(
|
|
44602
|
-
current,
|
|
44603
|
-
targetBlocks,
|
|
44604
|
-
location.zone
|
|
44605
|
-
);
|
|
44606
|
-
}
|
|
44607
|
-
const nextState2 = updateBlocksInCurrentSection(
|
|
44608
|
-
current,
|
|
44609
|
-
targetBlocks,
|
|
44610
|
-
location.zone
|
|
44611
|
-
);
|
|
44612
|
-
return {
|
|
44613
|
-
...nextState2,
|
|
44614
|
-
selection: {
|
|
44615
|
-
anchor: paragraphOffsetToPosition(nextParagraph2, 0),
|
|
44616
|
-
focus: paragraphOffsetToPosition(nextParagraph2, 0)
|
|
44617
|
-
}
|
|
44618
|
-
};
|
|
44361
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph2);
|
|
44619
44362
|
}
|
|
44620
44363
|
if (((_a2 = tableBlock.rows[0]) == null ? void 0 : _a2.cells.length) <= 1) {
|
|
44621
44364
|
return current;
|
|
@@ -44626,21 +44369,7 @@ function createTableRowColumnOperations(deps) {
|
|
|
44626
44369
|
const targetRow = tableBlock.rows[location.rowIndex];
|
|
44627
44370
|
const targetCell = targetRow == null ? void 0 : targetRow.cells[Math.min(location.cellIndex, targetRow.cells.length - 1)];
|
|
44628
44371
|
const nextParagraph = (targetCell == null ? void 0 : targetCell.blocks[0]) ?? findFirstNavigableParagraphInTable(tableBlock);
|
|
44629
|
-
|
|
44630
|
-
return updateBlocksInCurrentSection(current, targetBlocks, location.zone);
|
|
44631
|
-
}
|
|
44632
|
-
const nextState = updateBlocksInCurrentSection(
|
|
44633
|
-
current,
|
|
44634
|
-
targetBlocks,
|
|
44635
|
-
location.zone
|
|
44636
|
-
);
|
|
44637
|
-
return {
|
|
44638
|
-
...nextState,
|
|
44639
|
-
selection: {
|
|
44640
|
-
anchor: paragraphOffsetToPosition(nextParagraph, 0),
|
|
44641
|
-
focus: paragraphOffsetToPosition(nextParagraph, 0)
|
|
44642
|
-
}
|
|
44643
|
-
};
|
|
44372
|
+
return commitTableMutation(current, targetBlocks, location.zone, nextParagraph);
|
|
44644
44373
|
};
|
|
44645
44374
|
return {
|
|
44646
44375
|
insertSelectedTableRow,
|
|
@@ -49152,6 +48881,30 @@ function createEditorCommandsController(deps) {
|
|
|
49152
48881
|
selectionCollapsed,
|
|
49153
48882
|
selectedImageRun
|
|
49154
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
|
+
};
|
|
49155
48908
|
const getSelectedParagraphRange = () => {
|
|
49156
48909
|
const normalized = normalizeSelection(state);
|
|
49157
48910
|
return getParagraphs(state).slice(
|
|
@@ -49177,12 +48930,9 @@ function createEditorCommandsController(deps) {
|
|
|
49177
48930
|
if (!selectionTouchesList()) {
|
|
49178
48931
|
return false;
|
|
49179
48932
|
}
|
|
49180
|
-
|
|
49181
|
-
resetTransactionGrouping();
|
|
49182
|
-
applySelectionAwareParagraphCommand(
|
|
48933
|
+
execParagraph(
|
|
49183
48934
|
(current) => direction === "indent" ? indentParagraphList(current) : outdentParagraphList(current)
|
|
49184
48935
|
);
|
|
49185
|
-
focusInput();
|
|
49186
48936
|
return true;
|
|
49187
48937
|
};
|
|
49188
48938
|
const handleListEnter = () => {
|
|
@@ -49255,10 +49005,7 @@ function createEditorCommandsController(deps) {
|
|
|
49255
49005
|
logger.info(
|
|
49256
49006
|
`toggleStyle:${key} at ${sel.anchor.paragraphId}:${sel.anchor.runId}[${sel.anchor.offset}..${sel.focus.offset}]${selectionTableLocation()}`
|
|
49257
49007
|
);
|
|
49258
|
-
|
|
49259
|
-
resetTransactionGrouping();
|
|
49260
|
-
applySelectionAwareTextCommand((current) => toggleTextStyle(current, key));
|
|
49261
|
-
focusInput();
|
|
49008
|
+
execText((current) => toggleTextStyle(current, key));
|
|
49262
49009
|
};
|
|
49263
49010
|
const applyValueStyleCommand = (key, value) => {
|
|
49264
49011
|
if (selectionCollapsed()) {
|
|
@@ -49268,117 +49015,64 @@ function createEditorCommandsController(deps) {
|
|
|
49268
49015
|
logger.info(
|
|
49269
49016
|
`setStyle:${key}=${JSON.stringify(value)} at ${sel.anchor.paragraphId}:${sel.anchor.runId}[${sel.anchor.offset}..${sel.focus.offset}]${selectionTableLocation()}`
|
|
49270
49017
|
);
|
|
49271
|
-
|
|
49272
|
-
resetTransactionGrouping();
|
|
49273
|
-
applySelectionAwareTextCommand(
|
|
49274
|
-
(current) => setTextStyleValue(current, key, value)
|
|
49275
|
-
);
|
|
49276
|
-
focusInput();
|
|
49018
|
+
execText((current) => setTextStyleValue(current, key, value));
|
|
49277
49019
|
};
|
|
49278
49020
|
const applyChangeTextCaseCommand = (mode) => {
|
|
49279
49021
|
if (selectionCollapsed()) {
|
|
49280
49022
|
return;
|
|
49281
49023
|
}
|
|
49282
|
-
|
|
49283
|
-
resetTransactionGrouping();
|
|
49284
|
-
applySelectionAwareTextCommand(
|
|
49285
|
-
(current) => changeSelectedTextCase(current, mode)
|
|
49286
|
-
);
|
|
49287
|
-
focusInput();
|
|
49024
|
+
execText((current) => changeSelectedTextCase(current, mode));
|
|
49288
49025
|
};
|
|
49289
49026
|
const applyClearFormattingCommand = () => {
|
|
49290
49027
|
if (selectionCollapsed()) {
|
|
49291
49028
|
return;
|
|
49292
49029
|
}
|
|
49293
|
-
|
|
49294
|
-
resetTransactionGrouping();
|
|
49295
|
-
applySelectionAwareTextCommand(
|
|
49296
|
-
(current) => clearSelectedTextFormatting(current)
|
|
49297
|
-
);
|
|
49298
|
-
focusInput();
|
|
49030
|
+
execText((current) => clearSelectedTextFormatting(current));
|
|
49299
49031
|
};
|
|
49300
49032
|
const applyParagraphStyleCommand = (key, value) => {
|
|
49301
|
-
|
|
49302
|
-
resetTransactionGrouping();
|
|
49303
|
-
applySelectionAwareParagraphCommand(
|
|
49304
|
-
(current) => setParagraphStyle(current, key, value)
|
|
49305
|
-
);
|
|
49306
|
-
focusInput();
|
|
49033
|
+
execParagraph((current) => setParagraphStyle(current, key, value));
|
|
49307
49034
|
};
|
|
49308
49035
|
const toggleParagraphFlagCommand = (key) => {
|
|
49309
49036
|
const nextValue = !toolbarStyleState()[key];
|
|
49310
49037
|
applyParagraphStyleCommand(key, nextValue ? true : null);
|
|
49311
49038
|
};
|
|
49312
49039
|
const applyParagraphListCommand = (kind) => {
|
|
49313
|
-
|
|
49314
|
-
resetTransactionGrouping();
|
|
49315
|
-
applySelectionAwareParagraphCommand(
|
|
49316
|
-
(current) => toggleParagraphList(current, kind)
|
|
49317
|
-
);
|
|
49318
|
-
focusInput();
|
|
49040
|
+
execParagraph((current) => toggleParagraphList(current, kind));
|
|
49319
49041
|
};
|
|
49320
49042
|
const handleListFormatChange = (format) => {
|
|
49321
|
-
|
|
49322
|
-
resetTransactionGrouping();
|
|
49323
|
-
applySelectionAwareParagraphCommand(
|
|
49324
|
-
(current) => setParagraphListFormat(current, format)
|
|
49325
|
-
);
|
|
49326
|
-
focusInput();
|
|
49043
|
+
execParagraph((current) => setParagraphListFormat(current, format));
|
|
49327
49044
|
};
|
|
49328
49045
|
const handleListStartAtChange = (startAt) => {
|
|
49329
|
-
|
|
49330
|
-
resetTransactionGrouping();
|
|
49331
|
-
applySelectionAwareParagraphCommand(
|
|
49332
|
-
(current) => setParagraphListStartAt(current, startAt)
|
|
49333
|
-
);
|
|
49334
|
-
focusInput();
|
|
49046
|
+
execParagraph((current) => setParagraphListStartAt(current, startAt));
|
|
49335
49047
|
};
|
|
49336
49048
|
const applyInsertSectionBreakCommand = (breakType) => {
|
|
49337
|
-
|
|
49338
|
-
resetTransactionGrouping();
|
|
49339
|
-
applyState(insertSectionBreakAtSelection(state, breakType));
|
|
49340
|
-
focusInput();
|
|
49049
|
+
execState(insertSectionBreakAtSelection(state, breakType));
|
|
49341
49050
|
};
|
|
49342
49051
|
const applyInsertPageBreakCommand = () => {
|
|
49343
|
-
|
|
49344
|
-
resetTransactionGrouping();
|
|
49345
|
-
applyTransactionalState(
|
|
49052
|
+
execTransactional(
|
|
49346
49053
|
(current) => applyTableAwareParagraphEdit2(
|
|
49347
49054
|
current,
|
|
49348
49055
|
(temp) => insertPageBreakAtSelection(temp)
|
|
49349
49056
|
)
|
|
49350
49057
|
);
|
|
49351
|
-
focusInput();
|
|
49352
49058
|
};
|
|
49353
49059
|
const canInsertFootnoteCommand = () => (state.activeZone ?? "main") === "main";
|
|
49354
49060
|
const applyInsertFootnoteCommand = () => {
|
|
49355
49061
|
if (!canInsertFootnoteCommand()) {
|
|
49356
49062
|
return;
|
|
49357
49063
|
}
|
|
49358
|
-
|
|
49359
|
-
resetTransactionGrouping();
|
|
49360
|
-
applyTransactionalState((current) => insertFootnote(current));
|
|
49361
|
-
focusInput();
|
|
49064
|
+
execTransactional((current) => insertFootnote(current));
|
|
49362
49065
|
};
|
|
49363
49066
|
const handleStyleChange = (styleId) => {
|
|
49364
|
-
|
|
49365
|
-
resetTransactionGrouping();
|
|
49366
|
-
applySelectionAwareParagraphCommand(
|
|
49067
|
+
execParagraph(
|
|
49367
49068
|
(current) => setParagraphNamedStyle(current, styleId || null)
|
|
49368
49069
|
);
|
|
49369
|
-
focusInput();
|
|
49370
49070
|
};
|
|
49371
49071
|
const applyUpdateSectionSettingsCommand = (sectionIndex, settings) => {
|
|
49372
|
-
|
|
49373
|
-
resetTransactionGrouping();
|
|
49374
|
-
applyState(updateSectionSettings(state, sectionIndex, settings));
|
|
49375
|
-
focusInput();
|
|
49072
|
+
execState(updateSectionSettings(state, sectionIndex, settings));
|
|
49376
49073
|
};
|
|
49377
49074
|
const applyToggleTrackChangesCommand = () => {
|
|
49378
|
-
|
|
49379
|
-
resetTransactionGrouping();
|
|
49380
|
-
applyState(toggleTrackChanges(state));
|
|
49381
|
-
focusInput();
|
|
49075
|
+
execState(toggleTrackChanges(state));
|
|
49382
49076
|
};
|
|
49383
49077
|
const applyToggleShowMarginsCommand = () => {
|
|
49384
49078
|
applyState({ ...state, showMargins: !state.showMargins });
|
|
@@ -49389,28 +49083,19 @@ function createEditorCommandsController(deps) {
|
|
|
49389
49083
|
focusInput();
|
|
49390
49084
|
};
|
|
49391
49085
|
const applyAcceptRevisionsCommand = () => {
|
|
49392
|
-
|
|
49393
|
-
resetTransactionGrouping();
|
|
49394
|
-
applyState(acceptRevisionsInSelection(state));
|
|
49395
|
-
focusInput();
|
|
49086
|
+
execState(acceptRevisionsInSelection(state));
|
|
49396
49087
|
};
|
|
49397
49088
|
const applyRejectRevisionsCommand = () => {
|
|
49398
|
-
|
|
49399
|
-
resetTransactionGrouping();
|
|
49400
|
-
applyState(rejectRevisionsInSelection(state));
|
|
49401
|
-
focusInput();
|
|
49089
|
+
execState(rejectRevisionsInSelection(state));
|
|
49402
49090
|
};
|
|
49403
49091
|
const applyLinkCommand = (href) => {
|
|
49404
49092
|
const activeLink = getLinkAtSelection(state);
|
|
49405
49093
|
if (selectionCollapsed() && !activeLink) {
|
|
49406
49094
|
return;
|
|
49407
49095
|
}
|
|
49408
|
-
|
|
49409
|
-
resetTransactionGrouping();
|
|
49410
|
-
applyTransactionalState((current) => setLinkAtSelection(current, href), {
|
|
49096
|
+
execTransactional((current) => setLinkAtSelection(current, href), {
|
|
49411
49097
|
mergeKey: MERGE_KEYS.link
|
|
49412
49098
|
});
|
|
49413
|
-
focusInput();
|
|
49414
49099
|
};
|
|
49415
49100
|
const promptForLink = () => {
|
|
49416
49101
|
const activeLink = getLinkAtSelection(state) ?? "";
|
|
@@ -49427,12 +49112,9 @@ function createEditorCommandsController(deps) {
|
|
|
49427
49112
|
if (!run) {
|
|
49428
49113
|
return;
|
|
49429
49114
|
}
|
|
49430
|
-
|
|
49431
|
-
resetTransactionGrouping();
|
|
49432
|
-
applyTransactionalState((current) => setSelectedImageAlt(current, alt), {
|
|
49115
|
+
execTransactional((current) => setSelectedImageAlt(current, alt), {
|
|
49433
49116
|
mergeKey: MERGE_KEYS.imageAlt
|
|
49434
49117
|
});
|
|
49435
|
-
focusInput();
|
|
49436
49118
|
};
|
|
49437
49119
|
const promptForImageAlt = () => {
|
|
49438
49120
|
var _a2;
|
|
@@ -49448,13 +49130,10 @@ function createEditorCommandsController(deps) {
|
|
|
49448
49130
|
if (!run) {
|
|
49449
49131
|
return;
|
|
49450
49132
|
}
|
|
49451
|
-
|
|
49452
|
-
resetTransactionGrouping();
|
|
49453
|
-
applyTransactionalState(
|
|
49133
|
+
execTransactional(
|
|
49454
49134
|
(current) => setSelectedImageCaption(current, caption, deps.imageCaptionLabel()),
|
|
49455
49135
|
{ mergeKey: MERGE_KEYS.imageCaption }
|
|
49456
49136
|
);
|
|
49457
|
-
focusInput();
|
|
49458
49137
|
};
|
|
49459
49138
|
const promptForImageCaption = () => {
|
|
49460
49139
|
const run = selectedImageRun();
|