@harbour-enterprises/superdoc 0.22.0-next.2 → 0.22.0-next.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-Ck3Syakz.cjs → PdfViewer-CvFw8S_D.cjs} +1 -1
- package/dist/chunks/{PdfViewer-OEs-MC5j.es.js → PdfViewer-D95oFKMa.es.js} +1 -1
- package/dist/chunks/{index-BM732Zfw.cjs → index-Ct4VrAay.cjs} +39 -19
- package/dist/chunks/{index-B4aklZ4_.es.js → index-DgH1cx2c.es.js} +39 -19
- package/dist/chunks/{super-editor.es-DwGNbrZq.cjs → super-editor.es-CIDcWgLs.cjs} +188 -64
- package/dist/chunks/{super-editor.es-Bokezk1E.es.js → super-editor.es-WUoM0FI7.es.js} +188 -64
- package/dist/core/SuperDoc.d.ts +5 -0
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +4 -4
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BcqEfCTg.js → converter-DBwwYo1I.js} +187 -63
- package/dist/super-editor/chunks/{docx-zipper-DZ9ph0iQ.js → docx-zipper-BCI-3XE9.js} +1 -1
- package/dist/super-editor/chunks/{editor-CTHD3ziL.js → editor-W3rw5KHF.js} +2 -2
- package/dist/super-editor/chunks/{toolbar-DLQeMuoQ.js → toolbar-CFfRuTi3.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/super-converter/SuperConverter.d.ts +1 -13
- package/dist/super-editor/super-editor.es.js +7 -7
- 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 +225 -81
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -24846,17 +24846,16 @@ const getParagraphSpacing = (node, docx, styleId = "", marks = [], options = {})
|
|
|
24846
24846
|
};
|
|
24847
24847
|
const getDefaultParagraphStyle = (docx, styleId = "") => {
|
|
24848
24848
|
const styles = docx["word/styles.xml"];
|
|
24849
|
-
|
|
24849
|
+
const rootElements = styles?.elements?.[0]?.elements;
|
|
24850
|
+
if (!rootElements?.length) {
|
|
24850
24851
|
return {};
|
|
24851
24852
|
}
|
|
24852
|
-
const defaults =
|
|
24853
|
-
const pDefault = defaults
|
|
24853
|
+
const defaults = rootElements.find((el) => el.name === "w:docDefaults");
|
|
24854
|
+
const pDefault = defaults?.elements?.find((el) => el.name === "w:pPrDefault") || {};
|
|
24854
24855
|
const pPrDefault = pDefault?.elements?.find((el) => el.name === "w:pPr");
|
|
24855
24856
|
const pPrDefaultSpacingTag = pPrDefault?.elements?.find((el) => el.name === "w:spacing") || {};
|
|
24856
24857
|
const pPrDefaultIndentTag = pPrDefault?.elements?.find((el) => el.name === "w:ind") || {};
|
|
24857
|
-
const stylesNormal =
|
|
24858
|
-
(el) => el.name === "w:style" && el.attributes["w:styleId"] === "Normal"
|
|
24859
|
-
);
|
|
24858
|
+
const stylesNormal = rootElements.find((el) => el.name === "w:style" && el.attributes["w:styleId"] === "Normal");
|
|
24860
24859
|
const pPrNormal = stylesNormal?.elements?.find((el) => el.name === "w:pPr");
|
|
24861
24860
|
const pPrNormalSpacingTag = pPrNormal?.elements?.find((el) => el.name === "w:spacing") || {};
|
|
24862
24861
|
const pPrNormalIndentTag = pPrNormal?.elements?.find((el) => el.name === "w:ind") || {};
|
|
@@ -24865,9 +24864,7 @@ const getDefaultParagraphStyle = (docx, styleId = "") => {
|
|
|
24865
24864
|
let pPrStyleIdIndentTag = {};
|
|
24866
24865
|
let pPrStyleJc = {};
|
|
24867
24866
|
if (styleId) {
|
|
24868
|
-
const stylesById =
|
|
24869
|
-
(el) => el.name === "w:style" && el.attributes["w:styleId"] === styleId
|
|
24870
|
-
);
|
|
24867
|
+
const stylesById = rootElements.find((el) => el.name === "w:style" && el.attributes["w:styleId"] === styleId);
|
|
24871
24868
|
const pPrById = stylesById?.elements?.find((el) => el.name === "w:pPr");
|
|
24872
24869
|
pPrStyleIdSpacingTag = pPrById?.elements?.find((el) => el.name === "w:spacing") || {};
|
|
24873
24870
|
pPrStyleIdIndentTag = pPrById?.elements?.find((el) => el.name === "w:ind") || {};
|
|
@@ -30601,6 +30598,18 @@ const config = {
|
|
|
30601
30598
|
attributes: validXmlAttributes
|
|
30602
30599
|
};
|
|
30603
30600
|
const translator = NodeTranslator.from(config);
|
|
30601
|
+
const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
|
|
30602
|
+
pageSize: Object.freeze({ width: "12240", height: "15840" }),
|
|
30603
|
+
pageMargins: Object.freeze({
|
|
30604
|
+
top: "1440",
|
|
30605
|
+
right: "1440",
|
|
30606
|
+
bottom: "1440",
|
|
30607
|
+
left: "1440",
|
|
30608
|
+
header: "720",
|
|
30609
|
+
footer: "720",
|
|
30610
|
+
gutter: "0"
|
|
30611
|
+
})
|
|
30612
|
+
});
|
|
30604
30613
|
const isLineBreakOnlyRun = (node) => {
|
|
30605
30614
|
if (!node) return false;
|
|
30606
30615
|
if (node.type === "lineBreak" || node.type === "hardBreak") return true;
|
|
@@ -30653,28 +30662,63 @@ function exportSchemaToJson(params) {
|
|
|
30653
30662
|
return handler2(params);
|
|
30654
30663
|
}
|
|
30655
30664
|
function translateBodyNode(params) {
|
|
30656
|
-
let sectPr = params.bodyNode?.elements
|
|
30665
|
+
let sectPr = params.bodyNode?.elements?.find((n) => n.name === "w:sectPr");
|
|
30666
|
+
if (!sectPr) {
|
|
30667
|
+
sectPr = {
|
|
30668
|
+
type: "element",
|
|
30669
|
+
name: "w:sectPr",
|
|
30670
|
+
elements: []
|
|
30671
|
+
};
|
|
30672
|
+
} else if (!sectPr.elements) {
|
|
30673
|
+
sectPr = { ...sectPr, elements: [] };
|
|
30674
|
+
}
|
|
30657
30675
|
if (params.converter) {
|
|
30658
|
-
const hasHeader = sectPr
|
|
30676
|
+
const hasHeader = sectPr.elements?.some((n) => n.name === "w:headerReference");
|
|
30659
30677
|
const hasDefaultHeader = params.converter.headerIds?.default;
|
|
30660
30678
|
if (!hasHeader && hasDefaultHeader && !params.editor.options.isHeaderOrFooter) {
|
|
30661
30679
|
const defaultHeader = generateDefaultHeaderFooter("header", params.converter.headerIds?.default);
|
|
30662
30680
|
sectPr.elements.push(defaultHeader);
|
|
30663
30681
|
}
|
|
30664
|
-
const hasFooter = sectPr
|
|
30682
|
+
const hasFooter = sectPr.elements?.some((n) => n.name === "w:footerReference");
|
|
30665
30683
|
const hasDefaultFooter = params.converter.footerIds?.default;
|
|
30666
30684
|
if (!hasFooter && hasDefaultFooter && !params.editor.options.isHeaderOrFooter) {
|
|
30667
30685
|
const defaultFooter = generateDefaultHeaderFooter("footer", params.converter.footerIds?.default);
|
|
30668
30686
|
sectPr.elements.push(defaultFooter);
|
|
30669
30687
|
}
|
|
30670
|
-
const newMargins = params.converter.pageStyles
|
|
30671
|
-
|
|
30672
|
-
|
|
30673
|
-
|
|
30674
|
-
|
|
30675
|
-
|
|
30676
|
-
|
|
30677
|
-
|
|
30688
|
+
const newMargins = params.converter.pageStyles?.pageMargins;
|
|
30689
|
+
if (newMargins) {
|
|
30690
|
+
let sectPrMargins = sectPr.elements.find((n) => n.name === "w:pgMar");
|
|
30691
|
+
if (!sectPrMargins) {
|
|
30692
|
+
sectPrMargins = {
|
|
30693
|
+
type: "element",
|
|
30694
|
+
name: "w:pgMar",
|
|
30695
|
+
attributes: {}
|
|
30696
|
+
};
|
|
30697
|
+
sectPr.elements.push(sectPrMargins);
|
|
30698
|
+
} else if (!sectPrMargins.attributes) {
|
|
30699
|
+
sectPrMargins.attributes = {};
|
|
30700
|
+
}
|
|
30701
|
+
Object.entries(newMargins).forEach(([key, value]) => {
|
|
30702
|
+
const convertedValue = inchesToTwips(value);
|
|
30703
|
+
sectPrMargins.attributes[`w:${key}`] = convertedValue;
|
|
30704
|
+
});
|
|
30705
|
+
}
|
|
30706
|
+
let sectPrPgSz = sectPr.elements.find((n) => n.name === "w:pgSz");
|
|
30707
|
+
if (!sectPrPgSz) {
|
|
30708
|
+
sectPrPgSz = {
|
|
30709
|
+
type: "element",
|
|
30710
|
+
name: "w:pgSz",
|
|
30711
|
+
attributes: {}
|
|
30712
|
+
};
|
|
30713
|
+
sectPr.elements.push(sectPrPgSz);
|
|
30714
|
+
} else if (!sectPrPgSz.attributes) {
|
|
30715
|
+
sectPrPgSz.attributes = {};
|
|
30716
|
+
}
|
|
30717
|
+
const pageSize = params.converter.pageStyles?.pageSize;
|
|
30718
|
+
const widthInches = pageSize?.width;
|
|
30719
|
+
const heightInches = pageSize?.height;
|
|
30720
|
+
sectPrPgSz.attributes["w:w"] = widthInches ? String(inchesToTwips(widthInches)) : sectPrPgSz.attributes["w:w"] ?? DEFAULT_SECTION_PROPS_TWIPS.pageSize.width;
|
|
30721
|
+
sectPrPgSz.attributes["w:h"] = heightInches ? String(inchesToTwips(heightInches)) : sectPrPgSz.attributes["w:h"] ?? DEFAULT_SECTION_PROPS_TWIPS.pageSize.height;
|
|
30678
30722
|
}
|
|
30679
30723
|
const elements = translateChildNodes(params);
|
|
30680
30724
|
if (params.isHeaderFooter) {
|
|
@@ -32689,6 +32733,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
32689
32733
|
const nodeListHandler = defaultNodeListHandler();
|
|
32690
32734
|
const bodyNode = json.elements[0].elements.find((el) => el.name === "w:body");
|
|
32691
32735
|
if (bodyNode) {
|
|
32736
|
+
ensureSectionProperties(bodyNode);
|
|
32692
32737
|
const node = bodyNode;
|
|
32693
32738
|
const contentElements = node.elements?.filter((n) => n.name !== "w:sectPr") ?? [];
|
|
32694
32739
|
const content = pruneIgnoredNodes(contentElements);
|
|
@@ -32922,6 +32967,59 @@ function getDocumentStyles(node, docx, converter, editor) {
|
|
|
32922
32967
|
styles.alternateHeaders = isAlternatingHeadersOddEven(docx);
|
|
32923
32968
|
return styles;
|
|
32924
32969
|
}
|
|
32970
|
+
const DEFAULT_SECTION_PROPS = Object.freeze({
|
|
32971
|
+
pageSize: Object.freeze({ width: "12240", height: "15840" }),
|
|
32972
|
+
pageMargins: Object.freeze({
|
|
32973
|
+
top: "1440",
|
|
32974
|
+
right: "1440",
|
|
32975
|
+
bottom: "1440",
|
|
32976
|
+
left: "1440",
|
|
32977
|
+
header: "720",
|
|
32978
|
+
footer: "720",
|
|
32979
|
+
gutter: "0"
|
|
32980
|
+
})
|
|
32981
|
+
});
|
|
32982
|
+
function ensureSectionProperties(bodyNode, converter) {
|
|
32983
|
+
if (!bodyNode.elements) bodyNode.elements = [];
|
|
32984
|
+
let sectPr = bodyNode.elements.find((el) => el.name === "w:sectPr");
|
|
32985
|
+
if (!sectPr) {
|
|
32986
|
+
sectPr = {
|
|
32987
|
+
type: "element",
|
|
32988
|
+
name: "w:sectPr",
|
|
32989
|
+
elements: []
|
|
32990
|
+
};
|
|
32991
|
+
bodyNode.elements.push(sectPr);
|
|
32992
|
+
} else if (!sectPr.elements) {
|
|
32993
|
+
sectPr.elements = [];
|
|
32994
|
+
}
|
|
32995
|
+
const ensureChild = (name, factory) => {
|
|
32996
|
+
let child = sectPr.elements.find((el) => el.name === name);
|
|
32997
|
+
if (!child) {
|
|
32998
|
+
child = factory();
|
|
32999
|
+
sectPr.elements.push(child);
|
|
33000
|
+
} else if (!child.attributes) {
|
|
33001
|
+
child.attributes = {};
|
|
33002
|
+
}
|
|
33003
|
+
return child;
|
|
33004
|
+
};
|
|
33005
|
+
const pgSz = ensureChild("w:pgSz", () => ({
|
|
33006
|
+
type: "element",
|
|
33007
|
+
name: "w:pgSz",
|
|
33008
|
+
attributes: {}
|
|
33009
|
+
}));
|
|
33010
|
+
pgSz.attributes["w:w"] = pgSz.attributes["w:w"] ?? DEFAULT_SECTION_PROPS.pageSize.width;
|
|
33011
|
+
pgSz.attributes["w:h"] = pgSz.attributes["w:h"] ?? DEFAULT_SECTION_PROPS.pageSize.height;
|
|
33012
|
+
const pgMar = ensureChild("w:pgMar", () => ({
|
|
33013
|
+
type: "element",
|
|
33014
|
+
name: "w:pgMar",
|
|
33015
|
+
attributes: {}
|
|
33016
|
+
}));
|
|
33017
|
+
Object.entries(DEFAULT_SECTION_PROPS.pageMargins).forEach(([key, value]) => {
|
|
33018
|
+
const attrKey = `w:${key}`;
|
|
33019
|
+
if (pgMar.attributes[attrKey] == null) pgMar.attributes[attrKey] = value;
|
|
33020
|
+
});
|
|
33021
|
+
return sectPr;
|
|
33022
|
+
}
|
|
32925
33023
|
function getStyleDefinitions(docx) {
|
|
32926
33024
|
const styles = docx["word/styles.xml"];
|
|
32927
33025
|
if (!styles) return [];
|
|
@@ -33114,6 +33212,36 @@ const FONT_FAMILY_FALLBACKS = Object.freeze({
|
|
|
33114
33212
|
auto: "sans-serif"
|
|
33115
33213
|
});
|
|
33116
33214
|
const DEFAULT_GENERIC_FALLBACK = "sans-serif";
|
|
33215
|
+
const DEFAULT_FONT_SIZE_PT = 10;
|
|
33216
|
+
const collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state: state2 }) => {
|
|
33217
|
+
if (!runProps?.elements?.length || !state2) return;
|
|
33218
|
+
const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
|
|
33219
|
+
if (fontsNode?.attributes) {
|
|
33220
|
+
const themeName = fontsNode.attributes["w:asciiTheme"];
|
|
33221
|
+
if (themeName) {
|
|
33222
|
+
const themeInfo = themeResolver?.(themeName) || {};
|
|
33223
|
+
if ((allowOverrideTypeface || !state2.typeface) && themeInfo.typeface) state2.typeface = themeInfo.typeface;
|
|
33224
|
+
if ((allowOverrideTypeface || !state2.panose) && themeInfo.panose) state2.panose = themeInfo.panose;
|
|
33225
|
+
}
|
|
33226
|
+
const ascii = fontsNode.attributes["w:ascii"];
|
|
33227
|
+
if ((allowOverrideTypeface || !state2.typeface) && ascii) {
|
|
33228
|
+
state2.typeface = ascii;
|
|
33229
|
+
}
|
|
33230
|
+
}
|
|
33231
|
+
const sizeNode = runProps.elements.find((el) => el.name === "w:sz");
|
|
33232
|
+
if (sizeNode?.attributes?.["w:val"]) {
|
|
33233
|
+
const sizeTwips = Number(sizeNode.attributes["w:val"]);
|
|
33234
|
+
if (Number.isFinite(sizeTwips)) {
|
|
33235
|
+
if (state2.fallbackSzTwips === void 0) state2.fallbackSzTwips = sizeTwips;
|
|
33236
|
+
const sizePt = sizeTwips / 2;
|
|
33237
|
+
if (allowOverrideSize || state2.fontSizePt === void 0) state2.fontSizePt = sizePt;
|
|
33238
|
+
}
|
|
33239
|
+
}
|
|
33240
|
+
const kernNode = runProps.elements.find((el) => el.name === "w:kern");
|
|
33241
|
+
if (kernNode?.attributes?.["w:val"]) {
|
|
33242
|
+
if (allowOverrideSize || state2.kern === void 0) state2.kern = kernNode.attributes["w:val"];
|
|
33243
|
+
}
|
|
33244
|
+
};
|
|
33117
33245
|
const _SuperConverter = class _SuperConverter {
|
|
33118
33246
|
constructor(params = null) {
|
|
33119
33247
|
__privateAdd(this, _SuperConverter_instances);
|
|
@@ -33241,49 +33369,45 @@ const _SuperConverter = class _SuperConverter {
|
|
|
33241
33369
|
}
|
|
33242
33370
|
getDocumentDefaultStyles() {
|
|
33243
33371
|
const styles = this.convertedXml["word/styles.xml"];
|
|
33244
|
-
|
|
33245
|
-
const
|
|
33246
|
-
|
|
33247
|
-
|
|
33248
|
-
const
|
|
33249
|
-
const
|
|
33250
|
-
|
|
33251
|
-
|
|
33252
|
-
|
|
33253
|
-
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
|
|
33257
|
-
|
|
33258
|
-
|
|
33259
|
-
|
|
33260
|
-
|
|
33261
|
-
|
|
33262
|
-
|
|
33263
|
-
|
|
33264
|
-
|
|
33265
|
-
|
|
33266
|
-
|
|
33267
|
-
|
|
33268
|
-
|
|
33269
|
-
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33274
|
-
|
|
33275
|
-
|
|
33276
|
-
|
|
33277
|
-
|
|
33278
|
-
|
|
33279
|
-
|
|
33280
|
-
|
|
33281
|
-
|
|
33282
|
-
|
|
33283
|
-
const kern = rElements.find((el) => el.name === "w:kern")?.attributes["w:val"];
|
|
33284
|
-
const fontFamilyCss = _SuperConverter.toCssFontFamily(typeface, this.convertedXml);
|
|
33285
|
-
return { fontSizePt, kern, typeface, panose, fontFamilyCss };
|
|
33286
|
-
}
|
|
33372
|
+
const styleRoot = styles?.elements?.[0];
|
|
33373
|
+
const styleElements = styleRoot?.elements || [];
|
|
33374
|
+
if (!styleElements.length) return {};
|
|
33375
|
+
const defaults = styleElements.find((el) => el.name === "w:docDefaults");
|
|
33376
|
+
const normalStyle = styleElements.find((el) => el.name === "w:style" && el.attributes?.["w:styleId"] === "Normal");
|
|
33377
|
+
const defaultsState = {
|
|
33378
|
+
typeface: void 0,
|
|
33379
|
+
panose: void 0,
|
|
33380
|
+
fontSizePt: void 0,
|
|
33381
|
+
kern: void 0,
|
|
33382
|
+
fallbackSzTwips: void 0
|
|
33383
|
+
};
|
|
33384
|
+
const docDefaultRun = defaults?.elements?.find((el) => el.name === "w:rPrDefault");
|
|
33385
|
+
const docDefaultProps = docDefaultRun?.elements?.find((el) => el.name === "w:rPr") ?? docDefaultRun;
|
|
33386
|
+
collectRunDefaultProperties(docDefaultProps, {
|
|
33387
|
+
allowOverrideTypeface: true,
|
|
33388
|
+
allowOverrideSize: true,
|
|
33389
|
+
themeResolver: (theme) => this.getThemeInfo(theme),
|
|
33390
|
+
state: defaultsState
|
|
33391
|
+
});
|
|
33392
|
+
const normalRunProps = normalStyle?.elements?.find((el) => el.name === "w:rPr") ?? null;
|
|
33393
|
+
collectRunDefaultProperties(normalRunProps, {
|
|
33394
|
+
allowOverrideTypeface: true,
|
|
33395
|
+
allowOverrideSize: true,
|
|
33396
|
+
themeResolver: (theme) => this.getThemeInfo(theme),
|
|
33397
|
+
state: defaultsState
|
|
33398
|
+
});
|
|
33399
|
+
if (defaultsState.fontSizePt === void 0) {
|
|
33400
|
+
if (Number.isFinite(defaultsState.fallbackSzTwips)) defaultsState.fontSizePt = defaultsState.fallbackSzTwips / 2;
|
|
33401
|
+
else defaultsState.fontSizePt = DEFAULT_FONT_SIZE_PT;
|
|
33402
|
+
}
|
|
33403
|
+
const fontFamilyCss = defaultsState.typeface ? _SuperConverter.toCssFontFamily(defaultsState.typeface, this.convertedXml) : void 0;
|
|
33404
|
+
const result = {};
|
|
33405
|
+
if (defaultsState.fontSizePt !== void 0) result.fontSizePt = defaultsState.fontSizePt;
|
|
33406
|
+
if (defaultsState.kern !== void 0) result.kern = defaultsState.kern;
|
|
33407
|
+
if (defaultsState.typeface) result.typeface = defaultsState.typeface;
|
|
33408
|
+
if (defaultsState.panose) result.panose = defaultsState.panose;
|
|
33409
|
+
if (fontFamilyCss) result.fontFamilyCss = fontFamilyCss;
|
|
33410
|
+
return result;
|
|
33287
33411
|
}
|
|
33288
33412
|
getDocumentFonts() {
|
|
33289
33413
|
const fontTable = this.convertedXml["word/fontTable.xml"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, au as commonjsGlobal, B as Buffer, av as getDefaultExportFromCjs, aw as getContentTypesFromXml, ax as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, au as commonjsGlobal, B as Buffer, av as getDefaultExportFromCjs, aw as getContentTypesFromXml, ax as xmljs } from "./converter-DBwwYo1I.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
|
}
|
|
@@ -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, registerCopyHandler_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, initDevTools_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, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as SelectionRange, ao as Transform, ap as isInTable$1, aq as generateDocxRandomId, ar as insertNewRelationship, as as updateDOMAttributes, at as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as SelectionRange, ao as Transform, ap as isInTable$1, aq as generateDocxRandomId, ar as insertNewRelationship, as as updateDOMAttributes, at as htmlHandler } from "./converter-DBwwYo1I.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-BCI-3XE9.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -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 { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-DBwwYo1I.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-W3rw5KHF.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-W3rw5KHF.js";
|
|
2
|
+
import "./chunks/converter-DBwwYo1I.js";
|
|
3
|
+
import "./chunks/docx-zipper-BCI-3XE9.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -98,19 +98,7 @@ export class SuperConverter {
|
|
|
98
98
|
get docxHelpers(): any;
|
|
99
99
|
parseFromXml(): void;
|
|
100
100
|
parseXmlToJson(xml: any): any;
|
|
101
|
-
getDocumentDefaultStyles(): {
|
|
102
|
-
fontSizePt?: undefined;
|
|
103
|
-
kern?: undefined;
|
|
104
|
-
typeface?: undefined;
|
|
105
|
-
panose?: undefined;
|
|
106
|
-
fontFamilyCss?: undefined;
|
|
107
|
-
} | {
|
|
108
|
-
fontSizePt: number;
|
|
109
|
-
kern: any;
|
|
110
|
-
typeface: any;
|
|
111
|
-
panose: any;
|
|
112
|
-
fontFamilyCss: any;
|
|
113
|
-
};
|
|
101
|
+
getDocumentDefaultStyles(): {};
|
|
114
102
|
getDocumentFonts(): string;
|
|
115
103
|
getDocumentInternalId(): void;
|
|
116
104
|
createDocumentIdElement(): {
|
|
@@ -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 { av as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, ay as vClickOutside, H as findParentNode, az as getActiveFormatting, ap as isInTable, aA as readFromClipboard, aB as handleClipboardPaste, aC as getFileObject, aD as runPropertyTranslators, aE as translator, aF as translator$1, aG as translator$2, aH as translator$3, aI as translator$4, aJ as translator$5, aK as translator$6, aL as translator$7, aM as translator$8, aN as translator$9, aO as translator$a, aP as translator$b, aQ as translator$c, aR as translator$d, aS as translator$e, aT as translator$f, aU as translator$g, aV as translator$h, aW as translator$i, aX as translator$j, aY as translator$k, aZ as translator$l, a_ as translator$m, a$ as translator$n, b0 as translator$o, b1 as translator$p, b2 as translator$q, b3 as translator$r, b4 as translator$s, b5 as translator$t, b6 as translator$u, b7 as translator$v, b8 as translator$w, b9 as translator$x, ba as translator$y, bb as translator$z, bc as translator$A, bd as translator$B, be as translator$C, bf as translator$D, bg as translator$E, bh as translator$F, bi as translator$G, bj as translator$H, bk as translator$I, bl as translator$J, bm as translator$K, bn as translator$L, bo as translator$M, bp as translator$N, bq as translator$O, br as translator$P, bs as translator$Q, bt as translator$R, bu as translator$S, bv as translator$T, bw as translator$U, bx as translator$V, by as translator$W, bz as translator$X, bA as translator$Y, bB as translator$Z, bC as translator$_, bD as translator$$, bE as translator$10, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { bF, a5, i, a2 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i 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 { n, C, o, T, l, p, m } from "./chunks/editor-
|
|
12
|
+
import { av as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, ay as vClickOutside, H as findParentNode, az as getActiveFormatting, ap as isInTable, aA as readFromClipboard, aB as handleClipboardPaste, aC as getFileObject, aD as runPropertyTranslators, aE as translator, aF as translator$1, aG as translator$2, aH as translator$3, aI as translator$4, aJ as translator$5, aK as translator$6, aL as translator$7, aM as translator$8, aN as translator$9, aO as translator$a, aP as translator$b, aQ as translator$c, aR as translator$d, aS as translator$e, aT as translator$f, aU as translator$g, aV as translator$h, aW as translator$i, aX as translator$j, aY as translator$k, aZ as translator$l, a_ as translator$m, a$ as translator$n, b0 as translator$o, b1 as translator$p, b2 as translator$q, b3 as translator$r, b4 as translator$s, b5 as translator$t, b6 as translator$u, b7 as translator$v, b8 as translator$w, b9 as translator$x, ba as translator$y, bb as translator$z, bc as translator$A, bd as translator$B, be as translator$C, bf as translator$D, bg as translator$E, bh as translator$F, bi as translator$G, bj as translator$H, bk as translator$I, bl as translator$J, bm as translator$K, bn as translator$L, bo as translator$M, bp as translator$N, bq as translator$O, br as translator$P, bs as translator$Q, bt as translator$R, bu as translator$S, bv as translator$T, bw as translator$U, bx as translator$V, by as translator$W, bz as translator$X, bA as translator$Y, bB as translator$Z, bC as translator$_, bD as translator$$, bE as translator$10, a as Plugin } from "./chunks/converter-DBwwYo1I.js";
|
|
13
|
+
import { bF, a5, i, a2 } from "./chunks/converter-DBwwYo1I.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-W3rw5KHF.js";
|
|
15
|
+
import { n, C, o, T, l, p, m } from "./chunks/editor-W3rw5KHF.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-CFfRuTi3.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-BCI-3XE9.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -2584,7 +2584,7 @@ class SuperToolbar extends EventEmitter {
|
|
|
2584
2584
|
if (!argument) return;
|
|
2585
2585
|
item.onActivate({ zoom: argument });
|
|
2586
2586
|
this.emit("superdoc-command", { item, argument });
|
|
2587
|
-
const layers =
|
|
2587
|
+
const layers = this.superdoc.element?.querySelector(".layers");
|
|
2588
2588
|
if (!layers) return;
|
|
2589
2589
|
const isMobileDevice = typeof screen.orientation !== "undefined";
|
|
2590
2590
|
const isSmallScreen = window.matchMedia("(max-width: 834px)").matches;
|
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-CIDcWgLs.cjs");
|
|
4
4
|
require("./chunks/vue-DWle4Cai.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, r, 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, r, q } from "./chunks/super-editor.es-WUoM0FI7.es.js";
|
|
2
2
|
import "./chunks/vue-CXxsqYcP.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-CIDcWgLs.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-Ct4VrAay.cjs");
|
|
5
5
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
6
6
|
require("./chunks/jszip-b7l8QkfH.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, r, 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, r, p, q } from "./chunks/super-editor.es-WUoM0FI7.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-DgH1cx2c.es.js";
|
|
3
3
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
4
4
|
import "./chunks/jszip-B8KIZSNe.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|