oasis-editor 0.0.116 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OasisEditorApp-DY_N4M54.js → OasisEditorApp-DijR5F-O.js} +1849 -799
- package/dist/{index-DLKF27_V.js → index-Comlrue1.js} +588 -670
- package/dist/layoutProjection/constants.d.ts +7 -1
- package/dist/layoutProjection/footnotePagination.d.ts +0 -1
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +55 -55
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/components/Dialogs/TablePropertiesDialog.d.ts +2 -99
- package/dist/ui/components/Dialogs/font-dialog/FontTab.d.ts +2 -1
- package/dist/ui/components/Dialogs/table-properties/AltTextTabPanel.d.ts +3 -0
- package/dist/ui/components/Dialogs/table-properties/CellTabPanel.d.ts +3 -0
- package/dist/ui/components/Dialogs/table-properties/ColumnTabPanel.d.ts +3 -0
- package/dist/ui/components/Dialogs/table-properties/RowTabPanel.d.ts +3 -0
- package/dist/ui/components/Dialogs/table-properties/TablePropertiesController.d.ts +12 -0
- package/dist/ui/components/Dialogs/table-properties/TablePropertiesTypes.d.ts +160 -0
- package/dist/ui/components/Dialogs/table-properties/TableTabPanel.d.ts +6 -0
- package/dist/ui/components/Dialogs/table-properties/fields.d.ts +9 -0
- package/dist/ui/components/Dialogs/table-properties/useTablePropertiesController.d.ts +4 -0
- package/dist/ui/components/Toolbar/primitives/useSurfaceRect.d.ts +20 -0
- package/dist/ui/public/FieldRow.d.ts +13 -0
- package/dist/ui/public/NumberField.d.ts +13 -0
- package/dist/ui/public/Radio.d.ts +38 -0
- package/dist/ui/public/ToggleChip.d.ts +14 -0
- package/dist/ui/public/index.d.ts +8 -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 { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as
|
|
4
|
+
import { E as EMPTY_PROJECTION_CONTEXT, d as domTextMeasurer, g as getProjectedParagraphBlockHeight, e as estimateTableBlockHeight, p as projectParagraphLayout, a as getPageBodyBottom, b as getPageBodyTop, c as getPageContentWidth, F as FOOTNOTE_MARKER_GUTTER_PX, f as getParagraphText, h as getBlockParagraphs, i as getRunFootnoteReference, l as listReferencedEndnotes, j as getFootnoteDisplayMarker, k as createProjectionContext, m as getDocumentSections, n as getRunField, o as projectBlocksLayout, u as useContext, s as splitProps, q as spread, r as mergeProps, t as memo, v as insert, w as createComponent, x as createRenderEffect, y as setAttribute, S as Show, z as className, A as For, B as createContext, C as template, D as createUniqueId, G as style, H as visitRun, I as assertNever, J as createSignal, K as createEditorStateFromDocument, L as createInitialEditorState, M as STANDARD_FONT_SIZES_PT, N as fontSizePxToPt, O as probeLocalFontFamilies, P as createEditorParagraphFromRuns, Q as isInlineObjectRun, R as createEditorStyledRun, T as getParagraphLength, U as getActiveZone, V as getActiveSectionIndex, W as getParagraphs, X as normalizeSelection, Y as positionToParagraphOffset, Z as paragraphOffsetToPosition, _ as clampPosition, $ as findParagraphIndex, a0 as createCollapsedSelection, a1 as isSelectionCollapsed, a2 as parseFontSizePtToPx, a3 as formatFontSizePt, a4 as createEditorParagraph, a5 as findParagraphTableLocation, a6 as buildTableCellLayout, a7 as PT_PER_PX, a8 as createEditorTableCell, a9 as createEditorTableRow, aa as createEditorTable, ab as PX_PER_POINT, ac as underlineStyleToCssDecorationStyle, ad as resolveImageSrc, ae as listKindForTag, af as isParagraphTag, ag as collectInlineRuns, ah as parseParagraphStyle, ai as getRunImage, aj as InlineShell, ak as BalloonShell, al as DocumentShell, am as createMemo, an as getCaretRectFromSnapshot, ao as getParagraphRectFromSnapshot, ap as CaretOverlay, aq as setStyleProperty, ar as Button, as as useI18n, at as createEffect, au as TextField, av as Dialog, aw as SelectField, ax as UNDERLINE_STYLE_OPTIONS, ay as delegateEvents, az as Checkbox, aA as Tabs, aB as FieldRow, aC as NumberField, aD as createStore, aE as reconcile, aF as addEventListener, aG as onMount, aH as onCleanup, aI as use, aJ as PluginUiHost, aK as OasisEditorEditor, aL as OasisBrandMark, aM as setPreciseFontPreference, aN as setWelcomeSeen, aO as enablePreciseFontMode, aP as TWIPS_PER_POINT, aQ as PX_PER_INCH, aR as TWIPS_PER_INCH, aS as normalizeHex6, aT as TABLE_CONDITIONAL_FLAG_ATTRIBUTES, aU as TABLE_BORDER_EDGE_KEYS, aV as resolveEffectiveParagraphStyle, aW as resolveEffectiveTextStyleForParagraph, aX as EMU_PER_PT, aY as OOXML_ROTATION_UNITS, aZ as OOXML_PERCENT_DENOMINATOR, a_ as parseHexColorToRgb255, a$ as EMU_PER_PX, b0 as getRunEndnoteReference, b1 as iterateFootnoteReferenceRuns, b2 as iterateEndnoteReferenceRuns, b3 as imageContentTypeDefaults, b4 as getRunFieldChar, b5 as getRunFieldInstruction, b6 as createEditorRun, b7 as JSZip, b8 as imageExtensionFromMime, b9 as pxToPt$1, ba as resolveFloatingObjectRect, bb as getTextBoxFloatingGeometry, bc as getPresetPathSegments, bd as buildListLabels, be as DEFAULT_FONT_SIZE_PX, bf as resolveGradientAxis, bg as isDoubleUnderlineStyle, bh as isWavyUnderlineStyle, bi as underlineStyleLineWidthPx, bj as WAVY_UNDERLINE_WAVELENGTH_PX, bk as WAVY_UNDERLINE_AMPLITUDE_PX, bl as DOUBLE_UNDERLINE_OFFSET_PX, bm as underlineStyleDashArray, bn as EMPHASIS_GLYPH, bo as rgb255ToHex, bp as getImageFloatingGeometry, bq as textStyleToFontSizePt, br as TEXT_BASELINE_RATIO, bs as resolveOpenTypeFeatureTags, bt as resolveDecorationLineY, bu as DOUBLE_STRIKE_OFFSET_PX, bv as resolveListLabel, bw as getListLabelInset, bx as getAlignedListLabelInset, by as getParagraphBorderInsets, bz as buildSegmentTable, bA as buildCanvasTableLayout, bB as resolveCanvasTableWidth, bC as resolveFloatingTableRect, bD as normalizeFamily, bE as ROBOTO_FONT_FILES, bF as loadFontAsset, bG as OFFICE_COMPAT_FONT_FAMILIES, bH as BinaryReader, bI as buildSfnt, bJ as defaultFontDecoderRegistry, bK as SfntFontProgram, bL as collectPdfFontFamilies, bM as outlineFrom, bN as getPageHeaderZoneTop, bO as getPageColumnRects, bP as findFootnoteReference, bQ as resolveImporterForFile, bR as roundTo, bS as getDocumentSectionsCanonical, bT as getDocumentParagraphsCanonical, bU as getDocumentParagraphs, bV as getDocumentPageSettings, bW as getTableCellContentWidthForParagraph, bX as layoutMetricsEpoch, bY as bumpLayoutMetricsEpoch, bZ as createCanvasLayoutSnapshotProvider, b_ as on, b$ as debounce, c0 as unwrap, c1 as perfTimer, c2 as getRunTextBox, c3 as createEditorDocument, c4 as resolveResizedDimensions, c5 as resolveTextBoxRenderHeight, c6 as getToolbarStyleState, c7 as VERTICAL_HIT_WEIGHT, c8 as getCachedCanvasImage, c9 as measureParagraphMinContentWidthPx, ca as getEditableBlocksForZone, cb as findParagraphLocation, cc as createSectionBoundaryParagraph, cd as normalizePageSettings, ce as DEFAULT_EDITOR_PAGE_SETTINGS, cf as markStart, cg as markEnd, ch as getParagraphEntries, ci as getParagraphById, cj as createEditorFootnote, ck as createFootnoteReferenceRun, cl as renumberFootnotes, cm as getHeadingLevel, cn as preciseFontModeVersion, co as isPreciseFontModeEnabled, cp as resolveNamedTextStyle, cq as togglePreciseFontMode, cr as nextFontSizePt, cs as previousFontSizePt, ct as fontSizePtToPx, cu as createDefaultToolbarPreset, cv as MenuRegistry, cw as createToolbarRegistry, cx as Editor, cy as resolveCommandRef, cz as commandRefName, cA as createOasisEditorClient, cB as createEditorZoom, cC as startLongTaskObserver, cD as installGlobalReport, cE as applyStoredPreciseFontPreference, cF as getWelcomeSeen, cG as isLocalFontAccessSupported, cH as EDITOR_SCROLL_PADDING_PX, cI as Toolbar, cJ as OasisEditorLoading, cK as I18nProvider, cL as createTranslator, cM as createEditorLogger, cN as registerDomStatsSurface } from "./index-Comlrue1.js";
|
|
5
5
|
function projectHeaderFooterBlocksWithDependencies(blocks, deps, context = {}) {
|
|
6
6
|
const {
|
|
7
7
|
pageIndex,
|
|
@@ -77,6 +77,148 @@ function projectHeaderFooterBlocks(blocks, context = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
+
const FOOTNOTE_SEPARATOR_HEIGHT = 10;
|
|
81
|
+
const FOOTNOTE_BLOCK_GAP = 2;
|
|
82
|
+
const MAX_FOOTNOTE_LAYOUT_ITERATIONS = 4;
|
|
83
|
+
function getProjectedBlocksHeight$1(blocks) {
|
|
84
|
+
if (!blocks || blocks.length === 0) {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
return blocks.reduce((sum, block) => sum + block.estimatedHeight, 0);
|
|
88
|
+
}
|
|
89
|
+
function collectFootnoteReferencesFromBlock(block) {
|
|
90
|
+
var _a2, _b2;
|
|
91
|
+
const result = [];
|
|
92
|
+
const appendFromParagraph = (paragraph, startOffset, endOffset) => {
|
|
93
|
+
let runStart = 0;
|
|
94
|
+
for (const run of paragraph.runs) {
|
|
95
|
+
const runEnd = runStart + run.text.length;
|
|
96
|
+
const footnoteReference = getRunFootnoteReference(run);
|
|
97
|
+
if (footnoteReference && runEnd > startOffset && runStart < endOffset) {
|
|
98
|
+
result.push(footnoteReference.footnoteId);
|
|
99
|
+
}
|
|
100
|
+
runStart = runEnd;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
if (block.sourceBlock.type === "paragraph") {
|
|
104
|
+
appendFromParagraph(
|
|
105
|
+
block.sourceBlock,
|
|
106
|
+
((_a2 = block.layout) == null ? void 0 : _a2.startOffset) ?? 0,
|
|
107
|
+
((_b2 = block.layout) == null ? void 0 : _b2.endOffset) ?? getParagraphText(block.sourceBlock).length
|
|
108
|
+
);
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
for (const paragraph of getBlockParagraphs(block.sourceBlock)) {
|
|
112
|
+
appendFromParagraph(paragraph, 0, getParagraphText(paragraph).length);
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
function collectPageFootnoteReferenceIds(page) {
|
|
117
|
+
const seen = /* @__PURE__ */ new Set();
|
|
118
|
+
const ids = [];
|
|
119
|
+
for (const block of page.blocks) {
|
|
120
|
+
for (const footnoteId of collectFootnoteReferencesFromBlock(block)) {
|
|
121
|
+
if (seen.has(footnoteId)) continue;
|
|
122
|
+
seen.add(footnoteId);
|
|
123
|
+
ids.push(footnoteId);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return ids;
|
|
127
|
+
}
|
|
128
|
+
function projectFootnoteBlocksForPage(document2, footnoteReferenceIds, page, totalPages, measuredHeights, measuredParagraphLayouts, measurer, projectBlocks) {
|
|
129
|
+
var _a2, _b2, _c;
|
|
130
|
+
const contentWidth = Math.max(
|
|
131
|
+
24,
|
|
132
|
+
getPageContentWidth(page.pageSettings) - FOOTNOTE_MARKER_GUTTER_PX
|
|
133
|
+
);
|
|
134
|
+
const blocks = [];
|
|
135
|
+
for (const footnoteId of footnoteReferenceIds) {
|
|
136
|
+
const footnote = (_b2 = (_a2 = document2.footnotes) == null ? void 0 : _a2.items) == null ? void 0 : _b2[footnoteId];
|
|
137
|
+
if (!footnote) continue;
|
|
138
|
+
const projected = projectBlocks(footnote.blocks, {
|
|
139
|
+
pageIndex: page.index,
|
|
140
|
+
totalPages,
|
|
141
|
+
measuredHeights,
|
|
142
|
+
measuredParagraphLayouts,
|
|
143
|
+
styles: document2.styles,
|
|
144
|
+
contentWidth,
|
|
145
|
+
measurer,
|
|
146
|
+
defaultTabStop: (_c = document2.settings) == null ? void 0 : _c.defaultTabStop
|
|
147
|
+
});
|
|
148
|
+
for (const block of projected) {
|
|
149
|
+
blocks.push({
|
|
150
|
+
...block,
|
|
151
|
+
blockId: `${footnoteId}:${block.blockId}`
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return blocks;
|
|
156
|
+
}
|
|
157
|
+
function buildFootnoteReservations(pages, context) {
|
|
158
|
+
const reservations = /* @__PURE__ */ new Map();
|
|
159
|
+
for (const page of pages) {
|
|
160
|
+
const footnoteReferenceIds = collectPageFootnoteReferenceIds(page);
|
|
161
|
+
if (footnoteReferenceIds.length === 0) continue;
|
|
162
|
+
const footnoteBlocks = projectFootnoteBlocksForPage(
|
|
163
|
+
context.document,
|
|
164
|
+
footnoteReferenceIds,
|
|
165
|
+
page,
|
|
166
|
+
context.totalPages,
|
|
167
|
+
context.measuredHeights,
|
|
168
|
+
context.measuredParagraphLayouts,
|
|
169
|
+
context.measurer,
|
|
170
|
+
context.projectBlocks
|
|
171
|
+
);
|
|
172
|
+
if (footnoteBlocks.length === 0) continue;
|
|
173
|
+
const blockGaps = Math.max(0, footnoteBlocks.length - 1) * FOOTNOTE_BLOCK_GAP;
|
|
174
|
+
reservations.set(
|
|
175
|
+
page.index,
|
|
176
|
+
FOOTNOTE_SEPARATOR_HEIGHT + getProjectedBlocksHeight$1(footnoteBlocks) + blockGaps
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return reservations;
|
|
180
|
+
}
|
|
181
|
+
function reservationSignature(reservations) {
|
|
182
|
+
return [...reservations.entries()].sort(([left], [right]) => left - right).map(([pageIndex, height]) => `${pageIndex}:${Math.round(height)}`).join("|");
|
|
183
|
+
}
|
|
184
|
+
function applyFootnotesToPages(pages, context) {
|
|
185
|
+
return pages.map((page) => {
|
|
186
|
+
const footnoteReferenceIds = collectPageFootnoteReferenceIds(page);
|
|
187
|
+
if (footnoteReferenceIds.length === 0) {
|
|
188
|
+
return {
|
|
189
|
+
...page,
|
|
190
|
+
footnoteBlocks: void 0,
|
|
191
|
+
footnoteReferenceIds: void 0,
|
|
192
|
+
footnoteTop: void 0,
|
|
193
|
+
footnoteSeparatorTop: void 0
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const footnoteBlocks = projectFootnoteBlocksForPage(
|
|
197
|
+
context.document,
|
|
198
|
+
footnoteReferenceIds,
|
|
199
|
+
page,
|
|
200
|
+
context.totalPages,
|
|
201
|
+
context.measuredHeights,
|
|
202
|
+
context.measuredParagraphLayouts,
|
|
203
|
+
context.measurer,
|
|
204
|
+
context.projectBlocks
|
|
205
|
+
);
|
|
206
|
+
const bodyBottom = page.bodyBottom ?? getPageBodyBottom(page.pageSettings);
|
|
207
|
+
const footnoteSeparatorTop = Math.max(
|
|
208
|
+
page.bodyTop ?? getPageBodyTop(page.pageSettings),
|
|
209
|
+
bodyBottom
|
|
210
|
+
);
|
|
211
|
+
const footnoteTop = footnoteSeparatorTop + FOOTNOTE_SEPARATOR_HEIGHT;
|
|
212
|
+
return {
|
|
213
|
+
...page,
|
|
214
|
+
footnoteBlocks,
|
|
215
|
+
footnoteReferenceIds,
|
|
216
|
+
footnoteSeparatorTop,
|
|
217
|
+
footnoteTop,
|
|
218
|
+
bodyBottom
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
}
|
|
80
222
|
function getProjectedBlocksHeight(blocks) {
|
|
81
223
|
if (!blocks || blocks.length === 0) {
|
|
82
224
|
return 0;
|
|
@@ -464,6 +606,163 @@ function projectDocumentLayout(document2, maxPageHeightOverride, measuredHeights
|
|
|
464
606
|
pages: applyFootnotesToPages(pages, footnoteContext)
|
|
465
607
|
};
|
|
466
608
|
}
|
|
609
|
+
var _tmpl$$g = /* @__PURE__ */ template(`<span class=oasis-editor-ui-field-description>`), _tmpl$2$4 = /* @__PURE__ */ template(`<label><input type=radio class=oasis-editor-ui-radio-input><span class=oasis-editor-ui-checkbox-copy><span class=oasis-editor-ui-field-label>`), _tmpl$3$3 = /* @__PURE__ */ template(`<span class=oasis-editor-ui-field-label>`), _tmpl$4$1 = /* @__PURE__ */ template(`<div role=radiogroup>`);
|
|
610
|
+
const RadioGroupCtx = createContext();
|
|
611
|
+
function Radio$1(props) {
|
|
612
|
+
const fallbackId = createUniqueId();
|
|
613
|
+
const group = useContext(RadioGroupCtx);
|
|
614
|
+
const [local, others] = splitProps(props, ["label", "description", "value", "onChange", "class", "id", "checked", "name", "disabled"]);
|
|
615
|
+
const id = () => local.id ?? fallbackId;
|
|
616
|
+
const descriptionId = () => `${id()}-description`;
|
|
617
|
+
const checked = () => group ? group.value() === local.value : Boolean(local.checked);
|
|
618
|
+
const disabled = () => Boolean(local.disabled) || (group ? group.disabled() : false);
|
|
619
|
+
return (() => {
|
|
620
|
+
var _el$ = _tmpl$2$4(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
|
|
621
|
+
_el$2.addEventListener("change", (event) => {
|
|
622
|
+
var _a2;
|
|
623
|
+
if (group) group.onSelect(local.value);
|
|
624
|
+
(_a2 = local.onChange) == null ? void 0 : _a2.call(local, event.currentTarget.checked);
|
|
625
|
+
});
|
|
626
|
+
spread(_el$2, mergeProps({
|
|
627
|
+
get id() {
|
|
628
|
+
return id();
|
|
629
|
+
},
|
|
630
|
+
get name() {
|
|
631
|
+
return local.name ?? (group == null ? void 0 : group.name);
|
|
632
|
+
},
|
|
633
|
+
get value() {
|
|
634
|
+
return local.value;
|
|
635
|
+
},
|
|
636
|
+
get checked() {
|
|
637
|
+
return checked();
|
|
638
|
+
},
|
|
639
|
+
get disabled() {
|
|
640
|
+
return disabled();
|
|
641
|
+
},
|
|
642
|
+
get ["aria-describedby"]() {
|
|
643
|
+
return memo(() => !!local.description)() ? descriptionId() : void 0;
|
|
644
|
+
}
|
|
645
|
+
}, others), false, false);
|
|
646
|
+
insert(_el$4, () => local.label);
|
|
647
|
+
insert(_el$3, createComponent(Show, {
|
|
648
|
+
get when() {
|
|
649
|
+
return local.description;
|
|
650
|
+
},
|
|
651
|
+
get children() {
|
|
652
|
+
var _el$5 = _tmpl$$g();
|
|
653
|
+
insert(_el$5, () => local.description);
|
|
654
|
+
createRenderEffect(() => setAttribute(_el$5, "id", descriptionId()));
|
|
655
|
+
return _el$5;
|
|
656
|
+
}
|
|
657
|
+
}), null);
|
|
658
|
+
createRenderEffect((_p$) => {
|
|
659
|
+
var _v$ = `oasis-editor-ui-radio ${local.class ?? ""}`, _v$2 = id();
|
|
660
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
661
|
+
_v$2 !== _p$.t && setAttribute(_el$, "for", _p$.t = _v$2);
|
|
662
|
+
return _p$;
|
|
663
|
+
}, {
|
|
664
|
+
e: void 0,
|
|
665
|
+
t: void 0
|
|
666
|
+
});
|
|
667
|
+
return _el$;
|
|
668
|
+
})();
|
|
669
|
+
}
|
|
670
|
+
function RadioGroup(props) {
|
|
671
|
+
const fallbackName = createUniqueId();
|
|
672
|
+
const ctx = {
|
|
673
|
+
name: props.name ?? fallbackName,
|
|
674
|
+
value: () => props.value,
|
|
675
|
+
onSelect: (value) => {
|
|
676
|
+
var _a2;
|
|
677
|
+
return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, value);
|
|
678
|
+
},
|
|
679
|
+
disabled: () => Boolean(props.disabled)
|
|
680
|
+
};
|
|
681
|
+
return createComponent(RadioGroupCtx.Provider, {
|
|
682
|
+
value: ctx,
|
|
683
|
+
get children() {
|
|
684
|
+
var _el$6 = _tmpl$4$1();
|
|
685
|
+
insert(_el$6, createComponent(Show, {
|
|
686
|
+
get when() {
|
|
687
|
+
return props.label;
|
|
688
|
+
},
|
|
689
|
+
get children() {
|
|
690
|
+
var _el$7 = _tmpl$3$3();
|
|
691
|
+
insert(_el$7, () => props.label);
|
|
692
|
+
return _el$7;
|
|
693
|
+
}
|
|
694
|
+
}), null);
|
|
695
|
+
insert(_el$6, createComponent(Show, {
|
|
696
|
+
get when() {
|
|
697
|
+
return props.options;
|
|
698
|
+
},
|
|
699
|
+
get fallback() {
|
|
700
|
+
return props.children;
|
|
701
|
+
},
|
|
702
|
+
get children() {
|
|
703
|
+
return createComponent(For, {
|
|
704
|
+
get each() {
|
|
705
|
+
return props.options;
|
|
706
|
+
},
|
|
707
|
+
children: (option) => createComponent(Radio$1, {
|
|
708
|
+
get value() {
|
|
709
|
+
return option.value;
|
|
710
|
+
},
|
|
711
|
+
get label() {
|
|
712
|
+
return option.label;
|
|
713
|
+
},
|
|
714
|
+
get description() {
|
|
715
|
+
return option.description;
|
|
716
|
+
},
|
|
717
|
+
get disabled() {
|
|
718
|
+
return option.disabled;
|
|
719
|
+
}
|
|
720
|
+
})
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
}), null);
|
|
724
|
+
createRenderEffect((_p$) => {
|
|
725
|
+
var _v$3 = `oasis-editor-ui-radio-group ${props.class ?? ""}`, _v$4 = props.label;
|
|
726
|
+
_v$3 !== _p$.e && className(_el$6, _p$.e = _v$3);
|
|
727
|
+
_v$4 !== _p$.t && setAttribute(_el$6, "aria-label", _p$.t = _v$4);
|
|
728
|
+
return _p$;
|
|
729
|
+
}, {
|
|
730
|
+
e: void 0,
|
|
731
|
+
t: void 0
|
|
732
|
+
});
|
|
733
|
+
return _el$6;
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
var _tmpl$$f = /* @__PURE__ */ template(`<label><input type=checkbox class=oasis-editor-ui-toggle-chip-input><span class=oasis-editor-ui-toggle-chip-label>`);
|
|
738
|
+
function ToggleChip(props) {
|
|
739
|
+
const [local, others] = splitProps(props, ["label", "labelStyle", "onChange", "class", "checked"]);
|
|
740
|
+
return (() => {
|
|
741
|
+
var _el$ = _tmpl$$f(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
742
|
+
_el$2.addEventListener("change", (event) => {
|
|
743
|
+
var _a2;
|
|
744
|
+
return (_a2 = local.onChange) == null ? void 0 : _a2.call(local, event.currentTarget.checked);
|
|
745
|
+
});
|
|
746
|
+
spread(_el$2, mergeProps({
|
|
747
|
+
get checked() {
|
|
748
|
+
return local.checked;
|
|
749
|
+
}
|
|
750
|
+
}, others), false, false);
|
|
751
|
+
insert(_el$3, () => local.label);
|
|
752
|
+
createRenderEffect((_p$) => {
|
|
753
|
+
var _v$ = `oasis-editor-ui-toggle-chip ${local.class ?? ""}`, _v$2 = !!Boolean(local.checked), _v$3 = local.labelStyle;
|
|
754
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
755
|
+
_v$2 !== _p$.t && _el$.classList.toggle("is-active", _p$.t = _v$2);
|
|
756
|
+
_p$.a = style(_el$3, _v$3, _p$.a);
|
|
757
|
+
return _p$;
|
|
758
|
+
}, {
|
|
759
|
+
e: void 0,
|
|
760
|
+
t: void 0,
|
|
761
|
+
a: void 0
|
|
762
|
+
});
|
|
763
|
+
return _el$;
|
|
764
|
+
})();
|
|
765
|
+
}
|
|
467
766
|
function cloneStyle(style2) {
|
|
468
767
|
return style2 ? { ...style2 } : void 0;
|
|
469
768
|
}
|
|
@@ -31149,14 +31448,14 @@ function DropCaret(props) {
|
|
|
31149
31448
|
})
|
|
31150
31449
|
});
|
|
31151
31450
|
}
|
|
31152
|
-
var _tmpl$$
|
|
31451
|
+
var _tmpl$$e = /* @__PURE__ */ template(`<div class=oasis-editor-table-resize-guide>`), _tmpl$2$3 = /* @__PURE__ */ template(`<img class=oasis-editor-image-ghost>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=oasis-editor-table-ghost>`);
|
|
31153
31452
|
function EditorDragLayers(props) {
|
|
31154
31453
|
return [createComponent(Show, {
|
|
31155
31454
|
get when() {
|
|
31156
31455
|
return props.tableResize.resizing();
|
|
31157
31456
|
},
|
|
31158
31457
|
children: (resizing) => (() => {
|
|
31159
|
-
var _el$ = _tmpl$$
|
|
31458
|
+
var _el$ = _tmpl$$e();
|
|
31160
31459
|
createRenderEffect((_p$) => {
|
|
31161
31460
|
var _v$ = !!(resizing().type === "column"), _v$2 = !!(resizing().type === "row"), _v$3 = {
|
|
31162
31461
|
...resizing().type === "column" ? {
|
|
@@ -31187,7 +31486,7 @@ function EditorDragLayers(props) {
|
|
|
31187
31486
|
return memo(() => !!props.imageOps.dragging())() && props.imageOps.draggedImageInfo();
|
|
31188
31487
|
},
|
|
31189
31488
|
children: (info) => (() => {
|
|
31190
|
-
var _el$2 = _tmpl$2$
|
|
31489
|
+
var _el$2 = _tmpl$2$3();
|
|
31191
31490
|
createRenderEffect((_p$) => {
|
|
31192
31491
|
var _v$4 = info().src, _v$5 = `${info().width}px`, _v$6 = `${info().height}px`, _v$7 = `${props.imageOps.mousePos().x - info().offsetX}px`, _v$8 = `${props.imageOps.mousePos().y - info().offsetY}px`;
|
|
31193
31492
|
_v$4 !== _p$.e && setAttribute(_el$2, "src", _p$.e = _v$4);
|
|
@@ -31210,7 +31509,7 @@ function EditorDragLayers(props) {
|
|
|
31210
31509
|
return memo(() => !!props.tableDrag.dragging())() && props.tableDrag.draggedTableInfo();
|
|
31211
31510
|
},
|
|
31212
31511
|
children: (info) => (() => {
|
|
31213
|
-
var _el$3 = _tmpl$3$
|
|
31512
|
+
var _el$3 = _tmpl$3$2();
|
|
31214
31513
|
createRenderEffect((_p$) => {
|
|
31215
31514
|
var _v$9 = `${info().width}px`, _v$0 = `${info().height}px`, _v$1 = `${props.tableDrag.mousePos().x - info().offsetX}px`, _v$10 = `${props.tableDrag.mousePos().y - info().offsetY}px`;
|
|
31216
31515
|
_v$9 !== _p$.e && setStyleProperty(_el$3, "width", _p$.e = _v$9);
|
|
@@ -31300,24 +31599,31 @@ function EditorDragLayers(props) {
|
|
|
31300
31599
|
})
|
|
31301
31600
|
})];
|
|
31302
31601
|
}
|
|
31303
|
-
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">`);
|
|
31304
31602
|
function DialogFooter(props) {
|
|
31305
|
-
return [(
|
|
31306
|
-
|
|
31307
|
-
|
|
31308
|
-
|
|
31309
|
-
|
|
31310
|
-
|
|
31311
|
-
|
|
31312
|
-
|
|
31313
|
-
|
|
31314
|
-
|
|
31315
|
-
|
|
31316
|
-
|
|
31317
|
-
|
|
31318
|
-
|
|
31319
|
-
|
|
31320
|
-
|
|
31603
|
+
return [createComponent(Button, {
|
|
31604
|
+
variant: "secondary",
|
|
31605
|
+
get onClick() {
|
|
31606
|
+
return props.onCancel;
|
|
31607
|
+
},
|
|
31608
|
+
get ["data-testid"]() {
|
|
31609
|
+
return props.cancelTestId;
|
|
31610
|
+
},
|
|
31611
|
+
get children() {
|
|
31612
|
+
return props.cancelLabel;
|
|
31613
|
+
}
|
|
31614
|
+
}), createComponent(Button, {
|
|
31615
|
+
variant: "primary",
|
|
31616
|
+
get onClick() {
|
|
31617
|
+
return props.onConfirm;
|
|
31618
|
+
},
|
|
31619
|
+
get ["data-testid"]() {
|
|
31620
|
+
return props.confirmTestId;
|
|
31621
|
+
},
|
|
31622
|
+
get children() {
|
|
31623
|
+
return props.confirmLabel;
|
|
31624
|
+
}
|
|
31625
|
+
})];
|
|
31626
|
+
}
|
|
31321
31627
|
function TextInputDialog(props) {
|
|
31322
31628
|
const t = useI18n();
|
|
31323
31629
|
const [value, setValue] = createSignal(props.initialValue);
|
|
@@ -31365,28 +31671,30 @@ function TextInputDialog(props) {
|
|
|
31365
31671
|
});
|
|
31366
31672
|
},
|
|
31367
31673
|
get children() {
|
|
31368
|
-
|
|
31369
|
-
|
|
31370
|
-
|
|
31371
|
-
|
|
31372
|
-
|
|
31373
|
-
|
|
31374
|
-
|
|
31375
|
-
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
|
|
31379
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
|
|
31674
|
+
return createComponent(TextField, {
|
|
31675
|
+
ref(r$) {
|
|
31676
|
+
var _ref$ = inputRef;
|
|
31677
|
+
typeof _ref$ === "function" ? _ref$(r$) : inputRef = r$;
|
|
31678
|
+
},
|
|
31679
|
+
get label() {
|
|
31680
|
+
return props.label;
|
|
31681
|
+
},
|
|
31682
|
+
get value() {
|
|
31683
|
+
return value();
|
|
31684
|
+
},
|
|
31685
|
+
onChange: setValue,
|
|
31686
|
+
onKeyDown: (e) => e.key === "Enter" && handleConfirm(),
|
|
31687
|
+
get placeholder() {
|
|
31688
|
+
return props.placeholder;
|
|
31689
|
+
},
|
|
31690
|
+
get ["data-testid"]() {
|
|
31691
|
+
var _a2;
|
|
31692
|
+
return (_a2 = props.testIds) == null ? void 0 : _a2.input;
|
|
31693
|
+
}
|
|
31383
31694
|
});
|
|
31384
|
-
createRenderEffect(() => _el$3.value = value());
|
|
31385
|
-
return _el$;
|
|
31386
31695
|
}
|
|
31387
31696
|
});
|
|
31388
31697
|
}
|
|
31389
|
-
delegateEvents(["input", "keydown"]);
|
|
31390
31698
|
function LinkDialog(props) {
|
|
31391
31699
|
const t = useI18n();
|
|
31392
31700
|
return createComponent(TextInputDialog, {
|
|
@@ -31797,11 +32105,11 @@ function useFontDialogController(props) {
|
|
|
31797
32105
|
handleApply
|
|
31798
32106
|
};
|
|
31799
32107
|
}
|
|
31800
|
-
var _tmpl$$
|
|
32108
|
+
var _tmpl$$d = /* @__PURE__ */ template(`<div>`);
|
|
31801
32109
|
function FontPreview(props) {
|
|
31802
32110
|
const t = useI18n();
|
|
31803
32111
|
return (() => {
|
|
31804
|
-
var _el$ = _tmpl$$
|
|
32112
|
+
var _el$ = _tmpl$$d();
|
|
31805
32113
|
insert(_el$, () => t("dialog.font.previewText"));
|
|
31806
32114
|
createRenderEffect((_p$) => {
|
|
31807
32115
|
var _v$ = props.class ?? "oasis-editor-dialog-preview", _v$2 = props.testId, _v$3 = props.style;
|
|
@@ -31817,133 +32125,253 @@ function FontPreview(props) {
|
|
|
31817
32125
|
return _el$;
|
|
31818
32126
|
})();
|
|
31819
32127
|
}
|
|
31820
|
-
var _tmpl$$
|
|
32128
|
+
var _tmpl$$c = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-font-panel"><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-custom-size-group"><span class=oasis-editor-dialog-help-text></span></div></div><div class="oasis-editor-dialog-row oasis-editor-font-dialog-color-row"><div class="oasis-editor-dialog-input-group oasis-editor-font-dialog-color-mode-group"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-font-dialog-color-mode><option value=automatic></option><option value=custom></option></select><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-highlight></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-shading></div></div><div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-color data-testid=editor-font-dialog-underline-color></div></div><div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row></div></div></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label>`);
|
|
31821
32129
|
function FontTab(props) {
|
|
31822
32130
|
const t = useI18n();
|
|
31823
32131
|
const {
|
|
31824
32132
|
ctrl
|
|
31825
32133
|
} = props;
|
|
32134
|
+
const effectToggles = () => [{
|
|
32135
|
+
testId: "editor-font-dialog-bold",
|
|
32136
|
+
label: t("dialog.font.bold"),
|
|
32137
|
+
labelStyle: {
|
|
32138
|
+
"font-weight": 700
|
|
32139
|
+
},
|
|
32140
|
+
checked: () => ctrl.fontTabValues().bold,
|
|
32141
|
+
onChange: (checked) => ctrl.updateFontTab("bold", checked)
|
|
32142
|
+
}, {
|
|
32143
|
+
testId: "editor-font-dialog-italic",
|
|
32144
|
+
label: t("dialog.font.italic"),
|
|
32145
|
+
labelStyle: {
|
|
32146
|
+
"font-style": "italic"
|
|
32147
|
+
},
|
|
32148
|
+
checked: () => ctrl.fontTabValues().italic,
|
|
32149
|
+
onChange: (checked) => ctrl.updateFontTab("italic", checked)
|
|
32150
|
+
}, {
|
|
32151
|
+
testId: "editor-font-dialog-underline",
|
|
32152
|
+
label: t("dialog.font.underline"),
|
|
32153
|
+
labelStyle: {
|
|
32154
|
+
"text-decoration": "underline"
|
|
32155
|
+
},
|
|
32156
|
+
checked: () => ctrl.fontTabValues().underline,
|
|
32157
|
+
onChange: (checked) => ctrl.setFontTabValues((current) => ({
|
|
32158
|
+
...current,
|
|
32159
|
+
underline: checked,
|
|
32160
|
+
underlineStyle: checked ? current.underlineStyle === "none" ? "single" : current.underlineStyle : "none"
|
|
32161
|
+
}))
|
|
32162
|
+
}, {
|
|
32163
|
+
testId: "editor-font-dialog-strike",
|
|
32164
|
+
label: t("dialog.font.strike"),
|
|
32165
|
+
labelStyle: {
|
|
32166
|
+
"text-decoration": "line-through"
|
|
32167
|
+
},
|
|
32168
|
+
checked: () => ctrl.fontTabValues().strike,
|
|
32169
|
+
onChange: (checked) => ctrl.setFontTabValues((current) => ({
|
|
32170
|
+
...current,
|
|
32171
|
+
strike: checked,
|
|
32172
|
+
doubleStrike: checked ? false : current.doubleStrike
|
|
32173
|
+
}))
|
|
32174
|
+
}, {
|
|
32175
|
+
testId: "editor-font-dialog-double-strike",
|
|
32176
|
+
label: t("dialog.font.doubleStrike"),
|
|
32177
|
+
checked: () => ctrl.fontTabValues().doubleStrike,
|
|
32178
|
+
onChange: (checked) => ctrl.setFontTabValues((current) => ({
|
|
32179
|
+
...current,
|
|
32180
|
+
doubleStrike: checked,
|
|
32181
|
+
strike: checked ? false : current.strike
|
|
32182
|
+
}))
|
|
32183
|
+
}, {
|
|
32184
|
+
testId: "editor-font-dialog-superscript",
|
|
32185
|
+
label: t("toolbar.superscript"),
|
|
32186
|
+
checked: () => ctrl.fontTabValues().superscript,
|
|
32187
|
+
onChange: (checked) => ctrl.setFontTabValues((current) => ({
|
|
32188
|
+
...current,
|
|
32189
|
+
superscript: checked,
|
|
32190
|
+
subscript: checked ? false : current.subscript
|
|
32191
|
+
}))
|
|
32192
|
+
}, {
|
|
32193
|
+
testId: "editor-font-dialog-subscript",
|
|
32194
|
+
label: t("toolbar.subscript"),
|
|
32195
|
+
checked: () => ctrl.fontTabValues().subscript,
|
|
32196
|
+
onChange: (checked) => ctrl.setFontTabValues((current) => ({
|
|
32197
|
+
...current,
|
|
32198
|
+
subscript: checked,
|
|
32199
|
+
superscript: checked ? false : current.superscript
|
|
32200
|
+
}))
|
|
32201
|
+
}, {
|
|
32202
|
+
testId: "editor-font-dialog-small-caps",
|
|
32203
|
+
label: t("dialog.font.smallCaps"),
|
|
32204
|
+
checked: () => ctrl.fontTabValues().smallCaps,
|
|
32205
|
+
onChange: (checked) => ctrl.updateFontTab("smallCaps", checked)
|
|
32206
|
+
}, {
|
|
32207
|
+
testId: "editor-font-dialog-all-caps",
|
|
32208
|
+
label: t("dialog.font.allCaps"),
|
|
32209
|
+
checked: () => ctrl.fontTabValues().allCaps,
|
|
32210
|
+
onChange: (checked) => ctrl.updateFontTab("allCaps", checked)
|
|
32211
|
+
}, {
|
|
32212
|
+
testId: "editor-font-dialog-hidden",
|
|
32213
|
+
label: t("dialog.font.hidden"),
|
|
32214
|
+
checked: () => ctrl.fontTabValues().hidden,
|
|
32215
|
+
onChange: (checked) => ctrl.updateFontTab("hidden", checked)
|
|
32216
|
+
}];
|
|
31826
32217
|
return (() => {
|
|
31827
|
-
var _el$ = _tmpl$$
|
|
31828
|
-
_el$
|
|
31829
|
-
|
|
31830
|
-
|
|
31831
|
-
|
|
31832
|
-
insert(_el$4, () => t("dialog.font.familyFilter"));
|
|
31833
|
-
_el$5.$$input = (e) => ctrl.updateFontTab("familyFilter", e.currentTarget.value);
|
|
31834
|
-
insert(_el$8, () => t("dialog.font.family"));
|
|
31835
|
-
_el$9.addEventListener("change", (e) => ctrl.updateFontTab("fontFamily", e.currentTarget.value));
|
|
31836
|
-
insert(_el$9, createComponent(For, {
|
|
31837
|
-
get each() {
|
|
31838
|
-
return ctrl.visibleFamilyOptions();
|
|
32218
|
+
var _el$ = _tmpl$$c(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$4.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.firstChild, _el$10 = _el$1.nextSibling, _el$11 = _el$0.nextSibling, _el$12 = _el$8.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$12.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$7.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$18.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$22.nextSibling, _el$27 = _el$26.firstChild;
|
|
32219
|
+
insert(_el$2, createComponent(TextField, {
|
|
32220
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
32221
|
+
get label() {
|
|
32222
|
+
return t("dialog.font.familyFilter");
|
|
31839
32223
|
},
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
32224
|
+
get value() {
|
|
32225
|
+
return ctrl.fontTabValues().familyFilter;
|
|
32226
|
+
},
|
|
32227
|
+
onChange: (value) => ctrl.updateFontTab("familyFilter", value),
|
|
32228
|
+
"data-testid": "editor-font-dialog-family-filter"
|
|
32229
|
+
}));
|
|
32230
|
+
insert(_el$3, createComponent(SelectField, {
|
|
32231
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
32232
|
+
get label() {
|
|
32233
|
+
return t("dialog.font.family");
|
|
32234
|
+
},
|
|
32235
|
+
get value() {
|
|
32236
|
+
return ctrl.fontTabValues().fontFamily;
|
|
32237
|
+
},
|
|
32238
|
+
onChange: (value) => ctrl.updateFontTab("fontFamily", value),
|
|
32239
|
+
"data-testid": "editor-font-dialog-family",
|
|
32240
|
+
get options() {
|
|
32241
|
+
return [{
|
|
32242
|
+
value: "",
|
|
32243
|
+
label: "—"
|
|
32244
|
+
}, ...ctrl.visibleFamilyOptions().map((family) => ({
|
|
32245
|
+
value: family,
|
|
32246
|
+
label: family
|
|
32247
|
+
}))];
|
|
32248
|
+
}
|
|
31846
32249
|
}), null);
|
|
31847
|
-
insert(_el$
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
32250
|
+
insert(_el$3, createComponent(SelectField, {
|
|
32251
|
+
"class": "oasis-editor-font-dialog-size-group",
|
|
32252
|
+
get label() {
|
|
32253
|
+
return t("dialog.font.size");
|
|
32254
|
+
},
|
|
32255
|
+
get value() {
|
|
32256
|
+
return ctrl.fontTabValues().fontSize;
|
|
32257
|
+
},
|
|
32258
|
+
onChange: (value) => ctrl.updateFontTab("fontSize", value),
|
|
32259
|
+
"data-testid": "editor-font-dialog-size",
|
|
32260
|
+
get options() {
|
|
32261
|
+
return [{
|
|
32262
|
+
value: "",
|
|
32263
|
+
label: "—"
|
|
32264
|
+
}, ...ctrl.effectiveSizeOptions().map((size) => ({
|
|
32265
|
+
value: String(size),
|
|
32266
|
+
label: String(size)
|
|
32267
|
+
}))];
|
|
32268
|
+
}
|
|
32269
|
+
}), null);
|
|
32270
|
+
insert(_el$5, createComponent(TextField, {
|
|
32271
|
+
get label() {
|
|
32272
|
+
return t("dialog.font.customSize");
|
|
32273
|
+
},
|
|
32274
|
+
get value() {
|
|
32275
|
+
return ctrl.fontTabValues().fontSize;
|
|
32276
|
+
},
|
|
32277
|
+
onChange: (value) => ctrl.updateFontTab("fontSize", value),
|
|
32278
|
+
"data-testid": "editor-font-dialog-custom-size"
|
|
32279
|
+
}), _el$6);
|
|
32280
|
+
insert(_el$6, () => ctrl.customSizeError());
|
|
32281
|
+
insert(_el$4, createComponent(SelectField, {
|
|
32282
|
+
"class": "oasis-editor-font-dialog-style-list-group",
|
|
32283
|
+
get label() {
|
|
32284
|
+
return t("dialog.font.styleList");
|
|
31852
32285
|
},
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
32286
|
+
get value() {
|
|
32287
|
+
return ctrl.selectedFontStyle();
|
|
32288
|
+
},
|
|
32289
|
+
onChange: (value) => ctrl.applyFontStylePreset(value),
|
|
32290
|
+
"data-testid": "editor-font-dialog-style-list",
|
|
32291
|
+
get options() {
|
|
32292
|
+
return [{
|
|
32293
|
+
value: "regular",
|
|
32294
|
+
label: t("dialog.font.styleRegular")
|
|
32295
|
+
}, {
|
|
32296
|
+
value: "italic",
|
|
32297
|
+
label: t("dialog.font.styleItalic")
|
|
32298
|
+
}, {
|
|
32299
|
+
value: "bold",
|
|
32300
|
+
label: t("dialog.font.styleBold")
|
|
32301
|
+
}, {
|
|
32302
|
+
value: "boldItalic",
|
|
32303
|
+
label: t("dialog.font.styleBoldItalic")
|
|
32304
|
+
}];
|
|
32305
|
+
}
|
|
31859
32306
|
}), null);
|
|
31860
|
-
insert(_el$
|
|
31861
|
-
_el$
|
|
31862
|
-
insert(_el$
|
|
31863
|
-
insert(_el$
|
|
31864
|
-
_el$
|
|
31865
|
-
insert(_el$21, () => t("dialog.font.styleRegular"));
|
|
31866
|
-
insert(_el$22, () => t("dialog.font.styleItalic"));
|
|
31867
|
-
insert(_el$23, () => t("dialog.font.styleBold"));
|
|
31868
|
-
insert(_el$24, () => t("dialog.font.styleBoldItalic"));
|
|
31869
|
-
insert(_el$27, () => t("dialog.font.color"));
|
|
31870
|
-
_el$28.addEventListener("change", (e) => ctrl.updateFontTab("colorMode", e.currentTarget.value));
|
|
31871
|
-
insert(_el$29, () => t("toolbar.colorAutomatic"));
|
|
31872
|
-
insert(_el$30, () => t("dialog.font.customColor"));
|
|
31873
|
-
_el$31.$$input = (e) => ctrl.setFontTabValues((current) => ({
|
|
32307
|
+
insert(_el$9, () => t("dialog.font.color"));
|
|
32308
|
+
_el$0.addEventListener("change", (e) => ctrl.updateFontTab("colorMode", e.currentTarget.value));
|
|
32309
|
+
insert(_el$1, () => t("toolbar.colorAutomatic"));
|
|
32310
|
+
insert(_el$10, () => t("dialog.font.customColor"));
|
|
32311
|
+
_el$11.$$input = (e) => ctrl.setFontTabValues((current) => ({
|
|
31874
32312
|
...current,
|
|
31875
32313
|
color: e.currentTarget.value,
|
|
31876
32314
|
colorMode: "custom"
|
|
31877
32315
|
}));
|
|
31878
|
-
insert(_el$
|
|
31879
|
-
_el$
|
|
31880
|
-
insert(_el$
|
|
31881
|
-
_el$
|
|
31882
|
-
insert(_el$
|
|
31883
|
-
|
|
31884
|
-
|
|
31885
|
-
|
|
31886
|
-
|
|
31887
|
-
|
|
31888
|
-
|
|
31889
|
-
|
|
31890
|
-
|
|
31891
|
-
|
|
31892
|
-
|
|
31893
|
-
|
|
31894
|
-
|
|
31895
|
-
|
|
31896
|
-
|
|
31897
|
-
|
|
31898
|
-
|
|
31899
|
-
|
|
32316
|
+
insert(_el$13, () => t("dialog.font.highlight"));
|
|
32317
|
+
_el$14.$$input = (e) => ctrl.updateFontTab("highlight", e.currentTarget.value);
|
|
32318
|
+
insert(_el$16, () => t("dialog.font.shading"));
|
|
32319
|
+
_el$17.$$input = (e) => ctrl.updateFontTab("shading", e.currentTarget.value);
|
|
32320
|
+
insert(_el$18, createComponent(SelectField, {
|
|
32321
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
32322
|
+
get label() {
|
|
32323
|
+
return t("dialog.font.underlineStyle");
|
|
32324
|
+
},
|
|
32325
|
+
get value() {
|
|
32326
|
+
return ctrl.fontTabValues().underlineStyle;
|
|
32327
|
+
},
|
|
32328
|
+
onChange: (value) => ctrl.setFontTabValues((current) => ({
|
|
32329
|
+
...current,
|
|
32330
|
+
underlineStyle: value,
|
|
32331
|
+
underline: value !== "none"
|
|
32332
|
+
})),
|
|
32333
|
+
"data-testid": "editor-font-dialog-underline-style",
|
|
32334
|
+
get options() {
|
|
32335
|
+
return [{
|
|
32336
|
+
value: "none",
|
|
32337
|
+
label: t("toolbar.underlineRemove")
|
|
32338
|
+
}, ...UNDERLINE_STYLE_OPTIONS.map((option) => ({
|
|
32339
|
+
value: option.value,
|
|
32340
|
+
label: t(option.labelKey)
|
|
32341
|
+
}))];
|
|
32342
|
+
}
|
|
32343
|
+
}), _el$19);
|
|
32344
|
+
insert(_el$20, () => t("dialog.font.underlineColor"));
|
|
32345
|
+
_el$21.$$input = (e) => ctrl.setFontTabValues((current) => ({
|
|
31900
32346
|
...current,
|
|
31901
32347
|
underlineColor: e.currentTarget.value,
|
|
31902
32348
|
underline: current.underlineStyle !== "none"
|
|
31903
32349
|
}));
|
|
31904
|
-
insert(_el$
|
|
31905
|
-
_el$
|
|
31906
|
-
|
|
31907
|
-
|
|
31908
|
-
|
|
31909
|
-
|
|
31910
|
-
|
|
31911
|
-
|
|
31912
|
-
|
|
31913
|
-
|
|
31914
|
-
|
|
31915
|
-
|
|
31916
|
-
|
|
31917
|
-
|
|
31918
|
-
|
|
31919
|
-
|
|
31920
|
-
|
|
31921
|
-
|
|
31922
|
-
|
|
31923
|
-
|
|
31924
|
-
|
|
31925
|
-
|
|
31926
|
-
|
|
31927
|
-
_el$
|
|
31928
|
-
|
|
31929
|
-
superscript: e.currentTarget.checked,
|
|
31930
|
-
subscript: e.currentTarget.checked ? false : current.subscript
|
|
31931
|
-
})));
|
|
31932
|
-
insert(_el$67, () => t("toolbar.superscript"));
|
|
31933
|
-
_el$69.addEventListener("change", (e) => ctrl.setFontTabValues((current) => ({
|
|
31934
|
-
...current,
|
|
31935
|
-
subscript: e.currentTarget.checked,
|
|
31936
|
-
superscript: e.currentTarget.checked ? false : current.superscript
|
|
31937
|
-
})));
|
|
31938
|
-
insert(_el$70, () => t("toolbar.subscript"));
|
|
31939
|
-
_el$72.addEventListener("change", (e) => ctrl.updateFontTab("smallCaps", e.currentTarget.checked));
|
|
31940
|
-
insert(_el$73, () => t("dialog.font.smallCaps"));
|
|
31941
|
-
_el$75.addEventListener("change", (e) => ctrl.updateFontTab("allCaps", e.currentTarget.checked));
|
|
31942
|
-
insert(_el$76, () => t("dialog.font.allCaps"));
|
|
31943
|
-
_el$78.addEventListener("change", (e) => ctrl.updateFontTab("hidden", e.currentTarget.checked));
|
|
31944
|
-
insert(_el$79, () => t("dialog.font.hidden"));
|
|
31945
|
-
insert(_el$81, () => t("dialog.font.preview"));
|
|
31946
|
-
insert(_el$80, createComponent(FontPreview, {
|
|
32350
|
+
insert(_el$24, () => t("dialog.font.style"));
|
|
32351
|
+
insert(_el$25, createComponent(For, {
|
|
32352
|
+
get each() {
|
|
32353
|
+
return effectToggles();
|
|
32354
|
+
},
|
|
32355
|
+
children: (toggle) => createComponent(ToggleChip, {
|
|
32356
|
+
get label() {
|
|
32357
|
+
return toggle.label;
|
|
32358
|
+
},
|
|
32359
|
+
get labelStyle() {
|
|
32360
|
+
return toggle.labelStyle;
|
|
32361
|
+
},
|
|
32362
|
+
get checked() {
|
|
32363
|
+
return toggle.checked();
|
|
32364
|
+
},
|
|
32365
|
+
get onChange() {
|
|
32366
|
+
return toggle.onChange;
|
|
32367
|
+
},
|
|
32368
|
+
get ["data-testid"]() {
|
|
32369
|
+
return toggle.testId;
|
|
32370
|
+
}
|
|
32371
|
+
})
|
|
32372
|
+
}));
|
|
32373
|
+
insert(_el$27, () => t("dialog.font.preview"));
|
|
32374
|
+
insert(_el$26, createComponent(FontPreview, {
|
|
31947
32375
|
testId: "editor-font-dialog-preview",
|
|
31948
32376
|
get style() {
|
|
31949
32377
|
return ctrl.previewStyle();
|
|
@@ -31951,154 +32379,248 @@ function FontTab(props) {
|
|
|
31951
32379
|
}), null);
|
|
31952
32380
|
createRenderEffect((_p$) => {
|
|
31953
32381
|
var _v$ = ctrl.fontTabValues().colorMode === "automatic", _v$2 = ctrl.fontTabValues().underlineStyle === "none";
|
|
31954
|
-
_v$ !== _p$.e && (_el$
|
|
31955
|
-
_v$2 !== _p$.t && (_el$
|
|
32382
|
+
_v$ !== _p$.e && (_el$11.disabled = _p$.e = _v$);
|
|
32383
|
+
_v$2 !== _p$.t && (_el$21.disabled = _p$.t = _v$2);
|
|
31956
32384
|
return _p$;
|
|
31957
32385
|
}, {
|
|
31958
32386
|
e: void 0,
|
|
31959
32387
|
t: void 0
|
|
31960
32388
|
});
|
|
31961
|
-
createRenderEffect(() => _el$
|
|
31962
|
-
createRenderEffect(() => _el$
|
|
31963
|
-
createRenderEffect(() => _el$
|
|
31964
|
-
createRenderEffect(() => _el$
|
|
31965
|
-
createRenderEffect(() => _el$
|
|
31966
|
-
createRenderEffect(() => _el$28.value = ctrl.fontTabValues().colorMode);
|
|
31967
|
-
createRenderEffect(() => _el$31.value = ctrl.fontTabValues().color);
|
|
31968
|
-
createRenderEffect(() => _el$34.value = ctrl.fontTabValues().highlight || DEFAULT_HIGHLIGHT);
|
|
31969
|
-
createRenderEffect(() => _el$37.value = ctrl.fontTabValues().shading || DEFAULT_SHADING);
|
|
31970
|
-
createRenderEffect(() => _el$41.value = ctrl.fontTabValues().underlineStyle);
|
|
31971
|
-
createRenderEffect(() => _el$45.value = ctrl.fontTabValues().underlineColor || DEFAULT_COLOR);
|
|
31972
|
-
createRenderEffect(() => _el$51.checked = ctrl.fontTabValues().bold);
|
|
31973
|
-
createRenderEffect(() => _el$54.checked = ctrl.fontTabValues().italic);
|
|
31974
|
-
createRenderEffect(() => _el$57.checked = ctrl.fontTabValues().underline);
|
|
31975
|
-
createRenderEffect(() => _el$60.checked = ctrl.fontTabValues().strike);
|
|
31976
|
-
createRenderEffect(() => _el$63.checked = ctrl.fontTabValues().doubleStrike);
|
|
31977
|
-
createRenderEffect(() => _el$66.checked = ctrl.fontTabValues().superscript);
|
|
31978
|
-
createRenderEffect(() => _el$69.checked = ctrl.fontTabValues().subscript);
|
|
31979
|
-
createRenderEffect(() => _el$72.checked = ctrl.fontTabValues().smallCaps);
|
|
31980
|
-
createRenderEffect(() => _el$75.checked = ctrl.fontTabValues().allCaps);
|
|
31981
|
-
createRenderEffect(() => _el$78.checked = ctrl.fontTabValues().hidden);
|
|
32389
|
+
createRenderEffect(() => _el$0.value = ctrl.fontTabValues().colorMode);
|
|
32390
|
+
createRenderEffect(() => _el$11.value = ctrl.fontTabValues().color);
|
|
32391
|
+
createRenderEffect(() => _el$14.value = ctrl.fontTabValues().highlight || DEFAULT_HIGHLIGHT);
|
|
32392
|
+
createRenderEffect(() => _el$17.value = ctrl.fontTabValues().shading || DEFAULT_SHADING);
|
|
32393
|
+
createRenderEffect(() => _el$21.value = ctrl.fontTabValues().underlineColor || DEFAULT_COLOR);
|
|
31982
32394
|
return _el$;
|
|
31983
32395
|
})();
|
|
31984
32396
|
}
|
|
31985
32397
|
delegateEvents(["input"]);
|
|
31986
|
-
var _tmpl$$
|
|
32398
|
+
var _tmpl$$b = /* @__PURE__ */ template(`<div class="oasis-editor-font-dialog-panel oasis-editor-font-dialog-advanced-panel"><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label><label class="oasis-editor-dialog-label oasis-editor-font-dialog-by-label"></label></div><div class="oasis-editor-font-dialog-word-row oasis-editor-font-dialog-kerning-row"><span class="oasis-editor-dialog-help-text oasis-editor-font-dialog-kerning-suffix"></span></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div><div class=oasis-editor-font-dialog-word-row><label class=oasis-editor-dialog-label></label></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend></fieldset><p class=oasis-editor-dialog-help-text data-testid=editor-font-dialog-advanced-placeholder>`);
|
|
31987
32399
|
function AdvancedFontTab(props) {
|
|
31988
32400
|
const t = useI18n();
|
|
31989
32401
|
const {
|
|
31990
32402
|
ctrl
|
|
31991
32403
|
} = props;
|
|
31992
32404
|
return (() => {
|
|
31993
|
-
var _el$ = _tmpl$$
|
|
32405
|
+
var _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$2.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$16.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$18.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$12.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling;
|
|
31994
32406
|
insert(_el$3, () => t("dialog.font.advancedCharacterSpacingGroup"));
|
|
31995
32407
|
insert(_el$5, () => t("dialog.font.advancedScale"));
|
|
31996
|
-
_el$
|
|
31997
|
-
|
|
31998
|
-
|
|
31999
|
-
|
|
32000
|
-
|
|
32001
|
-
|
|
32002
|
-
|
|
32003
|
-
return
|
|
32004
|
-
|
|
32005
|
-
|
|
32006
|
-
|
|
32007
|
-
|
|
32008
|
-
|
|
32009
|
-
insert(_el$
|
|
32010
|
-
insert(_el$
|
|
32011
|
-
|
|
32012
|
-
|
|
32013
|
-
|
|
32014
|
-
|
|
32015
|
-
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
|
|
32019
|
-
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
insert(_el$
|
|
32030
|
-
_el$
|
|
32031
|
-
|
|
32032
|
-
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
|
|
32038
|
-
|
|
32039
|
-
|
|
32040
|
-
|
|
32041
|
-
insert(_el$
|
|
32042
|
-
insert(_el$
|
|
32043
|
-
|
|
32044
|
-
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
|
|
32408
|
+
insert(_el$4, createComponent(SelectField, {
|
|
32409
|
+
get value() {
|
|
32410
|
+
return ctrl.advancedTabValues().characterScale || "100";
|
|
32411
|
+
},
|
|
32412
|
+
onChange: (value) => ctrl.updateAdvancedTab("characterScale", value),
|
|
32413
|
+
"data-testid": "editor-font-dialog-advanced-scale",
|
|
32414
|
+
get options() {
|
|
32415
|
+
return WORD_CHARACTER_SCALES.map((scale) => ({
|
|
32416
|
+
value: String(scale),
|
|
32417
|
+
label: `${scale}%`
|
|
32418
|
+
}));
|
|
32419
|
+
}
|
|
32420
|
+
}), null);
|
|
32421
|
+
insert(_el$7, () => t("dialog.font.advancedSpacing"));
|
|
32422
|
+
insert(_el$6, createComponent(SelectField, {
|
|
32423
|
+
get value() {
|
|
32424
|
+
return ctrl.advancedTabValues().spacingMode;
|
|
32425
|
+
},
|
|
32426
|
+
onChange: (value) => ctrl.updateAdvancedTab("spacingMode", value),
|
|
32427
|
+
"data-testid": "editor-font-dialog-advanced-spacing-mode",
|
|
32428
|
+
get options() {
|
|
32429
|
+
return [{
|
|
32430
|
+
value: "normal",
|
|
32431
|
+
label: t("dialog.font.advancedNormal")
|
|
32432
|
+
}, {
|
|
32433
|
+
value: "expanded",
|
|
32434
|
+
label: t("dialog.font.advancedExpanded")
|
|
32435
|
+
}, {
|
|
32436
|
+
value: "condensed",
|
|
32437
|
+
label: t("dialog.font.advancedCondensed")
|
|
32438
|
+
}];
|
|
32439
|
+
}
|
|
32440
|
+
}), _el$8);
|
|
32441
|
+
insert(_el$8, () => t("dialog.font.advancedBy"));
|
|
32442
|
+
insert(_el$6, createComponent(TextField, {
|
|
32443
|
+
"class": "oasis-editor-font-dialog-small-input",
|
|
32444
|
+
get value() {
|
|
32445
|
+
return ctrl.advancedTabValues().spacingAmount;
|
|
32446
|
+
},
|
|
32447
|
+
get disabled() {
|
|
32448
|
+
return ctrl.advancedTabValues().spacingMode === "normal";
|
|
32449
|
+
},
|
|
32450
|
+
onChange: (value) => ctrl.updateAdvancedTab("spacingAmount", value),
|
|
32451
|
+
"data-testid": "editor-font-dialog-advanced-spacing-amount"
|
|
32452
|
+
}), null);
|
|
32453
|
+
insert(_el$0, () => t("dialog.font.advancedPosition"));
|
|
32454
|
+
insert(_el$9, createComponent(SelectField, {
|
|
32455
|
+
get value() {
|
|
32456
|
+
return ctrl.advancedTabValues().positionMode;
|
|
32457
|
+
},
|
|
32458
|
+
onChange: (value) => ctrl.updateAdvancedTab("positionMode", value),
|
|
32459
|
+
"data-testid": "editor-font-dialog-advanced-position-mode",
|
|
32460
|
+
get options() {
|
|
32461
|
+
return [{
|
|
32462
|
+
value: "normal",
|
|
32463
|
+
label: t("dialog.font.advancedNormal")
|
|
32464
|
+
}, {
|
|
32465
|
+
value: "raised",
|
|
32466
|
+
label: t("dialog.font.advancedRaised")
|
|
32467
|
+
}, {
|
|
32468
|
+
value: "lowered",
|
|
32469
|
+
label: t("dialog.font.advancedLowered")
|
|
32470
|
+
}];
|
|
32471
|
+
}
|
|
32472
|
+
}), _el$1);
|
|
32473
|
+
insert(_el$1, () => t("dialog.font.advancedBy"));
|
|
32474
|
+
insert(_el$9, createComponent(TextField, {
|
|
32475
|
+
"class": "oasis-editor-font-dialog-small-input",
|
|
32476
|
+
get value() {
|
|
32477
|
+
return ctrl.advancedTabValues().positionAmount;
|
|
32478
|
+
},
|
|
32479
|
+
get disabled() {
|
|
32480
|
+
return ctrl.advancedTabValues().positionMode === "normal";
|
|
32481
|
+
},
|
|
32482
|
+
onChange: (value) => ctrl.updateAdvancedTab("positionAmount", value),
|
|
32483
|
+
"data-testid": "editor-font-dialog-advanced-position-amount"
|
|
32484
|
+
}), null);
|
|
32485
|
+
insert(_el$10, createComponent(Checkbox, {
|
|
32486
|
+
"class": "oasis-editor-font-dialog-kerning-toggle",
|
|
32487
|
+
get label() {
|
|
32488
|
+
return t("dialog.font.advancedKerning");
|
|
32489
|
+
},
|
|
32490
|
+
get checked() {
|
|
32491
|
+
return ctrl.advancedTabValues().kerningEnabled;
|
|
32492
|
+
},
|
|
32493
|
+
onChange: (checked) => ctrl.setAdvancedTabValues((current) => ({
|
|
32494
|
+
...current,
|
|
32495
|
+
kerningEnabled: checked,
|
|
32496
|
+
kerningThreshold: checked ? current.kerningThreshold || "1" : current.kerningThreshold
|
|
32497
|
+
})),
|
|
32498
|
+
"data-testid": "editor-font-dialog-advanced-kerning-enabled"
|
|
32499
|
+
}), _el$11);
|
|
32500
|
+
insert(_el$10, createComponent(TextField, {
|
|
32501
|
+
"class": "oasis-editor-font-dialog-kerning-input",
|
|
32502
|
+
get value() {
|
|
32503
|
+
return ctrl.advancedTabValues().kerningThreshold;
|
|
32504
|
+
},
|
|
32505
|
+
get disabled() {
|
|
32506
|
+
return !ctrl.advancedTabValues().kerningEnabled;
|
|
32507
|
+
},
|
|
32508
|
+
onChange: (value) => ctrl.updateAdvancedTab("kerningThreshold", value),
|
|
32509
|
+
"data-testid": "editor-font-dialog-advanced-kerning"
|
|
32510
|
+
}), _el$11);
|
|
32511
|
+
insert(_el$11, () => t("dialog.font.advancedKerningAbove"));
|
|
32512
|
+
insert(_el$13, () => t("dialog.font.advancedOpenTypeGroup"));
|
|
32513
|
+
insert(_el$15, () => t("dialog.font.advancedLigatures"));
|
|
32514
|
+
insert(_el$14, createComponent(SelectField, {
|
|
32515
|
+
get value() {
|
|
32516
|
+
return ctrl.advancedTabValues().ligatures;
|
|
32517
|
+
},
|
|
32518
|
+
onChange: (value) => ctrl.updateAdvancedTab("ligatures", value),
|
|
32519
|
+
"data-testid": "editor-font-dialog-advanced-ligatures",
|
|
32520
|
+
get options() {
|
|
32521
|
+
return [{
|
|
32522
|
+
value: "",
|
|
32523
|
+
label: t("dialog.font.advancedDefault")
|
|
32524
|
+
}, {
|
|
32525
|
+
value: "none",
|
|
32526
|
+
label: t("dialog.font.advancedLigaturesNone")
|
|
32527
|
+
}, {
|
|
32528
|
+
value: "standard",
|
|
32529
|
+
label: t("dialog.font.advancedLigaturesStandard")
|
|
32530
|
+
}, {
|
|
32531
|
+
value: "contextual",
|
|
32532
|
+
label: t("dialog.font.advancedLigaturesContextual")
|
|
32533
|
+
}, {
|
|
32534
|
+
value: "historical",
|
|
32535
|
+
label: t("dialog.font.advancedLigaturesHistorical")
|
|
32536
|
+
}, {
|
|
32537
|
+
value: "standardContextual",
|
|
32538
|
+
label: t("dialog.font.advancedLigaturesStandardContextual")
|
|
32539
|
+
}];
|
|
32540
|
+
}
|
|
32541
|
+
}), null);
|
|
32542
|
+
insert(_el$17, () => t("dialog.font.advancedNumberSpacing"));
|
|
32543
|
+
insert(_el$16, createComponent(SelectField, {
|
|
32544
|
+
get value() {
|
|
32545
|
+
return ctrl.advancedTabValues().numberSpacing;
|
|
32546
|
+
},
|
|
32547
|
+
onChange: (value) => ctrl.updateAdvancedTab("numberSpacing", value),
|
|
32548
|
+
"data-testid": "editor-font-dialog-advanced-number-spacing",
|
|
32549
|
+
get options() {
|
|
32550
|
+
return [{
|
|
32551
|
+
value: "",
|
|
32552
|
+
label: t("dialog.font.advancedDefault")
|
|
32553
|
+
}, {
|
|
32554
|
+
value: "proportional",
|
|
32555
|
+
label: t("dialog.font.advancedNumberSpacingProportional")
|
|
32556
|
+
}, {
|
|
32557
|
+
value: "tabular",
|
|
32558
|
+
label: t("dialog.font.advancedNumberSpacingTabular")
|
|
32559
|
+
}];
|
|
32560
|
+
}
|
|
32561
|
+
}), null);
|
|
32562
|
+
insert(_el$19, () => t("dialog.font.advancedNumberForm"));
|
|
32563
|
+
insert(_el$18, createComponent(SelectField, {
|
|
32564
|
+
get value() {
|
|
32565
|
+
return ctrl.advancedTabValues().numberForm;
|
|
32566
|
+
},
|
|
32567
|
+
onChange: (value) => ctrl.updateAdvancedTab("numberForm", value),
|
|
32568
|
+
"data-testid": "editor-font-dialog-advanced-number-form",
|
|
32569
|
+
get options() {
|
|
32570
|
+
return [{
|
|
32571
|
+
value: "",
|
|
32572
|
+
label: t("dialog.font.advancedDefault")
|
|
32573
|
+
}, {
|
|
32574
|
+
value: "lining",
|
|
32575
|
+
label: t("dialog.font.advancedNumberFormLining")
|
|
32576
|
+
}, {
|
|
32577
|
+
value: "oldStyle",
|
|
32578
|
+
label: t("dialog.font.advancedNumberFormOldStyle")
|
|
32579
|
+
}];
|
|
32580
|
+
}
|
|
32581
|
+
}), null);
|
|
32582
|
+
insert(_el$21, () => t("dialog.font.advancedStylisticSet"));
|
|
32583
|
+
insert(_el$20, createComponent(SelectField, {
|
|
32584
|
+
get value() {
|
|
32585
|
+
return ctrl.advancedTabValues().stylisticSet;
|
|
32586
|
+
},
|
|
32587
|
+
onChange: (value) => ctrl.updateAdvancedTab("stylisticSet", value),
|
|
32588
|
+
"data-testid": "editor-font-dialog-advanced-stylistic-set",
|
|
32589
|
+
get options() {
|
|
32590
|
+
return [{
|
|
32591
|
+
value: "",
|
|
32592
|
+
label: t("dialog.font.advancedDefault")
|
|
32593
|
+
}, ...Array.from({
|
|
32053
32594
|
length: 20
|
|
32054
|
-
}, (_, index) => index + 1)
|
|
32595
|
+
}, (_, index) => index + 1).map((set) => ({
|
|
32596
|
+
value: String(set),
|
|
32597
|
+
label: String(set)
|
|
32598
|
+
}))];
|
|
32599
|
+
}
|
|
32600
|
+
}), null);
|
|
32601
|
+
insert(_el$12, createComponent(Checkbox, {
|
|
32602
|
+
"class": "oasis-editor-font-dialog-contextual-toggle",
|
|
32603
|
+
get label() {
|
|
32604
|
+
return t("dialog.font.advancedContextualAlternates");
|
|
32055
32605
|
},
|
|
32056
|
-
|
|
32057
|
-
|
|
32058
|
-
|
|
32059
|
-
|
|
32060
|
-
|
|
32061
|
-
})()
|
|
32606
|
+
get checked() {
|
|
32607
|
+
return ctrl.advancedTabValues().contextualAlternates;
|
|
32608
|
+
},
|
|
32609
|
+
onChange: (checked) => ctrl.updateAdvancedTab("contextualAlternates", checked),
|
|
32610
|
+
"data-testid": "editor-font-dialog-advanced-contextual-alternates"
|
|
32062
32611
|
}), null);
|
|
32063
|
-
_el$
|
|
32064
|
-
insert(_el$
|
|
32065
|
-
insert(_el$58, () => t("dialog.font.advancedPreviewGroup"));
|
|
32066
|
-
insert(_el$57, createComponent(FontPreview, {
|
|
32612
|
+
insert(_el$23, () => t("dialog.font.advancedPreviewGroup"));
|
|
32613
|
+
insert(_el$22, createComponent(FontPreview, {
|
|
32067
32614
|
"class": "oasis-editor-dialog-preview oasis-editor-font-dialog-advanced-preview",
|
|
32068
32615
|
testId: "editor-font-dialog-advanced-preview",
|
|
32069
32616
|
get style() {
|
|
32070
32617
|
return ctrl.previewStyle();
|
|
32071
32618
|
}
|
|
32072
32619
|
}), null);
|
|
32073
|
-
insert(_el$
|
|
32074
|
-
createRenderEffect((_p$) => {
|
|
32075
|
-
var _v$ = ctrl.advancedTabValues().spacingMode === "normal", _v$2 = ctrl.advancedTabValues().positionMode === "normal", _v$3 = !ctrl.advancedTabValues().kerningEnabled;
|
|
32076
|
-
_v$ !== _p$.e && (_el$12.disabled = _p$.e = _v$);
|
|
32077
|
-
_v$2 !== _p$.t && (_el$20.disabled = _p$.t = _v$2);
|
|
32078
|
-
_v$3 !== _p$.a && (_el$25.disabled = _p$.a = _v$3);
|
|
32079
|
-
return _p$;
|
|
32080
|
-
}, {
|
|
32081
|
-
e: void 0,
|
|
32082
|
-
t: void 0,
|
|
32083
|
-
a: void 0
|
|
32084
|
-
});
|
|
32085
|
-
createRenderEffect(() => _el$6.value = ctrl.advancedTabValues().characterScale || "100");
|
|
32086
|
-
createRenderEffect(() => _el$9.value = ctrl.advancedTabValues().spacingMode);
|
|
32087
|
-
createRenderEffect(() => _el$12.value = ctrl.advancedTabValues().spacingAmount);
|
|
32088
|
-
createRenderEffect(() => _el$15.value = ctrl.advancedTabValues().positionMode);
|
|
32089
|
-
createRenderEffect(() => _el$20.value = ctrl.advancedTabValues().positionAmount);
|
|
32090
|
-
createRenderEffect(() => _el$23.checked = ctrl.advancedTabValues().kerningEnabled);
|
|
32091
|
-
createRenderEffect(() => _el$25.value = ctrl.advancedTabValues().kerningThreshold);
|
|
32092
|
-
createRenderEffect(() => _el$31.value = ctrl.advancedTabValues().ligatures);
|
|
32093
|
-
createRenderEffect(() => _el$40.value = ctrl.advancedTabValues().numberSpacing);
|
|
32094
|
-
createRenderEffect(() => _el$46.value = ctrl.advancedTabValues().numberForm);
|
|
32095
|
-
createRenderEffect(() => _el$52.value = ctrl.advancedTabValues().stylisticSet);
|
|
32096
|
-
createRenderEffect(() => _el$55.checked = ctrl.advancedTabValues().contextualAlternates);
|
|
32620
|
+
insert(_el$24, () => ctrl.advancedValidationError() || t("dialog.font.advancedPlaceholder"));
|
|
32097
32621
|
return _el$;
|
|
32098
32622
|
})();
|
|
32099
32623
|
}
|
|
32100
|
-
delegateEvents(["input"]);
|
|
32101
|
-
var _tmpl$$7 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-secondary"data-testid=editor-font-dialog-cancel>`), _tmpl$2$3 = /* @__PURE__ */ template(`<button class="oasis-editor-dialog-button oasis-editor-dialog-button-primary"data-testid=editor-font-dialog-apply>`);
|
|
32102
32624
|
function FontDialog(props) {
|
|
32103
32625
|
const t = useI18n();
|
|
32104
32626
|
const ctrl = useFontDialogController(props);
|
|
@@ -32116,17 +32638,22 @@ function FontDialog(props) {
|
|
|
32116
32638
|
bodyClass: "oasis-editor-font-dialog-body",
|
|
32117
32639
|
size: "font",
|
|
32118
32640
|
get footer() {
|
|
32119
|
-
return
|
|
32120
|
-
|
|
32121
|
-
|
|
32122
|
-
|
|
32123
|
-
|
|
32124
|
-
|
|
32125
|
-
|
|
32126
|
-
|
|
32127
|
-
|
|
32128
|
-
|
|
32129
|
-
|
|
32641
|
+
return createComponent(DialogFooter, {
|
|
32642
|
+
get onCancel() {
|
|
32643
|
+
return props.onClose;
|
|
32644
|
+
},
|
|
32645
|
+
get onConfirm() {
|
|
32646
|
+
return ctrl.handleApply;
|
|
32647
|
+
},
|
|
32648
|
+
get cancelLabel() {
|
|
32649
|
+
return t("generic.cancel");
|
|
32650
|
+
},
|
|
32651
|
+
get confirmLabel() {
|
|
32652
|
+
return t("generic.ok");
|
|
32653
|
+
},
|
|
32654
|
+
cancelTestId: "editor-font-dialog-cancel",
|
|
32655
|
+
confirmTestId: "editor-font-dialog-apply"
|
|
32656
|
+
});
|
|
32130
32657
|
},
|
|
32131
32658
|
get children() {
|
|
32132
32659
|
return createComponent(Tabs, {
|
|
@@ -32159,8 +32686,7 @@ function FontDialog(props) {
|
|
|
32159
32686
|
}
|
|
32160
32687
|
});
|
|
32161
32688
|
}
|
|
32162
|
-
|
|
32163
|
-
var _tmpl$$6 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-align><option value=left></option><option value=center></option><option value=right></option><option value=justify>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input step=1 data-testid=editor-paragraph-dialog-indent-left></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input step=1 data-testid=editor-paragraph-dialog-indent-right>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-special><option value=none></option><option value=firstLine></option><option value=hanging></option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-special-by>`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-spacing-before></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=1 data-testid=editor-paragraph-dialog-spacing-after></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0.5 step=0.05 data-testid=editor-paragraph-dialog-line-height>`), _tmpl$5$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><select class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-style><option value=none></option><option value=solid></option><option value=dashed></option><option value=dotted></option></select></div><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><input type=number class=oasis-editor-dialog-input min=0 step=0.25 data-testid=editor-paragraph-dialog-border-width></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-shading>`), _tmpl$6$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-top></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-right></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-bottom></label><label class=oasis-editor-dialog-style-toggle><input type=checkbox data-testid=editor-paragraph-dialog-border-side-left>`), _tmpl$7$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`);
|
|
32689
|
+
var _tmpl$$a = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-paragraph-dialog-shading>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row><div class="oasis-editor-dialog-input-group oasis-editor-dialog-input-group-grow"><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-style-row>`), _tmpl$3$1 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><div class=oasis-editor-dialog-preview data-testid=editor-paragraph-dialog-preview>`);
|
|
32164
32690
|
const DEFAULT_BORDER_WIDTH_PT$1 = 0.5;
|
|
32165
32691
|
const DEFAULT_BORDER_COLOR$1 = "#000000";
|
|
32166
32692
|
function parseNumber$1(value) {
|
|
@@ -32171,16 +32697,16 @@ function parseNumber$1(value) {
|
|
|
32171
32697
|
function ParagraphDialog(props) {
|
|
32172
32698
|
const t = useI18n();
|
|
32173
32699
|
const [align, setAlign] = createSignal("");
|
|
32174
|
-
const [indentLeft, setIndentLeft] = createSignal(
|
|
32175
|
-
const [indentRight, setIndentRight] = createSignal(
|
|
32700
|
+
const [indentLeft, setIndentLeft] = createSignal(null);
|
|
32701
|
+
const [indentRight, setIndentRight] = createSignal(null);
|
|
32176
32702
|
const [special, setSpecial] = createSignal("none");
|
|
32177
|
-
const [specialBy, setSpecialBy] = createSignal(
|
|
32178
|
-
const [spacingBefore, setSpacingBefore] = createSignal(
|
|
32179
|
-
const [spacingAfter, setSpacingAfter] = createSignal(
|
|
32180
|
-
const [lineHeight, setLineHeight] = createSignal(
|
|
32703
|
+
const [specialBy, setSpecialBy] = createSignal(null);
|
|
32704
|
+
const [spacingBefore, setSpacingBefore] = createSignal(null);
|
|
32705
|
+
const [spacingAfter, setSpacingAfter] = createSignal(null);
|
|
32706
|
+
const [lineHeight, setLineHeight] = createSignal(null);
|
|
32181
32707
|
const [shading, setShading] = createSignal("");
|
|
32182
32708
|
const [borderStyle, setBorderStyle] = createSignal("none");
|
|
32183
|
-
const [borderWidth, setBorderWidth] = createSignal(
|
|
32709
|
+
const [borderWidth, setBorderWidth] = createSignal(null);
|
|
32184
32710
|
const [borderColor, setBorderColor] = createSignal("");
|
|
32185
32711
|
const [sideTop, setSideTop] = createSignal(false);
|
|
32186
32712
|
const [sideRight, setSideRight] = createSignal(false);
|
|
@@ -32189,15 +32715,15 @@ function ParagraphDialog(props) {
|
|
|
32189
32715
|
createEffect(() => {
|
|
32190
32716
|
if (props.isOpen) {
|
|
32191
32717
|
setAlign(props.initial.align ?? "");
|
|
32192
|
-
setIndentLeft(props.initial.indentLeft ?? "");
|
|
32193
|
-
setIndentRight(props.initial.indentRight ?? "");
|
|
32194
|
-
setSpacingBefore(props.initial.spacingBefore ?? "");
|
|
32195
|
-
setSpacingAfter(props.initial.spacingAfter ?? "");
|
|
32196
|
-
setLineHeight(props.initial.lineHeight ?? "");
|
|
32718
|
+
setIndentLeft(parseNumber$1(props.initial.indentLeft ?? ""));
|
|
32719
|
+
setIndentRight(parseNumber$1(props.initial.indentRight ?? ""));
|
|
32720
|
+
setSpacingBefore(parseNumber$1(props.initial.spacingBefore ?? ""));
|
|
32721
|
+
setSpacingAfter(parseNumber$1(props.initial.spacingAfter ?? ""));
|
|
32722
|
+
setLineHeight(parseNumber$1(props.initial.lineHeight ?? ""));
|
|
32197
32723
|
setShading(props.initial.shading ?? "");
|
|
32198
32724
|
const initialBorderStyle = props.initial.borderStyle;
|
|
32199
32725
|
setBorderStyle(initialBorderStyle === "solid" || initialBorderStyle === "dashed" || initialBorderStyle === "dotted" ? initialBorderStyle : "none");
|
|
32200
|
-
setBorderWidth(props.initial.borderWidth ?? "");
|
|
32726
|
+
setBorderWidth(parseNumber$1(props.initial.borderWidth ?? ""));
|
|
32201
32727
|
setBorderColor(props.initial.borderColor ?? "");
|
|
32202
32728
|
setSideTop(props.initial.borderSideTop ?? false);
|
|
32203
32729
|
setSideRight(props.initial.borderSideRight ?? false);
|
|
@@ -32207,24 +32733,24 @@ function ParagraphDialog(props) {
|
|
|
32207
32733
|
const hanging = parseNumber$1(props.initial.indentHanging ?? "");
|
|
32208
32734
|
if (hanging !== null && hanging > 0) {
|
|
32209
32735
|
setSpecial("hanging");
|
|
32210
|
-
setSpecialBy(
|
|
32736
|
+
setSpecialBy(hanging);
|
|
32211
32737
|
} else if (firstLine !== null && firstLine > 0) {
|
|
32212
32738
|
setSpecial("firstLine");
|
|
32213
|
-
setSpecialBy(
|
|
32739
|
+
setSpecialBy(firstLine);
|
|
32214
32740
|
} else {
|
|
32215
32741
|
setSpecial("none");
|
|
32216
|
-
setSpecialBy(
|
|
32742
|
+
setSpecialBy(null);
|
|
32217
32743
|
}
|
|
32218
32744
|
}
|
|
32219
32745
|
});
|
|
32220
32746
|
const previewStyle = createMemo(() => {
|
|
32221
|
-
const lh =
|
|
32222
|
-
const left =
|
|
32223
|
-
const right =
|
|
32224
|
-
const firstLine = special() === "firstLine" ?
|
|
32225
|
-
const hanging = special() === "hanging" ?
|
|
32747
|
+
const lh = lineHeight();
|
|
32748
|
+
const left = indentLeft();
|
|
32749
|
+
const right = indentRight();
|
|
32750
|
+
const firstLine = special() === "firstLine" ? specialBy() : null;
|
|
32751
|
+
const hanging = special() === "hanging" ? specialBy() : null;
|
|
32226
32752
|
const textIndent = firstLine !== null ? firstLine : hanging !== null ? -hanging : null;
|
|
32227
|
-
const borderCss = borderStyle() !== "none" ? `${
|
|
32753
|
+
const borderCss = borderStyle() !== "none" ? `${borderWidth() ?? DEFAULT_BORDER_WIDTH_PT$1}pt ${borderStyle()} ${borderColor().trim() || DEFAULT_BORDER_COLOR$1}` : void 0;
|
|
32228
32754
|
return {
|
|
32229
32755
|
"text-align": align() || void 0,
|
|
32230
32756
|
"line-height": lh !== null && lh > 0 ? String(lh) : void 0,
|
|
@@ -32248,7 +32774,7 @@ function ParagraphDialog(props) {
|
|
|
32248
32774
|
left: null
|
|
32249
32775
|
};
|
|
32250
32776
|
}
|
|
32251
|
-
const width =
|
|
32777
|
+
const width = borderWidth();
|
|
32252
32778
|
const border = {
|
|
32253
32779
|
type: style2,
|
|
32254
32780
|
width: width !== null && width > 0 ? width : DEFAULT_BORDER_WIDTH_PT$1,
|
|
@@ -32262,16 +32788,16 @@ function ParagraphDialog(props) {
|
|
|
32262
32788
|
};
|
|
32263
32789
|
};
|
|
32264
32790
|
const handleApply = () => {
|
|
32265
|
-
const by =
|
|
32791
|
+
const by = specialBy();
|
|
32266
32792
|
props.onApply({
|
|
32267
32793
|
align: align() || null,
|
|
32268
|
-
indentLeft:
|
|
32269
|
-
indentRight:
|
|
32794
|
+
indentLeft: indentLeft(),
|
|
32795
|
+
indentRight: indentRight(),
|
|
32270
32796
|
indentFirstLine: special() === "firstLine" ? by : null,
|
|
32271
32797
|
indentHanging: special() === "hanging" ? by : null,
|
|
32272
|
-
spacingBefore:
|
|
32273
|
-
spacingAfter:
|
|
32274
|
-
lineHeight:
|
|
32798
|
+
spacingBefore: spacingBefore(),
|
|
32799
|
+
spacingAfter: spacingAfter(),
|
|
32800
|
+
lineHeight: lineHeight(),
|
|
32275
32801
|
shading: shading().trim() || null,
|
|
32276
32802
|
borders: resolveBorders()
|
|
32277
32803
|
}, props.initial);
|
|
@@ -32304,137 +32830,271 @@ function ParagraphDialog(props) {
|
|
|
32304
32830
|
});
|
|
32305
32831
|
},
|
|
32306
32832
|
get children() {
|
|
32307
|
-
return [(
|
|
32308
|
-
|
|
32309
|
-
|
|
32310
|
-
|
|
32311
|
-
|
|
32312
|
-
|
|
32313
|
-
|
|
32314
|
-
|
|
32315
|
-
|
|
32316
|
-
|
|
32317
|
-
|
|
32318
|
-
|
|
32319
|
-
|
|
32320
|
-
|
|
32321
|
-
|
|
32322
|
-
|
|
32323
|
-
|
|
32324
|
-
|
|
32325
|
-
|
|
32326
|
-
|
|
32327
|
-
|
|
32328
|
-
|
|
32329
|
-
|
|
32330
|
-
|
|
32331
|
-
|
|
32332
|
-
|
|
32333
|
-
|
|
32334
|
-
|
|
32335
|
-
|
|
32336
|
-
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32343
|
-
|
|
32344
|
-
|
|
32345
|
-
|
|
32346
|
-
|
|
32347
|
-
|
|
32348
|
-
|
|
32349
|
-
|
|
32350
|
-
|
|
32351
|
-
|
|
32352
|
-
|
|
32353
|
-
|
|
32354
|
-
|
|
32355
|
-
|
|
32356
|
-
|
|
32357
|
-
|
|
32358
|
-
|
|
32359
|
-
|
|
32360
|
-
|
|
32361
|
-
|
|
32362
|
-
|
|
32363
|
-
|
|
32364
|
-
|
|
32365
|
-
|
|
32366
|
-
|
|
32367
|
-
|
|
32368
|
-
|
|
32369
|
-
|
|
32370
|
-
|
|
32833
|
+
return [createComponent(FieldRow, {
|
|
32834
|
+
get children() {
|
|
32835
|
+
return createComponent(SelectField, {
|
|
32836
|
+
get label() {
|
|
32837
|
+
return t("paragraph.alignLabel");
|
|
32838
|
+
},
|
|
32839
|
+
get value() {
|
|
32840
|
+
return align();
|
|
32841
|
+
},
|
|
32842
|
+
onChange: setAlign,
|
|
32843
|
+
"data-testid": "editor-paragraph-dialog-align",
|
|
32844
|
+
get options() {
|
|
32845
|
+
return [{
|
|
32846
|
+
value: "left",
|
|
32847
|
+
label: t("paragraph.alignLeft")
|
|
32848
|
+
}, {
|
|
32849
|
+
value: "center",
|
|
32850
|
+
label: t("paragraph.alignCenter")
|
|
32851
|
+
}, {
|
|
32852
|
+
value: "right",
|
|
32853
|
+
label: t("paragraph.alignRight")
|
|
32854
|
+
}, {
|
|
32855
|
+
value: "justify",
|
|
32856
|
+
label: t("paragraph.alignJustify")
|
|
32857
|
+
}];
|
|
32858
|
+
}
|
|
32859
|
+
});
|
|
32860
|
+
}
|
|
32861
|
+
}), createComponent(FieldRow, {
|
|
32862
|
+
get children() {
|
|
32863
|
+
return [createComponent(NumberField, {
|
|
32864
|
+
get label() {
|
|
32865
|
+
return t("paragraph.indentLeftLabel");
|
|
32866
|
+
},
|
|
32867
|
+
step: "1",
|
|
32868
|
+
get value() {
|
|
32869
|
+
return indentLeft() ?? "";
|
|
32870
|
+
},
|
|
32871
|
+
onChange: setIndentLeft,
|
|
32872
|
+
"data-testid": "editor-paragraph-dialog-indent-left"
|
|
32873
|
+
}), createComponent(NumberField, {
|
|
32874
|
+
get label() {
|
|
32875
|
+
return t("paragraph.indentRightLabel");
|
|
32876
|
+
},
|
|
32877
|
+
step: "1",
|
|
32878
|
+
get value() {
|
|
32879
|
+
return indentRight() ?? "";
|
|
32880
|
+
},
|
|
32881
|
+
onChange: setIndentRight,
|
|
32882
|
+
"data-testid": "editor-paragraph-dialog-indent-right"
|
|
32883
|
+
})];
|
|
32884
|
+
}
|
|
32885
|
+
}), createComponent(FieldRow, {
|
|
32886
|
+
get children() {
|
|
32887
|
+
return [createComponent(SelectField, {
|
|
32888
|
+
get label() {
|
|
32889
|
+
return t("paragraph.specialLabel");
|
|
32890
|
+
},
|
|
32891
|
+
get value() {
|
|
32892
|
+
return special();
|
|
32893
|
+
},
|
|
32894
|
+
onChange: (value) => {
|
|
32895
|
+
const next = value;
|
|
32896
|
+
setSpecial(next);
|
|
32897
|
+
if (next === "none") setSpecialBy(null);
|
|
32898
|
+
},
|
|
32899
|
+
"data-testid": "editor-paragraph-dialog-special",
|
|
32900
|
+
get options() {
|
|
32901
|
+
return [{
|
|
32902
|
+
value: "none",
|
|
32903
|
+
label: t("paragraph.specialNone")
|
|
32904
|
+
}, {
|
|
32905
|
+
value: "firstLine",
|
|
32906
|
+
label: t("paragraph.specialFirstLine")
|
|
32907
|
+
}, {
|
|
32908
|
+
value: "hanging",
|
|
32909
|
+
label: t("paragraph.specialHanging")
|
|
32910
|
+
}];
|
|
32911
|
+
}
|
|
32912
|
+
}), createComponent(NumberField, {
|
|
32913
|
+
get label() {
|
|
32914
|
+
return t("paragraph.specialByLabel");
|
|
32915
|
+
},
|
|
32916
|
+
min: "0",
|
|
32917
|
+
step: "1",
|
|
32918
|
+
get disabled() {
|
|
32919
|
+
return special() === "none";
|
|
32920
|
+
},
|
|
32921
|
+
get value() {
|
|
32922
|
+
return specialBy() ?? "";
|
|
32923
|
+
},
|
|
32924
|
+
onChange: setSpecialBy,
|
|
32925
|
+
"data-testid": "editor-paragraph-dialog-special-by"
|
|
32926
|
+
})];
|
|
32927
|
+
}
|
|
32928
|
+
}), createComponent(FieldRow, {
|
|
32929
|
+
get children() {
|
|
32930
|
+
return [createComponent(NumberField, {
|
|
32931
|
+
get label() {
|
|
32932
|
+
return t("paragraph.spacingBeforeLabel");
|
|
32933
|
+
},
|
|
32934
|
+
min: "0",
|
|
32935
|
+
step: "1",
|
|
32936
|
+
get value() {
|
|
32937
|
+
return spacingBefore() ?? "";
|
|
32938
|
+
},
|
|
32939
|
+
onChange: setSpacingBefore,
|
|
32940
|
+
"data-testid": "editor-paragraph-dialog-spacing-before"
|
|
32941
|
+
}), createComponent(NumberField, {
|
|
32942
|
+
get label() {
|
|
32943
|
+
return t("paragraph.spacingAfterLabel");
|
|
32944
|
+
},
|
|
32945
|
+
min: "0",
|
|
32946
|
+
step: "1",
|
|
32947
|
+
get value() {
|
|
32948
|
+
return spacingAfter() ?? "";
|
|
32949
|
+
},
|
|
32950
|
+
onChange: setSpacingAfter,
|
|
32951
|
+
"data-testid": "editor-paragraph-dialog-spacing-after"
|
|
32952
|
+
}), createComponent(NumberField, {
|
|
32953
|
+
get label() {
|
|
32954
|
+
return t("paragraph.lineSpacingLabel");
|
|
32955
|
+
},
|
|
32956
|
+
min: "0.5",
|
|
32957
|
+
step: "0.05",
|
|
32958
|
+
get value() {
|
|
32959
|
+
return lineHeight() ?? "";
|
|
32960
|
+
},
|
|
32961
|
+
onChange: setLineHeight,
|
|
32962
|
+
"data-testid": "editor-paragraph-dialog-line-height"
|
|
32963
|
+
})];
|
|
32964
|
+
}
|
|
32965
|
+
}), (() => {
|
|
32966
|
+
var _el$ = _tmpl$$a(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
|
|
32967
|
+
insert(_el$, createComponent(SelectField, {
|
|
32968
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
32969
|
+
get label() {
|
|
32970
|
+
return t("paragraph.borderStyleLabel");
|
|
32971
|
+
},
|
|
32972
|
+
get value() {
|
|
32973
|
+
return borderStyle();
|
|
32974
|
+
},
|
|
32975
|
+
onChange: (value) => {
|
|
32976
|
+
const next = value;
|
|
32977
|
+
setBorderStyle(next);
|
|
32978
|
+
if (next === "none") {
|
|
32979
|
+
setSideTop(false);
|
|
32980
|
+
setSideRight(false);
|
|
32981
|
+
setSideBottom(false);
|
|
32982
|
+
setSideLeft(false);
|
|
32983
|
+
} else if (!sideTop() && !sideRight() && !sideBottom() && !sideLeft()) {
|
|
32984
|
+
setSideTop(true);
|
|
32985
|
+
setSideRight(true);
|
|
32986
|
+
setSideBottom(true);
|
|
32987
|
+
setSideLeft(true);
|
|
32988
|
+
}
|
|
32989
|
+
},
|
|
32990
|
+
"data-testid": "editor-paragraph-dialog-border-style",
|
|
32991
|
+
get options() {
|
|
32992
|
+
return [{
|
|
32993
|
+
value: "none",
|
|
32994
|
+
label: t("paragraph.borderNone")
|
|
32995
|
+
}, {
|
|
32996
|
+
value: "solid",
|
|
32997
|
+
label: t("paragraph.borderSolid")
|
|
32998
|
+
}, {
|
|
32999
|
+
value: "dashed",
|
|
33000
|
+
label: t("paragraph.borderDashed")
|
|
33001
|
+
}, {
|
|
33002
|
+
value: "dotted",
|
|
33003
|
+
label: t("paragraph.borderDotted")
|
|
33004
|
+
}];
|
|
32371
33005
|
}
|
|
32372
|
-
});
|
|
32373
|
-
insert(_el
|
|
32374
|
-
|
|
32375
|
-
|
|
32376
|
-
|
|
32377
|
-
|
|
32378
|
-
|
|
32379
|
-
|
|
32380
|
-
|
|
32381
|
-
|
|
32382
|
-
|
|
32383
|
-
|
|
32384
|
-
|
|
32385
|
-
|
|
32386
|
-
|
|
32387
|
-
|
|
32388
|
-
},
|
|
32389
|
-
|
|
32390
|
-
|
|
32391
|
-
|
|
32392
|
-
|
|
32393
|
-
createRenderEffect(() => _el$
|
|
32394
|
-
createRenderEffect(() => _el$
|
|
32395
|
-
createRenderEffect(() => _el$
|
|
32396
|
-
return _el
|
|
33006
|
+
}), _el$2);
|
|
33007
|
+
insert(_el$, createComponent(NumberField, {
|
|
33008
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33009
|
+
get label() {
|
|
33010
|
+
return t("paragraph.borderWidthLabel");
|
|
33011
|
+
},
|
|
33012
|
+
min: "0",
|
|
33013
|
+
step: "0.25",
|
|
33014
|
+
get disabled() {
|
|
33015
|
+
return borderStyle() === "none";
|
|
33016
|
+
},
|
|
33017
|
+
get value() {
|
|
33018
|
+
return borderWidth() ?? "";
|
|
33019
|
+
},
|
|
33020
|
+
onChange: setBorderWidth,
|
|
33021
|
+
"data-testid": "editor-paragraph-dialog-border-width"
|
|
33022
|
+
}), _el$2);
|
|
33023
|
+
insert(_el$3, () => t("paragraph.borderColorLabel"));
|
|
33024
|
+
_el$4.$$input = (e) => setBorderColor(e.currentTarget.value);
|
|
33025
|
+
insert(_el$6, () => t("paragraph.shadingLabel"));
|
|
33026
|
+
_el$7.$$input = (e) => setShading(e.currentTarget.value);
|
|
33027
|
+
createRenderEffect(() => _el$4.disabled = borderStyle() === "none");
|
|
33028
|
+
createRenderEffect(() => _el$4.value = borderColor() || DEFAULT_BORDER_COLOR$1);
|
|
33029
|
+
createRenderEffect(() => _el$7.value = shading() || "#ffffff");
|
|
33030
|
+
return _el$;
|
|
32397
33031
|
})(), (() => {
|
|
32398
|
-
var _el$
|
|
32399
|
-
insert(_el$
|
|
32400
|
-
_el$
|
|
32401
|
-
|
|
32402
|
-
|
|
32403
|
-
|
|
32404
|
-
|
|
32405
|
-
|
|
32406
|
-
|
|
32407
|
-
|
|
32408
|
-
|
|
32409
|
-
|
|
32410
|
-
|
|
32411
|
-
|
|
32412
|
-
|
|
32413
|
-
|
|
32414
|
-
|
|
32415
|
-
|
|
32416
|
-
|
|
32417
|
-
|
|
32418
|
-
|
|
32419
|
-
|
|
32420
|
-
|
|
32421
|
-
|
|
32422
|
-
|
|
32423
|
-
|
|
32424
|
-
|
|
32425
|
-
|
|
33032
|
+
var _el$8 = _tmpl$2$2(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling;
|
|
33033
|
+
insert(_el$0, () => t("paragraph.borderSidesLabel"));
|
|
33034
|
+
insert(_el$1, createComponent(Checkbox, {
|
|
33035
|
+
get label() {
|
|
33036
|
+
return t("paragraph.borderSideTop");
|
|
33037
|
+
},
|
|
33038
|
+
get disabled() {
|
|
33039
|
+
return borderStyle() === "none";
|
|
33040
|
+
},
|
|
33041
|
+
get checked() {
|
|
33042
|
+
return sideTop();
|
|
33043
|
+
},
|
|
33044
|
+
onChange: setSideTop,
|
|
33045
|
+
"data-testid": "editor-paragraph-dialog-border-side-top"
|
|
33046
|
+
}), null);
|
|
33047
|
+
insert(_el$1, createComponent(Checkbox, {
|
|
33048
|
+
get label() {
|
|
33049
|
+
return t("paragraph.borderSideRight");
|
|
33050
|
+
},
|
|
33051
|
+
get disabled() {
|
|
33052
|
+
return borderStyle() === "none";
|
|
33053
|
+
},
|
|
33054
|
+
get checked() {
|
|
33055
|
+
return sideRight();
|
|
33056
|
+
},
|
|
33057
|
+
onChange: setSideRight,
|
|
33058
|
+
"data-testid": "editor-paragraph-dialog-border-side-right"
|
|
33059
|
+
}), null);
|
|
33060
|
+
insert(_el$1, createComponent(Checkbox, {
|
|
33061
|
+
get label() {
|
|
33062
|
+
return t("paragraph.borderSideBottom");
|
|
33063
|
+
},
|
|
33064
|
+
get disabled() {
|
|
33065
|
+
return borderStyle() === "none";
|
|
33066
|
+
},
|
|
33067
|
+
get checked() {
|
|
33068
|
+
return sideBottom();
|
|
33069
|
+
},
|
|
33070
|
+
onChange: setSideBottom,
|
|
33071
|
+
"data-testid": "editor-paragraph-dialog-border-side-bottom"
|
|
33072
|
+
}), null);
|
|
33073
|
+
insert(_el$1, createComponent(Checkbox, {
|
|
33074
|
+
get label() {
|
|
33075
|
+
return t("paragraph.borderSideLeft");
|
|
33076
|
+
},
|
|
33077
|
+
get disabled() {
|
|
33078
|
+
return borderStyle() === "none";
|
|
33079
|
+
},
|
|
33080
|
+
get checked() {
|
|
33081
|
+
return sideLeft();
|
|
33082
|
+
},
|
|
33083
|
+
onChange: setSideLeft,
|
|
33084
|
+
"data-testid": "editor-paragraph-dialog-border-side-left"
|
|
33085
|
+
}), null);
|
|
33086
|
+
return _el$8;
|
|
32426
33087
|
})(), (() => {
|
|
32427
|
-
var _el$
|
|
32428
|
-
insert(_el$
|
|
32429
|
-
insert(_el$
|
|
32430
|
-
createRenderEffect((_$p) => style(_el$
|
|
32431
|
-
return _el$
|
|
33088
|
+
var _el$10 = _tmpl$3$1(), _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling;
|
|
33089
|
+
insert(_el$11, () => t("paragraph.preview"));
|
|
33090
|
+
insert(_el$12, () => t("paragraph.previewText"));
|
|
33091
|
+
createRenderEffect((_$p) => style(_el$12, previewStyle(), _$p));
|
|
33092
|
+
return _el$10;
|
|
32432
33093
|
})()];
|
|
32433
33094
|
}
|
|
32434
33095
|
});
|
|
32435
33096
|
}
|
|
32436
33097
|
delegateEvents(["input"]);
|
|
32437
|
-
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>`);
|
|
32438
33098
|
const DEFAULT_BORDER_WIDTH_PT = 0.5;
|
|
32439
33099
|
const DEFAULT_BORDER_COLOR = "#000000";
|
|
32440
33100
|
function parseNumber(value) {
|
|
@@ -32456,241 +33116,8 @@ function resolveBorder(style2, widthValue, colorValue) {
|
|
|
32456
33116
|
color: colorValue.trim() || DEFAULT_BORDER_COLOR
|
|
32457
33117
|
};
|
|
32458
33118
|
}
|
|
32459
|
-
function
|
|
32460
|
-
return
|
|
32461
|
-
var _el$ = _tmpl$$5(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
32462
|
-
insert(_el$2, label);
|
|
32463
|
-
_el$3.$$input = (e) => setter(e.currentTarget.value);
|
|
32464
|
-
setAttribute(_el$3, "min", allowNegative ? void 0 : "0");
|
|
32465
|
-
_el$3.disabled = disabled;
|
|
32466
|
-
setAttribute(_el$3, "data-testid", testId);
|
|
32467
|
-
createRenderEffect(() => _el$3.value = value());
|
|
32468
|
-
return _el$;
|
|
32469
|
-
})();
|
|
32470
|
-
}
|
|
32471
|
-
function checkbox(label, checked, setter, testId, disabled = false) {
|
|
32472
|
-
return (() => {
|
|
32473
|
-
var _el$4 = _tmpl$2$1(), _el$5 = _el$4.firstChild;
|
|
32474
|
-
_el$5.addEventListener("change", (e) => setter(e.currentTarget.checked));
|
|
32475
|
-
_el$5.disabled = disabled;
|
|
32476
|
-
setAttribute(_el$5, "data-testid", testId);
|
|
32477
|
-
insert(_el$4, label, null);
|
|
32478
|
-
createRenderEffect(() => _el$5.checked = checked());
|
|
32479
|
-
return _el$4;
|
|
32480
|
-
})();
|
|
32481
|
-
}
|
|
32482
|
-
function TableTabPanel(p) {
|
|
32483
|
-
const t = useI18n();
|
|
32484
|
-
return (() => {
|
|
32485
|
-
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;
|
|
32486
|
-
insert(_el$8, () => t("table.sizeSection"));
|
|
32487
|
-
insert(_el$9, () => numericInput(t("table.preferredWidth"), () => p.form.tableWidth, (v) => p.set("tableWidth", v), "editor-table-properties-table-width"), _el$0);
|
|
32488
|
-
insert(_el$1, () => t("table.measureIn"));
|
|
32489
|
-
_el$10.addEventListener("change", (e) => p.set("tableWidthUnit", e.currentTarget.value));
|
|
32490
|
-
insert(_el$11, () => t("table.points"));
|
|
32491
|
-
insert(_el$12, () => t("table.percent"));
|
|
32492
|
-
insert(_el$14, () => t("table.alignmentSection"));
|
|
32493
|
-
insert(_el$15, () => ["left", "center", "right"].map((align) => (() => {
|
|
32494
|
-
var _el$43 = _tmpl$7(), _el$44 = _el$43.firstChild;
|
|
32495
|
-
_el$44.addEventListener("change", () => p.set("tableAlign", align));
|
|
32496
|
-
setAttribute(_el$44, "data-testid", `editor-table-properties-align-${align}`);
|
|
32497
|
-
insert(_el$43, () => t(`table.align${align[0].toUpperCase()}${align.slice(1)}`), null);
|
|
32498
|
-
createRenderEffect(() => _el$44.checked = p.form.tableAlign === align);
|
|
32499
|
-
return _el$43;
|
|
32500
|
-
})()));
|
|
32501
|
-
insert(_el$16, () => numericInput(t("table.indentFromLeft"), () => p.form.tableIndentLeft, (v) => p.set("tableIndentLeft", v), "editor-table-properties-indent-left"));
|
|
32502
|
-
insert(_el$18, () => t("table.textWrappingSection"));
|
|
32503
|
-
insert(_el$19, () => checkbox(t("table.wrapNone"), () => p.form.tableWrapping === "none", () => p.set("tableWrapping", "none"), "editor-table-properties-wrap-none"), null);
|
|
32504
|
-
insert(_el$19, () => checkbox(t("table.wrapAround"), () => p.form.tableWrapping === "around", () => p.set("tableWrapping", "around"), "editor-table-properties-wrap-around"), null);
|
|
32505
|
-
insert(_el$17, createComponent(Show, {
|
|
32506
|
-
get when() {
|
|
32507
|
-
return p.form.tableWrapping === "around";
|
|
32508
|
-
},
|
|
32509
|
-
get children() {
|
|
32510
|
-
return [(() => {
|
|
32511
|
-
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;
|
|
32512
|
-
insert(_el$22, () => t("table.horizontalAnchor"));
|
|
32513
|
-
_el$23.addEventListener("change", (e) => p.set("floatingHorizontalAnchor", e.currentTarget.value));
|
|
32514
|
-
insert(_el$24, () => t("table.anchorMargin"));
|
|
32515
|
-
insert(_el$25, () => t("table.anchorPage"));
|
|
32516
|
-
insert(_el$26, () => t("table.anchorText"));
|
|
32517
|
-
insert(_el$28, () => t("table.verticalAnchor"));
|
|
32518
|
-
_el$29.addEventListener("change", (e) => p.set("floatingVerticalAnchor", e.currentTarget.value));
|
|
32519
|
-
insert(_el$30, () => t("table.anchorMargin"));
|
|
32520
|
-
insert(_el$31, () => t("table.anchorPage"));
|
|
32521
|
-
insert(_el$32, () => t("table.anchorText"));
|
|
32522
|
-
createRenderEffect(() => _el$23.value = p.form.floatingHorizontalAnchor);
|
|
32523
|
-
createRenderEffect(() => _el$29.value = p.form.floatingVerticalAnchor);
|
|
32524
|
-
return _el$20;
|
|
32525
|
-
})(), (() => {
|
|
32526
|
-
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;
|
|
32527
|
-
insert(_el$33, () => numericInput(t("table.positionX"), () => p.form.floatingX, (v) => p.set("floatingX", v), "editor-table-properties-floating-x", Boolean(p.form.floatingXAlign), true), _el$34);
|
|
32528
|
-
insert(_el$33, () => numericInput(t("table.positionY"), () => p.form.floatingY, (v) => p.set("floatingY", v), "editor-table-properties-floating-y", Boolean(p.form.floatingYAlign), true), _el$34);
|
|
32529
|
-
insert(_el$35, () => t("table.horizontalAlignment"));
|
|
32530
|
-
_el$36.addEventListener("change", (e) => p.set("floatingXAlign", e.currentTarget.value));
|
|
32531
|
-
insert(_el$37, () => t("table.explicitOffset"));
|
|
32532
|
-
insert(_el$36, () => ["left", "center", "right", "inside", "outside"].map((value) => (() => {
|
|
32533
|
-
var _el$45 = _tmpl$8();
|
|
32534
|
-
_el$45.value = value;
|
|
32535
|
-
insert(_el$45, value);
|
|
32536
|
-
return _el$45;
|
|
32537
|
-
})()), null);
|
|
32538
|
-
insert(_el$39, () => t("table.verticalAlignment"));
|
|
32539
|
-
_el$40.addEventListener("change", (e) => p.set("floatingYAlign", e.currentTarget.value));
|
|
32540
|
-
insert(_el$41, () => t("table.explicitOffset"));
|
|
32541
|
-
insert(_el$40, () => ["top", "center", "bottom", "inside", "outside"].map((value) => (() => {
|
|
32542
|
-
var _el$46 = _tmpl$8();
|
|
32543
|
-
_el$46.value = value;
|
|
32544
|
-
insert(_el$46, value);
|
|
32545
|
-
return _el$46;
|
|
32546
|
-
})()), null);
|
|
32547
|
-
createRenderEffect(() => _el$36.value = p.form.floatingXAlign);
|
|
32548
|
-
createRenderEffect(() => _el$40.value = p.form.floatingYAlign);
|
|
32549
|
-
return _el$33;
|
|
32550
|
-
})(), (() => {
|
|
32551
|
-
var _el$42 = _tmpl$5$1();
|
|
32552
|
-
insert(_el$42, () => numericInput(t("table.distanceTop"), () => p.form.floatingDistanceTop, (v) => p.set("floatingDistanceTop", v), "editor-table-properties-floating-distance-top"), null);
|
|
32553
|
-
insert(_el$42, () => numericInput(t("table.distanceRight"), () => p.form.floatingDistanceRight, (v) => p.set("floatingDistanceRight", v), "editor-table-properties-floating-distance-right"), null);
|
|
32554
|
-
insert(_el$42, () => numericInput(t("table.distanceBottom"), () => p.form.floatingDistanceBottom, (v) => p.set("floatingDistanceBottom", v), "editor-table-properties-floating-distance-bottom"), null);
|
|
32555
|
-
insert(_el$42, () => numericInput(t("table.distanceLeft"), () => p.form.floatingDistanceLeft, (v) => p.set("floatingDistanceLeft", v), "editor-table-properties-floating-distance-left"), null);
|
|
32556
|
-
return _el$42;
|
|
32557
|
-
})(), memo(() => checkbox(t("table.allowOverlap"), () => p.form.floatingOverlap === "overlap", (value) => p.set("floatingOverlap", value ? "overlap" : "never"), "editor-table-properties-floating-overlap"))];
|
|
32558
|
-
}
|
|
32559
|
-
}), null);
|
|
32560
|
-
createRenderEffect(() => _el$10.value = p.form.tableWidthUnit);
|
|
32561
|
-
return _el$6;
|
|
32562
|
-
})();
|
|
32563
|
-
}
|
|
32564
|
-
function RowTabPanel(p) {
|
|
32565
|
-
const t = useI18n();
|
|
32566
|
-
return (() => {
|
|
32567
|
-
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;
|
|
32568
|
-
insert(_el$48, () => numericInput(t("table.rowHeight"), () => p.form.rowHeight, (v) => p.set("rowHeight", v), "editor-table-properties-row-height"), _el$49);
|
|
32569
|
-
insert(_el$50, () => t("table.rowHeightRule"));
|
|
32570
|
-
_el$51.addEventListener("change", (e) => p.set("rowHeightRule", e.currentTarget.value));
|
|
32571
|
-
insert(_el$52, () => t("table.rowAuto"));
|
|
32572
|
-
insert(_el$53, () => t("table.rowAtLeast"));
|
|
32573
|
-
insert(_el$54, () => t("table.rowExactly"));
|
|
32574
|
-
insert(_el$55, () => checkbox(t("table.repeatHeader"), () => p.form.repeatHeader, (v) => p.set("repeatHeader", v), "editor-table-properties-repeat-header"), null);
|
|
32575
|
-
insert(_el$55, () => checkbox(t("table.allowBreakAcrossPages"), () => p.form.allowBreakAcrossPages, (v) => p.set("allowBreakAcrossPages", v), "editor-table-properties-allow-break"), null);
|
|
32576
|
-
insert(_el$55, () => checkbox(t("table.hiddenRow"), () => p.form.hiddenRow, (v) => p.set("hiddenRow", v), "editor-table-properties-hidden-row"), null);
|
|
32577
|
-
createRenderEffect(() => _el$51.value = p.form.rowHeightRule);
|
|
32578
|
-
return _el$47;
|
|
32579
|
-
})();
|
|
32580
|
-
}
|
|
32581
|
-
function ColumnTabPanel(p) {
|
|
32582
|
-
const t = useI18n();
|
|
32583
|
-
return (() => {
|
|
32584
|
-
var _el$56 = _tmpl$0(), _el$57 = _el$56.firstChild;
|
|
32585
|
-
insert(_el$57, () => numericInput(t("table.columnWidth"), () => p.form.columnWidth, (v) => p.set("columnWidth", v), "editor-table-properties-column-width"));
|
|
32586
|
-
return _el$56;
|
|
32587
|
-
})();
|
|
32588
|
-
}
|
|
32589
|
-
function CellTabPanel(p) {
|
|
32590
|
-
const t = useI18n();
|
|
32591
|
-
const borderPreview = createMemo(() => {
|
|
32592
|
-
const border = resolveBorder(p.form.borderStyle, p.form.borderWidth, p.form.borderColor);
|
|
32593
|
-
const css = border ? `${border.width}pt ${border.type} ${border.color}` : void 0;
|
|
32594
|
-
return {
|
|
32595
|
-
"background-color": p.form.shading.trim() || void 0,
|
|
32596
|
-
"border-top": css && p.form.borderTop ? css : "1px solid #dadce0",
|
|
32597
|
-
"border-right": css && p.form.borderRight ? css : "1px solid #dadce0",
|
|
32598
|
-
"border-bottom": css && p.form.borderBottom ? css : "1px solid #dadce0",
|
|
32599
|
-
"border-left": css && p.form.borderLeft ? css : "1px solid #dadce0"
|
|
32600
|
-
};
|
|
32601
|
-
});
|
|
32602
|
-
return (() => {
|
|
32603
|
-
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;
|
|
32604
|
-
insert(_el$59, () => numericInput(t("table.cellWidth"), () => p.form.cellWidth, (v) => p.set("cellWidth", v), "editor-table-properties-cell-width"), _el$60);
|
|
32605
|
-
insert(_el$61, () => t("table.verticalAlignment"));
|
|
32606
|
-
_el$62.addEventListener("change", (e) => p.set("cellVerticalAlign", e.currentTarget.value));
|
|
32607
|
-
insert(_el$63, () => t("table.inherit"));
|
|
32608
|
-
insert(_el$64, () => t("table.valignTop"));
|
|
32609
|
-
insert(_el$65, () => t("table.valignMiddle"));
|
|
32610
|
-
insert(_el$66, () => t("table.valignBottom"));
|
|
32611
|
-
insert(_el$68, () => t("table.textDirection"));
|
|
32612
|
-
_el$69.addEventListener("change", (e) => p.set("cellTextDirection", e.currentTarget.value));
|
|
32613
|
-
insert(_el$70, () => t("table.inherit"));
|
|
32614
|
-
insert(_el$72, () => t("table.options"));
|
|
32615
|
-
insert(_el$73, () => checkbox(t("table.noWrap"), () => p.form.cellNoWrap, (v) => p.set("cellNoWrap", v), "editor-table-properties-cell-nowrap"), null);
|
|
32616
|
-
insert(_el$73, () => checkbox(t("table.fitText"), () => p.form.cellFitText, (v) => p.set("cellFitText", v), "editor-table-properties-cell-fit-text"), null);
|
|
32617
|
-
insert(_el$73, () => checkbox(t("table.hideMark"), () => p.form.cellHideMark, (v) => p.set("cellHideMark", v), "editor-table-properties-cell-hide-mark"), null);
|
|
32618
|
-
insert(_el$75, () => t("table.cellMargins"));
|
|
32619
|
-
insert(_el$76, () => numericInput(t("paragraph.borderSideTop"), () => p.form.marginTop, (v) => p.set("marginTop", v), "editor-table-properties-margin-top"), null);
|
|
32620
|
-
insert(_el$76, () => numericInput(t("paragraph.borderSideRight"), () => p.form.marginRight, (v) => p.set("marginRight", v), "editor-table-properties-margin-right"), null);
|
|
32621
|
-
insert(_el$76, () => numericInput(t("paragraph.borderSideBottom"), () => p.form.marginBottom, (v) => p.set("marginBottom", v), "editor-table-properties-margin-bottom"), null);
|
|
32622
|
-
insert(_el$76, () => numericInput(t("paragraph.borderSideLeft"), () => p.form.marginLeft, (v) => p.set("marginLeft", v), "editor-table-properties-margin-left"), null);
|
|
32623
|
-
insert(_el$78, () => t("paragraph.bordersSection"));
|
|
32624
|
-
insert(_el$81, () => t("paragraph.borderStyleLabel"));
|
|
32625
|
-
_el$82.addEventListener("change", (e) => {
|
|
32626
|
-
const next = e.currentTarget.value;
|
|
32627
|
-
p.set("borderStyle", next);
|
|
32628
|
-
if (next === "none") {
|
|
32629
|
-
p.set("borderTop", false);
|
|
32630
|
-
p.set("borderRight", false);
|
|
32631
|
-
p.set("borderBottom", false);
|
|
32632
|
-
p.set("borderLeft", false);
|
|
32633
|
-
p.set("borderStart", false);
|
|
32634
|
-
p.set("borderEnd", false);
|
|
32635
|
-
p.set("borderTlBr", false);
|
|
32636
|
-
p.set("borderTrBl", false);
|
|
32637
|
-
} else if (!p.form.borderTop && !p.form.borderRight && !p.form.borderBottom && !p.form.borderLeft) {
|
|
32638
|
-
p.set("borderTop", true);
|
|
32639
|
-
p.set("borderRight", true);
|
|
32640
|
-
p.set("borderBottom", true);
|
|
32641
|
-
p.set("borderLeft", true);
|
|
32642
|
-
}
|
|
32643
|
-
});
|
|
32644
|
-
insert(_el$83, () => t("paragraph.borderNone"));
|
|
32645
|
-
insert(_el$84, () => t("paragraph.borderSolid"));
|
|
32646
|
-
insert(_el$85, () => t("paragraph.borderDashed"));
|
|
32647
|
-
insert(_el$86, () => t("paragraph.borderDotted"));
|
|
32648
|
-
insert(_el$79, () => numericInput(t("paragraph.borderWidthLabel"), () => p.form.borderWidth, (v) => p.set("borderWidth", v), "editor-table-properties-border-width", p.form.borderStyle === "none"), _el$87);
|
|
32649
|
-
insert(_el$88, () => t("paragraph.borderColorLabel"));
|
|
32650
|
-
_el$89.$$input = (e) => p.set("borderColor", e.currentTarget.value);
|
|
32651
|
-
insert(_el$91, () => t("paragraph.shadingLabel"));
|
|
32652
|
-
_el$92.$$input = (e) => p.set("shading", e.currentTarget.value);
|
|
32653
|
-
insert(_el$93, () => checkbox(t("paragraph.borderSideTop"), () => p.form.borderTop, (v) => p.set("borderTop", v), "editor-table-properties-border-top", p.form.borderStyle === "none"), null);
|
|
32654
|
-
insert(_el$93, () => checkbox(t("paragraph.borderSideRight"), () => p.form.borderRight, (v) => p.set("borderRight", v), "editor-table-properties-border-right", p.form.borderStyle === "none"), null);
|
|
32655
|
-
insert(_el$93, () => checkbox(t("paragraph.borderSideBottom"), () => p.form.borderBottom, (v) => p.set("borderBottom", v), "editor-table-properties-border-bottom", p.form.borderStyle === "none"), null);
|
|
32656
|
-
insert(_el$93, () => checkbox(t("paragraph.borderSideLeft"), () => p.form.borderLeft, (v) => p.set("borderLeft", v), "editor-table-properties-border-left", p.form.borderStyle === "none"), null);
|
|
32657
|
-
insert(_el$93, () => checkbox(t("table.borderStart"), () => p.form.borderStart, (v) => p.set("borderStart", v), "editor-table-properties-border-start", p.form.borderStyle === "none"), null);
|
|
32658
|
-
insert(_el$93, () => checkbox(t("table.borderEnd"), () => p.form.borderEnd, (v) => p.set("borderEnd", v), "editor-table-properties-border-end", p.form.borderStyle === "none"), null);
|
|
32659
|
-
insert(_el$93, () => checkbox(t("table.borderTlBr"), () => p.form.borderTlBr, (v) => p.set("borderTlBr", v), "editor-table-properties-border-tlbr", p.form.borderStyle === "none"), null);
|
|
32660
|
-
insert(_el$93, () => checkbox(t("table.borderTrBl"), () => p.form.borderTrBl, (v) => p.set("borderTrBl", v), "editor-table-properties-border-trbl", p.form.borderStyle === "none"), null);
|
|
32661
|
-
createRenderEffect((_p$) => {
|
|
32662
|
-
var _v$ = p.form.borderStyle === "none", _v$2 = borderPreview();
|
|
32663
|
-
_v$ !== _p$.e && (_el$89.disabled = _p$.e = _v$);
|
|
32664
|
-
_p$.t = style(_el$94, _v$2, _p$.t);
|
|
32665
|
-
return _p$;
|
|
32666
|
-
}, {
|
|
32667
|
-
e: void 0,
|
|
32668
|
-
t: void 0
|
|
32669
|
-
});
|
|
32670
|
-
createRenderEffect(() => _el$62.value = p.form.cellVerticalAlign);
|
|
32671
|
-
createRenderEffect(() => _el$69.value = p.form.cellTextDirection);
|
|
32672
|
-
createRenderEffect(() => _el$82.value = p.form.borderStyle);
|
|
32673
|
-
createRenderEffect(() => _el$89.value = p.form.borderColor || DEFAULT_BORDER_COLOR);
|
|
32674
|
-
createRenderEffect(() => _el$92.value = p.form.shading || "#ffffff");
|
|
32675
|
-
return _el$58;
|
|
32676
|
-
})();
|
|
32677
|
-
}
|
|
32678
|
-
function AltTextTabPanel(p) {
|
|
32679
|
-
const t = useI18n();
|
|
32680
|
-
return (() => {
|
|
32681
|
-
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;
|
|
32682
|
-
insert(_el$97, () => t("table.altTitle"));
|
|
32683
|
-
_el$98.$$input = (e) => p.set("altTitle", e.currentTarget.value);
|
|
32684
|
-
insert(_el$100, () => t("table.altDescription"));
|
|
32685
|
-
_el$101.$$input = (e) => p.set("altDescription", e.currentTarget.value);
|
|
32686
|
-
createRenderEffect(() => _el$98.value = p.form.altTitle);
|
|
32687
|
-
createRenderEffect(() => _el$101.value = p.form.altDescription);
|
|
32688
|
-
return _el$95;
|
|
32689
|
-
})();
|
|
32690
|
-
}
|
|
32691
|
-
function TablePropertiesDialog(props) {
|
|
32692
|
-
const t = useI18n();
|
|
32693
|
-
const [form, setForm] = createStore({
|
|
33119
|
+
function createDefaultFormState() {
|
|
33120
|
+
return {
|
|
32694
33121
|
activeTab: "table",
|
|
32695
33122
|
tableWidth: "",
|
|
32696
33123
|
tableWidthUnit: "points",
|
|
@@ -32738,118 +33165,718 @@ function TablePropertiesDialog(props) {
|
|
|
32738
33165
|
shading: "",
|
|
32739
33166
|
altTitle: "",
|
|
32740
33167
|
altDescription: ""
|
|
32741
|
-
}
|
|
33168
|
+
};
|
|
33169
|
+
}
|
|
33170
|
+
function formStateFromInitial(initial) {
|
|
33171
|
+
return {
|
|
33172
|
+
activeTab: initial.activeTab ?? "table",
|
|
33173
|
+
tableWidth: initial.tableWidth,
|
|
33174
|
+
tableWidthUnit: initial.tableWidthUnit,
|
|
33175
|
+
tableAlign: initial.tableAlign,
|
|
33176
|
+
tableIndentLeft: initial.tableIndentLeft,
|
|
33177
|
+
tableWrapping: initial.tableWrapping,
|
|
33178
|
+
floatingHorizontalAnchor: initial.floatingHorizontalAnchor,
|
|
33179
|
+
floatingVerticalAnchor: initial.floatingVerticalAnchor,
|
|
33180
|
+
floatingX: initial.floatingX,
|
|
33181
|
+
floatingY: initial.floatingY,
|
|
33182
|
+
floatingXAlign: initial.floatingXAlign,
|
|
33183
|
+
floatingYAlign: initial.floatingYAlign,
|
|
33184
|
+
floatingDistanceTop: initial.floatingDistanceTop,
|
|
33185
|
+
floatingDistanceRight: initial.floatingDistanceRight,
|
|
33186
|
+
floatingDistanceBottom: initial.floatingDistanceBottom,
|
|
33187
|
+
floatingDistanceLeft: initial.floatingDistanceLeft,
|
|
33188
|
+
floatingOverlap: initial.floatingOverlap,
|
|
33189
|
+
rowHeight: initial.rowHeight,
|
|
33190
|
+
rowHeightRule: initial.rowHeightRule,
|
|
33191
|
+
repeatHeader: initial.repeatHeader,
|
|
33192
|
+
allowBreakAcrossPages: initial.allowBreakAcrossPages,
|
|
33193
|
+
hiddenRow: initial.hiddenRow,
|
|
33194
|
+
columnWidth: initial.columnWidth,
|
|
33195
|
+
cellWidth: initial.cellWidth,
|
|
33196
|
+
cellVerticalAlign: initial.cellVerticalAlign,
|
|
33197
|
+
cellTextDirection: initial.cellTextDirection,
|
|
33198
|
+
cellNoWrap: initial.cellNoWrap,
|
|
33199
|
+
cellFitText: initial.cellFitText,
|
|
33200
|
+
cellHideMark: initial.cellHideMark,
|
|
33201
|
+
marginTop: initial.marginTop,
|
|
33202
|
+
marginRight: initial.marginRight,
|
|
33203
|
+
marginBottom: initial.marginBottom,
|
|
33204
|
+
marginLeft: initial.marginLeft,
|
|
33205
|
+
borderStyle: initial.borderStyle,
|
|
33206
|
+
borderWidth: initial.borderWidth,
|
|
33207
|
+
borderColor: initial.borderColor,
|
|
33208
|
+
borderTop: initial.borderTop,
|
|
33209
|
+
borderRight: initial.borderRight,
|
|
33210
|
+
borderBottom: initial.borderBottom,
|
|
33211
|
+
borderLeft: initial.borderLeft,
|
|
33212
|
+
borderStart: initial.borderStart,
|
|
33213
|
+
borderEnd: initial.borderEnd,
|
|
33214
|
+
borderTlBr: initial.borderTopLeftToBottomRight,
|
|
33215
|
+
borderTrBl: initial.borderTopRightToBottomLeft,
|
|
33216
|
+
shading: initial.shading,
|
|
33217
|
+
altTitle: initial.altTitle,
|
|
33218
|
+
altDescription: initial.altDescription
|
|
33219
|
+
};
|
|
33220
|
+
}
|
|
33221
|
+
function buildTableApplyValues(form) {
|
|
33222
|
+
const border = resolveBorder(
|
|
33223
|
+
form.borderStyle,
|
|
33224
|
+
form.borderWidth,
|
|
33225
|
+
form.borderColor
|
|
33226
|
+
);
|
|
33227
|
+
return {
|
|
33228
|
+
tableWidth: parseWidth(form.tableWidth, form.tableWidthUnit),
|
|
33229
|
+
tableAlign: form.tableAlign || null,
|
|
33230
|
+
tableIndentLeft: parseWidth(form.tableIndentLeft, "points"),
|
|
33231
|
+
tableFloating: form.tableWrapping === "around" ? {
|
|
33232
|
+
horizontalAnchor: form.floatingHorizontalAnchor,
|
|
33233
|
+
verticalAnchor: form.floatingVerticalAnchor,
|
|
33234
|
+
...form.floatingXAlign ? {
|
|
33235
|
+
xAlign: form.floatingXAlign
|
|
33236
|
+
} : { x: parseNumber(form.floatingX) ?? 0 },
|
|
33237
|
+
...form.floatingYAlign ? {
|
|
33238
|
+
yAlign: form.floatingYAlign
|
|
33239
|
+
} : { y: parseNumber(form.floatingY) ?? 0 },
|
|
33240
|
+
distanceTop: parseNumber(form.floatingDistanceTop) ?? 0,
|
|
33241
|
+
distanceRight: parseNumber(form.floatingDistanceRight) ?? 0,
|
|
33242
|
+
distanceBottom: parseNumber(form.floatingDistanceBottom) ?? 0,
|
|
33243
|
+
distanceLeft: parseNumber(form.floatingDistanceLeft) ?? 0
|
|
33244
|
+
} : null,
|
|
33245
|
+
tableOverlap: form.tableWrapping === "around" ? form.floatingOverlap : null,
|
|
33246
|
+
rowHeight: parseWidth(form.rowHeight, "points"),
|
|
33247
|
+
rowHeightRule: form.rowHeightRule || null,
|
|
33248
|
+
repeatHeader: form.repeatHeader,
|
|
33249
|
+
cantSplit: !form.allowBreakAcrossPages,
|
|
33250
|
+
hiddenRow: form.hiddenRow,
|
|
33251
|
+
columnWidth: parseWidth(form.columnWidth, "points"),
|
|
33252
|
+
cellWidth: parseWidth(form.cellWidth, "points"),
|
|
33253
|
+
cellVerticalAlign: form.cellVerticalAlign || null,
|
|
33254
|
+
cellTextDirection: form.cellTextDirection || null,
|
|
33255
|
+
cellNoWrap: form.cellNoWrap,
|
|
33256
|
+
cellFitText: form.cellFitText,
|
|
33257
|
+
cellHideMark: form.cellHideMark,
|
|
33258
|
+
margins: {
|
|
33259
|
+
top: parseNumber(form.marginTop),
|
|
33260
|
+
right: parseNumber(form.marginRight),
|
|
33261
|
+
bottom: parseNumber(form.marginBottom),
|
|
33262
|
+
left: parseNumber(form.marginLeft)
|
|
33263
|
+
},
|
|
33264
|
+
borders: {
|
|
33265
|
+
top: form.borderTop ? border : null,
|
|
33266
|
+
right: form.borderRight ? border : null,
|
|
33267
|
+
bottom: form.borderBottom ? border : null,
|
|
33268
|
+
left: form.borderLeft ? border : null,
|
|
33269
|
+
start: form.borderStart ? border : null,
|
|
33270
|
+
end: form.borderEnd ? border : null,
|
|
33271
|
+
topLeftToBottomRight: form.borderTlBr ? border : null,
|
|
33272
|
+
topRightToBottomLeft: form.borderTrBl ? border : null
|
|
33273
|
+
},
|
|
33274
|
+
shading: form.shading.trim() || null,
|
|
33275
|
+
altTitle: form.altTitle.trim() || null,
|
|
33276
|
+
altDescription: form.altDescription.trim() || null
|
|
33277
|
+
};
|
|
33278
|
+
}
|
|
33279
|
+
function useTablePropertiesController(props) {
|
|
33280
|
+
const [form, setForm] = createStore(createDefaultFormState());
|
|
32742
33281
|
createEffect(() => {
|
|
32743
33282
|
if (!props.isOpen) return;
|
|
32744
|
-
setForm(reconcile(
|
|
32745
|
-
activeTab: props.initial.activeTab ?? "table",
|
|
32746
|
-
tableWidth: props.initial.tableWidth,
|
|
32747
|
-
tableWidthUnit: props.initial.tableWidthUnit,
|
|
32748
|
-
tableAlign: props.initial.tableAlign,
|
|
32749
|
-
tableIndentLeft: props.initial.tableIndentLeft,
|
|
32750
|
-
tableWrapping: props.initial.tableWrapping,
|
|
32751
|
-
floatingHorizontalAnchor: props.initial.floatingHorizontalAnchor,
|
|
32752
|
-
floatingVerticalAnchor: props.initial.floatingVerticalAnchor,
|
|
32753
|
-
floatingX: props.initial.floatingX,
|
|
32754
|
-
floatingY: props.initial.floatingY,
|
|
32755
|
-
floatingXAlign: props.initial.floatingXAlign,
|
|
32756
|
-
floatingYAlign: props.initial.floatingYAlign,
|
|
32757
|
-
floatingDistanceTop: props.initial.floatingDistanceTop,
|
|
32758
|
-
floatingDistanceRight: props.initial.floatingDistanceRight,
|
|
32759
|
-
floatingDistanceBottom: props.initial.floatingDistanceBottom,
|
|
32760
|
-
floatingDistanceLeft: props.initial.floatingDistanceLeft,
|
|
32761
|
-
floatingOverlap: props.initial.floatingOverlap,
|
|
32762
|
-
rowHeight: props.initial.rowHeight,
|
|
32763
|
-
rowHeightRule: props.initial.rowHeightRule,
|
|
32764
|
-
repeatHeader: props.initial.repeatHeader,
|
|
32765
|
-
allowBreakAcrossPages: props.initial.allowBreakAcrossPages,
|
|
32766
|
-
hiddenRow: props.initial.hiddenRow,
|
|
32767
|
-
columnWidth: props.initial.columnWidth,
|
|
32768
|
-
cellWidth: props.initial.cellWidth,
|
|
32769
|
-
cellVerticalAlign: props.initial.cellVerticalAlign,
|
|
32770
|
-
cellTextDirection: props.initial.cellTextDirection,
|
|
32771
|
-
cellNoWrap: props.initial.cellNoWrap,
|
|
32772
|
-
cellFitText: props.initial.cellFitText,
|
|
32773
|
-
cellHideMark: props.initial.cellHideMark,
|
|
32774
|
-
marginTop: props.initial.marginTop,
|
|
32775
|
-
marginRight: props.initial.marginRight,
|
|
32776
|
-
marginBottom: props.initial.marginBottom,
|
|
32777
|
-
marginLeft: props.initial.marginLeft,
|
|
32778
|
-
borderStyle: props.initial.borderStyle,
|
|
32779
|
-
borderWidth: props.initial.borderWidth,
|
|
32780
|
-
borderColor: props.initial.borderColor,
|
|
32781
|
-
borderTop: props.initial.borderTop,
|
|
32782
|
-
borderRight: props.initial.borderRight,
|
|
32783
|
-
borderBottom: props.initial.borderBottom,
|
|
32784
|
-
borderLeft: props.initial.borderLeft,
|
|
32785
|
-
borderStart: props.initial.borderStart,
|
|
32786
|
-
borderEnd: props.initial.borderEnd,
|
|
32787
|
-
borderTlBr: props.initial.borderTopLeftToBottomRight,
|
|
32788
|
-
borderTrBl: props.initial.borderTopRightToBottomLeft,
|
|
32789
|
-
shading: props.initial.shading,
|
|
32790
|
-
altTitle: props.initial.altTitle,
|
|
32791
|
-
altDescription: props.initial.altDescription
|
|
32792
|
-
}));
|
|
33283
|
+
setForm(reconcile(formStateFromInitial(props.initial)));
|
|
32793
33284
|
});
|
|
32794
33285
|
const handleApply = () => {
|
|
32795
|
-
|
|
32796
|
-
props.onApply({
|
|
32797
|
-
tableWidth: parseWidth(form.tableWidth, form.tableWidthUnit),
|
|
32798
|
-
tableAlign: form.tableAlign || null,
|
|
32799
|
-
tableIndentLeft: parseWidth(form.tableIndentLeft, "points"),
|
|
32800
|
-
tableFloating: form.tableWrapping === "around" ? {
|
|
32801
|
-
horizontalAnchor: form.floatingHorizontalAnchor,
|
|
32802
|
-
verticalAnchor: form.floatingVerticalAnchor,
|
|
32803
|
-
...form.floatingXAlign ? {
|
|
32804
|
-
xAlign: form.floatingXAlign
|
|
32805
|
-
} : {
|
|
32806
|
-
x: parseNumber(form.floatingX) ?? 0
|
|
32807
|
-
},
|
|
32808
|
-
...form.floatingYAlign ? {
|
|
32809
|
-
yAlign: form.floatingYAlign
|
|
32810
|
-
} : {
|
|
32811
|
-
y: parseNumber(form.floatingY) ?? 0
|
|
32812
|
-
},
|
|
32813
|
-
distanceTop: parseNumber(form.floatingDistanceTop) ?? 0,
|
|
32814
|
-
distanceRight: parseNumber(form.floatingDistanceRight) ?? 0,
|
|
32815
|
-
distanceBottom: parseNumber(form.floatingDistanceBottom) ?? 0,
|
|
32816
|
-
distanceLeft: parseNumber(form.floatingDistanceLeft) ?? 0
|
|
32817
|
-
} : null,
|
|
32818
|
-
tableOverlap: form.tableWrapping === "around" ? form.floatingOverlap : null,
|
|
32819
|
-
rowHeight: parseWidth(form.rowHeight, "points"),
|
|
32820
|
-
rowHeightRule: form.rowHeightRule || null,
|
|
32821
|
-
repeatHeader: form.repeatHeader,
|
|
32822
|
-
cantSplit: !form.allowBreakAcrossPages,
|
|
32823
|
-
hiddenRow: form.hiddenRow,
|
|
32824
|
-
columnWidth: parseWidth(form.columnWidth, "points"),
|
|
32825
|
-
cellWidth: parseWidth(form.cellWidth, "points"),
|
|
32826
|
-
cellVerticalAlign: form.cellVerticalAlign || null,
|
|
32827
|
-
cellTextDirection: form.cellTextDirection || null,
|
|
32828
|
-
cellNoWrap: form.cellNoWrap,
|
|
32829
|
-
cellFitText: form.cellFitText,
|
|
32830
|
-
cellHideMark: form.cellHideMark,
|
|
32831
|
-
margins: {
|
|
32832
|
-
top: parseNumber(form.marginTop),
|
|
32833
|
-
right: parseNumber(form.marginRight),
|
|
32834
|
-
bottom: parseNumber(form.marginBottom),
|
|
32835
|
-
left: parseNumber(form.marginLeft)
|
|
32836
|
-
},
|
|
32837
|
-
borders: {
|
|
32838
|
-
top: form.borderTop ? border : null,
|
|
32839
|
-
right: form.borderRight ? border : null,
|
|
32840
|
-
bottom: form.borderBottom ? border : null,
|
|
32841
|
-
left: form.borderLeft ? border : null,
|
|
32842
|
-
start: form.borderStart ? border : null,
|
|
32843
|
-
end: form.borderEnd ? border : null,
|
|
32844
|
-
topLeftToBottomRight: form.borderTlBr ? border : null,
|
|
32845
|
-
topRightToBottomLeft: form.borderTrBl ? border : null
|
|
32846
|
-
},
|
|
32847
|
-
shading: form.shading.trim() || null,
|
|
32848
|
-
altTitle: form.altTitle.trim() || null,
|
|
32849
|
-
altDescription: form.altDescription.trim() || null
|
|
32850
|
-
}, props.initial);
|
|
33286
|
+
props.onApply(buildTableApplyValues(form), props.initial);
|
|
32851
33287
|
props.onClose();
|
|
32852
33288
|
};
|
|
33289
|
+
return { form, set: setForm, handleApply };
|
|
33290
|
+
}
|
|
33291
|
+
function NumField(label, value, setter, testId, disabled = false, allowNegative = false) {
|
|
33292
|
+
return createComponent(TextField, {
|
|
33293
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33294
|
+
type: "number",
|
|
33295
|
+
label,
|
|
33296
|
+
min: allowNegative ? void 0 : "0",
|
|
33297
|
+
step: "1",
|
|
33298
|
+
get value() {
|
|
33299
|
+
return value();
|
|
33300
|
+
},
|
|
33301
|
+
disabled,
|
|
33302
|
+
onChange: setter,
|
|
33303
|
+
"data-testid": testId
|
|
33304
|
+
});
|
|
33305
|
+
}
|
|
33306
|
+
var _tmpl$$9 = /* @__PURE__ */ template(`<div class=oasis-editor-dialog-row>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row>`);
|
|
33307
|
+
function TableTabPanel(props) {
|
|
33308
|
+
const t = useI18n();
|
|
33309
|
+
const form = () => props.ctrl.form;
|
|
33310
|
+
const set = props.ctrl.set;
|
|
33311
|
+
return (() => {
|
|
33312
|
+
var _el$ = _tmpl$2$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
|
|
33313
|
+
insert(_el$3, () => t("table.sizeSection"));
|
|
33314
|
+
insert(_el$4, () => NumField(t("table.preferredWidth"), () => form().tableWidth, (v) => set("tableWidth", v), "editor-table-properties-table-width"), null);
|
|
33315
|
+
insert(_el$4, createComponent(SelectField, {
|
|
33316
|
+
get label() {
|
|
33317
|
+
return t("table.measureIn");
|
|
33318
|
+
},
|
|
33319
|
+
get value() {
|
|
33320
|
+
return form().tableWidthUnit;
|
|
33321
|
+
},
|
|
33322
|
+
onChange: (value) => set("tableWidthUnit", value),
|
|
33323
|
+
"data-testid": "editor-table-properties-table-width-unit",
|
|
33324
|
+
get options() {
|
|
33325
|
+
return [{
|
|
33326
|
+
value: "points",
|
|
33327
|
+
label: t("table.points")
|
|
33328
|
+
}, {
|
|
33329
|
+
value: "percent",
|
|
33330
|
+
label: t("table.percent")
|
|
33331
|
+
}];
|
|
33332
|
+
}
|
|
33333
|
+
}), null);
|
|
33334
|
+
insert(_el$6, () => t("table.alignmentSection"));
|
|
33335
|
+
insert(_el$5, createComponent(RadioGroup, {
|
|
33336
|
+
"class": "oasis-editor-dialog-style-row",
|
|
33337
|
+
name: "table-align",
|
|
33338
|
+
get value() {
|
|
33339
|
+
return form().tableAlign;
|
|
33340
|
+
},
|
|
33341
|
+
onChange: (value) => set("tableAlign", value),
|
|
33342
|
+
get children() {
|
|
33343
|
+
return ["left", "center", "right"].map((align) => createComponent(Radio$1, {
|
|
33344
|
+
value: align,
|
|
33345
|
+
get label() {
|
|
33346
|
+
return t(`table.align${align[0].toUpperCase()}${align.slice(1)}`);
|
|
33347
|
+
},
|
|
33348
|
+
"data-testid": `editor-table-properties-align-${align}`
|
|
33349
|
+
}));
|
|
33350
|
+
}
|
|
33351
|
+
}), _el$7);
|
|
33352
|
+
insert(_el$7, () => NumField(t("table.indentFromLeft"), () => form().tableIndentLeft, (v) => set("tableIndentLeft", v), "editor-table-properties-indent-left"));
|
|
33353
|
+
insert(_el$9, () => t("table.textWrappingSection"));
|
|
33354
|
+
insert(_el$0, createComponent(Checkbox, {
|
|
33355
|
+
get label() {
|
|
33356
|
+
return t("table.wrapNone");
|
|
33357
|
+
},
|
|
33358
|
+
get checked() {
|
|
33359
|
+
return form().tableWrapping === "none";
|
|
33360
|
+
},
|
|
33361
|
+
onChange: () => set("tableWrapping", "none"),
|
|
33362
|
+
"data-testid": "editor-table-properties-wrap-none"
|
|
33363
|
+
}), null);
|
|
33364
|
+
insert(_el$0, createComponent(Checkbox, {
|
|
33365
|
+
get label() {
|
|
33366
|
+
return t("table.wrapAround");
|
|
33367
|
+
},
|
|
33368
|
+
get checked() {
|
|
33369
|
+
return form().tableWrapping === "around";
|
|
33370
|
+
},
|
|
33371
|
+
onChange: () => set("tableWrapping", "around"),
|
|
33372
|
+
"data-testid": "editor-table-properties-wrap-around"
|
|
33373
|
+
}), null);
|
|
33374
|
+
insert(_el$8, createComponent(Show, {
|
|
33375
|
+
get when() {
|
|
33376
|
+
return form().tableWrapping === "around";
|
|
33377
|
+
},
|
|
33378
|
+
get children() {
|
|
33379
|
+
return [(() => {
|
|
33380
|
+
var _el$1 = _tmpl$$9();
|
|
33381
|
+
insert(_el$1, createComponent(SelectField, {
|
|
33382
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33383
|
+
get label() {
|
|
33384
|
+
return t("table.horizontalAnchor");
|
|
33385
|
+
},
|
|
33386
|
+
get value() {
|
|
33387
|
+
return form().floatingHorizontalAnchor;
|
|
33388
|
+
},
|
|
33389
|
+
onChange: (value) => set("floatingHorizontalAnchor", value),
|
|
33390
|
+
"data-testid": "editor-table-properties-floating-h-anchor",
|
|
33391
|
+
get options() {
|
|
33392
|
+
return [{
|
|
33393
|
+
value: "margin",
|
|
33394
|
+
label: t("table.anchorMargin")
|
|
33395
|
+
}, {
|
|
33396
|
+
value: "page",
|
|
33397
|
+
label: t("table.anchorPage")
|
|
33398
|
+
}, {
|
|
33399
|
+
value: "text",
|
|
33400
|
+
label: t("table.anchorText")
|
|
33401
|
+
}];
|
|
33402
|
+
}
|
|
33403
|
+
}), null);
|
|
33404
|
+
insert(_el$1, createComponent(SelectField, {
|
|
33405
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33406
|
+
get label() {
|
|
33407
|
+
return t("table.verticalAnchor");
|
|
33408
|
+
},
|
|
33409
|
+
get value() {
|
|
33410
|
+
return form().floatingVerticalAnchor;
|
|
33411
|
+
},
|
|
33412
|
+
onChange: (value) => set("floatingVerticalAnchor", value),
|
|
33413
|
+
"data-testid": "editor-table-properties-floating-v-anchor",
|
|
33414
|
+
get options() {
|
|
33415
|
+
return [{
|
|
33416
|
+
value: "margin",
|
|
33417
|
+
label: t("table.anchorMargin")
|
|
33418
|
+
}, {
|
|
33419
|
+
value: "page",
|
|
33420
|
+
label: t("table.anchorPage")
|
|
33421
|
+
}, {
|
|
33422
|
+
value: "text",
|
|
33423
|
+
label: t("table.anchorText")
|
|
33424
|
+
}];
|
|
33425
|
+
}
|
|
33426
|
+
}), null);
|
|
33427
|
+
return _el$1;
|
|
33428
|
+
})(), (() => {
|
|
33429
|
+
var _el$10 = _tmpl$$9();
|
|
33430
|
+
insert(_el$10, () => NumField(t("table.positionX"), () => form().floatingX, (v) => set("floatingX", v), "editor-table-properties-floating-x", Boolean(form().floatingXAlign), true), null);
|
|
33431
|
+
insert(_el$10, () => NumField(t("table.positionY"), () => form().floatingY, (v) => set("floatingY", v), "editor-table-properties-floating-y", Boolean(form().floatingYAlign), true), null);
|
|
33432
|
+
insert(_el$10, createComponent(SelectField, {
|
|
33433
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33434
|
+
get label() {
|
|
33435
|
+
return t("table.horizontalAlignment");
|
|
33436
|
+
},
|
|
33437
|
+
get value() {
|
|
33438
|
+
return form().floatingXAlign;
|
|
33439
|
+
},
|
|
33440
|
+
onChange: (value) => set("floatingXAlign", value),
|
|
33441
|
+
"data-testid": "editor-table-properties-floating-x-align",
|
|
33442
|
+
get options() {
|
|
33443
|
+
return [{
|
|
33444
|
+
value: "",
|
|
33445
|
+
label: t("table.explicitOffset")
|
|
33446
|
+
}, ...["left", "center", "right", "inside", "outside"].map((value) => ({
|
|
33447
|
+
value,
|
|
33448
|
+
label: value
|
|
33449
|
+
}))];
|
|
33450
|
+
}
|
|
33451
|
+
}), null);
|
|
33452
|
+
insert(_el$10, createComponent(SelectField, {
|
|
33453
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33454
|
+
get label() {
|
|
33455
|
+
return t("table.verticalAlignment");
|
|
33456
|
+
},
|
|
33457
|
+
get value() {
|
|
33458
|
+
return form().floatingYAlign;
|
|
33459
|
+
},
|
|
33460
|
+
onChange: (value) => set("floatingYAlign", value),
|
|
33461
|
+
"data-testid": "editor-table-properties-floating-y-align",
|
|
33462
|
+
get options() {
|
|
33463
|
+
return [{
|
|
33464
|
+
value: "",
|
|
33465
|
+
label: t("table.explicitOffset")
|
|
33466
|
+
}, ...["top", "center", "bottom", "inside", "outside"].map((value) => ({
|
|
33467
|
+
value,
|
|
33468
|
+
label: value
|
|
33469
|
+
}))];
|
|
33470
|
+
}
|
|
33471
|
+
}), null);
|
|
33472
|
+
return _el$10;
|
|
33473
|
+
})(), (() => {
|
|
33474
|
+
var _el$11 = _tmpl$$9();
|
|
33475
|
+
insert(_el$11, () => NumField(t("table.distanceTop"), () => form().floatingDistanceTop, (v) => set("floatingDistanceTop", v), "editor-table-properties-floating-distance-top"), null);
|
|
33476
|
+
insert(_el$11, () => NumField(t("table.distanceRight"), () => form().floatingDistanceRight, (v) => set("floatingDistanceRight", v), "editor-table-properties-floating-distance-right"), null);
|
|
33477
|
+
insert(_el$11, () => NumField(t("table.distanceBottom"), () => form().floatingDistanceBottom, (v) => set("floatingDistanceBottom", v), "editor-table-properties-floating-distance-bottom"), null);
|
|
33478
|
+
insert(_el$11, () => NumField(t("table.distanceLeft"), () => form().floatingDistanceLeft, (v) => set("floatingDistanceLeft", v), "editor-table-properties-floating-distance-left"), null);
|
|
33479
|
+
return _el$11;
|
|
33480
|
+
})(), createComponent(Checkbox, {
|
|
33481
|
+
get label() {
|
|
33482
|
+
return t("table.allowOverlap");
|
|
33483
|
+
},
|
|
33484
|
+
get checked() {
|
|
33485
|
+
return form().floatingOverlap === "overlap";
|
|
33486
|
+
},
|
|
33487
|
+
onChange: (value) => set("floatingOverlap", value ? "overlap" : "never"),
|
|
33488
|
+
"data-testid": "editor-table-properties-floating-overlap"
|
|
33489
|
+
})];
|
|
33490
|
+
}
|
|
33491
|
+
}), null);
|
|
33492
|
+
return _el$;
|
|
33493
|
+
})();
|
|
33494
|
+
}
|
|
33495
|
+
var _tmpl$$8 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row></div><div class=oasis-editor-dialog-style-row>`);
|
|
33496
|
+
function RowTabPanel(props) {
|
|
33497
|
+
const t = useI18n();
|
|
33498
|
+
const form = () => props.ctrl.form;
|
|
33499
|
+
const set = props.ctrl.set;
|
|
33500
|
+
return (() => {
|
|
33501
|
+
var _el$ = _tmpl$$8(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
33502
|
+
insert(_el$2, () => NumField(t("table.rowHeight"), () => form().rowHeight, (v) => set("rowHeight", v), "editor-table-properties-row-height"), null);
|
|
33503
|
+
insert(_el$2, createComponent(SelectField, {
|
|
33504
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33505
|
+
get label() {
|
|
33506
|
+
return t("table.rowHeightRule");
|
|
33507
|
+
},
|
|
33508
|
+
get value() {
|
|
33509
|
+
return form().rowHeightRule;
|
|
33510
|
+
},
|
|
33511
|
+
onChange: (value) => set("rowHeightRule", value),
|
|
33512
|
+
"data-testid": "editor-table-properties-row-height-rule",
|
|
33513
|
+
get options() {
|
|
33514
|
+
return [{
|
|
33515
|
+
value: "",
|
|
33516
|
+
label: t("table.rowAuto")
|
|
33517
|
+
}, {
|
|
33518
|
+
value: "atLeast",
|
|
33519
|
+
label: t("table.rowAtLeast")
|
|
33520
|
+
}, {
|
|
33521
|
+
value: "exact",
|
|
33522
|
+
label: t("table.rowExactly")
|
|
33523
|
+
}];
|
|
33524
|
+
}
|
|
33525
|
+
}), null);
|
|
33526
|
+
insert(_el$3, createComponent(Checkbox, {
|
|
33527
|
+
get label() {
|
|
33528
|
+
return t("table.repeatHeader");
|
|
33529
|
+
},
|
|
33530
|
+
get checked() {
|
|
33531
|
+
return form().repeatHeader;
|
|
33532
|
+
},
|
|
33533
|
+
onChange: (v) => set("repeatHeader", v),
|
|
33534
|
+
"data-testid": "editor-table-properties-repeat-header"
|
|
33535
|
+
}), null);
|
|
33536
|
+
insert(_el$3, createComponent(Checkbox, {
|
|
33537
|
+
get label() {
|
|
33538
|
+
return t("table.allowBreakAcrossPages");
|
|
33539
|
+
},
|
|
33540
|
+
get checked() {
|
|
33541
|
+
return form().allowBreakAcrossPages;
|
|
33542
|
+
},
|
|
33543
|
+
onChange: (v) => set("allowBreakAcrossPages", v),
|
|
33544
|
+
"data-testid": "editor-table-properties-allow-break"
|
|
33545
|
+
}), null);
|
|
33546
|
+
insert(_el$3, createComponent(Checkbox, {
|
|
33547
|
+
get label() {
|
|
33548
|
+
return t("table.hiddenRow");
|
|
33549
|
+
},
|
|
33550
|
+
get checked() {
|
|
33551
|
+
return form().hiddenRow;
|
|
33552
|
+
},
|
|
33553
|
+
onChange: (v) => set("hiddenRow", v),
|
|
33554
|
+
"data-testid": "editor-table-properties-hidden-row"
|
|
33555
|
+
}), null);
|
|
33556
|
+
return _el$;
|
|
33557
|
+
})();
|
|
33558
|
+
}
|
|
33559
|
+
var _tmpl$$7 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row>`);
|
|
33560
|
+
function ColumnTabPanel(props) {
|
|
33561
|
+
const t = useI18n();
|
|
33562
|
+
const form = () => props.ctrl.form;
|
|
33563
|
+
const set = props.ctrl.set;
|
|
33564
|
+
return (() => {
|
|
33565
|
+
var _el$ = _tmpl$$7(), _el$2 = _el$.firstChild;
|
|
33566
|
+
insert(_el$2, () => NumField(t("table.columnWidth"), () => form().columnWidth, (v) => set("columnWidth", v), "editor-table-properties-column-width"));
|
|
33567
|
+
return _el$;
|
|
33568
|
+
})();
|
|
33569
|
+
}
|
|
33570
|
+
var _tmpl$$6 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-row></div><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-style-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row></div></fieldset><fieldset class=oasis-editor-font-dialog-fieldset><legend></legend><div class=oasis-editor-dialog-row><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-border-color></div><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><input type=color class=oasis-editor-dialog-input data-testid=editor-table-properties-shading></div></div><div class=oasis-editor-dialog-style-row></div><div class=oasis-editor-table-properties-cell-preview data-testid=editor-table-properties-cell-preview>`);
|
|
33571
|
+
function CellTabPanel(props) {
|
|
33572
|
+
const t = useI18n();
|
|
33573
|
+
const form = () => props.ctrl.form;
|
|
33574
|
+
const set = props.ctrl.set;
|
|
33575
|
+
const borderPreview = createMemo(() => {
|
|
33576
|
+
const border = resolveBorder(form().borderStyle, form().borderWidth, form().borderColor);
|
|
33577
|
+
const css = border ? `${border.width}pt ${border.type} ${border.color}` : void 0;
|
|
33578
|
+
return {
|
|
33579
|
+
"background-color": form().shading.trim() || void 0,
|
|
33580
|
+
"border-top": css && form().borderTop ? css : "1px solid #dadce0",
|
|
33581
|
+
"border-right": css && form().borderRight ? css : "1px solid #dadce0",
|
|
33582
|
+
"border-bottom": css && form().borderBottom ? css : "1px solid #dadce0",
|
|
33583
|
+
"border-left": css && form().borderLeft ? css : "1px solid #dadce0"
|
|
33584
|
+
};
|
|
33585
|
+
});
|
|
33586
|
+
const borderDisabled = () => form().borderStyle === "none";
|
|
33587
|
+
return (() => {
|
|
33588
|
+
var _el$ = _tmpl$$6(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$3.nextSibling, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$10.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$1.nextSibling, _el$17 = _el$16.nextSibling;
|
|
33589
|
+
insert(_el$2, () => NumField(t("table.cellWidth"), () => form().cellWidth, (v) => set("cellWidth", v), "editor-table-properties-cell-width"), null);
|
|
33590
|
+
insert(_el$2, createComponent(SelectField, {
|
|
33591
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33592
|
+
get label() {
|
|
33593
|
+
return t("table.verticalAlignment");
|
|
33594
|
+
},
|
|
33595
|
+
get value() {
|
|
33596
|
+
return form().cellVerticalAlign;
|
|
33597
|
+
},
|
|
33598
|
+
onChange: (value) => set("cellVerticalAlign", value),
|
|
33599
|
+
"data-testid": "editor-table-properties-cell-valign",
|
|
33600
|
+
get options() {
|
|
33601
|
+
return [{
|
|
33602
|
+
value: "",
|
|
33603
|
+
label: t("table.inherit")
|
|
33604
|
+
}, {
|
|
33605
|
+
value: "top",
|
|
33606
|
+
label: t("table.valignTop")
|
|
33607
|
+
}, {
|
|
33608
|
+
value: "middle",
|
|
33609
|
+
label: t("table.valignMiddle")
|
|
33610
|
+
}, {
|
|
33611
|
+
value: "bottom",
|
|
33612
|
+
label: t("table.valignBottom")
|
|
33613
|
+
}];
|
|
33614
|
+
}
|
|
33615
|
+
}), null);
|
|
33616
|
+
insert(_el$2, createComponent(SelectField, {
|
|
33617
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33618
|
+
get label() {
|
|
33619
|
+
return t("table.textDirection");
|
|
33620
|
+
},
|
|
33621
|
+
get value() {
|
|
33622
|
+
return form().cellTextDirection;
|
|
33623
|
+
},
|
|
33624
|
+
onChange: (value) => set("cellTextDirection", value),
|
|
33625
|
+
"data-testid": "editor-table-properties-cell-direction",
|
|
33626
|
+
get options() {
|
|
33627
|
+
return [{
|
|
33628
|
+
value: "",
|
|
33629
|
+
label: t("table.inherit")
|
|
33630
|
+
}, {
|
|
33631
|
+
value: "lrTb",
|
|
33632
|
+
label: "lrTb"
|
|
33633
|
+
}, {
|
|
33634
|
+
value: "tbRl",
|
|
33635
|
+
label: "tbRl"
|
|
33636
|
+
}, {
|
|
33637
|
+
value: "btLr",
|
|
33638
|
+
label: "btLr"
|
|
33639
|
+
}, {
|
|
33640
|
+
value: "lrTbV",
|
|
33641
|
+
label: "lrTbV"
|
|
33642
|
+
}, {
|
|
33643
|
+
value: "tbRlV",
|
|
33644
|
+
label: "tbRlV"
|
|
33645
|
+
}];
|
|
33646
|
+
}
|
|
33647
|
+
}), null);
|
|
33648
|
+
insert(_el$4, () => t("table.options"));
|
|
33649
|
+
insert(_el$5, createComponent(Checkbox, {
|
|
33650
|
+
get label() {
|
|
33651
|
+
return t("table.noWrap");
|
|
33652
|
+
},
|
|
33653
|
+
get checked() {
|
|
33654
|
+
return form().cellNoWrap;
|
|
33655
|
+
},
|
|
33656
|
+
onChange: (v) => set("cellNoWrap", v),
|
|
33657
|
+
"data-testid": "editor-table-properties-cell-nowrap"
|
|
33658
|
+
}), null);
|
|
33659
|
+
insert(_el$5, createComponent(Checkbox, {
|
|
33660
|
+
get label() {
|
|
33661
|
+
return t("table.fitText");
|
|
33662
|
+
},
|
|
33663
|
+
get checked() {
|
|
33664
|
+
return form().cellFitText;
|
|
33665
|
+
},
|
|
33666
|
+
onChange: (v) => set("cellFitText", v),
|
|
33667
|
+
"data-testid": "editor-table-properties-cell-fit-text"
|
|
33668
|
+
}), null);
|
|
33669
|
+
insert(_el$5, createComponent(Checkbox, {
|
|
33670
|
+
get label() {
|
|
33671
|
+
return t("table.hideMark");
|
|
33672
|
+
},
|
|
33673
|
+
get checked() {
|
|
33674
|
+
return form().cellHideMark;
|
|
33675
|
+
},
|
|
33676
|
+
onChange: (v) => set("cellHideMark", v),
|
|
33677
|
+
"data-testid": "editor-table-properties-cell-hide-mark"
|
|
33678
|
+
}), null);
|
|
33679
|
+
insert(_el$7, () => t("table.cellMargins"));
|
|
33680
|
+
insert(_el$8, () => NumField(t("paragraph.borderSideTop"), () => form().marginTop, (v) => set("marginTop", v), "editor-table-properties-margin-top"), null);
|
|
33681
|
+
insert(_el$8, () => NumField(t("paragraph.borderSideRight"), () => form().marginRight, (v) => set("marginRight", v), "editor-table-properties-margin-right"), null);
|
|
33682
|
+
insert(_el$8, () => NumField(t("paragraph.borderSideBottom"), () => form().marginBottom, (v) => set("marginBottom", v), "editor-table-properties-margin-bottom"), null);
|
|
33683
|
+
insert(_el$8, () => NumField(t("paragraph.borderSideLeft"), () => form().marginLeft, (v) => set("marginLeft", v), "editor-table-properties-margin-left"), null);
|
|
33684
|
+
insert(_el$0, () => t("paragraph.bordersSection"));
|
|
33685
|
+
insert(_el$1, createComponent(SelectField, {
|
|
33686
|
+
"class": "oasis-editor-dialog-input-group-grow",
|
|
33687
|
+
get label() {
|
|
33688
|
+
return t("paragraph.borderStyleLabel");
|
|
33689
|
+
},
|
|
33690
|
+
get value() {
|
|
33691
|
+
return form().borderStyle;
|
|
33692
|
+
},
|
|
33693
|
+
onChange: (value) => {
|
|
33694
|
+
const next = value;
|
|
33695
|
+
set("borderStyle", next);
|
|
33696
|
+
if (next === "none") {
|
|
33697
|
+
set("borderTop", false);
|
|
33698
|
+
set("borderRight", false);
|
|
33699
|
+
set("borderBottom", false);
|
|
33700
|
+
set("borderLeft", false);
|
|
33701
|
+
set("borderStart", false);
|
|
33702
|
+
set("borderEnd", false);
|
|
33703
|
+
set("borderTlBr", false);
|
|
33704
|
+
set("borderTrBl", false);
|
|
33705
|
+
} else if (!form().borderTop && !form().borderRight && !form().borderBottom && !form().borderLeft) {
|
|
33706
|
+
set("borderTop", true);
|
|
33707
|
+
set("borderRight", true);
|
|
33708
|
+
set("borderBottom", true);
|
|
33709
|
+
set("borderLeft", true);
|
|
33710
|
+
}
|
|
33711
|
+
},
|
|
33712
|
+
"data-testid": "editor-table-properties-border-style",
|
|
33713
|
+
get options() {
|
|
33714
|
+
return [{
|
|
33715
|
+
value: "none",
|
|
33716
|
+
label: t("paragraph.borderNone")
|
|
33717
|
+
}, {
|
|
33718
|
+
value: "solid",
|
|
33719
|
+
label: t("paragraph.borderSolid")
|
|
33720
|
+
}, {
|
|
33721
|
+
value: "dashed",
|
|
33722
|
+
label: t("paragraph.borderDashed")
|
|
33723
|
+
}, {
|
|
33724
|
+
value: "dotted",
|
|
33725
|
+
label: t("paragraph.borderDotted")
|
|
33726
|
+
}];
|
|
33727
|
+
}
|
|
33728
|
+
}), _el$10);
|
|
33729
|
+
insert(_el$1, () => NumField(t("paragraph.borderWidthLabel"), () => form().borderWidth, (v) => set("borderWidth", v), "editor-table-properties-border-width", borderDisabled()), _el$10);
|
|
33730
|
+
insert(_el$11, () => t("paragraph.borderColorLabel"));
|
|
33731
|
+
_el$12.$$input = (e) => set("borderColor", e.currentTarget.value);
|
|
33732
|
+
insert(_el$14, () => t("paragraph.shadingLabel"));
|
|
33733
|
+
_el$15.$$input = (e) => set("shading", e.currentTarget.value);
|
|
33734
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33735
|
+
get label() {
|
|
33736
|
+
return t("paragraph.borderSideTop");
|
|
33737
|
+
},
|
|
33738
|
+
get checked() {
|
|
33739
|
+
return form().borderTop;
|
|
33740
|
+
},
|
|
33741
|
+
get disabled() {
|
|
33742
|
+
return borderDisabled();
|
|
33743
|
+
},
|
|
33744
|
+
onChange: (v) => set("borderTop", v),
|
|
33745
|
+
"data-testid": "editor-table-properties-border-top"
|
|
33746
|
+
}), null);
|
|
33747
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33748
|
+
get label() {
|
|
33749
|
+
return t("paragraph.borderSideRight");
|
|
33750
|
+
},
|
|
33751
|
+
get checked() {
|
|
33752
|
+
return form().borderRight;
|
|
33753
|
+
},
|
|
33754
|
+
get disabled() {
|
|
33755
|
+
return borderDisabled();
|
|
33756
|
+
},
|
|
33757
|
+
onChange: (v) => set("borderRight", v),
|
|
33758
|
+
"data-testid": "editor-table-properties-border-right"
|
|
33759
|
+
}), null);
|
|
33760
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33761
|
+
get label() {
|
|
33762
|
+
return t("paragraph.borderSideBottom");
|
|
33763
|
+
},
|
|
33764
|
+
get checked() {
|
|
33765
|
+
return form().borderBottom;
|
|
33766
|
+
},
|
|
33767
|
+
get disabled() {
|
|
33768
|
+
return borderDisabled();
|
|
33769
|
+
},
|
|
33770
|
+
onChange: (v) => set("borderBottom", v),
|
|
33771
|
+
"data-testid": "editor-table-properties-border-bottom"
|
|
33772
|
+
}), null);
|
|
33773
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33774
|
+
get label() {
|
|
33775
|
+
return t("paragraph.borderSideLeft");
|
|
33776
|
+
},
|
|
33777
|
+
get checked() {
|
|
33778
|
+
return form().borderLeft;
|
|
33779
|
+
},
|
|
33780
|
+
get disabled() {
|
|
33781
|
+
return borderDisabled();
|
|
33782
|
+
},
|
|
33783
|
+
onChange: (v) => set("borderLeft", v),
|
|
33784
|
+
"data-testid": "editor-table-properties-border-left"
|
|
33785
|
+
}), null);
|
|
33786
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33787
|
+
get label() {
|
|
33788
|
+
return t("table.borderStart");
|
|
33789
|
+
},
|
|
33790
|
+
get checked() {
|
|
33791
|
+
return form().borderStart;
|
|
33792
|
+
},
|
|
33793
|
+
get disabled() {
|
|
33794
|
+
return borderDisabled();
|
|
33795
|
+
},
|
|
33796
|
+
onChange: (v) => set("borderStart", v),
|
|
33797
|
+
"data-testid": "editor-table-properties-border-start"
|
|
33798
|
+
}), null);
|
|
33799
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33800
|
+
get label() {
|
|
33801
|
+
return t("table.borderEnd");
|
|
33802
|
+
},
|
|
33803
|
+
get checked() {
|
|
33804
|
+
return form().borderEnd;
|
|
33805
|
+
},
|
|
33806
|
+
get disabled() {
|
|
33807
|
+
return borderDisabled();
|
|
33808
|
+
},
|
|
33809
|
+
onChange: (v) => set("borderEnd", v),
|
|
33810
|
+
"data-testid": "editor-table-properties-border-end"
|
|
33811
|
+
}), null);
|
|
33812
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33813
|
+
get label() {
|
|
33814
|
+
return t("table.borderTlBr");
|
|
33815
|
+
},
|
|
33816
|
+
get checked() {
|
|
33817
|
+
return form().borderTlBr;
|
|
33818
|
+
},
|
|
33819
|
+
get disabled() {
|
|
33820
|
+
return borderDisabled();
|
|
33821
|
+
},
|
|
33822
|
+
onChange: (v) => set("borderTlBr", v),
|
|
33823
|
+
"data-testid": "editor-table-properties-border-tlbr"
|
|
33824
|
+
}), null);
|
|
33825
|
+
insert(_el$16, createComponent(Checkbox, {
|
|
33826
|
+
get label() {
|
|
33827
|
+
return t("table.borderTrBl");
|
|
33828
|
+
},
|
|
33829
|
+
get checked() {
|
|
33830
|
+
return form().borderTrBl;
|
|
33831
|
+
},
|
|
33832
|
+
get disabled() {
|
|
33833
|
+
return borderDisabled();
|
|
33834
|
+
},
|
|
33835
|
+
onChange: (v) => set("borderTrBl", v),
|
|
33836
|
+
"data-testid": "editor-table-properties-border-trbl"
|
|
33837
|
+
}), null);
|
|
33838
|
+
createRenderEffect((_p$) => {
|
|
33839
|
+
var _v$ = borderDisabled(), _v$2 = borderPreview();
|
|
33840
|
+
_v$ !== _p$.e && (_el$12.disabled = _p$.e = _v$);
|
|
33841
|
+
_p$.t = style(_el$17, _v$2, _p$.t);
|
|
33842
|
+
return _p$;
|
|
33843
|
+
}, {
|
|
33844
|
+
e: void 0,
|
|
33845
|
+
t: void 0
|
|
33846
|
+
});
|
|
33847
|
+
createRenderEffect(() => _el$12.value = form().borderColor || DEFAULT_BORDER_COLOR);
|
|
33848
|
+
createRenderEffect(() => _el$15.value = form().shading || "#ffffff");
|
|
33849
|
+
return _el$;
|
|
33850
|
+
})();
|
|
33851
|
+
}
|
|
33852
|
+
delegateEvents(["input"]);
|
|
33853
|
+
var _tmpl$$5 = /* @__PURE__ */ template(`<div class=oasis-editor-table-properties-panel><div class=oasis-editor-dialog-input-group><label class=oasis-editor-dialog-label></label><textarea class="oasis-editor-ui-input oasis-editor-table-properties-textarea"data-testid=editor-table-properties-alt-description>`);
|
|
33854
|
+
function AltTextTabPanel(props) {
|
|
33855
|
+
const t = useI18n();
|
|
33856
|
+
const form = () => props.ctrl.form;
|
|
33857
|
+
const set = props.ctrl.set;
|
|
33858
|
+
return (() => {
|
|
33859
|
+
var _el$ = _tmpl$$5(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
|
|
33860
|
+
insert(_el$, createComponent(TextField, {
|
|
33861
|
+
get label() {
|
|
33862
|
+
return t("table.altTitle");
|
|
33863
|
+
},
|
|
33864
|
+
get value() {
|
|
33865
|
+
return form().altTitle;
|
|
33866
|
+
},
|
|
33867
|
+
onChange: (v) => set("altTitle", v),
|
|
33868
|
+
"data-testid": "editor-table-properties-alt-title"
|
|
33869
|
+
}), _el$2);
|
|
33870
|
+
insert(_el$3, () => t("table.altDescription"));
|
|
33871
|
+
_el$4.$$input = (e) => set("altDescription", e.currentTarget.value);
|
|
33872
|
+
createRenderEffect(() => _el$4.value = form().altDescription);
|
|
33873
|
+
return _el$;
|
|
33874
|
+
})();
|
|
33875
|
+
}
|
|
33876
|
+
delegateEvents(["input"]);
|
|
33877
|
+
function TablePropertiesDialog(props) {
|
|
33878
|
+
const t = useI18n();
|
|
33879
|
+
const ctrl = useTablePropertiesController(props);
|
|
32853
33880
|
return createComponent(Dialog, {
|
|
32854
33881
|
get isOpen() {
|
|
32855
33882
|
return props.isOpen;
|
|
@@ -32868,7 +33895,9 @@ function TablePropertiesDialog(props) {
|
|
|
32868
33895
|
get onCancel() {
|
|
32869
33896
|
return props.onClose;
|
|
32870
33897
|
},
|
|
32871
|
-
onConfirm
|
|
33898
|
+
get onConfirm() {
|
|
33899
|
+
return ctrl.handleApply;
|
|
33900
|
+
},
|
|
32872
33901
|
get cancelLabel() {
|
|
32873
33902
|
return t("generic.cancel");
|
|
32874
33903
|
},
|
|
@@ -32882,9 +33911,9 @@ function TablePropertiesDialog(props) {
|
|
|
32882
33911
|
get children() {
|
|
32883
33912
|
return createComponent(Tabs, {
|
|
32884
33913
|
get value() {
|
|
32885
|
-
return form.activeTab;
|
|
33914
|
+
return ctrl.form.activeTab;
|
|
32886
33915
|
},
|
|
32887
|
-
onChange: (tab) =>
|
|
33916
|
+
onChange: (tab) => ctrl.set("activeTab", tab),
|
|
32888
33917
|
get ariaLabel() {
|
|
32889
33918
|
return t("table.propertiesTitle");
|
|
32890
33919
|
},
|
|
@@ -32895,40 +33924,35 @@ function TablePropertiesDialog(props) {
|
|
|
32895
33924
|
label: t("table.tabTable"),
|
|
32896
33925
|
testId: "editor-table-properties-tab-table",
|
|
32897
33926
|
panel: createComponent(TableTabPanel, {
|
|
32898
|
-
|
|
32899
|
-
set: setForm
|
|
33927
|
+
ctrl
|
|
32900
33928
|
})
|
|
32901
33929
|
}, {
|
|
32902
33930
|
id: "row",
|
|
32903
33931
|
label: t("table.tabRow"),
|
|
32904
33932
|
testId: "editor-table-properties-tab-row",
|
|
32905
33933
|
panel: createComponent(RowTabPanel, {
|
|
32906
|
-
|
|
32907
|
-
set: setForm
|
|
33934
|
+
ctrl
|
|
32908
33935
|
})
|
|
32909
33936
|
}, {
|
|
32910
33937
|
id: "column",
|
|
32911
33938
|
label: t("table.tabColumn"),
|
|
32912
33939
|
testId: "editor-table-properties-tab-column",
|
|
32913
33940
|
panel: createComponent(ColumnTabPanel, {
|
|
32914
|
-
|
|
32915
|
-
set: setForm
|
|
33941
|
+
ctrl
|
|
32916
33942
|
})
|
|
32917
33943
|
}, {
|
|
32918
33944
|
id: "cell",
|
|
32919
33945
|
label: t("table.tabCell"),
|
|
32920
33946
|
testId: "editor-table-properties-tab-cell",
|
|
32921
33947
|
panel: createComponent(CellTabPanel, {
|
|
32922
|
-
|
|
32923
|
-
set: setForm
|
|
33948
|
+
ctrl
|
|
32924
33949
|
})
|
|
32925
33950
|
}, {
|
|
32926
33951
|
id: "altText",
|
|
32927
33952
|
label: t("table.tabAltText"),
|
|
32928
33953
|
testId: "editor-table-properties-tab-alt-text",
|
|
32929
33954
|
panel: createComponent(AltTextTabPanel, {
|
|
32930
|
-
|
|
32931
|
-
set: setForm
|
|
33955
|
+
ctrl
|
|
32932
33956
|
})
|
|
32933
33957
|
}];
|
|
32934
33958
|
}
|
|
@@ -32936,7 +33960,6 @@ function TablePropertiesDialog(props) {
|
|
|
32936
33960
|
}
|
|
32937
33961
|
});
|
|
32938
33962
|
}
|
|
32939
|
-
delegateEvents(["input"]);
|
|
32940
33963
|
var _tmpl$$4 = /* @__PURE__ */ template(`<div class=oasis-editor-find-replace-dialog><div class=oasis-editor-fr-header><span></span><button class=oasis-editor-fr-close><i data-lucide=x></i></button></div><div class=oasis-editor-fr-body><div class=oasis-editor-fr-input-group><div class=oasis-editor-fr-input-wrapper><input type=text autofocus class=oasis-editor-fr-input><span class=oasis-editor-fr-counter></span></div><div class=oasis-editor-fr-actions><button><i data-lucide=chevron-up></i></button><button><i data-lucide=chevron-down></i></button></div></div><div class=oasis-editor-fr-input-group><input type=text class=oasis-editor-fr-input><div class=oasis-editor-fr-actions><button class=oasis-editor-fr-btn-text></button><button class=oasis-editor-fr-btn-text></button></div></div><div class=oasis-editor-fr-options><label class=oasis-editor-fr-checkbox><input type=checkbox><span></span></label><label class=oasis-editor-fr-checkbox><input type=checkbox><span>`);
|
|
32941
33964
|
function FindReplaceDialog(props) {
|
|
32942
33965
|
const t = useI18n();
|
|
@@ -33530,7 +34553,7 @@ function EditorWorkspace(props) {
|
|
|
33530
34553
|
}
|
|
33531
34554
|
})];
|
|
33532
34555
|
}
|
|
33533
|
-
var _tmpl$$1 = /* @__PURE__ */ template(`<div class=oasis-editor-welcome-overlay role=dialog aria-modal=true aria-labelledby=oasis-editor-welcome-title><div class=oasis-editor-welcome-card><h2 id=oasis-editor-welcome-title class=oasis-editor-welcome-title></h2><p class=oasis-editor-welcome-body></p><p class=oasis-editor-welcome-note></p><div class=oasis-editor-welcome-actions
|
|
34556
|
+
var _tmpl$$1 = /* @__PURE__ */ template(`<div class=oasis-editor-welcome-overlay role=dialog aria-modal=true aria-labelledby=oasis-editor-welcome-title><div class=oasis-editor-welcome-card><h2 id=oasis-editor-welcome-title class=oasis-editor-welcome-title></h2><p class=oasis-editor-welcome-body></p><p class=oasis-editor-welcome-note></p><div class=oasis-editor-welcome-actions>`);
|
|
33534
34557
|
function WelcomeOverlay(props) {
|
|
33535
34558
|
const t = useI18n();
|
|
33536
34559
|
const handleEnable = () => {
|
|
@@ -33548,7 +34571,7 @@ function WelcomeOverlay(props) {
|
|
|
33548
34571
|
return props.isOpen;
|
|
33549
34572
|
},
|
|
33550
34573
|
get children() {
|
|
33551
|
-
var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling
|
|
34574
|
+
var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling;
|
|
33552
34575
|
insert(_el$2, createComponent(OasisBrandMark, {
|
|
33553
34576
|
height: 72,
|
|
33554
34577
|
"class": "oasis-editor-welcome-mark"
|
|
@@ -33556,15 +34579,26 @@ function WelcomeOverlay(props) {
|
|
|
33556
34579
|
insert(_el$3, () => t("welcome.title"));
|
|
33557
34580
|
insert(_el$4, () => t("welcome.body"));
|
|
33558
34581
|
insert(_el$5, () => t("welcome.note"));
|
|
33559
|
-
_el$
|
|
33560
|
-
|
|
33561
|
-
|
|
33562
|
-
|
|
34582
|
+
insert(_el$6, createComponent(Button, {
|
|
34583
|
+
variant: "secondary",
|
|
34584
|
+
onClick: handleSkip,
|
|
34585
|
+
"data-testid": "editor-welcome-skip",
|
|
34586
|
+
get children() {
|
|
34587
|
+
return t("welcome.skip");
|
|
34588
|
+
}
|
|
34589
|
+
}), null);
|
|
34590
|
+
insert(_el$6, createComponent(Button, {
|
|
34591
|
+
variant: "primary",
|
|
34592
|
+
onClick: handleEnable,
|
|
34593
|
+
"data-testid": "editor-welcome-enable",
|
|
34594
|
+
get children() {
|
|
34595
|
+
return t("welcome.enable");
|
|
34596
|
+
}
|
|
34597
|
+
}), null);
|
|
33563
34598
|
return _el$;
|
|
33564
34599
|
}
|
|
33565
34600
|
});
|
|
33566
34601
|
}
|
|
33567
|
-
delegateEvents(["click"]);
|
|
33568
34602
|
const WORD_NS$1 = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
33569
34603
|
const PACKAGE_REL_NS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
33570
34604
|
const OFFICE_REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
@@ -37308,7 +38342,15 @@ async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, do
|
|
|
37308
38342
|
const text = chars.map((char) => styles.allCaps ? char.char.toUpperCase() : char.char).join("");
|
|
37309
38343
|
const firstChar = chars[0];
|
|
37310
38344
|
if (!firstChar || text.length === 0) return;
|
|
37311
|
-
drawLinkAnnotation(
|
|
38345
|
+
drawLinkAnnotation(
|
|
38346
|
+
writer,
|
|
38347
|
+
pageIndex,
|
|
38348
|
+
line,
|
|
38349
|
+
fragment,
|
|
38350
|
+
originX,
|
|
38351
|
+
originY,
|
|
38352
|
+
styles
|
|
38353
|
+
);
|
|
37312
38354
|
drawFragmentShading(
|
|
37313
38355
|
writer,
|
|
37314
38356
|
pageIndex,
|
|
@@ -37381,7 +38423,15 @@ async function drawFragmentText(writer, pageIndex, paragraph, line, fragment, do
|
|
|
37381
38423
|
styles,
|
|
37382
38424
|
baseTextOptions
|
|
37383
38425
|
};
|
|
37384
|
-
emitFragmentGlyphs(
|
|
38426
|
+
emitFragmentGlyphs(
|
|
38427
|
+
chunkCtx,
|
|
38428
|
+
chars,
|
|
38429
|
+
originX,
|
|
38430
|
+
styles,
|
|
38431
|
+
line,
|
|
38432
|
+
fragment,
|
|
38433
|
+
paragraphAlign
|
|
38434
|
+
);
|
|
37385
38435
|
if (styles.underline) {
|
|
37386
38436
|
drawFragmentDecoration(
|
|
37387
38437
|
writer,
|