@harbour-enterprises/superdoc 0.11.40 → 0.11.42
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-RKwdWGC7.es.js → super-editor.es-B_EX0CMY.es.js} +33 -25
- package/dist/chunks/{super-editor.es-DZzKZJLy.cjs → super-editor.es-CEU22lZX.cjs} +46 -43
- package/dist/style.css +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DQ7oe9jd.js → converter-adJM2cRp.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-Bu4tz-qv.js → docx-zipper-DgXLizYT.js} +1 -1
- package/dist/super-editor/chunks/{editor--E_CT98k.js → editor-Di7QIxzf.js} +3 -3
- package/dist/super-editor/chunks/{toolbar-H6KJEcQT.js → toolbar-DOQF8N-8.js} +132 -132
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +6 -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/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 +1 -1
- package/dist/super-editor/super-editor.es.js +459 -451
- package/dist/super-editor/tests/e2e/test-app/vite.config.d.ts +1 -1
- 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 +3 -3
- package/dist/superdoc.es.js +4 -4
- package/dist/superdoc.umd.js +1245 -1237
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts +0 -3
- package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts.map +0 -1
|
@@ -16756,7 +16756,7 @@ const ws = class H1 {
|
|
|
16756
16756
|
return;
|
|
16757
16757
|
}
|
|
16758
16758
|
}
|
|
16759
|
-
static updateDocumentVersion(e = this.convertedXml, n = "0.11.
|
|
16759
|
+
static updateDocumentVersion(e = this.convertedXml, n = "0.11.42") {
|
|
16760
16760
|
const r = "docProps/custom.xml";
|
|
16761
16761
|
e[r] || (e[r] = V1());
|
|
16762
16762
|
const o = e["docProps/custom.xml"];
|
|
@@ -17019,7 +17019,7 @@ function tT(t) {
|
|
|
17019
17019
|
function V1() {
|
|
17020
17020
|
return k4;
|
|
17021
17021
|
}
|
|
17022
|
-
function W1(t = 2, e = "0.11.
|
|
17022
|
+
function W1(t = 2, e = "0.11.42") {
|
|
17023
17023
|
return {
|
|
17024
17024
|
type: "element",
|
|
17025
17025
|
name: "property",
|
|
@@ -29771,7 +29771,7 @@ const J_ = class qx extends e_ {
|
|
|
29771
29771
|
* @returns {Object | void} Migration results
|
|
29772
29772
|
*/
|
|
29773
29773
|
processCollaborationMigrations() {
|
|
29774
|
-
if (console.debug("[checkVersionMigrations] Current editor version", "0.11.
|
|
29774
|
+
if (console.debug("[checkVersionMigrations] Current editor version", "0.11.42"), !this.options.ydoc) return;
|
|
29775
29775
|
let e = this.options.ydoc.getMap("meta").get("version");
|
|
29776
29776
|
e || (e = "initial"), console.debug("[checkVersionMigrations] Document version", e);
|
|
29777
29777
|
const n = mw(e) || [], r = this.state.plugins.find((i) => i.key.startsWith("y-sync"));
|
|
@@ -46158,7 +46158,7 @@ const rU = {
|
|
|
46158
46158
|
}, m = (g, v) => {
|
|
46159
46159
|
h();
|
|
46160
46160
|
const x = g.dropdownValueKey.value ? v[g.dropdownValueKey.value] : v.label;
|
|
46161
|
-
n("command", { item: g, argument: x });
|
|
46161
|
+
n("command", { item: g, argument: x, option: v });
|
|
46162
46162
|
}, y = (g) => {
|
|
46163
46163
|
h();
|
|
46164
46164
|
};
|
|
@@ -46239,7 +46239,7 @@ const rU = {
|
|
|
46239
46239
|
], 2))), 128))
|
|
46240
46240
|
], 4));
|
|
46241
46241
|
}
|
|
46242
|
-
}, $l = /* @__PURE__ */ St(cU, [["__scopeId", "data-v-
|
|
46242
|
+
}, $l = /* @__PURE__ */ St(cU, [["__scopeId", "data-v-01872c2d"]]), uU = {
|
|
46243
46243
|
__name: "Toolbar",
|
|
46244
46244
|
emits: ["command", "toggle", "select"],
|
|
46245
46245
|
setup(t, { emit: e }) {
|
|
@@ -46259,8 +46259,8 @@ const rU = {
|
|
|
46259
46259
|
}
|
|
46260
46260
|
}, c = PR(async () => {
|
|
46261
46261
|
await n.$toolbar.onToolbarResize(), r.value += 1;
|
|
46262
|
-
}, 300), u = ({ item: d, argument: p }) => {
|
|
46263
|
-
n.$toolbar.emitCommand({ item: d, argument: p });
|
|
46262
|
+
}, 300), u = ({ item: d, argument: p, option: f }) => {
|
|
46263
|
+
n.$toolbar.emitCommand({ item: d, argument: p, option: f });
|
|
46264
46264
|
};
|
|
46265
46265
|
return (d, p) => (xe(), Ee("div", {
|
|
46266
46266
|
class: "superdoc-toolbar",
|
|
@@ -46288,7 +46288,7 @@ const rU = {
|
|
|
46288
46288
|
}, null, 8, ["toolbar-items"])) : nt("", !0)
|
|
46289
46289
|
]));
|
|
46290
46290
|
}
|
|
46291
|
-
}, dU = /* @__PURE__ */ St(uU, [["__scopeId", "data-v-
|
|
46291
|
+
}, dU = /* @__PURE__ */ St(uU, [["__scopeId", "data-v-abd0fb95"]]), pU = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights", CS = "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: ";
|
|
46292
46292
|
async function $S(t, e = {}) {
|
|
46293
46293
|
const n = e.apiKey, r = e.endpoint || pU;
|
|
46294
46294
|
try {
|
|
@@ -48233,7 +48233,8 @@ class HV extends MU {
|
|
|
48233
48233
|
groups: null,
|
|
48234
48234
|
editor: null,
|
|
48235
48235
|
aiApiKey: null,
|
|
48236
|
-
aiEndpoint: null
|
|
48236
|
+
aiEndpoint: null,
|
|
48237
|
+
customButtons: []
|
|
48237
48238
|
}), Nb(this, As, {
|
|
48238
48239
|
/**
|
|
48239
48240
|
* Handles zoom level changes
|
|
@@ -48475,7 +48476,7 @@ class HV extends MU {
|
|
|
48475
48476
|
* @returns {ToolbarItem[]} An array of toolbar items in the specified group
|
|
48476
48477
|
*/
|
|
48477
48478
|
getToolbarItemByGroup(e) {
|
|
48478
|
-
return this.toolbarItems.filter((n) => n.group
|
|
48479
|
+
return this.toolbarItems.filter((n) => (n.group?.value || "center") === e);
|
|
48479
48480
|
}
|
|
48480
48481
|
/**
|
|
48481
48482
|
* Get a toolbar item by name
|
|
@@ -48537,16 +48538,22 @@ class HV extends MU {
|
|
|
48537
48538
|
* @param {*} [params.argument] - The argument passed to the command
|
|
48538
48539
|
* @returns {*} The result of the executed command, undefined if no result is returned
|
|
48539
48540
|
*/
|
|
48540
|
-
emitCommand({ item: e, argument: n }) {
|
|
48541
|
+
emitCommand({ item: e, argument: n, option: r }) {
|
|
48541
48542
|
this.activeEditor?.focus();
|
|
48542
|
-
const { command:
|
|
48543
|
-
if (
|
|
48544
|
-
if (this.log("(emmitCommand) Command:",
|
|
48545
|
-
|
|
48546
|
-
|
|
48547
|
-
|
|
48543
|
+
const { command: o } = e;
|
|
48544
|
+
if (o) {
|
|
48545
|
+
if (this.log("(emmitCommand) Command:", o, `
|
|
48546
|
+
item:`, e, `
|
|
48547
|
+
argument:`, n, `
|
|
48548
|
+
option:`, r), o in qd(this, As))
|
|
48549
|
+
return qd(this, As)[o]({ item: e, argument: n });
|
|
48550
|
+
if (o in this.activeEditor?.commands)
|
|
48551
|
+
this.activeEditor.commands[o](n);
|
|
48552
|
+
else if (typeof o == "function")
|
|
48553
|
+
o({ item: e, argument: n, option: r });
|
|
48548
48554
|
else
|
|
48549
|
-
throw new Error(`[super-toolbar 🎨] Command not found: ${
|
|
48555
|
+
throw new Error(`[super-toolbar 🎨] Command not found: ${o}`);
|
|
48556
|
+
this.updateToolbarState();
|
|
48550
48557
|
}
|
|
48551
48558
|
}
|
|
48552
48559
|
}
|
|
@@ -48566,14 +48573,15 @@ IS = function() {
|
|
|
48566
48573
|
* @returns {void}
|
|
48567
48574
|
*/
|
|
48568
48575
|
yf = function(t, e, n = !1) {
|
|
48569
|
-
const r = document.documentElement.clientWidth, { defaultItems: o, overflowItems: i } = UH(t, n, r, this.role, e);
|
|
48570
|
-
|
|
48571
|
-
|
|
48572
|
-
...
|
|
48576
|
+
const r = document.documentElement.clientWidth, { defaultItems: o, overflowItems: i } = UH(t, n, r, this.role, e), s = this.config.customButtons || [];
|
|
48577
|
+
s.length && o.push(...s.map((c) => Je({ ...c })));
|
|
48578
|
+
let a = [
|
|
48579
|
+
...o.map((c) => c.name.value),
|
|
48580
|
+
...i.map((c) => c.name.value)
|
|
48573
48581
|
];
|
|
48574
|
-
this.config.groups && (
|
|
48575
|
-
const
|
|
48576
|
-
this.toolbarItems =
|
|
48582
|
+
this.config.groups && (a = Object.values(this.config.groups).flatMap((c) => c));
|
|
48583
|
+
const l = o.filter((c) => a.includes(c.name.value)).filter((c) => !this.config.excludeItems.includes(c.name.value));
|
|
48584
|
+
this.toolbarItems = l, this.overflowItems = i.filter((c) => a.includes(c.name.value));
|
|
48577
48585
|
}, /**
|
|
48578
48586
|
* Initialize default fonts from the editor
|
|
48579
48587
|
* @private
|