@harbour-enterprises/superdoc 0.13.2-rev10 → 0.13.2-rev11
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-BwWbNxcS.es.js → super-editor.es-C0XuFRew.es.js} +68 -32
- package/dist/chunks/{super-editor.es-Bdu65rjC.cjs → super-editor.es-DNcda5wa.cjs} +68 -32
- package/dist/core/SuperDoc.d.ts +5 -0
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-lPrQA7b1.js → converter-g7XDS8H8.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-HvG9XskR.js → docx-zipper-VpCXV0uV.js} +1 -1
- package/dist/super-editor/chunks/{editor-DbkiH8Up.js → editor-B3V2UfZk.js} +68 -32
- package/dist/super-editor/chunks/{toolbar-JdrfUR1G.js → toolbar-DbwzVBvd.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +11 -4
- 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/extensions/pagination/pagination.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 +15 -2
- package/dist/superdoc.es.js +16 -3
- package/dist/superdoc.umd.js +82 -33
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -23972,7 +23972,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23972
23972
|
return;
|
|
23973
23973
|
}
|
|
23974
23974
|
}
|
|
23975
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-
|
|
23975
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-rev11") {
|
|
23976
23976
|
const customLocation = "docProps/custom.xml";
|
|
23977
23977
|
if (!docx[customLocation]) {
|
|
23978
23978
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24439,7 +24439,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24439
24439
|
function generateCustomXml() {
|
|
24440
24440
|
return DEFAULT_CUSTOM_XML;
|
|
24441
24441
|
}
|
|
24442
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-
|
|
24442
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-rev11") {
|
|
24443
24443
|
return {
|
|
24444
24444
|
type: "element",
|
|
24445
24445
|
name: "property",
|
|
@@ -26972,7 +26972,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
26972
26972
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26973
26973
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
26974
26974
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
26975
|
-
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,
|
|
26975
|
+
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, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
26976
26976
|
function getMarksFromSelection(state2) {
|
|
26977
26977
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
26978
26978
|
const marks = [];
|
|
@@ -39226,6 +39226,8 @@ const createHeaderFooterEditor = ({
|
|
|
39226
39226
|
});
|
|
39227
39227
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
39228
39228
|
const headerFooterEditor = new Editor({
|
|
39229
|
+
documentMode: editor.options.documentMode,
|
|
39230
|
+
role: editor.options.role,
|
|
39229
39231
|
loadFromSchema: true,
|
|
39230
39232
|
mode: "docx",
|
|
39231
39233
|
element: editorContainer,
|
|
@@ -40957,10 +40959,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
40957
40959
|
}
|
|
40958
40960
|
/**
|
|
40959
40961
|
* Unregister a PM plugin
|
|
40960
|
-
* @param {string|Object}
|
|
40962
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
40961
40963
|
* @returns {void}
|
|
40962
40964
|
*/
|
|
40963
|
-
unregisterPlugin(
|
|
40965
|
+
unregisterPlugin(nameOrPluginKey) {
|
|
40964
40966
|
if (this.isDestroyed) return;
|
|
40965
40967
|
const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
40966
40968
|
const state2 = this.state.reconfigure({
|
|
@@ -41038,7 +41040,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41038
41040
|
/**
|
|
41039
41041
|
* Attach styles and attributes to the editor element
|
|
41040
41042
|
*/
|
|
41041
|
-
updateEditorStyles(element, proseMirror) {
|
|
41043
|
+
updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
|
|
41042
41044
|
const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
|
|
41043
41045
|
if (!proseMirror || !element) {
|
|
41044
41046
|
return;
|
|
@@ -41072,9 +41074,12 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41072
41074
|
element.style.webkitOverflowScrolling = "touch";
|
|
41073
41075
|
const defaultLineHeight = 1.2;
|
|
41074
41076
|
proseMirror.style.lineHeight = defaultLineHeight;
|
|
41075
|
-
if (!
|
|
41077
|
+
if (!hasPaginationEnabled) {
|
|
41076
41078
|
proseMirror.style.paddingTop = "1in";
|
|
41077
41079
|
proseMirror.style.paddingBottom = "1in";
|
|
41080
|
+
} else {
|
|
41081
|
+
proseMirror.style.paddingTop = "0";
|
|
41082
|
+
proseMirror.style.paddingBottom = "0";
|
|
41078
41083
|
}
|
|
41079
41084
|
}
|
|
41080
41085
|
/**
|
|
@@ -41085,10 +41090,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41085
41090
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
41086
41091
|
* @returns {void}
|
|
41087
41092
|
*/
|
|
41088
|
-
initDefaultStyles(element = this.element) {
|
|
41093
|
+
initDefaultStyles(element = this.element, isPaginationEnabled = true) {
|
|
41089
41094
|
if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
|
|
41090
41095
|
const proseMirror = element?.querySelector(".ProseMirror");
|
|
41091
|
-
this.updateEditorStyles(element, proseMirror);
|
|
41096
|
+
this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
|
|
41092
41097
|
this.initMobileStyles(element);
|
|
41093
41098
|
}
|
|
41094
41099
|
/**
|
|
@@ -41136,6 +41141,26 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41136
41141
|
}
|
|
41137
41142
|
window.addEventListener("resize", () => handleResize);
|
|
41138
41143
|
}
|
|
41144
|
+
/**
|
|
41145
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
41146
|
+
* @private
|
|
41147
|
+
* @async
|
|
41148
|
+
* @returns {Promise<void>}
|
|
41149
|
+
*/
|
|
41150
|
+
async initPagination() {
|
|
41151
|
+
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41152
|
+
return;
|
|
41153
|
+
}
|
|
41154
|
+
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41155
|
+
if (pagination && this.options.pagination) {
|
|
41156
|
+
console.debug("🔗 [super-editor] Initializing pagination");
|
|
41157
|
+
const sectionData = await initPaginationData(this);
|
|
41158
|
+
this.storage.pagination.sectionData = sectionData;
|
|
41159
|
+
const { state: state2, dispatch } = this.view;
|
|
41160
|
+
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41161
|
+
dispatch(tr);
|
|
41162
|
+
}
|
|
41163
|
+
}
|
|
41139
41164
|
/**
|
|
41140
41165
|
* Get attrs of the currently selected node or mark.
|
|
41141
41166
|
* @param {String} nameOrType
|
|
@@ -41336,7 +41361,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41336
41361
|
* @returns {Object | void} Migration results
|
|
41337
41362
|
*/
|
|
41338
41363
|
processCollaborationMigrations() {
|
|
41339
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-
|
|
41364
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-rev11");
|
|
41340
41365
|
if (!this.options.ydoc) return;
|
|
41341
41366
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41342
41367
|
let docVersion = metaMap.get("version");
|
|
@@ -41386,7 +41411,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41386
41411
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
41387
41412
|
}
|
|
41388
41413
|
if (!this.options.ydoc) {
|
|
41389
|
-
|
|
41414
|
+
this.initPagination();
|
|
41390
41415
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41391
41416
|
}
|
|
41392
41417
|
}
|
|
@@ -41533,8 +41558,6 @@ init_fn = function(options2) {
|
|
|
41533
41558
|
this.on("contentError", this.options.onContentError);
|
|
41534
41559
|
this.on("exception", this.options.onException);
|
|
41535
41560
|
this.mount(this.options.element);
|
|
41536
|
-
this.initDefaultStyles();
|
|
41537
|
-
this.setDocumentMode(options2.documentMode);
|
|
41538
41561
|
if (this.options.isHeadless) return;
|
|
41539
41562
|
this.on("create", this.options.onCreate);
|
|
41540
41563
|
this.on("update", this.options.onUpdate);
|
|
@@ -41552,8 +41575,10 @@ init_fn = function(options2) {
|
|
|
41552
41575
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
41553
41576
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
41554
41577
|
this.initializeCollaborationData();
|
|
41578
|
+
this.initDefaultStyles();
|
|
41579
|
+
this.setDocumentMode(this.options.documentMode);
|
|
41555
41580
|
if (!this.options.ydoc) {
|
|
41556
|
-
|
|
41581
|
+
this.initPagination();
|
|
41557
41582
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41558
41583
|
}
|
|
41559
41584
|
};
|
|
@@ -41600,7 +41625,7 @@ insertNewFileData_fn = function() {
|
|
|
41600
41625
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
41601
41626
|
this.view.dispatch(tr);
|
|
41602
41627
|
setTimeout(() => {
|
|
41603
|
-
|
|
41628
|
+
this.initPagination();
|
|
41604
41629
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41605
41630
|
}, 50);
|
|
41606
41631
|
};
|
|
@@ -41746,7 +41771,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
41746
41771
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
41747
41772
|
this.options.collaborationIsReady = true;
|
|
41748
41773
|
if (!this.options.isNewFile) {
|
|
41749
|
-
|
|
41774
|
+
this.initPagination();
|
|
41750
41775
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41751
41776
|
}
|
|
41752
41777
|
};
|
|
@@ -41763,20 +41788,6 @@ initComments_fn = function() {
|
|
|
41763
41788
|
dispatch(tr);
|
|
41764
41789
|
}, 50);
|
|
41765
41790
|
};
|
|
41766
|
-
initPagination_fn = async function() {
|
|
41767
|
-
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41768
|
-
return;
|
|
41769
|
-
}
|
|
41770
|
-
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41771
|
-
if (pagination && this.options.pagination) {
|
|
41772
|
-
console.debug("🔗 [super-editor] Initializing pagination");
|
|
41773
|
-
const sectionData = await initPaginationData(this);
|
|
41774
|
-
this.storage.pagination.sectionData = sectionData;
|
|
41775
|
-
const { state: state2, dispatch } = this.view;
|
|
41776
|
-
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41777
|
-
dispatch(tr);
|
|
41778
|
-
}
|
|
41779
|
-
};
|
|
41780
41791
|
dispatchTransaction_fn = function(transaction) {
|
|
41781
41792
|
if (this.isDestroyed) return;
|
|
41782
41793
|
let state2;
|
|
@@ -54480,6 +54491,19 @@ const Pagination = Extension.create({
|
|
|
54480
54491
|
return commands2.insertContent({
|
|
54481
54492
|
type: "hardBreak"
|
|
54482
54493
|
});
|
|
54494
|
+
},
|
|
54495
|
+
/**
|
|
54496
|
+
* Toggle pagination on/off
|
|
54497
|
+
* @returns {void}
|
|
54498
|
+
*/
|
|
54499
|
+
togglePagination: () => ({ tr, state: state2, dispatch, editor }) => {
|
|
54500
|
+
const isEnabled = PaginationPluginKey.getState(state2)?.isEnabled;
|
|
54501
|
+
tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
|
|
54502
|
+
if (dispatch) {
|
|
54503
|
+
dispatch(tr);
|
|
54504
|
+
editor.initDefaultStyles(editor.element, !isEnabled);
|
|
54505
|
+
return true;
|
|
54506
|
+
}
|
|
54483
54507
|
}
|
|
54484
54508
|
};
|
|
54485
54509
|
},
|
|
@@ -54505,11 +54529,21 @@ const Pagination = Extension.create({
|
|
|
54505
54529
|
return {
|
|
54506
54530
|
isReadyToInit: false,
|
|
54507
54531
|
decorations: DecorationSet.empty,
|
|
54508
|
-
isDebugging
|
|
54532
|
+
isDebugging,
|
|
54533
|
+
isEnabled: editor.options.pagination
|
|
54509
54534
|
};
|
|
54510
54535
|
},
|
|
54511
54536
|
apply(tr, oldState, prevEditorState, newEditorState) {
|
|
54512
54537
|
const meta = tr.getMeta(PaginationPluginKey);
|
|
54538
|
+
if (meta && "isEnabled" in meta) {
|
|
54539
|
+
const newEnabled = meta.isEnabled;
|
|
54540
|
+
if (newEnabled) shouldUpdate = true;
|
|
54541
|
+
return {
|
|
54542
|
+
...oldState,
|
|
54543
|
+
decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
|
|
54544
|
+
isEnabled: newEnabled
|
|
54545
|
+
};
|
|
54546
|
+
}
|
|
54513
54547
|
if (meta && meta.isReadyToInit) {
|
|
54514
54548
|
shouldUpdate = true;
|
|
54515
54549
|
shouldInitialize = meta.isReadyToInit;
|
|
@@ -54558,6 +54592,7 @@ const Pagination = Extension.create({
|
|
|
54558
54592
|
let previousDecorations = DecorationSet.empty;
|
|
54559
54593
|
return {
|
|
54560
54594
|
update: (view2, prevState) => {
|
|
54595
|
+
if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
|
|
54561
54596
|
if (!shouldUpdate || isUpdating) return;
|
|
54562
54597
|
isUpdating = true;
|
|
54563
54598
|
hasInitialized = true;
|
|
@@ -54569,7 +54604,8 @@ const Pagination = Extension.create({
|
|
|
54569
54604
|
},
|
|
54570
54605
|
props: {
|
|
54571
54606
|
decorations(state2) {
|
|
54572
|
-
|
|
54607
|
+
const pluginState = PaginationPluginKey.getState(state2);
|
|
54608
|
+
return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
|
|
54573
54609
|
}
|
|
54574
54610
|
}
|
|
54575
54611
|
});
|
|
@@ -23989,7 +23989,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23989
23989
|
return;
|
|
23990
23990
|
}
|
|
23991
23991
|
}
|
|
23992
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-
|
|
23992
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-rev11") {
|
|
23993
23993
|
const customLocation = "docProps/custom.xml";
|
|
23994
23994
|
if (!docx[customLocation]) {
|
|
23995
23995
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24456,7 +24456,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24456
24456
|
function generateCustomXml() {
|
|
24457
24457
|
return DEFAULT_CUSTOM_XML;
|
|
24458
24458
|
}
|
|
24459
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-
|
|
24459
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-rev11") {
|
|
24460
24460
|
return {
|
|
24461
24461
|
type: "element",
|
|
24462
24462
|
name: "property",
|
|
@@ -26989,7 +26989,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
26989
26989
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26990
26990
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
26991
26991
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
26992
|
-
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,
|
|
26992
|
+
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, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
26993
26993
|
function getMarksFromSelection(state2) {
|
|
26994
26994
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
26995
26995
|
const marks = [];
|
|
@@ -39243,6 +39243,8 @@ const createHeaderFooterEditor = ({
|
|
|
39243
39243
|
});
|
|
39244
39244
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
39245
39245
|
const headerFooterEditor = new Editor({
|
|
39246
|
+
documentMode: editor.options.documentMode,
|
|
39247
|
+
role: editor.options.role,
|
|
39246
39248
|
loadFromSchema: true,
|
|
39247
39249
|
mode: "docx",
|
|
39248
39250
|
element: editorContainer,
|
|
@@ -40974,10 +40976,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
40974
40976
|
}
|
|
40975
40977
|
/**
|
|
40976
40978
|
* Unregister a PM plugin
|
|
40977
|
-
* @param {string|Object}
|
|
40979
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
40978
40980
|
* @returns {void}
|
|
40979
40981
|
*/
|
|
40980
|
-
unregisterPlugin(
|
|
40982
|
+
unregisterPlugin(nameOrPluginKey) {
|
|
40981
40983
|
if (this.isDestroyed) return;
|
|
40982
40984
|
const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
40983
40985
|
const state2 = this.state.reconfigure({
|
|
@@ -41055,7 +41057,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41055
41057
|
/**
|
|
41056
41058
|
* Attach styles and attributes to the editor element
|
|
41057
41059
|
*/
|
|
41058
|
-
updateEditorStyles(element, proseMirror) {
|
|
41060
|
+
updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
|
|
41059
41061
|
const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
|
|
41060
41062
|
if (!proseMirror || !element) {
|
|
41061
41063
|
return;
|
|
@@ -41089,9 +41091,12 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41089
41091
|
element.style.webkitOverflowScrolling = "touch";
|
|
41090
41092
|
const defaultLineHeight = 1.2;
|
|
41091
41093
|
proseMirror.style.lineHeight = defaultLineHeight;
|
|
41092
|
-
if (!
|
|
41094
|
+
if (!hasPaginationEnabled) {
|
|
41093
41095
|
proseMirror.style.paddingTop = "1in";
|
|
41094
41096
|
proseMirror.style.paddingBottom = "1in";
|
|
41097
|
+
} else {
|
|
41098
|
+
proseMirror.style.paddingTop = "0";
|
|
41099
|
+
proseMirror.style.paddingBottom = "0";
|
|
41095
41100
|
}
|
|
41096
41101
|
}
|
|
41097
41102
|
/**
|
|
@@ -41102,10 +41107,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41102
41107
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
41103
41108
|
* @returns {void}
|
|
41104
41109
|
*/
|
|
41105
|
-
initDefaultStyles(element = this.element) {
|
|
41110
|
+
initDefaultStyles(element = this.element, isPaginationEnabled = true) {
|
|
41106
41111
|
if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
|
|
41107
41112
|
const proseMirror = element?.querySelector(".ProseMirror");
|
|
41108
|
-
this.updateEditorStyles(element, proseMirror);
|
|
41113
|
+
this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
|
|
41109
41114
|
this.initMobileStyles(element);
|
|
41110
41115
|
}
|
|
41111
41116
|
/**
|
|
@@ -41153,6 +41158,26 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41153
41158
|
}
|
|
41154
41159
|
window.addEventListener("resize", () => handleResize);
|
|
41155
41160
|
}
|
|
41161
|
+
/**
|
|
41162
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
41163
|
+
* @private
|
|
41164
|
+
* @async
|
|
41165
|
+
* @returns {Promise<void>}
|
|
41166
|
+
*/
|
|
41167
|
+
async initPagination() {
|
|
41168
|
+
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41169
|
+
return;
|
|
41170
|
+
}
|
|
41171
|
+
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41172
|
+
if (pagination && this.options.pagination) {
|
|
41173
|
+
console.debug("🔗 [super-editor] Initializing pagination");
|
|
41174
|
+
const sectionData = await initPaginationData(this);
|
|
41175
|
+
this.storage.pagination.sectionData = sectionData;
|
|
41176
|
+
const { state: state2, dispatch } = this.view;
|
|
41177
|
+
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41178
|
+
dispatch(tr);
|
|
41179
|
+
}
|
|
41180
|
+
}
|
|
41156
41181
|
/**
|
|
41157
41182
|
* Get attrs of the currently selected node or mark.
|
|
41158
41183
|
* @param {String} nameOrType
|
|
@@ -41353,7 +41378,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41353
41378
|
* @returns {Object | void} Migration results
|
|
41354
41379
|
*/
|
|
41355
41380
|
processCollaborationMigrations() {
|
|
41356
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-
|
|
41381
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-rev11");
|
|
41357
41382
|
if (!this.options.ydoc) return;
|
|
41358
41383
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41359
41384
|
let docVersion = metaMap.get("version");
|
|
@@ -41403,7 +41428,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41403
41428
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
41404
41429
|
}
|
|
41405
41430
|
if (!this.options.ydoc) {
|
|
41406
|
-
|
|
41431
|
+
this.initPagination();
|
|
41407
41432
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41408
41433
|
}
|
|
41409
41434
|
}
|
|
@@ -41550,8 +41575,6 @@ init_fn = function(options2) {
|
|
|
41550
41575
|
this.on("contentError", this.options.onContentError);
|
|
41551
41576
|
this.on("exception", this.options.onException);
|
|
41552
41577
|
this.mount(this.options.element);
|
|
41553
|
-
this.initDefaultStyles();
|
|
41554
|
-
this.setDocumentMode(options2.documentMode);
|
|
41555
41578
|
if (this.options.isHeadless) return;
|
|
41556
41579
|
this.on("create", this.options.onCreate);
|
|
41557
41580
|
this.on("update", this.options.onUpdate);
|
|
@@ -41569,8 +41592,10 @@ init_fn = function(options2) {
|
|
|
41569
41592
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
41570
41593
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
41571
41594
|
this.initializeCollaborationData();
|
|
41595
|
+
this.initDefaultStyles();
|
|
41596
|
+
this.setDocumentMode(this.options.documentMode);
|
|
41572
41597
|
if (!this.options.ydoc) {
|
|
41573
|
-
|
|
41598
|
+
this.initPagination();
|
|
41574
41599
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41575
41600
|
}
|
|
41576
41601
|
};
|
|
@@ -41617,7 +41642,7 @@ insertNewFileData_fn = function() {
|
|
|
41617
41642
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
41618
41643
|
this.view.dispatch(tr);
|
|
41619
41644
|
setTimeout(() => {
|
|
41620
|
-
|
|
41645
|
+
this.initPagination();
|
|
41621
41646
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41622
41647
|
}, 50);
|
|
41623
41648
|
};
|
|
@@ -41763,7 +41788,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
41763
41788
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
41764
41789
|
this.options.collaborationIsReady = true;
|
|
41765
41790
|
if (!this.options.isNewFile) {
|
|
41766
|
-
|
|
41791
|
+
this.initPagination();
|
|
41767
41792
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41768
41793
|
}
|
|
41769
41794
|
};
|
|
@@ -41780,20 +41805,6 @@ initComments_fn = function() {
|
|
|
41780
41805
|
dispatch(tr);
|
|
41781
41806
|
}, 50);
|
|
41782
41807
|
};
|
|
41783
|
-
initPagination_fn = async function() {
|
|
41784
|
-
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41785
|
-
return;
|
|
41786
|
-
}
|
|
41787
|
-
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41788
|
-
if (pagination && this.options.pagination) {
|
|
41789
|
-
console.debug("🔗 [super-editor] Initializing pagination");
|
|
41790
|
-
const sectionData = await initPaginationData(this);
|
|
41791
|
-
this.storage.pagination.sectionData = sectionData;
|
|
41792
|
-
const { state: state2, dispatch } = this.view;
|
|
41793
|
-
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41794
|
-
dispatch(tr);
|
|
41795
|
-
}
|
|
41796
|
-
};
|
|
41797
41808
|
dispatchTransaction_fn = function(transaction) {
|
|
41798
41809
|
if (this.isDestroyed) return;
|
|
41799
41810
|
let state2;
|
|
@@ -54497,6 +54508,19 @@ const Pagination = Extension.create({
|
|
|
54497
54508
|
return commands2.insertContent({
|
|
54498
54509
|
type: "hardBreak"
|
|
54499
54510
|
});
|
|
54511
|
+
},
|
|
54512
|
+
/**
|
|
54513
|
+
* Toggle pagination on/off
|
|
54514
|
+
* @returns {void}
|
|
54515
|
+
*/
|
|
54516
|
+
togglePagination: () => ({ tr, state: state2, dispatch, editor }) => {
|
|
54517
|
+
const isEnabled = PaginationPluginKey.getState(state2)?.isEnabled;
|
|
54518
|
+
tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
|
|
54519
|
+
if (dispatch) {
|
|
54520
|
+
dispatch(tr);
|
|
54521
|
+
editor.initDefaultStyles(editor.element, !isEnabled);
|
|
54522
|
+
return true;
|
|
54523
|
+
}
|
|
54500
54524
|
}
|
|
54501
54525
|
};
|
|
54502
54526
|
},
|
|
@@ -54522,11 +54546,21 @@ const Pagination = Extension.create({
|
|
|
54522
54546
|
return {
|
|
54523
54547
|
isReadyToInit: false,
|
|
54524
54548
|
decorations: DecorationSet.empty,
|
|
54525
|
-
isDebugging
|
|
54549
|
+
isDebugging,
|
|
54550
|
+
isEnabled: editor.options.pagination
|
|
54526
54551
|
};
|
|
54527
54552
|
},
|
|
54528
54553
|
apply(tr, oldState, prevEditorState, newEditorState) {
|
|
54529
54554
|
const meta = tr.getMeta(PaginationPluginKey);
|
|
54555
|
+
if (meta && "isEnabled" in meta) {
|
|
54556
|
+
const newEnabled = meta.isEnabled;
|
|
54557
|
+
if (newEnabled) shouldUpdate = true;
|
|
54558
|
+
return {
|
|
54559
|
+
...oldState,
|
|
54560
|
+
decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
|
|
54561
|
+
isEnabled: newEnabled
|
|
54562
|
+
};
|
|
54563
|
+
}
|
|
54530
54564
|
if (meta && meta.isReadyToInit) {
|
|
54531
54565
|
shouldUpdate = true;
|
|
54532
54566
|
shouldInitialize = meta.isReadyToInit;
|
|
@@ -54575,6 +54609,7 @@ const Pagination = Extension.create({
|
|
|
54575
54609
|
let previousDecorations = DecorationSet.empty;
|
|
54576
54610
|
return {
|
|
54577
54611
|
update: (view2, prevState) => {
|
|
54612
|
+
if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
|
|
54578
54613
|
if (!shouldUpdate || isUpdating) return;
|
|
54579
54614
|
isUpdating = true;
|
|
54580
54615
|
hasInitialized = true;
|
|
@@ -54586,7 +54621,8 @@ const Pagination = Extension.create({
|
|
|
54586
54621
|
},
|
|
54587
54622
|
props: {
|
|
54588
54623
|
decorations(state2) {
|
|
54589
|
-
|
|
54624
|
+
const pluginState = PaginationPluginKey.getState(state2);
|
|
54625
|
+
return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
|
|
54590
54626
|
}
|
|
54591
54627
|
}
|
|
54592
54628
|
});
|
package/dist/core/SuperDoc.d.ts
CHANGED
|
@@ -203,6 +203,11 @@ export class SuperDoc extends EventEmitter<string | symbol, any> {
|
|
|
203
203
|
* @returns {void}
|
|
204
204
|
*/
|
|
205
205
|
toggleRuler(): void;
|
|
206
|
+
/**
|
|
207
|
+
* Toggle pagination for SuperEditors
|
|
208
|
+
* @returns {void}
|
|
209
|
+
*/
|
|
210
|
+
togglePagination(): void;
|
|
206
211
|
toolbarElement: any;
|
|
207
212
|
toolbar: SuperToolbar;
|
|
208
213
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAiBA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AAEH,2EAA2E;AAE3E;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;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,MAAM,EAAE;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI;;;;uBACxC,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,KAAK,IAAI;;;;wBAC/C,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,QAAQ,CAAC;QAAC,MAAM,QAAO;KAAE,KAAK,IAAI;;;;eACtD,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI;;;;yBACvD,MAAM,IAAI;;;;sBACV,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;;;;2BAC3B,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;qBACpC,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;kBACpC,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI;;;;2BAClC,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;;;;aACzC,MAAM;;;;uBACN,KAAQ;;;;iBACR,OAAO;;;;YACP,MAAM;;;;oBACN,KAAQ;;;;eACR,OAAO;;;;;;;;wBAEP,CAAS,IAAI,EAAJ,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;;;;eAC/B,IAAI;;;;aACJ,OAAO;;;;gCACP,OAAO;;;;mBACP,OAAO;;6BAvGQ,eAAe;0BASlB,0CAA0C;6BAJ5B,mCAAmC;8BAC7C,iEAAiE"}
|
|
@@ -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-g7XDS8H8.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-B3V2UfZk.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 = {}) {
|
|
@@ -23991,7 +23991,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
23991
23991
|
return;
|
|
23992
23992
|
}
|
|
23993
23993
|
}
|
|
23994
|
-
static updateDocumentVersion(docx = this.convertedXml, version = "0.13.2-
|
|
23994
|
+
static updateDocumentVersion(docx = this.convertedXml, version = "0.13.2-rev11") {
|
|
23995
23995
|
const customLocation = "docProps/custom.xml";
|
|
23996
23996
|
if (!docx[customLocation]) {
|
|
23997
23997
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24461,7 +24461,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24461
24461
|
function generateCustomXml() {
|
|
24462
24462
|
return DEFAULT_CUSTOM_XML;
|
|
24463
24463
|
}
|
|
24464
|
-
function generateSuperdocVersion(pid = 2, version = "0.13.2-
|
|
24464
|
+
function generateSuperdocVersion(pid = 2, version = "0.13.2-rev11") {
|
|
24465
24465
|
return {
|
|
24466
24466
|
type: "element",
|
|
24467
24467
|
name: "property",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as process$1, a4 as commonjsGlobal, B as Buffer, a5 as getDefaultExportFromCjs, a6 as getContentTypesFromXml, a7 as xmljs } from "./converter-
|
|
1
|
+
import { y as process$1, a4 as commonjsGlobal, B as Buffer, a5 as getDefaultExportFromCjs, a6 as getContentTypesFromXml, a7 as xmljs } from "./converter-g7XDS8H8.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
|
}
|