@harbour-enterprises/superdoc 0.14.6-next.3 → 0.14.6-next.4
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-Doj47_Uk.es.js → super-editor.es-BSwiXGrJ.es.js} +18 -5
- package/dist/chunks/{super-editor.es-Do3auYDx.cjs → super-editor.es-Bmml9Uk7.cjs} +18 -5
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Ro5dTlZK.js → converter-B6n6gLBy.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-Bw5bp8Iy.js → docx-zipper-CSMGmfdk.js} +1 -1
- package/dist/super-editor/chunks/{editor-CxB6pOHC.js → editor-BBuhT-Hl.js} +18 -5
- package/dist/super-editor/chunks/{toolbar-BAcW5u42.js → toolbar-DQKVvAMM.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +7 -0
- package/dist/super-editor/core/Editor.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/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- 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 +19 -6
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -24305,7 +24305,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
24305
24305
|
return;
|
|
24306
24306
|
}
|
|
24307
24307
|
}
|
|
24308
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.
|
|
24308
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.4") {
|
|
24309
24309
|
const customLocation = "docProps/custom.xml";
|
|
24310
24310
|
if (!docx[customLocation]) {
|
|
24311
24311
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24781,7 +24781,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24781
24781
|
function generateCustomXml() {
|
|
24782
24782
|
return DEFAULT_CUSTOM_XML;
|
|
24783
24783
|
}
|
|
24784
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.
|
|
24784
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.4") {
|
|
24785
24785
|
return {
|
|
24786
24786
|
type: "element",
|
|
24787
24787
|
name: "property",
|
|
@@ -40168,6 +40168,7 @@ const onHeaderFooterDataUpdate = async ({ editor, transaction }, mainEditor, sec
|
|
|
40168
40168
|
});
|
|
40169
40169
|
});
|
|
40170
40170
|
mainEditor.converter[`${type2}s`][sectionId] = updatedData;
|
|
40171
|
+
mainEditor.setOptions({ isHeaderFooterChanged: editor.docChanged });
|
|
40171
40172
|
await updateYdocDocxData(mainEditor);
|
|
40172
40173
|
};
|
|
40173
40174
|
const setEditorToolbar = ({ editor }, mainEditor) => {
|
|
@@ -41719,7 +41720,9 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41719
41720
|
// telemetry
|
|
41720
41721
|
telemetry: null,
|
|
41721
41722
|
// Docx xml updated by User
|
|
41722
|
-
customUpdatedFiles: {}
|
|
41723
|
+
customUpdatedFiles: {},
|
|
41724
|
+
isHeaderFooterChanged: false,
|
|
41725
|
+
isCustomXmlChanged: false
|
|
41723
41726
|
});
|
|
41724
41727
|
__privateMethod$1(this, _Editor_instances, initContainerElement_fn).call(this, options2);
|
|
41725
41728
|
__privateMethod$1(this, _Editor_instances, checkHeadless_fn).call(this, options2);
|
|
@@ -41737,6 +41740,13 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41737
41740
|
this.setHighContrastMode = setHighContrastMode;
|
|
41738
41741
|
initMode();
|
|
41739
41742
|
}
|
|
41743
|
+
/**
|
|
41744
|
+
* Getter which indicates if any changes happen in Editor
|
|
41745
|
+
* @returns {boolean}
|
|
41746
|
+
*/
|
|
41747
|
+
get docChanged() {
|
|
41748
|
+
return this.options.isHeaderFooterChanged || this.options.isCustomXmlChanged || !this.options.initialState.doc.eq(this.state.doc);
|
|
41749
|
+
}
|
|
41740
41750
|
mount(el) {
|
|
41741
41751
|
__privateMethod$1(this, _Editor_instances, createView_fn).call(this, el);
|
|
41742
41752
|
window.setTimeout(() => {
|
|
@@ -42375,7 +42385,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42375
42385
|
* @returns {Object | void} Migration results
|
|
42376
42386
|
*/
|
|
42377
42387
|
processCollaborationMigrations() {
|
|
42378
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.
|
|
42388
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.4");
|
|
42379
42389
|
if (!this.options.ydoc) return;
|
|
42380
42390
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
42381
42391
|
let docVersion = metaMap.get("version");
|
|
@@ -42457,6 +42467,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42457
42467
|
const internalFileXml = this.converter.schemaToXml(updatedContent);
|
|
42458
42468
|
this.options.customUpdatedFiles[name] = String(internalFileXml);
|
|
42459
42469
|
}
|
|
42470
|
+
this.options.isCustomXmlChanged = true;
|
|
42460
42471
|
}
|
|
42461
42472
|
/**
|
|
42462
42473
|
* Get all nodes of a specific type
|
|
@@ -42743,10 +42754,11 @@ createView_fn = function(element) {
|
|
|
42743
42754
|
let doc2 = __privateMethod$1(this, _Editor_instances, generatePmData_fn).call(this);
|
|
42744
42755
|
const state2 = { schema: this.schema };
|
|
42745
42756
|
if (!this.options.ydoc) state2.doc = doc2;
|
|
42757
|
+
this.options.initialState = EditorState.create(state2);
|
|
42746
42758
|
this.view = new EditorView(element, {
|
|
42747
42759
|
...this.options.editorProps,
|
|
42748
42760
|
dispatchTransaction: __privateMethod$1(this, _Editor_instances, dispatchTransaction_fn).bind(this),
|
|
42749
|
-
state:
|
|
42761
|
+
state: this.options.initialState,
|
|
42750
42762
|
handleClick: __privateMethod$1(this, _Editor_instances, handleNodeSelection_fn).bind(this),
|
|
42751
42763
|
handleDoubleClick: async (view, pos, event) => {
|
|
42752
42764
|
if (this.options.documentMode !== "editing") return;
|
|
@@ -42786,6 +42798,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
42786
42798
|
console.debug("🔗 [super-editor] Collaboration ready");
|
|
42787
42799
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
42788
42800
|
this.options.collaborationIsReady = true;
|
|
42801
|
+
this.options.initialState = this.state;
|
|
42789
42802
|
const { tr } = this.state;
|
|
42790
42803
|
tr.setMeta("collaborationReady", true);
|
|
42791
42804
|
this.view.dispatch(tr);
|
|
@@ -24322,7 +24322,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
24322
24322
|
return;
|
|
24323
24323
|
}
|
|
24324
24324
|
}
|
|
24325
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.
|
|
24325
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.4") {
|
|
24326
24326
|
const customLocation = "docProps/custom.xml";
|
|
24327
24327
|
if (!docx[customLocation]) {
|
|
24328
24328
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24798,7 +24798,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24798
24798
|
function generateCustomXml() {
|
|
24799
24799
|
return DEFAULT_CUSTOM_XML;
|
|
24800
24800
|
}
|
|
24801
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.
|
|
24801
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.4") {
|
|
24802
24802
|
return {
|
|
24803
24803
|
type: "element",
|
|
24804
24804
|
name: "property",
|
|
@@ -40185,6 +40185,7 @@ const onHeaderFooterDataUpdate = async ({ editor, transaction }, mainEditor, sec
|
|
|
40185
40185
|
});
|
|
40186
40186
|
});
|
|
40187
40187
|
mainEditor.converter[`${type2}s`][sectionId] = updatedData;
|
|
40188
|
+
mainEditor.setOptions({ isHeaderFooterChanged: editor.docChanged });
|
|
40188
40189
|
await updateYdocDocxData(mainEditor);
|
|
40189
40190
|
};
|
|
40190
40191
|
const setEditorToolbar = ({ editor }, mainEditor) => {
|
|
@@ -41736,7 +41737,9 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41736
41737
|
// telemetry
|
|
41737
41738
|
telemetry: null,
|
|
41738
41739
|
// Docx xml updated by User
|
|
41739
|
-
customUpdatedFiles: {}
|
|
41740
|
+
customUpdatedFiles: {},
|
|
41741
|
+
isHeaderFooterChanged: false,
|
|
41742
|
+
isCustomXmlChanged: false
|
|
41740
41743
|
});
|
|
41741
41744
|
__privateMethod$1(this, _Editor_instances, initContainerElement_fn).call(this, options2);
|
|
41742
41745
|
__privateMethod$1(this, _Editor_instances, checkHeadless_fn).call(this, options2);
|
|
@@ -41754,6 +41757,13 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41754
41757
|
this.setHighContrastMode = setHighContrastMode;
|
|
41755
41758
|
initMode();
|
|
41756
41759
|
}
|
|
41760
|
+
/**
|
|
41761
|
+
* Getter which indicates if any changes happen in Editor
|
|
41762
|
+
* @returns {boolean}
|
|
41763
|
+
*/
|
|
41764
|
+
get docChanged() {
|
|
41765
|
+
return this.options.isHeaderFooterChanged || this.options.isCustomXmlChanged || !this.options.initialState.doc.eq(this.state.doc);
|
|
41766
|
+
}
|
|
41757
41767
|
mount(el) {
|
|
41758
41768
|
__privateMethod$1(this, _Editor_instances, createView_fn).call(this, el);
|
|
41759
41769
|
window.setTimeout(() => {
|
|
@@ -42392,7 +42402,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42392
42402
|
* @returns {Object | void} Migration results
|
|
42393
42403
|
*/
|
|
42394
42404
|
processCollaborationMigrations() {
|
|
42395
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.
|
|
42405
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.4");
|
|
42396
42406
|
if (!this.options.ydoc) return;
|
|
42397
42407
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
42398
42408
|
let docVersion = metaMap.get("version");
|
|
@@ -42474,6 +42484,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42474
42484
|
const internalFileXml = this.converter.schemaToXml(updatedContent);
|
|
42475
42485
|
this.options.customUpdatedFiles[name] = String(internalFileXml);
|
|
42476
42486
|
}
|
|
42487
|
+
this.options.isCustomXmlChanged = true;
|
|
42477
42488
|
}
|
|
42478
42489
|
/**
|
|
42479
42490
|
* Get all nodes of a specific type
|
|
@@ -42760,10 +42771,11 @@ createView_fn = function(element) {
|
|
|
42760
42771
|
let doc2 = __privateMethod$1(this, _Editor_instances, generatePmData_fn).call(this);
|
|
42761
42772
|
const state2 = { schema: this.schema };
|
|
42762
42773
|
if (!this.options.ydoc) state2.doc = doc2;
|
|
42774
|
+
this.options.initialState = EditorState.create(state2);
|
|
42763
42775
|
this.view = new EditorView(element, {
|
|
42764
42776
|
...this.options.editorProps,
|
|
42765
42777
|
dispatchTransaction: __privateMethod$1(this, _Editor_instances, dispatchTransaction_fn).bind(this),
|
|
42766
|
-
state:
|
|
42778
|
+
state: this.options.initialState,
|
|
42767
42779
|
handleClick: __privateMethod$1(this, _Editor_instances, handleNodeSelection_fn).bind(this),
|
|
42768
42780
|
handleDoubleClick: async (view, pos, event) => {
|
|
42769
42781
|
if (this.options.documentMode !== "editing") return;
|
|
@@ -42803,6 +42815,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
42803
42815
|
console.debug("🔗 [super-editor] Collaboration ready");
|
|
42804
42816
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
42805
42817
|
this.options.collaborationIsReady = true;
|
|
42818
|
+
this.options.initialState = this.state;
|
|
42806
42819
|
const { tr } = this.state;
|
|
42807
42820
|
tr.setMeta("collaborationReady", true);
|
|
42808
42821
|
this.view.dispatch(tr);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-B6n6gLBy.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-BBuhT-Hl.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
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: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -24324,7 +24324,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
24324
24324
|
return;
|
|
24325
24325
|
}
|
|
24326
24326
|
}
|
|
24327
|
-
static updateDocumentVersion(docx = this.convertedXml, version = "0.14.6-next.
|
|
24327
|
+
static updateDocumentVersion(docx = this.convertedXml, version = "0.14.6-next.4") {
|
|
24328
24328
|
const customLocation = "docProps/custom.xml";
|
|
24329
24329
|
if (!docx[customLocation]) {
|
|
24330
24330
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24803,7 +24803,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24803
24803
|
function generateCustomXml() {
|
|
24804
24804
|
return DEFAULT_CUSTOM_XML;
|
|
24805
24805
|
}
|
|
24806
|
-
function generateSuperdocVersion(pid = 2, version = "0.14.6-next.
|
|
24806
|
+
function generateSuperdocVersion(pid = 2, version = "0.14.6-next.4") {
|
|
24807
24807
|
return {
|
|
24808
24808
|
type: "element",
|
|
24809
24809
|
name: "property",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as process$1, aa as commonjsGlobal, E as Buffer, ab as getDefaultExportFromCjs, ac as getContentTypesFromXml, ad as xmljs } from "./converter-
|
|
1
|
+
import { C as process$1, aa as commonjsGlobal, E as Buffer, ab as getDefaultExportFromCjs, ac as getContentTypesFromXml, ad as xmljs } from "./converter-B6n6gLBy.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, e as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, e as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-B6n6gLBy.js";
|
|
16
16
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
17
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
17
|
+
import { D as DocxZipper } from "./docx-zipper-CSMGmfdk.js";
|
|
18
18
|
function getMarksFromSelection(state) {
|
|
19
19
|
const { from: from2, to, empty: empty2 } = state.selection;
|
|
20
20
|
const marks = [];
|
|
@@ -12877,6 +12877,7 @@ const onHeaderFooterDataUpdate = async ({ editor, transaction }, mainEditor, sec
|
|
|
12877
12877
|
});
|
|
12878
12878
|
});
|
|
12879
12879
|
mainEditor.converter[`${type}s`][sectionId] = updatedData;
|
|
12880
|
+
mainEditor.setOptions({ isHeaderFooterChanged: editor.docChanged });
|
|
12880
12881
|
await updateYdocDocxData(mainEditor);
|
|
12881
12882
|
};
|
|
12882
12883
|
const setEditorToolbar = ({ editor }, mainEditor) => {
|
|
@@ -14456,7 +14457,9 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14456
14457
|
// telemetry
|
|
14457
14458
|
telemetry: null,
|
|
14458
14459
|
// Docx xml updated by User
|
|
14459
|
-
customUpdatedFiles: {}
|
|
14460
|
+
customUpdatedFiles: {},
|
|
14461
|
+
isHeaderFooterChanged: false,
|
|
14462
|
+
isCustomXmlChanged: false
|
|
14460
14463
|
});
|
|
14461
14464
|
__privateMethod(this, _Editor_instances, initContainerElement_fn).call(this, options);
|
|
14462
14465
|
__privateMethod(this, _Editor_instances, checkHeadless_fn).call(this, options);
|
|
@@ -14474,6 +14477,13 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14474
14477
|
this.setHighContrastMode = setHighContrastMode;
|
|
14475
14478
|
initMode();
|
|
14476
14479
|
}
|
|
14480
|
+
/**
|
|
14481
|
+
* Getter which indicates if any changes happen in Editor
|
|
14482
|
+
* @returns {boolean}
|
|
14483
|
+
*/
|
|
14484
|
+
get docChanged() {
|
|
14485
|
+
return this.options.isHeaderFooterChanged || this.options.isCustomXmlChanged || !this.options.initialState.doc.eq(this.state.doc);
|
|
14486
|
+
}
|
|
14477
14487
|
mount(el) {
|
|
14478
14488
|
__privateMethod(this, _Editor_instances, createView_fn).call(this, el);
|
|
14479
14489
|
window.setTimeout(() => {
|
|
@@ -15112,7 +15122,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
15112
15122
|
* @returns {Object | void} Migration results
|
|
15113
15123
|
*/
|
|
15114
15124
|
processCollaborationMigrations() {
|
|
15115
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.
|
|
15125
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.4");
|
|
15116
15126
|
if (!this.options.ydoc) return;
|
|
15117
15127
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
15118
15128
|
let docVersion = metaMap.get("version");
|
|
@@ -15194,6 +15204,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
15194
15204
|
const internalFileXml = this.converter.schemaToXml(updatedContent);
|
|
15195
15205
|
this.options.customUpdatedFiles[name] = String(internalFileXml);
|
|
15196
15206
|
}
|
|
15207
|
+
this.options.isCustomXmlChanged = true;
|
|
15197
15208
|
}
|
|
15198
15209
|
/**
|
|
15199
15210
|
* Get all nodes of a specific type
|
|
@@ -15576,10 +15587,11 @@ createView_fn = function(element) {
|
|
|
15576
15587
|
let doc2 = __privateMethod(this, _Editor_instances, generatePmData_fn).call(this);
|
|
15577
15588
|
const state = { schema: this.schema };
|
|
15578
15589
|
if (!this.options.ydoc) state.doc = doc2;
|
|
15590
|
+
this.options.initialState = EditorState.create(state);
|
|
15579
15591
|
this.view = new EditorView(element, {
|
|
15580
15592
|
...this.options.editorProps,
|
|
15581
15593
|
dispatchTransaction: __privateMethod(this, _Editor_instances, dispatchTransaction_fn).bind(this),
|
|
15582
|
-
state:
|
|
15594
|
+
state: this.options.initialState,
|
|
15583
15595
|
handleClick: __privateMethod(this, _Editor_instances, handleNodeSelection_fn).bind(this),
|
|
15584
15596
|
handleDoubleClick: async (view, pos, event) => {
|
|
15585
15597
|
if (this.options.documentMode !== "editing") return;
|
|
@@ -15629,6 +15641,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
15629
15641
|
console.debug("🔗 [super-editor] Collaboration ready");
|
|
15630
15642
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
15631
15643
|
this.options.collaborationIsReady = true;
|
|
15644
|
+
this.options.initialState = this.state;
|
|
15632
15645
|
const { tr } = this.state;
|
|
15633
15646
|
tr.setMeta("collaborationReady", true);
|
|
15634
15647
|
this.view.dispatch(tr);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { C as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { C as process$1 } from "./converter-B6n6gLBy.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BBuhT-Hl.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -212,8 +212,15 @@ export class Editor extends EventEmitter {
|
|
|
212
212
|
handleImageUpload: any;
|
|
213
213
|
telemetry: any;
|
|
214
214
|
customUpdatedFiles: {};
|
|
215
|
+
isHeaderFooterChanged: boolean;
|
|
216
|
+
isCustomXmlChanged: boolean;
|
|
215
217
|
};
|
|
216
218
|
setHighContrastMode: (value: any) => void;
|
|
219
|
+
/**
|
|
220
|
+
* Getter which indicates if any changes happen in Editor
|
|
221
|
+
* @returns {boolean}
|
|
222
|
+
*/
|
|
223
|
+
get docChanged(): boolean;
|
|
217
224
|
mount(el: any): void;
|
|
218
225
|
unmount(): void;
|
|
219
226
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"AAkCA;;;;GAIG;AAEH;;;;;GAKG;AACH;;;;;EAKE;AAEF;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-BBuhT-Hl.js";
|
|
2
|
+
import "./chunks/converter-B6n6gLBy.js";
|
|
3
|
+
import "./chunks/docx-zipper-CSMGmfdk.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination-helpers.js"],"names":[],"mappings":"AAKA,iDAAqE;AAQ9D,2CAHI,WAAW,OAuCrB;AA8BM;;;;;;;;;QA6EN;AAEM,6EAeN;AAEM;;;;;SAsBN;AAEM;;;
|
|
1
|
+
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination-helpers.js"],"names":[],"mappings":"AAKA,iDAAqE;AAQ9D,2CAHI,WAAW,OAuCrB;AA8BM;;;;;;;;;QA6EN;AAEM,6EAeN;AAEM;;;;;SAsBN;AAEM;;;8DAoBN;0BA3NyB,mBAAmB"}
|
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
12
|
-
import { ab as getDefaultExportFromCjs, J as v4, T as TextSelection$1, ae as vClickOutside, af as readFromClipboard, ag as handleClipboardPaste, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { X } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getMarkRange, f as findParentNode, d as getFileOpener, s as startImageUpload, e as getActiveFormatting, i as isInTable, h as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, j as getStarterExtensions, P as Placeholder, k as getRichTextExtensions, M as Mark, l as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { p, C, T, n, t, q, m, o } from "./chunks/editor-
|
|
12
|
+
import { ab as getDefaultExportFromCjs, J as v4, T as TextSelection$1, ae as vClickOutside, af as readFromClipboard, ag as handleClipboardPaste, a as Plugin } from "./chunks/converter-B6n6gLBy.js";
|
|
13
|
+
import { X } from "./chunks/converter-B6n6gLBy.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getMarkRange, f as findParentNode, d as getFileOpener, s as startImageUpload, e as getActiveFormatting, i as isInTable, h as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, j as getStarterExtensions, P as Placeholder, k as getRichTextExtensions, M as Mark, l as Extension, A as Attribute, N as Node } from "./chunks/editor-BBuhT-Hl.js";
|
|
15
|
+
import { p, C, T, n, t, q, m, o } from "./chunks/editor-BBuhT-Hl.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-DQKVvAMM.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-CSMGmfdk.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
(function(module) {
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-Bmml9Uk7.cjs");
|
|
4
4
|
require("./chunks/vue-tQYF719J.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-BSwiXGrJ.es.js";
|
|
2
2
|
import "./chunks/vue-lU0o_RlU.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-Bmml9Uk7.cjs");
|
|
4
4
|
const vue = require("./chunks/vue-tQYF719J.cjs");
|
|
5
5
|
const jszip = require("./chunks/jszip-D5XoMX4C.cjs");
|
|
6
6
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
|
@@ -47810,7 +47810,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
47810
47810
|
this.config.colors = shuffleArray(this.config.colors);
|
|
47811
47811
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
47812
47812
|
this.colorIndex = 0;
|
|
47813
|
-
this.version = "0.14.6-next.
|
|
47813
|
+
this.version = "0.14.6-next.4";
|
|
47814
47814
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
47815
47815
|
this.superdocId = config.superdocId || uuid.v4();
|
|
47816
47816
|
this.colors = this.config.colors;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { a, S, i, o } from "./chunks/super-editor.es-
|
|
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-BSwiXGrJ.es.js";
|
|
2
|
+
import { a, S, i, o } from "./chunks/super-editor.es-BSwiXGrJ.es.js";
|
|
3
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
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";
|
|
@@ -47793,7 +47793,7 @@ class SuperDoc extends EventEmitter {
|
|
|
47793
47793
|
this.config.colors = shuffleArray(this.config.colors);
|
|
47794
47794
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
47795
47795
|
this.colorIndex = 0;
|
|
47796
|
-
this.version = "0.14.6-next.
|
|
47796
|
+
this.version = "0.14.6-next.4";
|
|
47797
47797
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
47798
47798
|
this.superdocId = config.superdocId || v4();
|
|
47799
47799
|
this.colors = this.config.colors;
|
package/dist/superdoc.umd.js
CHANGED
|
@@ -31700,7 +31700,7 @@
|
|
|
31700
31700
|
return;
|
|
31701
31701
|
}
|
|
31702
31702
|
}
|
|
31703
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.
|
|
31703
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.4") {
|
|
31704
31704
|
const customLocation = "docProps/custom.xml";
|
|
31705
31705
|
if (!docx[customLocation]) {
|
|
31706
31706
|
docx[customLocation] = generateCustomXml();
|
|
@@ -32176,7 +32176,7 @@
|
|
|
32176
32176
|
function generateCustomXml() {
|
|
32177
32177
|
return DEFAULT_CUSTOM_XML;
|
|
32178
32178
|
}
|
|
32179
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.
|
|
32179
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.4") {
|
|
32180
32180
|
return {
|
|
32181
32181
|
type: "element",
|
|
32182
32182
|
name: "property",
|
|
@@ -47563,6 +47563,7 @@
|
|
|
47563
47563
|
});
|
|
47564
47564
|
});
|
|
47565
47565
|
mainEditor.converter[`${type2}s`][sectionId] = updatedData;
|
|
47566
|
+
mainEditor.setOptions({ isHeaderFooterChanged: editor.docChanged });
|
|
47566
47567
|
await updateYdocDocxData(mainEditor);
|
|
47567
47568
|
};
|
|
47568
47569
|
const setEditorToolbar = ({ editor }, mainEditor) => {
|
|
@@ -49114,7 +49115,9 @@
|
|
|
49114
49115
|
// telemetry
|
|
49115
49116
|
telemetry: null,
|
|
49116
49117
|
// Docx xml updated by User
|
|
49117
|
-
customUpdatedFiles: {}
|
|
49118
|
+
customUpdatedFiles: {},
|
|
49119
|
+
isHeaderFooterChanged: false,
|
|
49120
|
+
isCustomXmlChanged: false
|
|
49118
49121
|
});
|
|
49119
49122
|
__privateMethod$1(this, _Editor_instances, initContainerElement_fn).call(this, options2);
|
|
49120
49123
|
__privateMethod$1(this, _Editor_instances, checkHeadless_fn).call(this, options2);
|
|
@@ -49132,6 +49135,13 @@
|
|
|
49132
49135
|
this.setHighContrastMode = setHighContrastMode;
|
|
49133
49136
|
initMode();
|
|
49134
49137
|
}
|
|
49138
|
+
/**
|
|
49139
|
+
* Getter which indicates if any changes happen in Editor
|
|
49140
|
+
* @returns {boolean}
|
|
49141
|
+
*/
|
|
49142
|
+
get docChanged() {
|
|
49143
|
+
return this.options.isHeaderFooterChanged || this.options.isCustomXmlChanged || !this.options.initialState.doc.eq(this.state.doc);
|
|
49144
|
+
}
|
|
49135
49145
|
mount(el) {
|
|
49136
49146
|
__privateMethod$1(this, _Editor_instances, createView_fn).call(this, el);
|
|
49137
49147
|
window.setTimeout(() => {
|
|
@@ -49770,7 +49780,7 @@
|
|
|
49770
49780
|
* @returns {Object | void} Migration results
|
|
49771
49781
|
*/
|
|
49772
49782
|
processCollaborationMigrations() {
|
|
49773
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.
|
|
49783
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.4");
|
|
49774
49784
|
if (!this.options.ydoc) return;
|
|
49775
49785
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
49776
49786
|
let docVersion = metaMap.get("version");
|
|
@@ -49852,6 +49862,7 @@
|
|
|
49852
49862
|
const internalFileXml = this.converter.schemaToXml(updatedContent);
|
|
49853
49863
|
this.options.customUpdatedFiles[name] = String(internalFileXml);
|
|
49854
49864
|
}
|
|
49865
|
+
this.options.isCustomXmlChanged = true;
|
|
49855
49866
|
}
|
|
49856
49867
|
/**
|
|
49857
49868
|
* Get all nodes of a specific type
|
|
@@ -50138,10 +50149,11 @@
|
|
|
50138
50149
|
let doc2 = __privateMethod$1(this, _Editor_instances, generatePmData_fn).call(this);
|
|
50139
50150
|
const state2 = { schema: this.schema };
|
|
50140
50151
|
if (!this.options.ydoc) state2.doc = doc2;
|
|
50152
|
+
this.options.initialState = EditorState.create(state2);
|
|
50141
50153
|
this.view = new EditorView(element, {
|
|
50142
50154
|
...this.options.editorProps,
|
|
50143
50155
|
dispatchTransaction: __privateMethod$1(this, _Editor_instances, dispatchTransaction_fn).bind(this),
|
|
50144
|
-
state:
|
|
50156
|
+
state: this.options.initialState,
|
|
50145
50157
|
handleClick: __privateMethod$1(this, _Editor_instances, handleNodeSelection_fn).bind(this),
|
|
50146
50158
|
handleDoubleClick: async (view, pos, event) => {
|
|
50147
50159
|
if (this.options.documentMode !== "editing") return;
|
|
@@ -50181,6 +50193,7 @@
|
|
|
50181
50193
|
console.debug("🔗 [super-editor] Collaboration ready");
|
|
50182
50194
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
50183
50195
|
this.options.collaborationIsReady = true;
|
|
50196
|
+
this.options.initialState = this.state;
|
|
50184
50197
|
const { tr } = this.state;
|
|
50185
50198
|
tr.setMeta("collaborationReady", true);
|
|
50186
50199
|
this.view.dispatch(tr);
|
|
@@ -95658,7 +95671,7 @@ ${style2}
|
|
|
95658
95671
|
this.config.colors = shuffleArray(this.config.colors);
|
|
95659
95672
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
95660
95673
|
this.colorIndex = 0;
|
|
95661
|
-
this.version = "0.14.6-next.
|
|
95674
|
+
this.version = "0.14.6-next.4";
|
|
95662
95675
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
95663
95676
|
this.superdocId = config.superdocId || v4();
|
|
95664
95677
|
this.colors = this.config.colors;
|