@harbour-enterprises/superdoc 1.0.0-next.10 → 1.0.0-next.2
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/chunks/{PdfViewer-B9LcTIm2.cjs → PdfViewer-B-xTd4XY.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CZG4udaT.es.js → PdfViewer-eykNsWyi.es.js} +2 -2
- package/dist/chunks/{eventemitter3-44XulWQe.es.js → eventemitter3-CcXAdeql.es.js} +1 -1
- package/dist/chunks/{index-DdTDm9oI-BXzE00pk.es.js → index-BDVXUeCy-7mwhYeJ7.es.js} +1 -1
- package/dist/chunks/{index-DdTDm9oI-Duiy8M_G.cjs → index-BDVXUeCy-Di6ozaOM.cjs} +1 -1
- package/dist/chunks/{index-1n6qegaQ.es.js → index-DpQ8ZYM0.es.js} +325 -564
- package/dist/chunks/{index-4FiyZ-0E.cjs → index-rF5HExWB.cjs} +322 -561
- package/dist/chunks/{jszip-VP334ufO.es.js → jszip-5vvIqAEE.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BQQuazyp.cjs → super-editor.es-CcKbh84I.cjs} +25739 -28432
- package/dist/chunks/{super-editor.es-DKr759cY.es.js → super-editor.es-CxajnL9u.es.js} +25740 -28433
- package/dist/chunks/{vue-BuPTonTJ.es.js → vue-Dysv_7z5.es.js} +27 -27
- package/dist/chunks/xml-js-ClO_jHnq.es.js +2 -0
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts +3 -3
- package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts +3 -3
- package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/collaboration/helpers.d.ts.map +1 -1
- package/dist/packages/superdoc/src/core/types/index.d.ts +167 -4
- package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
- package/dist/style.css +92 -94
- package/dist/super-editor/ai-writer.es.js +3 -3
- package/dist/super-editor/chunks/{converter-BavE2jnW.js → converter-DN_dhslo.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-CY4M19qa.js → docx-zipper-Bhl_yBjL.js} +1 -1
- package/dist/super-editor/chunks/{editor-Cslr04KI.js → editor-3klx7hyV.js} +25818 -27908
- package/dist/super-editor/chunks/{index-DdTDm9oI.js → index-BDVXUeCy.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Zdgn--Js.js → toolbar-8YA9ltNC.js} +598 -834
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +21 -22
- package/dist/super-editor/super-editor.es.js +19 -44
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +26134 -29066
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-LkEmUa9-.es.js +0 -2
- package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts +0 -42
- package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as process$1 } from "./converter-
|
|
3
|
-
import {
|
|
1
|
+
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
+
import { p as process$1 } from "./converter-DN_dhslo.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-3klx7hyV.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -155,73 +155,383 @@ const toolbarIcons = {
|
|
|
155
155
|
paste: pasteIconSvg,
|
|
156
156
|
strikethrough: strikethroughSvg
|
|
157
157
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
_mPrefix = t;
|
|
158
|
+
const _hoisted_1$4 = { class: "toolbar-icon" };
|
|
159
|
+
const _hoisted_2$3 = ["innerHTML"];
|
|
160
|
+
const _sfc_main$5 = {
|
|
161
|
+
__name: "ToolbarButtonIcon",
|
|
162
|
+
props: {
|
|
163
|
+
name: {
|
|
164
|
+
type: String,
|
|
165
|
+
required: true
|
|
166
|
+
},
|
|
167
|
+
color: {
|
|
168
|
+
type: String,
|
|
169
|
+
default: null
|
|
170
|
+
},
|
|
171
|
+
icon: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: null
|
|
175
174
|
}
|
|
175
|
+
},
|
|
176
|
+
setup(__props) {
|
|
177
|
+
const props = __props;
|
|
178
|
+
const getBarColor = computed(() => {
|
|
179
|
+
if (props.name === "color") return { backgroundColor: props.color || "#111111" };
|
|
180
|
+
if (props.name === "highlight") return { backgroundColor: props.color || "#D6D6D6" };
|
|
181
|
+
});
|
|
182
|
+
const hasColorBar = computed(() => {
|
|
183
|
+
return ["color", "highlight"].includes(props.name);
|
|
184
|
+
});
|
|
185
|
+
return (_ctx, _cache) => {
|
|
186
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
187
|
+
createElementVNode("div", {
|
|
188
|
+
class: normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
|
|
189
|
+
innerHTML: __props.icon
|
|
190
|
+
}, null, 10, _hoisted_2$3),
|
|
191
|
+
hasColorBar.value ? (openBlock(), createElementBlock("div", {
|
|
192
|
+
key: 0,
|
|
193
|
+
class: "color-bar",
|
|
194
|
+
style: normalizeStyle(getBarColor.value)
|
|
195
|
+
}, null, 4)) : createCommentVNode("", true)
|
|
196
|
+
]);
|
|
197
|
+
};
|
|
176
198
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
199
|
+
};
|
|
200
|
+
const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-6d7523ab"]]);
|
|
201
|
+
const _hoisted_1$3 = ["role", "aria-label", "onKeydown"];
|
|
202
|
+
const _hoisted_2$2 = ["data-item"];
|
|
203
|
+
const _hoisted_3$2 = {
|
|
204
|
+
key: 1,
|
|
205
|
+
class: "button-label"
|
|
206
|
+
};
|
|
207
|
+
const _hoisted_4$1 = { key: 2 };
|
|
208
|
+
const _hoisted_5 = ["onKeydown", "id"];
|
|
209
|
+
const _hoisted_6 = ["placeholder", "onKeydown", "id"];
|
|
210
|
+
const _hoisted_7 = ["innerHTML"];
|
|
211
|
+
const _hoisted_8 = {
|
|
212
|
+
"aria-live": "polite",
|
|
213
|
+
class: "visually-hidden"
|
|
214
|
+
};
|
|
215
|
+
const _sfc_main$4 = {
|
|
216
|
+
__name: "ToolbarButton",
|
|
217
|
+
props: {
|
|
218
|
+
iconColor: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: null
|
|
221
|
+
},
|
|
222
|
+
active: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
default: false
|
|
225
|
+
},
|
|
226
|
+
isNarrow: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: false
|
|
229
|
+
},
|
|
230
|
+
isWide: {
|
|
231
|
+
type: Boolean,
|
|
232
|
+
default: false
|
|
233
|
+
},
|
|
234
|
+
toolbarItem: {
|
|
235
|
+
type: Object,
|
|
236
|
+
required: true
|
|
237
|
+
},
|
|
238
|
+
defaultLabel: {
|
|
239
|
+
type: String,
|
|
240
|
+
default: null
|
|
241
|
+
},
|
|
242
|
+
isOverflowItem: {
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: false
|
|
184
245
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
246
|
+
},
|
|
247
|
+
emits: ["buttonClick", "textSubmit"],
|
|
248
|
+
setup(__props, { emit: __emit }) {
|
|
249
|
+
const emit = __emit;
|
|
250
|
+
const props = __props;
|
|
251
|
+
const {
|
|
252
|
+
name,
|
|
253
|
+
active,
|
|
254
|
+
icon,
|
|
255
|
+
label,
|
|
256
|
+
hideLabel,
|
|
257
|
+
iconColor,
|
|
258
|
+
hasCaret,
|
|
259
|
+
disabled,
|
|
260
|
+
inlineTextInputVisible,
|
|
261
|
+
hasInlineTextInput,
|
|
262
|
+
minWidth,
|
|
263
|
+
style: style2,
|
|
264
|
+
attributes
|
|
265
|
+
} = props.toolbarItem;
|
|
266
|
+
const inlineTextInput = ref(label);
|
|
267
|
+
const inlineInput = ref(null);
|
|
268
|
+
const { isHighContrastMode } = useHighContrastMode();
|
|
269
|
+
const handleClick = () => {
|
|
270
|
+
if (hasInlineTextInput) {
|
|
271
|
+
nextTick(() => {
|
|
272
|
+
inlineInput.value?.focus();
|
|
273
|
+
inlineInput.value?.select();
|
|
274
|
+
});
|
|
203
275
|
}
|
|
276
|
+
emit("buttonClick");
|
|
204
277
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
278
|
+
const handleInputSubmit = () => {
|
|
279
|
+
const value = inlineTextInput.value;
|
|
280
|
+
const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
|
|
281
|
+
emit("textSubmit", cleanValue);
|
|
282
|
+
inlineTextInput.value = cleanValue;
|
|
283
|
+
};
|
|
284
|
+
const getStyle = computed(() => {
|
|
285
|
+
if (style2.value) return style2.value;
|
|
286
|
+
return {
|
|
287
|
+
minWidth: props.minWidth
|
|
288
|
+
};
|
|
289
|
+
});
|
|
290
|
+
const caretIcon = computed(() => {
|
|
291
|
+
return active.value ? toolbarIcons.dropdownCaretUp : toolbarIcons.dropdownCaretDown;
|
|
292
|
+
});
|
|
293
|
+
return (_ctx, _cache) => {
|
|
294
|
+
return openBlock(), createElementBlock("div", {
|
|
295
|
+
class: normalizeClass(["toolbar-item", unref(attributes).className]),
|
|
296
|
+
style: normalizeStyle(getStyle.value),
|
|
297
|
+
role: __props.isOverflowItem ? "menuitem" : "button",
|
|
298
|
+
"aria-label": unref(attributes).ariaLabel,
|
|
299
|
+
onClick: handleClick,
|
|
300
|
+
onKeydown: withKeys(withModifiers(handleClick, ["stop"]), ["enter"]),
|
|
301
|
+
tabindex: "0"
|
|
302
|
+
}, [
|
|
303
|
+
createElementVNode("div", {
|
|
304
|
+
class: normalizeClass(["toolbar-button", {
|
|
305
|
+
active: unref(active),
|
|
306
|
+
disabled: unref(disabled),
|
|
307
|
+
narrow: __props.isNarrow,
|
|
308
|
+
wide: __props.isWide,
|
|
309
|
+
"has-inline-text-input": unref(hasInlineTextInput),
|
|
310
|
+
"high-contrast": unref(isHighContrastMode)
|
|
311
|
+
}]),
|
|
312
|
+
"data-item": `btn-${unref(name) || ""}`
|
|
313
|
+
}, [
|
|
314
|
+
unref(icon) ? (openBlock(), createBlock(ToolbarButtonIcon, {
|
|
315
|
+
key: 0,
|
|
316
|
+
color: unref(iconColor),
|
|
317
|
+
class: "toolbar-icon",
|
|
318
|
+
icon: unref(icon),
|
|
319
|
+
name: unref(name)
|
|
320
|
+
}, null, 8, ["color", "icon", "name"])) : createCommentVNode("", true),
|
|
321
|
+
unref(label) && !unref(hideLabel) && !unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("div", _hoisted_3$2, toDisplayString(unref(label)), 1)) : createCommentVNode("", true),
|
|
322
|
+
unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
|
|
323
|
+
unref(name) === "fontSize" ? withDirectives((openBlock(), createElementBlock("input", {
|
|
324
|
+
key: 0,
|
|
325
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
|
|
326
|
+
onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
327
|
+
type: "text",
|
|
328
|
+
class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode) }]),
|
|
329
|
+
id: "inlineTextInput-" + unref(name),
|
|
330
|
+
autocomplete: "off",
|
|
331
|
+
ref_key: "inlineInput",
|
|
332
|
+
ref: inlineInput
|
|
333
|
+
}, null, 42, _hoisted_5)), [
|
|
334
|
+
[vModelText, inlineTextInput.value]
|
|
335
|
+
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
336
|
+
key: 1,
|
|
337
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inlineTextInput.value = $event),
|
|
338
|
+
placeholder: unref(label),
|
|
339
|
+
onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
340
|
+
type: "text",
|
|
341
|
+
class: "button-text-input",
|
|
342
|
+
id: "inlineTextInput-" + unref(name),
|
|
343
|
+
autocomplete: "off",
|
|
344
|
+
ref_key: "inlineInput",
|
|
345
|
+
ref: inlineInput
|
|
346
|
+
}, null, 40, _hoisted_6)), [
|
|
347
|
+
[vModelText, inlineTextInput.value]
|
|
348
|
+
])
|
|
349
|
+
])) : createCommentVNode("", true),
|
|
350
|
+
unref(hasCaret) ? (openBlock(), createElementBlock("div", {
|
|
351
|
+
key: 3,
|
|
352
|
+
class: "dropdown-caret",
|
|
353
|
+
innerHTML: caretIcon.value,
|
|
354
|
+
style: normalizeStyle({ opacity: unref(disabled) ? 0.6 : 1 })
|
|
355
|
+
}, null, 12, _hoisted_7)) : createCommentVNode("", true),
|
|
356
|
+
createElementVNode("div", _hoisted_8, toDisplayString(`${unref(attributes).ariaLabel} ${unref(active) ? "selected" : "unset"}`), 1)
|
|
357
|
+
], 10, _hoisted_2$2)
|
|
358
|
+
], 46, _hoisted_1$3);
|
|
220
359
|
};
|
|
221
360
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
361
|
+
};
|
|
362
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ea93b080"]]);
|
|
363
|
+
const _hoisted_1$2 = {
|
|
364
|
+
class: "toolbar-separator",
|
|
365
|
+
role: "separator",
|
|
366
|
+
"aria-label": "Toolbar separator"
|
|
367
|
+
};
|
|
368
|
+
const _sfc_main$3 = {
|
|
369
|
+
__name: "ToolbarSeparator",
|
|
370
|
+
props: {
|
|
371
|
+
active: {
|
|
372
|
+
type: Boolean,
|
|
373
|
+
default: false
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
emits: ["command"],
|
|
377
|
+
setup(__props, { emit: __emit }) {
|
|
378
|
+
const { isHighContrastMode } = useHighContrastMode();
|
|
379
|
+
const getSeparatorColor = () => {
|
|
380
|
+
if (isHighContrastMode.value) {
|
|
381
|
+
return "#000";
|
|
382
|
+
}
|
|
383
|
+
return "#dbdbdb";
|
|
384
|
+
};
|
|
385
|
+
return (_ctx, _cache) => {
|
|
386
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
387
|
+
createElementVNode("div", {
|
|
388
|
+
class: "separator-inner",
|
|
389
|
+
style: normalizeStyle({ backgroundColor: getSeparatorColor() })
|
|
390
|
+
}, null, 4)
|
|
391
|
+
]);
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const ToolbarSeparator = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-4ef9aa18"]]);
|
|
396
|
+
const _hoisted_1$1 = { class: "overflow-menu" };
|
|
397
|
+
const _hoisted_2$1 = { class: "overflow-menu-trigger" };
|
|
398
|
+
const _hoisted_3$1 = {
|
|
399
|
+
key: 0,
|
|
400
|
+
class: "overflow-menu_items",
|
|
401
|
+
role: "group"
|
|
402
|
+
};
|
|
403
|
+
const _sfc_main$2 = {
|
|
404
|
+
__name: "OverflowMenu",
|
|
405
|
+
props: {
|
|
406
|
+
toolbarItem: {
|
|
407
|
+
type: Object,
|
|
408
|
+
required: true
|
|
409
|
+
},
|
|
410
|
+
overflowItems: {
|
|
411
|
+
type: Array,
|
|
412
|
+
required: true
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
emits: ["buttonClick", "close"],
|
|
416
|
+
setup(__props, { emit: __emit }) {
|
|
417
|
+
const { proxy } = getCurrentInstance();
|
|
418
|
+
const emit = __emit;
|
|
419
|
+
const props = __props;
|
|
420
|
+
const isOverflowMenuOpened = computed(() => props.toolbarItem.expand.value);
|
|
421
|
+
const hasOpenDropdown = ref(false);
|
|
422
|
+
const overflowToolbarItem = computed(() => ({
|
|
423
|
+
...props.toolbarItem,
|
|
424
|
+
active: isOverflowMenuOpened.value
|
|
425
|
+
}));
|
|
426
|
+
const toggleOverflowMenu = () => {
|
|
427
|
+
emit("buttonClick", props.toolbarItem);
|
|
428
|
+
};
|
|
429
|
+
const handleCommand = ({ item, argument }) => {
|
|
430
|
+
proxy.$toolbar.emitCommand({ item, argument });
|
|
431
|
+
};
|
|
432
|
+
const handleKeyDown = (e) => {
|
|
433
|
+
if (e.key === "Escape") {
|
|
434
|
+
if (isOverflowMenuOpened.value && !hasOpenDropdown.value) {
|
|
435
|
+
e.preventDefault();
|
|
436
|
+
emit("close");
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
onMounted(() => {
|
|
441
|
+
document.addEventListener("keydown", handleKeyDown, true);
|
|
442
|
+
});
|
|
443
|
+
onBeforeUnmount(() => {
|
|
444
|
+
document.removeEventListener("keydown", handleKeyDown, true);
|
|
445
|
+
});
|
|
446
|
+
return (_ctx, _cache) => {
|
|
447
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
448
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
449
|
+
createVNode(ToolbarButton, {
|
|
450
|
+
"toolbar-item": overflowToolbarItem.value,
|
|
451
|
+
onButtonClick: toggleOverflowMenu
|
|
452
|
+
}, null, 8, ["toolbar-item"])
|
|
453
|
+
]),
|
|
454
|
+
isOverflowMenuOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
455
|
+
createVNode(ButtonGroup, {
|
|
456
|
+
class: "superdoc-toolbar-overflow",
|
|
457
|
+
"toolbar-items": __props.overflowItems,
|
|
458
|
+
"from-overflow": "",
|
|
459
|
+
onCommand: handleCommand,
|
|
460
|
+
onDropdownUpdateShow: _cache[0] || (_cache[0] = ($event) => hasOpenDropdown.value = $event)
|
|
461
|
+
}, null, 8, ["toolbar-items"])
|
|
462
|
+
])) : createCommentVNode("", true)
|
|
463
|
+
]);
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ef28da92"]]);
|
|
468
|
+
function plugin$1(options) {
|
|
469
|
+
let _bPrefix = ".";
|
|
470
|
+
let _ePrefix = "__";
|
|
471
|
+
let _mPrefix = "--";
|
|
472
|
+
let c2;
|
|
473
|
+
if (options) {
|
|
474
|
+
let t = options.blockPrefix;
|
|
475
|
+
if (t) {
|
|
476
|
+
_bPrefix = t;
|
|
477
|
+
}
|
|
478
|
+
t = options.elementPrefix;
|
|
479
|
+
if (t) {
|
|
480
|
+
_ePrefix = t;
|
|
481
|
+
}
|
|
482
|
+
t = options.modifierPrefix;
|
|
483
|
+
if (t) {
|
|
484
|
+
_mPrefix = t;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
const _plugin = {
|
|
488
|
+
install(instance) {
|
|
489
|
+
c2 = instance.c;
|
|
490
|
+
const ctx2 = instance.context;
|
|
491
|
+
ctx2.bem = {};
|
|
492
|
+
ctx2.bem.b = null;
|
|
493
|
+
ctx2.bem.els = null;
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
function b(arg) {
|
|
497
|
+
let memorizedB;
|
|
498
|
+
let memorizedE;
|
|
499
|
+
return {
|
|
500
|
+
before(ctx2) {
|
|
501
|
+
memorizedB = ctx2.bem.b;
|
|
502
|
+
memorizedE = ctx2.bem.els;
|
|
503
|
+
ctx2.bem.els = null;
|
|
504
|
+
},
|
|
505
|
+
after(ctx2) {
|
|
506
|
+
ctx2.bem.b = memorizedB;
|
|
507
|
+
ctx2.bem.els = memorizedE;
|
|
508
|
+
},
|
|
509
|
+
$({ context, props }) {
|
|
510
|
+
arg = typeof arg === "string" ? arg : arg({ context, props });
|
|
511
|
+
context.bem.b = arg;
|
|
512
|
+
return `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}`;
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function e(arg) {
|
|
517
|
+
let memorizedE;
|
|
518
|
+
return {
|
|
519
|
+
before(ctx2) {
|
|
520
|
+
memorizedE = ctx2.bem.els;
|
|
521
|
+
},
|
|
522
|
+
after(ctx2) {
|
|
523
|
+
ctx2.bem.els = memorizedE;
|
|
524
|
+
},
|
|
525
|
+
$({ context, props }) {
|
|
526
|
+
arg = typeof arg === "string" ? arg : arg({ context, props });
|
|
527
|
+
context.bem.els = arg.split(",").map((v) => v.trim());
|
|
528
|
+
return context.bem.els.map((el) => `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${_ePrefix}${el}`).join(", ");
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
function m(arg) {
|
|
533
|
+
return {
|
|
534
|
+
$({ context, props }) {
|
|
225
535
|
arg = typeof arg === "string" ? arg : arg({ context, props });
|
|
226
536
|
const modifiers = arg.split(",").map((v) => v.trim());
|
|
227
537
|
function elementToSelector(el) {
|
|
@@ -3765,30 +4075,30 @@ const defaultClsPrefix = "n";
|
|
|
3765
4075
|
function useConfig(props = {}, options = {
|
|
3766
4076
|
defaultBordered: true
|
|
3767
4077
|
}) {
|
|
3768
|
-
const
|
|
4078
|
+
const NConfigProvider = inject(configProviderInjectionKey, null);
|
|
3769
4079
|
return {
|
|
3770
4080
|
// NConfigProvider,
|
|
3771
|
-
inlineThemeDisabled:
|
|
3772
|
-
mergedRtlRef:
|
|
3773
|
-
mergedComponentPropsRef:
|
|
3774
|
-
mergedBreakpointsRef:
|
|
4081
|
+
inlineThemeDisabled: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.inlineThemeDisabled,
|
|
4082
|
+
mergedRtlRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef,
|
|
4083
|
+
mergedComponentPropsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedComponentPropsRef,
|
|
4084
|
+
mergedBreakpointsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBreakpointsRef,
|
|
3775
4085
|
mergedBorderedRef: computed(() => {
|
|
3776
4086
|
var _a, _b;
|
|
3777
4087
|
const {
|
|
3778
4088
|
bordered
|
|
3779
4089
|
} = props;
|
|
3780
4090
|
if (bordered !== void 0) return bordered;
|
|
3781
|
-
return (_b = (_a =
|
|
4091
|
+
return (_b = (_a = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBorderedRef.value) !== null && _a !== void 0 ? _a : options.defaultBordered) !== null && _b !== void 0 ? _b : true;
|
|
3782
4092
|
}),
|
|
3783
|
-
mergedClsPrefixRef:
|
|
3784
|
-
namespaceRef: computed(() =>
|
|
4093
|
+
mergedClsPrefixRef: NConfigProvider ? NConfigProvider.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
|
|
4094
|
+
namespaceRef: computed(() => NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedNamespaceRef.value)
|
|
3785
4095
|
};
|
|
3786
4096
|
}
|
|
3787
4097
|
function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
3788
4098
|
if (!cssVarsRef) throwError("useThemeClass", "cssVarsRef is not passed");
|
|
3789
|
-
const
|
|
3790
|
-
const mergedThemeHashRef =
|
|
3791
|
-
const styleMountTarget =
|
|
4099
|
+
const NConfigProvider = inject(configProviderInjectionKey, null);
|
|
4100
|
+
const mergedThemeHashRef = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeHashRef;
|
|
4101
|
+
const styleMountTarget = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget;
|
|
3792
4102
|
const themeClassRef = ref("");
|
|
3793
4103
|
const ssrAdapter2 = useSsrAdapter();
|
|
3794
4104
|
let renderCallback;
|
|
@@ -5133,7 +5443,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
|
|
|
5133
5443
|
}
|
|
5134
5444
|
return componentRtlState;
|
|
5135
5445
|
});
|
|
5136
|
-
const
|
|
5446
|
+
const NConfigProvider = inject(configProviderInjectionKey, null);
|
|
5137
5447
|
const mountStyle = () => {
|
|
5138
5448
|
watchEffect(() => {
|
|
5139
5449
|
const {
|
|
@@ -5153,7 +5463,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
|
|
|
5153
5463
|
bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
|
|
5154
5464
|
},
|
|
5155
5465
|
ssr: ssrAdapter2,
|
|
5156
|
-
parent:
|
|
5466
|
+
parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
|
|
5157
5467
|
});
|
|
5158
5468
|
});
|
|
5159
5469
|
};
|
|
@@ -5211,7 +5521,7 @@ function createTheme(theme) {
|
|
|
5211
5521
|
}
|
|
5212
5522
|
function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
|
|
5213
5523
|
const ssrAdapter2 = useSsrAdapter();
|
|
5214
|
-
const
|
|
5524
|
+
const NConfigProvider = inject(configProviderInjectionKey, null);
|
|
5215
5525
|
if (style2) {
|
|
5216
5526
|
const mountStyle = () => {
|
|
5217
5527
|
const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
|
|
@@ -5223,15 +5533,15 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
|
|
|
5223
5533
|
},
|
|
5224
5534
|
anchorMetaName: cssrAnchorMetaName,
|
|
5225
5535
|
ssr: ssrAdapter2,
|
|
5226
|
-
parent:
|
|
5536
|
+
parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
|
|
5227
5537
|
});
|
|
5228
|
-
if (!(
|
|
5538
|
+
if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
|
|
5229
5539
|
globalStyle.mount({
|
|
5230
5540
|
id: "n-global",
|
|
5231
5541
|
head: true,
|
|
5232
5542
|
anchorMetaName: cssrAnchorMetaName,
|
|
5233
5543
|
ssr: ssrAdapter2,
|
|
5234
|
-
parent:
|
|
5544
|
+
parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
|
|
5235
5545
|
});
|
|
5236
5546
|
}
|
|
5237
5547
|
};
|
|
@@ -5263,11 +5573,11 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
|
|
|
5263
5573
|
self: globalSelf = void 0,
|
|
5264
5574
|
peers: globalPeers = {}
|
|
5265
5575
|
} = {}
|
|
5266
|
-
} = (
|
|
5576
|
+
} = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeRef.value) || {};
|
|
5267
5577
|
const {
|
|
5268
5578
|
common: globalCommonOverrides = void 0,
|
|
5269
5579
|
[resolveId]: globalSelfOverrides = {}
|
|
5270
|
-
} = (
|
|
5580
|
+
} = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeOverridesRef.value) || {};
|
|
5271
5581
|
const {
|
|
5272
5582
|
common: globalSelfCommonOverrides,
|
|
5273
5583
|
peers: globalPeersOverrides = {}
|
|
@@ -8025,209 +8335,6 @@ const NPopover = defineComponent({
|
|
|
8025
8335
|
});
|
|
8026
8336
|
}
|
|
8027
8337
|
});
|
|
8028
|
-
const configProviderProps = {
|
|
8029
|
-
abstract: Boolean,
|
|
8030
|
-
bordered: {
|
|
8031
|
-
type: Boolean,
|
|
8032
|
-
default: void 0
|
|
8033
|
-
},
|
|
8034
|
-
clsPrefix: String,
|
|
8035
|
-
locale: Object,
|
|
8036
|
-
dateLocale: Object,
|
|
8037
|
-
namespace: String,
|
|
8038
|
-
rtl: Array,
|
|
8039
|
-
tag: {
|
|
8040
|
-
type: String,
|
|
8041
|
-
default: "div"
|
|
8042
|
-
},
|
|
8043
|
-
hljs: Object,
|
|
8044
|
-
katex: Object,
|
|
8045
|
-
theme: Object,
|
|
8046
|
-
themeOverrides: Object,
|
|
8047
|
-
componentOptions: Object,
|
|
8048
|
-
icons: Object,
|
|
8049
|
-
breakpoints: Object,
|
|
8050
|
-
preflightStyleDisabled: Boolean,
|
|
8051
|
-
styleMountTarget: Object,
|
|
8052
|
-
inlineThemeDisabled: {
|
|
8053
|
-
type: Boolean,
|
|
8054
|
-
default: void 0
|
|
8055
|
-
},
|
|
8056
|
-
// deprecated
|
|
8057
|
-
as: {
|
|
8058
|
-
type: String,
|
|
8059
|
-
validator: () => {
|
|
8060
|
-
warn("config-provider", "`as` is deprecated, please use `tag` instead.");
|
|
8061
|
-
return true;
|
|
8062
|
-
},
|
|
8063
|
-
default: void 0
|
|
8064
|
-
}
|
|
8065
|
-
};
|
|
8066
|
-
const NConfigProvider = defineComponent({
|
|
8067
|
-
name: "ConfigProvider",
|
|
8068
|
-
alias: ["App"],
|
|
8069
|
-
props: configProviderProps,
|
|
8070
|
-
setup(props) {
|
|
8071
|
-
const NConfigProvider2 = inject(configProviderInjectionKey, null);
|
|
8072
|
-
const mergedThemeRef = computed(() => {
|
|
8073
|
-
const {
|
|
8074
|
-
theme
|
|
8075
|
-
} = props;
|
|
8076
|
-
if (theme === null) return void 0;
|
|
8077
|
-
const inheritedTheme = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value;
|
|
8078
|
-
return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
|
|
8079
|
-
});
|
|
8080
|
-
const mergedThemeOverridesRef = computed(() => {
|
|
8081
|
-
const {
|
|
8082
|
-
themeOverrides
|
|
8083
|
-
} = props;
|
|
8084
|
-
if (themeOverrides === null) return void 0;
|
|
8085
|
-
if (themeOverrides === void 0) {
|
|
8086
|
-
return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
|
|
8087
|
-
} else {
|
|
8088
|
-
const inheritedThemeOverrides = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
|
|
8089
|
-
if (inheritedThemeOverrides === void 0) {
|
|
8090
|
-
return themeOverrides;
|
|
8091
|
-
} else {
|
|
8092
|
-
return merge$1({}, inheritedThemeOverrides, themeOverrides);
|
|
8093
|
-
}
|
|
8094
|
-
}
|
|
8095
|
-
});
|
|
8096
|
-
const mergedNamespaceRef = useMemo(() => {
|
|
8097
|
-
const {
|
|
8098
|
-
namespace: namespace2
|
|
8099
|
-
} = props;
|
|
8100
|
-
return namespace2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value : namespace2;
|
|
8101
|
-
});
|
|
8102
|
-
const mergedBorderedRef = useMemo(() => {
|
|
8103
|
-
const {
|
|
8104
|
-
bordered
|
|
8105
|
-
} = props;
|
|
8106
|
-
return bordered === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value : bordered;
|
|
8107
|
-
});
|
|
8108
|
-
const mergedIconsRef = computed(() => {
|
|
8109
|
-
const {
|
|
8110
|
-
icons
|
|
8111
|
-
} = props;
|
|
8112
|
-
return icons === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedIconsRef.value : icons;
|
|
8113
|
-
});
|
|
8114
|
-
const mergedComponentPropsRef = computed(() => {
|
|
8115
|
-
const {
|
|
8116
|
-
componentOptions
|
|
8117
|
-
} = props;
|
|
8118
|
-
if (componentOptions !== void 0) return componentOptions;
|
|
8119
|
-
return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef.value;
|
|
8120
|
-
});
|
|
8121
|
-
const mergedClsPrefixRef = computed(() => {
|
|
8122
|
-
const {
|
|
8123
|
-
clsPrefix
|
|
8124
|
-
} = props;
|
|
8125
|
-
if (clsPrefix !== void 0) return clsPrefix;
|
|
8126
|
-
if (NConfigProvider2) return NConfigProvider2.mergedClsPrefixRef.value;
|
|
8127
|
-
return defaultClsPrefix;
|
|
8128
|
-
});
|
|
8129
|
-
const mergedRtlRef = computed(() => {
|
|
8130
|
-
var _a;
|
|
8131
|
-
const {
|
|
8132
|
-
rtl
|
|
8133
|
-
} = props;
|
|
8134
|
-
if (rtl === void 0) {
|
|
8135
|
-
return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef.value;
|
|
8136
|
-
}
|
|
8137
|
-
const rtlEnabledState = {};
|
|
8138
|
-
for (const rtlInfo of rtl) {
|
|
8139
|
-
rtlEnabledState[rtlInfo.name] = markRaw(rtlInfo);
|
|
8140
|
-
(_a = rtlInfo.peers) === null || _a === void 0 ? void 0 : _a.forEach((peerRtlInfo) => {
|
|
8141
|
-
if (!(peerRtlInfo.name in rtlEnabledState)) {
|
|
8142
|
-
rtlEnabledState[peerRtlInfo.name] = markRaw(peerRtlInfo);
|
|
8143
|
-
}
|
|
8144
|
-
});
|
|
8145
|
-
}
|
|
8146
|
-
return rtlEnabledState;
|
|
8147
|
-
});
|
|
8148
|
-
const mergedBreakpointsRef = computed(() => {
|
|
8149
|
-
return props.breakpoints || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef.value);
|
|
8150
|
-
});
|
|
8151
|
-
const inlineThemeDisabled = props.inlineThemeDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled);
|
|
8152
|
-
const preflightStyleDisabled = props.preflightStyleDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled);
|
|
8153
|
-
const styleMountTarget = props.styleMountTarget || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget);
|
|
8154
|
-
const mergedThemeHashRef = computed(() => {
|
|
8155
|
-
const {
|
|
8156
|
-
value: theme
|
|
8157
|
-
} = mergedThemeRef;
|
|
8158
|
-
const {
|
|
8159
|
-
value: mergedThemeOverrides
|
|
8160
|
-
} = mergedThemeOverridesRef;
|
|
8161
|
-
const hasThemeOverrides = mergedThemeOverrides && Object.keys(mergedThemeOverrides).length !== 0;
|
|
8162
|
-
const themeName = theme === null || theme === void 0 ? void 0 : theme.name;
|
|
8163
|
-
if (themeName) {
|
|
8164
|
-
if (hasThemeOverrides) {
|
|
8165
|
-
return `${themeName}-${murmur2(JSON.stringify(mergedThemeOverridesRef.value))}`;
|
|
8166
|
-
}
|
|
8167
|
-
return themeName;
|
|
8168
|
-
} else {
|
|
8169
|
-
if (hasThemeOverrides) {
|
|
8170
|
-
return murmur2(JSON.stringify(mergedThemeOverridesRef.value));
|
|
8171
|
-
}
|
|
8172
|
-
return "";
|
|
8173
|
-
}
|
|
8174
|
-
});
|
|
8175
|
-
provide(configProviderInjectionKey, {
|
|
8176
|
-
mergedThemeHashRef,
|
|
8177
|
-
mergedBreakpointsRef,
|
|
8178
|
-
mergedRtlRef,
|
|
8179
|
-
mergedIconsRef,
|
|
8180
|
-
mergedComponentPropsRef,
|
|
8181
|
-
mergedBorderedRef,
|
|
8182
|
-
mergedNamespaceRef,
|
|
8183
|
-
mergedClsPrefixRef,
|
|
8184
|
-
mergedLocaleRef: computed(() => {
|
|
8185
|
-
const {
|
|
8186
|
-
locale
|
|
8187
|
-
} = props;
|
|
8188
|
-
if (locale === null) return void 0;
|
|
8189
|
-
return locale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedLocaleRef.value : locale;
|
|
8190
|
-
}),
|
|
8191
|
-
mergedDateLocaleRef: computed(() => {
|
|
8192
|
-
const {
|
|
8193
|
-
dateLocale
|
|
8194
|
-
} = props;
|
|
8195
|
-
if (dateLocale === null) return void 0;
|
|
8196
|
-
return dateLocale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedDateLocaleRef.value : dateLocale;
|
|
8197
|
-
}),
|
|
8198
|
-
mergedHljsRef: computed(() => {
|
|
8199
|
-
const {
|
|
8200
|
-
hljs
|
|
8201
|
-
} = props;
|
|
8202
|
-
return hljs === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value : hljs;
|
|
8203
|
-
}),
|
|
8204
|
-
mergedKatexRef: computed(() => {
|
|
8205
|
-
const {
|
|
8206
|
-
katex
|
|
8207
|
-
} = props;
|
|
8208
|
-
return katex === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedKatexRef.value : katex;
|
|
8209
|
-
}),
|
|
8210
|
-
mergedThemeRef,
|
|
8211
|
-
mergedThemeOverridesRef,
|
|
8212
|
-
inlineThemeDisabled: inlineThemeDisabled || false,
|
|
8213
|
-
preflightStyleDisabled: preflightStyleDisabled || false,
|
|
8214
|
-
styleMountTarget
|
|
8215
|
-
});
|
|
8216
|
-
return {
|
|
8217
|
-
mergedClsPrefix: mergedClsPrefixRef,
|
|
8218
|
-
mergedBordered: mergedBorderedRef,
|
|
8219
|
-
mergedNamespace: mergedNamespaceRef,
|
|
8220
|
-
mergedTheme: mergedThemeRef,
|
|
8221
|
-
mergedThemeOverrides: mergedThemeOverridesRef
|
|
8222
|
-
};
|
|
8223
|
-
},
|
|
8224
|
-
render() {
|
|
8225
|
-
var _a, _b, _c, _d;
|
|
8226
|
-
return !this.abstract ? h(this.as || this.tag, {
|
|
8227
|
-
class: `${this.mergedClsPrefix || defaultClsPrefix}-config-provider`
|
|
8228
|
-
}, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)) : (_d = (_c = this.$slots).default) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
8229
|
-
}
|
|
8230
|
-
});
|
|
8231
8338
|
const commonVariables = {
|
|
8232
8339
|
padding: "4px 0",
|
|
8233
8340
|
optionIconSizeSmall: "14px",
|
|
@@ -9525,496 +9632,186 @@ const NDropdown = defineComponent({
|
|
|
9525
9632
|
mergedClsPrefix,
|
|
9526
9633
|
menuProps
|
|
9527
9634
|
} = this;
|
|
9528
|
-
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
9529
|
-
const menuNodeProps = (menuProps === null || menuProps === void 0 ? void 0 : menuProps(void 0, this.tmNodes.map((v) => v.rawNode))) || {};
|
|
9530
|
-
const dropdownProps2 = {
|
|
9531
|
-
ref: createRefSetter(ref2),
|
|
9532
|
-
class: [className, `${mergedClsPrefix}-dropdown`, this.themeClass],
|
|
9533
|
-
clsPrefix: mergedClsPrefix,
|
|
9534
|
-
tmNodes: this.tmNodes,
|
|
9535
|
-
style: [...style2, this.cssVars],
|
|
9536
|
-
showArrow: this.showArrow,
|
|
9537
|
-
arrowStyle: this.arrowStyle,
|
|
9538
|
-
scrollable: this.scrollable,
|
|
9539
|
-
onMouseenter,
|
|
9540
|
-
onMouseleave
|
|
9541
|
-
};
|
|
9542
|
-
return h(NDropdownMenu, mergeProps(this.$attrs, dropdownProps2, menuNodeProps));
|
|
9543
|
-
};
|
|
9544
|
-
const {
|
|
9545
|
-
mergedTheme
|
|
9546
|
-
} = this;
|
|
9547
|
-
const popoverProps2 = {
|
|
9548
|
-
show: this.mergedShow,
|
|
9549
|
-
theme: mergedTheme.peers.Popover,
|
|
9550
|
-
themeOverrides: mergedTheme.peerOverrides.Popover,
|
|
9551
|
-
internalOnAfterLeave: this.handleAfterLeave,
|
|
9552
|
-
internalRenderBody: renderPopoverBody,
|
|
9553
|
-
onUpdateShow: this.doUpdateShow,
|
|
9554
|
-
"onUpdate:show": void 0
|
|
9555
|
-
};
|
|
9556
|
-
return h(NPopover, Object.assign({}, keep(this.$props, popoverPropKeys), popoverProps2), {
|
|
9557
|
-
trigger: () => {
|
|
9558
|
-
var _a, _b;
|
|
9559
|
-
return (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
9560
|
-
}
|
|
9561
|
-
});
|
|
9562
|
-
}
|
|
9563
|
-
});
|
|
9564
|
-
const messageApiInjectionKey = createInjectionKey("n-message-api");
|
|
9565
|
-
function useMessage() {
|
|
9566
|
-
const api = inject(messageApiInjectionKey, null);
|
|
9567
|
-
if (api === null) {
|
|
9568
|
-
throwError("use-message", "No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A.");
|
|
9569
|
-
}
|
|
9570
|
-
return api;
|
|
9571
|
-
}
|
|
9572
|
-
function self$1(vars) {
|
|
9573
|
-
const {
|
|
9574
|
-
heightSmall,
|
|
9575
|
-
heightMedium,
|
|
9576
|
-
heightLarge,
|
|
9577
|
-
borderRadius
|
|
9578
|
-
} = vars;
|
|
9579
|
-
return {
|
|
9580
|
-
color: "#eee",
|
|
9581
|
-
colorEnd: "#ddd",
|
|
9582
|
-
borderRadius,
|
|
9583
|
-
heightSmall,
|
|
9584
|
-
heightMedium,
|
|
9585
|
-
heightLarge
|
|
9586
|
-
};
|
|
9587
|
-
}
|
|
9588
|
-
const skeletonLight = {
|
|
9589
|
-
common: derived,
|
|
9590
|
-
self: self$1
|
|
9591
|
-
};
|
|
9592
|
-
const style = c$1([cB("skeleton", `
|
|
9593
|
-
height: 1em;
|
|
9594
|
-
width: 100%;
|
|
9595
|
-
transition:
|
|
9596
|
-
--n-color-start .3s var(--n-bezier),
|
|
9597
|
-
--n-color-end .3s var(--n-bezier),
|
|
9598
|
-
background-color .3s var(--n-bezier);
|
|
9599
|
-
animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
|
|
9600
|
-
background-color: var(--n-color-start);
|
|
9601
|
-
`), c$1("@keyframes skeleton-loading", `
|
|
9602
|
-
0% {
|
|
9603
|
-
background: var(--n-color-start);
|
|
9604
|
-
}
|
|
9605
|
-
40% {
|
|
9606
|
-
background: var(--n-color-end);
|
|
9607
|
-
}
|
|
9608
|
-
80% {
|
|
9609
|
-
background: var(--n-color-start);
|
|
9610
|
-
}
|
|
9611
|
-
100% {
|
|
9612
|
-
background: var(--n-color-start);
|
|
9613
|
-
}
|
|
9614
|
-
`)]);
|
|
9615
|
-
const skeletonProps = Object.assign(Object.assign({}, useTheme.props), {
|
|
9616
|
-
text: Boolean,
|
|
9617
|
-
round: Boolean,
|
|
9618
|
-
circle: Boolean,
|
|
9619
|
-
height: [String, Number],
|
|
9620
|
-
width: [String, Number],
|
|
9621
|
-
size: String,
|
|
9622
|
-
repeat: {
|
|
9623
|
-
type: Number,
|
|
9624
|
-
default: 1
|
|
9625
|
-
},
|
|
9626
|
-
animated: {
|
|
9627
|
-
type: Boolean,
|
|
9628
|
-
default: true
|
|
9629
|
-
},
|
|
9630
|
-
sharp: {
|
|
9631
|
-
type: Boolean,
|
|
9632
|
-
default: true
|
|
9633
|
-
}
|
|
9634
|
-
});
|
|
9635
|
-
const NSkeleton = defineComponent({
|
|
9636
|
-
name: "Skeleton",
|
|
9637
|
-
inheritAttrs: false,
|
|
9638
|
-
props: skeletonProps,
|
|
9639
|
-
setup(props) {
|
|
9640
|
-
useHoudini();
|
|
9641
|
-
const {
|
|
9642
|
-
mergedClsPrefixRef
|
|
9643
|
-
} = useConfig(props);
|
|
9644
|
-
const themeRef = useTheme("Skeleton", "-skeleton", style, skeletonLight, props, mergedClsPrefixRef);
|
|
9645
|
-
return {
|
|
9646
|
-
mergedClsPrefix: mergedClsPrefixRef,
|
|
9647
|
-
style: computed(() => {
|
|
9648
|
-
var _a, _b;
|
|
9649
|
-
const theme = themeRef.value;
|
|
9650
|
-
const {
|
|
9651
|
-
common: {
|
|
9652
|
-
cubicBezierEaseInOut: cubicBezierEaseInOut2
|
|
9653
|
-
}
|
|
9654
|
-
} = theme;
|
|
9655
|
-
const selfThemeVars = theme.self;
|
|
9656
|
-
const {
|
|
9657
|
-
color,
|
|
9658
|
-
colorEnd,
|
|
9659
|
-
borderRadius
|
|
9660
|
-
} = selfThemeVars;
|
|
9661
|
-
let sizeHeight;
|
|
9662
|
-
const {
|
|
9663
|
-
circle,
|
|
9664
|
-
sharp,
|
|
9665
|
-
round,
|
|
9666
|
-
width,
|
|
9667
|
-
height,
|
|
9668
|
-
size: size2,
|
|
9669
|
-
text,
|
|
9670
|
-
animated
|
|
9671
|
-
} = props;
|
|
9672
|
-
if (size2 !== void 0) {
|
|
9673
|
-
sizeHeight = selfThemeVars[createKey("height", size2)];
|
|
9674
|
-
}
|
|
9675
|
-
const mergedWidth = circle ? (_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : sizeHeight : width;
|
|
9676
|
-
const mergedHeight = (_b = circle ? width !== null && width !== void 0 ? width : height : height) !== null && _b !== void 0 ? _b : sizeHeight;
|
|
9677
|
-
return {
|
|
9678
|
-
display: text ? "inline-block" : "",
|
|
9679
|
-
verticalAlign: text ? "-0.125em" : "",
|
|
9680
|
-
borderRadius: circle ? "50%" : round ? "4096px" : sharp ? "" : borderRadius,
|
|
9681
|
-
width: typeof mergedWidth === "number" ? pxfy(mergedWidth) : mergedWidth,
|
|
9682
|
-
height: typeof mergedHeight === "number" ? pxfy(mergedHeight) : mergedHeight,
|
|
9683
|
-
animation: !animated ? "none" : "",
|
|
9684
|
-
"--n-bezier": cubicBezierEaseInOut2,
|
|
9685
|
-
"--n-color-start": color,
|
|
9686
|
-
"--n-color-end": colorEnd
|
|
9687
|
-
};
|
|
9688
|
-
})
|
|
9689
|
-
};
|
|
9690
|
-
},
|
|
9691
|
-
render() {
|
|
9692
|
-
const {
|
|
9693
|
-
repeat: repeatProp,
|
|
9694
|
-
style: style2,
|
|
9695
|
-
mergedClsPrefix,
|
|
9696
|
-
$attrs
|
|
9697
|
-
} = this;
|
|
9698
|
-
const child = h("div", mergeProps({
|
|
9699
|
-
class: `${mergedClsPrefix}-skeleton`,
|
|
9700
|
-
style: style2
|
|
9701
|
-
}, $attrs));
|
|
9702
|
-
if (repeatProp > 1) {
|
|
9703
|
-
return h(Fragment, null, repeat(repeatProp, null).map((_) => [child, "\n"]));
|
|
9704
|
-
}
|
|
9705
|
-
return child;
|
|
9706
|
-
}
|
|
9707
|
-
});
|
|
9708
|
-
const _hoisted_1$4 = { class: "toolbar-icon" };
|
|
9709
|
-
const _hoisted_2$3 = ["innerHTML"];
|
|
9710
|
-
const _sfc_main$5 = {
|
|
9711
|
-
__name: "ToolbarButtonIcon",
|
|
9712
|
-
props: {
|
|
9713
|
-
name: {
|
|
9714
|
-
type: String,
|
|
9715
|
-
required: true
|
|
9716
|
-
},
|
|
9717
|
-
color: {
|
|
9718
|
-
type: String,
|
|
9719
|
-
default: null
|
|
9720
|
-
},
|
|
9721
|
-
icon: {
|
|
9722
|
-
type: String,
|
|
9723
|
-
default: null
|
|
9724
|
-
}
|
|
9725
|
-
},
|
|
9726
|
-
setup(__props) {
|
|
9727
|
-
const props = __props;
|
|
9728
|
-
const getBarColor = computed(() => {
|
|
9729
|
-
if (props.name === "color") return { backgroundColor: props.color || "#111111" };
|
|
9730
|
-
if (props.name === "highlight") return { backgroundColor: props.color || "#D6D6D6" };
|
|
9731
|
-
});
|
|
9732
|
-
const hasColorBar = computed(() => {
|
|
9733
|
-
return ["color", "highlight"].includes(props.name);
|
|
9734
|
-
});
|
|
9735
|
-
return (_ctx, _cache) => {
|
|
9736
|
-
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
9737
|
-
createElementVNode("div", {
|
|
9738
|
-
class: normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
|
|
9739
|
-
innerHTML: __props.icon
|
|
9740
|
-
}, null, 10, _hoisted_2$3),
|
|
9741
|
-
hasColorBar.value ? (openBlock(), createElementBlock("div", {
|
|
9742
|
-
key: 0,
|
|
9743
|
-
class: "color-bar",
|
|
9744
|
-
style: normalizeStyle(getBarColor.value)
|
|
9745
|
-
}, null, 4)) : createCommentVNode("", true)
|
|
9746
|
-
]);
|
|
9747
|
-
};
|
|
9748
|
-
}
|
|
9749
|
-
};
|
|
9750
|
-
const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-6d7523ab"]]);
|
|
9751
|
-
const _hoisted_1$3 = ["role", "aria-label", "onKeydown"];
|
|
9752
|
-
const _hoisted_2$2 = ["data-item"];
|
|
9753
|
-
const _hoisted_3$2 = {
|
|
9754
|
-
key: 1,
|
|
9755
|
-
class: "button-label"
|
|
9756
|
-
};
|
|
9757
|
-
const _hoisted_4$1 = { key: 2 };
|
|
9758
|
-
const _hoisted_5 = ["onKeydown", "id"];
|
|
9759
|
-
const _hoisted_6 = ["placeholder", "onKeydown", "id"];
|
|
9760
|
-
const _hoisted_7 = ["innerHTML"];
|
|
9761
|
-
const _hoisted_8 = {
|
|
9762
|
-
"aria-live": "polite",
|
|
9763
|
-
class: "visually-hidden"
|
|
9764
|
-
};
|
|
9765
|
-
const _sfc_main$4 = {
|
|
9766
|
-
__name: "ToolbarButton",
|
|
9767
|
-
props: {
|
|
9768
|
-
iconColor: {
|
|
9769
|
-
type: String,
|
|
9770
|
-
default: null
|
|
9771
|
-
},
|
|
9772
|
-
active: {
|
|
9773
|
-
type: Boolean,
|
|
9774
|
-
default: false
|
|
9775
|
-
},
|
|
9776
|
-
isNarrow: {
|
|
9777
|
-
type: Boolean,
|
|
9778
|
-
default: false
|
|
9779
|
-
},
|
|
9780
|
-
isWide: {
|
|
9781
|
-
type: Boolean,
|
|
9782
|
-
default: false
|
|
9783
|
-
},
|
|
9784
|
-
toolbarItem: {
|
|
9785
|
-
type: Object,
|
|
9786
|
-
required: true
|
|
9787
|
-
},
|
|
9788
|
-
defaultLabel: {
|
|
9789
|
-
type: String,
|
|
9790
|
-
default: null
|
|
9791
|
-
},
|
|
9792
|
-
isOverflowItem: {
|
|
9793
|
-
type: Boolean,
|
|
9794
|
-
default: false
|
|
9795
|
-
}
|
|
9796
|
-
},
|
|
9797
|
-
emits: ["buttonClick", "textSubmit"],
|
|
9798
|
-
setup(__props, { emit: __emit }) {
|
|
9799
|
-
const emit = __emit;
|
|
9800
|
-
const props = __props;
|
|
9801
|
-
const {
|
|
9802
|
-
name,
|
|
9803
|
-
active,
|
|
9804
|
-
icon,
|
|
9805
|
-
label,
|
|
9806
|
-
hideLabel,
|
|
9807
|
-
iconColor,
|
|
9808
|
-
hasCaret,
|
|
9809
|
-
disabled,
|
|
9810
|
-
inlineTextInputVisible,
|
|
9811
|
-
hasInlineTextInput,
|
|
9812
|
-
minWidth,
|
|
9813
|
-
style: style2,
|
|
9814
|
-
attributes
|
|
9815
|
-
} = props.toolbarItem;
|
|
9816
|
-
const inlineTextInput = ref(label);
|
|
9817
|
-
const inlineInput = ref(null);
|
|
9818
|
-
const { isHighContrastMode } = useHighContrastMode();
|
|
9819
|
-
const handleClick = () => {
|
|
9820
|
-
if (hasInlineTextInput) {
|
|
9821
|
-
nextTick(() => {
|
|
9822
|
-
inlineInput.value?.focus();
|
|
9823
|
-
inlineInput.value?.select();
|
|
9824
|
-
});
|
|
9825
|
-
}
|
|
9826
|
-
emit("buttonClick");
|
|
9827
|
-
};
|
|
9828
|
-
const handleInputSubmit = () => {
|
|
9829
|
-
const value = inlineTextInput.value;
|
|
9830
|
-
const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
|
|
9831
|
-
emit("textSubmit", cleanValue);
|
|
9832
|
-
inlineTextInput.value = cleanValue;
|
|
9833
|
-
};
|
|
9834
|
-
const getStyle = computed(() => {
|
|
9835
|
-
if (style2.value) return style2.value;
|
|
9836
|
-
return {
|
|
9837
|
-
minWidth: props.minWidth
|
|
9838
|
-
};
|
|
9839
|
-
});
|
|
9840
|
-
const caretIcon = computed(() => {
|
|
9841
|
-
return active.value ? toolbarIcons.dropdownCaretUp : toolbarIcons.dropdownCaretDown;
|
|
9842
|
-
});
|
|
9843
|
-
return (_ctx, _cache) => {
|
|
9844
|
-
return openBlock(), createElementBlock("div", {
|
|
9845
|
-
class: normalizeClass(["toolbar-item", unref(attributes).className]),
|
|
9846
|
-
style: normalizeStyle(getStyle.value),
|
|
9847
|
-
role: __props.isOverflowItem ? "menuitem" : "button",
|
|
9848
|
-
"aria-label": unref(attributes).ariaLabel,
|
|
9849
|
-
onClick: handleClick,
|
|
9850
|
-
onKeydown: withKeys(withModifiers(handleClick, ["stop"]), ["enter"]),
|
|
9851
|
-
tabindex: "0"
|
|
9852
|
-
}, [
|
|
9853
|
-
createElementVNode("div", {
|
|
9854
|
-
class: normalizeClass(["toolbar-button", {
|
|
9855
|
-
active: unref(active),
|
|
9856
|
-
disabled: unref(disabled),
|
|
9857
|
-
narrow: __props.isNarrow,
|
|
9858
|
-
wide: __props.isWide,
|
|
9859
|
-
"has-inline-text-input": unref(hasInlineTextInput),
|
|
9860
|
-
"high-contrast": unref(isHighContrastMode)
|
|
9861
|
-
}]),
|
|
9862
|
-
"data-item": `btn-${unref(name) || ""}`
|
|
9863
|
-
}, [
|
|
9864
|
-
unref(icon) ? (openBlock(), createBlock(ToolbarButtonIcon, {
|
|
9865
|
-
key: 0,
|
|
9866
|
-
color: unref(iconColor),
|
|
9867
|
-
class: "toolbar-icon",
|
|
9868
|
-
icon: unref(icon),
|
|
9869
|
-
name: unref(name)
|
|
9870
|
-
}, null, 8, ["color", "icon", "name"])) : createCommentVNode("", true),
|
|
9871
|
-
unref(label) && !unref(hideLabel) && !unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("div", _hoisted_3$2, toDisplayString(unref(label)), 1)) : createCommentVNode("", true),
|
|
9872
|
-
unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
|
|
9873
|
-
unref(name) === "fontSize" ? withDirectives((openBlock(), createElementBlock("input", {
|
|
9874
|
-
key: 0,
|
|
9875
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
|
|
9876
|
-
onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
9877
|
-
type: "text",
|
|
9878
|
-
class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode) }]),
|
|
9879
|
-
id: "inlineTextInput-" + unref(name),
|
|
9880
|
-
autocomplete: "off",
|
|
9881
|
-
ref_key: "inlineInput",
|
|
9882
|
-
ref: inlineInput
|
|
9883
|
-
}, null, 42, _hoisted_5)), [
|
|
9884
|
-
[vModelText, inlineTextInput.value]
|
|
9885
|
-
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
9886
|
-
key: 1,
|
|
9887
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inlineTextInput.value = $event),
|
|
9888
|
-
placeholder: unref(label),
|
|
9889
|
-
onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
9890
|
-
type: "text",
|
|
9891
|
-
class: "button-text-input",
|
|
9892
|
-
id: "inlineTextInput-" + unref(name),
|
|
9893
|
-
autocomplete: "off",
|
|
9894
|
-
ref_key: "inlineInput",
|
|
9895
|
-
ref: inlineInput
|
|
9896
|
-
}, null, 40, _hoisted_6)), [
|
|
9897
|
-
[vModelText, inlineTextInput.value]
|
|
9898
|
-
])
|
|
9899
|
-
])) : createCommentVNode("", true),
|
|
9900
|
-
unref(hasCaret) ? (openBlock(), createElementBlock("div", {
|
|
9901
|
-
key: 3,
|
|
9902
|
-
class: "dropdown-caret",
|
|
9903
|
-
innerHTML: caretIcon.value,
|
|
9904
|
-
style: normalizeStyle({ opacity: unref(disabled) ? 0.6 : 1 })
|
|
9905
|
-
}, null, 12, _hoisted_7)) : createCommentVNode("", true),
|
|
9906
|
-
createElementVNode("div", _hoisted_8, toDisplayString(`${unref(attributes).ariaLabel} ${unref(active) ? "selected" : "unset"}`), 1)
|
|
9907
|
-
], 10, _hoisted_2$2)
|
|
9908
|
-
], 46, _hoisted_1$3);
|
|
9909
|
-
};
|
|
9910
|
-
}
|
|
9911
|
-
};
|
|
9912
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ea93b080"]]);
|
|
9913
|
-
const _hoisted_1$2 = {
|
|
9914
|
-
class: "toolbar-separator",
|
|
9915
|
-
role: "separator",
|
|
9916
|
-
"aria-label": "Toolbar separator"
|
|
9917
|
-
};
|
|
9918
|
-
const _sfc_main$3 = {
|
|
9919
|
-
__name: "ToolbarSeparator",
|
|
9920
|
-
props: {
|
|
9921
|
-
active: {
|
|
9922
|
-
type: Boolean,
|
|
9923
|
-
default: false
|
|
9924
|
-
}
|
|
9925
|
-
},
|
|
9926
|
-
emits: ["command"],
|
|
9927
|
-
setup(__props, { emit: __emit }) {
|
|
9928
|
-
const { isHighContrastMode } = useHighContrastMode();
|
|
9929
|
-
const getSeparatorColor = () => {
|
|
9930
|
-
if (isHighContrastMode.value) {
|
|
9931
|
-
return "#000";
|
|
9932
|
-
}
|
|
9933
|
-
return "#dbdbdb";
|
|
9635
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
9636
|
+
const menuNodeProps = (menuProps === null || menuProps === void 0 ? void 0 : menuProps(void 0, this.tmNodes.map((v) => v.rawNode))) || {};
|
|
9637
|
+
const dropdownProps2 = {
|
|
9638
|
+
ref: createRefSetter(ref2),
|
|
9639
|
+
class: [className, `${mergedClsPrefix}-dropdown`, this.themeClass],
|
|
9640
|
+
clsPrefix: mergedClsPrefix,
|
|
9641
|
+
tmNodes: this.tmNodes,
|
|
9642
|
+
style: [...style2, this.cssVars],
|
|
9643
|
+
showArrow: this.showArrow,
|
|
9644
|
+
arrowStyle: this.arrowStyle,
|
|
9645
|
+
scrollable: this.scrollable,
|
|
9646
|
+
onMouseenter,
|
|
9647
|
+
onMouseleave
|
|
9648
|
+
};
|
|
9649
|
+
return h(NDropdownMenu, mergeProps(this.$attrs, dropdownProps2, menuNodeProps));
|
|
9934
9650
|
};
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9651
|
+
const {
|
|
9652
|
+
mergedTheme
|
|
9653
|
+
} = this;
|
|
9654
|
+
const popoverProps2 = {
|
|
9655
|
+
show: this.mergedShow,
|
|
9656
|
+
theme: mergedTheme.peers.Popover,
|
|
9657
|
+
themeOverrides: mergedTheme.peerOverrides.Popover,
|
|
9658
|
+
internalOnAfterLeave: this.handleAfterLeave,
|
|
9659
|
+
internalRenderBody: renderPopoverBody,
|
|
9660
|
+
onUpdateShow: this.doUpdateShow,
|
|
9661
|
+
"onUpdate:show": void 0
|
|
9942
9662
|
};
|
|
9663
|
+
return h(NPopover, Object.assign({}, keep(this.$props, popoverPropKeys), popoverProps2), {
|
|
9664
|
+
trigger: () => {
|
|
9665
|
+
var _a, _b;
|
|
9666
|
+
return (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
9667
|
+
}
|
|
9668
|
+
});
|
|
9943
9669
|
}
|
|
9670
|
+
});
|
|
9671
|
+
const messageApiInjectionKey = createInjectionKey("n-message-api");
|
|
9672
|
+
function useMessage() {
|
|
9673
|
+
const api = inject(messageApiInjectionKey, null);
|
|
9674
|
+
if (api === null) {
|
|
9675
|
+
throwError("use-message", "No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A.");
|
|
9676
|
+
}
|
|
9677
|
+
return api;
|
|
9678
|
+
}
|
|
9679
|
+
function self$1(vars) {
|
|
9680
|
+
const {
|
|
9681
|
+
heightSmall,
|
|
9682
|
+
heightMedium,
|
|
9683
|
+
heightLarge,
|
|
9684
|
+
borderRadius
|
|
9685
|
+
} = vars;
|
|
9686
|
+
return {
|
|
9687
|
+
color: "#eee",
|
|
9688
|
+
colorEnd: "#ddd",
|
|
9689
|
+
borderRadius,
|
|
9690
|
+
heightSmall,
|
|
9691
|
+
heightMedium,
|
|
9692
|
+
heightLarge
|
|
9693
|
+
};
|
|
9694
|
+
}
|
|
9695
|
+
const skeletonLight = {
|
|
9696
|
+
common: derived,
|
|
9697
|
+
self: self$1
|
|
9944
9698
|
};
|
|
9945
|
-
const
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9699
|
+
const style = c$1([cB("skeleton", `
|
|
9700
|
+
height: 1em;
|
|
9701
|
+
width: 100%;
|
|
9702
|
+
transition:
|
|
9703
|
+
--n-color-start .3s var(--n-bezier),
|
|
9704
|
+
--n-color-end .3s var(--n-bezier),
|
|
9705
|
+
background-color .3s var(--n-bezier);
|
|
9706
|
+
animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
|
|
9707
|
+
background-color: var(--n-color-start);
|
|
9708
|
+
`), c$1("@keyframes skeleton-loading", `
|
|
9709
|
+
0% {
|
|
9710
|
+
background: var(--n-color-start);
|
|
9711
|
+
}
|
|
9712
|
+
40% {
|
|
9713
|
+
background: var(--n-color-end);
|
|
9714
|
+
}
|
|
9715
|
+
80% {
|
|
9716
|
+
background: var(--n-color-start);
|
|
9717
|
+
}
|
|
9718
|
+
100% {
|
|
9719
|
+
background: var(--n-color-start);
|
|
9720
|
+
}
|
|
9721
|
+
`)]);
|
|
9722
|
+
const skeletonProps = Object.assign(Object.assign({}, useTheme.props), {
|
|
9723
|
+
text: Boolean,
|
|
9724
|
+
round: Boolean,
|
|
9725
|
+
circle: Boolean,
|
|
9726
|
+
height: [String, Number],
|
|
9727
|
+
width: [String, Number],
|
|
9728
|
+
size: String,
|
|
9729
|
+
repeat: {
|
|
9730
|
+
type: Number,
|
|
9731
|
+
default: 1
|
|
9964
9732
|
},
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9733
|
+
animated: {
|
|
9734
|
+
type: Boolean,
|
|
9735
|
+
default: true
|
|
9736
|
+
},
|
|
9737
|
+
sharp: {
|
|
9738
|
+
type: Boolean,
|
|
9739
|
+
default: true
|
|
9740
|
+
}
|
|
9741
|
+
});
|
|
9742
|
+
const NSkeleton = defineComponent({
|
|
9743
|
+
name: "Skeleton",
|
|
9744
|
+
inheritAttrs: false,
|
|
9745
|
+
props: skeletonProps,
|
|
9746
|
+
setup(props) {
|
|
9747
|
+
useHoudini();
|
|
9748
|
+
const {
|
|
9749
|
+
mergedClsPrefixRef
|
|
9750
|
+
} = useConfig(props);
|
|
9751
|
+
const themeRef = useTheme("Skeleton", "-skeleton", style, skeletonLight, props, mergedClsPrefixRef);
|
|
9752
|
+
return {
|
|
9753
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
9754
|
+
style: computed(() => {
|
|
9755
|
+
var _a, _b;
|
|
9756
|
+
const theme = themeRef.value;
|
|
9757
|
+
const {
|
|
9758
|
+
common: {
|
|
9759
|
+
cubicBezierEaseInOut: cubicBezierEaseInOut2
|
|
9760
|
+
}
|
|
9761
|
+
} = theme;
|
|
9762
|
+
const selfThemeVars = theme.self;
|
|
9763
|
+
const {
|
|
9764
|
+
color,
|
|
9765
|
+
colorEnd,
|
|
9766
|
+
borderRadius
|
|
9767
|
+
} = selfThemeVars;
|
|
9768
|
+
let sizeHeight;
|
|
9769
|
+
const {
|
|
9770
|
+
circle,
|
|
9771
|
+
sharp,
|
|
9772
|
+
round,
|
|
9773
|
+
width,
|
|
9774
|
+
height,
|
|
9775
|
+
size: size2,
|
|
9776
|
+
text,
|
|
9777
|
+
animated
|
|
9778
|
+
} = props;
|
|
9779
|
+
if (size2 !== void 0) {
|
|
9780
|
+
sizeHeight = selfThemeVars[createKey("height", size2)];
|
|
9987
9781
|
}
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
}, null, 8, ["toolbar-item"])
|
|
10003
|
-
]),
|
|
10004
|
-
isOverflowMenuOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
10005
|
-
createVNode(ButtonGroup, {
|
|
10006
|
-
class: "superdoc-toolbar-overflow",
|
|
10007
|
-
"toolbar-items": __props.overflowItems,
|
|
10008
|
-
"from-overflow": "",
|
|
10009
|
-
onCommand: handleCommand,
|
|
10010
|
-
onDropdownUpdateShow: _cache[0] || (_cache[0] = ($event) => hasOpenDropdown.value = $event)
|
|
10011
|
-
}, null, 8, ["toolbar-items"])
|
|
10012
|
-
])) : createCommentVNode("", true)
|
|
10013
|
-
]);
|
|
9782
|
+
const mergedWidth = circle ? (_a = width !== null && width !== void 0 ? width : height) !== null && _a !== void 0 ? _a : sizeHeight : width;
|
|
9783
|
+
const mergedHeight = (_b = circle ? width !== null && width !== void 0 ? width : height : height) !== null && _b !== void 0 ? _b : sizeHeight;
|
|
9784
|
+
return {
|
|
9785
|
+
display: text ? "inline-block" : "",
|
|
9786
|
+
verticalAlign: text ? "-0.125em" : "",
|
|
9787
|
+
borderRadius: circle ? "50%" : round ? "4096px" : sharp ? "" : borderRadius,
|
|
9788
|
+
width: typeof mergedWidth === "number" ? pxfy(mergedWidth) : mergedWidth,
|
|
9789
|
+
height: typeof mergedHeight === "number" ? pxfy(mergedHeight) : mergedHeight,
|
|
9790
|
+
animation: !animated ? "none" : "",
|
|
9791
|
+
"--n-bezier": cubicBezierEaseInOut2,
|
|
9792
|
+
"--n-color-start": color,
|
|
9793
|
+
"--n-color-end": colorEnd
|
|
9794
|
+
};
|
|
9795
|
+
})
|
|
10014
9796
|
};
|
|
9797
|
+
},
|
|
9798
|
+
render() {
|
|
9799
|
+
const {
|
|
9800
|
+
repeat: repeatProp,
|
|
9801
|
+
style: style2,
|
|
9802
|
+
mergedClsPrefix,
|
|
9803
|
+
$attrs
|
|
9804
|
+
} = this;
|
|
9805
|
+
const child = h("div", mergeProps({
|
|
9806
|
+
class: `${mergedClsPrefix}-skeleton`,
|
|
9807
|
+
style: style2
|
|
9808
|
+
}, $attrs));
|
|
9809
|
+
if (repeatProp > 1) {
|
|
9810
|
+
return h(Fragment, null, repeat(repeatProp, null).map((_) => [child, "\n"]));
|
|
9811
|
+
}
|
|
9812
|
+
return child;
|
|
10015
9813
|
}
|
|
10016
|
-
};
|
|
10017
|
-
const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ef28da92"]]);
|
|
9814
|
+
});
|
|
10018
9815
|
const _hoisted_1 = ["onKeydown", "tabindex", "data-item-id"];
|
|
10019
9816
|
const _hoisted_2 = { key: 0 };
|
|
10020
9817
|
const _hoisted_3 = { key: 0 };
|
|
@@ -10030,16 +9827,6 @@ const _sfc_main$1 = {
|
|
|
10030
9827
|
type: Array,
|
|
10031
9828
|
default: () => []
|
|
10032
9829
|
},
|
|
10033
|
-
/**
|
|
10034
|
-
* The font-family to use for UI elements like dropdowns and tooltips.
|
|
10035
|
-
* This ensures consistent typography across toolbar UI components.
|
|
10036
|
-
* @type {string}
|
|
10037
|
-
* @default 'Arial, Helvetica, sans-serif'
|
|
10038
|
-
*/
|
|
10039
|
-
uiFontFamily: {
|
|
10040
|
-
type: String,
|
|
10041
|
-
default: "Arial, Helvetica, sans-serif"
|
|
10042
|
-
},
|
|
10043
9830
|
position: {
|
|
10044
9831
|
type: String,
|
|
10045
9832
|
default: "left"
|
|
@@ -10232,7 +10019,6 @@ const _sfc_main$1 = {
|
|
|
10232
10019
|
options: dropdownOptions(item),
|
|
10233
10020
|
trigger: item.disabled.value ? null : "click",
|
|
10234
10021
|
show: item.expand.value,
|
|
10235
|
-
"content-style": { fontFamily: props.uiFontFamily },
|
|
10236
10022
|
size: "medium",
|
|
10237
10023
|
placement: "bottom-start",
|
|
10238
10024
|
class: normalizeClass(["toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown", { "high-contrast": unref(isHighContrastMode) }]),
|
|
@@ -10240,16 +10026,14 @@ const _sfc_main$1 = {
|
|
|
10240
10026
|
onUpdateShow: handleDropdownUpdateShow,
|
|
10241
10027
|
style: normalizeStyle(item.dropdownStyles.value),
|
|
10242
10028
|
"menu-props": () => ({
|
|
10243
|
-
role: "menu"
|
|
10244
|
-
style: { fontFamily: props.uiFontFamily }
|
|
10029
|
+
role: "menu"
|
|
10245
10030
|
}),
|
|
10246
10031
|
"node-props": (option) => getDropdownAttributes(option, item)
|
|
10247
10032
|
}, {
|
|
10248
10033
|
default: withCtx(() => [
|
|
10249
10034
|
createVNode(unref(NTooltip), {
|
|
10250
10035
|
trigger: "hover",
|
|
10251
|
-
disabled: !item.tooltip?.value
|
|
10252
|
-
"content-style": { fontFamily: props.uiFontFamily }
|
|
10036
|
+
disabled: !item.tooltip?.value
|
|
10253
10037
|
}, {
|
|
10254
10038
|
trigger: withCtx(() => [
|
|
10255
10039
|
createVNode(ToolbarButton, {
|
|
@@ -10266,14 +10050,13 @@ const _sfc_main$1 = {
|
|
|
10266
10050
|
])
|
|
10267
10051
|
]),
|
|
10268
10052
|
_: 2
|
|
10269
|
-
}, 1032, ["disabled"
|
|
10053
|
+
}, 1032, ["disabled"])
|
|
10270
10054
|
]),
|
|
10271
10055
|
_: 2
|
|
10272
|
-
}, 1032, ["options", "trigger", "show", "
|
|
10056
|
+
}, 1032, ["options", "trigger", "show", "class", "onSelect", "style", "node-props"])) : isButton(item) ? (openBlock(), createBlock(unref(NTooltip), {
|
|
10273
10057
|
key: 2,
|
|
10274
10058
|
trigger: "hover",
|
|
10275
|
-
class: "sd-editor-toolbar-tooltip"
|
|
10276
|
-
"content-style": { fontFamily: props.uiFontFamily }
|
|
10059
|
+
class: "sd-editor-toolbar-tooltip"
|
|
10277
10060
|
}, {
|
|
10278
10061
|
trigger: withCtx(() => [
|
|
10279
10062
|
createVNode(ToolbarButton, {
|
|
@@ -10290,7 +10073,7 @@ const _sfc_main$1 = {
|
|
|
10290
10073
|
])) : createCommentVNode("", true)
|
|
10291
10074
|
]),
|
|
10292
10075
|
_: 2
|
|
10293
|
-
},
|
|
10076
|
+
}, 1024)) : createCommentVNode("", true),
|
|
10294
10077
|
isOverflow(item) && __props.overflowItems.length ? (openBlock(), createBlock(OverflowMenu, {
|
|
10295
10078
|
key: 3,
|
|
10296
10079
|
"toolbar-item": item,
|
|
@@ -10304,21 +10087,13 @@ const _sfc_main$1 = {
|
|
|
10304
10087
|
};
|
|
10305
10088
|
}
|
|
10306
10089
|
};
|
|
10307
|
-
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
10308
|
-
const DEFAULT_UI_FONT_FAMILY = "Arial, Helvetica, sans-serif";
|
|
10090
|
+
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c80a1e51"]]);
|
|
10309
10091
|
const _sfc_main = {
|
|
10310
10092
|
__name: "Toolbar",
|
|
10311
10093
|
emits: ["command", "toggle", "select"],
|
|
10312
10094
|
setup(__props, { emit: __emit }) {
|
|
10313
10095
|
const { proxy } = getCurrentInstance();
|
|
10314
10096
|
let toolbarKey = ref(1);
|
|
10315
|
-
const uiFontFamily = computed(() => {
|
|
10316
|
-
const configured = proxy?.$toolbar?.config?.uiDisplayFallbackFont;
|
|
10317
|
-
if (typeof configured === "string" && configured.trim()) {
|
|
10318
|
-
return configured.trim();
|
|
10319
|
-
}
|
|
10320
|
-
return DEFAULT_UI_FONT_FAMILY;
|
|
10321
|
-
});
|
|
10322
10097
|
const showLeftSide = proxy.$toolbar.config?.toolbarGroups?.includes("left");
|
|
10323
10098
|
const showRightSide = proxy.$toolbar.config?.toolbarGroups?.includes("right");
|
|
10324
10099
|
const excludeButtonsList = proxy.$toolbar.config?.toolbarButtonsExclude || [];
|
|
@@ -10365,48 +10140,37 @@ const _sfc_main = {
|
|
|
10365
10140
|
"aria-label": "Toolbar",
|
|
10366
10141
|
"data-editor-ui-surface": ""
|
|
10367
10142
|
}, [
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
tabindex: "0",
|
|
10395
|
-
"toolbar-items": getFilteredItems("right"),
|
|
10396
|
-
"ui-font-family": uiFontFamily.value,
|
|
10397
|
-
position: "right",
|
|
10398
|
-
onCommand: handleCommand,
|
|
10399
|
-
onItemClicked: restoreSelection,
|
|
10400
|
-
class: "superdoc-toolbar-group-side"
|
|
10401
|
-
}, null, 8, ["toolbar-items", "ui-font-family"])) : createCommentVNode("", true)
|
|
10402
|
-
]),
|
|
10403
|
-
_: 1
|
|
10404
|
-
})
|
|
10143
|
+
unref(showLeftSide) ? (openBlock(), createBlock(ButtonGroup, {
|
|
10144
|
+
key: 0,
|
|
10145
|
+
tabindex: "0",
|
|
10146
|
+
"toolbar-items": getFilteredItems("left"),
|
|
10147
|
+
position: "left",
|
|
10148
|
+
onCommand: handleCommand,
|
|
10149
|
+
onItemClicked: restoreSelection,
|
|
10150
|
+
class: "superdoc-toolbar-group-side"
|
|
10151
|
+
}, null, 8, ["toolbar-items"])) : createCommentVNode("", true),
|
|
10152
|
+
createVNode(ButtonGroup, {
|
|
10153
|
+
tabindex: "0",
|
|
10154
|
+
"toolbar-items": getFilteredItems("center"),
|
|
10155
|
+
"overflow-items": unref(proxy).$toolbar.overflowItems,
|
|
10156
|
+
position: "center",
|
|
10157
|
+
onCommand: handleCommand,
|
|
10158
|
+
onItemClicked: restoreSelection
|
|
10159
|
+
}, null, 8, ["toolbar-items", "overflow-items"]),
|
|
10160
|
+
unref(showRightSide) ? (openBlock(), createBlock(ButtonGroup, {
|
|
10161
|
+
key: 1,
|
|
10162
|
+
tabindex: "0",
|
|
10163
|
+
"toolbar-items": getFilteredItems("right"),
|
|
10164
|
+
position: "right",
|
|
10165
|
+
onCommand: handleCommand,
|
|
10166
|
+
onItemClicked: restoreSelection,
|
|
10167
|
+
class: "superdoc-toolbar-group-side"
|
|
10168
|
+
}, null, 8, ["toolbar-items"])) : createCommentVNode("", true)
|
|
10405
10169
|
]);
|
|
10406
10170
|
};
|
|
10407
10171
|
}
|
|
10408
10172
|
};
|
|
10409
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
10173
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f5ec271"]]);
|
|
10410
10174
|
export {
|
|
10411
10175
|
NSkeleton as N,
|
|
10412
10176
|
Toolbar as T,
|