@harbour-enterprises/superdoc 0.14.0-next.5 → 0.14.0-next.6
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-1V_Ac-SF.cjs → super-editor.es-CETApTAM.cjs} +63 -29
- package/dist/chunks/{super-editor.es-CS08WNwP.es.js → super-editor.es-PFHHaxd8.es.js} +63 -29
- 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-3dVTYXnm.js → converter-DXxu8c9w.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-CAF6BgPQ.js → docx-zipper-DjxR5LqI.js} +1 -1
- package/dist/super-editor/chunks/{editor-NHY1ApZn.js → editor-DQyfLPCk.js} +63 -29
- package/dist/super-editor/chunks/{toolbar-Dr1wHywT.js → toolbar-LIs10qdJ.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.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 +77 -30
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -24252,7 +24252,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
24252
24252
|
return;
|
|
24253
24253
|
}
|
|
24254
24254
|
}
|
|
24255
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.0-next.
|
|
24255
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.0-next.6") {
|
|
24256
24256
|
const customLocation = "docProps/custom.xml";
|
|
24257
24257
|
if (!docx[customLocation]) {
|
|
24258
24258
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24720,7 +24720,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24720
24720
|
function generateCustomXml() {
|
|
24721
24721
|
return DEFAULT_CUSTOM_XML;
|
|
24722
24722
|
}
|
|
24723
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.0-next.
|
|
24723
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.0-next.6") {
|
|
24724
24724
|
return {
|
|
24725
24725
|
type: "element",
|
|
24726
24726
|
name: "property",
|
|
@@ -27253,7 +27253,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
27253
27253
|
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);
|
|
27254
27254
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
27255
27255
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
27256
|
-
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,
|
|
27256
|
+
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;
|
|
27257
27257
|
function getMarksFromSelection(state2) {
|
|
27258
27258
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
27259
27259
|
const marks = [];
|
|
@@ -41529,10 +41529,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41529
41529
|
}
|
|
41530
41530
|
/**
|
|
41531
41531
|
* Unregister a PM plugin
|
|
41532
|
-
* @param {string|Object}
|
|
41532
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
41533
41533
|
* @returns {void}
|
|
41534
41534
|
*/
|
|
41535
|
-
unregisterPlugin(
|
|
41535
|
+
unregisterPlugin(nameOrPluginKey) {
|
|
41536
41536
|
if (this.isDestroyed) return;
|
|
41537
41537
|
const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
41538
41538
|
const state2 = this.state.reconfigure({
|
|
@@ -41610,7 +41610,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41610
41610
|
/**
|
|
41611
41611
|
* Attach styles and attributes to the editor element
|
|
41612
41612
|
*/
|
|
41613
|
-
updateEditorStyles(element, proseMirror) {
|
|
41613
|
+
updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
|
|
41614
41614
|
const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
|
|
41615
41615
|
if (!proseMirror || !element) {
|
|
41616
41616
|
return;
|
|
@@ -41644,9 +41644,12 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41644
41644
|
element.style.webkitOverflowScrolling = "touch";
|
|
41645
41645
|
const defaultLineHeight = 1.2;
|
|
41646
41646
|
proseMirror.style.lineHeight = defaultLineHeight;
|
|
41647
|
-
if (!
|
|
41647
|
+
if (!hasPaginationEnabled) {
|
|
41648
41648
|
proseMirror.style.paddingTop = "1in";
|
|
41649
41649
|
proseMirror.style.paddingBottom = "1in";
|
|
41650
|
+
} else {
|
|
41651
|
+
proseMirror.style.paddingTop = "0";
|
|
41652
|
+
proseMirror.style.paddingBottom = "0";
|
|
41650
41653
|
}
|
|
41651
41654
|
}
|
|
41652
41655
|
/**
|
|
@@ -41657,10 +41660,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41657
41660
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
41658
41661
|
* @returns {void}
|
|
41659
41662
|
*/
|
|
41660
|
-
initDefaultStyles(element = this.element) {
|
|
41663
|
+
initDefaultStyles(element = this.element, isPaginationEnabled = true) {
|
|
41661
41664
|
if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
|
|
41662
41665
|
const proseMirror = element?.querySelector(".ProseMirror");
|
|
41663
|
-
this.updateEditorStyles(element, proseMirror);
|
|
41666
|
+
this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
|
|
41664
41667
|
this.initMobileStyles(element);
|
|
41665
41668
|
}
|
|
41666
41669
|
/**
|
|
@@ -41708,6 +41711,25 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41708
41711
|
}
|
|
41709
41712
|
window.addEventListener("resize", () => handleResize);
|
|
41710
41713
|
}
|
|
41714
|
+
/**
|
|
41715
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
41716
|
+
* @private
|
|
41717
|
+
* @async
|
|
41718
|
+
* @returns {Promise<void>}
|
|
41719
|
+
*/
|
|
41720
|
+
async initPagination() {
|
|
41721
|
+
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41722
|
+
return;
|
|
41723
|
+
}
|
|
41724
|
+
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41725
|
+
if (pagination && this.options.pagination) {
|
|
41726
|
+
const sectionData = await initPaginationData(this);
|
|
41727
|
+
this.storage.pagination.sectionData = sectionData;
|
|
41728
|
+
const { state: state2, dispatch } = this.view;
|
|
41729
|
+
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41730
|
+
dispatch(tr);
|
|
41731
|
+
}
|
|
41732
|
+
}
|
|
41711
41733
|
/**
|
|
41712
41734
|
* Get attrs of the currently selected node or mark.
|
|
41713
41735
|
* @param {String} nameOrType
|
|
@@ -41917,7 +41939,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41917
41939
|
* @returns {Object | void} Migration results
|
|
41918
41940
|
*/
|
|
41919
41941
|
processCollaborationMigrations() {
|
|
41920
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.
|
|
41942
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.6");
|
|
41921
41943
|
if (!this.options.ydoc) return;
|
|
41922
41944
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41923
41945
|
let docVersion = metaMap.get("version");
|
|
@@ -41967,7 +41989,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41967
41989
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
41968
41990
|
}
|
|
41969
41991
|
if (!this.options.ydoc) {
|
|
41970
|
-
|
|
41992
|
+
this.initPagination();
|
|
41971
41993
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41972
41994
|
}
|
|
41973
41995
|
}
|
|
@@ -42134,7 +42156,7 @@ init_fn = function(options2) {
|
|
|
42134
42156
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
42135
42157
|
this.initializeCollaborationData();
|
|
42136
42158
|
if (!this.options.ydoc) {
|
|
42137
|
-
|
|
42159
|
+
this.initPagination();
|
|
42138
42160
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42139
42161
|
}
|
|
42140
42162
|
};
|
|
@@ -42181,7 +42203,7 @@ insertNewFileData_fn = function() {
|
|
|
42181
42203
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
42182
42204
|
this.view.dispatch(tr);
|
|
42183
42205
|
setTimeout(() => {
|
|
42184
|
-
|
|
42206
|
+
this.initPagination();
|
|
42185
42207
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42186
42208
|
}, 50);
|
|
42187
42209
|
};
|
|
@@ -42327,7 +42349,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
42327
42349
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
42328
42350
|
this.options.collaborationIsReady = true;
|
|
42329
42351
|
if (!this.options.isNewFile) {
|
|
42330
|
-
|
|
42352
|
+
this.initPagination();
|
|
42331
42353
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42332
42354
|
}
|
|
42333
42355
|
};
|
|
@@ -42344,19 +42366,6 @@ initComments_fn = function() {
|
|
|
42344
42366
|
dispatch(tr);
|
|
42345
42367
|
}, 50);
|
|
42346
42368
|
};
|
|
42347
|
-
initPagination_fn = async function() {
|
|
42348
|
-
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
42349
|
-
return;
|
|
42350
|
-
}
|
|
42351
|
-
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
42352
|
-
if (pagination && this.options.pagination) {
|
|
42353
|
-
const sectionData = await initPaginationData(this);
|
|
42354
|
-
this.storage.pagination.sectionData = sectionData;
|
|
42355
|
-
const { state: state2, dispatch } = this.view;
|
|
42356
|
-
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
42357
|
-
dispatch(tr);
|
|
42358
|
-
}
|
|
42359
|
-
};
|
|
42360
42369
|
dispatchTransaction_fn = function(transaction) {
|
|
42361
42370
|
if (this.isDestroyed) return;
|
|
42362
42371
|
let state2;
|
|
@@ -54980,6 +54989,19 @@ const Pagination = Extension.create({
|
|
|
54980
54989
|
return commands2.insertContent({
|
|
54981
54990
|
type: "hardBreak"
|
|
54982
54991
|
});
|
|
54992
|
+
},
|
|
54993
|
+
/**
|
|
54994
|
+
* Toggle pagination on/off
|
|
54995
|
+
* @returns {void}
|
|
54996
|
+
*/
|
|
54997
|
+
togglePagination: () => ({ tr, state: state2, dispatch, editor }) => {
|
|
54998
|
+
const isEnabled = PaginationPluginKey.getState(state2)?.isEnabled;
|
|
54999
|
+
tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
|
|
55000
|
+
if (dispatch) {
|
|
55001
|
+
dispatch(tr);
|
|
55002
|
+
editor.initDefaultStyles(editor.element, !isEnabled);
|
|
55003
|
+
return true;
|
|
55004
|
+
}
|
|
54983
55005
|
}
|
|
54984
55006
|
};
|
|
54985
55007
|
},
|
|
@@ -55005,11 +55027,21 @@ const Pagination = Extension.create({
|
|
|
55005
55027
|
return {
|
|
55006
55028
|
isReadyToInit: false,
|
|
55007
55029
|
decorations: DecorationSet.empty,
|
|
55008
|
-
isDebugging
|
|
55030
|
+
isDebugging,
|
|
55031
|
+
isEnabled: editor.options.pagination
|
|
55009
55032
|
};
|
|
55010
55033
|
},
|
|
55011
55034
|
apply(tr, oldState, prevEditorState, newEditorState) {
|
|
55012
55035
|
const meta = tr.getMeta(PaginationPluginKey);
|
|
55036
|
+
if (meta && "isEnabled" in meta) {
|
|
55037
|
+
const newEnabled = meta.isEnabled;
|
|
55038
|
+
if (newEnabled) shouldUpdate = true;
|
|
55039
|
+
return {
|
|
55040
|
+
...oldState,
|
|
55041
|
+
decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
|
|
55042
|
+
isEnabled: newEnabled
|
|
55043
|
+
};
|
|
55044
|
+
}
|
|
55013
55045
|
if (meta && meta.isReadyToInit) {
|
|
55014
55046
|
shouldUpdate = true;
|
|
55015
55047
|
shouldInitialize = meta.isReadyToInit;
|
|
@@ -55059,6 +55091,7 @@ const Pagination = Extension.create({
|
|
|
55059
55091
|
let previousDecorations = DecorationSet.empty;
|
|
55060
55092
|
return {
|
|
55061
55093
|
update: (view2, prevState) => {
|
|
55094
|
+
if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
|
|
55062
55095
|
if (!shouldUpdate || isUpdating) return;
|
|
55063
55096
|
isUpdating = true;
|
|
55064
55097
|
hasInitialized = true;
|
|
@@ -55070,7 +55103,8 @@ const Pagination = Extension.create({
|
|
|
55070
55103
|
},
|
|
55071
55104
|
props: {
|
|
55072
55105
|
decorations(state2) {
|
|
55073
|
-
|
|
55106
|
+
const pluginState = PaginationPluginKey.getState(state2);
|
|
55107
|
+
return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
|
|
55074
55108
|
}
|
|
55075
55109
|
}
|
|
55076
55110
|
});
|
|
@@ -24235,7 +24235,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
24235
24235
|
return;
|
|
24236
24236
|
}
|
|
24237
24237
|
}
|
|
24238
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.0-next.
|
|
24238
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.0-next.6") {
|
|
24239
24239
|
const customLocation = "docProps/custom.xml";
|
|
24240
24240
|
if (!docx[customLocation]) {
|
|
24241
24241
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24703,7 +24703,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24703
24703
|
function generateCustomXml() {
|
|
24704
24704
|
return DEFAULT_CUSTOM_XML;
|
|
24705
24705
|
}
|
|
24706
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.0-next.
|
|
24706
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.0-next.6") {
|
|
24707
24707
|
return {
|
|
24708
24708
|
type: "element",
|
|
24709
24709
|
name: "property",
|
|
@@ -27236,7 +27236,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
27236
27236
|
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);
|
|
27237
27237
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
27238
27238
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
27239
|
-
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,
|
|
27239
|
+
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;
|
|
27240
27240
|
function getMarksFromSelection(state2) {
|
|
27241
27241
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
27242
27242
|
const marks = [];
|
|
@@ -41512,10 +41512,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41512
41512
|
}
|
|
41513
41513
|
/**
|
|
41514
41514
|
* Unregister a PM plugin
|
|
41515
|
-
* @param {string|Object}
|
|
41515
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
41516
41516
|
* @returns {void}
|
|
41517
41517
|
*/
|
|
41518
|
-
unregisterPlugin(
|
|
41518
|
+
unregisterPlugin(nameOrPluginKey) {
|
|
41519
41519
|
if (this.isDestroyed) return;
|
|
41520
41520
|
const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
41521
41521
|
const state2 = this.state.reconfigure({
|
|
@@ -41593,7 +41593,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41593
41593
|
/**
|
|
41594
41594
|
* Attach styles and attributes to the editor element
|
|
41595
41595
|
*/
|
|
41596
|
-
updateEditorStyles(element, proseMirror) {
|
|
41596
|
+
updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
|
|
41597
41597
|
const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
|
|
41598
41598
|
if (!proseMirror || !element) {
|
|
41599
41599
|
return;
|
|
@@ -41627,9 +41627,12 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41627
41627
|
element.style.webkitOverflowScrolling = "touch";
|
|
41628
41628
|
const defaultLineHeight = 1.2;
|
|
41629
41629
|
proseMirror.style.lineHeight = defaultLineHeight;
|
|
41630
|
-
if (!
|
|
41630
|
+
if (!hasPaginationEnabled) {
|
|
41631
41631
|
proseMirror.style.paddingTop = "1in";
|
|
41632
41632
|
proseMirror.style.paddingBottom = "1in";
|
|
41633
|
+
} else {
|
|
41634
|
+
proseMirror.style.paddingTop = "0";
|
|
41635
|
+
proseMirror.style.paddingBottom = "0";
|
|
41633
41636
|
}
|
|
41634
41637
|
}
|
|
41635
41638
|
/**
|
|
@@ -41640,10 +41643,10 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41640
41643
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
41641
41644
|
* @returns {void}
|
|
41642
41645
|
*/
|
|
41643
|
-
initDefaultStyles(element = this.element) {
|
|
41646
|
+
initDefaultStyles(element = this.element, isPaginationEnabled = true) {
|
|
41644
41647
|
if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
|
|
41645
41648
|
const proseMirror = element?.querySelector(".ProseMirror");
|
|
41646
|
-
this.updateEditorStyles(element, proseMirror);
|
|
41649
|
+
this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
|
|
41647
41650
|
this.initMobileStyles(element);
|
|
41648
41651
|
}
|
|
41649
41652
|
/**
|
|
@@ -41691,6 +41694,25 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41691
41694
|
}
|
|
41692
41695
|
window.addEventListener("resize", () => handleResize);
|
|
41693
41696
|
}
|
|
41697
|
+
/**
|
|
41698
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
41699
|
+
* @private
|
|
41700
|
+
* @async
|
|
41701
|
+
* @returns {Promise<void>}
|
|
41702
|
+
*/
|
|
41703
|
+
async initPagination() {
|
|
41704
|
+
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
41705
|
+
return;
|
|
41706
|
+
}
|
|
41707
|
+
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
41708
|
+
if (pagination && this.options.pagination) {
|
|
41709
|
+
const sectionData = await initPaginationData(this);
|
|
41710
|
+
this.storage.pagination.sectionData = sectionData;
|
|
41711
|
+
const { state: state2, dispatch } = this.view;
|
|
41712
|
+
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
41713
|
+
dispatch(tr);
|
|
41714
|
+
}
|
|
41715
|
+
}
|
|
41694
41716
|
/**
|
|
41695
41717
|
* Get attrs of the currently selected node or mark.
|
|
41696
41718
|
* @param {String} nameOrType
|
|
@@ -41900,7 +41922,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41900
41922
|
* @returns {Object | void} Migration results
|
|
41901
41923
|
*/
|
|
41902
41924
|
processCollaborationMigrations() {
|
|
41903
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.
|
|
41925
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.6");
|
|
41904
41926
|
if (!this.options.ydoc) return;
|
|
41905
41927
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41906
41928
|
let docVersion = metaMap.get("version");
|
|
@@ -41950,7 +41972,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41950
41972
|
__privateMethod$1(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
41951
41973
|
}
|
|
41952
41974
|
if (!this.options.ydoc) {
|
|
41953
|
-
|
|
41975
|
+
this.initPagination();
|
|
41954
41976
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
41955
41977
|
}
|
|
41956
41978
|
}
|
|
@@ -42117,7 +42139,7 @@ init_fn = function(options2) {
|
|
|
42117
42139
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
42118
42140
|
this.initializeCollaborationData();
|
|
42119
42141
|
if (!this.options.ydoc) {
|
|
42120
|
-
|
|
42142
|
+
this.initPagination();
|
|
42121
42143
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42122
42144
|
}
|
|
42123
42145
|
};
|
|
@@ -42164,7 +42186,7 @@ insertNewFileData_fn = function() {
|
|
|
42164
42186
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
42165
42187
|
this.view.dispatch(tr);
|
|
42166
42188
|
setTimeout(() => {
|
|
42167
|
-
|
|
42189
|
+
this.initPagination();
|
|
42168
42190
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42169
42191
|
}, 50);
|
|
42170
42192
|
};
|
|
@@ -42310,7 +42332,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
42310
42332
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
42311
42333
|
this.options.collaborationIsReady = true;
|
|
42312
42334
|
if (!this.options.isNewFile) {
|
|
42313
|
-
|
|
42335
|
+
this.initPagination();
|
|
42314
42336
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
42315
42337
|
}
|
|
42316
42338
|
};
|
|
@@ -42327,19 +42349,6 @@ initComments_fn = function() {
|
|
|
42327
42349
|
dispatch(tr);
|
|
42328
42350
|
}, 50);
|
|
42329
42351
|
};
|
|
42330
|
-
initPagination_fn = async function() {
|
|
42331
|
-
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
42332
|
-
return;
|
|
42333
|
-
}
|
|
42334
|
-
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
42335
|
-
if (pagination && this.options.pagination) {
|
|
42336
|
-
const sectionData = await initPaginationData(this);
|
|
42337
|
-
this.storage.pagination.sectionData = sectionData;
|
|
42338
|
-
const { state: state2, dispatch } = this.view;
|
|
42339
|
-
const tr = state2.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
42340
|
-
dispatch(tr);
|
|
42341
|
-
}
|
|
42342
|
-
};
|
|
42343
42352
|
dispatchTransaction_fn = function(transaction) {
|
|
42344
42353
|
if (this.isDestroyed) return;
|
|
42345
42354
|
let state2;
|
|
@@ -54963,6 +54972,19 @@ const Pagination = Extension.create({
|
|
|
54963
54972
|
return commands2.insertContent({
|
|
54964
54973
|
type: "hardBreak"
|
|
54965
54974
|
});
|
|
54975
|
+
},
|
|
54976
|
+
/**
|
|
54977
|
+
* Toggle pagination on/off
|
|
54978
|
+
* @returns {void}
|
|
54979
|
+
*/
|
|
54980
|
+
togglePagination: () => ({ tr, state: state2, dispatch, editor }) => {
|
|
54981
|
+
const isEnabled = PaginationPluginKey.getState(state2)?.isEnabled;
|
|
54982
|
+
tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
|
|
54983
|
+
if (dispatch) {
|
|
54984
|
+
dispatch(tr);
|
|
54985
|
+
editor.initDefaultStyles(editor.element, !isEnabled);
|
|
54986
|
+
return true;
|
|
54987
|
+
}
|
|
54966
54988
|
}
|
|
54967
54989
|
};
|
|
54968
54990
|
},
|
|
@@ -54988,11 +55010,21 @@ const Pagination = Extension.create({
|
|
|
54988
55010
|
return {
|
|
54989
55011
|
isReadyToInit: false,
|
|
54990
55012
|
decorations: DecorationSet.empty,
|
|
54991
|
-
isDebugging
|
|
55013
|
+
isDebugging,
|
|
55014
|
+
isEnabled: editor.options.pagination
|
|
54992
55015
|
};
|
|
54993
55016
|
},
|
|
54994
55017
|
apply(tr, oldState, prevEditorState, newEditorState) {
|
|
54995
55018
|
const meta = tr.getMeta(PaginationPluginKey);
|
|
55019
|
+
if (meta && "isEnabled" in meta) {
|
|
55020
|
+
const newEnabled = meta.isEnabled;
|
|
55021
|
+
if (newEnabled) shouldUpdate = true;
|
|
55022
|
+
return {
|
|
55023
|
+
...oldState,
|
|
55024
|
+
decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
|
|
55025
|
+
isEnabled: newEnabled
|
|
55026
|
+
};
|
|
55027
|
+
}
|
|
54996
55028
|
if (meta && meta.isReadyToInit) {
|
|
54997
55029
|
shouldUpdate = true;
|
|
54998
55030
|
shouldInitialize = meta.isReadyToInit;
|
|
@@ -55042,6 +55074,7 @@ const Pagination = Extension.create({
|
|
|
55042
55074
|
let previousDecorations = DecorationSet.empty;
|
|
55043
55075
|
return {
|
|
55044
55076
|
update: (view2, prevState) => {
|
|
55077
|
+
if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
|
|
55045
55078
|
if (!shouldUpdate || isUpdating) return;
|
|
55046
55079
|
isUpdating = true;
|
|
55047
55080
|
hasInitialized = true;
|
|
@@ -55053,7 +55086,8 @@ const Pagination = Extension.create({
|
|
|
55053
55086
|
},
|
|
55054
55087
|
props: {
|
|
55055
55088
|
decorations(state2) {
|
|
55056
|
-
|
|
55089
|
+
const pluginState = PaginationPluginKey.getState(state2);
|
|
55090
|
+
return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
|
|
55057
55091
|
}
|
|
55058
55092
|
}
|
|
55059
55093
|
});
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IAsExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IA1ED,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAE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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-DXxu8c9w.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-DQyfLPCk.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 = {}) {
|
|
@@ -24254,7 +24254,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
24254
24254
|
return;
|
|
24255
24255
|
}
|
|
24256
24256
|
}
|
|
24257
|
-
static updateDocumentVersion(docx = this.convertedXml, version = "0.14.0-next.
|
|
24257
|
+
static updateDocumentVersion(docx = this.convertedXml, version = "0.14.0-next.6") {
|
|
24258
24258
|
const customLocation = "docProps/custom.xml";
|
|
24259
24259
|
if (!docx[customLocation]) {
|
|
24260
24260
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24725,7 +24725,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24725
24725
|
function generateCustomXml() {
|
|
24726
24726
|
return DEFAULT_CUSTOM_XML;
|
|
24727
24727
|
}
|
|
24728
|
-
function generateSuperdocVersion(pid = 2, version = "0.14.0-next.
|
|
24728
|
+
function generateSuperdocVersion(pid = 2, version = "0.14.0-next.6") {
|
|
24729
24729
|
return {
|
|
24730
24730
|
type: "element",
|
|
24731
24731
|
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-DXxu8c9w.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
|
}
|