@stll/folio-vue 0.2.0
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/ListButtons-B498PX1d.js +4256 -0
- package/dist/ListButtons-D-zMJ7rl.cjs +4 -0
- package/dist/PageSetupDialog-CGBaBVzo.cjs +15 -0
- package/dist/PageSetupDialog-DsjAfJy0.js +4873 -0
- package/dist/TablePropertiesDialog-A-1Pm1f9.cjs +1 -0
- package/dist/TablePropertiesDialog-PyXEJC_o.js +887 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +75 -0
- package/dist/components/DocxEditor/types.d.ts +528 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/FormattingBar.types.d.ts +67 -0
- package/dist/components/Toolbar/presets.d.ts +25 -0
- package/dist/components/dialogs/index.d.ts +24 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +13 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +1 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +22 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +60 -0
- package/dist/components/toolbarUtils.d.ts +3 -0
- package/dist/components/ui/AlignmentButtons.types.d.ts +13 -0
- package/dist/components/ui/StylePicker.types.d.ts +16 -0
- package/dist/components/ui/ZoomControl.types.d.ts +21 -0
- package/dist/components/ui/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/commentMarks.d.ts +32 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +39 -0
- package/dist/composables/useClipboard.d.ts +21 -0
- package/dist/composables/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentLifecycle.d.ts +39 -0
- package/dist/composables/useCommentManagement.d.ts +47 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useContextMenus.d.ts +64 -0
- package/dist/composables/useControllableBoolean.d.ts +16 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +123 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +68 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +43 -0
- package/dist/composables/useFindReplace.d.ts +22 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFormattingActions.d.ts +21 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHostCallbacks.d.ts +24 -0
- package/dist/composables/useHyperlinkManagement.d.ts +40 -0
- package/dist/composables/useImageActions.d.ts +25 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
- package/dist/composables/useMenuActions.d.ts +36 -0
- package/dist/composables/useOutlineSidebar.d.ts +24 -0
- package/dist/composables/usePageSetupControls.d.ts +28 -0
- package/dist/composables/usePagesPointer.d.ts +87 -0
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/usePortalClass.d.ts +8 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +30 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +15 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +61 -0
- package/dist/composables.js +378 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/folio-vue.css +2 -0
- package/dist/i18n/index.d.ts +36 -0
- package/dist/i18n/messages.d.ts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +4088 -0
- package/dist/messages.cjs +1 -0
- package/dist/messages.js +1 -0
- package/dist/renderAsync.d.ts +35 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +18 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui/folio-ui.d.ts +139 -0
- package/dist/ui.cjs +1 -0
- package/dist/ui.d.ts +67 -0
- package/dist/ui.js +446 -0
- package/dist/useZoom-BryUw3Cu.cjs +1 -0
- package/dist/useZoom-CIIRid8U.js +626 -0
- package/dist/utils/aiEditRange.d.ts +26 -0
- package/dist/utils/autoScroll.d.ts +22 -0
- package/dist/utils/cardStyles.d.ts +3 -0
- package/dist/utils/colorMode.d.ts +32 -0
- package/dist/utils/comments.d.ts +20 -0
- package/dist/utils/cssTypes.d.ts +7 -0
- package/dist/utils/domQueries.d.ts +39 -0
- package/dist/utils/fontOptions.d.ts +26 -0
- package/dist/utils/hostFonts.d.ts +25 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/listState.d.ts +22 -0
- package/dist/utils/reportIssue.d.ts +18 -0
- package/dist/utils/selectionHighlight.d.ts +44 -0
- package/dist/utils/sidebarConstants.d.ts +8 -0
- package/dist/utils/stylePreview.d.ts +53 -0
- package/dist/utils/textSelection.d.ts +40 -0
- package/dist/zIndex-BY0qa8Au.js +12 -0
- package/dist/zIndex-dFsQbASx.cjs +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,4256 @@
|
|
|
1
|
+
import { l as e, u as t } from "./PageSetupDialog-DsjAfJy0.js";
|
|
2
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, inject as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, openBlock as v, provide as y, reactive as b, ref as x, renderList as S, renderSlot as C, resolveDynamicComponent as w, toDisplayString as T, toRef as E, unref as D, vModelSelect as O, vModelText as k, watch as A, withCtx as j, withDirectives as M, withKeys as N, withModifiers as P } from "vue";
|
|
3
|
+
import { extractSelectionContext as F } from "@stll/folio-core/prosemirror/plugins/selectionTracker";
|
|
4
|
+
import { pixelsToTwips as I, twipsToPixels as L } from "@stll/folio-core/utils/units";
|
|
5
|
+
import { DISPLAY_MODES as R } from "@stll/folio-core/managers/EditorModeManager";
|
|
6
|
+
import { redoDepth as ee, undoDepth as te } from "prosemirror-history";
|
|
7
|
+
import { clearFormatting as z } from "@stll/folio-core/prosemirror/commands/formatting";
|
|
8
|
+
import { generateThemeTintShadeMatrix as B, resolveColor as V, resolveColorToHex as H, resolveHighlightColor as ne } from "@stll/folio-core/utils/colorResolver";
|
|
9
|
+
import { getTableContext as U } from "@stll/folio-core/prosemirror/extensions/nodes/TableExtension";
|
|
10
|
+
var W = {
|
|
11
|
+
undo: ["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],
|
|
12
|
+
redo: ["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],
|
|
13
|
+
print: ["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],
|
|
14
|
+
file_download: ["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],
|
|
15
|
+
file_upload: ["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],
|
|
16
|
+
format_bold: ["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],
|
|
17
|
+
format_italic: ["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],
|
|
18
|
+
format_underlined: ["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],
|
|
19
|
+
strikethrough_s: ["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],
|
|
20
|
+
superscript: ["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],
|
|
21
|
+
subscript: ["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],
|
|
22
|
+
link: ["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],
|
|
23
|
+
format_clear: ["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],
|
|
24
|
+
format_align_left: ["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],
|
|
25
|
+
format_align_center: ["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],
|
|
26
|
+
format_align_right: ["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],
|
|
27
|
+
format_align_justify: ["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],
|
|
28
|
+
format_line_spacing: ["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],
|
|
29
|
+
format_list_bulleted: ["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],
|
|
30
|
+
format_list_numbered: ["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],
|
|
31
|
+
format_indent_increase: ["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],
|
|
32
|
+
format_indent_decrease: ["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],
|
|
33
|
+
format_color_text: ["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],
|
|
34
|
+
ink_highlighter: ["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],
|
|
35
|
+
format_color_reset: ["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],
|
|
36
|
+
arrow_drop_down: ["M480-360 280-560h400L480-360Z"],
|
|
37
|
+
table: ["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],
|
|
38
|
+
table_chart: ["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],
|
|
39
|
+
grid_on: ["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],
|
|
40
|
+
table_rows: ["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],
|
|
41
|
+
view_column: ["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],
|
|
42
|
+
border_all: ["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],
|
|
43
|
+
select_all: ["M360-360h240v-240H360v240ZM200-120q-33 0-56.5-23.5T120-200h80v80Zm-80-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T200-840v80Zm80 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80q0 33-23.5 56.5T760-120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80q33 0 56.5 23.5T840-760h-80Z"],
|
|
44
|
+
border_outer: ["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],
|
|
45
|
+
border_inner: ["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],
|
|
46
|
+
border_clear: ["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],
|
|
47
|
+
add: ["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],
|
|
48
|
+
remove: ["M200-440v-80h560v80H200Z"],
|
|
49
|
+
delete: ["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],
|
|
50
|
+
delete_sweep: ["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],
|
|
51
|
+
call_merge: ["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],
|
|
52
|
+
call_split: ["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],
|
|
53
|
+
drag_indicator: ["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],
|
|
54
|
+
image: ["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],
|
|
55
|
+
format_image_left: ["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],
|
|
56
|
+
format_image_right: ["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],
|
|
57
|
+
horizontal_rule: ["M160-440v-80h640v80H160Z"],
|
|
58
|
+
flip_to_back: ["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],
|
|
59
|
+
flip_to_front: ["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],
|
|
60
|
+
open_with: ["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],
|
|
61
|
+
tune: ["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],
|
|
62
|
+
rotate_right: ["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],
|
|
63
|
+
rotate_left: ["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],
|
|
64
|
+
swap_horiz: ["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],
|
|
65
|
+
swap_vert: ["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],
|
|
66
|
+
shapes: ["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],
|
|
67
|
+
format_paint: ["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],
|
|
68
|
+
expand_more: ["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],
|
|
69
|
+
expand_less: ["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],
|
|
70
|
+
border_top: ["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],
|
|
71
|
+
border_bottom: ["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],
|
|
72
|
+
border_left: ["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],
|
|
73
|
+
border_right: ["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],
|
|
74
|
+
border_horizontal: ["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],
|
|
75
|
+
border_vertical: ["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],
|
|
76
|
+
padding: ["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],
|
|
77
|
+
text_rotation_none: ["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],
|
|
78
|
+
wrap_text: ["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],
|
|
79
|
+
height: ["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],
|
|
80
|
+
fit_width: ["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],
|
|
81
|
+
settings: ["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],
|
|
82
|
+
border_color: ["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],
|
|
83
|
+
format_color_fill: ["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],
|
|
84
|
+
vertical_align_top: ["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],
|
|
85
|
+
vertical_align_center: ["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],
|
|
86
|
+
vertical_align_bottom: ["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],
|
|
87
|
+
line_weight: ["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],
|
|
88
|
+
keyboard_arrow_up: ["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],
|
|
89
|
+
keyboard_arrow_down: ["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],
|
|
90
|
+
keyboard_arrow_left: ["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],
|
|
91
|
+
keyboard_arrow_right: ["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],
|
|
92
|
+
more_vert: ["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],
|
|
93
|
+
page_break: ["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],
|
|
94
|
+
arrow_back: ["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],
|
|
95
|
+
branding_watermark: ["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],
|
|
96
|
+
done_all: ["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],
|
|
97
|
+
check_circle: ["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],
|
|
98
|
+
chat_bubble_outline: ["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],
|
|
99
|
+
chat_bubble_check: ["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],
|
|
100
|
+
check: ["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],
|
|
101
|
+
close: ["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],
|
|
102
|
+
add_comment: ["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],
|
|
103
|
+
comment: ["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],
|
|
104
|
+
edit_note: ["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],
|
|
105
|
+
rate_review: ["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],
|
|
106
|
+
visibility: ["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],
|
|
107
|
+
format_textdirection_l_to_r: ["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],
|
|
108
|
+
format_textdirection_r_to_l: ["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],
|
|
109
|
+
"agent-sparkle": ["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]
|
|
110
|
+
}, G = ["width", "height"], K = ["d"], q = /* @__PURE__ */ u({
|
|
111
|
+
__name: "MaterialSymbol",
|
|
112
|
+
props: {
|
|
113
|
+
name: {},
|
|
114
|
+
size: { default: 20 },
|
|
115
|
+
className: { default: "" },
|
|
116
|
+
style: {}
|
|
117
|
+
},
|
|
118
|
+
setup(e) {
|
|
119
|
+
let t = e, i = W, a = r(() => i[t.name] || (typeof console < "u" && console.warn(`Icon not found: ${t.name}`), null));
|
|
120
|
+
return (t, r) => a.value ? (v(), o("svg", {
|
|
121
|
+
key: 0,
|
|
122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
+
width: e.size,
|
|
124
|
+
height: e.size,
|
|
125
|
+
viewBox: "0 -960 960 960",
|
|
126
|
+
fill: "currentColor",
|
|
127
|
+
class: m(e.className),
|
|
128
|
+
style: h({
|
|
129
|
+
display: "inline-flex",
|
|
130
|
+
flexShrink: 0,
|
|
131
|
+
...e.style ?? {}
|
|
132
|
+
}),
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
}, [(v(!0), o(n, null, S(a.value, (e, t) => (v(), o("path", {
|
|
135
|
+
key: t,
|
|
136
|
+
d: e
|
|
137
|
+
}, null, 8, K))), 128))], 14, G)) : (v(), o("span", {
|
|
138
|
+
key: 1,
|
|
139
|
+
class: m(e.className),
|
|
140
|
+
style: h({
|
|
141
|
+
fontSize: `${e.size}px`,
|
|
142
|
+
width: `${e.size}px`,
|
|
143
|
+
height: `${e.size}px`,
|
|
144
|
+
display: "inline-flex",
|
|
145
|
+
...e.style ?? {}
|
|
146
|
+
})
|
|
147
|
+
}, T(e.name), 7));
|
|
148
|
+
}
|
|
149
|
+
}), J = ["title", "onClick"], re = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
150
|
+
__name: "CommentMarginMarkers",
|
|
151
|
+
props: {
|
|
152
|
+
comments: {},
|
|
153
|
+
pagesContainer: {},
|
|
154
|
+
zoom: {},
|
|
155
|
+
pageWidthPx: {},
|
|
156
|
+
sidebarOpen: { type: Boolean },
|
|
157
|
+
resolvedCommentIds: {}
|
|
158
|
+
},
|
|
159
|
+
emits: ["marker-click"],
|
|
160
|
+
setup(e) {
|
|
161
|
+
let t = e, i = r(() => {
|
|
162
|
+
if (t.sidebarOpen) return [];
|
|
163
|
+
let e = t.pagesContainer;
|
|
164
|
+
if (!e) return [];
|
|
165
|
+
let n = e.getBoundingClientRect(), r = /* @__PURE__ */ new Map();
|
|
166
|
+
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
167
|
+
let e = t.dataset.commentId;
|
|
168
|
+
e && !r.has(e) && r.set(e, t);
|
|
169
|
+
}
|
|
170
|
+
let i = [];
|
|
171
|
+
for (let a of t.comments) {
|
|
172
|
+
if (a.parentId != null) continue;
|
|
173
|
+
let o = r.get(String(a.id));
|
|
174
|
+
if (!o) continue;
|
|
175
|
+
let s = o.getBoundingClientRect();
|
|
176
|
+
i.push({
|
|
177
|
+
comment: a,
|
|
178
|
+
isResolved: t.resolvedCommentIds.has(a.id),
|
|
179
|
+
y: (s.top - n.top + e.scrollTop) / t.zoom
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return i;
|
|
183
|
+
}), s = r(() => ({
|
|
184
|
+
position: "absolute",
|
|
185
|
+
top: 0,
|
|
186
|
+
left: `calc(50% + ${t.pageWidthPx / t.zoom / 2 + 6}px)`,
|
|
187
|
+
zIndex: 30,
|
|
188
|
+
pointerEvents: "none"
|
|
189
|
+
}));
|
|
190
|
+
return (t, r) => i.value.length > 0 ? (v(), o("div", {
|
|
191
|
+
key: 0,
|
|
192
|
+
class: "docx-comment-margin-markers",
|
|
193
|
+
style: h(s.value),
|
|
194
|
+
onMousedown: r[0] ||= P(() => {}, ["stop"])
|
|
195
|
+
}, [(v(!0), o(n, null, S(i.value, (n) => (v(), o("button", {
|
|
196
|
+
key: n.comment.id,
|
|
197
|
+
class: "docx-comment-margin-markers__btn",
|
|
198
|
+
title: n.isResolved ? "Resolved comment" : "Comment",
|
|
199
|
+
style: h({ top: n.y * e.zoom + "px" }),
|
|
200
|
+
onClick: (e) => t.$emit("marker-click", n.comment.id)
|
|
201
|
+
}, [l(q, {
|
|
202
|
+
name: n.isResolved ? "chat_bubble_check" : "chat_bubble_outline",
|
|
203
|
+
size: 18
|
|
204
|
+
}, null, 8, ["name"])], 12, J))), 128))], 36)) : a("", !0);
|
|
205
|
+
}
|
|
206
|
+
}), [["__scopeId", "data-v-fa51d56d"]]), ie = { class: "doc-name" }, Y = ["value"], ae = {
|
|
207
|
+
key: 1,
|
|
208
|
+
class: "doc-name__text"
|
|
209
|
+
}, oe = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
210
|
+
__name: "DocumentName",
|
|
211
|
+
props: {
|
|
212
|
+
modelValue: {},
|
|
213
|
+
editable: {
|
|
214
|
+
type: Boolean,
|
|
215
|
+
default: !0
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
emits: ["update:modelValue"],
|
|
219
|
+
setup(e, { emit: t }) {
|
|
220
|
+
let n = e, i = t, a = r(() => (n.modelValue || "").replace(/\.docx$/i, ""));
|
|
221
|
+
function s(e) {
|
|
222
|
+
let t = e.target;
|
|
223
|
+
if (!(t instanceof HTMLInputElement)) return;
|
|
224
|
+
let n = t.value;
|
|
225
|
+
i("update:modelValue", n.endsWith(".docx") ? n : n + ".docx");
|
|
226
|
+
}
|
|
227
|
+
function c(e) {
|
|
228
|
+
let t = e.target;
|
|
229
|
+
t instanceof HTMLInputElement && (t.value.trim() || i("update:modelValue", "Untitled document.docx"));
|
|
230
|
+
}
|
|
231
|
+
return (t, n) => (v(), o("div", ie, [e.editable ? (v(), o("input", {
|
|
232
|
+
key: 0,
|
|
233
|
+
class: "doc-name__input",
|
|
234
|
+
value: a.value,
|
|
235
|
+
placeholder: "Untitled document",
|
|
236
|
+
onInput: s,
|
|
237
|
+
onBlur: c
|
|
238
|
+
}, null, 40, Y)) : (v(), o("span", ae, T(a.value || "Untitled document"), 1))]));
|
|
239
|
+
}
|
|
240
|
+
}), [["__scopeId", "data-v-545e2786"]]), X = 4, Z = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
241
|
+
__name: "Popover",
|
|
242
|
+
props: {
|
|
243
|
+
open: { type: Boolean },
|
|
244
|
+
placement: { default: "bottom-left" },
|
|
245
|
+
panelClass: {},
|
|
246
|
+
panelStyle: {},
|
|
247
|
+
closeOnScroll: {
|
|
248
|
+
type: Boolean,
|
|
249
|
+
default: !0
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
emits: ["close", "update:open"],
|
|
253
|
+
setup(e, { emit: t }) {
|
|
254
|
+
let n = e, r = t, i = x(null), s = x(null), c = x({ position: "fixed" });
|
|
255
|
+
function l() {
|
|
256
|
+
let e = i.value;
|
|
257
|
+
if (!e) return;
|
|
258
|
+
let t = e.getBoundingClientRect(), r = { position: "fixed" };
|
|
259
|
+
n.placement.startsWith("top") ? (r.bottom = `${Math.round(window.innerHeight - t.top + X)}px`, r.top = "auto") : (r.top = `${Math.round(t.bottom + X)}px`, r.bottom = "auto"), n.placement.endsWith("right") ? (r.right = `${Math.round(window.innerWidth - t.right)}px`, r.left = "auto") : (r.left = `${Math.round(t.left)}px`, r.right = "auto"), c.value = r;
|
|
260
|
+
}
|
|
261
|
+
function u() {
|
|
262
|
+
r("update:open", !n.open), n.open && r("close");
|
|
263
|
+
}
|
|
264
|
+
function d() {
|
|
265
|
+
r("update:open", !1), r("close");
|
|
266
|
+
}
|
|
267
|
+
function f(e) {
|
|
268
|
+
if (!n.open) return;
|
|
269
|
+
let t = e.target;
|
|
270
|
+
t instanceof Node && (i.value?.contains(t) || s.value?.contains(t) || d());
|
|
271
|
+
}
|
|
272
|
+
function p(e) {
|
|
273
|
+
e.key === "Escape" && n.open && d();
|
|
274
|
+
}
|
|
275
|
+
function y(e) {
|
|
276
|
+
!n.closeOnScroll || !n.open || e.target instanceof Node && s.value?.contains(e.target) || d();
|
|
277
|
+
}
|
|
278
|
+
function b() {
|
|
279
|
+
n.open && l();
|
|
280
|
+
}
|
|
281
|
+
function S() {
|
|
282
|
+
document.addEventListener("mousedown", f), document.addEventListener("keydown", p), window.addEventListener("scroll", y, !0), window.addEventListener("resize", b);
|
|
283
|
+
}
|
|
284
|
+
function w() {
|
|
285
|
+
document.removeEventListener("mousedown", f), document.removeEventListener("keydown", p), window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", b);
|
|
286
|
+
}
|
|
287
|
+
return A(() => n.open, (e) => {
|
|
288
|
+
e ? (l(), S()) : w();
|
|
289
|
+
}), A(() => n.placement, () => n.open && l()), _(() => {
|
|
290
|
+
n.open && (l(), S());
|
|
291
|
+
}), g(w), (t, n) => (v(), o("span", {
|
|
292
|
+
ref_key: "rootRef",
|
|
293
|
+
ref: i,
|
|
294
|
+
class: "docx-popover"
|
|
295
|
+
}, [C(t.$slots, "trigger", {
|
|
296
|
+
toggle: u,
|
|
297
|
+
open: e.open
|
|
298
|
+
}, void 0, !0), e.open ? (v(), o("div", {
|
|
299
|
+
key: 0,
|
|
300
|
+
ref_key: "panelRef",
|
|
301
|
+
ref: s,
|
|
302
|
+
class: m(["docx-popover__panel", e.panelClass]),
|
|
303
|
+
style: h([c.value, e.panelStyle ?? {}]),
|
|
304
|
+
onMousedown: n[0] ||= P(() => {}, ["stop"])
|
|
305
|
+
}, [C(t.$slots, "panel", {}, void 0, !0)], 38)) : a("", !0)], 512));
|
|
306
|
+
}
|
|
307
|
+
}), [["__scopeId", "data-v-0f634953"]]), se = ["disabled", "onClick"], Q = {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: "docx-menu-dropdown__separator"
|
|
310
|
+
}, ce = ["onMouseenter", "onMouseleave"], le = ["disabled", "onClick"], ue = { class: "docx-menu-dropdown__label" }, de = {
|
|
311
|
+
key: 1,
|
|
312
|
+
class: "docx-menu-dropdown__shortcut"
|
|
313
|
+
}, fe = {
|
|
314
|
+
key: 2,
|
|
315
|
+
class: "docx-menu-dropdown__chevron"
|
|
316
|
+
}, pe = {
|
|
317
|
+
key: 0,
|
|
318
|
+
class: "docx-menu-dropdown__submenu"
|
|
319
|
+
}, $ = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
320
|
+
__name: "MenuDropdown",
|
|
321
|
+
props: {
|
|
322
|
+
label: {},
|
|
323
|
+
items: {},
|
|
324
|
+
disabled: { type: Boolean },
|
|
325
|
+
showChevron: {
|
|
326
|
+
type: Boolean,
|
|
327
|
+
default: !1
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
setup(e) {
|
|
331
|
+
function t(e) {
|
|
332
|
+
return "type" in e && e.type === "separator";
|
|
333
|
+
}
|
|
334
|
+
let r = x(!1), u = x(null);
|
|
335
|
+
function d() {
|
|
336
|
+
r.value = !1, u.value = null;
|
|
337
|
+
}
|
|
338
|
+
function f(e) {
|
|
339
|
+
e.disabled || e.submenu || (e.onClick?.(), d());
|
|
340
|
+
}
|
|
341
|
+
return (p, h) => (v(), i(Z, {
|
|
342
|
+
open: r.value,
|
|
343
|
+
"onUpdate:open": h[2] ||= (e) => r.value = e,
|
|
344
|
+
onClose: d
|
|
345
|
+
}, {
|
|
346
|
+
trigger: j(({ toggle: t }) => [s("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
class: m(["docx-menu-dropdown__trigger", { "docx-menu-dropdown__trigger--open": r.value }]),
|
|
349
|
+
disabled: e.disabled,
|
|
350
|
+
onMousedown: h[0] ||= P(() => {}, ["prevent"]),
|
|
351
|
+
onClick: P(t, ["prevent"])
|
|
352
|
+
}, [c(T(e.label) + " ", 1), e.showChevron ? (v(), i(q, {
|
|
353
|
+
key: 0,
|
|
354
|
+
name: "arrow_drop_down",
|
|
355
|
+
size: 16
|
|
356
|
+
})) : a("", !0)], 42, se)]),
|
|
357
|
+
panel: j(() => [s("div", {
|
|
358
|
+
class: "docx-menu-dropdown__menu",
|
|
359
|
+
onMousedown: h[1] ||= P(() => {}, ["prevent"])
|
|
360
|
+
}, [(v(!0), o(n, null, S(e.items, (e, r) => (v(), o(n, { key: r }, [t(e) ? (v(), o("div", Q)) : (v(), o("div", {
|
|
361
|
+
key: 1,
|
|
362
|
+
class: "docx-menu-dropdown__wrap",
|
|
363
|
+
onMouseenter: (t) => e.submenu ? u.value = r : void 0,
|
|
364
|
+
onMouseleave: (t) => e.submenu ? u.value = null : void 0
|
|
365
|
+
}, [s("button", {
|
|
366
|
+
type: "button",
|
|
367
|
+
class: m(["docx-menu-dropdown__item", { "docx-menu-dropdown__item--disabled": e.disabled }]),
|
|
368
|
+
disabled: e.disabled,
|
|
369
|
+
onClick: P((t) => f(e), ["prevent"])
|
|
370
|
+
}, [
|
|
371
|
+
e.icon ? (v(), i(q, {
|
|
372
|
+
key: 0,
|
|
373
|
+
name: e.icon,
|
|
374
|
+
size: 18
|
|
375
|
+
}, null, 8, ["name"])) : a("", !0),
|
|
376
|
+
s("span", ue, T(e.label), 1),
|
|
377
|
+
e.shortcut ? (v(), o("span", de, T(e.shortcut), 1)) : a("", !0),
|
|
378
|
+
e.submenu ? (v(), o("span", fe, [l(q, {
|
|
379
|
+
name: "keyboard_arrow_right",
|
|
380
|
+
size: 16
|
|
381
|
+
})])) : a("", !0)
|
|
382
|
+
], 10, le), e.submenu && u.value === r ? (v(), o("div", pe, [C(p.$slots, "submenu", {
|
|
383
|
+
item: e,
|
|
384
|
+
closeMenu: d
|
|
385
|
+
}, void 0, !0)])) : a("", !0)], 40, ce))], 64))), 128))], 32)]),
|
|
386
|
+
_: 3
|
|
387
|
+
}, 8, ["open"]));
|
|
388
|
+
}
|
|
389
|
+
}), [["__scopeId", "data-v-d89898cc"]]), me = ["aria-selected", "onMouseenter"], he = { class: "docx-table-grid-inline__label" }, ge = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
390
|
+
__name: "TableGridInline",
|
|
391
|
+
props: {
|
|
392
|
+
gridRows: { default: 6 },
|
|
393
|
+
gridColumns: { default: 6 }
|
|
394
|
+
},
|
|
395
|
+
emits: ["insert"],
|
|
396
|
+
setup(e, { emit: t }) {
|
|
397
|
+
let i = e, a = t, c = x(0), l = x(0), u = r(() => {
|
|
398
|
+
let e = [];
|
|
399
|
+
for (let t = 1; t <= i.gridRows; t++) for (let n = 1; n <= i.gridColumns; n++) e.push({
|
|
400
|
+
r: t,
|
|
401
|
+
c: n
|
|
402
|
+
});
|
|
403
|
+
return e;
|
|
404
|
+
});
|
|
405
|
+
function d() {
|
|
406
|
+
c.value > 0 && l.value > 0 && a("insert", c.value, l.value);
|
|
407
|
+
}
|
|
408
|
+
return (t, r) => (v(), o("div", null, [s("div", {
|
|
409
|
+
class: "docx-table-grid-inline__grid",
|
|
410
|
+
style: h({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` }),
|
|
411
|
+
role: "grid",
|
|
412
|
+
"aria-label": "Table size selector",
|
|
413
|
+
onMouseleave: r[0] ||= (e) => {
|
|
414
|
+
c.value = 0, l.value = 0;
|
|
415
|
+
}
|
|
416
|
+
}, [(v(!0), o(n, null, S(u.value, (e) => (v(), o("div", {
|
|
417
|
+
key: `${e.r}-${e.c}`,
|
|
418
|
+
class: m(["docx-table-grid-inline__cell", { "docx-table-grid-inline__cell--active": e.r <= c.value && e.c <= l.value }]),
|
|
419
|
+
role: "gridcell",
|
|
420
|
+
"aria-selected": e.r <= c.value && e.c <= l.value,
|
|
421
|
+
onMouseenter: (t) => {
|
|
422
|
+
c.value = e.r, l.value = e.c;
|
|
423
|
+
},
|
|
424
|
+
onClick: P(d, ["prevent"])
|
|
425
|
+
}, null, 42, me))), 128))], 36), s("div", he, T(c.value > 0 && l.value > 0 ? `${l.value} × ${c.value}` : "Select size"), 1)]));
|
|
426
|
+
}
|
|
427
|
+
}), [["__scopeId", "data-v-62b10375"]]), _e = {
|
|
428
|
+
class: "menu-bar",
|
|
429
|
+
role: "menubar"
|
|
430
|
+
}, ve = {
|
|
431
|
+
key: 1,
|
|
432
|
+
class: "menu-bar__break-submenu"
|
|
433
|
+
}, ye = ["onClick"], be = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
434
|
+
__name: "MenuBar",
|
|
435
|
+
props: {
|
|
436
|
+
showFileOpen: {
|
|
437
|
+
type: Boolean,
|
|
438
|
+
default: !0
|
|
439
|
+
},
|
|
440
|
+
showHelpMenu: {
|
|
441
|
+
type: Boolean,
|
|
442
|
+
default: !0
|
|
443
|
+
},
|
|
444
|
+
showTableInsert: {
|
|
445
|
+
type: Boolean,
|
|
446
|
+
default: !0
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
emits: ["action", "insert-table"],
|
|
450
|
+
setup(t, { emit: c }) {
|
|
451
|
+
let u = t, d = c, { t: f } = e();
|
|
452
|
+
function p(e) {
|
|
453
|
+
return () => d("action", e);
|
|
454
|
+
}
|
|
455
|
+
let m = r(() => {
|
|
456
|
+
let e = [];
|
|
457
|
+
return u.showFileOpen && e.push({
|
|
458
|
+
icon: "file_upload",
|
|
459
|
+
label: f("toolbar.open"),
|
|
460
|
+
shortcut: f("toolbar.openShortcut"),
|
|
461
|
+
onClick: p("open")
|
|
462
|
+
}), e.push({
|
|
463
|
+
icon: "file_download",
|
|
464
|
+
label: f("toolbar.save"),
|
|
465
|
+
shortcut: f("toolbar.saveShortcut"),
|
|
466
|
+
onClick: p("save")
|
|
467
|
+
}, { type: "separator" }, {
|
|
468
|
+
icon: "settings",
|
|
469
|
+
label: f("toolbar.pageSetup"),
|
|
470
|
+
onClick: p("pageSetup")
|
|
471
|
+
}), e;
|
|
472
|
+
}), h = r(() => [{
|
|
473
|
+
icon: "format_textdirection_l_to_r",
|
|
474
|
+
label: f("toolbar.leftToRight"),
|
|
475
|
+
onClick: p("dirLTR")
|
|
476
|
+
}, {
|
|
477
|
+
icon: "format_textdirection_r_to_l",
|
|
478
|
+
label: f("toolbar.rightToLeft"),
|
|
479
|
+
onClick: p("dirRTL")
|
|
480
|
+
}]), g = r(() => {
|
|
481
|
+
let e = [{
|
|
482
|
+
icon: "image",
|
|
483
|
+
label: f("toolbar.image"),
|
|
484
|
+
onClick: p("insertImage")
|
|
485
|
+
}];
|
|
486
|
+
return u.showTableInsert && e.push({
|
|
487
|
+
icon: "grid_on",
|
|
488
|
+
label: f("toolbar.table"),
|
|
489
|
+
key: "table",
|
|
490
|
+
submenu: !0
|
|
491
|
+
}), e.push({ type: "separator" }, {
|
|
492
|
+
icon: "page_break",
|
|
493
|
+
label: f("toolbar.break"),
|
|
494
|
+
key: "break",
|
|
495
|
+
submenu: !0
|
|
496
|
+
}, {
|
|
497
|
+
icon: "format_list_numbered",
|
|
498
|
+
label: f("toolbar.tableOfContents"),
|
|
499
|
+
onClick: p("insertTOC")
|
|
500
|
+
}, {
|
|
501
|
+
icon: "branding_watermark",
|
|
502
|
+
label: f("toolbar.watermark"),
|
|
503
|
+
onClick: p("watermark")
|
|
504
|
+
}), e;
|
|
505
|
+
}), _ = r(() => [
|
|
506
|
+
{
|
|
507
|
+
icon: "page_break",
|
|
508
|
+
label: f("toolbar.pageBreak"),
|
|
509
|
+
action: "insertPageBreak"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
icon: "horizontal_rule",
|
|
513
|
+
label: f("toolbar.sectionBreakNextPage"),
|
|
514
|
+
action: "insertSectionBreakNextPage"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
icon: "border_horizontal",
|
|
518
|
+
label: f("toolbar.sectionBreakContinuous"),
|
|
519
|
+
action: "insertSectionBreakContinuous"
|
|
520
|
+
}
|
|
521
|
+
]), y = r(() => [{
|
|
522
|
+
label: f("toolbar.reportIssue"),
|
|
523
|
+
onClick: p("reportIssue")
|
|
524
|
+
}]);
|
|
525
|
+
return (e, r) => (v(), o("div", _e, [
|
|
526
|
+
l($, {
|
|
527
|
+
label: D(f)("toolbar.file"),
|
|
528
|
+
items: m.value
|
|
529
|
+
}, null, 8, ["label", "items"]),
|
|
530
|
+
l($, {
|
|
531
|
+
label: D(f)("toolbar.format"),
|
|
532
|
+
items: h.value
|
|
533
|
+
}, null, 8, ["label", "items"]),
|
|
534
|
+
l($, {
|
|
535
|
+
label: D(f)("toolbar.insert"),
|
|
536
|
+
items: g.value
|
|
537
|
+
}, {
|
|
538
|
+
submenu: j(({ item: e, closeMenu: t }) => [e.key === "table" ? (v(), i(ge, {
|
|
539
|
+
key: 0,
|
|
540
|
+
onInsert: (e, n) => {
|
|
541
|
+
d("insert-table", e, n), t();
|
|
542
|
+
}
|
|
543
|
+
}, null, 8, ["onInsert"])) : e.key === "break" ? (v(), o("div", ve, [(v(!0), o(n, null, S(_.value, (e) => (v(), o("button", {
|
|
544
|
+
key: e.action,
|
|
545
|
+
type: "button",
|
|
546
|
+
class: "menu-bar__break-item",
|
|
547
|
+
onClick: P(() => {
|
|
548
|
+
d("action", e.action), t();
|
|
549
|
+
}, ["prevent"])
|
|
550
|
+
}, [l(q, {
|
|
551
|
+
name: e.icon,
|
|
552
|
+
size: 18
|
|
553
|
+
}, null, 8, ["name"]), s("span", null, T(e.label), 1)], 8, ye))), 128))])) : a("", !0)]),
|
|
554
|
+
_: 1
|
|
555
|
+
}, 8, ["label", "items"]),
|
|
556
|
+
t.showHelpMenu ? (v(), i($, {
|
|
557
|
+
key: 0,
|
|
558
|
+
label: D(f)("toolbar.help"),
|
|
559
|
+
items: y.value
|
|
560
|
+
}, null, 8, ["label", "items"])) : a("", !0)
|
|
561
|
+
]));
|
|
562
|
+
}
|
|
563
|
+
}), [["__scopeId", "data-v-19abfdee"]]), xe = [
|
|
564
|
+
"disabled",
|
|
565
|
+
"aria-label",
|
|
566
|
+
"title",
|
|
567
|
+
"aria-expanded",
|
|
568
|
+
"onClick"
|
|
569
|
+
], Se = { class: "docx-icon-grid__panel" }, Ce = ["title", "onClick"], we = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
570
|
+
__name: "IconGridDropdown",
|
|
571
|
+
props: {
|
|
572
|
+
options: {},
|
|
573
|
+
activeValue: {},
|
|
574
|
+
triggerIcon: {},
|
|
575
|
+
tooltipContent: {},
|
|
576
|
+
disabled: { type: Boolean },
|
|
577
|
+
ariaLabel: {}
|
|
578
|
+
},
|
|
579
|
+
emits: ["select"],
|
|
580
|
+
setup(e, { emit: t }) {
|
|
581
|
+
let r = t, a = x(!1);
|
|
582
|
+
function c(e) {
|
|
583
|
+
r("select", e), a.value = !1;
|
|
584
|
+
}
|
|
585
|
+
return (t, r) => (v(), i(Z, {
|
|
586
|
+
open: a.value,
|
|
587
|
+
"onUpdate:open": r[0] ||= (e) => a.value = e,
|
|
588
|
+
onClose: r[1] ||= (e) => a.value = !1
|
|
589
|
+
}, {
|
|
590
|
+
trigger: j(({ toggle: t }) => [s("button", {
|
|
591
|
+
type: "button",
|
|
592
|
+
class: m(["docx-icon-grid__btn", { "docx-icon-grid__btn--open": a.value }]),
|
|
593
|
+
disabled: e.disabled,
|
|
594
|
+
"aria-label": e.ariaLabel ?? e.tooltipContent,
|
|
595
|
+
title: e.tooltipContent,
|
|
596
|
+
"aria-expanded": a.value,
|
|
597
|
+
"aria-haspopup": "true",
|
|
598
|
+
onClick: P(t, ["prevent"])
|
|
599
|
+
}, [l(q, {
|
|
600
|
+
name: e.triggerIcon,
|
|
601
|
+
size: 20
|
|
602
|
+
}, null, 8, ["name"]), l(q, {
|
|
603
|
+
name: "arrow_drop_down",
|
|
604
|
+
size: 14
|
|
605
|
+
})], 10, xe)]),
|
|
606
|
+
panel: j(() => [s("div", Se, [(v(!0), o(n, null, S(e.options, (t) => (v(), o("button", {
|
|
607
|
+
key: t.value,
|
|
608
|
+
type: "button",
|
|
609
|
+
class: m(["docx-icon-grid__option", { "docx-icon-grid__option--active": e.activeValue === t.value }]),
|
|
610
|
+
title: t.label,
|
|
611
|
+
onClick: P((e) => c(t.value), ["prevent"])
|
|
612
|
+
}, [l(q, {
|
|
613
|
+
name: t.iconName,
|
|
614
|
+
size: 18
|
|
615
|
+
}, null, 8, ["name"])], 10, Ce))), 128))])]),
|
|
616
|
+
_: 1
|
|
617
|
+
}, 8, ["open"]));
|
|
618
|
+
}
|
|
619
|
+
}), [["__scopeId", "data-v-b64cef07"]]), Te = /* @__PURE__ */ u({
|
|
620
|
+
__name: "ImageWrapDropdown",
|
|
621
|
+
props: {
|
|
622
|
+
imageContext: {},
|
|
623
|
+
disabled: { type: Boolean }
|
|
624
|
+
},
|
|
625
|
+
emits: ["change"],
|
|
626
|
+
setup(t) {
|
|
627
|
+
let n = t, { t: a } = e(), o = [
|
|
628
|
+
{
|
|
629
|
+
value: "inline",
|
|
630
|
+
labelKey: "imageWrap.inline",
|
|
631
|
+
iconName: "format_image_left"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
value: "wrapRight",
|
|
635
|
+
labelKey: "imageWrap.floatLeft",
|
|
636
|
+
iconName: "format_image_right"
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
value: "wrapLeft",
|
|
640
|
+
labelKey: "imageWrap.floatRight",
|
|
641
|
+
iconName: "format_image_left"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
value: "topAndBottom",
|
|
645
|
+
labelKey: "imageWrap.topAndBottom",
|
|
646
|
+
iconName: "horizontal_rule"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
value: "behind",
|
|
650
|
+
labelKey: "imageWrap.behindText",
|
|
651
|
+
iconName: "flip_to_back"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
value: "inFront",
|
|
655
|
+
labelKey: "imageWrap.inFrontOfText",
|
|
656
|
+
iconName: "flip_to_front"
|
|
657
|
+
}
|
|
658
|
+
], s = r(() => o.map((e) => ({
|
|
659
|
+
value: e.value,
|
|
660
|
+
label: a(e.labelKey),
|
|
661
|
+
iconName: e.iconName
|
|
662
|
+
}))), c = r(() => {
|
|
663
|
+
let e = n.imageContext;
|
|
664
|
+
return e.displayMode === "float" && e.cssFloat === "left" ? "wrapRight" : e.displayMode === "float" && e.cssFloat === "right" ? "wrapLeft" : e.wrapType;
|
|
665
|
+
}), l = r(() => s.value.find((e) => e.value === c.value) ?? s.value.at(0)), u = r(() => l.value?.iconName ?? "format_image_left"), d = r(() => l.value?.label ?? "");
|
|
666
|
+
return (e, n) => (v(), i(we, {
|
|
667
|
+
options: s.value,
|
|
668
|
+
"active-value": c.value,
|
|
669
|
+
"trigger-icon": u.value,
|
|
670
|
+
"tooltip-content": D(a)("imageWrap.tooltipPrefix", { label: d.value }),
|
|
671
|
+
disabled: t.disabled,
|
|
672
|
+
onSelect: n[0] ||= (t) => e.$emit("change", t)
|
|
673
|
+
}, null, 8, [
|
|
674
|
+
"options",
|
|
675
|
+
"active-value",
|
|
676
|
+
"trigger-icon",
|
|
677
|
+
"tooltip-content",
|
|
678
|
+
"disabled"
|
|
679
|
+
]));
|
|
680
|
+
}
|
|
681
|
+
}), Ee = /* @__PURE__ */ u({
|
|
682
|
+
__name: "ImageTransformDropdown",
|
|
683
|
+
props: { disabled: { type: Boolean } },
|
|
684
|
+
emits: ["transform"],
|
|
685
|
+
setup(t) {
|
|
686
|
+
let { t: n } = e(), a = [
|
|
687
|
+
{
|
|
688
|
+
value: "rotateCW",
|
|
689
|
+
labelKey: "imageTransform.rotateClockwise",
|
|
690
|
+
iconName: "rotate_right"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
value: "rotateCCW",
|
|
694
|
+
labelKey: "imageTransform.rotateCounterClockwise",
|
|
695
|
+
iconName: "rotate_left"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
value: "flipH",
|
|
699
|
+
labelKey: "imageTransform.flipHorizontal",
|
|
700
|
+
iconName: "swap_horiz"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
value: "flipV",
|
|
704
|
+
labelKey: "imageTransform.flipVertical",
|
|
705
|
+
iconName: "swap_vert"
|
|
706
|
+
}
|
|
707
|
+
], o = r(() => a.map((e) => ({
|
|
708
|
+
value: e.value,
|
|
709
|
+
label: n(e.labelKey),
|
|
710
|
+
iconName: e.iconName
|
|
711
|
+
})));
|
|
712
|
+
return (e, r) => (v(), i(we, {
|
|
713
|
+
options: o.value,
|
|
714
|
+
"trigger-icon": "rotate_right",
|
|
715
|
+
"tooltip-content": D(n)("imageTransform.tooltip"),
|
|
716
|
+
disabled: t.disabled,
|
|
717
|
+
onSelect: r[0] ||= (t) => e.$emit("transform", t)
|
|
718
|
+
}, null, 8, [
|
|
719
|
+
"options",
|
|
720
|
+
"tooltip-content",
|
|
721
|
+
"disabled"
|
|
722
|
+
]));
|
|
723
|
+
}
|
|
724
|
+
}), De = ["title", "onClick"], Oe = {
|
|
725
|
+
key: 0,
|
|
726
|
+
class: "editing-mode__label"
|
|
727
|
+
}, ke = { class: "editing-mode__panel" }, Ae = ["onClick"], je = { class: "editing-mode__option-text" }, Me = { class: "editing-mode__option-label" }, Ne = { class: "editing-mode__option-desc" }, Pe = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
728
|
+
__name: "EditingModeDropdown",
|
|
729
|
+
props: { modelValue: {} },
|
|
730
|
+
emits: ["update:modelValue"],
|
|
731
|
+
setup(t, { emit: c }) {
|
|
732
|
+
let { t: u } = e(), d = t, f = c, p = {
|
|
733
|
+
value: "editing",
|
|
734
|
+
labelKey: "editor.editing",
|
|
735
|
+
icon: "edit_note",
|
|
736
|
+
descKey: "editor.editingDescription"
|
|
737
|
+
}, h = [
|
|
738
|
+
p,
|
|
739
|
+
{
|
|
740
|
+
value: "suggesting",
|
|
741
|
+
labelKey: "editor.suggesting",
|
|
742
|
+
icon: "rate_review",
|
|
743
|
+
descKey: "editor.suggestingDescription"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
value: "viewing",
|
|
747
|
+
labelKey: "editor.viewing",
|
|
748
|
+
icon: "visibility",
|
|
749
|
+
descKey: "editor.viewingDescription"
|
|
750
|
+
}
|
|
751
|
+
], y = x(!1), b = x(!1), C = r(() => h.find((e) => e.value === d.modelValue) ?? p);
|
|
752
|
+
function w(e) {
|
|
753
|
+
f("update:modelValue", e), y.value = !1;
|
|
754
|
+
}
|
|
755
|
+
let E = null;
|
|
756
|
+
function O(e) {
|
|
757
|
+
b.value = e.matches;
|
|
758
|
+
}
|
|
759
|
+
return _(() => {
|
|
760
|
+
E = window.matchMedia("(max-width: 1400px)"), b.value = E.matches, E.addEventListener("change", O);
|
|
761
|
+
}), g(() => E?.removeEventListener("change", O)), (e, r) => (v(), i(Z, {
|
|
762
|
+
open: y.value,
|
|
763
|
+
placement: "bottom-right",
|
|
764
|
+
"onUpdate:open": r[0] ||= (e) => y.value = e,
|
|
765
|
+
onClose: r[1] ||= (e) => y.value = !1
|
|
766
|
+
}, {
|
|
767
|
+
trigger: j(({ toggle: e }) => [s("button", {
|
|
768
|
+
type: "button",
|
|
769
|
+
class: m(["editing-mode__trigger", {
|
|
770
|
+
"editing-mode__trigger--open": y.value,
|
|
771
|
+
"editing-mode__trigger--compact": b.value
|
|
772
|
+
}]),
|
|
773
|
+
title: `${D(u)(C.value.labelKey)} (Ctrl+Shift+E)`,
|
|
774
|
+
onClick: P(e, ["prevent"])
|
|
775
|
+
}, [
|
|
776
|
+
l(q, {
|
|
777
|
+
name: C.value.icon,
|
|
778
|
+
size: 18
|
|
779
|
+
}, null, 8, ["name"]),
|
|
780
|
+
b.value ? a("", !0) : (v(), o("span", Oe, T(D(u)(C.value.labelKey)), 1)),
|
|
781
|
+
l(q, {
|
|
782
|
+
name: "arrow_drop_down",
|
|
783
|
+
size: 16
|
|
784
|
+
})
|
|
785
|
+
], 10, De)]),
|
|
786
|
+
panel: j(() => [s("div", ke, [(v(), o(n, null, S(h, (e) => s("button", {
|
|
787
|
+
key: e.value,
|
|
788
|
+
type: "button",
|
|
789
|
+
class: "editing-mode__option",
|
|
790
|
+
onClick: P((t) => w(e.value), ["prevent"])
|
|
791
|
+
}, [
|
|
792
|
+
l(q, {
|
|
793
|
+
name: e.icon,
|
|
794
|
+
size: 20
|
|
795
|
+
}, null, 8, ["name"]),
|
|
796
|
+
s("span", je, [s("span", Me, T(D(u)(e.labelKey)), 1), s("span", Ne, T(D(u)(e.descKey)), 1)]),
|
|
797
|
+
e.value === t.modelValue ? (v(), i(q, {
|
|
798
|
+
key: 0,
|
|
799
|
+
name: "check",
|
|
800
|
+
size: 18,
|
|
801
|
+
class: "editing-mode__check"
|
|
802
|
+
})) : a("", !0)
|
|
803
|
+
], 8, Ae)), 64))])]),
|
|
804
|
+
_: 1
|
|
805
|
+
}, 8, ["open"]));
|
|
806
|
+
}
|
|
807
|
+
}), [["__scopeId", "data-v-91bf1860"]]), Fe = { class: "review-controls" }, Ie = [
|
|
808
|
+
"disabled",
|
|
809
|
+
"aria-pressed",
|
|
810
|
+
"aria-label",
|
|
811
|
+
"title"
|
|
812
|
+
], Le = { class: "review-controls__toggle-label" }, Re = ["title", "onClick"], ze = { class: "review-controls__display-label" }, Be = ["onClick"], Ve = { class: "review-controls__option-label" }, He = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
813
|
+
__name: "ReviewControls",
|
|
814
|
+
props: {
|
|
815
|
+
trackChangesOn: { type: Boolean },
|
|
816
|
+
displayMode: {},
|
|
817
|
+
readOnly: {
|
|
818
|
+
type: Boolean,
|
|
819
|
+
default: !1
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
emits: ["toggle-track-changes", "update:display-mode"],
|
|
823
|
+
setup(t, { emit: c }) {
|
|
824
|
+
let { t: u } = e(), d = t, f = c, p = x(!1), h = {
|
|
825
|
+
"all-markup": "markupView.allMarkup",
|
|
826
|
+
"simple-markup": "markupView.simple",
|
|
827
|
+
"no-markup": "markupView.noMarkup",
|
|
828
|
+
original: "markupView.original"
|
|
829
|
+
};
|
|
830
|
+
function g(e) {
|
|
831
|
+
return u(h[e]);
|
|
832
|
+
}
|
|
833
|
+
let _ = r(() => g(d.displayMode));
|
|
834
|
+
function y(e) {
|
|
835
|
+
f("update:display-mode", e), p.value = !1;
|
|
836
|
+
}
|
|
837
|
+
return (e, r) => (v(), o("div", Fe, [s("button", {
|
|
838
|
+
type: "button",
|
|
839
|
+
class: m(["review-controls__toggle", { "review-controls__toggle--on": t.trackChangesOn }]),
|
|
840
|
+
disabled: t.readOnly,
|
|
841
|
+
"aria-pressed": t.trackChangesOn,
|
|
842
|
+
"aria-label": D(u)("toggleTrackChanges"),
|
|
843
|
+
title: D(u)("toggleTrackChanges"),
|
|
844
|
+
onMousedown: r[0] ||= P(() => {}, ["prevent"]),
|
|
845
|
+
onClick: r[1] ||= P((t) => e.$emit("toggle-track-changes"), ["prevent"])
|
|
846
|
+
}, [l(q, {
|
|
847
|
+
name: "edit_note",
|
|
848
|
+
size: 18
|
|
849
|
+
}), s("span", Le, T(t.trackChangesOn ? D(u)("trackingOn") : D(u)("trackingOff")), 1)], 42, Ie), l(Z, {
|
|
850
|
+
open: p.value,
|
|
851
|
+
placement: "bottom-right",
|
|
852
|
+
"onUpdate:open": r[4] ||= (e) => p.value = e,
|
|
853
|
+
onClose: r[5] ||= (e) => p.value = !1
|
|
854
|
+
}, {
|
|
855
|
+
trigger: j(({ toggle: e }) => [s("button", {
|
|
856
|
+
type: "button",
|
|
857
|
+
class: m(["review-controls__display", { "review-controls__display--open": p.value }]),
|
|
858
|
+
title: _.value,
|
|
859
|
+
onMousedown: r[2] ||= P(() => {}, ["prevent"]),
|
|
860
|
+
onClick: P(e, ["prevent"])
|
|
861
|
+
}, [
|
|
862
|
+
l(q, {
|
|
863
|
+
name: "visibility",
|
|
864
|
+
size: 16
|
|
865
|
+
}),
|
|
866
|
+
s("span", ze, T(_.value), 1),
|
|
867
|
+
l(q, {
|
|
868
|
+
name: "arrow_drop_down",
|
|
869
|
+
size: 16
|
|
870
|
+
})
|
|
871
|
+
], 42, Re)]),
|
|
872
|
+
panel: j(() => [s("div", {
|
|
873
|
+
class: "review-controls__panel",
|
|
874
|
+
onMousedown: r[3] ||= P(() => {}, ["prevent"])
|
|
875
|
+
}, [(v(!0), o(n, null, S(D(R), (e) => (v(), o("button", {
|
|
876
|
+
key: e,
|
|
877
|
+
type: "button",
|
|
878
|
+
class: "review-controls__option",
|
|
879
|
+
onClick: P((t) => y(e), ["prevent"])
|
|
880
|
+
}, [s("span", Ve, T(g(e)), 1), e === t.displayMode ? (v(), i(q, {
|
|
881
|
+
key: 0,
|
|
882
|
+
name: "check",
|
|
883
|
+
size: 18,
|
|
884
|
+
class: "review-controls__check"
|
|
885
|
+
})) : a("", !0)], 8, Be))), 128))], 32)]),
|
|
886
|
+
_: 1
|
|
887
|
+
}, 8, ["open"])]));
|
|
888
|
+
}
|
|
889
|
+
}), [["__scopeId", "data-v-96540653"]]);
|
|
890
|
+
//#endregion
|
|
891
|
+
//#region src/utils/fontOptions.ts
|
|
892
|
+
function Ue(e) {
|
|
893
|
+
if (e === void 0) return;
|
|
894
|
+
let t = e.map((e) => typeof e == "string" ? {
|
|
895
|
+
name: e,
|
|
896
|
+
fontFamily: e,
|
|
897
|
+
category: "other"
|
|
898
|
+
} : e);
|
|
899
|
+
if (We()) {
|
|
900
|
+
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
901
|
+
for (let r of t) n.has(r.name) && !e.has(r.name) && (console.warn(`[DocxEditor] Duplicate font name in fontFamilies: "${r.name}"`), e.add(r.name)), n.add(r.name);
|
|
902
|
+
}
|
|
903
|
+
return t;
|
|
904
|
+
}
|
|
905
|
+
function We() {
|
|
906
|
+
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
907
|
+
}
|
|
908
|
+
function Ge(e, t) {
|
|
909
|
+
if (!e || e.length === 0) return [];
|
|
910
|
+
let n = /* @__PURE__ */ new Set();
|
|
911
|
+
for (let e of t) n.add(e.trim().toLowerCase());
|
|
912
|
+
let r = /* @__PURE__ */ new Set(), i = [];
|
|
913
|
+
for (let t of e) {
|
|
914
|
+
let e = t.name.trim().toLowerCase();
|
|
915
|
+
n.has(e) || r.has(e) || (r.add(e), i.push(t));
|
|
916
|
+
}
|
|
917
|
+
return i;
|
|
918
|
+
}
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/components/Toolbar/presets.ts
|
|
921
|
+
var Ke = [
|
|
922
|
+
{
|
|
923
|
+
name: "Arial",
|
|
924
|
+
fontFamily: "Arial",
|
|
925
|
+
category: "sans-serif"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
name: "Calibri",
|
|
929
|
+
fontFamily: "Calibri",
|
|
930
|
+
category: "sans-serif"
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
name: "Helvetica",
|
|
934
|
+
fontFamily: "Helvetica",
|
|
935
|
+
category: "sans-serif"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
name: "Verdana",
|
|
939
|
+
fontFamily: "Verdana",
|
|
940
|
+
category: "sans-serif"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
name: "Open Sans",
|
|
944
|
+
fontFamily: "Open Sans",
|
|
945
|
+
category: "sans-serif"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
name: "Roboto",
|
|
949
|
+
fontFamily: "Roboto",
|
|
950
|
+
category: "sans-serif"
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
name: "Times New Roman",
|
|
954
|
+
fontFamily: "Times New Roman",
|
|
955
|
+
category: "serif"
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
name: "Georgia",
|
|
959
|
+
fontFamily: "Georgia",
|
|
960
|
+
category: "serif"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
name: "Cambria",
|
|
964
|
+
fontFamily: "Cambria",
|
|
965
|
+
category: "serif"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
name: "Garamond",
|
|
969
|
+
fontFamily: "Garamond",
|
|
970
|
+
category: "serif"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
name: "Courier New",
|
|
974
|
+
fontFamily: "Courier New",
|
|
975
|
+
category: "monospace"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
name: "Consolas",
|
|
979
|
+
fontFamily: "Consolas",
|
|
980
|
+
category: "monospace"
|
|
981
|
+
}
|
|
982
|
+
], qe = [
|
|
983
|
+
8,
|
|
984
|
+
9,
|
|
985
|
+
10,
|
|
986
|
+
11,
|
|
987
|
+
12,
|
|
988
|
+
14,
|
|
989
|
+
16,
|
|
990
|
+
18,
|
|
991
|
+
20,
|
|
992
|
+
24,
|
|
993
|
+
28,
|
|
994
|
+
36,
|
|
995
|
+
48,
|
|
996
|
+
72
|
|
997
|
+
], Je = [
|
|
998
|
+
{
|
|
999
|
+
id: "Normal",
|
|
1000
|
+
label: "Normal",
|
|
1001
|
+
nameKey: "styles.normalText"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
id: "Title",
|
|
1005
|
+
label: "Title",
|
|
1006
|
+
nameKey: "styles.title"
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
id: "Subtitle",
|
|
1010
|
+
label: "Subtitle",
|
|
1011
|
+
nameKey: "styles.subtitle"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
id: "Heading1",
|
|
1015
|
+
label: "Heading 1",
|
|
1016
|
+
nameKey: "styles.heading1"
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
id: "Heading2",
|
|
1020
|
+
label: "Heading 2",
|
|
1021
|
+
nameKey: "styles.heading2"
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
id: "Heading3",
|
|
1025
|
+
label: "Heading 3",
|
|
1026
|
+
nameKey: "styles.heading3"
|
|
1027
|
+
}
|
|
1028
|
+
], Ye = [
|
|
1029
|
+
{
|
|
1030
|
+
label: "Single",
|
|
1031
|
+
labelKey: "lineSpacing.single",
|
|
1032
|
+
value: 240
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
label: "1.15",
|
|
1036
|
+
value: 276
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
label: "1.5",
|
|
1040
|
+
value: 360
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
label: "Double",
|
|
1044
|
+
labelKey: "lineSpacing.double",
|
|
1045
|
+
value: 480
|
|
1046
|
+
}
|
|
1047
|
+
], Xe = [
|
|
1048
|
+
.5,
|
|
1049
|
+
.75,
|
|
1050
|
+
1,
|
|
1051
|
+
1.25,
|
|
1052
|
+
1.5,
|
|
1053
|
+
2
|
|
1054
|
+
];
|
|
1055
|
+
//#endregion
|
|
1056
|
+
//#region src/composables/useToolbarDropdowns.ts
|
|
1057
|
+
function Ze(e) {
|
|
1058
|
+
let t = x(null), n = x({
|
|
1059
|
+
top: 0,
|
|
1060
|
+
left: 0
|
|
1061
|
+
});
|
|
1062
|
+
function i(t) {
|
|
1063
|
+
switch (t) {
|
|
1064
|
+
case "zoom": return e.zoom.value;
|
|
1065
|
+
case "style": return e.style.value;
|
|
1066
|
+
case "font": return e.font.value;
|
|
1067
|
+
case "size": return e.size.value;
|
|
1068
|
+
case "align": return e.align.value;
|
|
1069
|
+
case "spacing": return e.spacing.value;
|
|
1070
|
+
default: return null;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
function a(e) {
|
|
1074
|
+
let t = i(e);
|
|
1075
|
+
if (!t) return;
|
|
1076
|
+
let r = t.getBoundingClientRect();
|
|
1077
|
+
n.value = {
|
|
1078
|
+
top: r.bottom,
|
|
1079
|
+
left: r.left
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
let o = r(() => ({
|
|
1083
|
+
top: `${n.value.top}px`,
|
|
1084
|
+
left: `${n.value.left}px`
|
|
1085
|
+
}));
|
|
1086
|
+
function s(e) {
|
|
1087
|
+
t.value !== e && a(e), t.value = t.value === e ? null : e;
|
|
1088
|
+
}
|
|
1089
|
+
function c(n) {
|
|
1090
|
+
let r = n.target;
|
|
1091
|
+
r instanceof Node && ([
|
|
1092
|
+
e.zoom,
|
|
1093
|
+
e.style,
|
|
1094
|
+
e.font,
|
|
1095
|
+
e.size,
|
|
1096
|
+
e.align,
|
|
1097
|
+
e.spacing
|
|
1098
|
+
].some((e) => e.value?.contains(r)) || (t.value = null));
|
|
1099
|
+
}
|
|
1100
|
+
return _(() => document.addEventListener("mousedown", c)), g(() => document.removeEventListener("mousedown", c)), {
|
|
1101
|
+
openDropdown: t,
|
|
1102
|
+
dropdownMenuStyle: o,
|
|
1103
|
+
toggleDropdown: s,
|
|
1104
|
+
recomputeDropdownPos: a
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
//#endregion
|
|
1108
|
+
//#region src/composables/useToolbarFontSize.ts
|
|
1109
|
+
function Qe(e) {
|
|
1110
|
+
let t = x(!1), n = (t) => e.execCommand("setFontSize", t * 2);
|
|
1111
|
+
function r() {
|
|
1112
|
+
t.value = !1, e.openDropdown.value = "size", e.recomputeDropdownPos("size");
|
|
1113
|
+
}
|
|
1114
|
+
function i() {
|
|
1115
|
+
t.value = !0;
|
|
1116
|
+
}
|
|
1117
|
+
function a(r) {
|
|
1118
|
+
if (t.value && r.target instanceof HTMLInputElement) {
|
|
1119
|
+
let e = parseFloat(r.target.value);
|
|
1120
|
+
isNaN(e) || n(Math.round(Math.min(Math.max(e, 1), 1638) * 2) / 2);
|
|
1121
|
+
}
|
|
1122
|
+
t.value = !1, e.openDropdown.value = null;
|
|
1123
|
+
}
|
|
1124
|
+
function o(r) {
|
|
1125
|
+
t.value = !1, n(r), e.openDropdown.value = null;
|
|
1126
|
+
}
|
|
1127
|
+
function s() {
|
|
1128
|
+
let t = e.currentFontSize.value;
|
|
1129
|
+
n(qe.find((e) => e > t) || t + 1);
|
|
1130
|
+
}
|
|
1131
|
+
function c() {
|
|
1132
|
+
let t = e.currentFontSize.value;
|
|
1133
|
+
n([...qe].reverse().find((e) => e < t) || Math.max(1, t - 1));
|
|
1134
|
+
}
|
|
1135
|
+
return {
|
|
1136
|
+
onSizeFocus: r,
|
|
1137
|
+
onSizeInput: i,
|
|
1138
|
+
commitFontSize: a,
|
|
1139
|
+
pickFontSize: o,
|
|
1140
|
+
increaseFontSize: s,
|
|
1141
|
+
decreaseFontSize: c
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
//#endregion
|
|
1145
|
+
//#region src/utils/stylePreview.ts
|
|
1146
|
+
var $e = {
|
|
1147
|
+
Title: 26,
|
|
1148
|
+
Subtitle: 18,
|
|
1149
|
+
Heading1: 24,
|
|
1150
|
+
Heading2: 18,
|
|
1151
|
+
Heading3: 16,
|
|
1152
|
+
Heading4: 14,
|
|
1153
|
+
Heading5: 13,
|
|
1154
|
+
Heading6: 13,
|
|
1155
|
+
Normal: 14
|
|
1156
|
+
}, et = new Set([
|
|
1157
|
+
"Title",
|
|
1158
|
+
"Heading1",
|
|
1159
|
+
"Heading2",
|
|
1160
|
+
"Heading3"
|
|
1161
|
+
]), tt = { Subtitle: "666666" }, nt = "#4a6c8c";
|
|
1162
|
+
function rt(e) {
|
|
1163
|
+
let t = $e[e.styleId], n = {
|
|
1164
|
+
fontSize: t ? `${t}px` : `${Math.min(Math.max(e.fontSize ? e.fontSize / 2 : 11, 11), 20)}px`,
|
|
1165
|
+
lineHeight: "1.3"
|
|
1166
|
+
};
|
|
1167
|
+
(e.bold ?? et.has(e.styleId)) && (n.fontWeight = "bold"), e.italic && (n.fontStyle = "italic");
|
|
1168
|
+
let r = e.color ?? tt[e.styleId];
|
|
1169
|
+
return r ? n.color = `#${r}` : e.styleId.startsWith("Heading") && (n.color = nt), n;
|
|
1170
|
+
}
|
|
1171
|
+
function it(e) {
|
|
1172
|
+
return !e || e.length === 0 ? [] : e.filter((e) => e.type === "paragraph").filter((e) => e.qFormat ? !0 : !(e.hidden || e.semiHidden)).map((e) => ({
|
|
1173
|
+
styleId: e.styleId,
|
|
1174
|
+
name: e.name || e.styleId,
|
|
1175
|
+
priority: e.uiPriority ?? 99,
|
|
1176
|
+
fontSize: e.rPr?.fontSize,
|
|
1177
|
+
bold: e.rPr?.bold,
|
|
1178
|
+
italic: e.rPr?.italic,
|
|
1179
|
+
color: e.rPr?.color?.rgb
|
|
1180
|
+
})).sort((e, t) => e.priority - t.priority);
|
|
1181
|
+
}
|
|
1182
|
+
//#endregion
|
|
1183
|
+
//#region src/composables/useParagraphStyleOptions.ts
|
|
1184
|
+
function at(e) {
|
|
1185
|
+
let t = r(() => {
|
|
1186
|
+
let t = it(e.documentStyles());
|
|
1187
|
+
return t.length > 0 ? t.map((t) => {
|
|
1188
|
+
let n = Je.find((e) => e.id === t.styleId);
|
|
1189
|
+
return {
|
|
1190
|
+
id: t.styleId,
|
|
1191
|
+
label: n ? e.t(n.nameKey) : t.name,
|
|
1192
|
+
previewStyle: rt(t)
|
|
1193
|
+
};
|
|
1194
|
+
}) : Je.map((t) => ({
|
|
1195
|
+
id: t.id,
|
|
1196
|
+
label: e.t(t.nameKey),
|
|
1197
|
+
previewStyle: rt({ styleId: t.id })
|
|
1198
|
+
}));
|
|
1199
|
+
});
|
|
1200
|
+
return {
|
|
1201
|
+
resolvedParagraphStyles: t,
|
|
1202
|
+
currentStyleLabel: r(() => {
|
|
1203
|
+
let n = e.currentStyleId() || "Normal", r = t.value.find((e) => e.id === n);
|
|
1204
|
+
return r ? r.label : n;
|
|
1205
|
+
})
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
//#endregion
|
|
1209
|
+
//#region src/components/ui/Button.vue?vue&type=script&setup=true&lang.ts
|
|
1210
|
+
var ot = ["disabled"], st = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", ct = /* @__PURE__ */ u({
|
|
1211
|
+
__name: "Button",
|
|
1212
|
+
props: {
|
|
1213
|
+
variant: { default: "default" },
|
|
1214
|
+
size: { default: "default" },
|
|
1215
|
+
disabled: {
|
|
1216
|
+
type: Boolean,
|
|
1217
|
+
default: !1
|
|
1218
|
+
},
|
|
1219
|
+
className: { default: "" }
|
|
1220
|
+
},
|
|
1221
|
+
emits: ["click"],
|
|
1222
|
+
setup(e) {
|
|
1223
|
+
let t = e, n = {
|
|
1224
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1225
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1226
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
1227
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
1228
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
1229
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1230
|
+
}, i = {
|
|
1231
|
+
default: "h-10 px-4 py-2",
|
|
1232
|
+
sm: "h-9 rounded-md px-3",
|
|
1233
|
+
lg: "h-11 rounded-md px-8",
|
|
1234
|
+
icon: "h-9 w-9",
|
|
1235
|
+
"icon-sm": "h-7 w-7"
|
|
1236
|
+
}, a = r(() => [
|
|
1237
|
+
st,
|
|
1238
|
+
n[t.variant],
|
|
1239
|
+
i[t.size],
|
|
1240
|
+
t.className
|
|
1241
|
+
].filter(Boolean).join(" "));
|
|
1242
|
+
return (t, n) => (v(), o("button", {
|
|
1243
|
+
class: m(a.value),
|
|
1244
|
+
disabled: e.disabled,
|
|
1245
|
+
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
1246
|
+
}, [C(t.$slots, "default")], 10, ot));
|
|
1247
|
+
}
|
|
1248
|
+
}), lt = [
|
|
1249
|
+
"disabled",
|
|
1250
|
+
"title",
|
|
1251
|
+
"aria-label"
|
|
1252
|
+
], ut = [
|
|
1253
|
+
"disabled",
|
|
1254
|
+
"title",
|
|
1255
|
+
"aria-label",
|
|
1256
|
+
"aria-expanded"
|
|
1257
|
+
], dt = [
|
|
1258
|
+
"disabled",
|
|
1259
|
+
"title",
|
|
1260
|
+
"aria-label",
|
|
1261
|
+
"aria-expanded"
|
|
1262
|
+
], ft = { class: "docx-color-picker__button-stack" }, pt = ["aria-label"], mt = {
|
|
1263
|
+
key: 0,
|
|
1264
|
+
class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--none"
|
|
1265
|
+
}, ht = {
|
|
1266
|
+
key: 1,
|
|
1267
|
+
class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--auto"
|
|
1268
|
+
}, gt = { class: "docx-color-picker__section-label" }, _t = { class: "docx-color-picker__grid" }, vt = [
|
|
1269
|
+
"title",
|
|
1270
|
+
"aria-label",
|
|
1271
|
+
"aria-selected",
|
|
1272
|
+
"onClick"
|
|
1273
|
+
], yt = { class: "docx-color-picker__section-label" }, bt = { class: "docx-color-picker__grid" }, xt = [
|
|
1274
|
+
"title",
|
|
1275
|
+
"aria-label",
|
|
1276
|
+
"aria-selected",
|
|
1277
|
+
"onClick"
|
|
1278
|
+
], St = { class: "docx-color-picker__section-label" }, Ct = { class: "docx-color-picker__custom" }, wt = ["onKeydown"], Tt = ["disabled"], Et = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
1279
|
+
__name: "ColorPicker",
|
|
1280
|
+
props: {
|
|
1281
|
+
mode: {},
|
|
1282
|
+
value: {},
|
|
1283
|
+
theme: {},
|
|
1284
|
+
disabled: {
|
|
1285
|
+
type: Boolean,
|
|
1286
|
+
default: !1
|
|
1287
|
+
},
|
|
1288
|
+
className: {},
|
|
1289
|
+
style: {},
|
|
1290
|
+
title: {},
|
|
1291
|
+
icon: {},
|
|
1292
|
+
autoLabel: {},
|
|
1293
|
+
splitButton: {
|
|
1294
|
+
type: Boolean,
|
|
1295
|
+
default: !0
|
|
1296
|
+
},
|
|
1297
|
+
defaultColor: {}
|
|
1298
|
+
},
|
|
1299
|
+
emits: ["change"],
|
|
1300
|
+
setup(t, { emit: i }) {
|
|
1301
|
+
let u = t, d = i, { t: f } = e(), p = [
|
|
1302
|
+
{
|
|
1303
|
+
nameKey: "colorPicker.colors.darkRed",
|
|
1304
|
+
hex: "C00000"
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
nameKey: "colorPicker.colors.red",
|
|
1308
|
+
hex: "FF0000"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
nameKey: "colorPicker.colors.orange",
|
|
1312
|
+
hex: "FFC000"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
nameKey: "colorPicker.colors.yellow",
|
|
1316
|
+
hex: "FFFF00"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
nameKey: "colorPicker.colors.lightGreen",
|
|
1320
|
+
hex: "92D050"
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
nameKey: "colorPicker.colors.green",
|
|
1324
|
+
hex: "00B050"
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
nameKey: "colorPicker.colors.lightBlue",
|
|
1328
|
+
hex: "00B0F0"
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
nameKey: "colorPicker.colors.blue",
|
|
1332
|
+
hex: "0070C0"
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
nameKey: "colorPicker.colors.darkBlue",
|
|
1336
|
+
hex: "002060"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
nameKey: "colorPicker.colors.purple",
|
|
1340
|
+
hex: "7030A0"
|
|
1341
|
+
}
|
|
1342
|
+
];
|
|
1343
|
+
function y(e) {
|
|
1344
|
+
return e ? typeof e == "string" ? u.mode === "highlight" ? ne(e) || (e === "none" ? "transparent" : e.startsWith("#") ? e : `#${e}`) : e.startsWith("#") ? e : `#${e}` : V(e, u.theme) : u.mode === "text" || u.mode === "border" ? "#000000" : "transparent";
|
|
1345
|
+
}
|
|
1346
|
+
function b(e) {
|
|
1347
|
+
return /^[0-9A-Fa-f]{6}$/.test(e.replace(/^#/, ""));
|
|
1348
|
+
}
|
|
1349
|
+
function C(e) {
|
|
1350
|
+
let t = e.replace(/^#/, "");
|
|
1351
|
+
if (t.length !== 6) return !1;
|
|
1352
|
+
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16);
|
|
1353
|
+
return (n * 299 + r * 587 + i * 114) / 1e3 > 230;
|
|
1354
|
+
}
|
|
1355
|
+
function w(e, t) {
|
|
1356
|
+
return e ? (typeof e == "string" ? e.replace(/^#/, "").toUpperCase() : H(e, u.theme)) === t.toUpperCase() : !1;
|
|
1357
|
+
}
|
|
1358
|
+
function E(e) {
|
|
1359
|
+
return e === "highlight" ? "FFFF00" : e === "border" ? { rgb: "000000" } : { rgb: "FF0000" };
|
|
1360
|
+
}
|
|
1361
|
+
function O(e) {
|
|
1362
|
+
return f(e === "text" ? "fontColor" : e === "highlight" ? "formattingBar.highlightColor" : "table.borderColor");
|
|
1363
|
+
}
|
|
1364
|
+
function j(e) {
|
|
1365
|
+
return e === "text" ? "format_color_text" : e === "highlight" ? "ink_highlighter" : "border_color";
|
|
1366
|
+
}
|
|
1367
|
+
let F = x(!1), I = x(""), L = x(null), R = x(null), ee = x(u.defaultColor ?? E(u.mode)), te = r(() => B(u.theme?.colorScheme ?? null)), z = r(() => te.value.flatMap((e, t) => e.map((e, n) => ({
|
|
1368
|
+
...e,
|
|
1369
|
+
key: `${t}-${n}`
|
|
1370
|
+
})))), U = r(() => y(u.value)), W = r(() => y(ee.value)), G = r(() => O(u.mode)), K = r(() => u.icon ?? j(u.mode));
|
|
1371
|
+
A(() => [
|
|
1372
|
+
u.value,
|
|
1373
|
+
u.mode,
|
|
1374
|
+
u.theme
|
|
1375
|
+
], () => {
|
|
1376
|
+
let e = y(u.value).replace(/^#/, "");
|
|
1377
|
+
/^[0-9A-Fa-f]{6}$/.test(e) && (I.value = e.toUpperCase());
|
|
1378
|
+
}, { immediate: !0 });
|
|
1379
|
+
let J = x({});
|
|
1380
|
+
function re() {
|
|
1381
|
+
let e = L.value;
|
|
1382
|
+
if (!e) return;
|
|
1383
|
+
let t = e.getBoundingClientRect();
|
|
1384
|
+
J.value = {
|
|
1385
|
+
top: `${t.bottom + 4}px`,
|
|
1386
|
+
left: `${t.left}px`
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
function ie() {
|
|
1390
|
+
u.disabled || (F.value || re(), F.value = !F.value);
|
|
1391
|
+
}
|
|
1392
|
+
function Y(e, t = !0) {
|
|
1393
|
+
t && (ee.value = e), d("change", e), F.value = !1;
|
|
1394
|
+
}
|
|
1395
|
+
function ae() {
|
|
1396
|
+
u.disabled || d("change", ee.value);
|
|
1397
|
+
}
|
|
1398
|
+
function oe(e) {
|
|
1399
|
+
if (u.mode === "highlight") {
|
|
1400
|
+
Y(e.hex);
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
let t = {
|
|
1404
|
+
themeColor: e.themeSlot,
|
|
1405
|
+
rgb: e.hex
|
|
1406
|
+
};
|
|
1407
|
+
e.tint && (t.themeTint = e.tint), e.shade && (t.themeShade = e.shade), Y(t);
|
|
1408
|
+
}
|
|
1409
|
+
function X(e) {
|
|
1410
|
+
Y(u.mode === "highlight" ? e : { rgb: e });
|
|
1411
|
+
}
|
|
1412
|
+
function Z() {
|
|
1413
|
+
Y(u.mode === "highlight" ? "none" : { auto: !0 }, !1);
|
|
1414
|
+
}
|
|
1415
|
+
function se() {
|
|
1416
|
+
let e = I.value.replace(/^#/, "").toUpperCase();
|
|
1417
|
+
b(e) && (Y(u.mode === "highlight" ? e : { rgb: e }), I.value = "");
|
|
1418
|
+
}
|
|
1419
|
+
function Q(e) {
|
|
1420
|
+
e.target instanceof HTMLInputElement || e.preventDefault();
|
|
1421
|
+
}
|
|
1422
|
+
function ce(e) {
|
|
1423
|
+
if (!F.value) return;
|
|
1424
|
+
let t = e.target;
|
|
1425
|
+
t instanceof Node && (L.value?.contains(t) || R.value?.contains(t) || (F.value = !1));
|
|
1426
|
+
}
|
|
1427
|
+
return _(() => document.addEventListener("mousedown", ce)), g(() => document.removeEventListener("mousedown", ce)), (e, r) => (v(), o("div", {
|
|
1428
|
+
ref_key: "containerRef",
|
|
1429
|
+
ref: L,
|
|
1430
|
+
class: m(["docx-color-picker", t.className]),
|
|
1431
|
+
style: h(t.style)
|
|
1432
|
+
}, [t.splitButton ? (v(), o("div", {
|
|
1433
|
+
key: 0,
|
|
1434
|
+
class: m(["docx-color-picker__split", { "is-disabled": t.disabled }])
|
|
1435
|
+
}, [s("button", {
|
|
1436
|
+
type: "button",
|
|
1437
|
+
class: "docx-color-picker__apply",
|
|
1438
|
+
disabled: t.disabled,
|
|
1439
|
+
title: t.title ?? G.value,
|
|
1440
|
+
"aria-label": t.title ?? G.value,
|
|
1441
|
+
onMousedown: r[0] ||= P(() => {}, ["prevent"]),
|
|
1442
|
+
onClick: ae
|
|
1443
|
+
}, [l(q, {
|
|
1444
|
+
name: K.value,
|
|
1445
|
+
size: 18
|
|
1446
|
+
}, null, 8, ["name"]), s("span", {
|
|
1447
|
+
class: m(["docx-color-picker__bar", { "is-light": W.value === "transparent" || C(W.value) }]),
|
|
1448
|
+
style: h({ background: W.value === "transparent" ? "#fff" : W.value })
|
|
1449
|
+
}, null, 6)], 40, lt), s("button", {
|
|
1450
|
+
type: "button",
|
|
1451
|
+
class: m(["docx-color-picker__arrow", { "is-open": F.value }]),
|
|
1452
|
+
disabled: t.disabled,
|
|
1453
|
+
title: t.title ?? G.value,
|
|
1454
|
+
"aria-label": t.title ?? G.value,
|
|
1455
|
+
"aria-haspopup": "true",
|
|
1456
|
+
"aria-expanded": F.value,
|
|
1457
|
+
onMousedown: r[1] ||= P(() => {}, ["prevent"]),
|
|
1458
|
+
onClick: ie
|
|
1459
|
+
}, [l(q, {
|
|
1460
|
+
name: "arrow_drop_down",
|
|
1461
|
+
size: 18
|
|
1462
|
+
})], 42, ut)], 2)) : (v(), o("button", {
|
|
1463
|
+
key: 1,
|
|
1464
|
+
type: "button",
|
|
1465
|
+
class: m(["docx-color-picker__button", { "is-open": F.value }]),
|
|
1466
|
+
disabled: t.disabled,
|
|
1467
|
+
title: t.title ?? G.value,
|
|
1468
|
+
"aria-label": t.title ?? G.value,
|
|
1469
|
+
"aria-haspopup": "true",
|
|
1470
|
+
"aria-expanded": F.value,
|
|
1471
|
+
onMousedown: r[2] ||= P(() => {}, ["prevent"]),
|
|
1472
|
+
onClick: ie
|
|
1473
|
+
}, [s("span", ft, [l(q, {
|
|
1474
|
+
name: K.value,
|
|
1475
|
+
size: 18
|
|
1476
|
+
}, null, 8, ["name"]), s("span", {
|
|
1477
|
+
class: m(["docx-color-picker__bar", { "is-light": U.value === "transparent" || C(U.value) }]),
|
|
1478
|
+
style: h({ background: U.value === "transparent" ? "#fff" : U.value })
|
|
1479
|
+
}, null, 6)]), l(q, {
|
|
1480
|
+
name: "arrow_drop_down",
|
|
1481
|
+
size: 14
|
|
1482
|
+
})], 42, dt)), F.value && !t.disabled ? (v(), o("div", {
|
|
1483
|
+
key: 2,
|
|
1484
|
+
ref_key: "panelRef",
|
|
1485
|
+
ref: R,
|
|
1486
|
+
class: "docx-color-picker__panel",
|
|
1487
|
+
style: h(J.value),
|
|
1488
|
+
role: "dialog",
|
|
1489
|
+
"aria-label": D(f)("colorPicker.ariaLabel", { type: G.value }),
|
|
1490
|
+
onMousedown: Q
|
|
1491
|
+
}, [
|
|
1492
|
+
s("button", {
|
|
1493
|
+
type: "button",
|
|
1494
|
+
class: "docx-color-picker__auto",
|
|
1495
|
+
onMousedown: r[3] ||= P(() => {}, ["prevent"]),
|
|
1496
|
+
onClick: Z
|
|
1497
|
+
}, [t.mode === "highlight" ? (v(), o("span", mt, [...r[10] ||= [s("span", { class: "docx-color-picker__auto-slash" }, null, -1)]])) : (v(), o("span", ht)), c(" " + T(t.autoLabel ?? (t.mode === "highlight" ? D(f)("colorPicker.noColor") : D(f)("colorPicker.automatic"))), 1)], 32),
|
|
1498
|
+
r[12] ||= s("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
1499
|
+
s("div", gt, T(D(f)("colorPicker.themeColors")), 1),
|
|
1500
|
+
s("div", _t, [(v(!0), o(n, null, S(z.value, (e) => (v(), o("button", {
|
|
1501
|
+
key: e.key,
|
|
1502
|
+
type: "button",
|
|
1503
|
+
class: m(["docx-color-picker__cell", { "is-selected": w(t.value, e.hex) }]),
|
|
1504
|
+
style: h({ background: "#" + e.hex }),
|
|
1505
|
+
title: e.label,
|
|
1506
|
+
"aria-label": e.label,
|
|
1507
|
+
"aria-selected": w(t.value, e.hex),
|
|
1508
|
+
onMousedown: r[4] ||= P(() => {}, ["prevent"]),
|
|
1509
|
+
onClick: (t) => oe(e)
|
|
1510
|
+
}, null, 46, vt))), 128))]),
|
|
1511
|
+
r[13] ||= s("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
1512
|
+
s("div", yt, T(D(f)("colorPicker.standardColors")), 1),
|
|
1513
|
+
s("div", bt, [(v(), o(n, null, S(p, (e) => s("button", {
|
|
1514
|
+
key: e.hex,
|
|
1515
|
+
type: "button",
|
|
1516
|
+
class: m(["docx-color-picker__cell", { "is-selected": w(t.value, e.hex) }]),
|
|
1517
|
+
style: h({ background: "#" + e.hex }),
|
|
1518
|
+
title: D(f)(e.nameKey),
|
|
1519
|
+
"aria-label": D(f)(e.nameKey),
|
|
1520
|
+
"aria-selected": w(t.value, e.hex),
|
|
1521
|
+
onMousedown: r[5] ||= P(() => {}, ["prevent"]),
|
|
1522
|
+
onClick: (t) => X(e.hex)
|
|
1523
|
+
}, null, 46, xt)), 64))]),
|
|
1524
|
+
r[14] ||= s("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
1525
|
+
s("div", St, T(D(f)("colorPicker.customColor")), 1),
|
|
1526
|
+
s("div", Ct, [
|
|
1527
|
+
r[11] ||= s("span", { class: "docx-color-picker__hash" }, "#", -1),
|
|
1528
|
+
M(s("input", {
|
|
1529
|
+
"onUpdate:modelValue": r[6] ||= (e) => I.value = e,
|
|
1530
|
+
type: "text",
|
|
1531
|
+
class: "docx-color-picker__hex",
|
|
1532
|
+
placeholder: "FF0000",
|
|
1533
|
+
maxlength: "6",
|
|
1534
|
+
"aria-label": "Custom hex color",
|
|
1535
|
+
onInput: r[7] ||= (e) => I.value = I.value.replace(/[^0-9A-Fa-f]/g, "").slice(0, 6),
|
|
1536
|
+
onKeydown: N(P(se, ["prevent"]), ["enter"]),
|
|
1537
|
+
onMousedown: r[8] ||= P(() => {}, ["stop"])
|
|
1538
|
+
}, null, 40, wt), [[k, I.value]]),
|
|
1539
|
+
s("button", {
|
|
1540
|
+
type: "button",
|
|
1541
|
+
class: "docx-color-picker__apply-btn",
|
|
1542
|
+
disabled: !b(I.value),
|
|
1543
|
+
onMousedown: r[9] ||= P(() => {}, ["prevent"]),
|
|
1544
|
+
onClick: se
|
|
1545
|
+
}, T(D(f)("common.apply")), 41, Tt)
|
|
1546
|
+
])
|
|
1547
|
+
], 44, pt)) : a("", !0)], 6));
|
|
1548
|
+
}
|
|
1549
|
+
}), [["__scopeId", "data-v-e0823d53"]]), Dt = {
|
|
1550
|
+
Button: ct,
|
|
1551
|
+
ColorPicker: Et,
|
|
1552
|
+
Popover: Z,
|
|
1553
|
+
Menu: $
|
|
1554
|
+
}, Ot = Symbol("folio-ui-components");
|
|
1555
|
+
function kt(e) {
|
|
1556
|
+
return e ? {
|
|
1557
|
+
...Dt,
|
|
1558
|
+
...e
|
|
1559
|
+
} : Dt;
|
|
1560
|
+
}
|
|
1561
|
+
function At(e) {
|
|
1562
|
+
y(Ot, kt(e));
|
|
1563
|
+
}
|
|
1564
|
+
function jt() {
|
|
1565
|
+
return d(Ot, Dt);
|
|
1566
|
+
}
|
|
1567
|
+
var Mt = u({
|
|
1568
|
+
name: "FolioUIProvider",
|
|
1569
|
+
props: { components: {
|
|
1570
|
+
type: Object,
|
|
1571
|
+
default: void 0
|
|
1572
|
+
} },
|
|
1573
|
+
setup(e, { slots: t }) {
|
|
1574
|
+
return At(e.components), () => t.default?.();
|
|
1575
|
+
}
|
|
1576
|
+
}), Nt = {
|
|
1577
|
+
key: 0,
|
|
1578
|
+
class: "basic-toolbar"
|
|
1579
|
+
}, Pt = [
|
|
1580
|
+
"title",
|
|
1581
|
+
"aria-label",
|
|
1582
|
+
"disabled"
|
|
1583
|
+
], Ft = [
|
|
1584
|
+
"title",
|
|
1585
|
+
"aria-label",
|
|
1586
|
+
"disabled"
|
|
1587
|
+
], It = ["disabled", "title"], Lt = ["aria-expanded", "title"], Rt = ["disabled", "title"], zt = ["onMousedown"], Bt = ["aria-expanded", "title"], Vt = ["onMousedown"], Ht = ["aria-expanded", "title"], Ut = {
|
|
1588
|
+
key: 0,
|
|
1589
|
+
class: "toolbar-dropdown__group-label"
|
|
1590
|
+
}, Wt = ["onMousedown"], Gt = ["title"], Kt = [
|
|
1591
|
+
"value",
|
|
1592
|
+
"title",
|
|
1593
|
+
"aria-expanded"
|
|
1594
|
+
], qt = ["title"], Jt = ["onMousedown"], Yt = ["title", "aria-label"], Xt = ["title", "aria-label"], Zt = ["title", "aria-label"], Qt = ["title", "aria-label"], $t = ["title", "aria-label"], en = ["title", "aria-label"], tn = ["title", "aria-label"], nn = ["aria-expanded", "title"], rn = ["title"], an = ["title"], on = ["title"], sn = ["title"], cn = ["title", "aria-label"], ln = ["title", "aria-label"], un = [
|
|
1595
|
+
"title",
|
|
1596
|
+
"aria-label",
|
|
1597
|
+
"disabled"
|
|
1598
|
+
], dn = ["title", "aria-label"], fn = ["aria-expanded", "title"], pn = ["onMousedown"], mn = ["title", "aria-label"], hn = ["title", "aria-label"], gn = ["title", "aria-label"], _n = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
1599
|
+
__name: "Toolbar",
|
|
1600
|
+
props: {
|
|
1601
|
+
view: { default: null },
|
|
1602
|
+
getCommands: {
|
|
1603
|
+
type: Function,
|
|
1604
|
+
default: () => ({})
|
|
1605
|
+
},
|
|
1606
|
+
stateTick: { default: 0 },
|
|
1607
|
+
zoomPercent: {},
|
|
1608
|
+
isMinZoom: { type: Boolean },
|
|
1609
|
+
isMaxZoom: { type: Boolean },
|
|
1610
|
+
zoomPresets: {},
|
|
1611
|
+
showZoomControl: { type: Boolean },
|
|
1612
|
+
editorMode: {},
|
|
1613
|
+
showReviewControls: {
|
|
1614
|
+
type: Boolean,
|
|
1615
|
+
default: !1
|
|
1616
|
+
},
|
|
1617
|
+
trackChangesOn: {
|
|
1618
|
+
type: Boolean,
|
|
1619
|
+
default: !1
|
|
1620
|
+
},
|
|
1621
|
+
displayMode: { default: "all-markup" },
|
|
1622
|
+
readOnly: {
|
|
1623
|
+
type: Boolean,
|
|
1624
|
+
default: !1
|
|
1625
|
+
},
|
|
1626
|
+
commentsSidebarOpen: { type: Boolean },
|
|
1627
|
+
imageContext: {},
|
|
1628
|
+
theme: {},
|
|
1629
|
+
fontFamilies: {},
|
|
1630
|
+
documentFonts: {},
|
|
1631
|
+
documentStyles: {}
|
|
1632
|
+
},
|
|
1633
|
+
emits: [
|
|
1634
|
+
"find-replace",
|
|
1635
|
+
"insert-table",
|
|
1636
|
+
"insert-image",
|
|
1637
|
+
"insert-link",
|
|
1638
|
+
"insert-symbol",
|
|
1639
|
+
"insert-page-break",
|
|
1640
|
+
"insert-toc",
|
|
1641
|
+
"page-setup",
|
|
1642
|
+
"toggle-outline",
|
|
1643
|
+
"zoom-in",
|
|
1644
|
+
"zoom-out",
|
|
1645
|
+
"zoom-set",
|
|
1646
|
+
"toggle-sidebar",
|
|
1647
|
+
"apply-style",
|
|
1648
|
+
"mode-change",
|
|
1649
|
+
"toggle-track-changes",
|
|
1650
|
+
"update:display-mode",
|
|
1651
|
+
"image-wrap-type",
|
|
1652
|
+
"image-properties",
|
|
1653
|
+
"image-transform"
|
|
1654
|
+
],
|
|
1655
|
+
setup(t, { emit: u }) {
|
|
1656
|
+
let { ColorPicker: d } = jt(), f = t, { t: p } = e(), g = u, _ = r(() => f.zoomPercent ?? 100), y = r(() => f.isMinZoom ?? !1), b = r(() => f.isMaxZoom ?? !1), w = r(() => f.zoomPresets ?? Xe), E = r(() => f.showZoomControl ?? !0), O = x(null), k = x(null), A = x(null), j = x(null), M = x(null), I = x(null), { openDropdown: L, dropdownMenuStyle: R, toggleDropdown: B, recomputeDropdownPos: V } = Ze({
|
|
1657
|
+
zoom: I,
|
|
1658
|
+
style: O,
|
|
1659
|
+
font: k,
|
|
1660
|
+
size: A,
|
|
1661
|
+
align: j,
|
|
1662
|
+
spacing: M
|
|
1663
|
+
}), H = r(() => {
|
|
1664
|
+
f.stateTick;
|
|
1665
|
+
let e = f.view;
|
|
1666
|
+
return e ? F(e.state) : {
|
|
1667
|
+
hasSelection: !1,
|
|
1668
|
+
isMultiParagraph: !1,
|
|
1669
|
+
textFormatting: {},
|
|
1670
|
+
paragraphFormatting: {},
|
|
1671
|
+
startParagraphIndex: 0,
|
|
1672
|
+
endParagraphIndex: 0,
|
|
1673
|
+
inList: !1,
|
|
1674
|
+
activeCommentIds: [],
|
|
1675
|
+
inInsertion: !1,
|
|
1676
|
+
inDeletion: !1
|
|
1677
|
+
};
|
|
1678
|
+
}), ne = r(() => {
|
|
1679
|
+
let e = H.value.textFormatting.fontFamily;
|
|
1680
|
+
return e?.ascii || e?.hAnsi || "Arial";
|
|
1681
|
+
}), U = r(() => {
|
|
1682
|
+
let e = H.value.textFormatting.fontSize;
|
|
1683
|
+
return e ? e / 2 : 11;
|
|
1684
|
+
}), W = r(() => H.value.paragraphFormatting.alignment || "left"), G = r(() => {
|
|
1685
|
+
switch (W.value) {
|
|
1686
|
+
case "center": return "format_align_center";
|
|
1687
|
+
case "right": return "format_align_right";
|
|
1688
|
+
case "both": return "format_align_justify";
|
|
1689
|
+
default: return "format_align_left";
|
|
1690
|
+
}
|
|
1691
|
+
}), { resolvedParagraphStyles: K, currentStyleLabel: J } = at({
|
|
1692
|
+
documentStyles: () => f.documentStyles,
|
|
1693
|
+
currentStyleId: () => H.value.paragraphFormatting.styleId || "Normal",
|
|
1694
|
+
t: p
|
|
1695
|
+
}), re = r(() => {
|
|
1696
|
+
f.stateTick;
|
|
1697
|
+
let e = f.view;
|
|
1698
|
+
return e ? te(e.state) > 0 : !1;
|
|
1699
|
+
}), ie = r(() => {
|
|
1700
|
+
f.stateTick;
|
|
1701
|
+
let e = f.view;
|
|
1702
|
+
return e ? ee(e.state) > 0 : !1;
|
|
1703
|
+
}), Y = r(() => {
|
|
1704
|
+
let e = H.value, t = e.inList && (e.listLevel ?? 0) > 0, n = (e.paragraphFormatting.indentLeft ?? 0) > 0;
|
|
1705
|
+
return t || n;
|
|
1706
|
+
}), ae = r(() => {
|
|
1707
|
+
let e = H.value.textFormatting.color?.rgb;
|
|
1708
|
+
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
1709
|
+
}), oe = r(() => {
|
|
1710
|
+
let e = H.value.textFormatting.highlight;
|
|
1711
|
+
if (!(!e || e === "none")) return e.replace(/^#/, "").toUpperCase();
|
|
1712
|
+
}), X = r(() => Ue(f.fontFamilies) ?? Ke), Z = r(() => Ge(f.documentFonts, X.value.map((e) => e.name))), se = r(() => [
|
|
1713
|
+
{
|
|
1714
|
+
label: p("font.documentFonts"),
|
|
1715
|
+
fonts: Z.value
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
label: p("font.sansSerif"),
|
|
1719
|
+
fonts: X.value.filter((e) => e.category === "sans-serif")
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
label: p("font.serif"),
|
|
1723
|
+
fonts: X.value.filter((e) => e.category === "serif")
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
label: p("font.monospace"),
|
|
1727
|
+
fonts: X.value.filter((e) => e.category === "monospace")
|
|
1728
|
+
},
|
|
1729
|
+
{
|
|
1730
|
+
label: p("font.other"),
|
|
1731
|
+
fonts: X.value.filter((e) => !e.category || e.category === "other")
|
|
1732
|
+
}
|
|
1733
|
+
]);
|
|
1734
|
+
function Q(e, ...t) {
|
|
1735
|
+
let n = f.view;
|
|
1736
|
+
if (!n) return;
|
|
1737
|
+
let r = f.getCommands()[e];
|
|
1738
|
+
if (!r) {
|
|
1739
|
+
typeof console < "u" && console.warn("[Toolbar] command not found:", e);
|
|
1740
|
+
return;
|
|
1741
|
+
}
|
|
1742
|
+
r(...t)(n.state, (e) => n.dispatch(e), n), n.hasFocus() || n.focus(), L.value = null;
|
|
1743
|
+
}
|
|
1744
|
+
function ce(e) {
|
|
1745
|
+
Q("setFontFamily", e);
|
|
1746
|
+
}
|
|
1747
|
+
let { onSizeFocus: le, onSizeInput: ue, commitFontSize: de, pickFontSize: fe, increaseFontSize: pe, decreaseFontSize: $ } = Qe({
|
|
1748
|
+
currentFontSize: U,
|
|
1749
|
+
openDropdown: L,
|
|
1750
|
+
recomputeDropdownPos: V,
|
|
1751
|
+
execCommand: Q
|
|
1752
|
+
});
|
|
1753
|
+
function me(e) {
|
|
1754
|
+
if (typeof e == "object" && e.auto) {
|
|
1755
|
+
Q("clearTextColor");
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
Q("setTextColor", typeof e == "string" ? { rgb: e } : e);
|
|
1759
|
+
}
|
|
1760
|
+
function he() {
|
|
1761
|
+
let e = f.view;
|
|
1762
|
+
e && (z(e.state, (t) => e.dispatch(t), e), e.hasFocus() || e.focus());
|
|
1763
|
+
}
|
|
1764
|
+
function ge(e) {
|
|
1765
|
+
Q("setHighlight", typeof e == "string" ? e : e.rgb ?? "none");
|
|
1766
|
+
}
|
|
1767
|
+
function _e(e) {
|
|
1768
|
+
g("apply-style", e), L.value = null;
|
|
1769
|
+
}
|
|
1770
|
+
function ve(e) {
|
|
1771
|
+
Q("setLineSpacing", e);
|
|
1772
|
+
}
|
|
1773
|
+
function ye(e) {
|
|
1774
|
+
let t = H.value.paragraphFormatting.lineSpacing;
|
|
1775
|
+
return t ? Math.abs(t - e) < 10 : e === 240;
|
|
1776
|
+
}
|
|
1777
|
+
return (e, r) => t.view ? (v(), o("div", Nt, [
|
|
1778
|
+
s("button", {
|
|
1779
|
+
title: D(p)("undoShortcut"),
|
|
1780
|
+
"aria-label": D(p)("undo"),
|
|
1781
|
+
disabled: !re.value,
|
|
1782
|
+
onMousedown: r[0] ||= P((e) => Q("undo"), ["prevent"])
|
|
1783
|
+
}, [l(q, { name: "undo" })], 40, Pt),
|
|
1784
|
+
s("button", {
|
|
1785
|
+
title: D(p)("redoShortcut"),
|
|
1786
|
+
"aria-label": D(p)("redo"),
|
|
1787
|
+
disabled: !ie.value,
|
|
1788
|
+
onMousedown: r[1] ||= P((e) => Q("redo"), ["prevent"])
|
|
1789
|
+
}, [l(q, { name: "redo" })], 40, Ft),
|
|
1790
|
+
r[42] ||= s("span", { class: "divider" }, null, -1),
|
|
1791
|
+
E.value ? (v(), o("div", {
|
|
1792
|
+
key: 0,
|
|
1793
|
+
class: "toolbar-dropdown zoom-group",
|
|
1794
|
+
ref_key: "zoomDropdownRef",
|
|
1795
|
+
ref: I
|
|
1796
|
+
}, [
|
|
1797
|
+
s("button", {
|
|
1798
|
+
class: "size-btn",
|
|
1799
|
+
onMousedown: r[2] ||= P((t) => e.$emit("zoom-out"), ["prevent"]),
|
|
1800
|
+
disabled: y.value,
|
|
1801
|
+
title: D(p)("zoom.zoomOut")
|
|
1802
|
+
}, " − ", 40, It),
|
|
1803
|
+
s("button", {
|
|
1804
|
+
class: "toolbar-dropdown__trigger zoom-trigger",
|
|
1805
|
+
onMousedown: r[3] ||= P((e) => D(B)("zoom"), ["prevent"]),
|
|
1806
|
+
"aria-expanded": D(L) === "zoom",
|
|
1807
|
+
"aria-haspopup": "listbox",
|
|
1808
|
+
title: D(p)("zoom.zoomLevel")
|
|
1809
|
+
}, [c(T(_.value) + "% ", 1), l(q, {
|
|
1810
|
+
class: "chevron",
|
|
1811
|
+
name: "arrow_drop_down",
|
|
1812
|
+
size: 16
|
|
1813
|
+
})], 40, Lt),
|
|
1814
|
+
s("button", {
|
|
1815
|
+
class: "size-btn",
|
|
1816
|
+
onMousedown: r[4] ||= P((t) => e.$emit("zoom-in"), ["prevent"]),
|
|
1817
|
+
disabled: b.value,
|
|
1818
|
+
title: D(p)("zoom.zoomIn")
|
|
1819
|
+
}, " + ", 40, Rt),
|
|
1820
|
+
D(L) === "zoom" ? (v(), o("div", {
|
|
1821
|
+
key: 0,
|
|
1822
|
+
style: h(D(R)),
|
|
1823
|
+
class: "toolbar-dropdown__menu zoom-menu"
|
|
1824
|
+
}, [(v(!0), o(n, null, S(w.value, (t) => (v(), o("button", {
|
|
1825
|
+
key: t,
|
|
1826
|
+
class: m(["toolbar-dropdown__item", { active: _.value === Math.round(t * 100) }]),
|
|
1827
|
+
onMousedown: P((n) => e.$emit("zoom-set", t), ["prevent"])
|
|
1828
|
+
}, T(Math.round(t * 100)) + "% ", 43, zt))), 128))], 4)) : a("", !0)
|
|
1829
|
+
], 512)) : a("", !0),
|
|
1830
|
+
r[43] ||= s("span", { class: "divider" }, null, -1),
|
|
1831
|
+
s("div", {
|
|
1832
|
+
class: "toolbar-dropdown",
|
|
1833
|
+
ref_key: "styleDropdownRef",
|
|
1834
|
+
ref: O
|
|
1835
|
+
}, [s("button", {
|
|
1836
|
+
class: "toolbar-dropdown__trigger style-trigger",
|
|
1837
|
+
onMousedown: r[5] ||= P((e) => D(B)("style"), ["prevent"]),
|
|
1838
|
+
"aria-expanded": D(L) === "style",
|
|
1839
|
+
"aria-haspopup": "listbox",
|
|
1840
|
+
title: D(p)("styles.selectAriaLabel")
|
|
1841
|
+
}, [c(T(D(J)) + " ", 1), l(q, {
|
|
1842
|
+
class: "chevron",
|
|
1843
|
+
name: "arrow_drop_down",
|
|
1844
|
+
size: 16
|
|
1845
|
+
})], 40, Bt), D(L) === "style" ? (v(), o("div", {
|
|
1846
|
+
key: 0,
|
|
1847
|
+
style: h(D(R)),
|
|
1848
|
+
class: "toolbar-dropdown__menu style-menu"
|
|
1849
|
+
}, [(v(!0), o(n, null, S(D(K), (e) => (v(), o("button", {
|
|
1850
|
+
key: e.id,
|
|
1851
|
+
class: m(["toolbar-dropdown__item", { active: (H.value.paragraphFormatting.styleId || "Normal") === e.id }]),
|
|
1852
|
+
onMousedown: P((t) => _e(e.id), ["prevent"])
|
|
1853
|
+
}, [s("span", { style: h({ ...e.previewStyle }) }, T(e.label), 5)], 42, Vt))), 128))], 4)) : a("", !0)], 512),
|
|
1854
|
+
r[44] ||= s("span", { class: "divider" }, null, -1),
|
|
1855
|
+
s("div", {
|
|
1856
|
+
class: "toolbar-dropdown",
|
|
1857
|
+
ref_key: "fontDropdownRef",
|
|
1858
|
+
ref: k
|
|
1859
|
+
}, [s("button", {
|
|
1860
|
+
class: "toolbar-dropdown__trigger font-trigger",
|
|
1861
|
+
onMousedown: r[6] ||= P((e) => D(B)("font"), ["prevent"]),
|
|
1862
|
+
"aria-expanded": D(L) === "font",
|
|
1863
|
+
"aria-haspopup": "listbox",
|
|
1864
|
+
title: D(p)("font.selectAriaLabel")
|
|
1865
|
+
}, [c(T(ne.value) + " ", 1), l(q, {
|
|
1866
|
+
class: "chevron",
|
|
1867
|
+
name: "arrow_drop_down",
|
|
1868
|
+
size: 16
|
|
1869
|
+
})], 40, Ht), D(L) === "font" ? (v(), o("div", {
|
|
1870
|
+
key: 0,
|
|
1871
|
+
style: h(D(R)),
|
|
1872
|
+
class: "toolbar-dropdown__menu font-menu"
|
|
1873
|
+
}, [(v(!0), o(n, null, S(se.value, (e) => (v(), o(n, { key: e.label }, [e.fonts.length > 0 ? (v(), o("div", Ut, T(e.label), 1)) : a("", !0), (v(!0), o(n, null, S(e.fonts, (e) => (v(), o("button", {
|
|
1874
|
+
key: e.name,
|
|
1875
|
+
class: m(["toolbar-dropdown__item", { active: ne.value === e.name }]),
|
|
1876
|
+
style: h({ fontFamily: e.fontFamily }),
|
|
1877
|
+
onMousedown: P((t) => ce(e.name), ["prevent"])
|
|
1878
|
+
}, T(e.name), 47, Wt))), 128))], 64))), 128))], 4)) : a("", !0)], 512),
|
|
1879
|
+
s("div", {
|
|
1880
|
+
class: "toolbar-dropdown font-size-group",
|
|
1881
|
+
ref_key: "sizeDropdownRef",
|
|
1882
|
+
ref: A
|
|
1883
|
+
}, [
|
|
1884
|
+
s("button", {
|
|
1885
|
+
class: "size-btn",
|
|
1886
|
+
onMousedown: r[7] ||= P((...e) => D($) && D($)(...e), ["prevent"]),
|
|
1887
|
+
title: D(p)("fontSize.decrease")
|
|
1888
|
+
}, " − ", 40, Gt),
|
|
1889
|
+
s("input", {
|
|
1890
|
+
class: "size-trigger size-input",
|
|
1891
|
+
type: "text",
|
|
1892
|
+
value: U.value,
|
|
1893
|
+
title: D(p)("fontSize"),
|
|
1894
|
+
onMousedown: r[8] ||= P(() => {}, ["stop"]),
|
|
1895
|
+
onFocus: r[9] ||= (...e) => D(le) && D(le)(...e),
|
|
1896
|
+
"aria-expanded": D(L) === "size",
|
|
1897
|
+
"aria-haspopup": "listbox",
|
|
1898
|
+
onInput: r[10] ||= (...e) => D(ue) && D(ue)(...e),
|
|
1899
|
+
onKeydown: [
|
|
1900
|
+
r[11] ||= N(P((e) => D(pe)(), ["prevent", "stop"]), ["up"]),
|
|
1901
|
+
r[12] ||= N(P((e) => D($)(), ["prevent", "stop"]), ["down"]),
|
|
1902
|
+
r[13] ||= N(P((e) => D(de)(e), ["prevent"]), ["enter"])
|
|
1903
|
+
],
|
|
1904
|
+
onBlur: r[14] ||= (e) => D(de)(e)
|
|
1905
|
+
}, null, 40, Kt),
|
|
1906
|
+
s("button", {
|
|
1907
|
+
class: "size-btn",
|
|
1908
|
+
onMousedown: r[15] ||= P((...e) => D(pe) && D(pe)(...e), ["prevent"]),
|
|
1909
|
+
title: D(p)("fontSize.increase")
|
|
1910
|
+
}, " + ", 40, qt),
|
|
1911
|
+
D(L) === "size" ? (v(), o("div", {
|
|
1912
|
+
key: 0,
|
|
1913
|
+
style: h(D(R)),
|
|
1914
|
+
class: "toolbar-dropdown__menu size-menu"
|
|
1915
|
+
}, [(v(!0), o(n, null, S(D(qe), (e) => (v(), o("button", {
|
|
1916
|
+
key: e,
|
|
1917
|
+
class: m(["toolbar-dropdown__item", { active: U.value === e }]),
|
|
1918
|
+
onMousedown: P((t) => D(fe)(e), ["prevent"])
|
|
1919
|
+
}, T(e), 43, Jt))), 128))], 4)) : a("", !0)
|
|
1920
|
+
], 512),
|
|
1921
|
+
r[45] ||= s("span", { class: "divider" }, null, -1),
|
|
1922
|
+
s("button", {
|
|
1923
|
+
title: D(p)("boldShortcut"),
|
|
1924
|
+
"aria-label": D(p)("bold"),
|
|
1925
|
+
class: m({ active: H.value.textFormatting.bold }),
|
|
1926
|
+
onMousedown: r[16] ||= P((e) => Q("toggleBold"), ["prevent"])
|
|
1927
|
+
}, [l(q, { name: "format_bold" })], 42, Yt),
|
|
1928
|
+
s("button", {
|
|
1929
|
+
title: D(p)("italicShortcut"),
|
|
1930
|
+
"aria-label": D(p)("italic"),
|
|
1931
|
+
class: m({ active: H.value.textFormatting.italic }),
|
|
1932
|
+
onMousedown: r[17] ||= P((e) => Q("toggleItalic"), ["prevent"])
|
|
1933
|
+
}, [l(q, { name: "format_italic" })], 42, Xt),
|
|
1934
|
+
s("button", {
|
|
1935
|
+
title: D(p)("underlineShortcut"),
|
|
1936
|
+
"aria-label": D(p)("underline"),
|
|
1937
|
+
class: m({ active: !!H.value.textFormatting.underline }),
|
|
1938
|
+
onMousedown: r[18] ||= P((e) => Q("toggleUnderline"), ["prevent"])
|
|
1939
|
+
}, [l(q, { name: "format_underlined" })], 42, Zt),
|
|
1940
|
+
s("button", {
|
|
1941
|
+
title: D(p)("formattingBar.strikethrough"),
|
|
1942
|
+
"aria-label": D(p)("formattingBar.strikethrough"),
|
|
1943
|
+
class: m({ active: H.value.textFormatting.strike }),
|
|
1944
|
+
onMousedown: r[19] ||= P((e) => Q("toggleStrike"), ["prevent"])
|
|
1945
|
+
}, [l(q, { name: "strikethrough_s" })], 42, Qt),
|
|
1946
|
+
l(D(d), {
|
|
1947
|
+
mode: "text",
|
|
1948
|
+
value: ae.value,
|
|
1949
|
+
theme: t.theme ?? null,
|
|
1950
|
+
onChange: me
|
|
1951
|
+
}, null, 8, ["value", "theme"]),
|
|
1952
|
+
l(D(d), {
|
|
1953
|
+
mode: "highlight",
|
|
1954
|
+
value: oe.value,
|
|
1955
|
+
theme: t.theme ?? null,
|
|
1956
|
+
onChange: ge
|
|
1957
|
+
}, null, 8, ["value", "theme"]),
|
|
1958
|
+
s("button", {
|
|
1959
|
+
title: D(p)("formattingBar.insertLinkShortcut"),
|
|
1960
|
+
"aria-label": D(p)("formattingBar.insertLink"),
|
|
1961
|
+
onMousedown: r[20] ||= P((t) => e.$emit("insert-link"), ["prevent"])
|
|
1962
|
+
}, [l(q, { name: "link" })], 40, $t),
|
|
1963
|
+
s("button", {
|
|
1964
|
+
title: D(p)("formattingBar.superscriptShortcut"),
|
|
1965
|
+
"aria-label": D(p)("formattingBar.superscript"),
|
|
1966
|
+
class: m({ active: H.value.textFormatting.vertAlign === "superscript" }),
|
|
1967
|
+
onMousedown: r[21] ||= P((e) => Q("toggleSuperscript"), ["prevent"])
|
|
1968
|
+
}, [l(q, { name: "superscript" })], 42, en),
|
|
1969
|
+
s("button", {
|
|
1970
|
+
title: D(p)("formattingBar.subscriptShortcut"),
|
|
1971
|
+
"aria-label": D(p)("formattingBar.subscript"),
|
|
1972
|
+
class: m({ active: H.value.textFormatting.vertAlign === "subscript" }),
|
|
1973
|
+
onMousedown: r[22] ||= P((e) => Q("toggleSubscript"), ["prevent"])
|
|
1974
|
+
}, [l(q, { name: "subscript" })], 42, tn),
|
|
1975
|
+
r[46] ||= s("span", { class: "divider" }, null, -1),
|
|
1976
|
+
s("div", {
|
|
1977
|
+
class: "toolbar-dropdown",
|
|
1978
|
+
ref_key: "alignDropdownRef",
|
|
1979
|
+
ref: j
|
|
1980
|
+
}, [s("button", {
|
|
1981
|
+
class: "toolbar-dropdown__trigger align-trigger",
|
|
1982
|
+
onMousedown: r[23] ||= P((e) => D(B)("align"), ["prevent"]),
|
|
1983
|
+
"aria-expanded": D(L) === "align",
|
|
1984
|
+
"aria-haspopup": "listbox",
|
|
1985
|
+
title: D(p)("alignmentGroup")
|
|
1986
|
+
}, [l(q, { name: G.value }, null, 8, ["name"]), l(q, {
|
|
1987
|
+
class: "chevron",
|
|
1988
|
+
name: "arrow_drop_down",
|
|
1989
|
+
size: 16
|
|
1990
|
+
})], 40, nn), D(L) === "align" ? (v(), o("div", {
|
|
1991
|
+
key: 0,
|
|
1992
|
+
style: h(D(R)),
|
|
1993
|
+
class: "toolbar-dropdown__menu align-strip"
|
|
1994
|
+
}, [
|
|
1995
|
+
s("button", {
|
|
1996
|
+
class: m(["align-strip__btn", { active: W.value === "left" }]),
|
|
1997
|
+
title: `${D(p)("alignLeft")} (${D(p)("alignment.alignLeftShortcut")})`,
|
|
1998
|
+
onMousedown: r[24] ||= P((e) => {
|
|
1999
|
+
Q("alignLeft"), L.value = null;
|
|
2000
|
+
}, ["prevent"])
|
|
2001
|
+
}, [l(q, {
|
|
2002
|
+
name: "format_align_left",
|
|
2003
|
+
size: 18
|
|
2004
|
+
})], 42, rn),
|
|
2005
|
+
s("button", {
|
|
2006
|
+
class: m(["align-strip__btn", { active: W.value === "center" }]),
|
|
2007
|
+
title: `${D(p)("alignCenter")} (${D(p)("alignment.centerShortcut")})`,
|
|
2008
|
+
onMousedown: r[25] ||= P((e) => {
|
|
2009
|
+
Q("alignCenter"), L.value = null;
|
|
2010
|
+
}, ["prevent"])
|
|
2011
|
+
}, [l(q, {
|
|
2012
|
+
name: "format_align_center",
|
|
2013
|
+
size: 18
|
|
2014
|
+
})], 42, an),
|
|
2015
|
+
s("button", {
|
|
2016
|
+
class: m(["align-strip__btn", { active: W.value === "right" }]),
|
|
2017
|
+
title: `${D(p)("alignRight")} (${D(p)("alignment.alignRightShortcut")})`,
|
|
2018
|
+
onMousedown: r[26] ||= P((e) => {
|
|
2019
|
+
Q("alignRight"), L.value = null;
|
|
2020
|
+
}, ["prevent"])
|
|
2021
|
+
}, [l(q, {
|
|
2022
|
+
name: "format_align_right",
|
|
2023
|
+
size: 18
|
|
2024
|
+
})], 42, on),
|
|
2025
|
+
s("button", {
|
|
2026
|
+
class: m(["align-strip__btn", { active: W.value === "both" }]),
|
|
2027
|
+
title: `${D(p)("justify")} (${D(p)("alignment.justifyShortcut")})`,
|
|
2028
|
+
onMousedown: r[27] ||= P((e) => {
|
|
2029
|
+
Q("alignJustify"), L.value = null;
|
|
2030
|
+
}, ["prevent"])
|
|
2031
|
+
}, [l(q, {
|
|
2032
|
+
name: "format_align_justify",
|
|
2033
|
+
size: 18
|
|
2034
|
+
})], 42, sn)
|
|
2035
|
+
], 4)) : a("", !0)], 512),
|
|
2036
|
+
s("button", {
|
|
2037
|
+
title: D(p)("bulletList"),
|
|
2038
|
+
"aria-label": D(p)("bulletList"),
|
|
2039
|
+
class: m({ active: H.value.inList && H.value.listType === "bullet" }),
|
|
2040
|
+
onMousedown: r[28] ||= P((e) => Q("toggleBulletList"), ["prevent"])
|
|
2041
|
+
}, [l(q, { name: "format_list_bulleted" })], 42, cn),
|
|
2042
|
+
s("button", {
|
|
2043
|
+
title: D(p)("numberedList"),
|
|
2044
|
+
"aria-label": D(p)("numberedList"),
|
|
2045
|
+
class: m({ active: H.value.inList && H.value.listType === "numbered" }),
|
|
2046
|
+
onMousedown: r[29] ||= P((e) => Q("toggleNumberedList"), ["prevent"])
|
|
2047
|
+
}, [l(q, { name: "format_list_numbered" })], 42, ln),
|
|
2048
|
+
s("button", {
|
|
2049
|
+
title: D(p)("decreaseIndent"),
|
|
2050
|
+
"aria-label": D(p)("decreaseIndent"),
|
|
2051
|
+
disabled: !Y.value,
|
|
2052
|
+
onMousedown: r[30] ||= P((e) => Q("outdent"), ["prevent"])
|
|
2053
|
+
}, [l(q, { name: "format_indent_decrease" })], 40, un),
|
|
2054
|
+
s("button", {
|
|
2055
|
+
title: D(p)("increaseIndent"),
|
|
2056
|
+
"aria-label": D(p)("increaseIndent"),
|
|
2057
|
+
onMousedown: r[31] ||= P((e) => Q("indent"), ["prevent"])
|
|
2058
|
+
}, [l(q, { name: "format_indent_increase" })], 40, dn),
|
|
2059
|
+
s("div", {
|
|
2060
|
+
class: "toolbar-dropdown",
|
|
2061
|
+
ref_key: "spacingDropdownRef",
|
|
2062
|
+
ref: M
|
|
2063
|
+
}, [s("button", {
|
|
2064
|
+
class: "toolbar-dropdown__trigger",
|
|
2065
|
+
onMousedown: r[32] ||= P((e) => D(B)("spacing"), ["prevent"]),
|
|
2066
|
+
"aria-expanded": D(L) === "spacing",
|
|
2067
|
+
"aria-haspopup": "listbox",
|
|
2068
|
+
title: D(p)("lineSpacing.label")
|
|
2069
|
+
}, [l(q, { name: "format_line_spacing" }), l(q, {
|
|
2070
|
+
class: "chevron",
|
|
2071
|
+
name: "arrow_drop_down",
|
|
2072
|
+
size: 16
|
|
2073
|
+
})], 40, fn), D(L) === "spacing" ? (v(), o("div", {
|
|
2074
|
+
key: 0,
|
|
2075
|
+
style: h(D(R)),
|
|
2076
|
+
class: "toolbar-dropdown__menu"
|
|
2077
|
+
}, [(v(!0), o(n, null, S(D(Ye), (e) => (v(), o("button", {
|
|
2078
|
+
key: e.value,
|
|
2079
|
+
class: m(["toolbar-dropdown__item", { active: ye(e.value) }]),
|
|
2080
|
+
onMousedown: P((t) => ve(e.value), ["prevent"])
|
|
2081
|
+
}, T(e.labelKey ? D(p)(e.labelKey) : e.label), 43, pn))), 128))], 4)) : a("", !0)], 512),
|
|
2082
|
+
s("button", {
|
|
2083
|
+
title: D(p)("formattingBar.clearFormatting"),
|
|
2084
|
+
"aria-label": D(p)("formattingBar.clearFormatting"),
|
|
2085
|
+
onMousedown: P(he, ["prevent"])
|
|
2086
|
+
}, [l(q, { name: "format_clear" })], 40, mn),
|
|
2087
|
+
r[47] ||= s("span", { class: "divider" }, null, -1),
|
|
2088
|
+
s("button", {
|
|
2089
|
+
title: D(p)("formattingBar.commentsAndChanges"),
|
|
2090
|
+
"aria-label": D(p)("formattingBar.commentsAndChanges"),
|
|
2091
|
+
class: m({ active: t.commentsSidebarOpen }),
|
|
2092
|
+
onMousedown: r[33] ||= P((t) => e.$emit("toggle-sidebar"), ["prevent"])
|
|
2093
|
+
}, [l(q, { name: "comment" })], 42, hn),
|
|
2094
|
+
t.imageContext ? (v(), o(n, { key: 1 }, [
|
|
2095
|
+
r[40] ||= s("span", { class: "divider" }, null, -1),
|
|
2096
|
+
l(Te, {
|
|
2097
|
+
"image-context": t.imageContext,
|
|
2098
|
+
onChange: r[34] ||= (t) => e.$emit("image-wrap-type", t)
|
|
2099
|
+
}, null, 8, ["image-context"]),
|
|
2100
|
+
l(Ee, { onTransform: r[35] ||= (t) => e.$emit("image-transform", t) }),
|
|
2101
|
+
s("button", {
|
|
2102
|
+
title: D(p)("formattingBar.imagePropertiesShortcut"),
|
|
2103
|
+
"aria-label": D(p)("formattingBar.imageProperties"),
|
|
2104
|
+
onMousedown: r[36] ||= P((t) => e.$emit("image-properties"), ["prevent"])
|
|
2105
|
+
}, [l(q, { name: "tune" })], 40, gn)
|
|
2106
|
+
], 64)) : a("", !0),
|
|
2107
|
+
C(e.$slots, "table-context", {}, void 0, !0),
|
|
2108
|
+
t.showReviewControls ? (v(), o(n, { key: 2 }, [r[41] ||= s("span", { class: "divider" }, null, -1), l(He, {
|
|
2109
|
+
"track-changes-on": t.trackChangesOn,
|
|
2110
|
+
"display-mode": t.displayMode,
|
|
2111
|
+
"read-only": t.readOnly,
|
|
2112
|
+
onToggleTrackChanges: r[37] ||= (t) => e.$emit("toggle-track-changes"),
|
|
2113
|
+
"onUpdate:displayMode": r[38] ||= (t) => e.$emit("update:display-mode", t)
|
|
2114
|
+
}, null, 8, [
|
|
2115
|
+
"track-changes-on",
|
|
2116
|
+
"display-mode",
|
|
2117
|
+
"read-only"
|
|
2118
|
+
])], 64)) : a("", !0),
|
|
2119
|
+
r[48] ||= s("span", { class: "divider" }, null, -1),
|
|
2120
|
+
t.editorMode ? (v(), i(Pe, {
|
|
2121
|
+
key: 3,
|
|
2122
|
+
"model-value": t.editorMode,
|
|
2123
|
+
"onUpdate:modelValue": r[39] ||= (t) => e.$emit("mode-change", t)
|
|
2124
|
+
}, null, 8, ["model-value"])) : a("", !0),
|
|
2125
|
+
C(e.$slots, "toolbar-extra", {}, void 0, !0)
|
|
2126
|
+
])) : a("", !0);
|
|
2127
|
+
}
|
|
2128
|
+
}), [["__scopeId", "data-v-e3cd76a8"]]), vn = ["aria-valuemax"], yn = { class: "docx-horizontal-ruler__ticks" }, bn = ["title", "onDblclick"], xn = 12240, Sn = 1440, Cn = 1440, wn = 567, Tn = "var(--doc-primary)", En = "var(--doc-primary)", Dn = "var(--doc-primary-hover)", On = 5, kn = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
2129
|
+
__name: "HorizontalRuler",
|
|
2130
|
+
props: {
|
|
2131
|
+
sectionProps: {},
|
|
2132
|
+
zoom: { default: 1 },
|
|
2133
|
+
editable: {
|
|
2134
|
+
type: Boolean,
|
|
2135
|
+
default: !0
|
|
2136
|
+
},
|
|
2137
|
+
showFirstLineIndent: {
|
|
2138
|
+
type: Boolean,
|
|
2139
|
+
default: !1
|
|
2140
|
+
},
|
|
2141
|
+
firstLineIndent: { default: 0 },
|
|
2142
|
+
hangingIndent: {
|
|
2143
|
+
type: Boolean,
|
|
2144
|
+
default: !1
|
|
2145
|
+
},
|
|
2146
|
+
indentLeft: { default: 0 },
|
|
2147
|
+
indentRight: { default: 0 },
|
|
2148
|
+
unit: { default: "inch" },
|
|
2149
|
+
tabStops: {}
|
|
2150
|
+
},
|
|
2151
|
+
emits: [
|
|
2152
|
+
"left-margin-change",
|
|
2153
|
+
"right-margin-change",
|
|
2154
|
+
"first-line-indent-change",
|
|
2155
|
+
"indent-left-change",
|
|
2156
|
+
"indent-right-change",
|
|
2157
|
+
"tab-stop-remove"
|
|
2158
|
+
],
|
|
2159
|
+
setup(e, { emit: t }) {
|
|
2160
|
+
let i = e, c = t, l = Math.round(On * 1.6), u = x(null), d = x(null), f = x(null), p = x(0), m = x("");
|
|
2161
|
+
function _(e) {
|
|
2162
|
+
return L(e) * i.zoom;
|
|
2163
|
+
}
|
|
2164
|
+
function y(e) {
|
|
2165
|
+
return Math.round(I(e / i.zoom));
|
|
2166
|
+
}
|
|
2167
|
+
let b = r(() => i.sectionProps?.pageWidth ?? xn), C = r(() => i.sectionProps?.marginLeft ?? Sn), w = r(() => i.sectionProps?.marginRight ?? Sn), E = r(() => b.value - C.value - w.value), D = r(() => _(b.value)), O = r(() => _(C.value)), k = r(() => _(w.value)), A = r(() => _(i.indentLeft)), j = r(() => _(i.indentRight)), M = r(() => i.hangingIndent ? -i.firstLineIndent : i.firstLineIndent), N = r(() => _(M.value)), F = r(() => O.value + A.value), R = r(() => D.value - k.value - j.value), ee = r(() => O.value + A.value + N.value), te = r(() => ({
|
|
2168
|
+
position: "relative",
|
|
2169
|
+
width: D.value + "px",
|
|
2170
|
+
height: "22px",
|
|
2171
|
+
backgroundColor: "transparent",
|
|
2172
|
+
overflow: "visible",
|
|
2173
|
+
userSelect: "none",
|
|
2174
|
+
cursor: d.value ? "ew-resize" : "default"
|
|
2175
|
+
})), z = r(() => ({
|
|
2176
|
+
position: "absolute",
|
|
2177
|
+
top: 0,
|
|
2178
|
+
left: 0,
|
|
2179
|
+
width: O.value + "px",
|
|
2180
|
+
height: "22px",
|
|
2181
|
+
backgroundColor: "var(--doc-shadow-subtle)",
|
|
2182
|
+
borderRight: "1px solid var(--doc-shadow-subtle)",
|
|
2183
|
+
cursor: i.editable ? "ew-resize" : "default",
|
|
2184
|
+
zIndex: 1
|
|
2185
|
+
})), B = r(() => ({
|
|
2186
|
+
position: "absolute",
|
|
2187
|
+
top: 0,
|
|
2188
|
+
right: 0,
|
|
2189
|
+
width: k.value + "px",
|
|
2190
|
+
height: "22px",
|
|
2191
|
+
backgroundColor: "var(--doc-shadow-subtle)",
|
|
2192
|
+
borderLeft: "1px solid var(--doc-shadow-subtle)",
|
|
2193
|
+
cursor: i.editable ? "ew-resize" : "default",
|
|
2194
|
+
zIndex: 1
|
|
2195
|
+
})), V = r(() => {
|
|
2196
|
+
let e = [];
|
|
2197
|
+
if (i.unit === "inch") {
|
|
2198
|
+
let t = Cn / 8, n = Math.ceil(b.value / t);
|
|
2199
|
+
for (let r = 0; r <= n; r++) {
|
|
2200
|
+
let n = r * t;
|
|
2201
|
+
if (n > b.value) break;
|
|
2202
|
+
let i = _(n);
|
|
2203
|
+
r % 8 == 0 ? e.push({
|
|
2204
|
+
position: i,
|
|
2205
|
+
height: 10,
|
|
2206
|
+
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
2207
|
+
}) : r % 4 == 0 ? e.push({
|
|
2208
|
+
position: i,
|
|
2209
|
+
height: 6
|
|
2210
|
+
}) : r % 2 == 0 ? e.push({
|
|
2211
|
+
position: i,
|
|
2212
|
+
height: 4
|
|
2213
|
+
}) : e.push({
|
|
2214
|
+
position: i,
|
|
2215
|
+
height: 2
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
} else {
|
|
2219
|
+
let t = wn / 10, n = Math.ceil(b.value / t);
|
|
2220
|
+
for (let r = 0; r <= n; r++) {
|
|
2221
|
+
let n = r * t;
|
|
2222
|
+
if (n > b.value) break;
|
|
2223
|
+
let i = _(n);
|
|
2224
|
+
r % 10 == 0 ? e.push({
|
|
2225
|
+
position: i,
|
|
2226
|
+
height: 10,
|
|
2227
|
+
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
2228
|
+
}) : r % 5 == 0 ? e.push({
|
|
2229
|
+
position: i,
|
|
2230
|
+
height: 6
|
|
2231
|
+
}) : e.push({
|
|
2232
|
+
position: i,
|
|
2233
|
+
height: 3
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
return e;
|
|
2238
|
+
}), H = r(() => i.tabStops?.length ? i.tabStops.map((e) => {
|
|
2239
|
+
let t = e.position;
|
|
2240
|
+
return {
|
|
2241
|
+
px: _(t),
|
|
2242
|
+
twips: t,
|
|
2243
|
+
label: ne(t)
|
|
2244
|
+
};
|
|
2245
|
+
}) : []);
|
|
2246
|
+
function ne(e) {
|
|
2247
|
+
return i.unit === "cm" ? (e / wn).toFixed(1) + " cm" : (e / Cn).toFixed(2) + "\"";
|
|
2248
|
+
}
|
|
2249
|
+
function U(e) {
|
|
2250
|
+
return d.value === e ? Dn : f.value === e ? En : Tn;
|
|
2251
|
+
}
|
|
2252
|
+
function W(e, t, n) {
|
|
2253
|
+
return {
|
|
2254
|
+
position: "absolute",
|
|
2255
|
+
left: t - On + "px",
|
|
2256
|
+
width: "10px",
|
|
2257
|
+
height: "10px",
|
|
2258
|
+
cursor: i.editable ? "ew-resize" : "default",
|
|
2259
|
+
zIndex: n ? 10 : 4,
|
|
2260
|
+
...e === "down" ? { top: 0 } : { bottom: 0 }
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
function G(e, t) {
|
|
2264
|
+
return e === "down" ? {
|
|
2265
|
+
position: "absolute",
|
|
2266
|
+
top: "1px",
|
|
2267
|
+
left: 0,
|
|
2268
|
+
width: 0,
|
|
2269
|
+
height: 0,
|
|
2270
|
+
borderLeft: `${On}px solid transparent`,
|
|
2271
|
+
borderRight: `${On}px solid transparent`,
|
|
2272
|
+
borderTop: `${l}px solid ${t}`,
|
|
2273
|
+
transition: "border-top-color 0.1s"
|
|
2274
|
+
} : {
|
|
2275
|
+
position: "absolute",
|
|
2276
|
+
bottom: "1px",
|
|
2277
|
+
left: 0,
|
|
2278
|
+
width: 0,
|
|
2279
|
+
height: 0,
|
|
2280
|
+
borderLeft: `${On}px solid transparent`,
|
|
2281
|
+
borderRight: `${On}px solid transparent`,
|
|
2282
|
+
borderBottom: `${l}px solid ${t}`,
|
|
2283
|
+
transition: "border-bottom-color 0.1s"
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
let K = 0;
|
|
2287
|
+
function q(e, t) {
|
|
2288
|
+
i.editable && (d.value = e, e === "leftMargin" ? K = C.value : e === "rightMargin" ? K = w.value : e === "leftIndent" ? K = i.indentLeft : e === "rightIndent" ? K = i.indentRight : e === "firstLineIndent" && (K = i.firstLineIndent), p.value = t.clientX - (u.value?.getBoundingClientRect().left ?? 0), m.value = ne(K), document.addEventListener("mousemove", J), document.addEventListener("mouseup", re));
|
|
2289
|
+
}
|
|
2290
|
+
function J(e) {
|
|
2291
|
+
if (!d.value || !u.value) return;
|
|
2292
|
+
let t = u.value.getBoundingClientRect();
|
|
2293
|
+
if (!t) return;
|
|
2294
|
+
let n = e.clientX - t.left;
|
|
2295
|
+
p.value = n;
|
|
2296
|
+
let r = y(n), i = ie(d.value, r);
|
|
2297
|
+
m.value = ne(i), Y(d.value, i);
|
|
2298
|
+
}
|
|
2299
|
+
function re(e) {
|
|
2300
|
+
d.value = null, document.removeEventListener("mousemove", J), document.removeEventListener("mouseup", re);
|
|
2301
|
+
}
|
|
2302
|
+
function ie(e, t) {
|
|
2303
|
+
if (e === "leftMargin") {
|
|
2304
|
+
let e = b.value - w.value - 720;
|
|
2305
|
+
return Math.round(Math.max(0, Math.min(t, e)));
|
|
2306
|
+
}
|
|
2307
|
+
if (e === "rightMargin") {
|
|
2308
|
+
let e = b.value - t, n = b.value - C.value - 720;
|
|
2309
|
+
return Math.round(Math.max(0, Math.min(e, n)));
|
|
2310
|
+
}
|
|
2311
|
+
if (e === "firstLineIndent") {
|
|
2312
|
+
let e = t - (C.value + i.indentLeft), n = E.value - i.indentLeft - i.indentRight - 720;
|
|
2313
|
+
return Math.round(Math.max(-i.indentLeft, Math.min(e, n)));
|
|
2314
|
+
}
|
|
2315
|
+
if (e === "leftIndent") {
|
|
2316
|
+
let e = t - C.value, n = E.value - i.indentRight - 720;
|
|
2317
|
+
return Math.round(Math.max(0, Math.min(e, n)));
|
|
2318
|
+
}
|
|
2319
|
+
let n = b.value - w.value - t, r = E.value - i.indentLeft - 720;
|
|
2320
|
+
return Math.round(Math.max(0, Math.min(n, r)));
|
|
2321
|
+
}
|
|
2322
|
+
function Y(e, t) {
|
|
2323
|
+
switch (e) {
|
|
2324
|
+
case "leftMargin":
|
|
2325
|
+
c("left-margin-change", t);
|
|
2326
|
+
break;
|
|
2327
|
+
case "rightMargin":
|
|
2328
|
+
c("right-margin-change", t);
|
|
2329
|
+
break;
|
|
2330
|
+
case "firstLineIndent":
|
|
2331
|
+
c("first-line-indent-change", t);
|
|
2332
|
+
break;
|
|
2333
|
+
case "leftIndent":
|
|
2334
|
+
c("indent-left-change", t);
|
|
2335
|
+
break;
|
|
2336
|
+
case "rightIndent":
|
|
2337
|
+
c("indent-right-change", t);
|
|
2338
|
+
break;
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
return g(() => {
|
|
2342
|
+
document.removeEventListener("mousemove", J), document.removeEventListener("mouseup", re);
|
|
2343
|
+
}), (t, r) => (v(), o("div", {
|
|
2344
|
+
ref_key: "rulerRef",
|
|
2345
|
+
ref: u,
|
|
2346
|
+
class: "docx-horizontal-ruler",
|
|
2347
|
+
style: h(te.value),
|
|
2348
|
+
role: "slider",
|
|
2349
|
+
"aria-label": "Horizontal ruler",
|
|
2350
|
+
"aria-valuemin": 0,
|
|
2351
|
+
"aria-valuemax": b.value
|
|
2352
|
+
}, [
|
|
2353
|
+
s("div", {
|
|
2354
|
+
class: "docx-horizontal-ruler__margin",
|
|
2355
|
+
style: h(z.value),
|
|
2356
|
+
onMousedown: r[0] ||= P((t) => e.editable ? q("leftMargin", t) : null, ["prevent", "stop"])
|
|
2357
|
+
}, null, 36),
|
|
2358
|
+
s("div", {
|
|
2359
|
+
class: "docx-horizontal-ruler__margin",
|
|
2360
|
+
style: h(B.value),
|
|
2361
|
+
onMousedown: r[1] ||= P((t) => e.editable ? q("rightMargin", t) : null, ["prevent", "stop"])
|
|
2362
|
+
}, null, 36),
|
|
2363
|
+
s("div", yn, [(v(!0), o(n, null, S(V.value, (e, t) => (v(), o(n, { key: t }, [s("div", {
|
|
2364
|
+
class: "docx-horizontal-ruler__tick-line",
|
|
2365
|
+
style: h({
|
|
2366
|
+
left: e.position + "px",
|
|
2367
|
+
height: e.height + "px"
|
|
2368
|
+
})
|
|
2369
|
+
}, null, 4), e.label ? (v(), o("div", {
|
|
2370
|
+
key: 0,
|
|
2371
|
+
class: "docx-horizontal-ruler__tick-label",
|
|
2372
|
+
style: h({ left: e.position + "px" })
|
|
2373
|
+
}, T(e.label), 5)) : a("", !0)], 64))), 128))]),
|
|
2374
|
+
e.showFirstLineIndent ? (v(), o("div", {
|
|
2375
|
+
key: 0,
|
|
2376
|
+
class: "docx-ruler-indent",
|
|
2377
|
+
style: h(W("down", ee.value, d.value === "firstLineIndent")),
|
|
2378
|
+
onMousedown: r[2] ||= P((t) => e.editable ? q("firstLineIndent", t) : null, ["prevent", "stop"]),
|
|
2379
|
+
onMouseenter: r[3] ||= (e) => f.value = "firstLineIndent",
|
|
2380
|
+
onMouseleave: r[4] ||= (e) => f.value = null
|
|
2381
|
+
}, [s("div", { style: h(G("down", U("firstLineIndent"))) }, null, 4)], 36)) : a("", !0),
|
|
2382
|
+
e.editable ? (v(), o("div", {
|
|
2383
|
+
key: 1,
|
|
2384
|
+
class: "docx-ruler-indent",
|
|
2385
|
+
style: h(W("up", F.value, d.value === "leftIndent")),
|
|
2386
|
+
onMousedown: r[5] ||= P((e) => q("leftIndent", e), ["prevent", "stop"]),
|
|
2387
|
+
onMouseenter: r[6] ||= (e) => f.value = "leftIndent",
|
|
2388
|
+
onMouseleave: r[7] ||= (e) => f.value = null
|
|
2389
|
+
}, [s("div", { style: h(G("up", U("leftIndent"))) }, null, 4)], 36)) : a("", !0),
|
|
2390
|
+
e.editable ? (v(), o("div", {
|
|
2391
|
+
key: 2,
|
|
2392
|
+
class: "docx-ruler-indent",
|
|
2393
|
+
style: h(W("down", R.value, d.value === "rightIndent")),
|
|
2394
|
+
onMousedown: r[8] ||= P((e) => q("rightIndent", e), ["prevent", "stop"]),
|
|
2395
|
+
onMouseenter: r[9] ||= (e) => f.value = "rightIndent",
|
|
2396
|
+
onMouseleave: r[10] ||= (e) => f.value = null
|
|
2397
|
+
}, [s("div", { style: h(G("down", U("rightIndent"))) }, null, 4)], 36)) : a("", !0),
|
|
2398
|
+
(v(!0), o(n, null, S(H.value, (e, n) => (v(), o("div", {
|
|
2399
|
+
key: n,
|
|
2400
|
+
class: "docx-horizontal-ruler__tab",
|
|
2401
|
+
style: h({ left: e.px + "px" }),
|
|
2402
|
+
title: `${e.label}`,
|
|
2403
|
+
onDblclick: P((n) => t.$emit("tab-stop-remove", e.twips), ["prevent"])
|
|
2404
|
+
}, "L", 44, bn))), 128)),
|
|
2405
|
+
d.value && m.value ? (v(), o("div", {
|
|
2406
|
+
key: 3,
|
|
2407
|
+
class: "docx-horizontal-ruler__tooltip",
|
|
2408
|
+
style: h({ left: p.value + "px" })
|
|
2409
|
+
}, T(m.value), 5)) : a("", !0)
|
|
2410
|
+
], 12, vn));
|
|
2411
|
+
}
|
|
2412
|
+
}), [["__scopeId", "data-v-845ef58d"]]), An = ["disabled", "onClick"], jn = { class: "docx-tbp__panel" }, Mn = ["title", "onClick"], Nn = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
2413
|
+
__name: "TableBorderPicker",
|
|
2414
|
+
props: { disabled: { type: Boolean } },
|
|
2415
|
+
emits: ["change"],
|
|
2416
|
+
setup(e, { emit: t }) {
|
|
2417
|
+
let r = t, a = x(!1), c = [
|
|
2418
|
+
{
|
|
2419
|
+
value: "all",
|
|
2420
|
+
icon: "border_all",
|
|
2421
|
+
label: "All borders"
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
value: "none",
|
|
2425
|
+
icon: "border_clear",
|
|
2426
|
+
label: "No borders"
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
value: "box",
|
|
2430
|
+
icon: "border_outer",
|
|
2431
|
+
label: "Outside borders"
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
value: "inside",
|
|
2435
|
+
icon: "border_inner",
|
|
2436
|
+
label: "Inside borders"
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
value: "top",
|
|
2440
|
+
icon: "border_top",
|
|
2441
|
+
label: "Top border"
|
|
2442
|
+
},
|
|
2443
|
+
{
|
|
2444
|
+
value: "bottom",
|
|
2445
|
+
icon: "border_bottom",
|
|
2446
|
+
label: "Bottom border"
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
value: "left",
|
|
2450
|
+
icon: "border_left",
|
|
2451
|
+
label: "Left border"
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
value: "right",
|
|
2455
|
+
icon: "border_right",
|
|
2456
|
+
label: "Right border"
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
value: "insideH",
|
|
2460
|
+
icon: "border_horizontal",
|
|
2461
|
+
label: "Inside horizontal"
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
value: "insideV",
|
|
2465
|
+
icon: "border_vertical",
|
|
2466
|
+
label: "Inside vertical"
|
|
2467
|
+
}
|
|
2468
|
+
];
|
|
2469
|
+
function u(e) {
|
|
2470
|
+
r("change", e), a.value = !1;
|
|
2471
|
+
}
|
|
2472
|
+
return (t, r) => (v(), i(Z, {
|
|
2473
|
+
open: a.value,
|
|
2474
|
+
"onUpdate:open": r[0] ||= (e) => a.value = e,
|
|
2475
|
+
onClose: r[1] ||= (e) => a.value = !1
|
|
2476
|
+
}, {
|
|
2477
|
+
trigger: j(({ toggle: t }) => [s("button", {
|
|
2478
|
+
type: "button",
|
|
2479
|
+
class: "docx-tbp__btn",
|
|
2480
|
+
disabled: e.disabled,
|
|
2481
|
+
title: "Borders",
|
|
2482
|
+
onClick: P(t, ["prevent"])
|
|
2483
|
+
}, [l(q, {
|
|
2484
|
+
name: "border_all",
|
|
2485
|
+
size: 20
|
|
2486
|
+
})], 8, An)]),
|
|
2487
|
+
panel: j(() => [s("div", jn, [(v(), o(n, null, S(c, (e) => s("button", {
|
|
2488
|
+
key: e.value,
|
|
2489
|
+
type: "button",
|
|
2490
|
+
class: "docx-tbp__option",
|
|
2491
|
+
title: e.label,
|
|
2492
|
+
onClick: P((t) => u(e.value), ["prevent"])
|
|
2493
|
+
}, [l(q, {
|
|
2494
|
+
name: e.icon,
|
|
2495
|
+
size: 20
|
|
2496
|
+
}, null, 8, ["name"])], 8, Mn)), 64))])]),
|
|
2497
|
+
_: 1
|
|
2498
|
+
}, 8, ["open"]));
|
|
2499
|
+
}
|
|
2500
|
+
}), [["__scopeId", "data-v-47032801"]]), Pn = /* @__PURE__ */ u({
|
|
2501
|
+
__name: "TableBorderColorPicker",
|
|
2502
|
+
props: {
|
|
2503
|
+
disabled: { type: Boolean },
|
|
2504
|
+
theme: {},
|
|
2505
|
+
value: {}
|
|
2506
|
+
},
|
|
2507
|
+
emits: ["change"],
|
|
2508
|
+
setup(t, { emit: n }) {
|
|
2509
|
+
let r = n, { t: a } = e();
|
|
2510
|
+
function o(e) {
|
|
2511
|
+
typeof e == "string" ? r("change", e.replace(/^#/, "")) : e.rgb ? r("change", e.rgb.replace(/^#/, "")) : e.auto && r("change", "000000");
|
|
2512
|
+
}
|
|
2513
|
+
return (e, n) => (v(), i(Et, {
|
|
2514
|
+
mode: "border",
|
|
2515
|
+
value: t.value,
|
|
2516
|
+
theme: t.theme ?? null,
|
|
2517
|
+
disabled: t.disabled,
|
|
2518
|
+
title: D(a)("table.borderColor"),
|
|
2519
|
+
onChange: o
|
|
2520
|
+
}, null, 8, [
|
|
2521
|
+
"value",
|
|
2522
|
+
"theme",
|
|
2523
|
+
"disabled",
|
|
2524
|
+
"title"
|
|
2525
|
+
]));
|
|
2526
|
+
}
|
|
2527
|
+
}), Fn = ["disabled", "onClick"], In = { class: "docx-tbwidth__panel" }, Ln = ["onClick"], Rn = { class: "docx-tbwidth__label" }, zn = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
2528
|
+
__name: "TableBorderWidthPicker",
|
|
2529
|
+
props: { disabled: { type: Boolean } },
|
|
2530
|
+
emits: ["change"],
|
|
2531
|
+
setup(e, { emit: t }) {
|
|
2532
|
+
let r = t, a = x(!1), c = [
|
|
2533
|
+
{
|
|
2534
|
+
label: "0.5pt",
|
|
2535
|
+
eighths: 4,
|
|
2536
|
+
previewPx: 1
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
label: "0.75pt",
|
|
2540
|
+
eighths: 6,
|
|
2541
|
+
previewPx: 1
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
label: "1pt",
|
|
2545
|
+
eighths: 8,
|
|
2546
|
+
previewPx: 2
|
|
2547
|
+
},
|
|
2548
|
+
{
|
|
2549
|
+
label: "1.5pt",
|
|
2550
|
+
eighths: 12,
|
|
2551
|
+
previewPx: 2
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
label: "2.25pt",
|
|
2555
|
+
eighths: 18,
|
|
2556
|
+
previewPx: 3
|
|
2557
|
+
},
|
|
2558
|
+
{
|
|
2559
|
+
label: "3pt",
|
|
2560
|
+
eighths: 24,
|
|
2561
|
+
previewPx: 4
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
label: "4.5pt",
|
|
2565
|
+
eighths: 36,
|
|
2566
|
+
previewPx: 6
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
label: "6pt",
|
|
2570
|
+
eighths: 48,
|
|
2571
|
+
previewPx: 8
|
|
2572
|
+
}
|
|
2573
|
+
];
|
|
2574
|
+
function u(e) {
|
|
2575
|
+
r("change", e), a.value = !1;
|
|
2576
|
+
}
|
|
2577
|
+
return (t, r) => (v(), i(Z, {
|
|
2578
|
+
open: a.value,
|
|
2579
|
+
"onUpdate:open": r[0] ||= (e) => a.value = e,
|
|
2580
|
+
onClose: r[1] ||= (e) => a.value = !1
|
|
2581
|
+
}, {
|
|
2582
|
+
trigger: j(({ toggle: t }) => [s("button", {
|
|
2583
|
+
type: "button",
|
|
2584
|
+
class: "docx-tbwidth__btn",
|
|
2585
|
+
disabled: e.disabled,
|
|
2586
|
+
title: "Border width",
|
|
2587
|
+
onClick: P(t, ["prevent"])
|
|
2588
|
+
}, [l(q, {
|
|
2589
|
+
name: "line_weight",
|
|
2590
|
+
size: 20
|
|
2591
|
+
})], 8, Fn)]),
|
|
2592
|
+
panel: j(() => [s("div", In, [(v(), o(n, null, S(c, (e) => s("button", {
|
|
2593
|
+
key: e.eighths,
|
|
2594
|
+
type: "button",
|
|
2595
|
+
class: "docx-tbwidth__option",
|
|
2596
|
+
onClick: P((t) => u(e.eighths), ["prevent"])
|
|
2597
|
+
}, [s("span", {
|
|
2598
|
+
class: "docx-tbwidth__preview",
|
|
2599
|
+
style: h({ borderTopWidth: e.previewPx + "px" })
|
|
2600
|
+
}, null, 4), s("span", Rn, T(e.label), 1)], 8, Ln)), 64))])]),
|
|
2601
|
+
_: 1
|
|
2602
|
+
}, 8, ["open"]));
|
|
2603
|
+
}
|
|
2604
|
+
}), [["__scopeId", "data-v-f11ca0b1"]]), Bn = /* @__PURE__ */ u({
|
|
2605
|
+
__name: "TableCellFillPicker",
|
|
2606
|
+
props: {
|
|
2607
|
+
disabled: { type: Boolean },
|
|
2608
|
+
theme: {},
|
|
2609
|
+
value: {}
|
|
2610
|
+
},
|
|
2611
|
+
emits: ["change"],
|
|
2612
|
+
setup(t, { emit: n }) {
|
|
2613
|
+
let r = n, { t: a } = e();
|
|
2614
|
+
function o(e) {
|
|
2615
|
+
typeof e == "string" && r("change", e === "none" ? "" : e.replace(/^#/, ""));
|
|
2616
|
+
}
|
|
2617
|
+
return (e, n) => (v(), i(Et, {
|
|
2618
|
+
mode: "highlight",
|
|
2619
|
+
value: t.value,
|
|
2620
|
+
theme: t.theme ?? null,
|
|
2621
|
+
disabled: t.disabled,
|
|
2622
|
+
title: D(a)("table.cellFillColor"),
|
|
2623
|
+
icon: "format_color_fill",
|
|
2624
|
+
"auto-label": D(a)("colorPicker.noColor"),
|
|
2625
|
+
onChange: o
|
|
2626
|
+
}, null, 8, [
|
|
2627
|
+
"value",
|
|
2628
|
+
"theme",
|
|
2629
|
+
"disabled",
|
|
2630
|
+
"title",
|
|
2631
|
+
"auto-label"
|
|
2632
|
+
]));
|
|
2633
|
+
}
|
|
2634
|
+
}), Vn = [
|
|
2635
|
+
"disabled",
|
|
2636
|
+
"title",
|
|
2637
|
+
"onClick"
|
|
2638
|
+
], Hn = ["aria-label"], Un = ["disabled"], Wn = ["disabled"], Gn = ["disabled"], Kn = ["disabled"], qn = { class: "docx-tmore__section-label" }, Jn = { class: "docx-tmore__icon-row" }, Yn = ["title"], Xn = ["title"], Zn = ["title"], Qn = { class: "docx-tmore__section-label" }, $n = { class: "docx-tmore__icon-row" }, er = ["title"], tr = ["title"], nr = ["title"], rr = { class: "docx-tmore__grow" }, ir = {
|
|
2639
|
+
key: 0,
|
|
2640
|
+
class: "docx-tmore__sub"
|
|
2641
|
+
}, ar = { class: "docx-tmore__margin-grid" }, or = { class: "docx-tmore__field-label" }, sr = ["onUpdate:modelValue"], cr = { class: "docx-tmore__grow" }, lr = {
|
|
2642
|
+
key: 1,
|
|
2643
|
+
class: "docx-tmore__sub"
|
|
2644
|
+
}, ur = { class: "docx-tmore__row-field" }, dr = { class: "docx-tmore__field-label" }, fr = { value: "auto" }, pr = { value: "atLeast" }, mr = { value: "exact" }, hr = {
|
|
2645
|
+
key: 0,
|
|
2646
|
+
class: "docx-tmore__row-field"
|
|
2647
|
+
}, gr = { class: "docx-tmore__field-label" }, _r = { class: "docx-tmore__grow" }, vr = {
|
|
2648
|
+
key: 2,
|
|
2649
|
+
class: "docx-tmore__sub docx-tmore__sub--list"
|
|
2650
|
+
}, yr = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
2651
|
+
__name: "TableMoreDropdown",
|
|
2652
|
+
props: {
|
|
2653
|
+
disabled: {
|
|
2654
|
+
type: Boolean,
|
|
2655
|
+
default: !1
|
|
2656
|
+
},
|
|
2657
|
+
canSplit: {
|
|
2658
|
+
type: Boolean,
|
|
2659
|
+
default: !1
|
|
2660
|
+
},
|
|
2661
|
+
canMerge: {
|
|
2662
|
+
type: Boolean,
|
|
2663
|
+
default: !1
|
|
2664
|
+
},
|
|
2665
|
+
rowCount: { default: 0 },
|
|
2666
|
+
columnCount: { default: 0 },
|
|
2667
|
+
currentJustification: { default: "left" }
|
|
2668
|
+
},
|
|
2669
|
+
emits: [
|
|
2670
|
+
"action",
|
|
2671
|
+
"cell-margins",
|
|
2672
|
+
"cell-text-direction",
|
|
2673
|
+
"row-height"
|
|
2674
|
+
],
|
|
2675
|
+
setup(t, { emit: r }) {
|
|
2676
|
+
let c = t, u = r, { t: d } = e(), f = x(!1), p = x(!1), h = x(!1), g = x(!1), _ = b({
|
|
2677
|
+
top: 0,
|
|
2678
|
+
bottom: 0,
|
|
2679
|
+
left: 108,
|
|
2680
|
+
right: 108
|
|
2681
|
+
}), y = x(0), C = x("atLeast");
|
|
2682
|
+
A(f, (e) => {
|
|
2683
|
+
e || (p.value = !1, h.value = !1, g.value = !1);
|
|
2684
|
+
});
|
|
2685
|
+
function w(e) {
|
|
2686
|
+
return c.disabled ? !0 : e === "splitCell" ? !c.canSplit : e === "mergeCells" ? !c.canMerge : e === "deleteRow" ? (c.rowCount ?? 0) <= 1 : e === "deleteColumn" ? (c.columnCount ?? 0) <= 1 : !1;
|
|
2687
|
+
}
|
|
2688
|
+
function E(e) {
|
|
2689
|
+
w(e) || (u("action", e), f.value = !1);
|
|
2690
|
+
}
|
|
2691
|
+
let N = (e) => {
|
|
2692
|
+
let t = Number(e);
|
|
2693
|
+
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
2694
|
+
};
|
|
2695
|
+
function F() {
|
|
2696
|
+
u("cell-margins", {
|
|
2697
|
+
top: N(_.top),
|
|
2698
|
+
bottom: N(_.bottom),
|
|
2699
|
+
left: N(_.left),
|
|
2700
|
+
right: N(_.right)
|
|
2701
|
+
}), f.value = !1;
|
|
2702
|
+
}
|
|
2703
|
+
function I() {
|
|
2704
|
+
let e = N(y.value);
|
|
2705
|
+
C.value === "auto" || e <= 0 ? u("row-height", { height: null }) : u("row-height", {
|
|
2706
|
+
height: e,
|
|
2707
|
+
rule: C.value
|
|
2708
|
+
}), f.value = !1;
|
|
2709
|
+
}
|
|
2710
|
+
function L(e) {
|
|
2711
|
+
u("cell-text-direction", e), f.value = !1;
|
|
2712
|
+
}
|
|
2713
|
+
return (e, r) => (v(), i(Z, {
|
|
2714
|
+
open: f.value,
|
|
2715
|
+
placement: "bottom-right",
|
|
2716
|
+
"onUpdate:open": r[35] ||= (e) => f.value = e,
|
|
2717
|
+
onClose: r[36] ||= (e) => f.value = !1
|
|
2718
|
+
}, {
|
|
2719
|
+
trigger: j(({ toggle: e }) => [s("button", {
|
|
2720
|
+
type: "button",
|
|
2721
|
+
class: m(["docx-tmore__btn", { "docx-tmore__btn--open": f.value }]),
|
|
2722
|
+
disabled: t.disabled,
|
|
2723
|
+
title: D(d)("tableAdvanced.tableOptions"),
|
|
2724
|
+
onClick: P(e, ["prevent"])
|
|
2725
|
+
}, [l(q, {
|
|
2726
|
+
name: "more_vert",
|
|
2727
|
+
size: 20
|
|
2728
|
+
})], 10, Vn)]),
|
|
2729
|
+
panel: j(() => [s("div", {
|
|
2730
|
+
class: "docx-tmore__panel",
|
|
2731
|
+
role: "menu",
|
|
2732
|
+
"aria-label": D(d)("tableAdvanced.tableOptionsMenu")
|
|
2733
|
+
}, [
|
|
2734
|
+
s("button", {
|
|
2735
|
+
type: "button",
|
|
2736
|
+
class: "docx-tmore__item",
|
|
2737
|
+
onClick: r[0] ||= P((e) => E("addRowAbove"), ["prevent"])
|
|
2738
|
+
}, [l(q, {
|
|
2739
|
+
name: "add",
|
|
2740
|
+
size: 18
|
|
2741
|
+
}), s("span", null, T(D(d)("insertRowAbove")), 1)]),
|
|
2742
|
+
s("button", {
|
|
2743
|
+
type: "button",
|
|
2744
|
+
class: "docx-tmore__item",
|
|
2745
|
+
onClick: r[1] ||= P((e) => E("addRowBelow"), ["prevent"])
|
|
2746
|
+
}, [l(q, {
|
|
2747
|
+
name: "add",
|
|
2748
|
+
size: 18
|
|
2749
|
+
}), s("span", null, T(D(d)("insertRowBelow")), 1)]),
|
|
2750
|
+
s("button", {
|
|
2751
|
+
type: "button",
|
|
2752
|
+
class: "docx-tmore__item",
|
|
2753
|
+
onClick: r[2] ||= P((e) => E("addColumnLeft"), ["prevent"])
|
|
2754
|
+
}, [l(q, {
|
|
2755
|
+
name: "add",
|
|
2756
|
+
size: 18
|
|
2757
|
+
}), s("span", null, T(D(d)("insertColumnLeft")), 1)]),
|
|
2758
|
+
s("button", {
|
|
2759
|
+
type: "button",
|
|
2760
|
+
class: "docx-tmore__item",
|
|
2761
|
+
onClick: r[3] ||= P((e) => E("addColumnRight"), ["prevent"])
|
|
2762
|
+
}, [l(q, {
|
|
2763
|
+
name: "add",
|
|
2764
|
+
size: 18
|
|
2765
|
+
}), s("span", null, T(D(d)("insertColumnRight")), 1)]),
|
|
2766
|
+
r[39] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2767
|
+
s("button", {
|
|
2768
|
+
type: "button",
|
|
2769
|
+
class: "docx-tmore__item",
|
|
2770
|
+
disabled: w("mergeCells"),
|
|
2771
|
+
onClick: r[4] ||= P((e) => E("mergeCells"), ["prevent"])
|
|
2772
|
+
}, [l(q, {
|
|
2773
|
+
name: "call_merge",
|
|
2774
|
+
size: 18
|
|
2775
|
+
}), s("span", null, T(D(d)("table.mergeCells")), 1)], 8, Un),
|
|
2776
|
+
s("button", {
|
|
2777
|
+
type: "button",
|
|
2778
|
+
class: "docx-tmore__item",
|
|
2779
|
+
disabled: w("splitCell"),
|
|
2780
|
+
onClick: r[5] ||= P((e) => E("splitCell"), ["prevent"])
|
|
2781
|
+
}, [l(q, {
|
|
2782
|
+
name: "call_split",
|
|
2783
|
+
size: 18
|
|
2784
|
+
}), s("span", null, T(D(d)("table.splitCell")), 1)], 8, Wn),
|
|
2785
|
+
r[40] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2786
|
+
s("button", {
|
|
2787
|
+
type: "button",
|
|
2788
|
+
class: "docx-tmore__item",
|
|
2789
|
+
onClick: r[6] ||= P((e) => E("selectTable"), ["prevent"])
|
|
2790
|
+
}, [l(q, {
|
|
2791
|
+
name: "select_all",
|
|
2792
|
+
size: 18
|
|
2793
|
+
}), s("span", null, T(D(d)("table.selectTable")), 1)]),
|
|
2794
|
+
r[41] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2795
|
+
s("button", {
|
|
2796
|
+
type: "button",
|
|
2797
|
+
class: "docx-tmore__item docx-tmore__item--danger",
|
|
2798
|
+
disabled: w("deleteRow"),
|
|
2799
|
+
onClick: r[7] ||= P((e) => E("deleteRow"), ["prevent"])
|
|
2800
|
+
}, [l(q, {
|
|
2801
|
+
name: "delete",
|
|
2802
|
+
size: 18
|
|
2803
|
+
}), s("span", null, T(D(d)("deleteRow")), 1)], 8, Gn),
|
|
2804
|
+
s("button", {
|
|
2805
|
+
type: "button",
|
|
2806
|
+
class: "docx-tmore__item docx-tmore__item--danger",
|
|
2807
|
+
disabled: w("deleteColumn"),
|
|
2808
|
+
onClick: r[8] ||= P((e) => E("deleteColumn"), ["prevent"])
|
|
2809
|
+
}, [l(q, {
|
|
2810
|
+
name: "delete",
|
|
2811
|
+
size: 18
|
|
2812
|
+
}), s("span", null, T(D(d)("deleteColumn")), 1)], 8, Kn),
|
|
2813
|
+
s("button", {
|
|
2814
|
+
type: "button",
|
|
2815
|
+
class: "docx-tmore__item docx-tmore__item--danger",
|
|
2816
|
+
onClick: r[9] ||= P((e) => E("deleteTable"), ["prevent"])
|
|
2817
|
+
}, [l(q, {
|
|
2818
|
+
name: "delete",
|
|
2819
|
+
size: 18
|
|
2820
|
+
}), s("span", null, T(D(d)("table.deleteTable")), 1)]),
|
|
2821
|
+
r[42] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2822
|
+
s("div", qn, T(D(d)("tableAdvanced.verticalAlignment")), 1),
|
|
2823
|
+
s("div", Jn, [
|
|
2824
|
+
s("button", {
|
|
2825
|
+
type: "button",
|
|
2826
|
+
class: "docx-tmore__icon-btn",
|
|
2827
|
+
title: D(d)("tableAdvanced.top"),
|
|
2828
|
+
onMousedown: r[10] ||= P(() => {}, ["prevent"]),
|
|
2829
|
+
onClick: r[11] ||= P((e) => E("verticalAlignTop"), ["prevent"])
|
|
2830
|
+
}, [l(q, {
|
|
2831
|
+
name: "vertical_align_top",
|
|
2832
|
+
size: 16
|
|
2833
|
+
})], 40, Yn),
|
|
2834
|
+
s("button", {
|
|
2835
|
+
type: "button",
|
|
2836
|
+
class: "docx-tmore__icon-btn",
|
|
2837
|
+
title: D(d)("tableAdvanced.middle"),
|
|
2838
|
+
onMousedown: r[12] ||= P(() => {}, ["prevent"]),
|
|
2839
|
+
onClick: r[13] ||= P((e) => E("verticalAlignMiddle"), ["prevent"])
|
|
2840
|
+
}, [l(q, {
|
|
2841
|
+
name: "vertical_align_center",
|
|
2842
|
+
size: 16
|
|
2843
|
+
})], 40, Xn),
|
|
2844
|
+
s("button", {
|
|
2845
|
+
type: "button",
|
|
2846
|
+
class: "docx-tmore__icon-btn",
|
|
2847
|
+
title: D(d)("tableAdvanced.bottom"),
|
|
2848
|
+
onMousedown: r[14] ||= P(() => {}, ["prevent"]),
|
|
2849
|
+
onClick: r[15] ||= P((e) => E("verticalAlignBottom"), ["prevent"])
|
|
2850
|
+
}, [l(q, {
|
|
2851
|
+
name: "vertical_align_bottom",
|
|
2852
|
+
size: 16
|
|
2853
|
+
})], 40, Zn)
|
|
2854
|
+
]),
|
|
2855
|
+
r[43] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2856
|
+
s("div", Qn, T(D(d)("tableAdvanced.tableAlignment")), 1),
|
|
2857
|
+
s("div", $n, [
|
|
2858
|
+
s("button", {
|
|
2859
|
+
type: "button",
|
|
2860
|
+
class: m(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": t.currentJustification === "left" }]),
|
|
2861
|
+
title: D(d)("tableAdvanced.alignTableLeft"),
|
|
2862
|
+
onMousedown: r[16] ||= P(() => {}, ["prevent"]),
|
|
2863
|
+
onClick: r[17] ||= P((e) => E("alignTableLeft"), ["prevent"])
|
|
2864
|
+
}, [l(q, {
|
|
2865
|
+
name: "format_align_left",
|
|
2866
|
+
size: 16
|
|
2867
|
+
})], 42, er),
|
|
2868
|
+
s("button", {
|
|
2869
|
+
type: "button",
|
|
2870
|
+
class: m(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": t.currentJustification === "center" }]),
|
|
2871
|
+
title: D(d)("tableAdvanced.alignTableCenter"),
|
|
2872
|
+
onMousedown: r[18] ||= P(() => {}, ["prevent"]),
|
|
2873
|
+
onClick: r[19] ||= P((e) => E("alignTableCenter"), ["prevent"])
|
|
2874
|
+
}, [l(q, {
|
|
2875
|
+
name: "format_align_center",
|
|
2876
|
+
size: 16
|
|
2877
|
+
})], 42, tr),
|
|
2878
|
+
s("button", {
|
|
2879
|
+
type: "button",
|
|
2880
|
+
class: m(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": t.currentJustification === "right" }]),
|
|
2881
|
+
title: D(d)("tableAdvanced.alignTableRight"),
|
|
2882
|
+
onMousedown: r[20] ||= P(() => {}, ["prevent"]),
|
|
2883
|
+
onClick: r[21] ||= P((e) => E("alignTableRight"), ["prevent"])
|
|
2884
|
+
}, [l(q, {
|
|
2885
|
+
name: "format_align_right",
|
|
2886
|
+
size: 16
|
|
2887
|
+
})], 42, nr)
|
|
2888
|
+
]),
|
|
2889
|
+
r[44] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
2890
|
+
s("button", {
|
|
2891
|
+
type: "button",
|
|
2892
|
+
class: "docx-tmore__item",
|
|
2893
|
+
onClick: r[22] ||= P((e) => p.value = !p.value, ["prevent"])
|
|
2894
|
+
}, [
|
|
2895
|
+
l(q, {
|
|
2896
|
+
name: "padding",
|
|
2897
|
+
size: 18
|
|
2898
|
+
}),
|
|
2899
|
+
s("span", rr, T(D(d)("tableAdvanced.cellMargins")), 1),
|
|
2900
|
+
l(q, {
|
|
2901
|
+
name: p.value ? "expand_less" : "expand_more",
|
|
2902
|
+
size: 18
|
|
2903
|
+
}, null, 8, ["name"])
|
|
2904
|
+
]),
|
|
2905
|
+
p.value ? (v(), o("div", ir, [s("div", ar, [(v(), o(n, null, S([
|
|
2906
|
+
"top",
|
|
2907
|
+
"bottom",
|
|
2908
|
+
"left",
|
|
2909
|
+
"right"
|
|
2910
|
+
], (e) => s("label", {
|
|
2911
|
+
key: e,
|
|
2912
|
+
class: "docx-tmore__field"
|
|
2913
|
+
}, [
|
|
2914
|
+
s("span", or, T(e), 1),
|
|
2915
|
+
M(s("input", {
|
|
2916
|
+
type: "number",
|
|
2917
|
+
min: "0",
|
|
2918
|
+
step: "20",
|
|
2919
|
+
"onUpdate:modelValue": (t) => _[e] = t,
|
|
2920
|
+
class: "docx-tmore__input"
|
|
2921
|
+
}, null, 8, sr), [[
|
|
2922
|
+
k,
|
|
2923
|
+
_[e],
|
|
2924
|
+
void 0,
|
|
2925
|
+
{ number: !0 }
|
|
2926
|
+
]]),
|
|
2927
|
+
r[37] ||= s("span", { class: "docx-tmore__unit" }, "tw", -1)
|
|
2928
|
+
])), 64))]), s("button", {
|
|
2929
|
+
type: "button",
|
|
2930
|
+
class: "docx-tmore__apply",
|
|
2931
|
+
onClick: P(F, ["prevent"])
|
|
2932
|
+
}, T(D(d)("common.apply")), 1)])) : a("", !0),
|
|
2933
|
+
s("button", {
|
|
2934
|
+
type: "button",
|
|
2935
|
+
class: "docx-tmore__item",
|
|
2936
|
+
onClick: r[23] ||= P((e) => h.value = !h.value, ["prevent"])
|
|
2937
|
+
}, [
|
|
2938
|
+
l(q, {
|
|
2939
|
+
name: "height",
|
|
2940
|
+
size: 18
|
|
2941
|
+
}),
|
|
2942
|
+
s("span", cr, T(D(d)("tableAdvanced.rowHeight")), 1),
|
|
2943
|
+
l(q, {
|
|
2944
|
+
name: h.value ? "expand_less" : "expand_more",
|
|
2945
|
+
size: 18
|
|
2946
|
+
}, null, 8, ["name"])
|
|
2947
|
+
]),
|
|
2948
|
+
h.value ? (v(), o("div", lr, [
|
|
2949
|
+
s("label", ur, [s("span", dr, T(D(d)("tableAdvanced.rule")), 1), M(s("select", {
|
|
2950
|
+
"onUpdate:modelValue": r[24] ||= (e) => C.value = e,
|
|
2951
|
+
class: "docx-tmore__select"
|
|
2952
|
+
}, [
|
|
2953
|
+
s("option", fr, T(D(d)("tableAdvanced.heightRules.auto")), 1),
|
|
2954
|
+
s("option", pr, T(D(d)("tableAdvanced.heightRules.atLeast")), 1),
|
|
2955
|
+
s("option", mr, T(D(d)("tableAdvanced.heightRules.exact")), 1)
|
|
2956
|
+
], 512), [[O, C.value]])]),
|
|
2957
|
+
C.value === "auto" ? a("", !0) : (v(), o("label", hr, [
|
|
2958
|
+
s("span", gr, T(D(d)("tableAdvanced.height")), 1),
|
|
2959
|
+
M(s("input", {
|
|
2960
|
+
type: "number",
|
|
2961
|
+
min: "0",
|
|
2962
|
+
step: "20",
|
|
2963
|
+
"onUpdate:modelValue": r[25] ||= (e) => y.value = e,
|
|
2964
|
+
class: "docx-tmore__input"
|
|
2965
|
+
}, null, 512), [[
|
|
2966
|
+
k,
|
|
2967
|
+
y.value,
|
|
2968
|
+
void 0,
|
|
2969
|
+
{ number: !0 }
|
|
2970
|
+
]]),
|
|
2971
|
+
r[38] ||= s("span", { class: "docx-tmore__unit" }, "tw", -1)
|
|
2972
|
+
])),
|
|
2973
|
+
s("button", {
|
|
2974
|
+
type: "button",
|
|
2975
|
+
class: "docx-tmore__apply",
|
|
2976
|
+
onClick: P(I, ["prevent"])
|
|
2977
|
+
}, T(D(d)("common.apply")), 1)
|
|
2978
|
+
])) : a("", !0),
|
|
2979
|
+
s("button", {
|
|
2980
|
+
type: "button",
|
|
2981
|
+
class: "docx-tmore__item",
|
|
2982
|
+
onClick: r[26] ||= P((e) => g.value = !g.value, ["prevent"])
|
|
2983
|
+
}, [
|
|
2984
|
+
l(q, {
|
|
2985
|
+
name: "text_rotation_none",
|
|
2986
|
+
size: 18
|
|
2987
|
+
}),
|
|
2988
|
+
s("span", _r, T(D(d)("textDirection")), 1),
|
|
2989
|
+
l(q, {
|
|
2990
|
+
name: g.value ? "expand_less" : "expand_more",
|
|
2991
|
+
size: 18
|
|
2992
|
+
}, null, 8, ["name"])
|
|
2993
|
+
]),
|
|
2994
|
+
g.value ? (v(), o("div", vr, [
|
|
2995
|
+
s("button", {
|
|
2996
|
+
type: "button",
|
|
2997
|
+
class: "docx-tmore__sub-item",
|
|
2998
|
+
onClick: r[27] ||= P((e) => L(null), ["prevent"])
|
|
2999
|
+
}, T(D(d)("tableAdvanced.textDirections.horizontal")), 1),
|
|
3000
|
+
s("button", {
|
|
3001
|
+
type: "button",
|
|
3002
|
+
class: "docx-tmore__sub-item",
|
|
3003
|
+
onClick: r[28] ||= P((e) => L("tbRl"), ["prevent"])
|
|
3004
|
+
}, T(D(d)("tableAdvanced.textDirections.verticalRL")), 1),
|
|
3005
|
+
s("button", {
|
|
3006
|
+
type: "button",
|
|
3007
|
+
class: "docx-tmore__sub-item",
|
|
3008
|
+
onClick: r[29] ||= P((e) => L("btLr"), ["prevent"])
|
|
3009
|
+
}, T(D(d)("tableAdvanced.textDirections.verticalLR")), 1)
|
|
3010
|
+
])) : a("", !0),
|
|
3011
|
+
r[45] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
3012
|
+
s("button", {
|
|
3013
|
+
type: "button",
|
|
3014
|
+
class: "docx-tmore__item",
|
|
3015
|
+
onClick: r[30] ||= P((e) => E("toggleHeaderRow"), ["prevent"])
|
|
3016
|
+
}, [l(q, {
|
|
3017
|
+
name: "table_rows",
|
|
3018
|
+
size: 18
|
|
3019
|
+
}), s("span", null, T(D(d)("tableAdvanced.toggleHeaderRow")), 1)]),
|
|
3020
|
+
s("button", {
|
|
3021
|
+
type: "button",
|
|
3022
|
+
class: "docx-tmore__item",
|
|
3023
|
+
onClick: r[31] ||= P((e) => E("distributeColumns"), ["prevent"])
|
|
3024
|
+
}, [l(q, {
|
|
3025
|
+
name: "view_column",
|
|
3026
|
+
size: 18
|
|
3027
|
+
}), s("span", null, T(D(d)("tableAdvanced.distributeColumns")), 1)]),
|
|
3028
|
+
s("button", {
|
|
3029
|
+
type: "button",
|
|
3030
|
+
class: "docx-tmore__item",
|
|
3031
|
+
onClick: r[32] ||= P((e) => E("autoFit"), ["prevent"])
|
|
3032
|
+
}, [l(q, {
|
|
3033
|
+
name: "fit_width",
|
|
3034
|
+
size: 18
|
|
3035
|
+
}), s("span", null, T(D(d)("tableAdvanced.autoFit")), 1)]),
|
|
3036
|
+
s("button", {
|
|
3037
|
+
type: "button",
|
|
3038
|
+
class: "docx-tmore__item",
|
|
3039
|
+
onClick: r[33] ||= P((e) => E("toggleNoWrap"), ["prevent"])
|
|
3040
|
+
}, [l(q, {
|
|
3041
|
+
name: "wrap_text",
|
|
3042
|
+
size: 18
|
|
3043
|
+
}), s("span", null, T(D(d)("tableAdvanced.toggleNoWrap")), 1)]),
|
|
3044
|
+
r[46] ||= s("div", { class: "docx-tmore__separator" }, null, -1),
|
|
3045
|
+
s("button", {
|
|
3046
|
+
type: "button",
|
|
3047
|
+
class: "docx-tmore__item",
|
|
3048
|
+
onClick: r[34] ||= P((e) => E("tableProperties"), ["prevent"])
|
|
3049
|
+
}, [l(q, {
|
|
3050
|
+
name: "settings",
|
|
3051
|
+
size: 18
|
|
3052
|
+
}), s("span", null, T(D(d)("tableAdvanced.tableProperties")), 1)])
|
|
3053
|
+
], 8, Hn)]),
|
|
3054
|
+
_: 1
|
|
3055
|
+
}, 8, ["open"]));
|
|
3056
|
+
}
|
|
3057
|
+
}), [["__scopeId", "data-v-d2fe4ec6"]]), br = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3058
|
+
__name: "TableToolbar",
|
|
3059
|
+
props: {
|
|
3060
|
+
view: {},
|
|
3061
|
+
getCommands: { type: Function },
|
|
3062
|
+
stateTick: {},
|
|
3063
|
+
theme: {}
|
|
3064
|
+
},
|
|
3065
|
+
setup(e, { expose: t }) {
|
|
3066
|
+
let i = e, c = r(() => {
|
|
3067
|
+
i.stateTick;
|
|
3068
|
+
let e = i.view;
|
|
3069
|
+
return e ? U(e.state) : null;
|
|
3070
|
+
}), u = r(() => !!c.value?.isInTable), d = r(() => {
|
|
3071
|
+
i.stateTick;
|
|
3072
|
+
let e = i.view;
|
|
3073
|
+
if (!e) return !1;
|
|
3074
|
+
let { $from: t } = e.state.selection;
|
|
3075
|
+
for (let e = t.depth; e > 0; e--) if (t.node(e).type.name === "tableCell") {
|
|
3076
|
+
let n = t.node(e), r = n.attrs.colspan, i = n.attrs.rowspan;
|
|
3077
|
+
return (typeof r == "number" ? r : 1) > 1 || (typeof i == "number" ? i : 1) > 1;
|
|
3078
|
+
}
|
|
3079
|
+
return !1;
|
|
3080
|
+
}), p = r(() => {
|
|
3081
|
+
let e = c.value?.cellBorderColor;
|
|
3082
|
+
if (e && typeof e == "object" && "rgb" in e && typeof e.rgb == "string") return e.rgb;
|
|
3083
|
+
}), m = r(() => p.value === void 0 ? {} : { value: p.value }), h = r(() => !!c.value?.hasMultiCellSelection), g = r(() => c.value?.rowCount ?? 0), _ = r(() => c.value?.columnCount ?? 0), y = r(() => {
|
|
3084
|
+
let e = c.value?.table?.attrs.justification;
|
|
3085
|
+
return e === "center" || e === "right" ? e : "left";
|
|
3086
|
+
}), b = {
|
|
3087
|
+
style: "single",
|
|
3088
|
+
size: 4,
|
|
3089
|
+
color: { rgb: "000000" }
|
|
3090
|
+
};
|
|
3091
|
+
A([() => i.view, () => i.stateTick], () => {
|
|
3092
|
+
let e = i.view;
|
|
3093
|
+
if (!e) return;
|
|
3094
|
+
let t = U(e.state), n = t.cellBorderColor;
|
|
3095
|
+
!n || !t.isInTable || typeof n == "object" && "rgb" in n && typeof n.rgb == "string" && (b.color = { rgb: n.rgb });
|
|
3096
|
+
}, { immediate: !0 });
|
|
3097
|
+
function x(e, ...t) {
|
|
3098
|
+
let n = i.view;
|
|
3099
|
+
if (!n) return !1;
|
|
3100
|
+
let r = i.getCommands()[e];
|
|
3101
|
+
return r ? (r(...t)(n.state, (e) => n.dispatch(e), n), n.focus(), !0) : !1;
|
|
3102
|
+
}
|
|
3103
|
+
function S(e) {
|
|
3104
|
+
let t = {
|
|
3105
|
+
...b,
|
|
3106
|
+
color: { ...b.color }
|
|
3107
|
+
};
|
|
3108
|
+
switch (e) {
|
|
3109
|
+
case "all":
|
|
3110
|
+
x("setAllTableBorders", t);
|
|
3111
|
+
return;
|
|
3112
|
+
case "none":
|
|
3113
|
+
x("removeTableBorders");
|
|
3114
|
+
return;
|
|
3115
|
+
case "box":
|
|
3116
|
+
x("setOutsideTableBorders", t);
|
|
3117
|
+
return;
|
|
3118
|
+
case "inside":
|
|
3119
|
+
case "insideH":
|
|
3120
|
+
case "insideV":
|
|
3121
|
+
x("setInsideTableBorders", t);
|
|
3122
|
+
return;
|
|
3123
|
+
case "top":
|
|
3124
|
+
case "bottom":
|
|
3125
|
+
case "left":
|
|
3126
|
+
case "right":
|
|
3127
|
+
x("setCellBorder", e, t, !0);
|
|
3128
|
+
return;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
function C(e) {
|
|
3132
|
+
b.color = { rgb: e.replace(/^#/, "") }, x("setTableBorderColor", e);
|
|
3133
|
+
}
|
|
3134
|
+
function w(e) {
|
|
3135
|
+
b.size = e, x("setTableBorderWidth", e);
|
|
3136
|
+
}
|
|
3137
|
+
function T(e) {
|
|
3138
|
+
x("setCellFillColor", e);
|
|
3139
|
+
}
|
|
3140
|
+
let E = {
|
|
3141
|
+
autoFit: ["autoFitContents"],
|
|
3142
|
+
alignTableLeft: ["setTableProperties", { justification: "left" }],
|
|
3143
|
+
alignTableCenter: ["setTableProperties", { justification: "center" }],
|
|
3144
|
+
alignTableRight: ["setTableProperties", { justification: "right" }],
|
|
3145
|
+
verticalAlignTop: ["setCellVerticalAlign", "top"],
|
|
3146
|
+
verticalAlignMiddle: ["setCellVerticalAlign", "center"],
|
|
3147
|
+
verticalAlignBottom: ["setCellVerticalAlign", "bottom"]
|
|
3148
|
+
};
|
|
3149
|
+
function D(e) {
|
|
3150
|
+
if (e === "tableProperties") return;
|
|
3151
|
+
let t = E[e];
|
|
3152
|
+
t ? x(...t) : x(e);
|
|
3153
|
+
}
|
|
3154
|
+
function O(e) {
|
|
3155
|
+
x("setCellMargins", e);
|
|
3156
|
+
}
|
|
3157
|
+
function k(e) {
|
|
3158
|
+
x("setCellTextDirection", e);
|
|
3159
|
+
}
|
|
3160
|
+
function j(e) {
|
|
3161
|
+
x("setRowHeight", e.height, e.rule);
|
|
3162
|
+
}
|
|
3163
|
+
return t({
|
|
3164
|
+
isInTable: u,
|
|
3165
|
+
canSplit: d,
|
|
3166
|
+
canMerge: h,
|
|
3167
|
+
rowCount: g,
|
|
3168
|
+
columnCount: _,
|
|
3169
|
+
currentJustification: y,
|
|
3170
|
+
onBorderPreset: S,
|
|
3171
|
+
onBorderColor: C,
|
|
3172
|
+
onBorderWidth: w,
|
|
3173
|
+
onCellFill: T,
|
|
3174
|
+
onMoreAction: D,
|
|
3175
|
+
onCellMargins: O,
|
|
3176
|
+
onCellTextDirection: k,
|
|
3177
|
+
onRowHeight: j
|
|
3178
|
+
}), (t, r) => u.value ? (v(), o(n, { key: 0 }, [
|
|
3179
|
+
r[0] ||= s("span", { class: "divider" }, null, -1),
|
|
3180
|
+
l(Nn, { onChange: S }),
|
|
3181
|
+
l(Pn, f({ theme: e.theme ?? null }, m.value, { onChange: C }), null, 16, ["theme"]),
|
|
3182
|
+
l(zn, { onChange: w }),
|
|
3183
|
+
l(Bn, {
|
|
3184
|
+
theme: e.theme ?? null,
|
|
3185
|
+
onChange: T
|
|
3186
|
+
}, null, 8, ["theme"]),
|
|
3187
|
+
l(yr, {
|
|
3188
|
+
"can-split": d.value,
|
|
3189
|
+
"can-merge": h.value,
|
|
3190
|
+
"row-count": g.value,
|
|
3191
|
+
"column-count": _.value,
|
|
3192
|
+
"current-justification": y.value,
|
|
3193
|
+
onAction: D,
|
|
3194
|
+
onCellMargins: O,
|
|
3195
|
+
onCellTextDirection: k,
|
|
3196
|
+
onRowHeight: j
|
|
3197
|
+
}, null, 8, [
|
|
3198
|
+
"can-split",
|
|
3199
|
+
"can-merge",
|
|
3200
|
+
"row-count",
|
|
3201
|
+
"column-count",
|
|
3202
|
+
"current-justification"
|
|
3203
|
+
])
|
|
3204
|
+
], 64)) : a("", !0);
|
|
3205
|
+
}
|
|
3206
|
+
}), [["__scopeId", "data-v-af7b47da"]]), xr = { class: "docx-vertical-ruler__ticks" }, Sr = 15840, Cr = 1440, wr = 1440, Tr = 567, Er = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3207
|
+
__name: "VerticalRuler",
|
|
3208
|
+
props: {
|
|
3209
|
+
sectionProps: {},
|
|
3210
|
+
zoom: { default: 1 },
|
|
3211
|
+
editable: {
|
|
3212
|
+
type: Boolean,
|
|
3213
|
+
default: !0
|
|
3214
|
+
},
|
|
3215
|
+
unit: { default: "inch" }
|
|
3216
|
+
},
|
|
3217
|
+
emits: ["top-margin-change", "bottom-margin-change"],
|
|
3218
|
+
setup(e, { emit: t }) {
|
|
3219
|
+
let i = e, c = t, l = x(null), u = x(null);
|
|
3220
|
+
function d(e) {
|
|
3221
|
+
return L(e) * i.zoom;
|
|
3222
|
+
}
|
|
3223
|
+
function f(e) {
|
|
3224
|
+
return Math.round(I(e / i.zoom));
|
|
3225
|
+
}
|
|
3226
|
+
let p = r(() => i.sectionProps?.pageHeight ?? Sr), m = r(() => i.sectionProps?.marginTop ?? Cr), _ = r(() => i.sectionProps?.marginBottom ?? Cr), y = r(() => d(p.value)), b = r(() => d(m.value)), C = r(() => d(_.value)), w = r(() => ({
|
|
3227
|
+
position: "relative",
|
|
3228
|
+
width: "20px",
|
|
3229
|
+
height: y.value + "px",
|
|
3230
|
+
backgroundColor: "transparent",
|
|
3231
|
+
overflow: "visible",
|
|
3232
|
+
userSelect: "none",
|
|
3233
|
+
cursor: l.value ? "ns-resize" : "default"
|
|
3234
|
+
})), E = r(() => {
|
|
3235
|
+
let e = [];
|
|
3236
|
+
if (i.unit === "inch") {
|
|
3237
|
+
let t = wr / 8, n = Math.ceil(p.value / t);
|
|
3238
|
+
for (let r = 0; r <= n; r++) {
|
|
3239
|
+
let n = r * t;
|
|
3240
|
+
if (n > p.value) break;
|
|
3241
|
+
let i = d(n);
|
|
3242
|
+
r % 8 == 0 ? e.push({
|
|
3243
|
+
position: i,
|
|
3244
|
+
width: 10,
|
|
3245
|
+
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
3246
|
+
}) : r % 4 == 0 ? e.push({
|
|
3247
|
+
position: i,
|
|
3248
|
+
width: 6
|
|
3249
|
+
}) : r % 2 == 0 ? e.push({
|
|
3250
|
+
position: i,
|
|
3251
|
+
width: 4
|
|
3252
|
+
}) : e.push({
|
|
3253
|
+
position: i,
|
|
3254
|
+
width: 2
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
} else {
|
|
3258
|
+
let t = Tr / 10, n = Math.ceil(p.value / t);
|
|
3259
|
+
for (let r = 0; r <= n; r++) {
|
|
3260
|
+
let n = r * t;
|
|
3261
|
+
if (n > p.value) break;
|
|
3262
|
+
let i = d(n);
|
|
3263
|
+
r % 10 == 0 ? e.push({
|
|
3264
|
+
position: i,
|
|
3265
|
+
width: 10,
|
|
3266
|
+
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
3267
|
+
}) : r % 5 == 0 ? e.push({
|
|
3268
|
+
position: i,
|
|
3269
|
+
width: 6
|
|
3270
|
+
}) : e.push({
|
|
3271
|
+
position: i,
|
|
3272
|
+
width: 3
|
|
3273
|
+
});
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
return e;
|
|
3277
|
+
});
|
|
3278
|
+
function D(e) {
|
|
3279
|
+
return {
|
|
3280
|
+
position: "absolute",
|
|
3281
|
+
top: e - 5 + "px",
|
|
3282
|
+
right: 0,
|
|
3283
|
+
width: "20px",
|
|
3284
|
+
height: "10px",
|
|
3285
|
+
cursor: i.editable ? "ns-resize" : "default",
|
|
3286
|
+
zIndex: l.value === null ? 1 : 10
|
|
3287
|
+
};
|
|
3288
|
+
}
|
|
3289
|
+
function O(e) {
|
|
3290
|
+
let t = l.value === e, n = u.value === e, r = "var(--doc-primary)";
|
|
3291
|
+
return t ? r = "var(--doc-primary-hover)" : n && (r = "var(--doc-primary)"), {
|
|
3292
|
+
position: "absolute",
|
|
3293
|
+
top: "0px",
|
|
3294
|
+
right: "2px",
|
|
3295
|
+
width: "0",
|
|
3296
|
+
height: "0",
|
|
3297
|
+
borderTop: "5px solid transparent",
|
|
3298
|
+
borderBottom: "5px solid transparent",
|
|
3299
|
+
borderRight: `8px solid ${r}`,
|
|
3300
|
+
transition: "border-right-color 0.1s"
|
|
3301
|
+
};
|
|
3302
|
+
}
|
|
3303
|
+
let k = 0, A = 0;
|
|
3304
|
+
function j(e, t) {
|
|
3305
|
+
i.editable && (l.value = e, k = t.clientY, A = e === "topMargin" ? m.value : _.value, document.addEventListener("mousemove", M), document.addEventListener("mouseup", N));
|
|
3306
|
+
}
|
|
3307
|
+
function M(e) {
|
|
3308
|
+
if (!l.value) return;
|
|
3309
|
+
let t = e.clientY - k, n = f(l.value === "topMargin" ? t : -t), r = p.value - (l.value === "topMargin" ? _.value : m.value) - 720, i = Math.round(Math.max(0, Math.min(A + n, r)));
|
|
3310
|
+
l.value === "topMargin" ? c("top-margin-change", i) : c("bottom-margin-change", i);
|
|
3311
|
+
}
|
|
3312
|
+
function N() {
|
|
3313
|
+
l.value = null, document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", N);
|
|
3314
|
+
}
|
|
3315
|
+
return g(() => {
|
|
3316
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", N);
|
|
3317
|
+
}), (t, r) => (v(), o("div", {
|
|
3318
|
+
class: "docx-vertical-ruler",
|
|
3319
|
+
style: h(w.value),
|
|
3320
|
+
role: "slider",
|
|
3321
|
+
"aria-label": "Vertical ruler",
|
|
3322
|
+
"aria-orientation": "vertical"
|
|
3323
|
+
}, [
|
|
3324
|
+
s("div", xr, [(v(!0), o(n, null, S(E.value, (e, t) => (v(), o(n, { key: t }, [s("div", {
|
|
3325
|
+
class: "docx-vertical-ruler__tick-line",
|
|
3326
|
+
style: h({
|
|
3327
|
+
top: e.position + "px",
|
|
3328
|
+
width: e.width + "px"
|
|
3329
|
+
})
|
|
3330
|
+
}, null, 4), e.label ? (v(), o("div", {
|
|
3331
|
+
key: 0,
|
|
3332
|
+
class: "docx-vertical-ruler__tick-label",
|
|
3333
|
+
style: h({ top: e.position + "px" })
|
|
3334
|
+
}, T(e.label), 5)) : a("", !0)], 64))), 128))]),
|
|
3335
|
+
e.editable ? (v(), o("div", {
|
|
3336
|
+
key: 0,
|
|
3337
|
+
class: "docx-vertical-ruler__marker",
|
|
3338
|
+
style: h(D(b.value)),
|
|
3339
|
+
onMousedown: r[0] ||= P((e) => j("topMargin", e), ["prevent"]),
|
|
3340
|
+
onMouseenter: r[1] ||= (e) => u.value = "topMargin",
|
|
3341
|
+
onMouseleave: r[2] ||= (e) => u.value = null
|
|
3342
|
+
}, [s("div", { style: h(O("topMargin")) }, null, 4)], 36)) : a("", !0),
|
|
3343
|
+
e.editable ? (v(), o("div", {
|
|
3344
|
+
key: 1,
|
|
3345
|
+
class: "docx-vertical-ruler__marker",
|
|
3346
|
+
style: h(D(y.value - C.value)),
|
|
3347
|
+
onMousedown: r[3] ||= P((e) => j("bottomMargin", e), ["prevent"]),
|
|
3348
|
+
onMouseenter: r[4] ||= (e) => u.value = "bottomMargin",
|
|
3349
|
+
onMouseleave: r[5] ||= (e) => u.value = null
|
|
3350
|
+
}, [s("div", { style: h(O("bottomMargin")) }, null, 4)], 36)) : a("", !0)
|
|
3351
|
+
], 4));
|
|
3352
|
+
}
|
|
3353
|
+
}), [["__scopeId", "data-v-fc2715dd"]]);
|
|
3354
|
+
//#endregion
|
|
3355
|
+
//#region src/utils/comments.ts
|
|
3356
|
+
function Dr(e) {
|
|
3357
|
+
return e?.length ? e.flatMap((e) => e.content.filter((e) => e.type === "run").flatMap((e) => "content" in e ? e.content : []).filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "")).join("") : "";
|
|
3358
|
+
}
|
|
3359
|
+
function Or(e) {
|
|
3360
|
+
return e ? new Date(e).toLocaleString(void 0, {
|
|
3361
|
+
hour: "numeric",
|
|
3362
|
+
minute: "2-digit",
|
|
3363
|
+
month: "short",
|
|
3364
|
+
day: "numeric"
|
|
3365
|
+
}) : "";
|
|
3366
|
+
}
|
|
3367
|
+
function kr(e) {
|
|
3368
|
+
return e.split(/\s+/).map((e) => e[0]).join("").toUpperCase().slice(0, 2);
|
|
3369
|
+
}
|
|
3370
|
+
var Ar = [
|
|
3371
|
+
"#6DCCB1",
|
|
3372
|
+
"#79AAD9",
|
|
3373
|
+
"#EE789D",
|
|
3374
|
+
"#A987D1",
|
|
3375
|
+
"#E6A85F",
|
|
3376
|
+
"#F2CC8F",
|
|
3377
|
+
"#68B3A2",
|
|
3378
|
+
"#B07AA1",
|
|
3379
|
+
"#59A14F",
|
|
3380
|
+
"#FF9DA7",
|
|
3381
|
+
"#E15759",
|
|
3382
|
+
"#76B7B2"
|
|
3383
|
+
];
|
|
3384
|
+
function jr(e) {
|
|
3385
|
+
let t = 0;
|
|
3386
|
+
for (let n = 0; n < e.length; n++) t = e.charCodeAt(n) + ((t << 5) - t);
|
|
3387
|
+
return Ar[Math.abs(t) % Ar.length] ?? "#888888";
|
|
3388
|
+
}
|
|
3389
|
+
function Mr(e, t = 50) {
|
|
3390
|
+
return e.length > t ? e.slice(0, t) + "..." : e;
|
|
3391
|
+
}
|
|
3392
|
+
//#endregion
|
|
3393
|
+
//#region src/components/sidebar/Avatar.vue
|
|
3394
|
+
var Nr = /* @__PURE__ */ u({
|
|
3395
|
+
__name: "Avatar",
|
|
3396
|
+
props: {
|
|
3397
|
+
name: { default: "U" },
|
|
3398
|
+
size: { default: 32 }
|
|
3399
|
+
},
|
|
3400
|
+
setup(e) {
|
|
3401
|
+
let t = e, n = r(() => kr(t.name || "U")), i = r(() => ({
|
|
3402
|
+
width: t.size + "px",
|
|
3403
|
+
height: t.size + "px",
|
|
3404
|
+
borderRadius: "50%",
|
|
3405
|
+
backgroundColor: jr(t.name || "U"),
|
|
3406
|
+
color: "#fff",
|
|
3407
|
+
display: "flex",
|
|
3408
|
+
alignItems: "center",
|
|
3409
|
+
justifyContent: "center",
|
|
3410
|
+
fontSize: t.size === 32 ? "13px" : "11px",
|
|
3411
|
+
fontWeight: 500,
|
|
3412
|
+
flexShrink: 0
|
|
3413
|
+
}));
|
|
3414
|
+
return (e, t) => (v(), o("div", {
|
|
3415
|
+
class: "docx-avatar",
|
|
3416
|
+
style: h(i.value)
|
|
3417
|
+
}, T(n.value), 5));
|
|
3418
|
+
}
|
|
3419
|
+
}), Pr = {
|
|
3420
|
+
key: 0,
|
|
3421
|
+
class: "reply-thread"
|
|
3422
|
+
}, Fr = {
|
|
3423
|
+
key: 0,
|
|
3424
|
+
class: "reply-thread__more"
|
|
3425
|
+
}, Ir = { class: "reply-thread__header" }, Lr = { class: "reply-thread__author-block" }, Rr = { class: "reply-thread__author" }, zr = { class: "reply-thread__date" }, Br = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3426
|
+
__name: "ReplyThread",
|
|
3427
|
+
props: {
|
|
3428
|
+
replies: {},
|
|
3429
|
+
isExpanded: { type: Boolean }
|
|
3430
|
+
},
|
|
3431
|
+
setup(e) {
|
|
3432
|
+
let t = e, i = r(() => t.isExpanded ? t.replies : t.replies.slice(-1)), c = r(() => t.isExpanded ? 0 : Math.max(0, t.replies.length - 1));
|
|
3433
|
+
return (t, r) => e.replies.length > 0 ? (v(), o("div", Pr, [c.value > 0 ? (v(), o("div", Fr, T(c.value) + " " + T(c.value === 1 ? "reply" : "replies"), 1)) : a("", !0), (v(!0), o(n, null, S(i.value, (t) => (v(), o("div", {
|
|
3434
|
+
key: t.id,
|
|
3435
|
+
class: m(["reply-thread__item", { "reply-thread__item--expanded": e.isExpanded }])
|
|
3436
|
+
}, [s("div", Ir, [l(Nr, {
|
|
3437
|
+
name: t.author,
|
|
3438
|
+
size: 28
|
|
3439
|
+
}, null, 8, ["name"]), s("div", Lr, [s("div", Rr, T(t.author || "Unknown"), 1), s("div", zr, T(D(Or)(t.date)), 1)])]), s("div", { class: m(["reply-thread__body", { "reply-thread__body--clamp": !e.isExpanded }]) }, T(D(Dr)(t.content)), 3)], 2))), 128))])) : a("", !0);
|
|
3440
|
+
}
|
|
3441
|
+
}), [["__scopeId", "data-v-05622ce1"]]), Vr = ["onKeydown"], Hr = { class: "reply-input__actions" }, Ur = ["disabled"], Wr = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3442
|
+
__name: "ReplyInput",
|
|
3443
|
+
emits: ["submit"],
|
|
3444
|
+
setup(e, { emit: t }) {
|
|
3445
|
+
let i = t, a = x(!1), c = x(""), l = x(null), u = r(() => c.value.trim());
|
|
3446
|
+
function d() {
|
|
3447
|
+
a.value = !0, p(() => l.value?.focus({ preventScroll: !0 }));
|
|
3448
|
+
}
|
|
3449
|
+
function f() {
|
|
3450
|
+
a.value = !1, c.value = "";
|
|
3451
|
+
}
|
|
3452
|
+
function h() {
|
|
3453
|
+
let e = u.value;
|
|
3454
|
+
e && i("submit", e), c.value = "", a.value = !1;
|
|
3455
|
+
}
|
|
3456
|
+
return (e, t) => (v(), o("div", {
|
|
3457
|
+
onClick: t[4] ||= P(() => {}, ["stop"]),
|
|
3458
|
+
onMousedown: t[5] ||= P(() => {}, ["stop"]),
|
|
3459
|
+
class: "reply-input"
|
|
3460
|
+
}, [a.value ? (v(), o(n, { key: 1 }, [M(s("input", {
|
|
3461
|
+
ref_key: "inputRef",
|
|
3462
|
+
ref: l,
|
|
3463
|
+
"onUpdate:modelValue": t[1] ||= (e) => c.value = e,
|
|
3464
|
+
type: "text",
|
|
3465
|
+
placeholder: "Reply",
|
|
3466
|
+
class: "reply-input__field reply-input__field--active",
|
|
3467
|
+
onMousedown: t[2] ||= P(() => {}, ["stop"]),
|
|
3468
|
+
onKeydown: [
|
|
3469
|
+
t[3] ||= P(() => {}, ["stop"]),
|
|
3470
|
+
N(P(h, ["prevent"]), ["enter"]),
|
|
3471
|
+
N(f, ["esc"])
|
|
3472
|
+
]
|
|
3473
|
+
}, null, 40, Vr), [[k, c.value]]), s("div", Hr, [s("button", {
|
|
3474
|
+
class: "reply-input__cancel",
|
|
3475
|
+
onClick: P(f, ["stop"])
|
|
3476
|
+
}, "Cancel"), s("button", {
|
|
3477
|
+
class: m(["reply-input__submit", { "reply-input__submit--active": u.value }]),
|
|
3478
|
+
disabled: !u.value,
|
|
3479
|
+
onClick: P(h, ["stop"])
|
|
3480
|
+
}, "Reply", 10, Ur)])], 64)) : (v(), o("input", {
|
|
3481
|
+
key: 0,
|
|
3482
|
+
readonly: "",
|
|
3483
|
+
placeholder: "Reply",
|
|
3484
|
+
class: "reply-input__field reply-input__field--inactive",
|
|
3485
|
+
onMousedown: t[0] ||= P(() => {}, ["stop"]),
|
|
3486
|
+
onClick: P(d, ["stop"])
|
|
3487
|
+
}, null, 32))], 32));
|
|
3488
|
+
}
|
|
3489
|
+
}), [["__scopeId", "data-v-2e135c9d"]]), Gr = ["data-comment-id"], Kr = {
|
|
3490
|
+
key: 0,
|
|
3491
|
+
class: "comment-card__resolved"
|
|
3492
|
+
}, qr = { class: "comment-card__head" }, Jr = { class: "comment-card__author-block" }, Yr = { class: "comment-card__author" }, Xr = { class: "comment-card__date" }, Zr = {
|
|
3493
|
+
key: 0,
|
|
3494
|
+
class: "comment-card__actions"
|
|
3495
|
+
}, Qr = ["title"], $r = { class: "comment-card__body" }, ei = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3496
|
+
__name: "CommentCard",
|
|
3497
|
+
props: {
|
|
3498
|
+
comment: {},
|
|
3499
|
+
replies: {},
|
|
3500
|
+
expanded: { type: Boolean }
|
|
3501
|
+
},
|
|
3502
|
+
emits: [
|
|
3503
|
+
"click",
|
|
3504
|
+
"reply",
|
|
3505
|
+
"resolve",
|
|
3506
|
+
"unresolve",
|
|
3507
|
+
"delete"
|
|
3508
|
+
],
|
|
3509
|
+
setup(e, { emit: t }) {
|
|
3510
|
+
let n = e, r = t, c = x(!1);
|
|
3511
|
+
function u() {
|
|
3512
|
+
c.value = !1, r("delete", n.comment.id);
|
|
3513
|
+
}
|
|
3514
|
+
return (t, n) => (v(), o("div", {
|
|
3515
|
+
class: m(["comment-card", { "comment-card--expanded": e.expanded }]),
|
|
3516
|
+
"data-comment-id": e.comment.id,
|
|
3517
|
+
onClick: n[5] ||= (e) => t.$emit("click"),
|
|
3518
|
+
onMousedown: n[6] ||= P(() => {}, ["stop"])
|
|
3519
|
+
}, [
|
|
3520
|
+
e.comment.done ? (v(), o("div", Kr, [l(q, {
|
|
3521
|
+
name: "check",
|
|
3522
|
+
size: 12
|
|
3523
|
+
}), n[7] ||= s("span", null, "Resolved", -1)])) : a("", !0),
|
|
3524
|
+
s("div", qr, [
|
|
3525
|
+
l(Nr, {
|
|
3526
|
+
name: e.comment.author,
|
|
3527
|
+
size: 32
|
|
3528
|
+
}, null, 8, ["name"]),
|
|
3529
|
+
s("div", Jr, [s("div", Yr, T(e.comment.author || "Unknown"), 1), s("div", Xr, T(D(Or)(e.comment.date)), 1)]),
|
|
3530
|
+
e.expanded ? (v(), o("div", Zr, [
|
|
3531
|
+
s("button", {
|
|
3532
|
+
class: "comment-card__icon-btn",
|
|
3533
|
+
title: e.comment.done ? "Reopen" : "Resolve",
|
|
3534
|
+
onClick: n[0] ||= P((n) => e.comment.done ? t.$emit("unresolve", e.comment.id) : t.$emit("resolve", e.comment.id), ["stop"])
|
|
3535
|
+
}, [l(q, {
|
|
3536
|
+
name: e.comment.done ? "undo" : "check",
|
|
3537
|
+
size: 20
|
|
3538
|
+
}, null, 8, ["name"])], 8, Qr),
|
|
3539
|
+
s("button", {
|
|
3540
|
+
class: "comment-card__icon-btn",
|
|
3541
|
+
title: "More options",
|
|
3542
|
+
onClick: n[1] ||= P((e) => c.value = !c.value, ["stop"])
|
|
3543
|
+
}, [l(q, {
|
|
3544
|
+
name: "more_vert",
|
|
3545
|
+
size: 20
|
|
3546
|
+
})]),
|
|
3547
|
+
c.value ? (v(), o("div", {
|
|
3548
|
+
key: 0,
|
|
3549
|
+
class: "comment-card__menu",
|
|
3550
|
+
onClick: n[2] ||= P(() => {}, ["stop"]),
|
|
3551
|
+
onMousedown: n[3] ||= P(() => {}, ["stop"])
|
|
3552
|
+
}, [s("button", {
|
|
3553
|
+
class: "comment-card__menu-item",
|
|
3554
|
+
onClick: u
|
|
3555
|
+
}, "Delete")], 32)) : a("", !0)
|
|
3556
|
+
])) : a("", !0)
|
|
3557
|
+
]),
|
|
3558
|
+
s("div", $r, T(D(Dr)(e.comment.content)), 1),
|
|
3559
|
+
l(Br, {
|
|
3560
|
+
replies: e.replies,
|
|
3561
|
+
"is-expanded": e.expanded
|
|
3562
|
+
}, null, 8, ["replies", "is-expanded"]),
|
|
3563
|
+
e.expanded && !e.comment.done ? (v(), i(Wr, {
|
|
3564
|
+
key: 1,
|
|
3565
|
+
onSubmit: n[4] ||= (n) => t.$emit("reply", e.comment.id, n)
|
|
3566
|
+
})) : a("", !0)
|
|
3567
|
+
], 42, Gr));
|
|
3568
|
+
}
|
|
3569
|
+
}), [["__scopeId", "data-v-e4e6cbdb"]]), ti = ["data-comment-id"], ni = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3570
|
+
__name: "ResolvedCommentMarker",
|
|
3571
|
+
props: { comment: {} },
|
|
3572
|
+
emits: ["toggle-expand"],
|
|
3573
|
+
setup(e) {
|
|
3574
|
+
return (t, n) => (v(), o("div", {
|
|
3575
|
+
class: "resolved-comment-marker",
|
|
3576
|
+
"data-comment-id": e.comment.id,
|
|
3577
|
+
"data-comment-resolved": "true",
|
|
3578
|
+
onClick: n[0] ||= (e) => t.$emit("toggle-expand"),
|
|
3579
|
+
onMousedown: n[1] ||= P(() => {}, ["stop"])
|
|
3580
|
+
}, [l(q, {
|
|
3581
|
+
name: "chat_bubble_check",
|
|
3582
|
+
size: 20
|
|
3583
|
+
})], 40, ti));
|
|
3584
|
+
}
|
|
3585
|
+
}), [["__scopeId", "data-v-a50692db"]]), ri = { class: "tc-card__head" }, ii = { class: "tc-card__author-block" }, ai = { class: "tc-card__author" }, oi = {
|
|
3586
|
+
key: 0,
|
|
3587
|
+
class: "tc-card__date"
|
|
3588
|
+
}, si = {
|
|
3589
|
+
key: 0,
|
|
3590
|
+
class: "tc-card__actions"
|
|
3591
|
+
}, ci = ["title"], li = ["title"], ui = { class: "tc-card__body" }, di = { class: "tc-card__deleted" }, fi = { class: "tc-card__inserted" }, pi = { class: "tc-card__inserted" }, mi = { class: "tc-card__deleted" }, hi = { class: "tc-card__changed" }, gi = {
|
|
3592
|
+
key: 4,
|
|
3593
|
+
class: "tc-card__inserted"
|
|
3594
|
+
}, _i = {
|
|
3595
|
+
key: 5,
|
|
3596
|
+
class: "tc-card__deleted"
|
|
3597
|
+
}, vi = {
|
|
3598
|
+
key: 6,
|
|
3599
|
+
class: "tc-card__inserted"
|
|
3600
|
+
}, yi = {
|
|
3601
|
+
key: 7,
|
|
3602
|
+
class: "tc-card__deleted"
|
|
3603
|
+
}, bi = {
|
|
3604
|
+
key: 8,
|
|
3605
|
+
class: "tc-card__changed"
|
|
3606
|
+
}, xi = {
|
|
3607
|
+
key: 9,
|
|
3608
|
+
class: "tc-card__changed"
|
|
3609
|
+
}, Si = {
|
|
3610
|
+
key: 10,
|
|
3611
|
+
class: "tc-card__changed"
|
|
3612
|
+
}, Ci = {
|
|
3613
|
+
key: 11,
|
|
3614
|
+
class: "tc-card__changed"
|
|
3615
|
+
}, wi = {
|
|
3616
|
+
key: 12,
|
|
3617
|
+
class: "tc-card__inserted"
|
|
3618
|
+
}, Ti = {
|
|
3619
|
+
key: 13,
|
|
3620
|
+
class: "tc-card__deleted"
|
|
3621
|
+
}, Ei = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3622
|
+
__name: "TrackedChangeCard",
|
|
3623
|
+
props: {
|
|
3624
|
+
change: {},
|
|
3625
|
+
expanded: { type: Boolean },
|
|
3626
|
+
replies: {}
|
|
3627
|
+
},
|
|
3628
|
+
emits: [
|
|
3629
|
+
"click",
|
|
3630
|
+
"accept-by-id",
|
|
3631
|
+
"reject-by-id",
|
|
3632
|
+
"reply"
|
|
3633
|
+
],
|
|
3634
|
+
setup(t, { emit: u }) {
|
|
3635
|
+
let { t: d } = e(), f = t, p = u, h = r(() => f.change.author || d("trackedChanges.unknown"));
|
|
3636
|
+
function g() {
|
|
3637
|
+
let e = new Set([f.change.revisionId]);
|
|
3638
|
+
f.change.type === "replacement" && f.change.insertionRevisionId != null && e.add(f.change.insertionRevisionId);
|
|
3639
|
+
for (let t of f.change.coalescedRevisionIds ?? []) e.add(t);
|
|
3640
|
+
return [...e];
|
|
3641
|
+
}
|
|
3642
|
+
function _() {
|
|
3643
|
+
for (let e of g()) p("accept-by-id", e);
|
|
3644
|
+
}
|
|
3645
|
+
function y() {
|
|
3646
|
+
for (let e of g()) p("reject-by-id", e);
|
|
3647
|
+
}
|
|
3648
|
+
return (e, r) => (v(), o("div", {
|
|
3649
|
+
class: m(["tc-card", { "tc-card--expanded": t.expanded }]),
|
|
3650
|
+
onClick: r[1] ||= (t) => e.$emit("click"),
|
|
3651
|
+
onMousedown: r[2] ||= P(() => {}, ["stop"])
|
|
3652
|
+
}, [
|
|
3653
|
+
s("div", ri, [
|
|
3654
|
+
l(Nr, {
|
|
3655
|
+
name: h.value,
|
|
3656
|
+
size: 32
|
|
3657
|
+
}, null, 8, ["name"]),
|
|
3658
|
+
s("div", ii, [s("div", ai, T(h.value), 1), t.change.date ? (v(), o("div", oi, T(D(Or)(t.change.date)), 1)) : a("", !0)]),
|
|
3659
|
+
t.expanded ? (v(), o("div", si, [s("button", {
|
|
3660
|
+
class: "tc-card__icon-btn",
|
|
3661
|
+
title: D(d)("acceptChange"),
|
|
3662
|
+
onClick: P(_, ["stop"])
|
|
3663
|
+
}, [l(q, {
|
|
3664
|
+
name: "check",
|
|
3665
|
+
size: 20
|
|
3666
|
+
})], 8, ci), s("button", {
|
|
3667
|
+
class: "tc-card__icon-btn",
|
|
3668
|
+
title: D(d)("rejectChange"),
|
|
3669
|
+
onClick: P(y, ["stop"])
|
|
3670
|
+
}, [l(q, {
|
|
3671
|
+
name: "close",
|
|
3672
|
+
size: 20
|
|
3673
|
+
})], 8, li)])) : a("", !0)
|
|
3674
|
+
]),
|
|
3675
|
+
s("div", ui, [t.change.type === "replacement" ? (v(), o(n, { key: 0 }, [
|
|
3676
|
+
c(T(D(d)("trackedChanges.replaced")) + " ", 1),
|
|
3677
|
+
s("span", di, "\"" + T(D(Mr)(t.change.deletedText || "")) + "\"", 1),
|
|
3678
|
+
c(" " + T(D(d)("trackedChanges.with")) + " ", 1),
|
|
3679
|
+
s("span", fi, "\"" + T(D(Mr)(t.change.text)) + "\"", 1)
|
|
3680
|
+
], 64)) : t.change.type === "paragraphMarkInsertion" ? (v(), o(n, { key: 1 }, [c(T(D(d)("revisions.paragraphMarkInserted")), 1), t.change.text ? (v(), o(n, { key: 0 }, [r[3] ||= c(": ", -1), s("span", pi, "\"" + T(D(Mr)(t.change.text)) + "\"", 1)], 64)) : a("", !0)], 64)) : t.change.type === "paragraphMarkDeletion" ? (v(), o(n, { key: 2 }, [c(T(D(d)("revisions.paragraphMarkDeleted")), 1), t.change.text ? (v(), o(n, { key: 0 }, [r[4] ||= c(": ", -1), s("span", mi, "\"" + T(D(Mr)(t.change.text)) + "\"", 1)], 64)) : a("", !0)], 64)) : t.change.type === "paragraphPropertiesChanged" ? (v(), o(n, { key: 3 }, [c(T(D(d)("revisions.paragraphPropertiesChanged")), 1), t.change.text ? (v(), o(n, { key: 0 }, [r[5] ||= c(": ", -1), s("span", hi, "\"" + T(D(Mr)(t.change.text)) + "\"", 1)], 64)) : a("", !0)], 64)) : t.change.type === "rowInserted" ? (v(), o("span", gi, T(D(d)("revisions.rowInserted")), 1)) : t.change.type === "rowDeleted" ? (v(), o("span", _i, T(D(d)("revisions.rowDeleted")), 1)) : t.change.type === "cellInserted" ? (v(), o("span", vi, T(D(d)("revisions.cellInserted")), 1)) : t.change.type === "cellDeleted" ? (v(), o("span", yi, T(D(d)("revisions.cellDeleted")), 1)) : t.change.type === "cellMerged" ? (v(), o("span", bi, T(D(d)("revisions.cellMerged")), 1)) : t.change.type === "rowPropertiesChanged" ? (v(), o("span", xi, T(D(d)("revisions.rowPropertiesChanged")), 1)) : t.change.type === "cellPropertiesChanged" ? (v(), o("span", Si, T(D(d)("revisions.cellPropertiesChanged")), 1)) : t.change.type === "tablePropertiesChanged" ? (v(), o("span", Ci, T(D(d)("revisions.tablePropertiesChanged")), 1)) : t.change.type === "tableInserted" ? (v(), o("span", wi, T(D(d)("revisions.tableInserted")), 1)) : t.change.type === "tableDeleted" ? (v(), o("span", Ti, T(D(d)("revisions.tableDeleted")), 1)) : (v(), o(n, { key: 14 }, [c(T(t.change.type === "insertion" ? D(d)("inserted") : D(d)("deleted")) + " ", 1), s("span", { class: m(t.change.type === "insertion" ? "tc-card__inserted" : "tc-card__deleted") }, " \"" + T(D(Mr)(t.change.text)) + "\" ", 3)], 64))]),
|
|
3681
|
+
l(Br, {
|
|
3682
|
+
replies: t.replies,
|
|
3683
|
+
"is-expanded": t.expanded
|
|
3684
|
+
}, null, 8, ["replies", "is-expanded"]),
|
|
3685
|
+
t.expanded ? (v(), i(Wr, {
|
|
3686
|
+
key: 0,
|
|
3687
|
+
onSubmit: r[0] ||= (n) => e.$emit("reply", t.change.revisionId, n)
|
|
3688
|
+
})) : a("", !0)
|
|
3689
|
+
], 34));
|
|
3690
|
+
}
|
|
3691
|
+
}), [["__scopeId", "data-v-885ea7b9"]]), Di = ["onKeydown"], Oi = { class: "add-comment-card__actions" }, ki = ["disabled"], Ai = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3692
|
+
__name: "AddCommentCard",
|
|
3693
|
+
emits: ["submit", "cancel"],
|
|
3694
|
+
setup(e, { emit: t }) {
|
|
3695
|
+
let n = t, i = x(""), a = x(null), c = r(() => i.value.trim());
|
|
3696
|
+
_(() => {
|
|
3697
|
+
a.value?.focus({ preventScroll: !0 });
|
|
3698
|
+
});
|
|
3699
|
+
function l() {
|
|
3700
|
+
c.value && (n("submit", c.value), i.value = "");
|
|
3701
|
+
}
|
|
3702
|
+
function u() {
|
|
3703
|
+
n("cancel"), i.value = "";
|
|
3704
|
+
}
|
|
3705
|
+
return (e, t) => (v(), o("div", {
|
|
3706
|
+
class: "add-comment-card",
|
|
3707
|
+
onMousedown: t[3] ||= P(() => {}, ["stop"])
|
|
3708
|
+
}, [M(s("textarea", {
|
|
3709
|
+
ref_key: "inputRef",
|
|
3710
|
+
ref: a,
|
|
3711
|
+
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
3712
|
+
class: "add-comment-card__field",
|
|
3713
|
+
placeholder: "Add a comment",
|
|
3714
|
+
onMousedown: t[1] ||= P(() => {}, ["stop"]),
|
|
3715
|
+
onKeydown: [
|
|
3716
|
+
t[2] ||= P(() => {}, ["stop"]),
|
|
3717
|
+
N(P(l, ["exact", "prevent"]), ["enter"]),
|
|
3718
|
+
N(u, ["esc"])
|
|
3719
|
+
]
|
|
3720
|
+
}, null, 40, Di), [[k, i.value]]), s("div", Oi, [s("button", {
|
|
3721
|
+
class: "add-comment-card__cancel",
|
|
3722
|
+
onClick: u
|
|
3723
|
+
}, "Cancel"), s("button", {
|
|
3724
|
+
class: m(["add-comment-card__submit", { "add-comment-card__submit--active": c.value }]),
|
|
3725
|
+
disabled: !c.value,
|
|
3726
|
+
onClick: l
|
|
3727
|
+
}, "Comment", 10, ki)])], 32));
|
|
3728
|
+
}
|
|
3729
|
+
}), [["__scopeId", "data-v-fa58f532"]]);
|
|
3730
|
+
//#endregion
|
|
3731
|
+
//#region src/components/sidebar/resolveItemPositions.ts
|
|
3732
|
+
function ji(e, t, n, r, i) {
|
|
3733
|
+
if (e.length === 0) return [];
|
|
3734
|
+
let a = [];
|
|
3735
|
+
for (let r of e) {
|
|
3736
|
+
let e;
|
|
3737
|
+
if (r.fixedY != null && (e = r.fixedY * n), e == null && r.anchorKey) {
|
|
3738
|
+
let i = t.get(r.anchorKey);
|
|
3739
|
+
i != null && (e = i * n);
|
|
3740
|
+
}
|
|
3741
|
+
if (e == null) {
|
|
3742
|
+
let t = i.get(r.id);
|
|
3743
|
+
t != null && (e = t);
|
|
3744
|
+
}
|
|
3745
|
+
e != null && (a.push({
|
|
3746
|
+
item: r,
|
|
3747
|
+
targetY: e
|
|
3748
|
+
}), i.set(r.id, e));
|
|
3749
|
+
}
|
|
3750
|
+
a.sort((e, t) => {
|
|
3751
|
+
let n = e.targetY - t.targetY;
|
|
3752
|
+
return n === 0 ? (e.item.priority ?? 0) - (t.item.priority ?? 0) : n;
|
|
3753
|
+
});
|
|
3754
|
+
let o = [], s = 0;
|
|
3755
|
+
for (let e of a) {
|
|
3756
|
+
let t = r.get(e.item.id) ?? e.item.estimatedHeight ?? 80, n = Math.max(e.targetY, s + 8);
|
|
3757
|
+
o.push({
|
|
3758
|
+
item: e.item,
|
|
3759
|
+
y: n
|
|
3760
|
+
}), s = n + t;
|
|
3761
|
+
}
|
|
3762
|
+
return o;
|
|
3763
|
+
}
|
|
3764
|
+
//#endregion
|
|
3765
|
+
//#region src/composables/useCommentSidebarItems.ts
|
|
3766
|
+
function Mi({ comments: e, trackedChanges: t, showResolved: n, isAddingComment: i, addCommentYPosition: a }) {
|
|
3767
|
+
return r(() => {
|
|
3768
|
+
let r = [];
|
|
3769
|
+
i?.value && a?.value != null && r.push({
|
|
3770
|
+
id: "new-comment-input",
|
|
3771
|
+
anchorPos: 0,
|
|
3772
|
+
fixedY: a.value,
|
|
3773
|
+
priority: -1e3,
|
|
3774
|
+
isTemporary: !0,
|
|
3775
|
+
estimatedHeight: 120,
|
|
3776
|
+
kind: "add-comment"
|
|
3777
|
+
});
|
|
3778
|
+
let o = /* @__PURE__ */ new Map();
|
|
3779
|
+
for (let t of e.value) if (t.parentId != null) {
|
|
3780
|
+
let e = o.get(t.parentId);
|
|
3781
|
+
e ? e.push(t) : o.set(t.parentId, [t]);
|
|
3782
|
+
}
|
|
3783
|
+
for (let t of e.value) t.parentId ?? (t.done && !n?.value || r.push({
|
|
3784
|
+
id: `comment-${t.id}`,
|
|
3785
|
+
anchorPos: 0,
|
|
3786
|
+
anchorKey: `comment-${t.id}`,
|
|
3787
|
+
priority: 0,
|
|
3788
|
+
estimatedHeight: t.done ? 28 : 80,
|
|
3789
|
+
kind: "comment",
|
|
3790
|
+
comment: t,
|
|
3791
|
+
replies: o.get(t.id) ?? []
|
|
3792
|
+
}));
|
|
3793
|
+
return t.value.forEach((e, t) => {
|
|
3794
|
+
r.push({
|
|
3795
|
+
id: `tc-${e.revisionId}-${t}`,
|
|
3796
|
+
anchorPos: e.from,
|
|
3797
|
+
anchorKey: `revision-${e.revisionId}`,
|
|
3798
|
+
priority: 1,
|
|
3799
|
+
estimatedHeight: 80,
|
|
3800
|
+
kind: "tracked-change",
|
|
3801
|
+
change: e,
|
|
3802
|
+
replies: o.get(e.revisionId) ?? []
|
|
3803
|
+
});
|
|
3804
|
+
}), r;
|
|
3805
|
+
});
|
|
3806
|
+
}
|
|
3807
|
+
//#endregion
|
|
3808
|
+
//#region src/components/UnifiedSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
3809
|
+
var Ni = ["data-card-id"], Pi = 16, Fi = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
3810
|
+
__name: "UnifiedSidebar",
|
|
3811
|
+
props: {
|
|
3812
|
+
isOpen: { type: Boolean },
|
|
3813
|
+
comments: {},
|
|
3814
|
+
trackedChanges: {},
|
|
3815
|
+
isAddingComment: { type: Boolean },
|
|
3816
|
+
showResolved: { type: Boolean },
|
|
3817
|
+
pagesContainer: {},
|
|
3818
|
+
pageWidthPx: {},
|
|
3819
|
+
zoom: {},
|
|
3820
|
+
activeItemId: {},
|
|
3821
|
+
addCommentYPosition: {}
|
|
3822
|
+
},
|
|
3823
|
+
emits: [
|
|
3824
|
+
"close",
|
|
3825
|
+
"add-comment",
|
|
3826
|
+
"cancel-add-comment",
|
|
3827
|
+
"comment-reply",
|
|
3828
|
+
"comment-resolve",
|
|
3829
|
+
"comment-unresolve",
|
|
3830
|
+
"comment-delete",
|
|
3831
|
+
"accept-change",
|
|
3832
|
+
"reject-change",
|
|
3833
|
+
"accept-change-by-id",
|
|
3834
|
+
"reject-change-by-id",
|
|
3835
|
+
"tracked-change-reply",
|
|
3836
|
+
"update:activeItemId"
|
|
3837
|
+
],
|
|
3838
|
+
setup(e, { emit: t }) {
|
|
3839
|
+
let l = e, u = t, d = x(null), f = r(() => l.activeItemId === void 0 ? d.value : l.activeItemId);
|
|
3840
|
+
function p(e) {
|
|
3841
|
+
let t = f.value === e ? null : e;
|
|
3842
|
+
d.value = t, u("update:activeItemId", t);
|
|
3843
|
+
}
|
|
3844
|
+
function m(e) {
|
|
3845
|
+
e.stopPropagation();
|
|
3846
|
+
let t = e.target;
|
|
3847
|
+
t instanceof HTMLElement && t.closest(".unified-sidebar__card-slot") || f.value !== null && (d.value = null, u("update:activeItemId", null));
|
|
3848
|
+
}
|
|
3849
|
+
let y = Mi({
|
|
3850
|
+
comments: E(l, "comments"),
|
|
3851
|
+
trackedChanges: E(l, "trackedChanges"),
|
|
3852
|
+
showResolved: r(() => l.showResolved ?? !1),
|
|
3853
|
+
isAddingComment: r(() => l.isAddingComment ?? !1),
|
|
3854
|
+
addCommentYPosition: r(() => l.addCommentYPosition ?? null)
|
|
3855
|
+
}), b = x(null), C = x(/* @__PURE__ */ new Map()), O = /* @__PURE__ */ new Map(), k = null, M = null, N = /* @__PURE__ */ new Set();
|
|
3856
|
+
function P() {
|
|
3857
|
+
let e = b.value;
|
|
3858
|
+
if (!e || !M) return;
|
|
3859
|
+
let t = new Set(e.querySelectorAll("[data-card-id]"));
|
|
3860
|
+
if (!(t.size === N.size && [...t].every((e) => N.has(e)))) {
|
|
3861
|
+
M.disconnect();
|
|
3862
|
+
for (let e of t) M.observe(e);
|
|
3863
|
+
N = t;
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
function F() {
|
|
3867
|
+
let e = l.pagesContainer, t = y.value;
|
|
3868
|
+
if (!e || t.length === 0) {
|
|
3869
|
+
C.value = /* @__PURE__ */ new Map();
|
|
3870
|
+
return;
|
|
3871
|
+
}
|
|
3872
|
+
let n = e.getBoundingClientRect(), r = /* @__PURE__ */ new Map();
|
|
3873
|
+
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
3874
|
+
let e = t.dataset.commentId;
|
|
3875
|
+
e && !r.has(e) && r.set(e, t);
|
|
3876
|
+
}
|
|
3877
|
+
let i = /* @__PURE__ */ new Map();
|
|
3878
|
+
for (let t of e.querySelectorAll(".docx-insertion[data-revision-id]")) {
|
|
3879
|
+
let e = t.dataset.revisionId;
|
|
3880
|
+
e && !i.has(e) && i.set(e, t);
|
|
3881
|
+
}
|
|
3882
|
+
let a = /* @__PURE__ */ new Map();
|
|
3883
|
+
for (let t of e.querySelectorAll(".docx-deletion[data-revision-id]")) {
|
|
3884
|
+
let e = t.dataset.revisionId;
|
|
3885
|
+
e && !a.has(e) && a.set(e, t);
|
|
3886
|
+
}
|
|
3887
|
+
for (let t of e.querySelectorAll(".ep-revision-table[data-revision-id], .ep-revision-row[data-revision-id], .ep-revision-cell[data-revision-id], .layout-revision-pmark[data-revision-id]")) {
|
|
3888
|
+
let e = t.dataset.revisionId;
|
|
3889
|
+
if (!e) continue;
|
|
3890
|
+
let n = t.classList.contains("ep-revision-ins") || t.classList.contains("layout-revision-ins") ? i : a;
|
|
3891
|
+
n.has(e) || n.set(e, t);
|
|
3892
|
+
}
|
|
3893
|
+
let o = /* @__PURE__ */ new Map(), s = (t) => t.getBoundingClientRect().top - n.top + e.scrollTop;
|
|
3894
|
+
for (let e of t) {
|
|
3895
|
+
if (!e.anchorKey) continue;
|
|
3896
|
+
let t;
|
|
3897
|
+
if (e.kind === "comment") t = r.get(String(e.comment.id));
|
|
3898
|
+
else if (e.kind === "tracked-change") {
|
|
3899
|
+
let n = e.change;
|
|
3900
|
+
t = n.type === "deletion" ? a.get(String(n.revisionId)) : i.get(String(n.insertionRevisionId ?? n.revisionId));
|
|
3901
|
+
}
|
|
3902
|
+
t && o.set(e.anchorKey, s(t));
|
|
3903
|
+
}
|
|
3904
|
+
let c = /* @__PURE__ */ new Map(), u = b.value;
|
|
3905
|
+
if (u) for (let e of u.querySelectorAll("[data-card-id]")) {
|
|
3906
|
+
let t = e.dataset.cardId;
|
|
3907
|
+
t && c.set(t, e.offsetHeight);
|
|
3908
|
+
}
|
|
3909
|
+
let d = /* @__PURE__ */ new Map();
|
|
3910
|
+
for (let { item: e, y: n } of ji(t, o, 1, c, O)) d.set(e.id, n);
|
|
3911
|
+
C.value = d, P();
|
|
3912
|
+
}
|
|
3913
|
+
let I = r(() => {
|
|
3914
|
+
let e = 0;
|
|
3915
|
+
for (let t of C.value.values()) e = Math.max(e, t);
|
|
3916
|
+
return e + 200;
|
|
3917
|
+
}), L = r(() => {
|
|
3918
|
+
let e = f.value;
|
|
3919
|
+
if (!e) return "";
|
|
3920
|
+
if (e.startsWith("comment-")) return `.paged-editor__pages [data-comment-id="${e.slice(8)}"] { background-color: rgba(255, 212, 0, 0.35) !important; border-bottom: 2px solid rgba(255, 212, 0, 0.7) !important; }`;
|
|
3921
|
+
if (e.startsWith("tc-")) {
|
|
3922
|
+
let t = e.split("-").at(1) ?? "";
|
|
3923
|
+
return `
|
|
3924
|
+
.paged-editor__pages .docx-insertion[data-revision-id="${y.value.find((t) => t.id === e)?.change?.insertionRevisionId ?? Number(t)}"] { background-color: rgba(52, 168, 83, 0.2) !important; border-bottom: 2px solid #2e7d32 !important; }
|
|
3925
|
+
.paged-editor__pages .docx-deletion[data-revision-id="${t}"] { background-color: rgba(211, 47, 47, 0.2) !important; text-decoration-thickness: 2px !important; }
|
|
3926
|
+
`;
|
|
3927
|
+
}
|
|
3928
|
+
return "";
|
|
3929
|
+
}), R = r(() => {
|
|
3930
|
+
let e = l.pageWidthPx / 2 + Pi - 176, t = C.value.size > 0 || y.value.length === 0;
|
|
3931
|
+
return {
|
|
3932
|
+
position: "absolute",
|
|
3933
|
+
top: "0",
|
|
3934
|
+
left: `calc(50% + ${e}px)`,
|
|
3935
|
+
width: "340px",
|
|
3936
|
+
opacity: +!!t
|
|
3937
|
+
};
|
|
3938
|
+
});
|
|
3939
|
+
function ee(e) {
|
|
3940
|
+
let t = C.value.get(e);
|
|
3941
|
+
return t == null ? {
|
|
3942
|
+
position: "static",
|
|
3943
|
+
marginBottom: "8px"
|
|
3944
|
+
} : {
|
|
3945
|
+
position: "absolute",
|
|
3946
|
+
top: t + "px",
|
|
3947
|
+
left: 0,
|
|
3948
|
+
right: 0,
|
|
3949
|
+
transition: "top 0.15s ease"
|
|
3950
|
+
};
|
|
3951
|
+
}
|
|
3952
|
+
let te = !1;
|
|
3953
|
+
function z() {
|
|
3954
|
+
te || (te = !0, requestAnimationFrame(() => {
|
|
3955
|
+
te = !1, F();
|
|
3956
|
+
}));
|
|
3957
|
+
}
|
|
3958
|
+
A(() => [
|
|
3959
|
+
y.value,
|
|
3960
|
+
f.value,
|
|
3961
|
+
l.pagesContainer,
|
|
3962
|
+
l.pageWidthPx,
|
|
3963
|
+
l.zoom,
|
|
3964
|
+
l.isAddingComment,
|
|
3965
|
+
l.addCommentYPosition
|
|
3966
|
+
], () => z(), { immediate: !0 });
|
|
3967
|
+
function B(e) {
|
|
3968
|
+
let t = e?.parentElement ?? null;
|
|
3969
|
+
for (; t;) {
|
|
3970
|
+
let e = getComputedStyle(t).overflowY;
|
|
3971
|
+
if (e === "auto" || e === "scroll") return t;
|
|
3972
|
+
t = t.parentElement;
|
|
3973
|
+
}
|
|
3974
|
+
return null;
|
|
3975
|
+
}
|
|
3976
|
+
let V = null;
|
|
3977
|
+
function H() {
|
|
3978
|
+
V && V.removeEventListener("scroll", z), V = B(l.pagesContainer), V && V.addEventListener("scroll", z, { passive: !0 });
|
|
3979
|
+
}
|
|
3980
|
+
return _(() => {
|
|
3981
|
+
M = new ResizeObserver(() => z()), z(), l.pagesContainer && (k = new ResizeObserver(() => z()), k.observe(l.pagesContainer), H());
|
|
3982
|
+
}), A(() => l.pagesContainer, (e) => {
|
|
3983
|
+
k?.disconnect(), k = null, e && (k = new ResizeObserver(() => z()), k.observe(e), H());
|
|
3984
|
+
}), g(() => {
|
|
3985
|
+
k?.disconnect(), M?.disconnect(), V && V.removeEventListener("scroll", z);
|
|
3986
|
+
}), (t, r) => (v(), o(n, null, [L.value ? (v(), i(w("style"), { key: 0 }, {
|
|
3987
|
+
default: j(() => [c(T(L.value), 1)]),
|
|
3988
|
+
_: 1
|
|
3989
|
+
})) : a("", !0), e.isOpen ? (v(), o("aside", {
|
|
3990
|
+
key: 1,
|
|
3991
|
+
ref_key: "rootRef",
|
|
3992
|
+
ref: b,
|
|
3993
|
+
class: "unified-sidebar",
|
|
3994
|
+
style: h(R.value),
|
|
3995
|
+
onMousedown: m
|
|
3996
|
+
}, [s("div", {
|
|
3997
|
+
class: "unified-sidebar__inner",
|
|
3998
|
+
style: h({ minHeight: I.value + "px" })
|
|
3999
|
+
}, [(v(!0), o(n, null, S(D(y), (e) => (v(), o("div", {
|
|
4000
|
+
key: e.id,
|
|
4001
|
+
class: "unified-sidebar__card-slot",
|
|
4002
|
+
"data-card-id": e.id,
|
|
4003
|
+
style: h(ee(e.id))
|
|
4004
|
+
}, [e.kind === "add-comment" ? (v(), i(Ai, {
|
|
4005
|
+
key: 0,
|
|
4006
|
+
onSubmit: r[0] ||= (e) => t.$emit("add-comment", e),
|
|
4007
|
+
onCancel: r[1] ||= (e) => t.$emit("cancel-add-comment")
|
|
4008
|
+
})) : e.kind === "comment" && e.comment.done && f.value !== e.id ? (v(), i(ni, {
|
|
4009
|
+
key: 1,
|
|
4010
|
+
comment: e.comment,
|
|
4011
|
+
onToggleExpand: (t) => p(e.id)
|
|
4012
|
+
}, null, 8, ["comment", "onToggleExpand"])) : e.kind === "comment" ? (v(), i(ei, {
|
|
4013
|
+
key: 2,
|
|
4014
|
+
comment: e.comment,
|
|
4015
|
+
replies: e.replies,
|
|
4016
|
+
expanded: f.value === e.id,
|
|
4017
|
+
onClick: (t) => p(e.id),
|
|
4018
|
+
onReply: r[2] ||= (e, n) => t.$emit("comment-reply", e, n),
|
|
4019
|
+
onResolve: r[3] ||= (e) => t.$emit("comment-resolve", e),
|
|
4020
|
+
onUnresolve: r[4] ||= (e) => t.$emit("comment-unresolve", e),
|
|
4021
|
+
onDelete: r[5] ||= (e) => t.$emit("comment-delete", e)
|
|
4022
|
+
}, null, 8, [
|
|
4023
|
+
"comment",
|
|
4024
|
+
"replies",
|
|
4025
|
+
"expanded",
|
|
4026
|
+
"onClick"
|
|
4027
|
+
])) : e.kind === "tracked-change" ? (v(), i(Ei, {
|
|
4028
|
+
key: 3,
|
|
4029
|
+
change: e.change,
|
|
4030
|
+
replies: e.replies ?? [],
|
|
4031
|
+
expanded: f.value === e.id,
|
|
4032
|
+
onClick: (t) => p(e.id),
|
|
4033
|
+
onAccept: r[6] ||= (e, n) => t.$emit("accept-change", e, n),
|
|
4034
|
+
onReject: r[7] ||= (e, n) => t.$emit("reject-change", e, n),
|
|
4035
|
+
onAcceptById: r[8] ||= (e) => t.$emit("accept-change-by-id", e),
|
|
4036
|
+
onRejectById: r[9] ||= (e) => t.$emit("reject-change-by-id", e),
|
|
4037
|
+
onReply: r[10] ||= (e, n) => t.$emit("tracked-change-reply", e, n)
|
|
4038
|
+
}, null, 8, [
|
|
4039
|
+
"change",
|
|
4040
|
+
"replies",
|
|
4041
|
+
"expanded",
|
|
4042
|
+
"onClick"
|
|
4043
|
+
])) : a("", !0)], 12, Ni))), 128))], 4)], 36)) : a("", !0)], 64));
|
|
4044
|
+
}
|
|
4045
|
+
}), [["__scopeId", "data-v-a073acda"]]), Ii = ["value", "disabled"], Li = ["value"], Ri = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
4046
|
+
__name: "StylePicker",
|
|
4047
|
+
props: {
|
|
4048
|
+
value: {},
|
|
4049
|
+
styles: {},
|
|
4050
|
+
disabled: {
|
|
4051
|
+
type: Boolean,
|
|
4052
|
+
default: !1
|
|
4053
|
+
},
|
|
4054
|
+
className: {}
|
|
4055
|
+
},
|
|
4056
|
+
emits: ["change"],
|
|
4057
|
+
setup(e, { emit: t }) {
|
|
4058
|
+
let i = e, a = t, s = [
|
|
4059
|
+
{
|
|
4060
|
+
styleId: "Normal",
|
|
4061
|
+
name: "Normal text"
|
|
4062
|
+
},
|
|
4063
|
+
{
|
|
4064
|
+
styleId: "Title",
|
|
4065
|
+
name: "Title"
|
|
4066
|
+
},
|
|
4067
|
+
{
|
|
4068
|
+
styleId: "Subtitle",
|
|
4069
|
+
name: "Subtitle"
|
|
4070
|
+
},
|
|
4071
|
+
{
|
|
4072
|
+
styleId: "Heading1",
|
|
4073
|
+
name: "Heading 1"
|
|
4074
|
+
},
|
|
4075
|
+
{
|
|
4076
|
+
styleId: "Heading2",
|
|
4077
|
+
name: "Heading 2"
|
|
4078
|
+
},
|
|
4079
|
+
{
|
|
4080
|
+
styleId: "Heading3",
|
|
4081
|
+
name: "Heading 3"
|
|
4082
|
+
}
|
|
4083
|
+
], c = r(() => i.styles ?? s);
|
|
4084
|
+
function l(e) {
|
|
4085
|
+
e.target instanceof HTMLSelectElement && a("change", e.target.value);
|
|
4086
|
+
}
|
|
4087
|
+
return (t, r) => (v(), o("select", {
|
|
4088
|
+
class: m(["docx-style-picker", e.className]),
|
|
4089
|
+
value: e.value ?? "Normal",
|
|
4090
|
+
disabled: e.disabled,
|
|
4091
|
+
"aria-label": "Paragraph style",
|
|
4092
|
+
onChange: l
|
|
4093
|
+
}, [(v(!0), o(n, null, S(c.value, (e) => (v(), o("option", {
|
|
4094
|
+
key: e.styleId,
|
|
4095
|
+
value: e.styleId
|
|
4096
|
+
}, T(e.name), 9, Li))), 128))], 42, Ii));
|
|
4097
|
+
}
|
|
4098
|
+
}), [["__scopeId", "data-v-30d0e9b2"]]), zi = [
|
|
4099
|
+
"disabled",
|
|
4100
|
+
"title",
|
|
4101
|
+
"aria-expanded",
|
|
4102
|
+
"onClick"
|
|
4103
|
+
], Bi = { class: "docx-align__panel" }, Vi = ["title", "onClick"], Hi = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
4104
|
+
__name: "AlignmentButtons",
|
|
4105
|
+
props: {
|
|
4106
|
+
value: { default: "left" },
|
|
4107
|
+
disabled: {
|
|
4108
|
+
type: Boolean,
|
|
4109
|
+
default: !1
|
|
4110
|
+
}
|
|
4111
|
+
},
|
|
4112
|
+
emits: ["change"],
|
|
4113
|
+
setup(e, { emit: t }) {
|
|
4114
|
+
let a = e, c = t, u = x(!1), d = [
|
|
4115
|
+
{
|
|
4116
|
+
value: "left",
|
|
4117
|
+
label: "Align left",
|
|
4118
|
+
icon: "format_align_left",
|
|
4119
|
+
shortcut: "Ctrl+L"
|
|
4120
|
+
},
|
|
4121
|
+
{
|
|
4122
|
+
value: "center",
|
|
4123
|
+
label: "Center",
|
|
4124
|
+
icon: "format_align_center",
|
|
4125
|
+
shortcut: "Ctrl+E"
|
|
4126
|
+
},
|
|
4127
|
+
{
|
|
4128
|
+
value: "right",
|
|
4129
|
+
label: "Align right",
|
|
4130
|
+
icon: "format_align_right",
|
|
4131
|
+
shortcut: "Ctrl+R"
|
|
4132
|
+
},
|
|
4133
|
+
{
|
|
4134
|
+
value: "both",
|
|
4135
|
+
label: "Justify",
|
|
4136
|
+
icon: "format_align_justify",
|
|
4137
|
+
shortcut: "Ctrl+J"
|
|
4138
|
+
}
|
|
4139
|
+
], f = r(() => d.find((e) => e.value === a.value)?.icon ?? "format_align_left"), p = r(() => d.find((e) => e.value === a.value)?.label ?? "Left");
|
|
4140
|
+
function h(e) {
|
|
4141
|
+
c("change", e), u.value = !1;
|
|
4142
|
+
}
|
|
4143
|
+
return (t, r) => (v(), i(Z, {
|
|
4144
|
+
open: u.value,
|
|
4145
|
+
"onUpdate:open": r[0] ||= (e) => u.value = e,
|
|
4146
|
+
onClose: r[1] ||= (e) => u.value = !1
|
|
4147
|
+
}, {
|
|
4148
|
+
trigger: j(({ toggle: t }) => [s("button", {
|
|
4149
|
+
type: "button",
|
|
4150
|
+
class: m(["docx-align__btn", { "docx-align__btn--open": u.value }]),
|
|
4151
|
+
disabled: e.disabled,
|
|
4152
|
+
title: `Alignment: ${p.value}`,
|
|
4153
|
+
"aria-expanded": u.value,
|
|
4154
|
+
"aria-haspopup": "true",
|
|
4155
|
+
onClick: P(t, ["prevent"])
|
|
4156
|
+
}, [l(q, {
|
|
4157
|
+
name: f.value,
|
|
4158
|
+
size: 20
|
|
4159
|
+
}, null, 8, ["name"]), l(q, {
|
|
4160
|
+
name: "arrow_drop_down",
|
|
4161
|
+
size: 14
|
|
4162
|
+
})], 10, zi)]),
|
|
4163
|
+
panel: j(() => [s("div", Bi, [(v(), o(n, null, S(d, (t) => s("button", {
|
|
4164
|
+
key: t.value,
|
|
4165
|
+
type: "button",
|
|
4166
|
+
class: m(["docx-align__option", { "docx-align__option--active": e.value === t.value }]),
|
|
4167
|
+
title: `${t.label} (${t.shortcut})`,
|
|
4168
|
+
onClick: P((e) => h(t.value), ["prevent"])
|
|
4169
|
+
}, [l(q, {
|
|
4170
|
+
name: t.icon,
|
|
4171
|
+
size: 20
|
|
4172
|
+
}, null, 8, ["name"])], 10, Vi)), 64))])]),
|
|
4173
|
+
_: 1
|
|
4174
|
+
}, 8, ["open"]));
|
|
4175
|
+
}
|
|
4176
|
+
}), [["__scopeId", "data-v-34a01365"]]);
|
|
4177
|
+
//#endregion
|
|
4178
|
+
//#region src/utils/listState.ts
|
|
4179
|
+
function Ui() {
|
|
4180
|
+
return {
|
|
4181
|
+
type: "none",
|
|
4182
|
+
level: 0,
|
|
4183
|
+
isInList: !1
|
|
4184
|
+
};
|
|
4185
|
+
}
|
|
4186
|
+
//#endregion
|
|
4187
|
+
//#region src/components/ui/ListButtons.vue?vue&type=script&setup=true&lang.ts
|
|
4188
|
+
var Wi = { class: "docx-list-btns" }, Gi = ["disabled"], Ki = ["disabled"], qi = ["disabled"], Ji = ["disabled"], Yi = /*#__PURE__*/ t(/* @__PURE__ */ u({
|
|
4189
|
+
__name: "ListButtons",
|
|
4190
|
+
props: {
|
|
4191
|
+
listState: {},
|
|
4192
|
+
disabled: {
|
|
4193
|
+
type: Boolean,
|
|
4194
|
+
default: !1
|
|
4195
|
+
},
|
|
4196
|
+
showIndentButtons: {
|
|
4197
|
+
type: Boolean,
|
|
4198
|
+
default: !0
|
|
4199
|
+
},
|
|
4200
|
+
canOutdent: {
|
|
4201
|
+
type: Boolean,
|
|
4202
|
+
default: !0
|
|
4203
|
+
}
|
|
4204
|
+
},
|
|
4205
|
+
emits: [
|
|
4206
|
+
"bullet-list",
|
|
4207
|
+
"numbered-list",
|
|
4208
|
+
"indent",
|
|
4209
|
+
"outdent"
|
|
4210
|
+
],
|
|
4211
|
+
setup(e) {
|
|
4212
|
+
return (t, r) => (v(), o("span", Wi, [
|
|
4213
|
+
s("button", {
|
|
4214
|
+
type: "button",
|
|
4215
|
+
class: m(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "bullet" }]),
|
|
4216
|
+
disabled: e.disabled,
|
|
4217
|
+
title: "Bullet list",
|
|
4218
|
+
onClick: r[0] ||= P((e) => t.$emit("bullet-list"), ["prevent"])
|
|
4219
|
+
}, [l(q, {
|
|
4220
|
+
name: "format_list_bulleted",
|
|
4221
|
+
size: 20
|
|
4222
|
+
})], 10, Gi),
|
|
4223
|
+
s("button", {
|
|
4224
|
+
type: "button",
|
|
4225
|
+
class: m(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "numbered" }]),
|
|
4226
|
+
disabled: e.disabled,
|
|
4227
|
+
title: "Numbered list",
|
|
4228
|
+
onClick: r[1] ||= P((e) => t.$emit("numbered-list"), ["prevent"])
|
|
4229
|
+
}, [l(q, {
|
|
4230
|
+
name: "format_list_numbered",
|
|
4231
|
+
size: 20
|
|
4232
|
+
})], 10, Ki),
|
|
4233
|
+
e.showIndentButtons ? (v(), o(n, { key: 0 }, [s("button", {
|
|
4234
|
+
type: "button",
|
|
4235
|
+
class: "docx-list-btns__btn",
|
|
4236
|
+
disabled: e.disabled || !e.canOutdent,
|
|
4237
|
+
title: "Decrease indent",
|
|
4238
|
+
onClick: r[2] ||= P((e) => t.$emit("outdent"), ["prevent"])
|
|
4239
|
+
}, [l(q, {
|
|
4240
|
+
name: "format_indent_decrease",
|
|
4241
|
+
size: 20
|
|
4242
|
+
})], 8, qi), s("button", {
|
|
4243
|
+
type: "button",
|
|
4244
|
+
class: "docx-list-btns__btn",
|
|
4245
|
+
disabled: e.disabled,
|
|
4246
|
+
title: "Increase indent",
|
|
4247
|
+
onClick: r[3] ||= P((e) => t.$emit("indent"), ["prevent"])
|
|
4248
|
+
}, [l(q, {
|
|
4249
|
+
name: "format_indent_increase",
|
|
4250
|
+
size: 20
|
|
4251
|
+
})], 8, Ji)], 64)) : a("", !0)
|
|
4252
|
+
]));
|
|
4253
|
+
}
|
|
4254
|
+
}), [["__scopeId", "data-v-c0ca80c9"]]);
|
|
4255
|
+
//#endregion
|
|
4256
|
+
export { be as A, jt as C, Ee as D, Pe as E, re as F, q as I, $ as M, Z as N, Te as O, oe as P, At as S, ct as T, Pn as _, Fi as a, _n as b, ni as c, Br as d, Er as f, zn as g, Bn as h, Ri as i, ge as j, we as k, ei as l, yr as m, Ui as n, Ai as o, br as p, Hi as r, Ei as s, Yi as t, Wr as u, Nn as v, Et as w, Mt as x, kn as y };
|