@harbour-enterprises/superdoc 0.28.2 → 0.29.0-next.1
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-lAbA0-lT.cjs → PdfViewer-D-eZ2Yov.cjs} +1 -1
- package/dist/chunks/{PdfViewer-DpWYWlWj.es.js → PdfViewer-DkZrQk4g.es.js} +1 -1
- package/dist/chunks/{index-Dw2T2UIP.es.js → index-DJQlES_f.es.js} +3 -3
- package/dist/chunks/{index-Dz5_CDAf-B9kc0ArX.es.js → index-DQ6dCde6-BZTSGgXX.es.js} +1 -1
- package/dist/chunks/{index-Dz5_CDAf-C5D7BTD6.cjs → index-DQ6dCde6-BnMDi7G1.cjs} +1 -1
- package/dist/chunks/{index-ByVhw_G0.cjs → index-zeAsCB89.cjs} +3 -3
- package/dist/chunks/{super-editor.es-7iRvcDFc.cjs → super-editor.es-BV85aAFJ.cjs} +135 -36
- package/dist/chunks/{super-editor.es-DnZ5Ru-q.es.js → super-editor.es-CLErM40t.es.js} +135 -36
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +10 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-C5g1OhUM.js → converter-iD03MYzC.js} +95 -29
- package/dist/super-editor/chunks/{docx-zipper-D9LLIDXC.js → docx-zipper-nrZgxvR8.js} +1 -1
- package/dist/super-editor/chunks/{editor-CD7hiFDo.js → editor-C7iHgXnE.js} +42 -9
- package/dist/super-editor/chunks/{index-Dz5_CDAf.js → index-DQ6dCde6.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-BC_z_xMq.js → toolbar-DKrq-G-q.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/style.css +10 -0
- package/dist/super-editor/super-editor/src/core/super-converter/relationship-helpers.d.ts +2 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/listImporter.d.ts +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/numberingCache.d.ts +2 -2
- package/dist/super-editor/super-editor/src/utils/headless-helpers.d.ts +1 -0
- package/dist/super-editor/super-editor/src/utils/styleIsolation.d.ts +2 -0
- 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 +137 -38
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -28333,7 +28333,23 @@
|
|
|
28333
28333
|
]
|
|
28334
28334
|
};
|
|
28335
28335
|
const docxNumberingCacheStore = /* @__PURE__ */ new WeakMap();
|
|
28336
|
+
const NUMBERING_CACHE_KEY = "numbering-cache";
|
|
28336
28337
|
const LEVELS_MAP_KEY = Symbol("superdoc.numbering.levels");
|
|
28338
|
+
const NUMBERING_CACHE_DOCX_KEY = Symbol("superdoc.numbering.docx");
|
|
28339
|
+
const clearConverterCache = (converter) => {
|
|
28340
|
+
if (!converter) return;
|
|
28341
|
+
delete converter[NUMBERING_CACHE_KEY];
|
|
28342
|
+
delete converter[NUMBERING_CACHE_DOCX_KEY];
|
|
28343
|
+
};
|
|
28344
|
+
const setConverterCache = (converter, cache2, docx) => {
|
|
28345
|
+
if (!converter) return;
|
|
28346
|
+
converter[NUMBERING_CACHE_KEY] = cache2;
|
|
28347
|
+
if (docx && typeof docx === "object") {
|
|
28348
|
+
converter[NUMBERING_CACHE_DOCX_KEY] = docx;
|
|
28349
|
+
} else {
|
|
28350
|
+
delete converter[NUMBERING_CACHE_DOCX_KEY];
|
|
28351
|
+
}
|
|
28352
|
+
};
|
|
28337
28353
|
const createEmptyCache = () => ({
|
|
28338
28354
|
numToAbstractId: /* @__PURE__ */ new Map(),
|
|
28339
28355
|
abstractById: /* @__PURE__ */ new Map(),
|
|
@@ -28405,12 +28421,27 @@
|
|
|
28405
28421
|
}
|
|
28406
28422
|
return { numToAbstractId, abstractById, templateById, numToDefinition, numNodesById };
|
|
28407
28423
|
};
|
|
28408
|
-
const ensureNumberingCache = (docx) => {
|
|
28424
|
+
const ensureNumberingCache = (docx, converter) => {
|
|
28425
|
+
if (converter?.[NUMBERING_CACHE_KEY]) {
|
|
28426
|
+
const cachedDocx = converter[NUMBERING_CACHE_DOCX_KEY];
|
|
28427
|
+
if (docx && cachedDocx && cachedDocx !== docx) {
|
|
28428
|
+
clearConverterCache(converter);
|
|
28429
|
+
} else {
|
|
28430
|
+
return converter[NUMBERING_CACHE_KEY];
|
|
28431
|
+
}
|
|
28432
|
+
}
|
|
28409
28433
|
if (!docx || typeof docx !== "object") return createEmptyCache();
|
|
28410
28434
|
const existingCache = docxNumberingCacheStore.get(docx);
|
|
28411
|
-
if (existingCache)
|
|
28435
|
+
if (existingCache) {
|
|
28436
|
+
setConverterCache(converter, existingCache, docx);
|
|
28437
|
+
return existingCache;
|
|
28438
|
+
}
|
|
28412
28439
|
const cache2 = buildNumberingCache(docx);
|
|
28413
|
-
|
|
28440
|
+
if (converter) {
|
|
28441
|
+
setConverterCache(converter, cache2, docx);
|
|
28442
|
+
} else {
|
|
28443
|
+
docxNumberingCacheStore.set(docx, cache2);
|
|
28444
|
+
}
|
|
28414
28445
|
return cache2;
|
|
28415
28446
|
};
|
|
28416
28447
|
const handleListNode = (params2) => {
|
|
@@ -28667,11 +28698,11 @@
|
|
|
28667
28698
|
}
|
|
28668
28699
|
return { numId, ilvl };
|
|
28669
28700
|
};
|
|
28670
|
-
const getAbstractDefinition = (numId, docx) => {
|
|
28701
|
+
const getAbstractDefinition = (numId, docx, converter) => {
|
|
28671
28702
|
const numberingXml = docx["word/numbering.xml"];
|
|
28672
28703
|
if (!numberingXml) return {};
|
|
28673
28704
|
if (numId == null) return void 0;
|
|
28674
|
-
const cache2 = ensureNumberingCache(docx);
|
|
28705
|
+
const cache2 = ensureNumberingCache(docx, converter);
|
|
28675
28706
|
const numKey = String(numId);
|
|
28676
28707
|
let listDefinitionForThisNumId = cache2.numToDefinition.get(numKey);
|
|
28677
28708
|
if (!listDefinitionForThisNumId) {
|
|
@@ -32184,10 +32215,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
32184
32215
|
if (typeof numId === "string") numId = Number(numId);
|
|
32185
32216
|
if (typeof level === "string") level = Number(level);
|
|
32186
32217
|
const docx = editor?.converter?.convertedXml;
|
|
32187
|
-
const
|
|
32218
|
+
const converter = editor?.converter;
|
|
32219
|
+
const numbering = converter?.numbering;
|
|
32188
32220
|
const styleDefinition = docx ? getStyleTagFromStyleId(styleId, docx) : null;
|
|
32189
32221
|
const stylePpr = styleDefinition?.elements.find((el) => el.name === "w:pPr");
|
|
32190
|
-
let abstractDefinition = docx ? getAbstractDefinition(numId, docx) : null;
|
|
32222
|
+
let abstractDefinition = docx ? getAbstractDefinition(numId, docx, converter) : null;
|
|
32191
32223
|
if (!abstractDefinition) {
|
|
32192
32224
|
const listDef = numbering?.definitions?.[numId];
|
|
32193
32225
|
const abstractId = listDef?.elements?.find((item) => item.name === "w:abstractNumId")?.attributes?.["w:val"];
|
|
@@ -36528,7 +36560,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
36528
36560
|
const { width: w2, height: h2 } = resizeKeepAspectRatio(size2.w, size2.h, maxWidthEmu);
|
|
36529
36561
|
if (w2 && h2) size2 = { w: w2, h: h2 };
|
|
36530
36562
|
}
|
|
36531
|
-
if (
|
|
36563
|
+
if (imageId) {
|
|
36564
|
+
const docx = params2.converter?.convertedXml || {};
|
|
36565
|
+
const rels = docx["word/_rels/document.xml.rels"];
|
|
36566
|
+
const relsTag = rels?.elements?.find((el) => el.name === "Relationships");
|
|
36567
|
+
const hasRelation = relsTag?.elements.find((el) => el.attributes.Id === imageId);
|
|
36568
|
+
const path2 = src?.split("word/")[1];
|
|
36569
|
+
if (!hasRelation) {
|
|
36570
|
+
addImageRelationshipForId(params2, imageId, path2);
|
|
36571
|
+
}
|
|
36572
|
+
} else if (params2.node.type === "image" && !imageId) {
|
|
36532
36573
|
const path2 = src?.split("word/")[1];
|
|
36533
36574
|
imageId = addNewImageRelationship(params2, path2);
|
|
36534
36575
|
} else if (params2.node.type === "fieldAnnotation" && !imageId) {
|
|
@@ -36752,6 +36793,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
36752
36793
|
params2.relationships.push(newRel);
|
|
36753
36794
|
return newId;
|
|
36754
36795
|
}
|
|
36796
|
+
function addImageRelationshipForId(params2, id, imagePath) {
|
|
36797
|
+
const newRel = {
|
|
36798
|
+
type: "element",
|
|
36799
|
+
name: "Relationship",
|
|
36800
|
+
attributes: {
|
|
36801
|
+
Id: id,
|
|
36802
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
|
36803
|
+
Target: imagePath
|
|
36804
|
+
}
|
|
36805
|
+
};
|
|
36806
|
+
params2.relationships.push(newRel);
|
|
36807
|
+
}
|
|
36755
36808
|
function translateVectorShape(params2) {
|
|
36756
36809
|
const { node: node2 } = params2;
|
|
36757
36810
|
const { drawingContent } = node2.attrs;
|
|
@@ -41240,7 +41293,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41240
41293
|
comments,
|
|
41241
41294
|
inlineDocumentFonts,
|
|
41242
41295
|
linkedStyles: getStyleDefinitions(docx),
|
|
41243
|
-
numbering: getNumberingDefinitions(docx)
|
|
41296
|
+
numbering: getNumberingDefinitions(docx, converter)
|
|
41244
41297
|
};
|
|
41245
41298
|
}
|
|
41246
41299
|
return null;
|
|
@@ -41639,8 +41692,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41639
41692
|
]);
|
|
41640
41693
|
return content2.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
|
|
41641
41694
|
}
|
|
41642
|
-
function getNumberingDefinitions(docx) {
|
|
41643
|
-
const cache2 = ensureNumberingCache(docx);
|
|
41695
|
+
function getNumberingDefinitions(docx, converter) {
|
|
41696
|
+
const cache2 = ensureNumberingCache(docx, converter);
|
|
41644
41697
|
const abstractDefinitions = {};
|
|
41645
41698
|
cache2.abstractById.forEach((value, key2) => {
|
|
41646
41699
|
const numericKey = Number(key2);
|
|
@@ -43014,6 +43067,35 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
43014
43067
|
};
|
|
43015
43068
|
const HYPERLINK_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
43016
43069
|
const HEADER_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
|
43070
|
+
const FOOTER_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
|
43071
|
+
const REL_ID_NUMERIC_PATTERN = /rId|mi/g;
|
|
43072
|
+
const getLargestRelationshipId = (relationships = []) => {
|
|
43073
|
+
const numericIds = relationships.map((rel) => Number(String(rel?.attributes?.Id ?? "").replace(REL_ID_NUMERIC_PATTERN, ""))).filter((value) => Number.isFinite(value));
|
|
43074
|
+
return numericIds.length ? Math.max(...numericIds) : 0;
|
|
43075
|
+
};
|
|
43076
|
+
const mergeRelationshipElements = (existingRelationships = [], newRelationships = []) => {
|
|
43077
|
+
if (!newRelationships?.length) return existingRelationships;
|
|
43078
|
+
let largestId = getLargestRelationshipId(existingRelationships);
|
|
43079
|
+
const seenIds = new Set(existingRelationships.map((rel) => rel?.attributes?.Id).filter(Boolean));
|
|
43080
|
+
const additions = [];
|
|
43081
|
+
newRelationships.forEach((rel) => {
|
|
43082
|
+
if (!rel?.attributes) return;
|
|
43083
|
+
const attributes = rel.attributes;
|
|
43084
|
+
const currentId = attributes.Id || "";
|
|
43085
|
+
attributes.Target = attributes?.Target?.replace(/&/g, "&");
|
|
43086
|
+
const existingTarget = existingRelationships.find((el) => el.attributes.Target === attributes.Target);
|
|
43087
|
+
const isMedia = attributes.Target?.startsWith("media/");
|
|
43088
|
+
const isNewHyperlink = attributes.Type === HYPERLINK_RELATIONSHIP_TYPE && currentId.length > 6;
|
|
43089
|
+
const isNewHeadFoot = (attributes.Type === HEADER_RELATIONSHIP_TYPE || attributes.Type === FOOTER_RELATIONSHIP_TYPE) && currentId.length > 6;
|
|
43090
|
+
const hasSeenId = currentId && seenIds.has(currentId);
|
|
43091
|
+
const shouldSkip2 = !isNewHyperlink && !isNewHeadFoot && (hasSeenId || existingTarget);
|
|
43092
|
+
if (shouldSkip2) return;
|
|
43093
|
+
attributes.Id = currentId.length > 6 || isMedia ? currentId : `rId${++largestId}`;
|
|
43094
|
+
seenIds.add(attributes.Id);
|
|
43095
|
+
additions.push(rel);
|
|
43096
|
+
});
|
|
43097
|
+
return additions.length ? [...existingRelationships, ...additions] : existingRelationships;
|
|
43098
|
+
};
|
|
43017
43099
|
const FONT_FAMILY_FALLBACKS = Object.freeze({
|
|
43018
43100
|
swiss: "Arial, sans-serif",
|
|
43019
43101
|
roman: "Times New Roman, serif",
|
|
@@ -43222,7 +43304,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
43222
43304
|
static getStoredSuperdocVersion(docx) {
|
|
43223
43305
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
43224
43306
|
}
|
|
43225
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.28.
|
|
43307
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.28.2") {
|
|
43226
43308
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
43227
43309
|
}
|
|
43228
43310
|
/**
|
|
@@ -43728,23 +43810,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
43728
43810
|
exportProcessNewRelationships_fn = function(rels = []) {
|
|
43729
43811
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
43730
43812
|
const relationships = relsData.elements.find((x) => x.name === "Relationships");
|
|
43731
|
-
|
|
43732
|
-
const regex = /rId|mi/g;
|
|
43733
|
-
let largestId = Math.max(...relationships.elements.map((el) => Number(el.attributes.Id.replace(regex, ""))));
|
|
43734
|
-
rels.forEach((rel) => {
|
|
43735
|
-
const existingId = rel.attributes.Id;
|
|
43736
|
-
const existingTarget = relationships.elements.find((el) => el.attributes.Target === rel.attributes.Target);
|
|
43737
|
-
const isNewMedia = rel.attributes.Target?.startsWith("media/") && existingId.length > 6;
|
|
43738
|
-
const isNewHyperlink = rel.attributes.Type === HYPERLINK_RELATIONSHIP_TYPE && existingId.length > 6;
|
|
43739
|
-
const isNewHeadFoot = rel.attributes.Type === HEADER_RELATIONSHIP_TYPE && existingId.length > 6;
|
|
43740
|
-
if (existingTarget && !isNewMedia && !isNewHyperlink && !isNewHeadFoot) {
|
|
43741
|
-
return;
|
|
43742
|
-
}
|
|
43743
|
-
rel.attributes.Target = rel.attributes?.Target?.replace(/&/g, "&");
|
|
43744
|
-
rel.attributes.Id = existingId.length > 6 ? existingId : `rId${++largestId}`;
|
|
43745
|
-
newRels.push(rel);
|
|
43746
|
-
});
|
|
43747
|
-
relationships.elements = [...relationships.elements, ...newRels];
|
|
43813
|
+
relationships.elements = mergeRelationshipElements(relationships.elements, rels);
|
|
43748
43814
|
};
|
|
43749
43815
|
exportProcessMediaFiles_fn = async function(media2 = {}) {
|
|
43750
43816
|
const processedData = {
|
|
@@ -57428,10 +57494,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
57428
57494
|
type: getNodeType(extension.name, this.schema)
|
|
57429
57495
|
};
|
|
57430
57496
|
const addNodeView = getExtensionConfigField(extension, "addNodeView", context);
|
|
57431
|
-
if (!addNodeView) return
|
|
57497
|
+
if (!addNodeView) return null;
|
|
57498
|
+
const nodeViewFunction = addNodeView();
|
|
57499
|
+
if (!nodeViewFunction) return null;
|
|
57432
57500
|
const nodeview = (node2, _view, getPos, decorations) => {
|
|
57433
57501
|
const htmlAttributes = Attribute.getAttributesToRender(node2, extensionAttrs);
|
|
57434
|
-
return
|
|
57502
|
+
return nodeViewFunction({
|
|
57435
57503
|
editor,
|
|
57436
57504
|
node: node2,
|
|
57437
57505
|
getPos,
|
|
@@ -57441,7 +57509,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
57441
57509
|
});
|
|
57442
57510
|
};
|
|
57443
57511
|
return [extension.name, nodeview];
|
|
57444
|
-
});
|
|
57512
|
+
}).filter(Boolean);
|
|
57445
57513
|
return Object.fromEntries(entries);
|
|
57446
57514
|
}
|
|
57447
57515
|
};
|
|
@@ -58064,6 +58132,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
58064
58132
|
const updateYdocDocxData = async (editor, ydoc) => {
|
|
58065
58133
|
ydoc = ydoc || editor.options.ydoc;
|
|
58066
58134
|
if (!ydoc) return;
|
|
58135
|
+
if (!editor || editor.isDestroyed) return;
|
|
58067
58136
|
const metaMap = ydoc.getMap("meta");
|
|
58068
58137
|
const docxValue = metaMap.get("docx");
|
|
58069
58138
|
let docx = [];
|
|
@@ -58095,6 +58164,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
58095
58164
|
{ event: "docx-update", user: editor.options.user }
|
|
58096
58165
|
);
|
|
58097
58166
|
};
|
|
58167
|
+
const STYLE_ISOLATION_CLASS = "sd-editor-scoped";
|
|
58168
|
+
const applyStyleIsolationClass = (target) => {
|
|
58169
|
+
if (!target || !target.classList) return;
|
|
58170
|
+
target.classList.add(STYLE_ISOLATION_CLASS);
|
|
58171
|
+
};
|
|
58098
58172
|
const PaginationPluginKey = new PluginKey("paginationPlugin");
|
|
58099
58173
|
const initPaginationData = async (editor) => {
|
|
58100
58174
|
if (!editor.converter) return;
|
|
@@ -58130,6 +58204,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
58130
58204
|
return new Promise((resolve2) => {
|
|
58131
58205
|
const editorContainer = document.createElement("div");
|
|
58132
58206
|
editorContainer.className = "super-editor";
|
|
58207
|
+
applyStyleIsolationClass(editorContainer);
|
|
58133
58208
|
editorContainer.style.padding = "0";
|
|
58134
58209
|
editorContainer.style.margin = "0";
|
|
58135
58210
|
const sectionEditor = createHeaderFooterEditor({ editor, data, editorContainer });
|
|
@@ -58157,6 +58232,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
58157
58232
|
const { fontSizePt, typeface, fontFamilyCss } = parentStyles;
|
|
58158
58233
|
const fontSizeInPixles = fontSizePt * 1.3333;
|
|
58159
58234
|
const lineHeight2 = fontSizeInPixles * 1.2;
|
|
58235
|
+
applyStyleIsolationClass(editorContainer);
|
|
58160
58236
|
Object.assign(editorContainer.style, {
|
|
58161
58237
|
padding: "0",
|
|
58162
58238
|
margin: "0",
|
|
@@ -59547,6 +59623,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59547
59623
|
});
|
|
59548
59624
|
});
|
|
59549
59625
|
return [syncPlugin];
|
|
59626
|
+
},
|
|
59627
|
+
addCommands() {
|
|
59628
|
+
return {
|
|
59629
|
+
addImageToCollaboration: ({ mediaPath, fileData }) => () => {
|
|
59630
|
+
if (!this.options.ydoc || !mediaPath || !fileData) return false;
|
|
59631
|
+
const mediaMap = this.options.ydoc.getMap("media");
|
|
59632
|
+
mediaMap.set(mediaPath, fileData);
|
|
59633
|
+
return true;
|
|
59634
|
+
}
|
|
59635
|
+
};
|
|
59550
59636
|
}
|
|
59551
59637
|
});
|
|
59552
59638
|
const createSyncPlugin = (ydoc, editor) => {
|
|
@@ -61399,7 +61485,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61399
61485
|
{ default: remarkStringify2 },
|
|
61400
61486
|
{ default: remarkGfm2 }
|
|
61401
61487
|
] = await Promise.all([
|
|
61402
|
-
Promise.resolve().then(() =>
|
|
61488
|
+
Promise.resolve().then(() => indexDQ6dCde6),
|
|
61403
61489
|
Promise.resolve().then(() => indexDRCvimau),
|
|
61404
61490
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
61405
61491
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -61617,7 +61703,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61617
61703
|
* @returns {Object | void} Migration results
|
|
61618
61704
|
*/
|
|
61619
61705
|
processCollaborationMigrations() {
|
|
61620
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.28.
|
|
61706
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.28.2");
|
|
61621
61707
|
if (!this.options.ydoc) return;
|
|
61622
61708
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
61623
61709
|
let docVersion = metaMap.get("version");
|
|
@@ -61808,7 +61894,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61808
61894
|
options.element.classList.add("sd-super-editor-html");
|
|
61809
61895
|
}
|
|
61810
61896
|
}
|
|
61811
|
-
|
|
61897
|
+
if (options.isHeadless) {
|
|
61898
|
+
options.element = null;
|
|
61899
|
+
return;
|
|
61900
|
+
}
|
|
61901
|
+
options.element = options.element || document.createElement("div");
|
|
61902
|
+
applyStyleIsolationClass(options.element);
|
|
61812
61903
|
};
|
|
61813
61904
|
init_fn = function() {
|
|
61814
61905
|
__privateMethod$1(this, _Editor_instances, createExtensionService_fn).call(this);
|
|
@@ -66691,6 +66782,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
66691
66782
|
}
|
|
66692
66783
|
});
|
|
66693
66784
|
}
|
|
66785
|
+
const shouldSkipNodeView = (editor) => {
|
|
66786
|
+
return editor.options.isHeadless;
|
|
66787
|
+
};
|
|
66694
66788
|
const ListItem = Node$1.create({
|
|
66695
66789
|
name: "listItem",
|
|
66696
66790
|
content: "paragraph* block*",
|
|
@@ -66717,9 +66811,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
66717
66811
|
},
|
|
66718
66812
|
/**
|
|
66719
66813
|
* Important: The listItem node uses a custom node view.
|
|
66720
|
-
*
|
|
66814
|
+
* Skip node view in headless mode for performance.
|
|
66815
|
+
* @returns {import('@core/NodeView.js').NodeView|null}
|
|
66721
66816
|
*/
|
|
66722
66817
|
addNodeView() {
|
|
66818
|
+
if (shouldSkipNodeView(this.editor)) return null;
|
|
66723
66819
|
return ({ node: node2, editor, getPos, decorations }) => {
|
|
66724
66820
|
return new ListItemNodeView(node2, getPos, decorations, editor);
|
|
66725
66821
|
};
|
|
@@ -81831,6 +81927,7 @@ ${l}
|
|
|
81831
81927
|
this.view = view;
|
|
81832
81928
|
this.popover = document.createElement("div");
|
|
81833
81929
|
this.popover.className = "sd-editor-popover";
|
|
81930
|
+
applyStyleIsolationClass(this.popover);
|
|
81834
81931
|
document.body.appendChild(this.popover);
|
|
81835
81932
|
this.tippyInstance = tippy(this.popover, {
|
|
81836
81933
|
trigger: "manual",
|
|
@@ -83247,6 +83344,7 @@ ${l}
|
|
|
83247
83344
|
const tempContainer = editor.options.element.cloneNode();
|
|
83248
83345
|
if (!tempContainer) return [];
|
|
83249
83346
|
tempContainer.className = "temp-container super-editor";
|
|
83347
|
+
applyStyleIsolationClass(tempContainer);
|
|
83250
83348
|
const HIDDEN_EDITOR_OFFSET_TOP = 0;
|
|
83251
83349
|
const HIDDEN_EDITOR_OFFSET_LEFT = 0;
|
|
83252
83350
|
tempContainer.style.left = HIDDEN_EDITOR_OFFSET_TOP + "px";
|
|
@@ -84295,6 +84393,7 @@ ${l}
|
|
|
84295
84393
|
handleEl.style.pointerEvents = "auto";
|
|
84296
84394
|
resizeContainer.appendChild(handleEl);
|
|
84297
84395
|
}
|
|
84396
|
+
applyStyleIsolationClass(resizeContainer);
|
|
84298
84397
|
document.body.appendChild(resizeContainer);
|
|
84299
84398
|
updateHandlePositions(wrapper.firstElementChild);
|
|
84300
84399
|
}
|
|
@@ -117515,7 +117614,7 @@ ${style2}
|
|
|
117515
117614
|
this.config.colors = shuffleArray(this.config.colors);
|
|
117516
117615
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
117517
117616
|
this.colorIndex = 0;
|
|
117518
|
-
this.version = "0.28.
|
|
117617
|
+
this.version = "0.28.2";
|
|
117519
117618
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
117520
117619
|
this.superdocId = config2.superdocId || v4();
|
|
117521
117620
|
this.colors = this.config.colors;
|
|
@@ -119915,7 +120014,7 @@ ${style2}
|
|
|
119915
120014
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
119916
120015
|
);
|
|
119917
120016
|
}
|
|
119918
|
-
const
|
|
120017
|
+
const indexDQ6dCde6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
119919
120018
|
__proto__: null,
|
|
119920
120019
|
unified
|
|
119921
120020
|
}, Symbol.toStringTag, { value: "Module" }));
|