@harbour-enterprises/superdoc 0.16.1 → 0.16.3
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/{PdfViewer-Bov51NJk.cjs → PdfViewer-BF9znEuU.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CGOPmqZL.es.js → PdfViewer-DZ7nYZ_7.es.js} +1 -1
- package/dist/chunks/{index-C9t8QM3H.es.js → index-B5SFvLE3.es.js} +3 -3
- package/dist/chunks/{index-H2DnqbsC.cjs → index-ix5rRPuN.cjs} +3 -3
- package/dist/chunks/{super-editor.es-Bd5ul_QJ.cjs → super-editor.es-CUUY0Y9b.cjs} +76 -72
- package/dist/chunks/{super-editor.es-BhpCczpb.es.js → super-editor.es-CcHzk5fr.es.js} +76 -72
- 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-T_2xCPrJ.js → converter-daTWQDSX.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-D22Q5mQ5.js → docx-zipper-D6pIqvek.js} +1 -1
- package/dist/super-editor/chunks/{editor-CCZEU0o3.js → editor-DlwltKCg.js} +76 -72
- package/dist/super-editor/chunks/{toolbar-7j6S3kWZ.js → toolbar-BUKbd0tf.js} +2 -2
- package/dist/super-editor/converter.es.js +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/file-zipper.es.js +1 -1
- package/dist/super-editor/src/core/commands/insertContentAt.d.ts +6 -5
- package/dist/super-editor/src/extensions/block-node/block-node.d.ts +2 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +77 -73
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _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, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_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, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, o as Slice, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as getListItemStyleDefinitions, ai as docxNumberigHelpers, aj as parseIndentElement, ak as combineIndents, al as StepMap, am as getColStyleDeclaration, an as SelectionRange, ao as Transform, ap as findParentNodeClosestToPos, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, o as Slice, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as getListItemStyleDefinitions, ai as docxNumberigHelpers, aj as parseIndentElement, ak as combineIndents, al as StepMap, am as getColStyleDeclaration, an as SelectionRange, ao as Transform, ap as findParentNodeClosestToPos, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-daTWQDSX.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-D6pIqvek.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -1990,76 +1990,78 @@ const isFragment = (nodeOrFragment) => {
|
|
|
1990
1990
|
return !("type" in nodeOrFragment);
|
|
1991
1991
|
};
|
|
1992
1992
|
const insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) => {
|
|
1993
|
-
if (dispatch)
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
editor.emit("contentError", {
|
|
2012
|
-
editor,
|
|
2013
|
-
error: e,
|
|
2014
|
-
disableCollaboration: () => {
|
|
2015
|
-
console.error("[super-editor error]: Unable to disable collaboration at this point in time");
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2018
|
-
return false;
|
|
2019
|
-
}
|
|
2020
|
-
let { from: from2, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
|
|
2021
|
-
const forceTextInsert = typeof value === "string" || Array.isArray(value) && value.every((v) => typeof v === "string" || v && typeof v.text === "string") || value && typeof value === "object" && typeof value.text === "string";
|
|
2022
|
-
let isOnlyTextContent = forceTextInsert;
|
|
2023
|
-
let isOnlyBlockContent = true;
|
|
2024
|
-
const nodes = isFragment(content) ? content : [content];
|
|
2025
|
-
nodes.forEach((node) => {
|
|
2026
|
-
node.check();
|
|
2027
|
-
if (!forceTextInsert) {
|
|
2028
|
-
isOnlyTextContent = isOnlyTextContent ? node.isText && node.marks.length === 0 : false;
|
|
2029
|
-
}
|
|
2030
|
-
isOnlyBlockContent = isOnlyBlockContent ? node.isBlock : false;
|
|
1993
|
+
if (!dispatch) return true;
|
|
1994
|
+
options = {
|
|
1995
|
+
parseOptions: {},
|
|
1996
|
+
updateSelection: true,
|
|
1997
|
+
applyInputRules: false,
|
|
1998
|
+
applyPasteRules: false,
|
|
1999
|
+
// optional escape hatch to force literal text insertion
|
|
2000
|
+
asText: false,
|
|
2001
|
+
...options
|
|
2002
|
+
};
|
|
2003
|
+
let content;
|
|
2004
|
+
try {
|
|
2005
|
+
content = createNodeFromContent(value, editor.schema, {
|
|
2006
|
+
parseOptions: {
|
|
2007
|
+
preserveWhitespace: "full",
|
|
2008
|
+
...options.parseOptions
|
|
2009
|
+
},
|
|
2010
|
+
errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck
|
|
2031
2011
|
});
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
to
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
let newContent;
|
|
2041
|
-
if (isOnlyTextContent) {
|
|
2042
|
-
if (Array.isArray(value)) {
|
|
2043
|
-
newContent = value.map((v) => typeof v === "string" ? v : v && v.text || "").join("");
|
|
2044
|
-
} else if (typeof value === "object" && !!value && !!value.text) {
|
|
2045
|
-
newContent = value.text;
|
|
2046
|
-
} else {
|
|
2047
|
-
newContent = value;
|
|
2012
|
+
} catch (e) {
|
|
2013
|
+
editor.emit("contentError", {
|
|
2014
|
+
editor,
|
|
2015
|
+
error: e,
|
|
2016
|
+
disableCollaboration: () => {
|
|
2017
|
+
console.error("[super-editor error]: Unable to disable collaboration at this point in time");
|
|
2048
2018
|
}
|
|
2049
|
-
|
|
2019
|
+
});
|
|
2020
|
+
return false;
|
|
2021
|
+
}
|
|
2022
|
+
let { from: from2, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
|
|
2023
|
+
const isBareString = typeof value === "string";
|
|
2024
|
+
const looksLikeHTML = isBareString && /^\s*<[a-zA-Z][^>]*>.*<\/[a-zA-Z][^>]*>\s*$/s.test(value);
|
|
2025
|
+
const hasNewline = isBareString && /[\r\n]/.test(value);
|
|
2026
|
+
const forceTextInsert = !!options.asText || hasNewline && !looksLikeHTML || Array.isArray(value) && value.every((v) => typeof v === "string" || v && typeof v.text === "string") || !!value && typeof value === "object" && typeof value.text === "string";
|
|
2027
|
+
let isOnlyTextContent = true;
|
|
2028
|
+
let isOnlyBlockContent = true;
|
|
2029
|
+
const nodes = isFragment(content) ? content : [content];
|
|
2030
|
+
nodes.forEach((node) => {
|
|
2031
|
+
node.check();
|
|
2032
|
+
isOnlyTextContent = isOnlyTextContent ? node.isText && node.marks.length === 0 : false;
|
|
2033
|
+
isOnlyBlockContent = isOnlyBlockContent ? node.isBlock : false;
|
|
2034
|
+
});
|
|
2035
|
+
if (from2 === to && isOnlyBlockContent) {
|
|
2036
|
+
const { parent } = tr.doc.resolve(from2);
|
|
2037
|
+
const isEmptyTextBlock = parent.isTextblock && !parent.type.spec.code && !parent.childCount;
|
|
2038
|
+
if (isEmptyTextBlock) {
|
|
2039
|
+
from2 -= 1;
|
|
2040
|
+
to += 1;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
let newContent;
|
|
2044
|
+
if (isOnlyTextContent || forceTextInsert) {
|
|
2045
|
+
if (Array.isArray(value)) {
|
|
2046
|
+
newContent = value.map((v) => typeof v === "string" ? v : v && v.text || "").join("");
|
|
2047
|
+
} else if (typeof value === "object" && !!value && !!value.text) {
|
|
2048
|
+
newContent = value.text;
|
|
2050
2049
|
} else {
|
|
2051
|
-
newContent =
|
|
2052
|
-
tr.replaceWith(from2, to, newContent);
|
|
2053
|
-
}
|
|
2054
|
-
if (options.updateSelection) {
|
|
2055
|
-
selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
|
|
2056
|
-
}
|
|
2057
|
-
if (options.applyInputRules) {
|
|
2058
|
-
tr.setMeta("applyInputRules", { from: from2, text: newContent });
|
|
2059
|
-
}
|
|
2060
|
-
if (options.applyPasteRules) {
|
|
2061
|
-
tr.setMeta("applyPasteRules", { from: from2, text: newContent });
|
|
2050
|
+
newContent = typeof value === "string" ? value : "";
|
|
2062
2051
|
}
|
|
2052
|
+
tr.insertText(newContent, from2, to);
|
|
2053
|
+
} else {
|
|
2054
|
+
newContent = content;
|
|
2055
|
+
tr.replaceWith(from2, to, newContent);
|
|
2056
|
+
}
|
|
2057
|
+
if (options.updateSelection) {
|
|
2058
|
+
selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
|
|
2059
|
+
}
|
|
2060
|
+
if (options.applyInputRules) {
|
|
2061
|
+
tr.setMeta("applyInputRules", { from: from2, text: newContent });
|
|
2062
|
+
}
|
|
2063
|
+
if (options.applyPasteRules) {
|
|
2064
|
+
tr.setMeta("applyPasteRules", { from: from2, text: newContent });
|
|
2063
2065
|
}
|
|
2064
2066
|
return true;
|
|
2065
2067
|
};
|
|
@@ -14254,7 +14256,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14254
14256
|
* @returns {Object | void} Migration results
|
|
14255
14257
|
*/
|
|
14256
14258
|
processCollaborationMigrations() {
|
|
14257
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.16.
|
|
14259
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.16.2");
|
|
14258
14260
|
if (!this.options.ydoc) return;
|
|
14259
14261
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14260
14262
|
let docVersion = metaMap.get("version");
|
|
@@ -25048,11 +25050,10 @@ const BlockNode = Extension.create({
|
|
|
25048
25050
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
25049
25051
|
if (hasInitialized && !transactions.some((tr2) => tr2.docChanged)) return null;
|
|
25050
25052
|
if (hasInitialized && !checkForNewBlockNodesInTrs(transactions)) return null;
|
|
25051
|
-
|
|
25053
|
+
const { tr } = newState;
|
|
25052
25054
|
let changed = false;
|
|
25053
25055
|
newState.doc.descendants((node, pos) => {
|
|
25054
25056
|
if (!nodeAllowsSdBlockIdAttr(node) || !nodeNeedsSdBlockId(node)) return null;
|
|
25055
|
-
tr = tr ?? newState.tr;
|
|
25056
25057
|
tr.setNodeMarkup(
|
|
25057
25058
|
pos,
|
|
25058
25059
|
void 0,
|
|
@@ -25064,7 +25065,10 @@ const BlockNode = Extension.create({
|
|
|
25064
25065
|
);
|
|
25065
25066
|
changed = true;
|
|
25066
25067
|
});
|
|
25067
|
-
if (changed && !hasInitialized)
|
|
25068
|
+
if (changed && !hasInitialized) {
|
|
25069
|
+
hasInitialized = true;
|
|
25070
|
+
}
|
|
25071
|
+
tr.setStoredMarks(newState.tr.storedMarks);
|
|
25068
25072
|
return changed ? tr : null;
|
|
25069
25073
|
}
|
|
25070
25074
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { H as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { H as process$1 } from "./converter-daTWQDSX.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DlwltKCg.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -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-DlwltKCg.js";
|
|
2
|
+
import "./chunks/converter-daTWQDSX.js";
|
|
3
|
+
import "./chunks/docx-zipper-D6pIqvek.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function insertContentAt(position: import("prosemirror-model").ResolvedPos
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export function insertContentAt(position: import("prosemirror-model").ResolvedPos | number | {
|
|
2
|
+
from: number;
|
|
3
|
+
to: number;
|
|
4
|
+
}, value: string | Array<string | {
|
|
5
|
+
text?: string;
|
|
6
|
+
}> | ProseMirrorNode | ProseMirrorFragment, options: any): boolean;
|
|
6
7
|
export type ProseMirrorNode = import("prosemirror-model").Node;
|
|
7
8
|
export type ProseMirrorFragment = import("prosemirror-model").Fragment;
|
|
@@ -2,6 +2,7 @@ export const BlockNodePluginKey: PluginKey<any>;
|
|
|
2
2
|
export const BlockNode: Extension;
|
|
3
3
|
export function nodeAllowsSdBlockIdAttr(node: import("prosemirror-model").Node): boolean;
|
|
4
4
|
export function nodeNeedsSdBlockId(node: import("prosemirror-model").Node): boolean;
|
|
5
|
-
export function checkForNewBlockNodesInTrs(transactions:
|
|
5
|
+
export function checkForNewBlockNodesInTrs(transactions: readonly Transaction[]): boolean;
|
|
6
6
|
import { PluginKey } from 'prosemirror-state';
|
|
7
7
|
import { Extension } from '@core/Extension.js';
|
|
8
|
+
import { Transaction } from 'prosemirror-state';
|
|
@@ -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 { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { aE, a4, d, a1 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { k, C, l, T, i, m, j } from "./chunks/editor-
|
|
12
|
+
import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, a as Plugin } from "./chunks/converter-daTWQDSX.js";
|
|
13
|
+
import { aE, a4, d, a1 } from "./chunks/converter-daTWQDSX.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-DlwltKCg.js";
|
|
15
|
+
import { k, C, l, T, i, m, j } from "./chunks/editor-DlwltKCg.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BUKbd0tf.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-D6pIqvek.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
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-CUUY0Y9b.cjs");
|
|
4
4
|
require("./chunks/vue-B6WOnFdF.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, f, g, T, h, i, j, k, l, m, n, o, p, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, q } from "./chunks/super-editor.es-CcHzk5fr.es.js";
|
|
2
2
|
import "./chunks/vue-xvq3uP6K.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CUUY0Y9b.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-ix5rRPuN.cjs");
|
|
5
5
|
require("./chunks/vue-B6WOnFdF.cjs");
|
|
6
6
|
require("./chunks/jszip-DmmUnPkH.cjs");
|
|
7
7
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, p, q } from "./chunks/super-editor.es-CcHzk5fr.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-B5SFvLE3.es.js";
|
|
3
3
|
import "./chunks/vue-xvq3uP6K.es.js";
|
|
4
4
|
import "./chunks/jszip-DXHu60h9.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
package/dist/superdoc.umd.js
CHANGED
|
@@ -37720,7 +37720,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
37720
37720
|
return;
|
|
37721
37721
|
}
|
|
37722
37722
|
}
|
|
37723
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.16.
|
|
37723
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.16.2") {
|
|
37724
37724
|
const customLocation = "docProps/custom.xml";
|
|
37725
37725
|
if (!docx[customLocation]) {
|
|
37726
37726
|
docx[customLocation] = generateCustomXml();
|
|
@@ -38202,7 +38202,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38202
38202
|
function generateCustomXml() {
|
|
38203
38203
|
return DEFAULT_CUSTOM_XML;
|
|
38204
38204
|
}
|
|
38205
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.16.
|
|
38205
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.16.2") {
|
|
38206
38206
|
return {
|
|
38207
38207
|
type: "element",
|
|
38208
38208
|
name: "property",
|
|
@@ -42759,76 +42759,78 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
42759
42759
|
return !("type" in nodeOrFragment);
|
|
42760
42760
|
};
|
|
42761
42761
|
const insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) => {
|
|
42762
|
-
if (dispatch)
|
|
42763
|
-
|
|
42764
|
-
|
|
42765
|
-
|
|
42766
|
-
|
|
42767
|
-
|
|
42768
|
-
|
|
42769
|
-
|
|
42770
|
-
|
|
42771
|
-
|
|
42772
|
-
|
|
42773
|
-
|
|
42774
|
-
|
|
42775
|
-
|
|
42776
|
-
|
|
42777
|
-
|
|
42778
|
-
}
|
|
42779
|
-
|
|
42780
|
-
editor.emit("contentError", {
|
|
42781
|
-
editor,
|
|
42782
|
-
error: e,
|
|
42783
|
-
disableCollaboration: () => {
|
|
42784
|
-
console.error("[super-editor error]: Unable to disable collaboration at this point in time");
|
|
42785
|
-
}
|
|
42786
|
-
});
|
|
42787
|
-
return false;
|
|
42788
|
-
}
|
|
42789
|
-
let { from: from2, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
|
|
42790
|
-
const forceTextInsert = typeof value === "string" || Array.isArray(value) && value.every((v2) => typeof v2 === "string" || v2 && typeof v2.text === "string") || value && typeof value === "object" && typeof value.text === "string";
|
|
42791
|
-
let isOnlyTextContent = forceTextInsert;
|
|
42792
|
-
let isOnlyBlockContent = true;
|
|
42793
|
-
const nodes = isFragment(content) ? content : [content];
|
|
42794
|
-
nodes.forEach((node2) => {
|
|
42795
|
-
node2.check();
|
|
42796
|
-
if (!forceTextInsert) {
|
|
42797
|
-
isOnlyTextContent = isOnlyTextContent ? node2.isText && node2.marks.length === 0 : false;
|
|
42798
|
-
}
|
|
42799
|
-
isOnlyBlockContent = isOnlyBlockContent ? node2.isBlock : false;
|
|
42762
|
+
if (!dispatch) return true;
|
|
42763
|
+
options = {
|
|
42764
|
+
parseOptions: {},
|
|
42765
|
+
updateSelection: true,
|
|
42766
|
+
applyInputRules: false,
|
|
42767
|
+
applyPasteRules: false,
|
|
42768
|
+
// optional escape hatch to force literal text insertion
|
|
42769
|
+
asText: false,
|
|
42770
|
+
...options
|
|
42771
|
+
};
|
|
42772
|
+
let content;
|
|
42773
|
+
try {
|
|
42774
|
+
content = createNodeFromContent(value, editor.schema, {
|
|
42775
|
+
parseOptions: {
|
|
42776
|
+
preserveWhitespace: "full",
|
|
42777
|
+
...options.parseOptions
|
|
42778
|
+
},
|
|
42779
|
+
errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck
|
|
42800
42780
|
});
|
|
42801
|
-
|
|
42802
|
-
|
|
42803
|
-
|
|
42804
|
-
|
|
42805
|
-
|
|
42806
|
-
to
|
|
42807
|
-
}
|
|
42808
|
-
}
|
|
42809
|
-
let newContent;
|
|
42810
|
-
if (isOnlyTextContent) {
|
|
42811
|
-
if (Array.isArray(value)) {
|
|
42812
|
-
newContent = value.map((v2) => typeof v2 === "string" ? v2 : v2 && v2.text || "").join("");
|
|
42813
|
-
} else if (typeof value === "object" && !!value && !!value.text) {
|
|
42814
|
-
newContent = value.text;
|
|
42815
|
-
} else {
|
|
42816
|
-
newContent = value;
|
|
42781
|
+
} catch (e) {
|
|
42782
|
+
editor.emit("contentError", {
|
|
42783
|
+
editor,
|
|
42784
|
+
error: e,
|
|
42785
|
+
disableCollaboration: () => {
|
|
42786
|
+
console.error("[super-editor error]: Unable to disable collaboration at this point in time");
|
|
42817
42787
|
}
|
|
42818
|
-
|
|
42788
|
+
});
|
|
42789
|
+
return false;
|
|
42790
|
+
}
|
|
42791
|
+
let { from: from2, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
|
|
42792
|
+
const isBareString = typeof value === "string";
|
|
42793
|
+
const looksLikeHTML = isBareString && /^\s*<[a-zA-Z][^>]*>.*<\/[a-zA-Z][^>]*>\s*$/s.test(value);
|
|
42794
|
+
const hasNewline = isBareString && /[\r\n]/.test(value);
|
|
42795
|
+
const forceTextInsert = !!options.asText || hasNewline && !looksLikeHTML || Array.isArray(value) && value.every((v2) => typeof v2 === "string" || v2 && typeof v2.text === "string") || !!value && typeof value === "object" && typeof value.text === "string";
|
|
42796
|
+
let isOnlyTextContent = true;
|
|
42797
|
+
let isOnlyBlockContent = true;
|
|
42798
|
+
const nodes = isFragment(content) ? content : [content];
|
|
42799
|
+
nodes.forEach((node2) => {
|
|
42800
|
+
node2.check();
|
|
42801
|
+
isOnlyTextContent = isOnlyTextContent ? node2.isText && node2.marks.length === 0 : false;
|
|
42802
|
+
isOnlyBlockContent = isOnlyBlockContent ? node2.isBlock : false;
|
|
42803
|
+
});
|
|
42804
|
+
if (from2 === to && isOnlyBlockContent) {
|
|
42805
|
+
const { parent } = tr.doc.resolve(from2);
|
|
42806
|
+
const isEmptyTextBlock = parent.isTextblock && !parent.type.spec.code && !parent.childCount;
|
|
42807
|
+
if (isEmptyTextBlock) {
|
|
42808
|
+
from2 -= 1;
|
|
42809
|
+
to += 1;
|
|
42810
|
+
}
|
|
42811
|
+
}
|
|
42812
|
+
let newContent;
|
|
42813
|
+
if (isOnlyTextContent || forceTextInsert) {
|
|
42814
|
+
if (Array.isArray(value)) {
|
|
42815
|
+
newContent = value.map((v2) => typeof v2 === "string" ? v2 : v2 && v2.text || "").join("");
|
|
42816
|
+
} else if (typeof value === "object" && !!value && !!value.text) {
|
|
42817
|
+
newContent = value.text;
|
|
42819
42818
|
} else {
|
|
42820
|
-
newContent =
|
|
42821
|
-
tr.replaceWith(from2, to, newContent);
|
|
42822
|
-
}
|
|
42823
|
-
if (options.updateSelection) {
|
|
42824
|
-
selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
|
|
42825
|
-
}
|
|
42826
|
-
if (options.applyInputRules) {
|
|
42827
|
-
tr.setMeta("applyInputRules", { from: from2, text: newContent });
|
|
42828
|
-
}
|
|
42829
|
-
if (options.applyPasteRules) {
|
|
42830
|
-
tr.setMeta("applyPasteRules", { from: from2, text: newContent });
|
|
42819
|
+
newContent = typeof value === "string" ? value : "";
|
|
42831
42820
|
}
|
|
42821
|
+
tr.insertText(newContent, from2, to);
|
|
42822
|
+
} else {
|
|
42823
|
+
newContent = content;
|
|
42824
|
+
tr.replaceWith(from2, to, newContent);
|
|
42825
|
+
}
|
|
42826
|
+
if (options.updateSelection) {
|
|
42827
|
+
selectionToInsertionEnd(tr, tr.steps.length - 1, -1);
|
|
42828
|
+
}
|
|
42829
|
+
if (options.applyInputRules) {
|
|
42830
|
+
tr.setMeta("applyInputRules", { from: from2, text: newContent });
|
|
42831
|
+
}
|
|
42832
|
+
if (options.applyPasteRules) {
|
|
42833
|
+
tr.setMeta("applyPasteRules", { from: from2, text: newContent });
|
|
42832
42834
|
}
|
|
42833
42835
|
return true;
|
|
42834
42836
|
};
|
|
@@ -54971,7 +54973,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
54971
54973
|
* @returns {Object | void} Migration results
|
|
54972
54974
|
*/
|
|
54973
54975
|
processCollaborationMigrations() {
|
|
54974
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.16.
|
|
54976
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.16.2");
|
|
54975
54977
|
if (!this.options.ydoc) return;
|
|
54976
54978
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
54977
54979
|
let docVersion = metaMap.get("version");
|
|
@@ -65648,11 +65650,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
65648
65650
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
65649
65651
|
if (hasInitialized && !transactions.some((tr2) => tr2.docChanged)) return null;
|
|
65650
65652
|
if (hasInitialized && !checkForNewBlockNodesInTrs(transactions)) return null;
|
|
65651
|
-
|
|
65653
|
+
const { tr } = newState;
|
|
65652
65654
|
let changed = false;
|
|
65653
65655
|
newState.doc.descendants((node2, pos) => {
|
|
65654
65656
|
if (!nodeAllowsSdBlockIdAttr(node2) || !nodeNeedsSdBlockId(node2)) return null;
|
|
65655
|
-
tr = tr ?? newState.tr;
|
|
65656
65657
|
tr.setNodeMarkup(
|
|
65657
65658
|
pos,
|
|
65658
65659
|
void 0,
|
|
@@ -65664,7 +65665,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
65664
65665
|
);
|
|
65665
65666
|
changed = true;
|
|
65666
65667
|
});
|
|
65667
|
-
if (changed && !hasInitialized)
|
|
65668
|
+
if (changed && !hasInitialized) {
|
|
65669
|
+
hasInitialized = true;
|
|
65670
|
+
}
|
|
65671
|
+
tr.setStoredMarks(newState.tr.storedMarks);
|
|
65668
65672
|
return changed ? tr : null;
|
|
65669
65673
|
}
|
|
65670
65674
|
})
|
|
@@ -104484,7 +104488,7 @@ ${style2}
|
|
|
104484
104488
|
this.config.colors = shuffleArray(this.config.colors);
|
|
104485
104489
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
104486
104490
|
this.colorIndex = 0;
|
|
104487
|
-
this.version = "0.16.
|
|
104491
|
+
this.version = "0.16.2";
|
|
104488
104492
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
104489
104493
|
this.superdocId = config.superdocId || v4();
|
|
104490
104494
|
this.colors = this.config.colors;
|