@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
|
@@ -9,12 +9,12 @@ 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 __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
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,
|
|
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, _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, r as replaceStep$1, e as Selection, 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 isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as chainableEditorState, u as generateRandom32BitHex, v as DOMSerializer, w as Mark$1, x as dropPoint, y as process$1, B as Buffer2, z as inputRulesPlugin, C as TrackDeleteMarkName, E as TrackInsertMarkName, G as v4, H as TrackFormatMarkName, I as comments_module_events, J as AddMarkStep, K as RemoveMarkStep, L as twipsToLines, O as pixelsToTwips, Q as CommandService, U as SuperConverter, V as EditorState, W as hasSomeParentWithClass, X as parseSizeUnit, Y as getLineHeightValueString, Z as InputRule, _ as toKebabCase, $ as kebabCase, a0 as getColStyleDeclaration, a1 as SelectionRange, a2 as Transform, a3 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, r as replaceStep$1, e as Selection, 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 isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as chainableEditorState, u as generateRandom32BitHex, v as DOMSerializer, w as Mark$1, x as dropPoint, y as process$1, B as Buffer2, z as inputRulesPlugin, C as TrackDeleteMarkName, E as TrackInsertMarkName, G as v4, H as TrackFormatMarkName, I as comments_module_events, J as AddMarkStep, K as RemoveMarkStep, L as twipsToLines, O as pixelsToTwips, Q as CommandService, U as SuperConverter, V as EditorState, W as hasSomeParentWithClass, X as parseSizeUnit, Y as getLineHeightValueString, Z as InputRule, _ as toKebabCase, $ as kebabCase, a0 as getColStyleDeclaration, a1 as SelectionRange, a2 as Transform, a3 as createColGroup } from "./converter-g7XDS8H8.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-VpCXV0uV.js";
|
|
18
18
|
function getMarksFromSelection(state) {
|
|
19
19
|
const { from: from2, to, empty: empty2 } = state.selection;
|
|
20
20
|
const marks = [];
|
|
@@ -12277,6 +12277,8 @@ const createHeaderFooterEditor = ({
|
|
|
12277
12277
|
});
|
|
12278
12278
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
12279
12279
|
const headerFooterEditor = new Editor({
|
|
12280
|
+
documentMode: editor.options.documentMode,
|
|
12281
|
+
role: editor.options.role,
|
|
12280
12282
|
loadFromSchema: true,
|
|
12281
12283
|
mode: "docx",
|
|
12282
12284
|
element: editorContainer,
|
|
@@ -14036,10 +14038,10 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14036
14038
|
}
|
|
14037
14039
|
/**
|
|
14038
14040
|
* Unregister a PM plugin
|
|
14039
|
-
* @param {string|Object}
|
|
14041
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
14040
14042
|
* @returns {void}
|
|
14041
14043
|
*/
|
|
14042
|
-
unregisterPlugin(
|
|
14044
|
+
unregisterPlugin(nameOrPluginKey) {
|
|
14043
14045
|
if (this.isDestroyed) return;
|
|
14044
14046
|
const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
14045
14047
|
const state = this.state.reconfigure({
|
|
@@ -14117,7 +14119,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14117
14119
|
/**
|
|
14118
14120
|
* Attach styles and attributes to the editor element
|
|
14119
14121
|
*/
|
|
14120
|
-
updateEditorStyles(element, proseMirror) {
|
|
14122
|
+
updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
|
|
14121
14123
|
const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
|
|
14122
14124
|
if (!proseMirror || !element) {
|
|
14123
14125
|
return;
|
|
@@ -14151,9 +14153,12 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14151
14153
|
element.style.webkitOverflowScrolling = "touch";
|
|
14152
14154
|
const defaultLineHeight = 1.2;
|
|
14153
14155
|
proseMirror.style.lineHeight = defaultLineHeight;
|
|
14154
|
-
if (!
|
|
14156
|
+
if (!hasPaginationEnabled) {
|
|
14155
14157
|
proseMirror.style.paddingTop = "1in";
|
|
14156
14158
|
proseMirror.style.paddingBottom = "1in";
|
|
14159
|
+
} else {
|
|
14160
|
+
proseMirror.style.paddingTop = "0";
|
|
14161
|
+
proseMirror.style.paddingBottom = "0";
|
|
14157
14162
|
}
|
|
14158
14163
|
}
|
|
14159
14164
|
/**
|
|
@@ -14164,10 +14169,10 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14164
14169
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
14165
14170
|
* @returns {void}
|
|
14166
14171
|
*/
|
|
14167
|
-
initDefaultStyles(element = this.element) {
|
|
14172
|
+
initDefaultStyles(element = this.element, isPaginationEnabled = true) {
|
|
14168
14173
|
if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
|
|
14169
14174
|
const proseMirror = element?.querySelector(".ProseMirror");
|
|
14170
|
-
this.updateEditorStyles(element, proseMirror);
|
|
14175
|
+
this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
|
|
14171
14176
|
this.initMobileStyles(element);
|
|
14172
14177
|
}
|
|
14173
14178
|
/**
|
|
@@ -14215,6 +14220,26 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14215
14220
|
}
|
|
14216
14221
|
window.addEventListener("resize", () => handleResize);
|
|
14217
14222
|
}
|
|
14223
|
+
/**
|
|
14224
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
14225
|
+
* @private
|
|
14226
|
+
* @async
|
|
14227
|
+
* @returns {Promise<void>}
|
|
14228
|
+
*/
|
|
14229
|
+
async initPagination() {
|
|
14230
|
+
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
14231
|
+
return;
|
|
14232
|
+
}
|
|
14233
|
+
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
14234
|
+
if (pagination && this.options.pagination) {
|
|
14235
|
+
console.debug("🔗 [super-editor] Initializing pagination");
|
|
14236
|
+
const sectionData = await initPaginationData(this);
|
|
14237
|
+
this.storage.pagination.sectionData = sectionData;
|
|
14238
|
+
const { state, dispatch } = this.view;
|
|
14239
|
+
const tr = state.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
14240
|
+
dispatch(tr);
|
|
14241
|
+
}
|
|
14242
|
+
}
|
|
14218
14243
|
/**
|
|
14219
14244
|
* Get attrs of the currently selected node or mark.
|
|
14220
14245
|
* @param {String} nameOrType
|
|
@@ -14415,7 +14440,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14415
14440
|
* @returns {Object | void} Migration results
|
|
14416
14441
|
*/
|
|
14417
14442
|
processCollaborationMigrations() {
|
|
14418
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-
|
|
14443
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-rev11");
|
|
14419
14444
|
if (!this.options.ydoc) return;
|
|
14420
14445
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14421
14446
|
let docVersion = metaMap.get("version");
|
|
@@ -14465,7 +14490,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14465
14490
|
__privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
14466
14491
|
}
|
|
14467
14492
|
if (!this.options.ydoc) {
|
|
14468
|
-
|
|
14493
|
+
this.initPagination();
|
|
14469
14494
|
__privateMethod(this, _Editor_instances, initComments_fn).call(this);
|
|
14470
14495
|
}
|
|
14471
14496
|
}
|
|
@@ -14624,8 +14649,6 @@ init_fn = function(options) {
|
|
|
14624
14649
|
this.on("contentError", this.options.onContentError);
|
|
14625
14650
|
this.on("exception", this.options.onException);
|
|
14626
14651
|
this.mount(this.options.element);
|
|
14627
|
-
this.initDefaultStyles();
|
|
14628
|
-
this.setDocumentMode(options.documentMode);
|
|
14629
14652
|
if (this.options.isHeadless) return;
|
|
14630
14653
|
this.on("create", this.options.onCreate);
|
|
14631
14654
|
this.on("update", this.options.onUpdate);
|
|
@@ -14643,8 +14666,10 @@ init_fn = function(options) {
|
|
|
14643
14666
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
14644
14667
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
14645
14668
|
this.initializeCollaborationData();
|
|
14669
|
+
this.initDefaultStyles();
|
|
14670
|
+
this.setDocumentMode(this.options.documentMode);
|
|
14646
14671
|
if (!this.options.ydoc) {
|
|
14647
|
-
|
|
14672
|
+
this.initPagination();
|
|
14648
14673
|
__privateMethod(this, _Editor_instances, initComments_fn).call(this);
|
|
14649
14674
|
}
|
|
14650
14675
|
};
|
|
@@ -14720,7 +14745,7 @@ insertNewFileData_fn = function() {
|
|
|
14720
14745
|
const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
|
|
14721
14746
|
this.view.dispatch(tr);
|
|
14722
14747
|
setTimeout(() => {
|
|
14723
|
-
|
|
14748
|
+
this.initPagination();
|
|
14724
14749
|
__privateMethod(this, _Editor_instances, initComments_fn).call(this);
|
|
14725
14750
|
}, 50);
|
|
14726
14751
|
};
|
|
@@ -14931,7 +14956,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
14931
14956
|
this.options.onCollaborationReady({ editor, ydoc });
|
|
14932
14957
|
this.options.collaborationIsReady = true;
|
|
14933
14958
|
if (!this.options.isNewFile) {
|
|
14934
|
-
|
|
14959
|
+
this.initPagination();
|
|
14935
14960
|
__privateMethod(this, _Editor_instances, initComments_fn).call(this);
|
|
14936
14961
|
}
|
|
14937
14962
|
};
|
|
@@ -14953,20 +14978,6 @@ initComments_fn = function() {
|
|
|
14953
14978
|
dispatch(tr);
|
|
14954
14979
|
}, 50);
|
|
14955
14980
|
};
|
|
14956
|
-
initPagination_fn = async function() {
|
|
14957
|
-
if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
|
|
14958
|
-
return;
|
|
14959
|
-
}
|
|
14960
|
-
const pagination = this.options.extensions.find((e) => e.name === "pagination");
|
|
14961
|
-
if (pagination && this.options.pagination) {
|
|
14962
|
-
console.debug("🔗 [super-editor] Initializing pagination");
|
|
14963
|
-
const sectionData = await initPaginationData(this);
|
|
14964
|
-
this.storage.pagination.sectionData = sectionData;
|
|
14965
|
-
const { state, dispatch } = this.view;
|
|
14966
|
-
const tr = state.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
|
|
14967
|
-
dispatch(tr);
|
|
14968
|
-
}
|
|
14969
|
-
};
|
|
14970
14981
|
/**
|
|
14971
14982
|
* Dispatch a transaction to update the editor state
|
|
14972
14983
|
* @private
|
|
@@ -27696,6 +27707,19 @@ const Pagination = Extension.create({
|
|
|
27696
27707
|
return commands2.insertContent({
|
|
27697
27708
|
type: "hardBreak"
|
|
27698
27709
|
});
|
|
27710
|
+
},
|
|
27711
|
+
/**
|
|
27712
|
+
* Toggle pagination on/off
|
|
27713
|
+
* @returns {void}
|
|
27714
|
+
*/
|
|
27715
|
+
togglePagination: () => ({ tr, state, dispatch, editor }) => {
|
|
27716
|
+
const isEnabled = PaginationPluginKey.getState(state)?.isEnabled;
|
|
27717
|
+
tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
|
|
27718
|
+
if (dispatch) {
|
|
27719
|
+
dispatch(tr);
|
|
27720
|
+
editor.initDefaultStyles(editor.element, !isEnabled);
|
|
27721
|
+
return true;
|
|
27722
|
+
}
|
|
27699
27723
|
}
|
|
27700
27724
|
};
|
|
27701
27725
|
},
|
|
@@ -27721,11 +27745,21 @@ const Pagination = Extension.create({
|
|
|
27721
27745
|
return {
|
|
27722
27746
|
isReadyToInit: false,
|
|
27723
27747
|
decorations: DecorationSet.empty,
|
|
27724
|
-
isDebugging
|
|
27748
|
+
isDebugging,
|
|
27749
|
+
isEnabled: editor.options.pagination
|
|
27725
27750
|
};
|
|
27726
27751
|
},
|
|
27727
27752
|
apply(tr, oldState, prevEditorState, newEditorState) {
|
|
27728
27753
|
const meta = tr.getMeta(PaginationPluginKey);
|
|
27754
|
+
if (meta && "isEnabled" in meta) {
|
|
27755
|
+
const newEnabled = meta.isEnabled;
|
|
27756
|
+
if (newEnabled) shouldUpdate = true;
|
|
27757
|
+
return {
|
|
27758
|
+
...oldState,
|
|
27759
|
+
decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
|
|
27760
|
+
isEnabled: newEnabled
|
|
27761
|
+
};
|
|
27762
|
+
}
|
|
27729
27763
|
if (meta && meta.isReadyToInit) {
|
|
27730
27764
|
shouldUpdate = true;
|
|
27731
27765
|
shouldInitialize = meta.isReadyToInit;
|
|
@@ -27774,6 +27808,7 @@ const Pagination = Extension.create({
|
|
|
27774
27808
|
let previousDecorations = DecorationSet.empty;
|
|
27775
27809
|
return {
|
|
27776
27810
|
update: (view2, prevState) => {
|
|
27811
|
+
if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
|
|
27777
27812
|
if (!shouldUpdate || isUpdating) return;
|
|
27778
27813
|
isUpdating = true;
|
|
27779
27814
|
hasInitialized = true;
|
|
@@ -27785,7 +27820,8 @@ const Pagination = Extension.create({
|
|
|
27785
27820
|
},
|
|
27786
27821
|
props: {
|
|
27787
27822
|
decorations(state) {
|
|
27788
|
-
|
|
27823
|
+
const pluginState = PaginationPluginKey.getState(state);
|
|
27824
|
+
return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
|
|
27789
27825
|
}
|
|
27790
27826
|
}
|
|
27791
27827
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, nextTick, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { y as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { y as process$1 } from "./converter-g7XDS8H8.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-B3V2UfZk.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -317,10 +317,10 @@ export class Editor extends EventEmitter {
|
|
|
317
317
|
registerPlugin(plugin: any, handlePlugins: any): void;
|
|
318
318
|
/**
|
|
319
319
|
* Unregister a PM plugin
|
|
320
|
-
* @param {string|Object}
|
|
320
|
+
* @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
|
|
321
321
|
* @returns {void}
|
|
322
322
|
*/
|
|
323
|
-
unregisterPlugin(
|
|
323
|
+
unregisterPlugin(nameOrPluginKey: string | any): void;
|
|
324
324
|
converter: any;
|
|
325
325
|
/**
|
|
326
326
|
* Creates all node views.
|
|
@@ -335,7 +335,7 @@ export class Editor extends EventEmitter {
|
|
|
335
335
|
/**
|
|
336
336
|
* Attach styles and attributes to the editor element
|
|
337
337
|
*/
|
|
338
|
-
updateEditorStyles(element: any, proseMirror: any): void;
|
|
338
|
+
updateEditorStyles(element: any, proseMirror: any, hasPaginationEnabled?: boolean): void;
|
|
339
339
|
/**
|
|
340
340
|
* Initialize default styles for the editor container and ProseMirror.
|
|
341
341
|
* Get page size and margins from the converter.
|
|
@@ -344,7 +344,7 @@ export class Editor extends EventEmitter {
|
|
|
344
344
|
* @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
|
|
345
345
|
* @returns {void}
|
|
346
346
|
*/
|
|
347
|
-
initDefaultStyles(element?: HTMLElement): void;
|
|
347
|
+
initDefaultStyles(element?: HTMLElement, isPaginationEnabled?: boolean): void;
|
|
348
348
|
/**
|
|
349
349
|
* Initializes responsive styles for mobile devices.
|
|
350
350
|
* Sets up scaling based on viewport width and handles orientation changes.
|
|
@@ -353,6 +353,13 @@ export class Editor extends EventEmitter {
|
|
|
353
353
|
* @returns {void}
|
|
354
354
|
*/
|
|
355
355
|
initMobileStyles(element: HTMLElement | void): void;
|
|
356
|
+
/**
|
|
357
|
+
* Initialize pagination, if the pagination extension is enabled.
|
|
358
|
+
* @private
|
|
359
|
+
* @async
|
|
360
|
+
* @returns {Promise<void>}
|
|
361
|
+
*/
|
|
362
|
+
private initPagination;
|
|
356
363
|
/**
|
|
357
364
|
* Get attrs of the currently selected node or mark.
|
|
358
365
|
* @param {String} nameOrType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"AAkCA;;;;GAIG;AAEH;;;;;GAKG;AACH;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;GAIG;AACH;IA6rBE;;;;;;;;;;;;OAYG;IACH,+BARW,IAAI,GAAC,IAAI,GAAC,MAAM,WAChB,OAAO,GACL,OAAO,OAAO,CAc1B;IAED;;;;;OAKG;IACH,qCAFa,MAAM,CAKlB;IAED;;;;;;OAMG;IACH,gDAHW,MAAM,OAMhB;IA8tBD;;;;;O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KhB;;CAEF;;;;;cAxuDa,MAAM;;;;iBACN,MAAM;;;;;;;;;UAWP,MAAM;;;;WACN,MAAM;;;;WACN,MAAM,GAAG,IAAI;;;;;;cAIZ,WAAW;;;;eACX,MAAM;;;;iBACN,OAAO;;;;mBACP,QAAQ;;;;iBACR,MAAM;;;;cACN,MAAM;;;;WACN,IAAI;;;;YACJ,KAAK,CAAE,IAAI,CAAC;;;;;;;;;;;;;;;;mBAIZ,MAAM;;;;WACN,MAAM;;;;WACN,MAAM;;;;;;;;;;;;;;;;;;;;iBAKN,MAAM;;;;;;;;eAEN,OAAO;;;;;;;;;;;;;;;;uBAIP,OAAO;;;;wBACP,OAAO;;;;gBACP,OAAO;;;;YACP,MAAM;;;;kBACN,OAAO;;;;iBACP,OAAO;;;;;;;;;;;;uBAGP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAsBP,OAAO;;;;mBACP,OAAO;;;;WACP,MAAM;;6BAzGS,mBAAmB"}
|
|
@@ -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-B3V2UfZk.js";
|
|
2
|
+
import "./chunks/converter-g7XDS8H8.js";
|
|
3
|
+
import "./chunks/docx-zipper-VpCXV0uV.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;;;;;;;;;
|
|
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;;;;;;;;;QA0EN;AAEM,6EAeN;AAEM;;;;;SAsBN;AAEM;;;8DAmBN;0BAvNyB,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAkBA,
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAkBA,6BA8LG"}
|
|
@@ -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 { a5 as getDefaultExportFromCjs, G as v4, a8 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { U } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, f as findParentNode, c as getFileOpener, s as startImageUpload, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { o, C, T, m, q, p, l, n } from "./chunks/editor-
|
|
12
|
+
import { a5 as getDefaultExportFromCjs, G as v4, a8 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-g7XDS8H8.js";
|
|
13
|
+
import { U } from "./chunks/converter-g7XDS8H8.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, f as findParentNode, c as getFileOpener, s as startImageUpload, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-B3V2UfZk.js";
|
|
15
|
+
import { o, C, T, m, q, p, l, n } from "./chunks/editor-B3V2UfZk.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, getCurrentInstance, computed, watch, createCommentVNode, withDirectives, withKeys, vModelText, createTextVNode, toDisplayString, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-DbwzVBvd.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-VpCXV0uV.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-DNcda5wa.cjs");
|
|
4
4
|
require("./chunks/vue-BBjMeYfo.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, S, c, d, e, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, S, c, d, e, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-C0XuFRew.es.js";
|
|
2
2
|
import "./chunks/vue-BBJVqxjL.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-DNcda5wa.cjs");
|
|
4
4
|
const vue = require("./chunks/vue-BBjMeYfo.cjs");
|
|
5
5
|
const jszip = require("./chunks/jszip-9bCX1h2W.cjs");
|
|
6
6
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
|
@@ -47805,7 +47805,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
47805
47805
|
this.config.colors = shuffleArray(this.config.colors);
|
|
47806
47806
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
47807
47807
|
this.colorIndex = 0;
|
|
47808
|
-
this.version = "0.13.2-
|
|
47808
|
+
this.version = "0.13.2-rev11";
|
|
47809
47809
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
47810
47810
|
this.superdocId = config.superdocId || uuid.v4();
|
|
47811
47811
|
this.colors = this.config.colors;
|
|
@@ -48048,6 +48048,19 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
48048
48048
|
doc.rulers = this.config.rulers;
|
|
48049
48049
|
});
|
|
48050
48050
|
}
|
|
48051
|
+
/**
|
|
48052
|
+
* Toggle pagination for SuperEditors
|
|
48053
|
+
* @returns {void}
|
|
48054
|
+
*/
|
|
48055
|
+
togglePagination() {
|
|
48056
|
+
this.config.pagination = !this.config.pagination;
|
|
48057
|
+
this.superdocStore.documents.forEach((doc) => {
|
|
48058
|
+
const editor = doc.getEditor();
|
|
48059
|
+
if (editor) {
|
|
48060
|
+
editor.commands.togglePagination();
|
|
48061
|
+
}
|
|
48062
|
+
});
|
|
48063
|
+
}
|
|
48051
48064
|
#addToolbar() {
|
|
48052
48065
|
const moduleConfig = this.config.modules?.toolbar || {};
|
|
48053
48066
|
this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-
|
|
2
|
-
import { a, S, i, n } from "./chunks/super-editor.es-
|
|
1
|
+
import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-C0XuFRew.es.js";
|
|
2
|
+
import { a, S, i, n } from "./chunks/super-editor.es-C0XuFRew.es.js";
|
|
3
3
|
import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 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, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-BBJVqxjL.es.js";
|
|
4
4
|
import { B as Buffer$2 } from "./chunks/jszip-Cl3s9njw.es.js";
|
|
5
5
|
import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
|
@@ -47788,7 +47788,7 @@ class SuperDoc extends EventEmitter {
|
|
|
47788
47788
|
this.config.colors = shuffleArray(this.config.colors);
|
|
47789
47789
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
47790
47790
|
this.colorIndex = 0;
|
|
47791
|
-
this.version = "0.13.2-
|
|
47791
|
+
this.version = "0.13.2-rev11";
|
|
47792
47792
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
47793
47793
|
this.superdocId = config.superdocId || v4();
|
|
47794
47794
|
this.colors = this.config.colors;
|
|
@@ -48031,6 +48031,19 @@ class SuperDoc extends EventEmitter {
|
|
|
48031
48031
|
doc.rulers = this.config.rulers;
|
|
48032
48032
|
});
|
|
48033
48033
|
}
|
|
48034
|
+
/**
|
|
48035
|
+
* Toggle pagination for SuperEditors
|
|
48036
|
+
* @returns {void}
|
|
48037
|
+
*/
|
|
48038
|
+
togglePagination() {
|
|
48039
|
+
this.config.pagination = !this.config.pagination;
|
|
48040
|
+
this.superdocStore.documents.forEach((doc) => {
|
|
48041
|
+
const editor = doc.getEditor();
|
|
48042
|
+
if (editor) {
|
|
48043
|
+
editor.commands.togglePagination();
|
|
48044
|
+
}
|
|
48045
|
+
});
|
|
48046
|
+
}
|
|
48034
48047
|
#addToolbar() {
|
|
48035
48048
|
const moduleConfig = this.config.modules?.toolbar || {};
|
|
48036
48049
|
this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;
|