@harbour-enterprises/superdoc 0.15.4 → 0.15.5-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/{eventemitter3-DESeWqCF.es.js → eventemitter3-BKLF7Ip6.es.js} +1 -1
- package/dist/chunks/{eventemitter3-BgTTc0kr.cjs → eventemitter3-CLT6oufV.cjs} +1 -1
- package/dist/chunks/{index-5s0lZrRi.cjs → index-B5xS6OKK.cjs} +2 -2
- package/dist/chunks/{index-BDb18xQR.es.js → index-BqH3eQTm.es.js} +2 -2
- package/dist/chunks/{index-CEIbpU5u.es.js → index-D612mw4O.es.js} +4 -4
- package/dist/chunks/{index-CjAcITPh.cjs → index-DhQaJbc2.cjs} +2 -2
- package/dist/chunks/{index-gYvWcHA-.es.js → index-DzFLdJgk.es.js} +2 -2
- package/dist/chunks/{index-Dz0ZMALg.cjs → index-ibuaxW1X.cjs} +4 -4
- package/dist/chunks/{jszip-eJOLo2UN.es.js → jszip-BwJb6_S5.es.js} +1 -1
- package/dist/chunks/{jszip-BgN565V6.cjs → jszip-DWfnW2xV.cjs} +1 -1
- package/dist/chunks/{super-editor.es-mOsixnG-.es.js → super-editor.es-BbXoCTdu.es.js} +164 -49
- package/dist/chunks/{super-editor.es-BWqewsue.cjs → super-editor.es-eYj5Pfwk.cjs} +164 -49
- package/dist/chunks/{url-yluXzDeN.cjs → url-7PXI9_kJ.cjs} +2 -2
- package/dist/chunks/{url-D1vPFtjG.es.js → url-CNqDAz7z.es.js} +2 -2
- package/dist/chunks/{vue-aMYj79Bx.es.js → vue-B_OPNNfX.es.js} +7 -14
- package/dist/chunks/{vue-BLDJYAe8.cjs → vue-CfKg12kH.cjs} +7 -14
- package/dist/chunks/{xml-js-DahUgrqx.cjs → xml-js-B_rfwhrZ.cjs} +2 -2
- package/dist/chunks/{xml-js-BWZkA4YC.es.js → xml-js-Bn0K9fTK.es.js} +2 -2
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter--xE2kl-N.js → converter-CRXPW1NM.js} +89 -29
- package/dist/super-editor/chunks/{docx-zipper-FdXKvTYy.js → docx-zipper-D-36-fgk.js} +1 -1
- package/dist/super-editor/chunks/{editor-CXZwfSox.js → editor-BjuTQMUs.js} +74 -19
- package/dist/super-editor/chunks/{toolbar-CzsjA6Zy.js → toolbar-Bi-ptE7e.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/InputRule.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +5 -0
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/markImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/runNodeImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/tableImporter.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/bold/bold.d.ts.map +1 -1
- package/dist/super-editor/extensions/index.d.ts +2 -1
- package/dist/super-editor/extensions/index.d.ts.map +1 -1
- package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
- package/dist/super-editor/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts.map +1 -1
- package/dist/super-editor/extensions/paragraph/paragraph.d.ts.map +1 -1
- package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
- package/dist/super-editor/extensions/text-transform/index.d.ts +2 -0
- package/dist/super-editor/extensions/text-transform/index.d.ts.map +1 -0
- package/dist/super-editor/extensions/text-transform/text-transform.d.ts +2 -0
- package/dist/super-editor/extensions/text-transform/text-transform.d.ts.map +1 -0
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +8 -8
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +8 -8
- package/dist/superdoc.es.js +9 -9
- package/dist/superdoc.umd.js +171 -63
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jszip = require("./jszip-
|
|
3
|
-
const index$2 = require("./index-
|
|
2
|
+
const jszip = require("./jszip-DWfnW2xV.cjs");
|
|
3
|
+
const index$2 = require("./index-ibuaxW1X.cjs");
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
for (var i = 0; i < m.length; i++) {
|
|
6
6
|
const e = m[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from "./jszip-
|
|
2
|
-
import { r as requireStreamHttp } from "./index-
|
|
1
|
+
import { g as getDefaultExportFromCjs } from "./jszip-BwJb6_S5.es.js";
|
|
2
|
+
import { r as requireStreamHttp } from "./index-D612mw4O.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace } from "./jszip-
|
|
2
|
-
import { p as process$1 } from "./vue-
|
|
3
|
-
import { r as require_stream_readable, a as require_stream_writable, b as require_stream_duplex, c as require_stream_transform, d as require_stream_passthrough, e as requireEndOfStream, f as requirePipeline, g as requireInherits_browser } from "./xml-js-
|
|
4
|
-
import { u as url } from "./url-
|
|
1
|
+
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace } from "./jszip-BwJb6_S5.es.js";
|
|
2
|
+
import { p as process$1 } from "./vue-B_OPNNfX.es.js";
|
|
3
|
+
import { r as require_stream_readable, a as require_stream_writable, b as require_stream_duplex, c as require_stream_transform, d as require_stream_passthrough, e as requireEndOfStream, f as requirePipeline, g as requireInherits_browser } from "./xml-js-Bn0K9fTK.es.js";
|
|
4
|
+
import { u as url } from "./url-CNqDAz7z.es.js";
|
|
5
5
|
var streamHttp = {};
|
|
6
6
|
var request = { exports: {} };
|
|
7
7
|
var capability = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jszip = require("./jszip-
|
|
3
|
-
const index$2 = require("./index-
|
|
2
|
+
const jszip = require("./jszip-DWfnW2xV.cjs");
|
|
3
|
+
const index$2 = require("./index-ibuaxW1X.cjs");
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
for (var i = 0; i < m.length; i++) {
|
|
6
6
|
const e = m[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from "./jszip-
|
|
2
|
-
import { r as requireStreamHttp, a as require$$1 } from "./index-
|
|
1
|
+
import { g as getDefaultExportFromCjs } from "./jszip-BwJb6_S5.es.js";
|
|
2
|
+
import { r as requireStreamHttp, a as require$$1 } from "./index-D612mw4O.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jszip = require("./jszip-
|
|
3
|
-
const vue = require("./vue-
|
|
4
|
-
const xmlJs = require("./xml-js-
|
|
5
|
-
const url = require("./url-
|
|
2
|
+
const jszip = require("./jszip-DWfnW2xV.cjs");
|
|
3
|
+
const vue = require("./vue-CfKg12kH.cjs");
|
|
4
|
+
const xmlJs = require("./xml-js-B_rfwhrZ.cjs");
|
|
5
|
+
const url = require("./url-7PXI9_kJ.cjs");
|
|
6
6
|
var streamHttp = {};
|
|
7
7
|
var request = { exports: {} };
|
|
8
8
|
var capability = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as defineComponent, q as getCurrentInstance, s as onDeactivated, u as nextTick, v as createBlock, x as createVNode, y as unref, z as withCtx, A as createTextVNode, B as normalizeStyle, C as h, D as toRef, E as provide, G as mergeProps, H as cloneVNode, T as Text$2, I as withDirectives, J as watchEffect, K as shallowRef, L as vModelText, M as withKeys, N as reactive, O as readonly, P as Transition, Q as vShow, R as Comment, S as renderSlot, U as onActivated, V as Teleport, W as isVNode, X as onUnmounted, Y as resolveDynamicComponent, Z as normalizeProps, _ as guardReactiveProps, $ as markRaw } from "./vue-
|
|
1
|
+
import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as defineComponent, q as getCurrentInstance, s as onDeactivated, u as nextTick, v as createBlock, x as createVNode, y as unref, z as withCtx, A as createTextVNode, B as normalizeStyle, C as h, D as toRef, E as provide, G as mergeProps, H as cloneVNode, T as Text$2, I as withDirectives, J as watchEffect, K as shallowRef, L as vModelText, M as withKeys, N as reactive, O as readonly, P as Transition, Q as vShow, R as Comment, S as renderSlot, U as onActivated, V as Teleport, W as isVNode, X as onUnmounted, Y as resolveDynamicComponent, Z as normalizeProps, _ as guardReactiveProps, $ as markRaw } from "./vue-B_OPNNfX.es.js";
|
|
2
2
|
import * as Y from "yjs";
|
|
3
3
|
import { UndoManager, Item as Item$2, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
4
4
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -19597,6 +19597,8 @@ const getTextContentFromNodes = ($from, maxMatch = 500) => {
|
|
|
19597
19597
|
function parseMarks(property2, unknownMarks = [], docx = null) {
|
|
19598
19598
|
const marks = [];
|
|
19599
19599
|
const seen = /* @__PURE__ */ new Set();
|
|
19600
|
+
const lang = property2?.elements?.find((el) => el.name === "w:lang");
|
|
19601
|
+
lang?.attributes || {};
|
|
19600
19602
|
property2?.elements?.forEach((element) => {
|
|
19601
19603
|
const marksForType = SuperConverter.markTypes.filter((mark) => mark.name === element.name);
|
|
19602
19604
|
if (!marksForType.length) {
|
|
@@ -19623,10 +19625,21 @@ function parseMarks(property2, unknownMarks = [], docx = null) {
|
|
|
19623
19625
|
seen.add(m.type);
|
|
19624
19626
|
const { attributes = {} } = element;
|
|
19625
19627
|
const newMark = { type: m.type };
|
|
19626
|
-
|
|
19628
|
+
const exceptionMarks = ["w:b", "w:caps"];
|
|
19629
|
+
if ((attributes["w:val"] === "0" || attributes["w:val"] === "none") && !exceptionMarks.includes(m.name)) {
|
|
19627
19630
|
return;
|
|
19628
19631
|
}
|
|
19629
19632
|
if (m.mark) newMark.type = m.mark;
|
|
19633
|
+
if (m.name === "w:caps") {
|
|
19634
|
+
newMark.attrs = {};
|
|
19635
|
+
if (attributes["w:val"] === "0") {
|
|
19636
|
+
newMark.attrs[m.property] = "none";
|
|
19637
|
+
} else {
|
|
19638
|
+
newMark.attrs[m.property] = "uppercase";
|
|
19639
|
+
}
|
|
19640
|
+
marks.push(newMark);
|
|
19641
|
+
return;
|
|
19642
|
+
}
|
|
19630
19643
|
if (Object.keys(attributes).length) {
|
|
19631
19644
|
const value = getMarkValue(m.type, attributes, docx);
|
|
19632
19645
|
if (value === null || value === void 0) return;
|
|
@@ -19909,12 +19922,6 @@ const handleParagraphNode = (params2) => {
|
|
|
19909
19922
|
};
|
|
19910
19923
|
}
|
|
19911
19924
|
}
|
|
19912
|
-
if (docx) {
|
|
19913
|
-
const { textCase } = getDefaultParagraphStyle(docx, styleId);
|
|
19914
|
-
if (textCase) {
|
|
19915
|
-
schemaNode.attrs.textCase = textCase;
|
|
19916
|
-
}
|
|
19917
|
-
}
|
|
19918
19925
|
if (framePr && framePr.attributes["w:dropCap"]) {
|
|
19919
19926
|
schemaNode.attrs.dropcap = {
|
|
19920
19927
|
type: framePr.attributes["w:dropCap"],
|
|
@@ -20019,22 +20026,15 @@ const getDefaultParagraphStyle = (docx, styleId = "") => {
|
|
|
20019
20026
|
const pPrNormal = stylesNormal?.elements?.find((el) => el.name === "w:pPr");
|
|
20020
20027
|
const pPrNormalSpacingTag = pPrNormal?.elements?.find((el) => el.name === "w:spacing") || {};
|
|
20021
20028
|
const pPrNormalIndentTag = pPrNormal?.elements?.find((el) => el.name === "w:ind") || {};
|
|
20029
|
+
const isNormalAsDefault = stylesNormal?.attributes?.["w:default"] === "1";
|
|
20022
20030
|
let pPrStyleIdSpacingTag = {};
|
|
20023
20031
|
let pPrStyleIdIndentTag = {};
|
|
20024
20032
|
let pPrStyleJc = {};
|
|
20025
|
-
let textCase = null;
|
|
20026
20033
|
if (styleId) {
|
|
20027
20034
|
const stylesById = styles.elements[0].elements?.find(
|
|
20028
20035
|
(el) => el.name === "w:style" && el.attributes["w:styleId"] === styleId
|
|
20029
20036
|
);
|
|
20030
20037
|
const pPrById = stylesById?.elements?.find((el) => el.name === "w:pPr");
|
|
20031
|
-
const basedOn = stylesById?.elements.find((el) => el.name === "w:basedOn");
|
|
20032
|
-
const baseStyles = styles.elements[0].elements?.find(
|
|
20033
|
-
(el) => el.name === "w:style" && el.attributes["w:styleId"] === basedOn?.attributes["w:val"]
|
|
20034
|
-
);
|
|
20035
|
-
const rprBaseStyles = baseStyles?.elements?.find((el) => el.name === "w:rPr");
|
|
20036
|
-
const caps = rprBaseStyles?.elements?.find((el) => el.name === "w:caps");
|
|
20037
|
-
if (caps) textCase = "uppercase";
|
|
20038
20038
|
pPrStyleIdSpacingTag = pPrById?.elements?.find((el) => el.name === "w:spacing") || {};
|
|
20039
20039
|
pPrStyleIdIndentTag = pPrById?.elements?.find((el) => el.name === "w:ind") || {};
|
|
20040
20040
|
pPrStyleJc = pPrById?.elements?.find((el) => el.name === "w:jc") || {};
|
|
@@ -20046,11 +20046,12 @@ const getDefaultParagraphStyle = (docx, styleId = "") => {
|
|
|
20046
20046
|
const { attributes: pPrDefaultIndentAttr } = pPrDefaultIndentTag;
|
|
20047
20047
|
const { attributes: pPrNormalIndentAttr } = pPrNormalIndentTag;
|
|
20048
20048
|
const { attributes: pPrByIdIndentAttr } = pPrStyleIdIndentTag;
|
|
20049
|
+
const spacingRest = isNormalAsDefault ? pPrNormalSpacingAttr || pPrDefaultSpacingAttr : pPrDefaultSpacingAttr || pPrNormalSpacingAttr;
|
|
20050
|
+
const indentRest = isNormalAsDefault ? pPrNormalIndentAttr || pPrDefaultIndentAttr : pPrDefaultIndentAttr || pPrNormalIndentAttr;
|
|
20049
20051
|
return {
|
|
20050
|
-
spacing: pPrByIdSpacingAttr ||
|
|
20051
|
-
indent: pPrByIdIndentAttr ||
|
|
20052
|
-
justify: pPrByIdJcAttr
|
|
20053
|
-
textCase
|
|
20052
|
+
spacing: pPrByIdSpacingAttr || spacingRest,
|
|
20053
|
+
indent: pPrByIdIndentAttr || indentRest,
|
|
20054
|
+
justify: pPrByIdJcAttr
|
|
20054
20055
|
};
|
|
20055
20056
|
};
|
|
20056
20057
|
const paragraphNodeHandlerEntity = {
|
|
@@ -21032,7 +21033,9 @@ function getAbstractNumIdByNumId(numId, docx) {
|
|
|
21032
21033
|
const { elements } = numbering;
|
|
21033
21034
|
const listData = elements[0];
|
|
21034
21035
|
const numberingElements = listData.elements || [];
|
|
21035
|
-
const numDef = numberingElements.find(
|
|
21036
|
+
const numDef = numberingElements.find(
|
|
21037
|
+
(el) => el.name === "w:num" && el.attributes?.["w:numId"] === numId
|
|
21038
|
+
);
|
|
21036
21039
|
if (!numDef) return null;
|
|
21037
21040
|
const abstractNumIdRef = numDef.elements?.find((el) => el.name === "w:abstractNumId");
|
|
21038
21041
|
return abstractNumIdRef?.attributes?.["w:val"];
|
|
@@ -23838,6 +23841,23 @@ function handleHtmlPaste(html, editor) {
|
|
|
23838
23841
|
const paragraphContent = doc2.firstChild.content;
|
|
23839
23842
|
const tr = state2.tr.replaceSelectionWith(paragraphContent, false);
|
|
23840
23843
|
dispatch(tr);
|
|
23844
|
+
} else if (isInParagraph) {
|
|
23845
|
+
const allContent = [];
|
|
23846
|
+
doc2.content.forEach((node2, index2) => {
|
|
23847
|
+
if (node2.type.name === "paragraph") {
|
|
23848
|
+
allContent.push(...node2.content.content);
|
|
23849
|
+
if (index2 < doc2.content.childCount - 1) {
|
|
23850
|
+
allContent.push(editor.schema.text("\n"));
|
|
23851
|
+
}
|
|
23852
|
+
}
|
|
23853
|
+
});
|
|
23854
|
+
if (allContent.length > 0) {
|
|
23855
|
+
const fragment = Fragment.from(allContent);
|
|
23856
|
+
const tr = state2.tr.replaceSelectionWith(fragment, false);
|
|
23857
|
+
dispatch(tr);
|
|
23858
|
+
} else {
|
|
23859
|
+
dispatch(state2.tr.replaceSelectionWith(doc2, true));
|
|
23860
|
+
}
|
|
23841
23861
|
} else {
|
|
23842
23862
|
dispatch(state2.tr.replaceSelectionWith(doc2, true));
|
|
23843
23863
|
}
|
|
@@ -25833,7 +25853,16 @@ function translateTab(params2) {
|
|
|
25833
25853
|
function generateTableProperties(node2) {
|
|
25834
25854
|
const elements = [];
|
|
25835
25855
|
const { attrs } = node2;
|
|
25836
|
-
const {
|
|
25856
|
+
const {
|
|
25857
|
+
tableWidth,
|
|
25858
|
+
tableWidthType,
|
|
25859
|
+
tableStyleId,
|
|
25860
|
+
borders,
|
|
25861
|
+
tableIndent,
|
|
25862
|
+
tableLayout,
|
|
25863
|
+
tableCellSpacing,
|
|
25864
|
+
justification
|
|
25865
|
+
} = attrs;
|
|
25837
25866
|
if (tableStyleId) {
|
|
25838
25867
|
const tableStyleElement = {
|
|
25839
25868
|
name: "w:tblStyle",
|
|
@@ -25876,6 +25905,13 @@ function generateTableProperties(node2) {
|
|
|
25876
25905
|
}
|
|
25877
25906
|
});
|
|
25878
25907
|
}
|
|
25908
|
+
if (justification) {
|
|
25909
|
+
const justificationElement = {
|
|
25910
|
+
name: "w:jc",
|
|
25911
|
+
attributes: { "w:val": justification }
|
|
25912
|
+
};
|
|
25913
|
+
elements.push(justificationElement);
|
|
25914
|
+
}
|
|
25879
25915
|
return {
|
|
25880
25916
|
name: "w:tblPr",
|
|
25881
25917
|
elements
|
|
@@ -26099,6 +26135,13 @@ function translateMark(mark) {
|
|
|
26099
26135
|
let value;
|
|
26100
26136
|
switch (mark.type) {
|
|
26101
26137
|
case "bold":
|
|
26138
|
+
if (attrs?.value) {
|
|
26139
|
+
markElement.attributes["w:val"] = attrs.value;
|
|
26140
|
+
} else {
|
|
26141
|
+
delete markElement.attributes;
|
|
26142
|
+
}
|
|
26143
|
+
markElement.type = "element";
|
|
26144
|
+
break;
|
|
26102
26145
|
case "italic":
|
|
26103
26146
|
delete markElement.attributes;
|
|
26104
26147
|
markElement.type = "element";
|
|
@@ -26132,6 +26175,14 @@ function translateMark(mark) {
|
|
|
26132
26175
|
case "textIndent":
|
|
26133
26176
|
markElement.attributes["w:firstline"] = inchesToTwips(attrs.textIndent);
|
|
26134
26177
|
break;
|
|
26178
|
+
case "textTransform":
|
|
26179
|
+
if (attrs?.textTransform === "none") {
|
|
26180
|
+
markElement.attributes["w:val"] = "0";
|
|
26181
|
+
} else {
|
|
26182
|
+
delete markElement.attributes;
|
|
26183
|
+
}
|
|
26184
|
+
markElement.type = "element";
|
|
26185
|
+
break;
|
|
26135
26186
|
case "lineHeight":
|
|
26136
26187
|
markElement.attributes["w:line"] = linesToTwips(attrs.lineHeight);
|
|
26137
26188
|
break;
|
|
@@ -27005,6 +27056,10 @@ function handleTableNode(node2, params2) {
|
|
|
27005
27056
|
};
|
|
27006
27057
|
attrs["borderCollapse"] = "separate";
|
|
27007
27058
|
}
|
|
27059
|
+
const tblJustification = tblPr.elements.find((el) => el.name === "w:jc");
|
|
27060
|
+
if (tblJustification?.attributes) {
|
|
27061
|
+
attrs["justification"] = tblJustification.attributes["w:val"];
|
|
27062
|
+
}
|
|
27008
27063
|
const rows = node2.elements.filter((el) => el.name === "w:tr");
|
|
27009
27064
|
const refStylesBorders = referencedStyles?.borders || {};
|
|
27010
27065
|
const refStylesRowBorders = referencedStyles?.rowBorders || {};
|
|
@@ -27550,7 +27605,11 @@ const handleRunNode = (params2) => {
|
|
|
27550
27605
|
const textStyleMark = marks.find((m) => m.type === "textStyle");
|
|
27551
27606
|
const hasFontStyle = textStyleMark && Object.keys(textStyleMark.attrs).length > 0;
|
|
27552
27607
|
if (defaultNodeStyles.marks && !hasFontStyle) {
|
|
27553
|
-
marks.
|
|
27608
|
+
const hasBoldDisabled = marks.find((m) => m.type === "bold")?.attrs?.value === "0";
|
|
27609
|
+
for (let mark of defaultNodeStyles.marks) {
|
|
27610
|
+
if (["bold"].includes(mark.type) && hasBoldDisabled) continue;
|
|
27611
|
+
marks.push(mark);
|
|
27612
|
+
}
|
|
27554
27613
|
}
|
|
27555
27614
|
if (node2.marks) marks.push(...node2.marks);
|
|
27556
27615
|
const newMarks = createImportMarks(marks);
|
|
@@ -28719,7 +28778,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
28719
28778
|
return;
|
|
28720
28779
|
}
|
|
28721
28780
|
}
|
|
28722
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.
|
|
28781
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.1") {
|
|
28723
28782
|
const customLocation = "docProps/custom.xml";
|
|
28724
28783
|
if (!docx[customLocation]) {
|
|
28725
28784
|
docx[customLocation] = generateCustomXml();
|
|
@@ -29148,22 +29207,23 @@ __publicField$2(_SuperConverter, "allowedElements", Object.freeze({
|
|
|
29148
29207
|
"w:commentReference": "commentReference"
|
|
29149
29208
|
}));
|
|
29150
29209
|
__publicField$2(_SuperConverter, "markTypes", [
|
|
29151
|
-
{ name: "w:b", type: "bold" },
|
|
29152
|
-
{ name:
|
|
29210
|
+
{ name: "w:b", type: "bold", property: "value" },
|
|
29211
|
+
// { name: 'w:bCs', type: 'bold' },
|
|
29153
29212
|
{ name: "w:i", type: "italic" },
|
|
29154
|
-
{ name:
|
|
29213
|
+
// { name: 'w:iCs', type: 'italic' },
|
|
29155
29214
|
{ name: "w:u", type: "underline", mark: "underline", property: "underlineType" },
|
|
29156
29215
|
{ name: "w:strike", type: "strike", mark: "strike" },
|
|
29157
29216
|
{ name: "w:color", type: "color", mark: "textStyle", property: "color" },
|
|
29158
29217
|
{ name: "w:sz", type: "fontSize", mark: "textStyle", property: "fontSize" },
|
|
29159
|
-
{ name:
|
|
29218
|
+
// { name: 'w:szCs', type: 'fontSize', mark: 'textStyle', property: 'fontSize' },
|
|
29160
29219
|
{ name: "w:rFonts", type: "fontFamily", mark: "textStyle", property: "fontFamily" },
|
|
29161
29220
|
{ name: "w:jc", type: "textAlign", mark: "textStyle", property: "textAlign" },
|
|
29162
29221
|
{ name: "w:ind", type: "textIndent", mark: "textStyle", property: "textIndent" },
|
|
29163
29222
|
{ name: "w:spacing", type: "lineHeight", mark: "textStyle", property: "lineHeight" },
|
|
29164
29223
|
{ name: "link", type: "link", mark: "link", property: "href" },
|
|
29165
29224
|
{ name: "w:highlight", type: "highlight", mark: "highlight", property: "color" },
|
|
29166
|
-
{ name: "w:shd", type: "highlight", mark: "highlight", property: "color" }
|
|
29225
|
+
{ name: "w:shd", type: "highlight", mark: "highlight", property: "color" },
|
|
29226
|
+
{ name: "w:caps", type: "textTransform", mark: "textStyle", property: "textTransform" }
|
|
29167
29227
|
]);
|
|
29168
29228
|
__publicField$2(_SuperConverter, "propertyTypes", Object.freeze({
|
|
29169
29229
|
"w:pPr": "paragraphProperties",
|
|
@@ -29197,7 +29257,7 @@ function storeSuperdocVersion(docx) {
|
|
|
29197
29257
|
function generateCustomXml() {
|
|
29198
29258
|
return DEFAULT_CUSTOM_XML;
|
|
29199
29259
|
}
|
|
29200
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.15.
|
|
29260
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.1") {
|
|
29201
29261
|
return {
|
|
29202
29262
|
type: "element",
|
|
29203
29263
|
name: "property",
|
|
@@ -45380,7 +45440,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
45380
45440
|
* @returns {Object | void} Migration results
|
|
45381
45441
|
*/
|
|
45382
45442
|
processCollaborationMigrations() {
|
|
45383
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.15.
|
|
45443
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.1");
|
|
45384
45444
|
if (!this.options.ydoc) return;
|
|
45385
45445
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
45386
45446
|
let docVersion = metaMap.get("version");
|
|
@@ -47468,6 +47528,9 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47468
47528
|
if (!linkedDefinitionStyles["font-size"] && basedOnDefinitionStyles["font-size"]) {
|
|
47469
47529
|
resultStyles["font-size"] = basedOnDefinitionStyles["font-size"];
|
|
47470
47530
|
}
|
|
47531
|
+
if (!linkedDefinitionStyles["text-transform"] && basedOnDefinitionStyles["text-transform"]) {
|
|
47532
|
+
resultStyles["text-transform"] = basedOnDefinitionStyles["text-transform"];
|
|
47533
|
+
}
|
|
47471
47534
|
Object.entries(resultStyles).forEach(([k, value]) => {
|
|
47472
47535
|
const key = kebabCase$1(k);
|
|
47473
47536
|
const flattenedMarks = [];
|
|
@@ -47485,6 +47548,7 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47485
47548
|
const mark = flattenedMarks.find((n) => n.key === key);
|
|
47486
47549
|
const hasParentIndent = Object.keys(parent?.attrs?.indent || {});
|
|
47487
47550
|
const hasParentSpacing = Object.keys(parent?.attrs?.spacing || {});
|
|
47551
|
+
const listTypes = ["orderedList", "listItem"];
|
|
47488
47552
|
if (!mark) {
|
|
47489
47553
|
if (key === "spacing" && includeSpacing && !hasParentSpacing) {
|
|
47490
47554
|
const space = getSpacingStyle(value);
|
|
@@ -47497,7 +47561,18 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47497
47561
|
if (rightIndent) markValue["margin-right"] = rightIndent + "px";
|
|
47498
47562
|
if (firstLine) markValue["text-indent"] = firstLine + "px";
|
|
47499
47563
|
} else if (key === "bold") {
|
|
47500
|
-
|
|
47564
|
+
const val = value?.value;
|
|
47565
|
+
if (!listTypes.includes(node2.type.name) && val !== "0") {
|
|
47566
|
+
markValue["font-weight"] = "bold";
|
|
47567
|
+
}
|
|
47568
|
+
} else if (key === "text-transform") {
|
|
47569
|
+
if (!listTypes.includes(node2.type.name)) {
|
|
47570
|
+
markValue[key] = value;
|
|
47571
|
+
}
|
|
47572
|
+
} else if (key === "font-size") {
|
|
47573
|
+
if (!listTypes.includes(node2.type.name)) {
|
|
47574
|
+
markValue[key] = value;
|
|
47575
|
+
}
|
|
47501
47576
|
} else if (typeof value === "string") {
|
|
47502
47577
|
markValue[key] = value;
|
|
47503
47578
|
}
|
|
@@ -47745,12 +47820,6 @@ function orderedListSync(editor) {
|
|
|
47745
47820
|
listNumberingType,
|
|
47746
47821
|
start: numberingDefStart
|
|
47747
47822
|
} = ListHelpers.getListDefinitionDetails({ numId, level, editor });
|
|
47748
|
-
if (listNumberingType !== node2.attrs.listNumberingType) {
|
|
47749
|
-
listNumberingType = node2.attrs.listNumberingType;
|
|
47750
|
-
}
|
|
47751
|
-
if (lvlText !== node2.attrs.lvlText) {
|
|
47752
|
-
lvlText = node2.attrs.lvlText;
|
|
47753
|
-
}
|
|
47754
47823
|
const start2 = parseInt(numberingDefStart) || 1;
|
|
47755
47824
|
if (!listMap.has(numId)) {
|
|
47756
47825
|
const generatedLevels = {};
|
|
@@ -48109,14 +48178,6 @@ const Paragraph = Node$1.create({
|
|
|
48109
48178
|
else if (jc === "both") style2 += "text-align: justify;";
|
|
48110
48179
|
return { style: style2 };
|
|
48111
48180
|
}
|
|
48112
|
-
},
|
|
48113
|
-
textCase: {
|
|
48114
|
-
renderDOM: (attrs) => {
|
|
48115
|
-
if (!attrs.textCase) return {};
|
|
48116
|
-
return {
|
|
48117
|
-
style: `text-transform: ${attrs.textCase}`
|
|
48118
|
-
};
|
|
48119
|
-
}
|
|
48120
48181
|
}
|
|
48121
48182
|
};
|
|
48122
48183
|
},
|
|
@@ -50924,6 +50985,19 @@ const Table = Node$1.create({
|
|
|
50924
50985
|
};
|
|
50925
50986
|
}
|
|
50926
50987
|
},
|
|
50988
|
+
justification: {
|
|
50989
|
+
default: null,
|
|
50990
|
+
renderDOM: (attrs) => {
|
|
50991
|
+
if (!attrs.justification) return {};
|
|
50992
|
+
if (attrs.justification === "center") {
|
|
50993
|
+
return { style: `margin: 0 auto` };
|
|
50994
|
+
}
|
|
50995
|
+
if (attrs.justification === "right") {
|
|
50996
|
+
return { style: `margin-left: auto` };
|
|
50997
|
+
}
|
|
50998
|
+
return {};
|
|
50999
|
+
}
|
|
51000
|
+
},
|
|
50927
51001
|
tableStyleId: {
|
|
50928
51002
|
rendered: false
|
|
50929
51003
|
},
|
|
@@ -54189,6 +54263,20 @@ const Bold = Mark2.create({
|
|
|
54189
54263
|
htmlAttributes: {}
|
|
54190
54264
|
};
|
|
54191
54265
|
},
|
|
54266
|
+
addAttributes() {
|
|
54267
|
+
return {
|
|
54268
|
+
value: {
|
|
54269
|
+
default: null,
|
|
54270
|
+
renderDOM: (attrs) => {
|
|
54271
|
+
if (!attrs.value) return {};
|
|
54272
|
+
if (attrs.value === "0") {
|
|
54273
|
+
return { style: "font-weight: normal" };
|
|
54274
|
+
}
|
|
54275
|
+
return {};
|
|
54276
|
+
}
|
|
54277
|
+
}
|
|
54278
|
+
};
|
|
54279
|
+
},
|
|
54192
54280
|
parseDOM() {
|
|
54193
54281
|
return [
|
|
54194
54282
|
{ tag: "strong" },
|
|
@@ -54959,6 +55047,32 @@ const getChangesByIdToResolve = (state2, id) => {
|
|
|
54959
55047
|
}
|
|
54960
55048
|
return [matchingChange, linkedChange].filter(Boolean);
|
|
54961
55049
|
};
|
|
55050
|
+
const TextTransform = Extension.create({
|
|
55051
|
+
name: "textTransform",
|
|
55052
|
+
addOptions() {
|
|
55053
|
+
return {
|
|
55054
|
+
types: ["textStyle"]
|
|
55055
|
+
};
|
|
55056
|
+
},
|
|
55057
|
+
addGlobalAttributes() {
|
|
55058
|
+
return [
|
|
55059
|
+
{
|
|
55060
|
+
types: this.options.types,
|
|
55061
|
+
attributes: {
|
|
55062
|
+
textTransform: {
|
|
55063
|
+
default: null,
|
|
55064
|
+
renderDOM: (attrs) => {
|
|
55065
|
+
if (!attrs.textCase) return {};
|
|
55066
|
+
return {
|
|
55067
|
+
style: `text-transform: ${attrs.textCase}`
|
|
55068
|
+
};
|
|
55069
|
+
}
|
|
55070
|
+
}
|
|
55071
|
+
}
|
|
55072
|
+
}
|
|
55073
|
+
];
|
|
55074
|
+
}
|
|
55075
|
+
});
|
|
54962
55076
|
const Placeholder = Extension.create({
|
|
54963
55077
|
name: "placeholder",
|
|
54964
55078
|
addOptions() {
|
|
@@ -60438,7 +60552,8 @@ const getStarterExtensions = () => {
|
|
|
60438
60552
|
StructuredContent,
|
|
60439
60553
|
DocumentSection,
|
|
60440
60554
|
NodeResizer,
|
|
60441
|
-
CustomSelection
|
|
60555
|
+
CustomSelection,
|
|
60556
|
+
TextTransform
|
|
60442
60557
|
];
|
|
60443
60558
|
};
|
|
60444
60559
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
@@ -71880,7 +71995,7 @@ const _sfc_main$b = {
|
|
|
71880
71995
|
class: "remove-btn__icon",
|
|
71881
71996
|
innerHTML: unref(toolbarIcons).removeLink
|
|
71882
71997
|
}, null, 8, _hoisted_12),
|
|
71883
|
-
_cache[5] || (_cache[5] = createTextVNode(" Remove "
|
|
71998
|
+
_cache[5] || (_cache[5] = createTextVNode(" Remove "))
|
|
71884
71999
|
])) : createCommentVNode("", true),
|
|
71885
72000
|
createBaseVNode("button", {
|
|
71886
72001
|
class: normalizeClass(["submit-btn", { "disable-btn": isDisabled2.value }]),
|
|
@@ -72079,7 +72194,7 @@ const _sfc_main$9 = {
|
|
|
72079
72194
|
innerHTML: unref(DropIcon),
|
|
72080
72195
|
class: "none-icon"
|
|
72081
72196
|
}, null, 8, _hoisted_2$5),
|
|
72082
|
-
_cache[1] || (_cache[1] = createTextVNode(" None "
|
|
72197
|
+
_cache[1] || (_cache[1] = createTextVNode(" None "))
|
|
72083
72198
|
])) : createCommentVNode("", true),
|
|
72084
72199
|
createBaseVNode("div", _hoisted_3$4, [
|
|
72085
72200
|
createVNode(IconGridRow, {
|