@harbour-enterprises/superdoc 1.0.0-next.2 → 1.0.0-next.3

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.
Files changed (40) hide show
  1. package/dist/chunks/{PdfViewer-eykNsWyi.es.js → PdfViewer-PUn0q_lG.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-B-xTd4XY.cjs → PdfViewer-cVGt7Ne7.cjs} +1 -1
  3. package/dist/chunks/{eventemitter3-CcXAdeql.es.js → eventemitter3-44XulWQe.es.js} +1 -1
  4. package/dist/chunks/{index-BDVXUeCy-Di6ozaOM.cjs → index-DLO-SgUP-BNtYQDPq.cjs} +1 -1
  5. package/dist/chunks/{index-BDVXUeCy-7mwhYeJ7.es.js → index-DLO-SgUP-c73otQJ5.es.js} +1 -1
  6. package/dist/chunks/{index-rF5HExWB.cjs → index-Djmhr-R6.cjs} +465 -228
  7. package/dist/chunks/{index-DpQ8ZYM0.es.js → index-mHanL4xN.es.js} +468 -231
  8. package/dist/chunks/{jszip-5vvIqAEE.es.js → jszip-VP334ufO.es.js} +1 -1
  9. package/dist/chunks/{super-editor.es-CcKbh84I.cjs → super-editor.es-Cve8WKfM.cjs} +619 -379
  10. package/dist/chunks/{super-editor.es-CxajnL9u.es.js → super-editor.es-S9Kp_7dy.es.js} +620 -380
  11. package/dist/chunks/{vue-Dysv_7z5.es.js → vue-BuPTonTJ.es.js} +27 -27
  12. package/dist/chunks/xml-js-LkEmUa9-.es.js +2 -0
  13. package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts +42 -0
  14. package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts.map +1 -0
  15. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +3 -3
  16. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  17. package/dist/packages/superdoc/src/core/types/index.d.ts +4 -167
  18. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  19. package/dist/style.css +88 -86
  20. package/dist/super-editor/ai-writer.es.js +3 -3
  21. package/dist/super-editor/chunks/{converter-DN_dhslo.js → converter-ByybZRFp.js} +1 -1
  22. package/dist/super-editor/chunks/{docx-zipper-Bhl_yBjL.js → docx-zipper-CFQANTLI.js} +1 -1
  23. package/dist/super-editor/chunks/{editor-3klx7hyV.js → editor-Cu4hD14N.js} +16 -16
  24. package/dist/super-editor/chunks/{index-BDVXUeCy.js → index-DLO-SgUP.js} +1 -1
  25. package/dist/super-editor/chunks/{toolbar-8YA9ltNC.js → toolbar-5MMla0sj.js} +804 -568
  26. package/dist/super-editor/converter.es.js +1 -1
  27. package/dist/super-editor/docx-zipper.es.js +2 -2
  28. package/dist/super-editor/editor.es.js +3 -3
  29. package/dist/super-editor/file-zipper.es.js +1 -1
  30. package/dist/super-editor/style.css +22 -21
  31. package/dist/super-editor/super-editor.es.js +10 -6
  32. package/dist/super-editor/toolbar.es.js +2 -2
  33. package/dist/super-editor.cjs +1 -1
  34. package/dist/super-editor.es.js +2 -2
  35. package/dist/superdoc.cjs +2 -2
  36. package/dist/superdoc.es.js +2 -2
  37. package/dist/superdoc.umd.js +1082 -605
  38. package/dist/superdoc.umd.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunks/xml-js-ClO_jHnq.es.js +0 -2
@@ -1,4 +1,4 @@
1
- import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as getCurrentInstance, p as onDeactivated, q as nextTick, s as createBlock, u as createVNode, v as unref, x as normalizeStyle, y as defineComponent, z as h, A as mergeProps, B as shallowRef, C as withCtx, D as createTextVNode, E as toRef, G as provide, H as cloneVNode, T as Text$2, I as withDirectives, J as watchEffect, K as vModelText, L as withKeys, M as reactive, N as readonly, O as Transition, P as vShow, Q as Comment, R as renderSlot, S as onActivated, U as Teleport, V as isVNode, W as onUnmounted, X as markRaw, Y as resolveDynamicComponent, Z as normalizeProps, _ as guardReactiveProps, $ as useCssVars } from "./vue-Dysv_7z5.es.js";
1
+ import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as getCurrentInstance, p as onDeactivated, q as nextTick, s as createVNode, u as withCtx, v as createBlock, x as unref, y as defineComponent, z as normalizeStyle, A as h, B as mergeProps, C as shallowRef, D as markRaw, E as provide, G as createTextVNode, H as toRef, I as cloneVNode, T as Text$2, J as withDirectives, K as watchEffect, L as vModelText, M as withKeys, N as reactive, O as readonly, P as Transition, Q as vShow, R as Comment, S as renderSlot, U as onActivated, V as Teleport, W as isVNode, X as onUnmounted, Y as resolveDynamicComponent, Z as normalizeProps, _ as guardReactiveProps, $ as useCssVars } from "./vue-BuPTonTJ.es.js";
2
2
  import * as Y from "yjs";
3
3
  import { UndoManager, Item as Item$2, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
4
4
  var __defProp$2 = Object.defineProperty;
@@ -42410,7 +42410,7 @@ const _SuperConverter = class _SuperConverter2 {
42410
42410
  static getStoredSuperdocVersion(docx) {
42411
42411
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42412
42412
  }
42413
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.2") {
42413
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.3") {
42414
42414
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42415
42415
  }
42416
42416
  /**
@@ -58549,28 +58549,28 @@ const setImageNodeSelection = (view, pos) => {
58549
58549
  }
58550
58550
  return false;
58551
58551
  };
58552
- function canRenderFont(fontName, fallbackFont = "sans-serif") {
58553
- const _canRenderFont = (fontName2, fallbackFont2) => {
58552
+ function canRenderFont(fontName, uiDisplayFallbackFont = "sans-serif") {
58553
+ const _canRenderFont = (fontName2, uiDisplayFallbackFont2) => {
58554
58554
  const canvas2 = document.createElement("canvas");
58555
58555
  const ctx2 = canvas2.getContext("2d");
58556
58556
  ctx2.textBaseline = "top";
58557
58557
  const text = "abcdefghijklmnopqrstuvwxyz0123456789";
58558
- ctx2.font = `72px ${fallbackFont2}`;
58558
+ ctx2.font = `72px ${uiDisplayFallbackFont2}`;
58559
58559
  const initialTextMeasurement = ctx2.measureText(text);
58560
58560
  const fallbackWidth = initialTextMeasurement.width;
58561
58561
  const fallbackHeight = initialTextMeasurement.actualBoundingBoxDescent;
58562
- ctx2.font = `72px "${fontName2}", ${fallbackFont2}`;
58562
+ ctx2.font = `72px "${fontName2}", ${uiDisplayFallbackFont2}`;
58563
58563
  const customTextMeasurement = ctx2.measureText(text);
58564
58564
  const customFontWidth = customTextMeasurement.width;
58565
58565
  const customFontHeight = customTextMeasurement.actualBoundingBoxDescent;
58566
58566
  const isAvailable = customFontWidth !== fallbackWidth || customFontHeight !== fallbackHeight;
58567
58567
  return isAvailable;
58568
58568
  };
58569
- if (_canRenderFont(fontName, fallbackFont)) {
58569
+ if (_canRenderFont(fontName, uiDisplayFallbackFont)) {
58570
58570
  return true;
58571
58571
  }
58572
- const oppositeFallbackFont = fallbackFont === "sans-serif" ? "serif" : "sans-serif";
58573
- return _canRenderFont(fontName, oppositeFallbackFont);
58572
+ const oppositeUiDisplayFallbackFont = uiDisplayFallbackFont === "sans-serif" ? "serif" : "sans-serif";
58573
+ return _canRenderFont(fontName, oppositeUiDisplayFallbackFont);
58574
58574
  }
58575
58575
  const { findChildren: findChildren$3 } = helpers;
58576
58576
  function getAllFieldAnnotations(state2) {
@@ -59638,7 +59638,7 @@ const isHeadless = (editor) => {
59638
59638
  const shouldSkipNodeView = (editor) => {
59639
59639
  return isHeadless(editor);
59640
59640
  };
59641
- const summaryVersion = "1.0.0-next.2";
59641
+ const summaryVersion = "1.0.0-next.3";
59642
59642
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59643
59643
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59644
59644
  function mapAttributes(attrs) {
@@ -60427,7 +60427,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60427
60427
  { default: remarkStringify },
60428
60428
  { default: remarkGfm }
60429
60429
  ] = await Promise.all([
60430
- import("./index-BDVXUeCy-7mwhYeJ7.es.js"),
60430
+ import("./index-DLO-SgUP-c73otQJ5.es.js"),
60431
60431
  import("./index-DRCvimau-Cw339678.es.js"),
60432
60432
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
60433
60433
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60632,7 +60632,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60632
60632
  * Process collaboration migrations
60633
60633
  */
60634
60634
  processCollaborationMigrations() {
60635
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.2");
60635
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.3");
60636
60636
  if (!this.options.ydoc) return;
60637
60637
  const metaMap = this.options.ydoc.getMap("meta");
60638
60638
  let docVersion = metaMap.get("version");
@@ -68362,9 +68362,9 @@ const extractFirstTextRunFont = (para) => {
68362
68362
  const font = findFirstTextFont(para.content);
68363
68363
  return font;
68364
68364
  };
68365
- const applyBaseRunDefaults = (run2, defaults, fallbackFont, fallbackSize) => {
68365
+ const applyBaseRunDefaults = (run2, defaults, uiDisplayFallbackFont, fallbackSize) => {
68366
68366
  if (!run2) return;
68367
- if (defaults.fontFamily && run2.fontFamily === fallbackFont) {
68367
+ if (defaults.fontFamily && run2.fontFamily === uiDisplayFallbackFont) {
68368
68368
  run2.fontFamily = defaults.fontFamily;
68369
68369
  }
68370
68370
  if (defaults.fontSizePx != null && run2.fontSize === fallbackSize) {
@@ -86201,8 +86201,8 @@ async function measureParagraphBlock(block, maxWidth) {
86201
86201
  }
86202
86202
  }
86203
86203
  if (!currentLine && lines.length === 0) {
86204
- const fallbackFontSize = (block.runs[0]?.kind === "text" ? block.runs[0].fontSize : void 0) ?? 12;
86205
- const metrics = calculateTypographyMetrics(fallbackFontSize, spacing);
86204
+ const uiDisplayFallbackFontSize = (block.runs[0]?.kind === "text" ? block.runs[0].fontSize : void 0) ?? 12;
86205
+ const metrics = calculateTypographyMetrics(uiDisplayFallbackFontSize, spacing);
86206
86206
  const fallbackLine = {
86207
86207
  fromRun: 0,
86208
86208
  fromChar: 0,
@@ -110839,316 +110839,6 @@ const toolbarIcons = {
110839
110839
  paste: pasteIconSvg,
110840
110840
  strikethrough: strikethroughSvg
110841
110841
  };
110842
- const _hoisted_1$4$1 = { class: "toolbar-icon" };
110843
- const _hoisted_2$3$1 = ["innerHTML"];
110844
- const _sfc_main$5$1 = {
110845
- __name: "ToolbarButtonIcon",
110846
- props: {
110847
- name: {
110848
- type: String,
110849
- required: true
110850
- },
110851
- color: {
110852
- type: String,
110853
- default: null
110854
- },
110855
- icon: {
110856
- type: String,
110857
- default: null
110858
- }
110859
- },
110860
- setup(__props) {
110861
- const props = __props;
110862
- const getBarColor = computed(() => {
110863
- if (props.name === "color") return { backgroundColor: props.color || "#111111" };
110864
- if (props.name === "highlight") return { backgroundColor: props.color || "#D6D6D6" };
110865
- });
110866
- const hasColorBar = computed(() => {
110867
- return ["color", "highlight"].includes(props.name);
110868
- });
110869
- return (_ctx, _cache) => {
110870
- return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
110871
- createBaseVNode("div", {
110872
- class: normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
110873
- innerHTML: __props.icon
110874
- }, null, 10, _hoisted_2$3$1),
110875
- hasColorBar.value ? (openBlock(), createElementBlock("div", {
110876
- key: 0,
110877
- class: "color-bar",
110878
- style: normalizeStyle(getBarColor.value)
110879
- }, null, 4)) : createCommentVNode("", true)
110880
- ]);
110881
- };
110882
- }
110883
- };
110884
- const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5$1, [["__scopeId", "data-v-6d7523ab"]]);
110885
- const _hoisted_1$3$1 = ["role", "aria-label", "onKeydown"];
110886
- const _hoisted_2$2$1 = ["data-item"];
110887
- const _hoisted_3$2$1 = {
110888
- key: 1,
110889
- class: "button-label"
110890
- };
110891
- const _hoisted_4$1$1 = { key: 2 };
110892
- const _hoisted_5$4 = ["onKeydown", "id"];
110893
- const _hoisted_6$2 = ["placeholder", "onKeydown", "id"];
110894
- const _hoisted_7$1 = ["innerHTML"];
110895
- const _hoisted_8$1 = {
110896
- "aria-live": "polite",
110897
- class: "visually-hidden"
110898
- };
110899
- const _sfc_main$4$1 = {
110900
- __name: "ToolbarButton",
110901
- props: {
110902
- iconColor: {
110903
- type: String,
110904
- default: null
110905
- },
110906
- active: {
110907
- type: Boolean,
110908
- default: false
110909
- },
110910
- isNarrow: {
110911
- type: Boolean,
110912
- default: false
110913
- },
110914
- isWide: {
110915
- type: Boolean,
110916
- default: false
110917
- },
110918
- toolbarItem: {
110919
- type: Object,
110920
- required: true
110921
- },
110922
- defaultLabel: {
110923
- type: String,
110924
- default: null
110925
- },
110926
- isOverflowItem: {
110927
- type: Boolean,
110928
- default: false
110929
- }
110930
- },
110931
- emits: ["buttonClick", "textSubmit"],
110932
- setup(__props, { emit: __emit }) {
110933
- const emit = __emit;
110934
- const props = __props;
110935
- const {
110936
- name,
110937
- active,
110938
- icon,
110939
- label,
110940
- hideLabel,
110941
- iconColor,
110942
- hasCaret,
110943
- disabled,
110944
- inlineTextInputVisible,
110945
- hasInlineTextInput,
110946
- minWidth,
110947
- style: style2,
110948
- attributes
110949
- } = props.toolbarItem;
110950
- const inlineTextInput = ref$1(label);
110951
- const inlineInput = ref$1(null);
110952
- const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
110953
- const handleClick2 = () => {
110954
- if (hasInlineTextInput) {
110955
- nextTick(() => {
110956
- inlineInput.value?.focus();
110957
- inlineInput.value?.select();
110958
- });
110959
- }
110960
- emit("buttonClick");
110961
- };
110962
- const handleInputSubmit = () => {
110963
- const value = inlineTextInput.value;
110964
- const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
110965
- emit("textSubmit", cleanValue);
110966
- inlineTextInput.value = cleanValue;
110967
- };
110968
- const getStyle = computed(() => {
110969
- if (style2.value) return style2.value;
110970
- return {
110971
- minWidth: props.minWidth
110972
- };
110973
- });
110974
- const caretIcon = computed(() => {
110975
- return active.value ? toolbarIcons.dropdownCaretUp : toolbarIcons.dropdownCaretDown;
110976
- });
110977
- return (_ctx, _cache) => {
110978
- return openBlock(), createElementBlock("div", {
110979
- class: normalizeClass(["toolbar-item", unref(attributes).className]),
110980
- style: normalizeStyle(getStyle.value),
110981
- role: __props.isOverflowItem ? "menuitem" : "button",
110982
- "aria-label": unref(attributes).ariaLabel,
110983
- onClick: handleClick2,
110984
- onKeydown: withKeys(withModifiers(handleClick2, ["stop"]), ["enter"]),
110985
- tabindex: "0"
110986
- }, [
110987
- createBaseVNode("div", {
110988
- class: normalizeClass(["toolbar-button", {
110989
- active: unref(active),
110990
- disabled: unref(disabled),
110991
- narrow: __props.isNarrow,
110992
- wide: __props.isWide,
110993
- "has-inline-text-input": unref(hasInlineTextInput),
110994
- "high-contrast": unref(isHighContrastMode2)
110995
- }]),
110996
- "data-item": `btn-${unref(name) || ""}`
110997
- }, [
110998
- unref(icon) ? (openBlock(), createBlock(ToolbarButtonIcon, {
110999
- key: 0,
111000
- color: unref(iconColor),
111001
- class: "toolbar-icon",
111002
- icon: unref(icon),
111003
- name: unref(name)
111004
- }, null, 8, ["color", "icon", "name"])) : createCommentVNode("", true),
111005
- unref(label) && !unref(hideLabel) && !unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("div", _hoisted_3$2$1, toDisplayString(unref(label)), 1)) : createCommentVNode("", true),
111006
- unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("span", _hoisted_4$1$1, [
111007
- unref(name) === "fontSize" ? withDirectives((openBlock(), createElementBlock("input", {
111008
- key: 0,
111009
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
111010
- onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
111011
- type: "text",
111012
- class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode2) }]),
111013
- id: "inlineTextInput-" + unref(name),
111014
- autocomplete: "off",
111015
- ref_key: "inlineInput",
111016
- ref: inlineInput
111017
- }, null, 42, _hoisted_5$4)), [
111018
- [vModelText, inlineTextInput.value]
111019
- ]) : withDirectives((openBlock(), createElementBlock("input", {
111020
- key: 1,
111021
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inlineTextInput.value = $event),
111022
- placeholder: unref(label),
111023
- onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
111024
- type: "text",
111025
- class: "button-text-input",
111026
- id: "inlineTextInput-" + unref(name),
111027
- autocomplete: "off",
111028
- ref_key: "inlineInput",
111029
- ref: inlineInput
111030
- }, null, 40, _hoisted_6$2)), [
111031
- [vModelText, inlineTextInput.value]
111032
- ])
111033
- ])) : createCommentVNode("", true),
111034
- unref(hasCaret) ? (openBlock(), createElementBlock("div", {
111035
- key: 3,
111036
- class: "dropdown-caret",
111037
- innerHTML: caretIcon.value,
111038
- style: normalizeStyle({ opacity: unref(disabled) ? 0.6 : 1 })
111039
- }, null, 12, _hoisted_7$1)) : createCommentVNode("", true),
111040
- createBaseVNode("div", _hoisted_8$1, toDisplayString(`${unref(attributes).ariaLabel} ${unref(active) ? "selected" : "unset"}`), 1)
111041
- ], 10, _hoisted_2$2$1)
111042
- ], 46, _hoisted_1$3$1);
111043
- };
111044
- }
111045
- };
111046
- const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-ea93b080"]]);
111047
- const _hoisted_1$2$1 = {
111048
- class: "toolbar-separator",
111049
- role: "separator",
111050
- "aria-label": "Toolbar separator"
111051
- };
111052
- const _sfc_main$3$1 = {
111053
- __name: "ToolbarSeparator",
111054
- props: {
111055
- active: {
111056
- type: Boolean,
111057
- default: false
111058
- }
111059
- },
111060
- emits: ["command"],
111061
- setup(__props, { emit: __emit }) {
111062
- const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
111063
- const getSeparatorColor = () => {
111064
- if (isHighContrastMode2.value) {
111065
- return "#000";
111066
- }
111067
- return "#dbdbdb";
111068
- };
111069
- return (_ctx, _cache) => {
111070
- return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
111071
- createBaseVNode("div", {
111072
- class: "separator-inner",
111073
- style: normalizeStyle({ backgroundColor: getSeparatorColor() })
111074
- }, null, 4)
111075
- ]);
111076
- };
111077
- }
111078
- };
111079
- const ToolbarSeparator = /* @__PURE__ */ _export_sfc(_sfc_main$3$1, [["__scopeId", "data-v-4ef9aa18"]]);
111080
- const _hoisted_1$1$1 = { class: "overflow-menu" };
111081
- const _hoisted_2$1$1 = { class: "overflow-menu-trigger" };
111082
- const _hoisted_3$1$1 = {
111083
- key: 0,
111084
- class: "overflow-menu_items",
111085
- role: "group"
111086
- };
111087
- const _sfc_main$2$1 = {
111088
- __name: "OverflowMenu",
111089
- props: {
111090
- toolbarItem: {
111091
- type: Object,
111092
- required: true
111093
- },
111094
- overflowItems: {
111095
- type: Array,
111096
- required: true
111097
- }
111098
- },
111099
- emits: ["buttonClick", "close"],
111100
- setup(__props, { emit: __emit }) {
111101
- const { proxy } = getCurrentInstance();
111102
- const emit = __emit;
111103
- const props = __props;
111104
- const isOverflowMenuOpened = computed(() => props.toolbarItem.expand.value);
111105
- const hasOpenDropdown = ref$1(false);
111106
- const overflowToolbarItem = computed(() => ({
111107
- ...props.toolbarItem,
111108
- active: isOverflowMenuOpened.value
111109
- }));
111110
- const toggleOverflowMenu = () => {
111111
- emit("buttonClick", props.toolbarItem);
111112
- };
111113
- const handleCommand = ({ item, argument }) => {
111114
- proxy.$toolbar.emitCommand({ item, argument });
111115
- };
111116
- const handleKeyDown2 = (e) => {
111117
- if (e.key === "Escape") {
111118
- if (isOverflowMenuOpened.value && !hasOpenDropdown.value) {
111119
- e.preventDefault();
111120
- emit("close");
111121
- }
111122
- }
111123
- };
111124
- onMounted(() => {
111125
- document.addEventListener("keydown", handleKeyDown2, true);
111126
- });
111127
- onBeforeUnmount(() => {
111128
- document.removeEventListener("keydown", handleKeyDown2, true);
111129
- });
111130
- return (_ctx, _cache) => {
111131
- return openBlock(), createElementBlock("div", _hoisted_1$1$1, [
111132
- createBaseVNode("div", _hoisted_2$1$1, [
111133
- createVNode(ToolbarButton, {
111134
- "toolbar-item": overflowToolbarItem.value,
111135
- onButtonClick: toggleOverflowMenu
111136
- }, null, 8, ["toolbar-item"])
111137
- ]),
111138
- isOverflowMenuOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1$1, [
111139
- createVNode(ButtonGroup, {
111140
- class: "superdoc-toolbar-overflow",
111141
- "toolbar-items": __props.overflowItems,
111142
- "from-overflow": "",
111143
- onCommand: handleCommand,
111144
- onDropdownUpdateShow: _cache[0] || (_cache[0] = ($event) => hasOpenDropdown.value = $event)
111145
- }, null, 8, ["toolbar-items"])
111146
- ])) : createCommentVNode("", true)
111147
- ]);
111148
- };
111149
- }
111150
- };
111151
- const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2$1, [["__scopeId", "data-v-ef28da92"]]);
111152
110842
  function plugin$1(options) {
111153
110843
  let _bPrefix = ".";
111154
110844
  let _ePrefix = "__";
@@ -114759,30 +114449,30 @@ const defaultClsPrefix = "n";
114759
114449
  function useConfig(props = {}, options = {
114760
114450
  defaultBordered: true
114761
114451
  }) {
114762
- const NConfigProvider = inject(configProviderInjectionKey, null);
114452
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
114763
114453
  return {
114764
114454
  // NConfigProvider,
114765
- inlineThemeDisabled: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.inlineThemeDisabled,
114766
- mergedRtlRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef,
114767
- mergedComponentPropsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedComponentPropsRef,
114768
- mergedBreakpointsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBreakpointsRef,
114455
+ inlineThemeDisabled: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled,
114456
+ mergedRtlRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef,
114457
+ mergedComponentPropsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef,
114458
+ mergedBreakpointsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef,
114769
114459
  mergedBorderedRef: computed(() => {
114770
114460
  var _a2, _b2;
114771
114461
  const {
114772
114462
  bordered
114773
114463
  } = props;
114774
114464
  if (bordered !== void 0) return bordered;
114775
- return (_b2 = (_a2 = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBorderedRef.value) !== null && _a2 !== void 0 ? _a2 : options.defaultBordered) !== null && _b2 !== void 0 ? _b2 : true;
114465
+ return (_b2 = (_a2 = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value) !== null && _a2 !== void 0 ? _a2 : options.defaultBordered) !== null && _b2 !== void 0 ? _b2 : true;
114776
114466
  }),
114777
- mergedClsPrefixRef: NConfigProvider ? NConfigProvider.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
114778
- namespaceRef: computed(() => NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedNamespaceRef.value)
114467
+ mergedClsPrefixRef: NConfigProvider2 ? NConfigProvider2.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
114468
+ namespaceRef: computed(() => NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value)
114779
114469
  };
114780
114470
  }
114781
114471
  function useThemeClass(componentName, hashRef, cssVarsRef, props) {
114782
114472
  if (!cssVarsRef) throwError("useThemeClass", "cssVarsRef is not passed");
114783
- const NConfigProvider = inject(configProviderInjectionKey, null);
114784
- const mergedThemeHashRef = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeHashRef;
114785
- const styleMountTarget = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget;
114473
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
114474
+ const mergedThemeHashRef = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeHashRef;
114475
+ const styleMountTarget = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget;
114786
114476
  const themeClassRef = ref$1("");
114787
114477
  const ssrAdapter2 = useSsrAdapter();
114788
114478
  let renderCallback;
@@ -116127,7 +115817,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
116127
115817
  }
116128
115818
  return componentRtlState;
116129
115819
  });
116130
- const NConfigProvider = inject(configProviderInjectionKey, null);
115820
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
116131
115821
  const mountStyle = () => {
116132
115822
  watchEffect(() => {
116133
115823
  const {
@@ -116147,7 +115837,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
116147
115837
  bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
116148
115838
  },
116149
115839
  ssr: ssrAdapter2,
116150
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
115840
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
116151
115841
  });
116152
115842
  });
116153
115843
  };
@@ -116205,7 +115895,7 @@ function createTheme(theme) {
116205
115895
  }
116206
115896
  function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
116207
115897
  const ssrAdapter2 = useSsrAdapter();
116208
- const NConfigProvider = inject(configProviderInjectionKey, null);
115898
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
116209
115899
  if (style2) {
116210
115900
  const mountStyle = () => {
116211
115901
  const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
@@ -116217,15 +115907,15 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
116217
115907
  },
116218
115908
  anchorMetaName: cssrAnchorMetaName,
116219
115909
  ssr: ssrAdapter2,
116220
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
115910
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
116221
115911
  });
116222
- if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
115912
+ if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
116223
115913
  globalStyle.mount({
116224
115914
  id: "n-global",
116225
115915
  head: true,
116226
115916
  anchorMetaName: cssrAnchorMetaName,
116227
115917
  ssr: ssrAdapter2,
116228
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
115918
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
116229
115919
  });
116230
115920
  }
116231
115921
  };
@@ -116257,11 +115947,11 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
116257
115947
  self: globalSelf = void 0,
116258
115948
  peers: globalPeers = {}
116259
115949
  } = {}
116260
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeRef.value) || {};
115950
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value) || {};
116261
115951
  const {
116262
115952
  common: globalCommonOverrides = void 0,
116263
115953
  [resolveId]: globalSelfOverrides = {}
116264
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeOverridesRef.value) || {};
115954
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value) || {};
116265
115955
  const {
116266
115956
  common: globalSelfCommonOverrides,
116267
115957
  peers: globalPeersOverrides = {}
@@ -119019,6 +118709,209 @@ const NPopover = defineComponent({
119019
118709
  });
119020
118710
  }
119021
118711
  });
118712
+ const configProviderProps = {
118713
+ abstract: Boolean,
118714
+ bordered: {
118715
+ type: Boolean,
118716
+ default: void 0
118717
+ },
118718
+ clsPrefix: String,
118719
+ locale: Object,
118720
+ dateLocale: Object,
118721
+ namespace: String,
118722
+ rtl: Array,
118723
+ tag: {
118724
+ type: String,
118725
+ default: "div"
118726
+ },
118727
+ hljs: Object,
118728
+ katex: Object,
118729
+ theme: Object,
118730
+ themeOverrides: Object,
118731
+ componentOptions: Object,
118732
+ icons: Object,
118733
+ breakpoints: Object,
118734
+ preflightStyleDisabled: Boolean,
118735
+ styleMountTarget: Object,
118736
+ inlineThemeDisabled: {
118737
+ type: Boolean,
118738
+ default: void 0
118739
+ },
118740
+ // deprecated
118741
+ as: {
118742
+ type: String,
118743
+ validator: () => {
118744
+ warn("config-provider", "`as` is deprecated, please use `tag` instead.");
118745
+ return true;
118746
+ },
118747
+ default: void 0
118748
+ }
118749
+ };
118750
+ const NConfigProvider = defineComponent({
118751
+ name: "ConfigProvider",
118752
+ alias: ["App"],
118753
+ props: configProviderProps,
118754
+ setup(props) {
118755
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
118756
+ const mergedThemeRef = computed(() => {
118757
+ const {
118758
+ theme
118759
+ } = props;
118760
+ if (theme === null) return void 0;
118761
+ const inheritedTheme = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value;
118762
+ return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
118763
+ });
118764
+ const mergedThemeOverridesRef = computed(() => {
118765
+ const {
118766
+ themeOverrides
118767
+ } = props;
118768
+ if (themeOverrides === null) return void 0;
118769
+ if (themeOverrides === void 0) {
118770
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
118771
+ } else {
118772
+ const inheritedThemeOverrides = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
118773
+ if (inheritedThemeOverrides === void 0) {
118774
+ return themeOverrides;
118775
+ } else {
118776
+ return merge$1({}, inheritedThemeOverrides, themeOverrides);
118777
+ }
118778
+ }
118779
+ });
118780
+ const mergedNamespaceRef = useMemo(() => {
118781
+ const {
118782
+ namespace: namespace2
118783
+ } = props;
118784
+ return namespace2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value : namespace2;
118785
+ });
118786
+ const mergedBorderedRef = useMemo(() => {
118787
+ const {
118788
+ bordered
118789
+ } = props;
118790
+ return bordered === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value : bordered;
118791
+ });
118792
+ const mergedIconsRef = computed(() => {
118793
+ const {
118794
+ icons: icons2
118795
+ } = props;
118796
+ return icons2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedIconsRef.value : icons2;
118797
+ });
118798
+ const mergedComponentPropsRef = computed(() => {
118799
+ const {
118800
+ componentOptions
118801
+ } = props;
118802
+ if (componentOptions !== void 0) return componentOptions;
118803
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef.value;
118804
+ });
118805
+ const mergedClsPrefixRef = computed(() => {
118806
+ const {
118807
+ clsPrefix
118808
+ } = props;
118809
+ if (clsPrefix !== void 0) return clsPrefix;
118810
+ if (NConfigProvider2) return NConfigProvider2.mergedClsPrefixRef.value;
118811
+ return defaultClsPrefix;
118812
+ });
118813
+ const mergedRtlRef = computed(() => {
118814
+ var _a2;
118815
+ const {
118816
+ rtl
118817
+ } = props;
118818
+ if (rtl === void 0) {
118819
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef.value;
118820
+ }
118821
+ const rtlEnabledState = {};
118822
+ for (const rtlInfo of rtl) {
118823
+ rtlEnabledState[rtlInfo.name] = markRaw(rtlInfo);
118824
+ (_a2 = rtlInfo.peers) === null || _a2 === void 0 ? void 0 : _a2.forEach((peerRtlInfo) => {
118825
+ if (!(peerRtlInfo.name in rtlEnabledState)) {
118826
+ rtlEnabledState[peerRtlInfo.name] = markRaw(peerRtlInfo);
118827
+ }
118828
+ });
118829
+ }
118830
+ return rtlEnabledState;
118831
+ });
118832
+ const mergedBreakpointsRef = computed(() => {
118833
+ return props.breakpoints || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef.value);
118834
+ });
118835
+ const inlineThemeDisabled = props.inlineThemeDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled);
118836
+ const preflightStyleDisabled = props.preflightStyleDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled);
118837
+ const styleMountTarget = props.styleMountTarget || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget);
118838
+ const mergedThemeHashRef = computed(() => {
118839
+ const {
118840
+ value: theme
118841
+ } = mergedThemeRef;
118842
+ const {
118843
+ value: mergedThemeOverrides
118844
+ } = mergedThemeOverridesRef;
118845
+ const hasThemeOverrides = mergedThemeOverrides && Object.keys(mergedThemeOverrides).length !== 0;
118846
+ const themeName = theme === null || theme === void 0 ? void 0 : theme.name;
118847
+ if (themeName) {
118848
+ if (hasThemeOverrides) {
118849
+ return `${themeName}-${murmur2(JSON.stringify(mergedThemeOverridesRef.value))}`;
118850
+ }
118851
+ return themeName;
118852
+ } else {
118853
+ if (hasThemeOverrides) {
118854
+ return murmur2(JSON.stringify(mergedThemeOverridesRef.value));
118855
+ }
118856
+ return "";
118857
+ }
118858
+ });
118859
+ provide(configProviderInjectionKey, {
118860
+ mergedThemeHashRef,
118861
+ mergedBreakpointsRef,
118862
+ mergedRtlRef,
118863
+ mergedIconsRef,
118864
+ mergedComponentPropsRef,
118865
+ mergedBorderedRef,
118866
+ mergedNamespaceRef,
118867
+ mergedClsPrefixRef,
118868
+ mergedLocaleRef: computed(() => {
118869
+ const {
118870
+ locale
118871
+ } = props;
118872
+ if (locale === null) return void 0;
118873
+ return locale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedLocaleRef.value : locale;
118874
+ }),
118875
+ mergedDateLocaleRef: computed(() => {
118876
+ const {
118877
+ dateLocale
118878
+ } = props;
118879
+ if (dateLocale === null) return void 0;
118880
+ return dateLocale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedDateLocaleRef.value : dateLocale;
118881
+ }),
118882
+ mergedHljsRef: computed(() => {
118883
+ const {
118884
+ hljs
118885
+ } = props;
118886
+ return hljs === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value : hljs;
118887
+ }),
118888
+ mergedKatexRef: computed(() => {
118889
+ const {
118890
+ katex
118891
+ } = props;
118892
+ return katex === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedKatexRef.value : katex;
118893
+ }),
118894
+ mergedThemeRef,
118895
+ mergedThemeOverridesRef,
118896
+ inlineThemeDisabled: inlineThemeDisabled || false,
118897
+ preflightStyleDisabled: preflightStyleDisabled || false,
118898
+ styleMountTarget
118899
+ });
118900
+ return {
118901
+ mergedClsPrefix: mergedClsPrefixRef,
118902
+ mergedBordered: mergedBorderedRef,
118903
+ mergedNamespace: mergedNamespaceRef,
118904
+ mergedTheme: mergedThemeRef,
118905
+ mergedThemeOverrides: mergedThemeOverridesRef
118906
+ };
118907
+ },
118908
+ render() {
118909
+ var _a2, _b2, _c, _d;
118910
+ return !this.abstract ? h(this.as || this.tag, {
118911
+ class: `${this.mergedClsPrefix || defaultClsPrefix}-config-provider`
118912
+ }, (_b2 = (_a2 = this.$slots).default) === null || _b2 === void 0 ? void 0 : _b2.call(_a2)) : (_d = (_c = this.$slots).default) === null || _d === void 0 ? void 0 : _d.call(_c);
118913
+ }
118914
+ });
119022
118915
  const commonVariables = {
119023
118916
  padding: "4px 0",
119024
118917
  optionIconSizeSmall: "14px",
@@ -120496,6 +120389,316 @@ const NSkeleton = defineComponent({
120496
120389
  return child;
120497
120390
  }
120498
120391
  });
120392
+ const _hoisted_1$4$1 = { class: "toolbar-icon" };
120393
+ const _hoisted_2$3$1 = ["innerHTML"];
120394
+ const _sfc_main$5$1 = {
120395
+ __name: "ToolbarButtonIcon",
120396
+ props: {
120397
+ name: {
120398
+ type: String,
120399
+ required: true
120400
+ },
120401
+ color: {
120402
+ type: String,
120403
+ default: null
120404
+ },
120405
+ icon: {
120406
+ type: String,
120407
+ default: null
120408
+ }
120409
+ },
120410
+ setup(__props) {
120411
+ const props = __props;
120412
+ const getBarColor = computed(() => {
120413
+ if (props.name === "color") return { backgroundColor: props.color || "#111111" };
120414
+ if (props.name === "highlight") return { backgroundColor: props.color || "#D6D6D6" };
120415
+ });
120416
+ const hasColorBar = computed(() => {
120417
+ return ["color", "highlight"].includes(props.name);
120418
+ });
120419
+ return (_ctx, _cache) => {
120420
+ return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
120421
+ createBaseVNode("div", {
120422
+ class: normalizeClass(["toolbar-icon__icon", [`toolbar-icon__icon--${props.name}`]]),
120423
+ innerHTML: __props.icon
120424
+ }, null, 10, _hoisted_2$3$1),
120425
+ hasColorBar.value ? (openBlock(), createElementBlock("div", {
120426
+ key: 0,
120427
+ class: "color-bar",
120428
+ style: normalizeStyle(getBarColor.value)
120429
+ }, null, 4)) : createCommentVNode("", true)
120430
+ ]);
120431
+ };
120432
+ }
120433
+ };
120434
+ const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5$1, [["__scopeId", "data-v-6d7523ab"]]);
120435
+ const _hoisted_1$3$1 = ["role", "aria-label", "onKeydown"];
120436
+ const _hoisted_2$2$1 = ["data-item"];
120437
+ const _hoisted_3$2$1 = {
120438
+ key: 1,
120439
+ class: "button-label"
120440
+ };
120441
+ const _hoisted_4$1$1 = { key: 2 };
120442
+ const _hoisted_5$4 = ["onKeydown", "id"];
120443
+ const _hoisted_6$2 = ["placeholder", "onKeydown", "id"];
120444
+ const _hoisted_7$1 = ["innerHTML"];
120445
+ const _hoisted_8$1 = {
120446
+ "aria-live": "polite",
120447
+ class: "visually-hidden"
120448
+ };
120449
+ const _sfc_main$4$1 = {
120450
+ __name: "ToolbarButton",
120451
+ props: {
120452
+ iconColor: {
120453
+ type: String,
120454
+ default: null
120455
+ },
120456
+ active: {
120457
+ type: Boolean,
120458
+ default: false
120459
+ },
120460
+ isNarrow: {
120461
+ type: Boolean,
120462
+ default: false
120463
+ },
120464
+ isWide: {
120465
+ type: Boolean,
120466
+ default: false
120467
+ },
120468
+ toolbarItem: {
120469
+ type: Object,
120470
+ required: true
120471
+ },
120472
+ defaultLabel: {
120473
+ type: String,
120474
+ default: null
120475
+ },
120476
+ isOverflowItem: {
120477
+ type: Boolean,
120478
+ default: false
120479
+ }
120480
+ },
120481
+ emits: ["buttonClick", "textSubmit"],
120482
+ setup(__props, { emit: __emit }) {
120483
+ const emit = __emit;
120484
+ const props = __props;
120485
+ const {
120486
+ name,
120487
+ active,
120488
+ icon,
120489
+ label,
120490
+ hideLabel,
120491
+ iconColor,
120492
+ hasCaret,
120493
+ disabled,
120494
+ inlineTextInputVisible,
120495
+ hasInlineTextInput,
120496
+ minWidth,
120497
+ style: style2,
120498
+ attributes
120499
+ } = props.toolbarItem;
120500
+ const inlineTextInput = ref$1(label);
120501
+ const inlineInput = ref$1(null);
120502
+ const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
120503
+ const handleClick2 = () => {
120504
+ if (hasInlineTextInput) {
120505
+ nextTick(() => {
120506
+ inlineInput.value?.focus();
120507
+ inlineInput.value?.select();
120508
+ });
120509
+ }
120510
+ emit("buttonClick");
120511
+ };
120512
+ const handleInputSubmit = () => {
120513
+ const value = inlineTextInput.value;
120514
+ const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
120515
+ emit("textSubmit", cleanValue);
120516
+ inlineTextInput.value = cleanValue;
120517
+ };
120518
+ const getStyle = computed(() => {
120519
+ if (style2.value) return style2.value;
120520
+ return {
120521
+ minWidth: props.minWidth
120522
+ };
120523
+ });
120524
+ const caretIcon = computed(() => {
120525
+ return active.value ? toolbarIcons.dropdownCaretUp : toolbarIcons.dropdownCaretDown;
120526
+ });
120527
+ return (_ctx, _cache) => {
120528
+ return openBlock(), createElementBlock("div", {
120529
+ class: normalizeClass(["toolbar-item", unref(attributes).className]),
120530
+ style: normalizeStyle(getStyle.value),
120531
+ role: __props.isOverflowItem ? "menuitem" : "button",
120532
+ "aria-label": unref(attributes).ariaLabel,
120533
+ onClick: handleClick2,
120534
+ onKeydown: withKeys(withModifiers(handleClick2, ["stop"]), ["enter"]),
120535
+ tabindex: "0"
120536
+ }, [
120537
+ createBaseVNode("div", {
120538
+ class: normalizeClass(["toolbar-button", {
120539
+ active: unref(active),
120540
+ disabled: unref(disabled),
120541
+ narrow: __props.isNarrow,
120542
+ wide: __props.isWide,
120543
+ "has-inline-text-input": unref(hasInlineTextInput),
120544
+ "high-contrast": unref(isHighContrastMode2)
120545
+ }]),
120546
+ "data-item": `btn-${unref(name) || ""}`
120547
+ }, [
120548
+ unref(icon) ? (openBlock(), createBlock(ToolbarButtonIcon, {
120549
+ key: 0,
120550
+ color: unref(iconColor),
120551
+ class: "toolbar-icon",
120552
+ icon: unref(icon),
120553
+ name: unref(name)
120554
+ }, null, 8, ["color", "icon", "name"])) : createCommentVNode("", true),
120555
+ unref(label) && !unref(hideLabel) && !unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("div", _hoisted_3$2$1, toDisplayString(unref(label)), 1)) : createCommentVNode("", true),
120556
+ unref(inlineTextInputVisible) ? (openBlock(), createElementBlock("span", _hoisted_4$1$1, [
120557
+ unref(name) === "fontSize" ? withDirectives((openBlock(), createElementBlock("input", {
120558
+ key: 0,
120559
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
120560
+ onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
120561
+ type: "text",
120562
+ class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode2) }]),
120563
+ id: "inlineTextInput-" + unref(name),
120564
+ autocomplete: "off",
120565
+ ref_key: "inlineInput",
120566
+ ref: inlineInput
120567
+ }, null, 42, _hoisted_5$4)), [
120568
+ [vModelText, inlineTextInput.value]
120569
+ ]) : withDirectives((openBlock(), createElementBlock("input", {
120570
+ key: 1,
120571
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inlineTextInput.value = $event),
120572
+ placeholder: unref(label),
120573
+ onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
120574
+ type: "text",
120575
+ class: "button-text-input",
120576
+ id: "inlineTextInput-" + unref(name),
120577
+ autocomplete: "off",
120578
+ ref_key: "inlineInput",
120579
+ ref: inlineInput
120580
+ }, null, 40, _hoisted_6$2)), [
120581
+ [vModelText, inlineTextInput.value]
120582
+ ])
120583
+ ])) : createCommentVNode("", true),
120584
+ unref(hasCaret) ? (openBlock(), createElementBlock("div", {
120585
+ key: 3,
120586
+ class: "dropdown-caret",
120587
+ innerHTML: caretIcon.value,
120588
+ style: normalizeStyle({ opacity: unref(disabled) ? 0.6 : 1 })
120589
+ }, null, 12, _hoisted_7$1)) : createCommentVNode("", true),
120590
+ createBaseVNode("div", _hoisted_8$1, toDisplayString(`${unref(attributes).ariaLabel} ${unref(active) ? "selected" : "unset"}`), 1)
120591
+ ], 10, _hoisted_2$2$1)
120592
+ ], 46, _hoisted_1$3$1);
120593
+ };
120594
+ }
120595
+ };
120596
+ const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-ea93b080"]]);
120597
+ const _hoisted_1$2$1 = {
120598
+ class: "toolbar-separator",
120599
+ role: "separator",
120600
+ "aria-label": "Toolbar separator"
120601
+ };
120602
+ const _sfc_main$3$1 = {
120603
+ __name: "ToolbarSeparator",
120604
+ props: {
120605
+ active: {
120606
+ type: Boolean,
120607
+ default: false
120608
+ }
120609
+ },
120610
+ emits: ["command"],
120611
+ setup(__props, { emit: __emit }) {
120612
+ const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
120613
+ const getSeparatorColor = () => {
120614
+ if (isHighContrastMode2.value) {
120615
+ return "#000";
120616
+ }
120617
+ return "#dbdbdb";
120618
+ };
120619
+ return (_ctx, _cache) => {
120620
+ return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
120621
+ createBaseVNode("div", {
120622
+ class: "separator-inner",
120623
+ style: normalizeStyle({ backgroundColor: getSeparatorColor() })
120624
+ }, null, 4)
120625
+ ]);
120626
+ };
120627
+ }
120628
+ };
120629
+ const ToolbarSeparator = /* @__PURE__ */ _export_sfc(_sfc_main$3$1, [["__scopeId", "data-v-4ef9aa18"]]);
120630
+ const _hoisted_1$1$1 = { class: "overflow-menu" };
120631
+ const _hoisted_2$1$1 = { class: "overflow-menu-trigger" };
120632
+ const _hoisted_3$1$1 = {
120633
+ key: 0,
120634
+ class: "overflow-menu_items",
120635
+ role: "group"
120636
+ };
120637
+ const _sfc_main$2$1 = {
120638
+ __name: "OverflowMenu",
120639
+ props: {
120640
+ toolbarItem: {
120641
+ type: Object,
120642
+ required: true
120643
+ },
120644
+ overflowItems: {
120645
+ type: Array,
120646
+ required: true
120647
+ }
120648
+ },
120649
+ emits: ["buttonClick", "close"],
120650
+ setup(__props, { emit: __emit }) {
120651
+ const { proxy } = getCurrentInstance();
120652
+ const emit = __emit;
120653
+ const props = __props;
120654
+ const isOverflowMenuOpened = computed(() => props.toolbarItem.expand.value);
120655
+ const hasOpenDropdown = ref$1(false);
120656
+ const overflowToolbarItem = computed(() => ({
120657
+ ...props.toolbarItem,
120658
+ active: isOverflowMenuOpened.value
120659
+ }));
120660
+ const toggleOverflowMenu = () => {
120661
+ emit("buttonClick", props.toolbarItem);
120662
+ };
120663
+ const handleCommand = ({ item, argument }) => {
120664
+ proxy.$toolbar.emitCommand({ item, argument });
120665
+ };
120666
+ const handleKeyDown2 = (e) => {
120667
+ if (e.key === "Escape") {
120668
+ if (isOverflowMenuOpened.value && !hasOpenDropdown.value) {
120669
+ e.preventDefault();
120670
+ emit("close");
120671
+ }
120672
+ }
120673
+ };
120674
+ onMounted(() => {
120675
+ document.addEventListener("keydown", handleKeyDown2, true);
120676
+ });
120677
+ onBeforeUnmount(() => {
120678
+ document.removeEventListener("keydown", handleKeyDown2, true);
120679
+ });
120680
+ return (_ctx, _cache) => {
120681
+ return openBlock(), createElementBlock("div", _hoisted_1$1$1, [
120682
+ createBaseVNode("div", _hoisted_2$1$1, [
120683
+ createVNode(ToolbarButton, {
120684
+ "toolbar-item": overflowToolbarItem.value,
120685
+ onButtonClick: toggleOverflowMenu
120686
+ }, null, 8, ["toolbar-item"])
120687
+ ]),
120688
+ isOverflowMenuOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1$1, [
120689
+ createVNode(ButtonGroup, {
120690
+ class: "superdoc-toolbar-overflow",
120691
+ "toolbar-items": __props.overflowItems,
120692
+ "from-overflow": "",
120693
+ onCommand: handleCommand,
120694
+ onDropdownUpdateShow: _cache[0] || (_cache[0] = ($event) => hasOpenDropdown.value = $event)
120695
+ }, null, 8, ["toolbar-items"])
120696
+ ])) : createCommentVNode("", true)
120697
+ ]);
120698
+ };
120699
+ }
120700
+ };
120701
+ const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2$1, [["__scopeId", "data-v-ef28da92"]]);
120499
120702
  const _hoisted_1$h = ["onKeydown", "tabindex", "data-item-id"];
120500
120703
  const _hoisted_2$b = { key: 0 };
120501
120704
  const _hoisted_3$9 = { key: 0 };
@@ -120511,6 +120714,16 @@ const _sfc_main$1$1 = {
120511
120714
  type: Array,
120512
120715
  default: () => []
120513
120716
  },
120717
+ /**
120718
+ * The font-family to use for UI elements like dropdowns and tooltips.
120719
+ * This ensures consistent typography across toolbar UI components.
120720
+ * @type {string}
120721
+ * @default 'Arial, Helvetica, sans-serif'
120722
+ */
120723
+ uiFontFamily: {
120724
+ type: String,
120725
+ default: "Arial, Helvetica, sans-serif"
120726
+ },
120514
120727
  position: {
120515
120728
  type: String,
120516
120729
  default: "left"
@@ -120703,6 +120916,7 @@ const _sfc_main$1$1 = {
120703
120916
  options: dropdownOptions(item),
120704
120917
  trigger: item.disabled.value ? null : "click",
120705
120918
  show: item.expand.value,
120919
+ "content-style": { fontFamily: props.uiFontFamily },
120706
120920
  size: "medium",
120707
120921
  placement: "bottom-start",
120708
120922
  class: normalizeClass(["toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown", { "high-contrast": unref(isHighContrastMode2) }]),
@@ -120710,14 +120924,16 @@ const _sfc_main$1$1 = {
120710
120924
  onUpdateShow: handleDropdownUpdateShow,
120711
120925
  style: normalizeStyle(item.dropdownStyles.value),
120712
120926
  "menu-props": () => ({
120713
- role: "menu"
120927
+ role: "menu",
120928
+ style: { fontFamily: props.uiFontFamily }
120714
120929
  }),
120715
120930
  "node-props": (option) => getDropdownAttributes(option, item)
120716
120931
  }, {
120717
120932
  default: withCtx(() => [
120718
120933
  createVNode(unref(NTooltip), {
120719
120934
  trigger: "hover",
120720
- disabled: !item.tooltip?.value
120935
+ disabled: !item.tooltip?.value,
120936
+ "content-style": { fontFamily: props.uiFontFamily }
120721
120937
  }, {
120722
120938
  trigger: withCtx(() => [
120723
120939
  createVNode(ToolbarButton, {
@@ -120734,13 +120950,14 @@ const _sfc_main$1$1 = {
120734
120950
  ])
120735
120951
  ]),
120736
120952
  _: 2
120737
- }, 1032, ["disabled"])
120953
+ }, 1032, ["disabled", "content-style"])
120738
120954
  ]),
120739
120955
  _: 2
120740
- }, 1032, ["options", "trigger", "show", "class", "onSelect", "style", "node-props"])) : isButton(item) ? (openBlock(), createBlock(unref(NTooltip), {
120956
+ }, 1032, ["options", "trigger", "show", "content-style", "class", "onSelect", "style", "menu-props", "node-props"])) : isButton(item) ? (openBlock(), createBlock(unref(NTooltip), {
120741
120957
  key: 2,
120742
120958
  trigger: "hover",
120743
- class: "sd-editor-toolbar-tooltip"
120959
+ class: "sd-editor-toolbar-tooltip",
120960
+ "content-style": { fontFamily: props.uiFontFamily }
120744
120961
  }, {
120745
120962
  trigger: withCtx(() => [
120746
120963
  createVNode(ToolbarButton, {
@@ -120757,7 +120974,7 @@ const _sfc_main$1$1 = {
120757
120974
  ])) : createCommentVNode("", true)
120758
120975
  ]),
120759
120976
  _: 2
120760
- }, 1024)) : createCommentVNode("", true),
120977
+ }, 1032, ["content-style"])) : createCommentVNode("", true),
120761
120978
  isOverflow(item) && __props.overflowItems.length ? (openBlock(), createBlock(OverflowMenu, {
120762
120979
  key: 3,
120763
120980
  "toolbar-item": item,
@@ -120771,13 +120988,21 @@ const _sfc_main$1$1 = {
120771
120988
  };
120772
120989
  }
120773
120990
  };
120774
- const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-c80a1e51"]]);
120991
+ const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-f732136c"]]);
120992
+ const DEFAULT_UI_FONT_FAMILY = "Arial, Helvetica, sans-serif";
120775
120993
  const _sfc_main$j = {
120776
120994
  __name: "Toolbar",
120777
120995
  emits: ["command", "toggle", "select"],
120778
120996
  setup(__props, { emit: __emit }) {
120779
120997
  const { proxy } = getCurrentInstance();
120780
120998
  let toolbarKey = ref$1(1);
120999
+ const uiFontFamily = computed(() => {
121000
+ const configured = proxy?.$toolbar?.config?.uiDisplayFallbackFont;
121001
+ if (typeof configured === "string" && configured.trim()) {
121002
+ return configured.trim();
121003
+ }
121004
+ return DEFAULT_UI_FONT_FAMILY;
121005
+ });
120781
121006
  const showLeftSide = proxy.$toolbar.config?.toolbarGroups?.includes("left");
120782
121007
  const showRightSide = proxy.$toolbar.config?.toolbarGroups?.includes("right");
120783
121008
  const excludeButtonsList = proxy.$toolbar.config?.toolbarButtonsExclude || [];
@@ -120824,37 +121049,48 @@ const _sfc_main$j = {
120824
121049
  "aria-label": "Toolbar",
120825
121050
  "data-editor-ui-surface": ""
120826
121051
  }, [
120827
- unref(showLeftSide) ? (openBlock(), createBlock(ButtonGroup, {
120828
- key: 0,
120829
- tabindex: "0",
120830
- "toolbar-items": getFilteredItems("left"),
120831
- position: "left",
120832
- onCommand: handleCommand,
120833
- onItemClicked: restoreSelection2,
120834
- class: "superdoc-toolbar-group-side"
120835
- }, null, 8, ["toolbar-items"])) : createCommentVNode("", true),
120836
- createVNode(ButtonGroup, {
120837
- tabindex: "0",
120838
- "toolbar-items": getFilteredItems("center"),
120839
- "overflow-items": unref(proxy).$toolbar.overflowItems,
120840
- position: "center",
120841
- onCommand: handleCommand,
120842
- onItemClicked: restoreSelection2
120843
- }, null, 8, ["toolbar-items", "overflow-items"]),
120844
- unref(showRightSide) ? (openBlock(), createBlock(ButtonGroup, {
120845
- key: 1,
120846
- tabindex: "0",
120847
- "toolbar-items": getFilteredItems("right"),
120848
- position: "right",
120849
- onCommand: handleCommand,
120850
- onItemClicked: restoreSelection2,
120851
- class: "superdoc-toolbar-group-side"
120852
- }, null, 8, ["toolbar-items"])) : createCommentVNode("", true)
121052
+ createVNode(unref(NConfigProvider), {
121053
+ abstract: "",
121054
+ "preflight-style-disabled": ""
121055
+ }, {
121056
+ default: withCtx(() => [
121057
+ unref(showLeftSide) ? (openBlock(), createBlock(ButtonGroup, {
121058
+ key: 0,
121059
+ tabindex: "0",
121060
+ "toolbar-items": getFilteredItems("left"),
121061
+ "ui-font-family": uiFontFamily.value,
121062
+ position: "left",
121063
+ onCommand: handleCommand,
121064
+ onItemClicked: restoreSelection2,
121065
+ class: "superdoc-toolbar-group-side"
121066
+ }, null, 8, ["toolbar-items", "ui-font-family"])) : createCommentVNode("", true),
121067
+ createVNode(ButtonGroup, {
121068
+ tabindex: "0",
121069
+ "toolbar-items": getFilteredItems("center"),
121070
+ "overflow-items": unref(proxy).$toolbar.overflowItems,
121071
+ "ui-font-family": uiFontFamily.value,
121072
+ position: "center",
121073
+ onCommand: handleCommand,
121074
+ onItemClicked: restoreSelection2
121075
+ }, null, 8, ["toolbar-items", "overflow-items", "ui-font-family"]),
121076
+ unref(showRightSide) ? (openBlock(), createBlock(ButtonGroup, {
121077
+ key: 1,
121078
+ tabindex: "0",
121079
+ "toolbar-items": getFilteredItems("right"),
121080
+ "ui-font-family": uiFontFamily.value,
121081
+ position: "right",
121082
+ onCommand: handleCommand,
121083
+ onItemClicked: restoreSelection2,
121084
+ class: "superdoc-toolbar-group-side"
121085
+ }, null, 8, ["toolbar-items", "ui-font-family"])) : createCommentVNode("", true)
121086
+ ]),
121087
+ _: 1
121088
+ })
120853
121089
  ]);
120854
121090
  };
120855
121091
  }
120856
121092
  };
120857
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-3f5ec271"]]);
121093
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-c7a72aa9"]]);
120858
121094
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
120859
121095
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
120860
121096
  async function baseInsightsFetch(payload, options = {}) {
@@ -121371,7 +121607,7 @@ const _sfc_main$i = {
121371
121607
  };
121372
121608
  }
121373
121609
  };
121374
- const AIWriter = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-d869be75"]]);
121610
+ const AIWriter = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-a4bc3d14"]]);
121375
121611
  async function createZip(blobs, fileNames) {
121376
121612
  const zip = new JSZip();
121377
121613
  blobs.forEach((blob, index2) => {
@@ -124220,6 +124456,10 @@ const _SuperToolbar = class _SuperToolbar2 extends EventEmitter2 {
124220
124456
  this.config.selector = this.config.element;
124221
124457
  }
124222
124458
  this.toolbarContainer = this.findElementBySelector(this.config.selector);
124459
+ if (this.toolbarContainer) {
124460
+ const uiFontFamily = (this.config?.uiDisplayFallbackFont || "").toString().trim() || "Arial, Helvetica, sans-serif";
124461
+ this.toolbarContainer.style.setProperty("--sd-ui-font-family", uiFontFamily);
124462
+ }
124223
124463
  __privateMethod(this, _SuperToolbar_instances, initToolbarGroups_fn).call(this);
124224
124464
  __privateMethod(this, _SuperToolbar_instances, makeToolbarItems_fn).call(this, {
124225
124465
  superToolbar: this,