@harbour-enterprises/superdoc 0.14.0-next.2 → 0.14.0-next.21
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/{eventemitter3-BrspJk8q.es.js → eventemitter3-BIPEy-pY.es.js} +1 -1
- package/dist/chunks/{eventemitter3-DfVviFzP.cjs → eventemitter3-DGnD-HK9.cjs} +1 -1
- package/dist/chunks/{index-Diu6UKHt.es.js → index-BvK-G6B1.es.js} +4 -4
- package/dist/chunks/{index-B4J7wgs6.cjs → index-CCRVYhTn.cjs} +2 -2
- package/dist/chunks/{index-Cdsq63Xq.cjs → index-CgJ5KVh6.cjs} +4 -4
- package/dist/chunks/{index-Hr3Um-Bg.es.js → index-oHslWah4.es.js} +2 -2
- package/dist/chunks/{jszip-DckFs3A7.es.js → jszip-CYDYUNnI.es.js} +1 -1
- package/dist/chunks/{jszip-BTAcmbVg.cjs → jszip-D5XoMX4C.cjs} +1 -1
- package/dist/chunks/{super-editor.es-C6TRTeBI.es.js → super-editor.es-Cu7C5Ezf.es.js} +3414 -2237
- package/dist/chunks/{super-editor.es-DFls-Ipj.cjs → super-editor.es-DM3LYkiV.cjs} +3402 -2225
- package/dist/chunks/{url-BIzg4y2i.cjs → url-BG1Z_Z2_.cjs} +2 -2
- package/dist/chunks/{url-CHayXMZH.es.js → url-Dvx6wrNT.es.js} +2 -2
- package/dist/chunks/{vue-Bi1uWinj.es.js → vue-lU0o_RlU.es.js} +35 -15
- package/dist/chunks/{vue-HIY1g7dm.cjs → vue-tQYF719J.cjs} +24 -4
- package/dist/chunks/{xml-js-BjqmFOSP.cjs → xml-js-BHJlXtfU.cjs} +13 -6
- package/dist/chunks/{xml-js-CfClL-1b.es.js → xml-js-DNISVjNF.es.js} +13 -6
- package/dist/composables/use-ai.d.ts +1 -3
- package/dist/composables/use-ai.d.ts.map +1 -1
- package/dist/core/SuperDoc.d.ts +5 -0
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/helpers/floor.d.ts +2 -0
- package/dist/helpers/floor.d.ts.map +1 -0
- package/dist/stores/hrbr-fields-store.d.ts.map +1 -1
- package/dist/style.css +407 -291
- package/dist/super-editor/ai-writer.es.js +18 -33
- package/dist/super-editor/chunks/{converter-2R-ZXcMD.js → converter-BnCzxu5M.js} +1685 -1609
- package/dist/super-editor/chunks/{docx-zipper-D1Hg-x9a.js → docx-zipper-BPw_B6hI.js} +1 -1
- package/dist/super-editor/chunks/{editor-DYjOoB1N.js → editor-DD4MGOZb.js} +1788 -1251
- package/dist/super-editor/chunks/{toolbar-WyGfV3qj.js → toolbar-BCtZctWE.js} +33 -38
- package/dist/super-editor/components/cursor-helpers.d.ts +23 -0
- package/dist/super-editor/components/cursor-helpers.d.ts.map +1 -1
- package/dist/super-editor/components/slash-menu/constants.d.ts +64 -0
- package/dist/super-editor/components/slash-menu/constants.d.ts.map +1 -0
- package/dist/super-editor/components/slash-menu/menuItems.d.ts +35 -0
- package/dist/super-editor/components/slash-menu/menuItems.d.ts.map +1 -0
- package/dist/super-editor/components/slash-menu/utils.d.ts +10 -0
- package/dist/super-editor/components/slash-menu/utils.d.ts.map +1 -0
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/toolbarIcons.d.ts +3 -12
- package/dist/super-editor/components/toolbar/toolbarTexts.d.ts +0 -11
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +12 -4
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/InputRule.d.ts.map +1 -1
- package/dist/super-editor/core/commands/decreaseListIndent.d.ts.map +1 -1
- package/dist/super-editor/core/commands/deleteListItem.d.ts.map +1 -1
- package/dist/super-editor/core/commands/deleteSelection.d.ts +2 -0
- package/dist/super-editor/core/commands/deleteSelection.d.ts.map +1 -1
- package/dist/super-editor/core/commands/increaseListIndent.d.ts.map +1 -1
- package/dist/super-editor/core/commands/joinBackward.d.ts.map +1 -1
- package/dist/super-editor/core/commands/joinForward.d.ts.map +1 -1
- package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
- package/dist/super-editor/core/commands/toggleList.d.ts +5 -1
- package/dist/super-editor/core/commands/toggleList.d.ts.map +1 -1
- package/dist/super-editor/core/extensions/keymap.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/list-numbering-helpers.d.ts +6 -5
- package/dist/super-editor/core/helpers/list-numbering-helpers.d.ts.map +1 -1
- 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/core/super-converter/v2/importer/annotationImporter.d.ts +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/hyperlinkImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
- package/dist/super-editor/core/utilities/clipboardUtils.d.ts +27 -0
- package/dist/super-editor/core/utilities/clipboardUtils.d.ts.map +1 -0
- package/dist/super-editor/core/utilities/index.d.ts +1 -0
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/ai/ai-plugin.d.ts.map +1 -1
- package/dist/super-editor/extensions/bullet-list/bullet-list.d.ts.map +1 -1
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/findRemovedFieldAnnotations.d.ts.map +1 -1
- package/dist/super-editor/extensions/index.d.ts.map +1 -1
- package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
- package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts +0 -3
- package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts.map +1 -1
- package/dist/super-editor/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination.d.ts.map +1 -1
- package/dist/super-editor/extensions/paragraph/paragraph.d.ts.map +1 -1
- package/dist/super-editor/extensions/slash-menu/index.d.ts +2 -0
- package/dist/super-editor/extensions/slash-menu/index.d.ts.map +1 -0
- package/dist/super-editor/extensions/slash-menu/slash-menu.d.ts +4 -0
- package/dist/super-editor/extensions/slash-menu/slash-menu.d.ts.map +1 -0
- package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/index.d.ts +1 -1
- package/dist/super-editor/index.d.ts.map +1 -1
- package/dist/super-editor/style.css +368 -261
- package/dist/super-editor/super-editor.es.js +1202 -608
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +3 -2
- package/dist/super-editor.es.js +15 -14
- package/dist/superdoc.cjs +89 -76
- package/dist/superdoc.es.js +141 -128
- package/dist/superdoc.umd.js +3716 -2509
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/superdoc.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a, S, i,
|
|
3
|
-
import {
|
|
4
|
-
import { B as Buffer$2 } from "./chunks/jszip-
|
|
1
|
+
import { p as index$1, C as CommentsPluginKey, g as TrackChangesBasePluginKey, E as Editor, m as getRichTextExtensions, e as SuperInput, d as SuperEditor, A as AIWriter, f as SuperToolbar, h as createZip } from "./chunks/super-editor.es-Cu7C5Ezf.es.js";
|
|
2
|
+
import { a, S, i, o } from "./chunks/super-editor.es-Cu7C5Ezf.es.js";
|
|
3
|
+
import { a0 as effectScope, r as ref, $ as markRaw, p as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a4 as hasInjectionContext, N as reactive, u as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a8 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, Y as resolveDynamicComponent } from "./chunks/vue-lU0o_RlU.es.js";
|
|
4
|
+
import { B as Buffer$2 } from "./chunks/jszip-CYDYUNnI.es.js";
|
|
5
5
|
import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
|
6
|
-
import { E as EventEmitter } from "./chunks/eventemitter3-
|
|
6
|
+
import { E as EventEmitter } from "./chunks/eventemitter3-BIPEy-pY.es.js";
|
|
7
7
|
import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
|
|
8
8
|
import * as Y from "yjs";
|
|
9
9
|
import { Doc, Map as Map$2 } from "yjs";
|
|
@@ -345,8 +345,8 @@ function _crc32(buf, previous) {
|
|
|
345
345
|
previous = previous.readUInt32BE(0);
|
|
346
346
|
}
|
|
347
347
|
let crc = ~~previous ^ -1;
|
|
348
|
-
for (var
|
|
349
|
-
crc = CRC_TABLE[(crc ^ buf[
|
|
348
|
+
for (var n = 0; n < buf.length; n++) {
|
|
349
|
+
crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
|
|
350
350
|
}
|
|
351
351
|
return crc ^ -1;
|
|
352
352
|
}
|
|
@@ -814,8 +814,8 @@ const piniaSymbol = process$1.env.NODE_ENV !== "production" ? Symbol("pinia") :
|
|
|
814
814
|
/* istanbul ignore next */
|
|
815
815
|
Symbol()
|
|
816
816
|
);
|
|
817
|
-
function isPlainObject$1(
|
|
818
|
-
return
|
|
817
|
+
function isPlainObject$1(o2) {
|
|
818
|
+
return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
|
|
819
819
|
}
|
|
820
820
|
var MutationType;
|
|
821
821
|
(function(MutationType2) {
|
|
@@ -967,8 +967,8 @@ function toastMessage(message, type) {
|
|
|
967
967
|
console.log(piniaMessage);
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
function isPinia(
|
|
971
|
-
return "_a" in
|
|
970
|
+
function isPinia(o2) {
|
|
971
|
+
return "_a" in o2 && "install" in o2;
|
|
972
972
|
}
|
|
973
973
|
function checkClipboardAccess() {
|
|
974
974
|
if (!("clipboard" in navigator)) {
|
|
@@ -1679,8 +1679,8 @@ function shouldHydrate(obj) {
|
|
|
1679
1679
|
return !isPlainObject$1(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
|
|
1680
1680
|
}
|
|
1681
1681
|
const { assign } = Object;
|
|
1682
|
-
function isComputed(
|
|
1683
|
-
return !!(isRef(
|
|
1682
|
+
function isComputed(o2) {
|
|
1683
|
+
return !!(isRef(o2) && o2.effect);
|
|
1684
1684
|
}
|
|
1685
1685
|
function createOptionsStore(id, options, pinia, hot) {
|
|
1686
1686
|
const { state, actions, getters } = options;
|
|
@@ -2155,8 +2155,8 @@ function useField(field) {
|
|
|
2155
2155
|
const originalJSON = field;
|
|
2156
2156
|
const fieldStyle = reactive({
|
|
2157
2157
|
fontFamily: field.fontfamily || "Arial",
|
|
2158
|
-
fontSize: field.font_size || "
|
|
2159
|
-
originalFontSize: field.original_font_size || "
|
|
2158
|
+
fontSize: field.font_size || "12pt",
|
|
2159
|
+
originalFontSize: field.original_font_size || "12pt"
|
|
2160
2160
|
});
|
|
2161
2161
|
const logicRules = ref(field.logicrules);
|
|
2162
2162
|
const hidden = ref(false);
|
|
@@ -2428,7 +2428,7 @@ hasConf("production");
|
|
|
2428
2428
|
const forceColor = isNode && isOneOf(process$1.env.FORCE_COLOR, ["true", "1", "2"]);
|
|
2429
2429
|
forceColor || !hasParam("--no-colors") && // @todo deprecate --no-colors
|
|
2430
2430
|
!hasConf("no-color") && (!isNode || process$1.stdout.isTTY) && (!isNode || hasParam("--color") || getVariable("COLORTERM") !== null || (getVariable("TERM") || "").includes("color"));
|
|
2431
|
-
const floor = Math.floor;
|
|
2431
|
+
const floor$1 = Math.floor;
|
|
2432
2432
|
const min = (a2, b) => a2 < b ? a2 : b;
|
|
2433
2433
|
const max = (a2, b) => a2 > b ? a2 : b;
|
|
2434
2434
|
const pow = Math.pow;
|
|
@@ -2473,7 +2473,7 @@ const write = (encoder, num) => {
|
|
|
2473
2473
|
const writeVarUint = (encoder, num) => {
|
|
2474
2474
|
while (num > BITS7) {
|
|
2475
2475
|
write(encoder, BIT8 | BITS7 & num);
|
|
2476
|
-
num = floor(num / 128);
|
|
2476
|
+
num = floor$1(num / 128);
|
|
2477
2477
|
}
|
|
2478
2478
|
write(encoder, BITS7 & num);
|
|
2479
2479
|
};
|
|
@@ -2861,7 +2861,7 @@ class Awareness extends Observable {
|
|
|
2861
2861
|
if (remove.length > 0) {
|
|
2862
2862
|
removeAwarenessStates(this, remove, "timeout");
|
|
2863
2863
|
}
|
|
2864
|
-
}, floor(outdatedTimeout / 10));
|
|
2864
|
+
}, floor$1(outdatedTimeout / 10));
|
|
2865
2865
|
doc.on("destroy", () => {
|
|
2866
2866
|
this.destroy();
|
|
2867
2867
|
});
|
|
@@ -4225,7 +4225,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
|
|
|
4225
4225
|
return group.some((c2) => c2.conversationId === dialog.conversationId);
|
|
4226
4226
|
});
|
|
4227
4227
|
if (overlapsGroup) {
|
|
4228
|
-
const filtered = overlaps.filter((
|
|
4228
|
+
const filtered = overlaps.filter((o2) => !overlapsGroup.some((o22) => o22.conversationId === o22.conversationId));
|
|
4229
4229
|
overlapsGroup.push(...filtered);
|
|
4230
4230
|
} else {
|
|
4231
4231
|
overlappingComments.value.unshift(overlaps);
|
|
@@ -5229,14 +5229,14 @@ const colors = {
|
|
|
5229
5229
|
function hsv2rgb(h2, s, v) {
|
|
5230
5230
|
s /= 100;
|
|
5231
5231
|
v /= 100;
|
|
5232
|
-
let f = (
|
|
5232
|
+
let f = (n, k = (n + h2 / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
5233
5233
|
return [f(5) * 255, f(3) * 255, f(1) * 255];
|
|
5234
5234
|
}
|
|
5235
5235
|
function hsl2rgb(h2, s, l) {
|
|
5236
5236
|
s /= 100;
|
|
5237
5237
|
l /= 100;
|
|
5238
5238
|
let a2 = s * Math.min(l, 1 - l);
|
|
5239
|
-
let f = (
|
|
5239
|
+
let f = (n, k = (n + h2 / 30) % 12) => l - a2 * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
5240
5240
|
return [f(0) * 255, f(8) * 255, f(4) * 255];
|
|
5241
5241
|
}
|
|
5242
5242
|
const prefix = "^\\s*";
|
|
@@ -7457,9 +7457,9 @@ var Scheduler = function() {
|
|
|
7457
7457
|
return Scheduler2;
|
|
7458
7458
|
}();
|
|
7459
7459
|
var scheduler = new Scheduler();
|
|
7460
|
-
var updateCount = function(
|
|
7461
|
-
!watching &&
|
|
7462
|
-
watching +=
|
|
7460
|
+
var updateCount = function(n) {
|
|
7461
|
+
!watching && n > 0 && scheduler.start();
|
|
7462
|
+
watching += n;
|
|
7463
7463
|
!watching && scheduler.stop();
|
|
7464
7464
|
};
|
|
7465
7465
|
var skipNotifyOnElement = function(target) {
|
|
@@ -8516,9 +8516,9 @@ function isPrototype(value) {
|
|
|
8516
8516
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a;
|
|
8517
8517
|
return value === proto;
|
|
8518
8518
|
}
|
|
8519
|
-
function baseTimes(
|
|
8520
|
-
var index2 = -1, result = Array(
|
|
8521
|
-
while (++index2 <
|
|
8519
|
+
function baseTimes(n, iteratee) {
|
|
8520
|
+
var index2 = -1, result = Array(n);
|
|
8521
|
+
while (++index2 < n) {
|
|
8522
8522
|
result[index2] = iteratee(index2);
|
|
8523
8523
|
}
|
|
8524
8524
|
return result;
|
|
@@ -13318,7 +13318,6 @@ const style$2 = cB("icon", `
|
|
|
13318
13318
|
display: inline-block;
|
|
13319
13319
|
position: relative;
|
|
13320
13320
|
fill: currentColor;
|
|
13321
|
-
transform: translateZ(0);
|
|
13322
13321
|
`, [cM("color-transition", {
|
|
13323
13322
|
transition: "color .3s var(--n-bezier)"
|
|
13324
13323
|
}), cM("depth", {
|
|
@@ -14695,7 +14694,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
14695
14694
|
return target;
|
|
14696
14695
|
};
|
|
14697
14696
|
const _hoisted_1$g = { class: "user-container" };
|
|
14698
|
-
const _hoisted_2$
|
|
14697
|
+
const _hoisted_2$9 = ["src"];
|
|
14699
14698
|
const _hoisted_3$7 = {
|
|
14700
14699
|
key: 1,
|
|
14701
14700
|
class: "user-bg"
|
|
@@ -14720,14 +14719,14 @@ const _sfc_main$h = {
|
|
|
14720
14719
|
key: 0,
|
|
14721
14720
|
class: "user-bg",
|
|
14722
14721
|
src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
|
|
14723
|
-
}, null, 8, _hoisted_2$
|
|
14722
|
+
}, null, 8, _hoisted_2$9)) : (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))
|
|
14724
14723
|
]);
|
|
14725
14724
|
};
|
|
14726
14725
|
}
|
|
14727
14726
|
};
|
|
14728
14727
|
const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-53e13009"]]);
|
|
14729
14728
|
const _hoisted_1$f = { class: "comment-option" };
|
|
14730
|
-
const _hoisted_2$
|
|
14729
|
+
const _hoisted_2$8 = ["innerHTML"];
|
|
14731
14730
|
const _hoisted_3$6 = { class: "option-state" };
|
|
14732
14731
|
const _hoisted_4$4 = ["innerHTML"];
|
|
14733
14732
|
const _sfc_main$g = {
|
|
@@ -14768,11 +14767,11 @@ const _sfc_main$g = {
|
|
|
14768
14767
|
}
|
|
14769
14768
|
];
|
|
14770
14769
|
const getState = computed(() => {
|
|
14771
|
-
return options.find((
|
|
14770
|
+
return options.find((o2) => o2.key === activeState.value)?.label;
|
|
14772
14771
|
});
|
|
14773
14772
|
const getStyle = computed(() => {
|
|
14774
14773
|
if (!props.state) return {};
|
|
14775
|
-
const activeOption = options.find((
|
|
14774
|
+
const activeOption = options.find((o2) => o2.key === activeState.value);
|
|
14776
14775
|
if (!activeOption) return {};
|
|
14777
14776
|
const style2 = { backgroundColor: activeOption.backgroundColor };
|
|
14778
14777
|
if (props.isDisabled) {
|
|
@@ -14783,7 +14782,7 @@ const _sfc_main$g = {
|
|
|
14783
14782
|
});
|
|
14784
14783
|
const handleSelect = (key, suppressEmit = false) => {
|
|
14785
14784
|
activeState.value = key;
|
|
14786
|
-
activeIcon.value = options.find((
|
|
14785
|
+
activeIcon.value = options.find((o2) => o2.key === key)?.iconString;
|
|
14787
14786
|
if (suppressEmit) return;
|
|
14788
14787
|
emit("select", key);
|
|
14789
14788
|
};
|
|
@@ -14811,7 +14810,7 @@ const _sfc_main$g = {
|
|
|
14811
14810
|
createBaseVNode("div", {
|
|
14812
14811
|
class: "active-icon",
|
|
14813
14812
|
innerHTML: activeIcon.value
|
|
14814
|
-
}, null, 8, _hoisted_2$
|
|
14813
|
+
}, null, 8, _hoisted_2$8),
|
|
14815
14814
|
createBaseVNode("div", _hoisted_3$6, toDisplayString(getState.value), 1),
|
|
14816
14815
|
createBaseVNode("div", {
|
|
14817
14816
|
class: "dropdown-caret",
|
|
@@ -14840,7 +14839,7 @@ function formatDate(timestamp) {
|
|
|
14840
14839
|
return formattedDate;
|
|
14841
14840
|
}
|
|
14842
14841
|
const _hoisted_1$e = { class: "card-section comment-header" };
|
|
14843
|
-
const _hoisted_2$
|
|
14842
|
+
const _hoisted_2$7 = { class: "comment-header-left" };
|
|
14844
14843
|
const _hoisted_3$5 = { class: "user-info" };
|
|
14845
14844
|
const _hoisted_4$3 = { class: "user-name" };
|
|
14846
14845
|
const _hoisted_5$2 = {
|
|
@@ -14936,7 +14935,7 @@ const _sfc_main$f = {
|
|
|
14936
14935
|
});
|
|
14937
14936
|
return (_ctx, _cache) => {
|
|
14938
14937
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
14939
|
-
createBaseVNode("div", _hoisted_2$
|
|
14938
|
+
createBaseVNode("div", _hoisted_2$7, [
|
|
14940
14939
|
createVNode(Avatar, {
|
|
14941
14940
|
user: getCurrentUser.value,
|
|
14942
14941
|
class: "avatar"
|
|
@@ -15048,7 +15047,7 @@ const _hoisted_1$c = {
|
|
|
15048
15047
|
key: 0,
|
|
15049
15048
|
class: "existing-internal-input"
|
|
15050
15049
|
};
|
|
15051
|
-
const _hoisted_2$
|
|
15050
|
+
const _hoisted_2$6 = {
|
|
15052
15051
|
key: 0,
|
|
15053
15052
|
class: "card-section comment-body"
|
|
15054
15053
|
};
|
|
@@ -15312,7 +15311,7 @@ const _sfc_main$d = {
|
|
|
15312
15311
|
onReject: handleReject,
|
|
15313
15312
|
onOverflowSelect: ($event) => handleOverflowSelect($event, comment)
|
|
15314
15313
|
}, null, 8, ["config", "timestamp", "comment", "onOverflowSelect"]),
|
|
15315
|
-
comment.trackedChange ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
15314
|
+
comment.trackedChange ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
15316
15315
|
createBaseVNode("div", _hoisted_3$4, [
|
|
15317
15316
|
createBaseVNode("div", _hoisted_4$2, [
|
|
15318
15317
|
comment.trackedChangeType === "trackFormat" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
@@ -15385,7 +15384,7 @@ const _sfc_main$d = {
|
|
|
15385
15384
|
};
|
|
15386
15385
|
const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ff48cd67"]]);
|
|
15387
15386
|
const _hoisted_1$b = { class: "comments-list" };
|
|
15388
|
-
const _hoisted_2$
|
|
15387
|
+
const _hoisted_2$5 = { key: 0 };
|
|
15389
15388
|
const _hoisted_3$3 = { class: "comment-item" };
|
|
15390
15389
|
const _hoisted_4$1 = { key: 1 };
|
|
15391
15390
|
const _hoisted_5 = { class: "comment-item" };
|
|
@@ -15419,7 +15418,7 @@ const _sfc_main$c = {
|
|
|
15419
15418
|
});
|
|
15420
15419
|
return (_ctx, _cache) => {
|
|
15421
15420
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
15422
|
-
__props.showMainComments ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
15421
|
+
__props.showMainComments ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
15423
15422
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getGroupedComments).parentComments, (comment) => {
|
|
15424
15423
|
return openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
15425
15424
|
createVNode(CommentDialog, { comment }, null, 8, ["comment"])
|
|
@@ -17215,8 +17214,8 @@ var __webpack_modules__ = {
|
|
|
17215
17214
|
var ceil = Math.ceil;
|
|
17216
17215
|
var floor2 = Math.floor;
|
|
17217
17216
|
module2.exports = Math.trunc || function trunc(x) {
|
|
17218
|
-
var
|
|
17219
|
-
return (
|
|
17217
|
+
var n = +x;
|
|
17218
|
+
return (n > 0 ? floor2 : ceil)(n);
|
|
17220
17219
|
};
|
|
17221
17220
|
}
|
|
17222
17221
|
),
|
|
@@ -19744,7 +19743,7 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
19744
19743
|
return shadow2(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
|
|
19745
19744
|
}
|
|
19746
19745
|
}
|
|
19747
|
-
const hexNumbers = Array.from(Array(256).keys(), (
|
|
19746
|
+
const hexNumbers = Array.from(Array(256).keys(), (n) => n.toString(16).padStart(2, "0"));
|
|
19748
19747
|
class Util2 {
|
|
19749
19748
|
static makeHexColor(r, g, b) {
|
|
19750
19749
|
return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
|
|
@@ -20236,12 +20235,12 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
20236
20235
|
const filter = info2.filter = this.#createFilter(id);
|
|
20237
20236
|
this.#addTransferMapConversion(table, table, table, filter);
|
|
20238
20237
|
this.#addGrayConversion(filter);
|
|
20239
|
-
const getSteps = (c2,
|
|
20238
|
+
const getSteps = (c2, n) => {
|
|
20240
20239
|
const start = fgRGB[c2] / 255;
|
|
20241
20240
|
const end = bgRGB[c2] / 255;
|
|
20242
|
-
const arr = new Array(
|
|
20243
|
-
for (let i2 = 0; i2 <=
|
|
20244
|
-
arr[i2] = start + i2 /
|
|
20241
|
+
const arr = new Array(n + 1);
|
|
20242
|
+
for (let i2 = 0; i2 <= n; i2++) {
|
|
20243
|
+
arr[i2] = start + i2 / n * (end - start);
|
|
20245
20244
|
}
|
|
20246
20245
|
return arr.join(",");
|
|
20247
20246
|
};
|
|
@@ -20327,13 +20326,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
20327
20326
|
[fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB];
|
|
20328
20327
|
}
|
|
20329
20328
|
this.#defs.style.color = "";
|
|
20330
|
-
const getSteps = (fg, bg,
|
|
20329
|
+
const getSteps = (fg, bg, n) => {
|
|
20331
20330
|
const arr = new Array(256);
|
|
20332
|
-
const step = (bgGray - fgGray) /
|
|
20331
|
+
const step = (bgGray - fgGray) / n;
|
|
20333
20332
|
const newStart = fg / 255;
|
|
20334
|
-
const newStep = (bg - fg) / (255 *
|
|
20333
|
+
const newStep = (bg - fg) / (255 * n);
|
|
20335
20334
|
let prev = 0;
|
|
20336
|
-
for (let i2 = 0; i2 <=
|
|
20335
|
+
for (let i2 = 0; i2 <= n; i2++) {
|
|
20337
20336
|
const k = Math.round(fgGray + i2 * step);
|
|
20338
20337
|
const value = newStart + i2 * newStep;
|
|
20339
20338
|
for (let j = prev; j <= k; j++) {
|
|
@@ -24390,20 +24389,20 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
24390
24389
|
"./chunks/empty-smM22Y5N.es.js"
|
|
24391
24390
|
), http = await import(
|
|
24392
24391
|
/*webpackIgnore: true*/
|
|
24393
|
-
"./chunks/index-
|
|
24394
|
-
).then((
|
|
24392
|
+
"./chunks/index-BvK-G6B1.es.js"
|
|
24393
|
+
).then((n) => n.i), https = await import(
|
|
24395
24394
|
/*webpackIgnore: true*/
|
|
24396
|
-
"./chunks/index-
|
|
24397
|
-
).then((
|
|
24395
|
+
"./chunks/index-oHslWah4.es.js"
|
|
24396
|
+
).then((n) => n.i), url = await import(
|
|
24398
24397
|
/*webpackIgnore: true*/
|
|
24399
|
-
"./chunks/url-
|
|
24400
|
-
).then((
|
|
24398
|
+
"./chunks/url-Dvx6wrNT.es.js"
|
|
24399
|
+
).then((n) => n.u);
|
|
24401
24400
|
let canvas, path2d;
|
|
24402
24401
|
try {
|
|
24403
24402
|
canvas = await import(
|
|
24404
24403
|
/*webpackIgnore: true*/
|
|
24405
24404
|
"./chunks/__vite-browser-external-CURh0WXD.es.js"
|
|
24406
|
-
).then((
|
|
24405
|
+
).then((n) => n._);
|
|
24407
24406
|
} catch {
|
|
24408
24407
|
}
|
|
24409
24408
|
try {
|
|
@@ -28116,26 +28115,26 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
28116
28115
|
let match2;
|
|
28117
28116
|
const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
|
|
28118
28117
|
while ((match2 = iter.exec(contentDispositionStr)) !== null) {
|
|
28119
|
-
let [,
|
|
28120
|
-
|
|
28121
|
-
if (
|
|
28122
|
-
if (
|
|
28118
|
+
let [, n, quot, part] = match2;
|
|
28119
|
+
n = parseInt(n, 10);
|
|
28120
|
+
if (n in matches) {
|
|
28121
|
+
if (n === 0) {
|
|
28123
28122
|
break;
|
|
28124
28123
|
}
|
|
28125
28124
|
continue;
|
|
28126
28125
|
}
|
|
28127
|
-
matches[
|
|
28126
|
+
matches[n] = [quot, part];
|
|
28128
28127
|
}
|
|
28129
28128
|
const parts = [];
|
|
28130
|
-
for (let
|
|
28131
|
-
if (!(
|
|
28129
|
+
for (let n = 0; n < matches.length; ++n) {
|
|
28130
|
+
if (!(n in matches)) {
|
|
28132
28131
|
break;
|
|
28133
28132
|
}
|
|
28134
|
-
let [quot, part] = matches[
|
|
28133
|
+
let [quot, part] = matches[n];
|
|
28135
28134
|
part = rfc2616unquote(part);
|
|
28136
28135
|
if (quot) {
|
|
28137
28136
|
part = unescape(part);
|
|
28138
|
-
if (
|
|
28137
|
+
if (n === 0) {
|
|
28139
28138
|
part = rfc5987decode(part);
|
|
28140
28139
|
}
|
|
28141
28140
|
}
|
|
@@ -31466,8 +31465,8 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
|
|
|
31466
31465
|
const version2 = "4.3.136";
|
|
31467
31466
|
const build2 = "0cec64437";
|
|
31468
31467
|
__webpack_require__$1(670);
|
|
31469
|
-
function makeColorComp(
|
|
31470
|
-
return Math.floor(Math.max(0, Math.min(1,
|
|
31468
|
+
function makeColorComp(n) {
|
|
31469
|
+
return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");
|
|
31471
31470
|
}
|
|
31472
31471
|
function scaleAndClamp(x) {
|
|
31473
31472
|
return Math.max(0, Math.min(255, 255 * x));
|
|
@@ -42987,9 +42986,9 @@ class TextHighlighter {
|
|
|
42987
42986
|
let clearedUntilDivIdx = -1;
|
|
42988
42987
|
for (const match2 of matches) {
|
|
42989
42988
|
const begin = Math.max(clearedUntilDivIdx, match2.begin.divIdx);
|
|
42990
|
-
for (let
|
|
42991
|
-
const div = textDivs[
|
|
42992
|
-
div.textContent = textContentItemsStr[
|
|
42989
|
+
for (let n = begin, end = match2.end.divIdx; n <= end; n++) {
|
|
42990
|
+
const div = textDivs[n];
|
|
42991
|
+
div.textContent = textContentItemsStr[n];
|
|
42993
42992
|
div.className = "";
|
|
42994
42993
|
}
|
|
42995
42994
|
clearedUntilDivIdx = match2.end.divIdx + 1;
|
|
@@ -46264,7 +46263,7 @@ const _hoisted_1$9 = {
|
|
|
46264
46263
|
class: "comments-container",
|
|
46265
46264
|
id: "commentsContainer"
|
|
46266
46265
|
};
|
|
46267
|
-
const _hoisted_2$
|
|
46266
|
+
const _hoisted_2$4 = { class: "comments-layer" };
|
|
46268
46267
|
const _hoisted_3$2 = ["onClick", "data-id"];
|
|
46269
46268
|
const _sfc_main$a = {
|
|
46270
46269
|
__name: "CommentsLayer",
|
|
@@ -46359,7 +46358,7 @@ const _sfc_main$a = {
|
|
|
46359
46358
|
});
|
|
46360
46359
|
return (_ctx, _cache) => {
|
|
46361
46360
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
46362
|
-
createBaseVNode("div", _hoisted_2$
|
|
46361
|
+
createBaseVNode("div", _hoisted_2$4, [
|
|
46363
46362
|
(openBlock(true), createElementBlock(Fragment, null, renderList(getCurrentComments.value, (conversation) => {
|
|
46364
46363
|
return openBlock(), createElementBlock("div", {
|
|
46365
46364
|
class: "sd-comment-anchor sd-highlight",
|
|
@@ -46375,7 +46374,7 @@ const _sfc_main$a = {
|
|
|
46375
46374
|
};
|
|
46376
46375
|
const CommentsLayer = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0dbcad34"]]);
|
|
46377
46376
|
const _hoisted_1$8 = { class: "sidebar-container calculation-container" };
|
|
46378
|
-
const _hoisted_2$
|
|
46377
|
+
const _hoisted_2$3 = ["id"];
|
|
46379
46378
|
const _sfc_main$9 = {
|
|
46380
46379
|
__name: "FloatingComments",
|
|
46381
46380
|
props: {
|
|
@@ -46511,7 +46510,7 @@ const _sfc_main$9 = {
|
|
|
46511
46510
|
parent: __props.parent,
|
|
46512
46511
|
comment
|
|
46513
46512
|
}, null, 8, ["parent", "comment"]))
|
|
46514
|
-
], 8, _hoisted_2$
|
|
46513
|
+
], 8, _hoisted_2$3)
|
|
46515
46514
|
]);
|
|
46516
46515
|
}), 128))
|
|
46517
46516
|
]),
|
|
@@ -46576,7 +46575,6 @@ const _sfc_main$8 = {
|
|
|
46576
46575
|
};
|
|
46577
46576
|
const TextField = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-f3984d30"]]);
|
|
46578
46577
|
const _hoisted_1$7 = ["innerHTML"];
|
|
46579
|
-
const _hoisted_2$3 = { key: 1 };
|
|
46580
46578
|
const _sfc_main$7 = {
|
|
46581
46579
|
__name: "ParagraphField",
|
|
46582
46580
|
props: {
|
|
@@ -46596,24 +46594,24 @@ const _sfc_main$7 = {
|
|
|
46596
46594
|
}
|
|
46597
46595
|
},
|
|
46598
46596
|
setup(__props) {
|
|
46599
|
-
const props = __props;
|
|
46600
46597
|
const getStyle = computed(() => {
|
|
46601
|
-
const fontSize2 = props.styleOverride?.originalFontSize || 120;
|
|
46602
46598
|
return {
|
|
46603
|
-
fontSize:
|
|
46599
|
+
fontSize: "11pt"
|
|
46604
46600
|
};
|
|
46605
46601
|
});
|
|
46606
46602
|
return (_ctx, _cache) => {
|
|
46607
46603
|
return __props.field.value ? (openBlock(), createElementBlock("div", {
|
|
46608
46604
|
key: 0,
|
|
46609
46605
|
class: "paragraph-field",
|
|
46610
|
-
style: normalizeStyle(getStyle.value),
|
|
46611
46606
|
innerHTML: __props.field.value
|
|
46612
|
-
}, null,
|
|
46607
|
+
}, null, 8, _hoisted_1$7)) : (openBlock(), createElementBlock("span", {
|
|
46608
|
+
key: 1,
|
|
46609
|
+
style: normalizeStyle(getStyle.value)
|
|
46610
|
+
}, toDisplayString(__props.field.placeholder || __props.field.label), 5));
|
|
46613
46611
|
};
|
|
46614
46612
|
}
|
|
46615
46613
|
};
|
|
46616
|
-
const ParagraphField = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
46614
|
+
const ParagraphField = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-512d3292"]]);
|
|
46617
46615
|
const _hoisted_1$6 = ["src"];
|
|
46618
46616
|
const _hoisted_2$2 = { key: 1 };
|
|
46619
46617
|
const _sfc_main$6 = {
|
|
@@ -46689,25 +46687,46 @@ const _sfc_main$5 = {
|
|
|
46689
46687
|
optionId: {
|
|
46690
46688
|
type: String,
|
|
46691
46689
|
required: true
|
|
46690
|
+
},
|
|
46691
|
+
styleOverride: {
|
|
46692
|
+
type: Object,
|
|
46693
|
+
required: false,
|
|
46694
|
+
default: () => ({})
|
|
46692
46695
|
}
|
|
46693
46696
|
},
|
|
46694
46697
|
setup(__props) {
|
|
46695
46698
|
const props = __props;
|
|
46696
46699
|
const getValue2 = computed(() => {
|
|
46697
|
-
const match2 = props.field.options.find((
|
|
46700
|
+
const match2 = props.field.options.find((o2) => o2.annotationId.includes(props.optionId));
|
|
46698
46701
|
return match2?.checked;
|
|
46699
46702
|
});
|
|
46703
|
+
const getPreviewStyle = computed(() => {
|
|
46704
|
+
const borderWidth = 2;
|
|
46705
|
+
const width = Number.parseFloat(props.styleOverride?.coordinates?.minWidth || 0) - borderWidth + "px";
|
|
46706
|
+
const height = Number.parseFloat(props.styleOverride?.coordinates?.minHeight || 0) - borderWidth + "px";
|
|
46707
|
+
const fontSize2 = parseFloat(width) + "pt";
|
|
46708
|
+
return {
|
|
46709
|
+
width,
|
|
46710
|
+
height,
|
|
46711
|
+
fontSize: fontSize2
|
|
46712
|
+
};
|
|
46713
|
+
});
|
|
46700
46714
|
return (_ctx, _cache) => {
|
|
46701
46715
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
46702
|
-
|
|
46716
|
+
props.isEditing ? (openBlock(), createBlock(unref(NCheckbox), {
|
|
46717
|
+
key: 0,
|
|
46703
46718
|
checked: getValue2.value,
|
|
46704
46719
|
disabled: !props.isEditing
|
|
46705
|
-
}, null, 8, ["checked", "disabled"])
|
|
46720
|
+
}, null, 8, ["checked", "disabled"])) : (openBlock(), createElementBlock("div", {
|
|
46721
|
+
key: 1,
|
|
46722
|
+
class: "checkbox-preview",
|
|
46723
|
+
style: normalizeStyle(getPreviewStyle.value)
|
|
46724
|
+
}, toDisplayString(getValue2.value ? "x" : ""), 5))
|
|
46706
46725
|
]);
|
|
46707
46726
|
};
|
|
46708
46727
|
}
|
|
46709
46728
|
};
|
|
46710
|
-
const CheckboxField = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
46729
|
+
const CheckboxField = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-94bf1b6c"]]);
|
|
46711
46730
|
const _hoisted_1$4 = { key: 0 };
|
|
46712
46731
|
const _sfc_main$4 = {
|
|
46713
46732
|
__name: "SelectField",
|
|
@@ -46743,6 +46762,10 @@ const _sfc_main$4 = {
|
|
|
46743
46762
|
}
|
|
46744
46763
|
};
|
|
46745
46764
|
const SelectField = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b8cacb22"]]);
|
|
46765
|
+
const floor = (val, precision) => {
|
|
46766
|
+
const multiplier = 10 ** precision;
|
|
46767
|
+
return Math.floor(val * multiplier) / multiplier;
|
|
46768
|
+
};
|
|
46746
46769
|
const useHrbrFieldsStore = /* @__PURE__ */ defineStore("hrbr-fields", () => {
|
|
46747
46770
|
const superdocStore = useSuperdocStore();
|
|
46748
46771
|
const { documents, pages } = storeToRefs(superdocStore);
|
|
@@ -46789,8 +46812,9 @@ const useHrbrFieldsStore = /* @__PURE__ */ defineStore("hrbr-fields", () => {
|
|
|
46789
46812
|
const pageLeft = pageBounds.left - bounds.left;
|
|
46790
46813
|
const mappedCoordinates = _mapAnnotation(coordinates, scale, pageBottom, pageLeft);
|
|
46791
46814
|
const annotationStyle = {
|
|
46792
|
-
fontSize: annotation.original_font_size + "
|
|
46793
|
-
|
|
46815
|
+
fontSize: floor(annotation.original_font_size * scale, 2) + "pt",
|
|
46816
|
+
fontFamily: annotation.fontfamily || "Arial",
|
|
46817
|
+
originalFontSize: floor(annotation.original_font_size * scale, 2),
|
|
46794
46818
|
coordinates: mappedCoordinates
|
|
46795
46819
|
};
|
|
46796
46820
|
const field = {
|
|
@@ -47050,32 +47074,11 @@ function useSelectedText(editorRef) {
|
|
|
47050
47074
|
selectedText
|
|
47051
47075
|
};
|
|
47052
47076
|
}
|
|
47053
|
-
function useAi({
|
|
47077
|
+
function useAi({ activeEditorRef }) {
|
|
47054
47078
|
const showAiLayer = ref(false);
|
|
47055
47079
|
const showAiWriter = ref(false);
|
|
47056
47080
|
const aiWriterPosition = reactive({ top: 0, left: 0 });
|
|
47057
47081
|
const aiLayer = ref(null);
|
|
47058
|
-
const handleAiHighlight = ({ type, data }) => {
|
|
47059
|
-
if (!aiLayer.value) return;
|
|
47060
|
-
const editor = activeEditorRef.value;
|
|
47061
|
-
switch (type) {
|
|
47062
|
-
case "add":
|
|
47063
|
-
if (editor && !editor.isDestroyed) {
|
|
47064
|
-
editor.commands.clearAiHighlightStyle();
|
|
47065
|
-
}
|
|
47066
|
-
aiLayer.value.addAiHighlight();
|
|
47067
|
-
break;
|
|
47068
|
-
case "remove":
|
|
47069
|
-
if (editor && !editor.isDestroyed) {
|
|
47070
|
-
editor.commands.clearAiHighlightStyle();
|
|
47071
|
-
}
|
|
47072
|
-
aiLayer.value.removeAiHighlight();
|
|
47073
|
-
break;
|
|
47074
|
-
case "update":
|
|
47075
|
-
aiLayer.value.updateAiHighlight();
|
|
47076
|
-
break;
|
|
47077
|
-
}
|
|
47078
|
-
};
|
|
47079
47082
|
const showAiWriterAtCursor = () => {
|
|
47080
47083
|
const editor = activeEditorRef.value;
|
|
47081
47084
|
if (!editor || editor.isDestroyed) {
|
|
@@ -47086,7 +47089,7 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
|
|
|
47086
47089
|
const { view } = editor;
|
|
47087
47090
|
const { selection } = view.state;
|
|
47088
47091
|
if (!selection.empty) {
|
|
47089
|
-
|
|
47092
|
+
editor.commands.insertAiMark();
|
|
47090
47093
|
}
|
|
47091
47094
|
let coords;
|
|
47092
47095
|
try {
|
|
@@ -47125,7 +47128,12 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
|
|
|
47125
47128
|
showAiLayer.value = value;
|
|
47126
47129
|
};
|
|
47127
47130
|
const handleAiToolClick = () => {
|
|
47128
|
-
|
|
47131
|
+
const editor = activeEditorRef.value;
|
|
47132
|
+
if (!editor || editor.isDestroyed) {
|
|
47133
|
+
console.error("[useAi] Editor not available");
|
|
47134
|
+
return;
|
|
47135
|
+
}
|
|
47136
|
+
editor.commands.insertAiMark();
|
|
47129
47137
|
showAiWriterAtCursor();
|
|
47130
47138
|
};
|
|
47131
47139
|
return {
|
|
@@ -47136,7 +47144,6 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
|
|
|
47136
47144
|
aiLayer,
|
|
47137
47145
|
// Methods
|
|
47138
47146
|
initAiLayer,
|
|
47139
|
-
handleAiHighlight,
|
|
47140
47147
|
showAiWriterAtCursor,
|
|
47141
47148
|
handleAiWriterClose,
|
|
47142
47149
|
handleAiToolClick
|
|
@@ -47205,11 +47212,9 @@ const _sfc_main = {
|
|
|
47205
47212
|
aiWriterPosition,
|
|
47206
47213
|
aiLayer,
|
|
47207
47214
|
initAiLayer,
|
|
47208
|
-
handleAiHighlight,
|
|
47209
47215
|
handleAiWriterClose,
|
|
47210
47216
|
handleAiToolClick
|
|
47211
47217
|
} = useAi({
|
|
47212
|
-
emitAiHighlight: (params2) => proxy.$superdoc.emit("ai-highlight", params2),
|
|
47213
47218
|
activeEditorRef
|
|
47214
47219
|
});
|
|
47215
47220
|
const hrbrFieldsLayer = ref(null);
|
|
@@ -47338,6 +47343,7 @@ const _sfc_main = {
|
|
|
47338
47343
|
isInternal: proxy.$superdoc.config.isInternal,
|
|
47339
47344
|
annotations: proxy.$superdoc.config.annotations,
|
|
47340
47345
|
isCommentsEnabled: proxy.$superdoc.config.modules?.comments,
|
|
47346
|
+
isAiEnabled: proxy.$superdoc.config.modules?.ai,
|
|
47341
47347
|
onBeforeCreate: onEditorBeforeCreate,
|
|
47342
47348
|
onCreate: onEditorCreate,
|
|
47343
47349
|
onDestroy: onEditorDestroy,
|
|
@@ -47406,11 +47412,9 @@ const _sfc_main = {
|
|
|
47406
47412
|
if (isCommentsEnabled.value && !modules.comments.readOnly) {
|
|
47407
47413
|
document.addEventListener("mousedown", handleDocumentMouseDown);
|
|
47408
47414
|
}
|
|
47409
|
-
proxy.$superdoc.on("ai-highlight", handleAiHighlight);
|
|
47410
47415
|
});
|
|
47411
47416
|
onBeforeUnmount(() => {
|
|
47412
47417
|
document.removeEventListener("mousedown", handleDocumentMouseDown);
|
|
47413
|
-
proxy.$superdoc.off("ai-highlight", handleAiHighlight);
|
|
47414
47418
|
});
|
|
47415
47419
|
const selectionLayer = ref(null);
|
|
47416
47420
|
const isDragging = ref(false);
|
|
@@ -47680,15 +47684,14 @@ const _sfc_main = {
|
|
|
47680
47684
|
"handle-close": unref(handleAiWriterClose),
|
|
47681
47685
|
editor: unref(proxy).$superdoc.activeEditor,
|
|
47682
47686
|
"api-key": unref(proxy).$superdoc.toolbar?.config?.aiApiKey,
|
|
47683
|
-
endpoint: unref(proxy).$superdoc.config?.modules?.ai?.endpoint
|
|
47684
|
-
|
|
47685
|
-
}, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint", "onAiHighlight"])
|
|
47687
|
+
endpoint: unref(proxy).$superdoc.config?.modules?.ai?.endpoint
|
|
47688
|
+
}, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint"])
|
|
47686
47689
|
], 4)) : createCommentVNode("", true)
|
|
47687
47690
|
], 2);
|
|
47688
47691
|
};
|
|
47689
47692
|
}
|
|
47690
47693
|
};
|
|
47691
|
-
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
47694
|
+
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1c59a62"]]);
|
|
47692
47695
|
const createSuperdocVueApp = () => {
|
|
47693
47696
|
const app = createApp(App);
|
|
47694
47697
|
const pinia = createPinia();
|
|
@@ -47787,7 +47790,7 @@ class SuperDoc extends EventEmitter {
|
|
|
47787
47790
|
this.config.colors = shuffleArray(this.config.colors);
|
|
47788
47791
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
47789
47792
|
this.colorIndex = 0;
|
|
47790
|
-
this.version = "0.14.0-next.
|
|
47793
|
+
this.version = "0.14.0-next.21";
|
|
47791
47794
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
47792
47795
|
this.superdocId = config.superdocId || v4();
|
|
47793
47796
|
this.colors = this.config.colors;
|
|
@@ -48030,6 +48033,19 @@ class SuperDoc extends EventEmitter {
|
|
|
48030
48033
|
doc.rulers = this.config.rulers;
|
|
48031
48034
|
});
|
|
48032
48035
|
}
|
|
48036
|
+
/**
|
|
48037
|
+
* Toggle pagination for SuperEditors
|
|
48038
|
+
* @returns {void}
|
|
48039
|
+
*/
|
|
48040
|
+
togglePagination() {
|
|
48041
|
+
this.config.pagination = !this.config.pagination;
|
|
48042
|
+
this.superdocStore.documents.forEach((doc) => {
|
|
48043
|
+
const editor = doc.getEditor();
|
|
48044
|
+
if (editor) {
|
|
48045
|
+
editor.commands.togglePagination();
|
|
48046
|
+
}
|
|
48047
|
+
});
|
|
48048
|
+
}
|
|
48033
48049
|
#addToolbar() {
|
|
48034
48050
|
const moduleConfig = this.config.modules?.toolbar || {};
|
|
48035
48051
|
this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;
|
|
@@ -48053,9 +48069,6 @@ class SuperDoc extends EventEmitter {
|
|
|
48053
48069
|
};
|
|
48054
48070
|
this.toolbar = new SuperToolbar(config);
|
|
48055
48071
|
this.toolbar.on("superdoc-command", this.onToolbarCommand.bind(this));
|
|
48056
|
-
this.toolbar.on("ai-highlight", ({ type, data }) => {
|
|
48057
|
-
this.emit("ai-highlight", { type, data });
|
|
48058
|
-
});
|
|
48059
48072
|
this.once("editorCreate", () => this.toolbar.updateToolbarState());
|
|
48060
48073
|
}
|
|
48061
48074
|
/**
|
|
@@ -48379,6 +48392,6 @@ export {
|
|
|
48379
48392
|
i as fieldAnnotationHelpers,
|
|
48380
48393
|
getFileObject,
|
|
48381
48394
|
getRichTextExtensions,
|
|
48382
|
-
|
|
48395
|
+
o as superEditorHelpers,
|
|
48383
48396
|
index$1 as trackChangesHelpers
|
|
48384
48397
|
};
|