@harbour-enterprises/superdoc 0.12.34-next.2 → 0.12.35-next.1
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/{super-editor.es-C9AkEjnH.cjs → super-editor.es-CrLkFZx3.cjs} +153 -57
- package/dist/chunks/{super-editor.es-BL9qks26.es.js → super-editor.es-DKDM0ods.es.js} +153 -57
- package/dist/style.css +42 -35
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DASNJ_pe.js → converter-fyrJGAG_.js} +22 -19
- package/dist/super-editor/chunks/{docx-zipper-Ba5P9kSx.js → docx-zipper-2BesmPVy.js} +1 -1
- package/dist/super-editor/chunks/{editor-Cizth369.js → editor-JPMSAwgN.js} +5 -5
- package/dist/super-editor/chunks/{toolbar-CjP-3g7l.js → toolbar-BdZhVjSi.js} +119 -35
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +3 -0
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +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 +42 -35
- package/dist/super-editor/super-editor.es.js +18 -9
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +154 -58
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -20468,24 +20468,26 @@ generateXml_fn = function(node2, debug = false) {
|
|
|
20468
20468
|
if (!name && node2.type === "text") {
|
|
20469
20469
|
return node2.text;
|
|
20470
20470
|
}
|
|
20471
|
-
if (
|
|
20472
|
-
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
|
|
20476
|
-
|
|
20477
|
-
|
|
20478
|
-
|
|
20479
|
-
|
|
20480
|
-
|
|
20481
|
-
|
|
20482
|
-
|
|
20483
|
-
|
|
20471
|
+
if (elements) {
|
|
20472
|
+
if (name === "w:instrText") {
|
|
20473
|
+
tags.push(elements[0].text);
|
|
20474
|
+
} else if (name === "w:t" || name === "w:delText" || name === "wp:posOffset") {
|
|
20475
|
+
const text = __privateMethod$2(this, _DocxExporter_instances, replaceSpecialCharacters_fn).call(this, elements[0].text);
|
|
20476
|
+
tags.push(text);
|
|
20477
|
+
} else {
|
|
20478
|
+
if (elements) {
|
|
20479
|
+
for (let child of elements) {
|
|
20480
|
+
const newElements = __privateMethod$2(this, _DocxExporter_instances, generateXml_fn).call(this, child);
|
|
20481
|
+
if (!newElements) continue;
|
|
20482
|
+
if (typeof newElements === "string") {
|
|
20483
|
+
tags.push(newElements);
|
|
20484
|
+
continue;
|
|
20485
|
+
}
|
|
20486
|
+
const removeUndefined = newElements.filter((el) => {
|
|
20487
|
+
return el !== "<undefined>" && el !== "</undefined>";
|
|
20488
|
+
});
|
|
20489
|
+
tags.push(...removeUndefined);
|
|
20484
20490
|
}
|
|
20485
|
-
const removeUndefined = newElements.filter((el) => {
|
|
20486
|
-
return el !== "<undefined>" && el !== "</undefined>";
|
|
20487
|
-
});
|
|
20488
|
-
tags.push(...removeUndefined);
|
|
20489
20491
|
}
|
|
20490
20492
|
}
|
|
20491
20493
|
}
|
|
@@ -23307,7 +23309,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23307
23309
|
return;
|
|
23308
23310
|
}
|
|
23309
23311
|
}
|
|
23310
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.
|
|
23312
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.12.35-next.1") {
|
|
23311
23313
|
const customLocation = "docProps/custom.xml";
|
|
23312
23314
|
if (!docx[customLocation]) {
|
|
23313
23315
|
docx[customLocation] = generateCustomXml();
|
|
@@ -23434,6 +23436,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23434
23436
|
getThemeInfo(themeName) {
|
|
23435
23437
|
themeName = themeName.toLowerCase();
|
|
23436
23438
|
const theme1 = this.convertedXml["word/theme/theme1.xml"];
|
|
23439
|
+
if (!theme1) return {};
|
|
23437
23440
|
const themeData = theme1.elements.find((el) => el.name === "a:theme");
|
|
23438
23441
|
const themeElements = themeData.elements.find((el) => el.name === "a:themeElements");
|
|
23439
23442
|
const fontScheme = themeElements.elements.find((el) => el.name === "a:fontScheme");
|
|
@@ -23773,7 +23776,7 @@ function storeSuperdocVersion(docx) {
|
|
|
23773
23776
|
function generateCustomXml() {
|
|
23774
23777
|
return DEFAULT_CUSTOM_XML;
|
|
23775
23778
|
}
|
|
23776
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.12.
|
|
23779
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.12.35-next.1") {
|
|
23777
23780
|
return {
|
|
23778
23781
|
type: "element",
|
|
23779
23782
|
name: "property",
|
|
@@ -41050,7 +41053,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41050
41053
|
* @returns {Object | void} Migration results
|
|
41051
41054
|
*/
|
|
41052
41055
|
processCollaborationMigrations() {
|
|
41053
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.12.
|
|
41056
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.12.35-next.1");
|
|
41054
41057
|
if (!this.options.ydoc) return;
|
|
41055
41058
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41056
41059
|
let docVersion = metaMap.get("version");
|
|
@@ -52790,7 +52793,7 @@ function generateInternalPageBreaks(doc2, view, editor, sectionData) {
|
|
|
52790
52793
|
if (currentPageNumber === 1) {
|
|
52791
52794
|
const headerId2 = getHeaderFooterId(currentPageNumber, "headerIds", editor, currentNode);
|
|
52792
52795
|
decorations.pop();
|
|
52793
|
-
const newFirstHeader = createHeader(pageMargins, pageSize, sectionData, headerId2);
|
|
52796
|
+
const newFirstHeader = createHeader(pageMargins, pageSize, sectionData, headerId2, editor);
|
|
52794
52797
|
const pageBreak2 = createPageBreak({ editor, header: newFirstHeader, isFirstHeader: true });
|
|
52795
52798
|
decorations.push(Decoration.widget(0, pageBreak2, { key: "stable-key" }));
|
|
52796
52799
|
}
|
|
@@ -52870,7 +52873,7 @@ function createHeader(pageMargins, pageSize, sectionData, headerId, editor) {
|
|
|
52870
52873
|
const headerHeight = Math.max(headerDef?.height || 0, minHeaderHeight) + headerOffset;
|
|
52871
52874
|
const availableHeight = headerHeight - headerMargin;
|
|
52872
52875
|
const editorContainer = document.createElement("div");
|
|
52873
|
-
if (!headerId && !editor
|
|
52876
|
+
if (!headerId && !editor?.converter?.headerIds?.["default"]) {
|
|
52874
52877
|
headerId = "rId" + generateDocxRandomId();
|
|
52875
52878
|
editor.converter.headerIds["default"] = headerId;
|
|
52876
52879
|
}
|
|
@@ -53730,16 +53733,20 @@ const _sfc_main$5$1 = {
|
|
|
53730
53733
|
}
|
|
53731
53734
|
};
|
|
53732
53735
|
const ToolbarButtonIcon = /* @__PURE__ */ _export_sfc(_sfc_main$5$1, [["__scopeId", "data-v-6d7523ab"]]);
|
|
53733
|
-
const _hoisted_1$3$1 = ["role"];
|
|
53734
|
-
const _hoisted_2$2$1 = ["data-item"
|
|
53736
|
+
const _hoisted_1$3$1 = ["role", "aria-label", "onKeydown"];
|
|
53737
|
+
const _hoisted_2$2$1 = ["data-item"];
|
|
53735
53738
|
const _hoisted_3$2$1 = {
|
|
53736
53739
|
key: 1,
|
|
53737
53740
|
class: "button-label"
|
|
53738
53741
|
};
|
|
53739
|
-
const _hoisted_4$
|
|
53742
|
+
const _hoisted_4$1$1 = { key: 2 };
|
|
53740
53743
|
const _hoisted_5$4 = ["placeholder", "onKeydown", "id"];
|
|
53741
53744
|
const _hoisted_6$2 = ["placeholder", "onKeydown", "id"];
|
|
53742
53745
|
const _hoisted_7$1 = ["innerHTML"];
|
|
53746
|
+
const _hoisted_8$1 = {
|
|
53747
|
+
"aria-live": "polite",
|
|
53748
|
+
class: "visually-hidden"
|
|
53749
|
+
};
|
|
53743
53750
|
const _sfc_main$4$1 = {
|
|
53744
53751
|
__name: "ToolbarButton",
|
|
53745
53752
|
props: {
|
|
@@ -53822,14 +53829,15 @@ const _sfc_main$4$1 = {
|
|
|
53822
53829
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
53823
53830
|
class: vue.normalizeClass(["toolbar-item", vue.unref(attributes).className]),
|
|
53824
53831
|
style: vue.normalizeStyle(getStyle.value),
|
|
53825
|
-
role: __props.isOverflowItem ? "menuitem" : ""
|
|
53832
|
+
role: __props.isOverflowItem ? "menuitem" : "button",
|
|
53833
|
+
"aria-label": vue.unref(attributes).ariaLabel,
|
|
53834
|
+
onClick: handleClick2,
|
|
53835
|
+
onKeydown: vue.withKeys(vue.withModifiers(handleClick2, ["stop"]), ["enter"]),
|
|
53836
|
+
tabindex: "0"
|
|
53826
53837
|
}, [
|
|
53827
53838
|
vue.createBaseVNode("div", {
|
|
53828
|
-
onClick: handleClick2,
|
|
53829
53839
|
class: vue.normalizeClass(["toolbar-button", { active: vue.unref(active), disabled: vue.unref(disabled), narrow: __props.isNarrow, wide: __props.isWide, "has-inline-text-input": vue.unref(hasInlineTextInput), "high-contrast": vue.unref(isHighContrastMode2) }]),
|
|
53830
|
-
"data-item": `btn-${vue.unref(name) || ""}
|
|
53831
|
-
"aria-label": vue.unref(attributes).ariaLabel,
|
|
53832
|
-
role: "button"
|
|
53840
|
+
"data-item": `btn-${vue.unref(name) || ""}`
|
|
53833
53841
|
}, [
|
|
53834
53842
|
vue.unref(icon) ? (vue.openBlock(), vue.createBlock(ToolbarButtonIcon, {
|
|
53835
53843
|
key: 0,
|
|
@@ -53839,7 +53847,7 @@ const _sfc_main$4$1 = {
|
|
|
53839
53847
|
name: vue.unref(name)
|
|
53840
53848
|
}, null, 8, ["color", "icon", "name"])) : vue.createCommentVNode("", true),
|
|
53841
53849
|
vue.unref(label) && !vue.unref(hideLabel) && !vue.unref(inlineTextInputVisible) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2$1, vue.toDisplayString(vue.unref(label)), 1)) : vue.createCommentVNode("", true),
|
|
53842
|
-
vue.unref(inlineTextInputVisible) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
53850
|
+
vue.unref(inlineTextInputVisible) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$1$1, [
|
|
53843
53851
|
vue.unref(name) === "fontSize" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
53844
53852
|
key: 0,
|
|
53845
53853
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
|
|
@@ -53849,7 +53857,7 @@ const _sfc_main$4$1 = {
|
|
|
53849
53857
|
type: "text",
|
|
53850
53858
|
class: vue.normalizeClass(["button-text-input", { "high-contrast": vue.unref(isHighContrastMode2) }]),
|
|
53851
53859
|
id: "inlineTextInput-" + vue.unref(name),
|
|
53852
|
-
|
|
53860
|
+
autocomplete: "off",
|
|
53853
53861
|
ref_key: "inlineInput",
|
|
53854
53862
|
ref: inlineInput
|
|
53855
53863
|
}, null, 42, _hoisted_5$4)), [
|
|
@@ -53862,7 +53870,7 @@ const _sfc_main$4$1 = {
|
|
|
53862
53870
|
type: "text",
|
|
53863
53871
|
class: "button-text-input",
|
|
53864
53872
|
id: "inlineTextInput-" + vue.unref(name),
|
|
53865
|
-
|
|
53873
|
+
autocomplete: "off",
|
|
53866
53874
|
ref_key: "inlineInput",
|
|
53867
53875
|
ref: inlineInput
|
|
53868
53876
|
}, null, 40, _hoisted_6$2)), [
|
|
@@ -53874,13 +53882,14 @@ const _sfc_main$4$1 = {
|
|
|
53874
53882
|
class: "dropdown-caret",
|
|
53875
53883
|
innerHTML: caretIcon.value,
|
|
53876
53884
|
style: vue.normalizeStyle({ opacity: vue.unref(disabled) ? 0.6 : 1 })
|
|
53877
|
-
}, null, 12, _hoisted_7$1)) : vue.createCommentVNode("", true)
|
|
53885
|
+
}, null, 12, _hoisted_7$1)) : vue.createCommentVNode("", true),
|
|
53886
|
+
vue.createBaseVNode("div", _hoisted_8$1, vue.toDisplayString(`${vue.unref(attributes).ariaLabel} ${vue.unref(active) ? "selected" : "unset"}`), 1)
|
|
53878
53887
|
], 10, _hoisted_2$2$1)
|
|
53879
|
-
],
|
|
53888
|
+
], 46, _hoisted_1$3$1);
|
|
53880
53889
|
};
|
|
53881
53890
|
}
|
|
53882
53891
|
};
|
|
53883
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-
|
|
53892
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-2518a3d1"]]);
|
|
53884
53893
|
const _hoisted_1$2$1 = {
|
|
53885
53894
|
class: "toolbar-separator",
|
|
53886
53895
|
role: "separator",
|
|
@@ -63298,9 +63307,10 @@ const NSkeleton = vue.defineComponent({
|
|
|
63298
63307
|
return child;
|
|
63299
63308
|
}
|
|
63300
63309
|
});
|
|
63301
|
-
const _hoisted_1$d =
|
|
63310
|
+
const _hoisted_1$d = ["onKeydown", "tabindex"];
|
|
63302
63311
|
const _hoisted_2$b = { key: 0 };
|
|
63303
63312
|
const _hoisted_3$9 = { key: 0 };
|
|
63313
|
+
const _hoisted_4$5 = { key: 0 };
|
|
63304
63314
|
const _sfc_main$1$1 = {
|
|
63305
63315
|
__name: "ButtonGroup",
|
|
63306
63316
|
props: {
|
|
@@ -63350,11 +63360,11 @@ const _sfc_main$1$1 = {
|
|
|
63350
63360
|
const isDropdown = (item) => item.type === "dropdown";
|
|
63351
63361
|
const isSeparator = (item) => item.type === "separator";
|
|
63352
63362
|
const isOverflow = (item) => item.type === "overflow";
|
|
63353
|
-
const handleToolbarButtonClick = (item, argument = null) => {
|
|
63363
|
+
const handleToolbarButtonClick = (item, argument = null, switchFocusToEditor = true) => {
|
|
63354
63364
|
currentItem.value = item;
|
|
63355
63365
|
currentItem.value.expand = true;
|
|
63356
63366
|
if (item.disabled.value) return;
|
|
63357
|
-
emit("command", { item, argument });
|
|
63367
|
+
emit("command", { item, argument, switchFocusToEditor });
|
|
63358
63368
|
};
|
|
63359
63369
|
const handleToolbarButtonTextSubmit = (item, argument) => {
|
|
63360
63370
|
if (item.disabled.value) return;
|
|
@@ -63370,7 +63380,7 @@ const _sfc_main$1$1 = {
|
|
|
63370
63380
|
const handleSelect = (item, option) => {
|
|
63371
63381
|
closeDropdowns();
|
|
63372
63382
|
const value = item.dropdownValueKey.value ? option[item.dropdownValueKey.value] : option.label;
|
|
63373
|
-
emit("command", { item, argument: value, option });
|
|
63383
|
+
emit("command", { item, argument: value, option, switchFocusToEditor: true });
|
|
63374
63384
|
selectedOption.value = option.key;
|
|
63375
63385
|
};
|
|
63376
63386
|
const dropdownOptions = (item) => {
|
|
@@ -63394,19 +63404,92 @@ const _sfc_main$1$1 = {
|
|
|
63394
63404
|
const handleClickOutside = (e) => {
|
|
63395
63405
|
closeDropdowns();
|
|
63396
63406
|
};
|
|
63407
|
+
const moveToNextButton = (e) => {
|
|
63408
|
+
const currentButton = e.target;
|
|
63409
|
+
const nextButton = e.target.closest(".toolbar-item-ctn").nextElementSibling;
|
|
63410
|
+
if (nextButton) {
|
|
63411
|
+
currentButton.setAttribute("tabindex", "-1");
|
|
63412
|
+
nextButton.setAttribute("tabindex", "0");
|
|
63413
|
+
nextButton.focus();
|
|
63414
|
+
}
|
|
63415
|
+
};
|
|
63416
|
+
const moveToPreviousButton = (e) => {
|
|
63417
|
+
const currentButton = e.target;
|
|
63418
|
+
const previousButton = e.target.closest(".toolbar-item-ctn").previousElementSibling;
|
|
63419
|
+
if (previousButton) {
|
|
63420
|
+
currentButton.setAttribute("tabindex", "-1");
|
|
63421
|
+
previousButton.setAttribute("tabindex", "0");
|
|
63422
|
+
previousButton.focus();
|
|
63423
|
+
}
|
|
63424
|
+
};
|
|
63425
|
+
const moveToNextButtonGroup = (e) => {
|
|
63426
|
+
const nextButtonGroup = e.target.closest(".button-group").nextElementSibling;
|
|
63427
|
+
if (nextButtonGroup) {
|
|
63428
|
+
nextButtonGroup.setAttribute("tabindex", "0");
|
|
63429
|
+
nextButtonGroup.focus();
|
|
63430
|
+
} else {
|
|
63431
|
+
const editor = document.querySelector(".ProseMirror");
|
|
63432
|
+
if (editor) {
|
|
63433
|
+
editor.focus();
|
|
63434
|
+
}
|
|
63435
|
+
}
|
|
63436
|
+
};
|
|
63437
|
+
const moveToPreviousButtonGroup = (e) => {
|
|
63438
|
+
const previousButtonGroup = e.target.closest(".button-group").previousElementSibling;
|
|
63439
|
+
if (previousButtonGroup) {
|
|
63440
|
+
previousButtonGroup.setAttribute("tabindex", "0");
|
|
63441
|
+
previousButtonGroup.focus();
|
|
63442
|
+
}
|
|
63443
|
+
};
|
|
63444
|
+
const handleKeyDown2 = (e, item) => {
|
|
63445
|
+
e.preventDefault();
|
|
63446
|
+
switch (e.key) {
|
|
63447
|
+
case "Enter":
|
|
63448
|
+
handleToolbarButtonClick(item, null, false);
|
|
63449
|
+
break;
|
|
63450
|
+
case "Escape":
|
|
63451
|
+
closeDropdowns();
|
|
63452
|
+
break;
|
|
63453
|
+
case "ArrowRight":
|
|
63454
|
+
closeDropdowns();
|
|
63455
|
+
moveToNextButton(e);
|
|
63456
|
+
break;
|
|
63457
|
+
case "ArrowLeft":
|
|
63458
|
+
closeDropdowns();
|
|
63459
|
+
moveToPreviousButton(e);
|
|
63460
|
+
break;
|
|
63461
|
+
case "Tab":
|
|
63462
|
+
if (e.shiftKey) {
|
|
63463
|
+
moveToPreviousButtonGroup(e);
|
|
63464
|
+
} else {
|
|
63465
|
+
moveToNextButtonGroup(e);
|
|
63466
|
+
}
|
|
63467
|
+
break;
|
|
63468
|
+
}
|
|
63469
|
+
};
|
|
63470
|
+
const handleFocus = (e) => {
|
|
63471
|
+
const firstButton = e.target.closest(".button-group").querySelector(".toolbar-item-ctn:not(.disabled)");
|
|
63472
|
+
if (firstButton) {
|
|
63473
|
+
firstButton.focus();
|
|
63474
|
+
}
|
|
63475
|
+
};
|
|
63397
63476
|
return (_ctx, _cache) => {
|
|
63398
63477
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
63399
63478
|
style: vue.normalizeStyle(getPositionStyle.value),
|
|
63400
63479
|
class: "button-group",
|
|
63401
|
-
role: "group"
|
|
63480
|
+
role: "group",
|
|
63481
|
+
onFocus: handleFocus
|
|
63402
63482
|
}, [
|
|
63403
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.toolbarItems, (item) => {
|
|
63483
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.toolbarItems, (item, index2) => {
|
|
63404
63484
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
63405
63485
|
key: item.id.value,
|
|
63406
63486
|
class: vue.normalizeClass([{
|
|
63407
63487
|
narrow: item.isNarrow.value,
|
|
63408
|
-
wide: item.isWide.value
|
|
63409
|
-
|
|
63488
|
+
wide: item.isWide.value,
|
|
63489
|
+
disabled: item.disabled.value
|
|
63490
|
+
}, "toolbar-item-ctn"]),
|
|
63491
|
+
onKeydown: (e) => handleKeyDown2(e, item),
|
|
63492
|
+
tabindex: index2 === 0 ? 0 : -1
|
|
63410
63493
|
}, [
|
|
63411
63494
|
isSeparator(item) ? (vue.openBlock(), vue.createBlock(ToolbarSeparator, {
|
|
63412
63495
|
key: 0,
|
|
@@ -63436,14 +63519,15 @@ const _sfc_main$1$1 = {
|
|
|
63436
63519
|
trigger: vue.withCtx(() => [
|
|
63437
63520
|
vue.createVNode(ToolbarButton, {
|
|
63438
63521
|
"toolbar-item": item,
|
|
63522
|
+
disabled: item.disabled.value,
|
|
63439
63523
|
onTextSubmit: ($event) => handleToolbarButtonTextSubmit(item, $event),
|
|
63440
63524
|
onButtonClick: ($event) => handleToolbarButtonClick(item)
|
|
63441
|
-
}, null, 8, ["toolbar-item", "onTextSubmit", "onButtonClick"])
|
|
63525
|
+
}, null, 8, ["toolbar-item", "disabled", "onTextSubmit", "onButtonClick"])
|
|
63442
63526
|
]),
|
|
63443
63527
|
default: vue.withCtx(() => [
|
|
63444
63528
|
vue.createBaseVNode("div", null, [
|
|
63445
63529
|
vue.createTextVNode(vue.toDisplayString(item.tooltip) + " ", 1),
|
|
63446
|
-
item.disabled.value ? (vue.openBlock(), vue.createElementBlock("span",
|
|
63530
|
+
item.disabled.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, "(disabled)")) : vue.createCommentVNode("", true)
|
|
63447
63531
|
])
|
|
63448
63532
|
]),
|
|
63449
63533
|
_: 2
|
|
@@ -63464,9 +63548,9 @@ const _sfc_main$1$1 = {
|
|
|
63464
63548
|
}, null, 8, ["toolbar-item", "is-overflow-item", "onTextSubmit", "onButtonClick"])
|
|
63465
63549
|
]),
|
|
63466
63550
|
default: vue.withCtx(() => [
|
|
63467
|
-
item.tooltip ? (vue.openBlock(), vue.createElementBlock("div",
|
|
63551
|
+
item.tooltip ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$9, [
|
|
63468
63552
|
vue.createTextVNode(vue.toDisplayString(item.tooltip) + " ", 1),
|
|
63469
|
-
item.disabled.value ? (vue.openBlock(), vue.createElementBlock("span",
|
|
63553
|
+
item.disabled.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$5, "(disabled)")) : vue.createCommentVNode("", true)
|
|
63470
63554
|
])) : vue.createCommentVNode("", true)
|
|
63471
63555
|
]),
|
|
63472
63556
|
_: 2
|
|
@@ -63476,13 +63560,13 @@ const _sfc_main$1$1 = {
|
|
|
63476
63560
|
"toolbar-item": item,
|
|
63477
63561
|
"overflow-items": __props.overflowItems
|
|
63478
63562
|
}, null, 8, ["toolbar-item", "overflow-items"])) : vue.createCommentVNode("", true)
|
|
63479
|
-
],
|
|
63563
|
+
], 42, _hoisted_1$d);
|
|
63480
63564
|
}), 128))
|
|
63481
|
-
],
|
|
63565
|
+
], 36);
|
|
63482
63566
|
};
|
|
63483
63567
|
}
|
|
63484
63568
|
};
|
|
63485
|
-
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-
|
|
63569
|
+
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-53a792b0"]]);
|
|
63486
63570
|
const _sfc_main$e = {
|
|
63487
63571
|
__name: "Toolbar",
|
|
63488
63572
|
emits: ["command", "toggle", "select"],
|
|
@@ -63521,8 +63605,8 @@ const _sfc_main$e = {
|
|
|
63521
63605
|
toolbarKey.value += 1;
|
|
63522
63606
|
};
|
|
63523
63607
|
const onResizeThrottled = throttle(onWindowResized, 300);
|
|
63524
|
-
const handleCommand = ({ item, argument, option }) => {
|
|
63525
|
-
proxy.$toolbar.emitCommand({ item, argument, option });
|
|
63608
|
+
const handleCommand = ({ item, argument, option, switchFocusToEditor = true }) => {
|
|
63609
|
+
proxy.$toolbar.emitCommand({ item, argument, option, switchFocusToEditor });
|
|
63526
63610
|
};
|
|
63527
63611
|
return (_ctx, _cache) => {
|
|
63528
63612
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -63533,12 +63617,14 @@ const _sfc_main$e = {
|
|
|
63533
63617
|
}, [
|
|
63534
63618
|
vue.unref(showLeftSide) ? (vue.openBlock(), vue.createBlock(ButtonGroup, {
|
|
63535
63619
|
key: 0,
|
|
63620
|
+
tabindex: "0",
|
|
63536
63621
|
"toolbar-items": getFilteredItems("left"),
|
|
63537
63622
|
position: "left",
|
|
63538
63623
|
onCommand: handleCommand,
|
|
63539
63624
|
class: "superdoc-toolbar-group-side"
|
|
63540
63625
|
}, null, 8, ["toolbar-items"])) : vue.createCommentVNode("", true),
|
|
63541
63626
|
vue.createVNode(ButtonGroup, {
|
|
63627
|
+
tabindex: "0",
|
|
63542
63628
|
"toolbar-items": getFilteredItems("center"),
|
|
63543
63629
|
"overflow-items": vue.unref(proxy).$toolbar.overflowItems,
|
|
63544
63630
|
position: "center",
|
|
@@ -63546,6 +63632,7 @@ const _sfc_main$e = {
|
|
|
63546
63632
|
}, null, 8, ["toolbar-items", "overflow-items"]),
|
|
63547
63633
|
vue.unref(showRightSide) ? (vue.openBlock(), vue.createBlock(ButtonGroup, {
|
|
63548
63634
|
key: 1,
|
|
63635
|
+
tabindex: "0",
|
|
63549
63636
|
"toolbar-items": getFilteredItems("right"),
|
|
63550
63637
|
position: "right",
|
|
63551
63638
|
onCommand: handleCommand,
|
|
@@ -63555,7 +63642,7 @@ const _sfc_main$e = {
|
|
|
63555
63642
|
};
|
|
63556
63643
|
}
|
|
63557
63644
|
};
|
|
63558
|
-
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
63645
|
+
const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-b182f42b"]]);
|
|
63559
63646
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
63560
63647
|
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: ";
|
|
63561
63648
|
async function baseInsightsFetch(payload, options2 = {}) {
|
|
@@ -66812,8 +66899,8 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
66812
66899
|
* @param {*} [params.argument] - The argument passed to the command
|
|
66813
66900
|
* @returns {*} The result of the executed command, undefined if no result is returned
|
|
66814
66901
|
*/
|
|
66815
|
-
emitCommand({ item, argument, option }) {
|
|
66816
|
-
if (this.activeEditor && !this.activeEditor.options.isHeaderOrFooter) {
|
|
66902
|
+
emitCommand({ item, argument, option, switchFocusToEditor = true }) {
|
|
66903
|
+
if (this.activeEditor && !this.activeEditor.options.isHeaderOrFooter && switchFocusToEditor) {
|
|
66817
66904
|
this.activeEditor.focus();
|
|
66818
66905
|
}
|
|
66819
66906
|
const { command: command2 } = item;
|
|
@@ -67310,6 +67397,15 @@ const _sfc_main$2 = {
|
|
|
67310
67397
|
});
|
|
67311
67398
|
};
|
|
67312
67399
|
const handleSuperEditorKeydown = (event) => {
|
|
67400
|
+
if ((event.metaKey || event.ctrlKey) && event.altKey && event.shiftKey) {
|
|
67401
|
+
if (event.code === "KeyM") {
|
|
67402
|
+
const toolbar = document.querySelector(".superdoc-toolbar");
|
|
67403
|
+
if (toolbar) {
|
|
67404
|
+
toolbar.setAttribute("tabindex", "0");
|
|
67405
|
+
toolbar.focus();
|
|
67406
|
+
}
|
|
67407
|
+
}
|
|
67408
|
+
}
|
|
67313
67409
|
emit("editor-keydown", { editor: editor.value });
|
|
67314
67410
|
};
|
|
67315
67411
|
const handleSuperEditorClick = (event) => {
|
|
@@ -67415,7 +67511,7 @@ const _sfc_main$2 = {
|
|
|
67415
67511
|
};
|
|
67416
67512
|
}
|
|
67417
67513
|
};
|
|
67418
|
-
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
67514
|
+
const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-199a4ecf"]]);
|
|
67419
67515
|
const _sfc_main$1 = {
|
|
67420
67516
|
__name: "BasicUpload",
|
|
67421
67517
|
emits: ["file-change"],
|