@harbour-enterprises/superdoc 0.15.3 → 0.15.4-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-CwgXzIDF.es.js → super-editor.es-BDGHv_Gl.es.js} +184 -52
- package/dist/chunks/{super-editor.es-DBI0Gl-j.cjs → super-editor.es-yjvWhbbI.cjs} +184 -52
- 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-GrsWwUpa.js → converter-OvHX-zbm.js} +72 -29
- package/dist/super-editor/chunks/{docx-zipper-CcHsJFyq.js → docx-zipper-Bqdv1MV1.js} +1 -1
- package/dist/super-editor/chunks/{editor-wXuRbPQR.js → editor-B4Fn3yDo.js} +111 -22
- package/dist/super-editor/chunks/{toolbar-wixoWN4v.js → toolbar-gYvFKlDX.js} +2 -2
- package/dist/super-editor/converter.es.js +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/structured-content/document-section.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 +191 -66
- 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"];
|
|
@@ -25833,7 +25836,16 @@ function translateTab(params2) {
|
|
|
25833
25836
|
function generateTableProperties(node2) {
|
|
25834
25837
|
const elements = [];
|
|
25835
25838
|
const { attrs } = node2;
|
|
25836
|
-
const {
|
|
25839
|
+
const {
|
|
25840
|
+
tableWidth,
|
|
25841
|
+
tableWidthType,
|
|
25842
|
+
tableStyleId,
|
|
25843
|
+
borders,
|
|
25844
|
+
tableIndent,
|
|
25845
|
+
tableLayout,
|
|
25846
|
+
tableCellSpacing,
|
|
25847
|
+
justification
|
|
25848
|
+
} = attrs;
|
|
25837
25849
|
if (tableStyleId) {
|
|
25838
25850
|
const tableStyleElement = {
|
|
25839
25851
|
name: "w:tblStyle",
|
|
@@ -25876,6 +25888,13 @@ function generateTableProperties(node2) {
|
|
|
25876
25888
|
}
|
|
25877
25889
|
});
|
|
25878
25890
|
}
|
|
25891
|
+
if (justification) {
|
|
25892
|
+
const justificationElement = {
|
|
25893
|
+
name: "w:jc",
|
|
25894
|
+
attributes: { "w:val": justification }
|
|
25895
|
+
};
|
|
25896
|
+
elements.push(justificationElement);
|
|
25897
|
+
}
|
|
25879
25898
|
return {
|
|
25880
25899
|
name: "w:tblPr",
|
|
25881
25900
|
elements
|
|
@@ -26099,6 +26118,13 @@ function translateMark(mark) {
|
|
|
26099
26118
|
let value;
|
|
26100
26119
|
switch (mark.type) {
|
|
26101
26120
|
case "bold":
|
|
26121
|
+
if (attrs?.value) {
|
|
26122
|
+
markElement.attributes["w:val"] = attrs.value;
|
|
26123
|
+
} else {
|
|
26124
|
+
delete markElement.attributes;
|
|
26125
|
+
}
|
|
26126
|
+
markElement.type = "element";
|
|
26127
|
+
break;
|
|
26102
26128
|
case "italic":
|
|
26103
26129
|
delete markElement.attributes;
|
|
26104
26130
|
markElement.type = "element";
|
|
@@ -26132,6 +26158,14 @@ function translateMark(mark) {
|
|
|
26132
26158
|
case "textIndent":
|
|
26133
26159
|
markElement.attributes["w:firstline"] = inchesToTwips(attrs.textIndent);
|
|
26134
26160
|
break;
|
|
26161
|
+
case "textTransform":
|
|
26162
|
+
if (attrs?.textTransform === "none") {
|
|
26163
|
+
markElement.attributes["w:val"] = "0";
|
|
26164
|
+
} else {
|
|
26165
|
+
delete markElement.attributes;
|
|
26166
|
+
}
|
|
26167
|
+
markElement.type = "element";
|
|
26168
|
+
break;
|
|
26135
26169
|
case "lineHeight":
|
|
26136
26170
|
markElement.attributes["w:line"] = linesToTwips(attrs.lineHeight);
|
|
26137
26171
|
break;
|
|
@@ -27005,6 +27039,10 @@ function handleTableNode(node2, params2) {
|
|
|
27005
27039
|
};
|
|
27006
27040
|
attrs["borderCollapse"] = "separate";
|
|
27007
27041
|
}
|
|
27042
|
+
const tblJustification = tblPr.elements.find((el) => el.name === "w:jc");
|
|
27043
|
+
if (tblJustification?.attributes) {
|
|
27044
|
+
attrs["justification"] = tblJustification.attributes["w:val"];
|
|
27045
|
+
}
|
|
27008
27046
|
const rows = node2.elements.filter((el) => el.name === "w:tr");
|
|
27009
27047
|
const refStylesBorders = referencedStyles?.borders || {};
|
|
27010
27048
|
const refStylesRowBorders = referencedStyles?.rowBorders || {};
|
|
@@ -27550,7 +27588,11 @@ const handleRunNode = (params2) => {
|
|
|
27550
27588
|
const textStyleMark = marks.find((m) => m.type === "textStyle");
|
|
27551
27589
|
const hasFontStyle = textStyleMark && Object.keys(textStyleMark.attrs).length > 0;
|
|
27552
27590
|
if (defaultNodeStyles.marks && !hasFontStyle) {
|
|
27553
|
-
marks.
|
|
27591
|
+
const hasBoldDisabled = marks.find((m) => m.type === "bold")?.attrs?.value === "0";
|
|
27592
|
+
for (let mark of defaultNodeStyles.marks) {
|
|
27593
|
+
if (["bold"].includes(mark.type) && hasBoldDisabled) continue;
|
|
27594
|
+
marks.push(mark);
|
|
27595
|
+
}
|
|
27554
27596
|
}
|
|
27555
27597
|
if (node2.marks) marks.push(...node2.marks);
|
|
27556
27598
|
const newMarks = createImportMarks(marks);
|
|
@@ -28719,7 +28761,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
28719
28761
|
return;
|
|
28720
28762
|
}
|
|
28721
28763
|
}
|
|
28722
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.
|
|
28764
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.4-next.1") {
|
|
28723
28765
|
const customLocation = "docProps/custom.xml";
|
|
28724
28766
|
if (!docx[customLocation]) {
|
|
28725
28767
|
docx[customLocation] = generateCustomXml();
|
|
@@ -29148,22 +29190,23 @@ __publicField$2(_SuperConverter, "allowedElements", Object.freeze({
|
|
|
29148
29190
|
"w:commentReference": "commentReference"
|
|
29149
29191
|
}));
|
|
29150
29192
|
__publicField$2(_SuperConverter, "markTypes", [
|
|
29151
|
-
{ name: "w:b", type: "bold" },
|
|
29152
|
-
{ name:
|
|
29193
|
+
{ name: "w:b", type: "bold", property: "value" },
|
|
29194
|
+
// { name: 'w:bCs', type: 'bold' },
|
|
29153
29195
|
{ name: "w:i", type: "italic" },
|
|
29154
|
-
{ name:
|
|
29196
|
+
// { name: 'w:iCs', type: 'italic' },
|
|
29155
29197
|
{ name: "w:u", type: "underline", mark: "underline", property: "underlineType" },
|
|
29156
29198
|
{ name: "w:strike", type: "strike", mark: "strike" },
|
|
29157
29199
|
{ name: "w:color", type: "color", mark: "textStyle", property: "color" },
|
|
29158
29200
|
{ name: "w:sz", type: "fontSize", mark: "textStyle", property: "fontSize" },
|
|
29159
|
-
{ name:
|
|
29201
|
+
// { name: 'w:szCs', type: 'fontSize', mark: 'textStyle', property: 'fontSize' },
|
|
29160
29202
|
{ name: "w:rFonts", type: "fontFamily", mark: "textStyle", property: "fontFamily" },
|
|
29161
29203
|
{ name: "w:jc", type: "textAlign", mark: "textStyle", property: "textAlign" },
|
|
29162
29204
|
{ name: "w:ind", type: "textIndent", mark: "textStyle", property: "textIndent" },
|
|
29163
29205
|
{ name: "w:spacing", type: "lineHeight", mark: "textStyle", property: "lineHeight" },
|
|
29164
29206
|
{ name: "link", type: "link", mark: "link", property: "href" },
|
|
29165
29207
|
{ name: "w:highlight", type: "highlight", mark: "highlight", property: "color" },
|
|
29166
|
-
{ name: "w:shd", type: "highlight", mark: "highlight", property: "color" }
|
|
29208
|
+
{ name: "w:shd", type: "highlight", mark: "highlight", property: "color" },
|
|
29209
|
+
{ name: "w:caps", type: "textTransform", mark: "textStyle", property: "textTransform" }
|
|
29167
29210
|
]);
|
|
29168
29211
|
__publicField$2(_SuperConverter, "propertyTypes", Object.freeze({
|
|
29169
29212
|
"w:pPr": "paragraphProperties",
|
|
@@ -29197,7 +29240,7 @@ function storeSuperdocVersion(docx) {
|
|
|
29197
29240
|
function generateCustomXml() {
|
|
29198
29241
|
return DEFAULT_CUSTOM_XML;
|
|
29199
29242
|
}
|
|
29200
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.15.
|
|
29243
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.15.4-next.1") {
|
|
29201
29244
|
return {
|
|
29202
29245
|
type: "element",
|
|
29203
29246
|
name: "property",
|
|
@@ -45380,7 +45423,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
45380
45423
|
* @returns {Object | void} Migration results
|
|
45381
45424
|
*/
|
|
45382
45425
|
processCollaborationMigrations() {
|
|
45383
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.15.
|
|
45426
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.15.4-next.1");
|
|
45384
45427
|
if (!this.options.ydoc) return;
|
|
45385
45428
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
45386
45429
|
let docVersion = metaMap.get("version");
|
|
@@ -47468,6 +47511,9 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47468
47511
|
if (!linkedDefinitionStyles["font-size"] && basedOnDefinitionStyles["font-size"]) {
|
|
47469
47512
|
resultStyles["font-size"] = basedOnDefinitionStyles["font-size"];
|
|
47470
47513
|
}
|
|
47514
|
+
if (!linkedDefinitionStyles["text-transform"] && basedOnDefinitionStyles["text-transform"]) {
|
|
47515
|
+
resultStyles["text-transform"] = basedOnDefinitionStyles["text-transform"];
|
|
47516
|
+
}
|
|
47471
47517
|
Object.entries(resultStyles).forEach(([k, value]) => {
|
|
47472
47518
|
const key = kebabCase$1(k);
|
|
47473
47519
|
const flattenedMarks = [];
|
|
@@ -47485,6 +47531,7 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47485
47531
|
const mark = flattenedMarks.find((n) => n.key === key);
|
|
47486
47532
|
const hasParentIndent = Object.keys(parent?.attrs?.indent || {});
|
|
47487
47533
|
const hasParentSpacing = Object.keys(parent?.attrs?.spacing || {});
|
|
47534
|
+
const listTypes = ["orderedList", "listItem"];
|
|
47488
47535
|
if (!mark) {
|
|
47489
47536
|
if (key === "spacing" && includeSpacing && !hasParentSpacing) {
|
|
47490
47537
|
const space = getSpacingStyle(value);
|
|
@@ -47497,7 +47544,18 @@ const generateLinkedStyleString = (linkedStyle, basedOnStyle, node2, parent, inc
|
|
|
47497
47544
|
if (rightIndent) markValue["margin-right"] = rightIndent + "px";
|
|
47498
47545
|
if (firstLine) markValue["text-indent"] = firstLine + "px";
|
|
47499
47546
|
} else if (key === "bold") {
|
|
47500
|
-
|
|
47547
|
+
const val = value?.value;
|
|
47548
|
+
if (!listTypes.includes(node2.type.name) && val !== "0") {
|
|
47549
|
+
markValue["font-weight"] = "bold";
|
|
47550
|
+
}
|
|
47551
|
+
} else if (key === "text-transform") {
|
|
47552
|
+
if (!listTypes.includes(node2.type.name)) {
|
|
47553
|
+
markValue[key] = value;
|
|
47554
|
+
}
|
|
47555
|
+
} else if (key === "font-size") {
|
|
47556
|
+
if (!listTypes.includes(node2.type.name)) {
|
|
47557
|
+
markValue[key] = value;
|
|
47558
|
+
}
|
|
47501
47559
|
} else if (typeof value === "string") {
|
|
47502
47560
|
markValue[key] = value;
|
|
47503
47561
|
}
|
|
@@ -47745,12 +47803,6 @@ function orderedListSync(editor) {
|
|
|
47745
47803
|
listNumberingType,
|
|
47746
47804
|
start: numberingDefStart
|
|
47747
47805
|
} = 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
47806
|
const start2 = parseInt(numberingDefStart) || 1;
|
|
47755
47807
|
if (!listMap.has(numId)) {
|
|
47756
47808
|
const generatedLevels = {};
|
|
@@ -48109,14 +48161,6 @@ const Paragraph = Node$1.create({
|
|
|
48109
48161
|
else if (jc === "both") style2 += "text-align: justify;";
|
|
48110
48162
|
return { style: style2 };
|
|
48111
48163
|
}
|
|
48112
|
-
},
|
|
48113
|
-
textCase: {
|
|
48114
|
-
renderDOM: (attrs) => {
|
|
48115
|
-
if (!attrs.textCase) return {};
|
|
48116
|
-
return {
|
|
48117
|
-
style: `text-transform: ${attrs.textCase}`
|
|
48118
|
-
};
|
|
48119
|
-
}
|
|
48120
48164
|
}
|
|
48121
48165
|
};
|
|
48122
48166
|
},
|
|
@@ -50924,6 +50968,19 @@ const Table = Node$1.create({
|
|
|
50924
50968
|
};
|
|
50925
50969
|
}
|
|
50926
50970
|
},
|
|
50971
|
+
justification: {
|
|
50972
|
+
default: null,
|
|
50973
|
+
renderDOM: (attrs) => {
|
|
50974
|
+
if (!attrs.justification) return {};
|
|
50975
|
+
if (attrs.justification === "center") {
|
|
50976
|
+
return { style: `margin: 0 auto` };
|
|
50977
|
+
}
|
|
50978
|
+
if (attrs.justification === "right") {
|
|
50979
|
+
return { style: `margin-left: auto` };
|
|
50980
|
+
}
|
|
50981
|
+
return {};
|
|
50982
|
+
}
|
|
50983
|
+
},
|
|
50927
50984
|
tableStyleId: {
|
|
50928
50985
|
rendered: false
|
|
50929
50986
|
},
|
|
@@ -54000,14 +54057,48 @@ const DocumentSection = Node$1.create({
|
|
|
54000
54057
|
if (!node2) return false;
|
|
54001
54058
|
const isAlreadyInSdtBlock = findParentNode((node22) => node22.type.name === "documentSection")(selection);
|
|
54002
54059
|
if (isAlreadyInSdtBlock && isAlreadyInSdtBlock.node) {
|
|
54003
|
-
const
|
|
54004
|
-
from2 =
|
|
54005
|
-
to =
|
|
54060
|
+
const insertPos2 = isAlreadyInSdtBlock.pos + isAlreadyInSdtBlock.node.nodeSize;
|
|
54061
|
+
from2 = insertPos2;
|
|
54062
|
+
to = insertPos2;
|
|
54006
54063
|
}
|
|
54007
54064
|
tr.replaceRangeWith(from2, to, node2);
|
|
54065
|
+
const nodeEnd = from2 + node2.nodeSize;
|
|
54066
|
+
let shouldInsertParagraph = true;
|
|
54067
|
+
let insertPos = nodeEnd;
|
|
54068
|
+
if (nodeEnd >= tr.doc.content.size) {
|
|
54069
|
+
insertPos = tr.doc.content.size;
|
|
54070
|
+
if (insertPos > 0) {
|
|
54071
|
+
const $endPos = tr.doc.resolve(insertPos);
|
|
54072
|
+
if ($endPos.nodeBefore && $endPos.nodeBefore.type.name === "paragraph") {
|
|
54073
|
+
shouldInsertParagraph = false;
|
|
54074
|
+
}
|
|
54075
|
+
}
|
|
54076
|
+
}
|
|
54077
|
+
if (shouldInsertParagraph) {
|
|
54078
|
+
const emptyParagraph = tr.doc.type.schema.nodes.paragraph.create();
|
|
54079
|
+
tr.insert(insertPos, emptyParagraph);
|
|
54080
|
+
}
|
|
54008
54081
|
if (dispatch) {
|
|
54009
54082
|
tr.setMeta("documentSection", { action: "create" });
|
|
54010
54083
|
dispatch(tr);
|
|
54084
|
+
setTimeout(() => {
|
|
54085
|
+
try {
|
|
54086
|
+
const currentState = editor.state;
|
|
54087
|
+
const docSize = currentState.doc.content.size;
|
|
54088
|
+
let targetPos = from2 + node2.nodeSize;
|
|
54089
|
+
if (shouldInsertParagraph) {
|
|
54090
|
+
targetPos += 1;
|
|
54091
|
+
}
|
|
54092
|
+
targetPos = Math.min(targetPos, docSize);
|
|
54093
|
+
if (targetPos < docSize && targetPos > 0) {
|
|
54094
|
+
const newSelection = Selection.near(currentState.doc.resolve(targetPos));
|
|
54095
|
+
const newTr = currentState.tr.setSelection(newSelection);
|
|
54096
|
+
editor.view.dispatch(newTr);
|
|
54097
|
+
}
|
|
54098
|
+
} catch (e) {
|
|
54099
|
+
console.warn("Could not set delayed selection:", e);
|
|
54100
|
+
}
|
|
54101
|
+
}, 0);
|
|
54011
54102
|
}
|
|
54012
54103
|
return true;
|
|
54013
54104
|
},
|
|
@@ -54155,6 +54246,20 @@ const Bold = Mark2.create({
|
|
|
54155
54246
|
htmlAttributes: {}
|
|
54156
54247
|
};
|
|
54157
54248
|
},
|
|
54249
|
+
addAttributes() {
|
|
54250
|
+
return {
|
|
54251
|
+
value: {
|
|
54252
|
+
default: null,
|
|
54253
|
+
renderDOM: (attrs) => {
|
|
54254
|
+
if (!attrs.value) return {};
|
|
54255
|
+
if (attrs.value === "0") {
|
|
54256
|
+
return { style: "font-weight: normal" };
|
|
54257
|
+
}
|
|
54258
|
+
return {};
|
|
54259
|
+
}
|
|
54260
|
+
}
|
|
54261
|
+
};
|
|
54262
|
+
},
|
|
54158
54263
|
parseDOM() {
|
|
54159
54264
|
return [
|
|
54160
54265
|
{ tag: "strong" },
|
|
@@ -54925,6 +55030,32 @@ const getChangesByIdToResolve = (state2, id) => {
|
|
|
54925
55030
|
}
|
|
54926
55031
|
return [matchingChange, linkedChange].filter(Boolean);
|
|
54927
55032
|
};
|
|
55033
|
+
const TextTransform = Extension.create({
|
|
55034
|
+
name: "textTransform",
|
|
55035
|
+
addOptions() {
|
|
55036
|
+
return {
|
|
55037
|
+
types: ["textStyle"]
|
|
55038
|
+
};
|
|
55039
|
+
},
|
|
55040
|
+
addGlobalAttributes() {
|
|
55041
|
+
return [
|
|
55042
|
+
{
|
|
55043
|
+
types: this.options.types,
|
|
55044
|
+
attributes: {
|
|
55045
|
+
textTransform: {
|
|
55046
|
+
default: null,
|
|
55047
|
+
renderDOM: (attrs) => {
|
|
55048
|
+
if (!attrs.textCase) return {};
|
|
55049
|
+
return {
|
|
55050
|
+
style: `text-transform: ${attrs.textCase}`
|
|
55051
|
+
};
|
|
55052
|
+
}
|
|
55053
|
+
}
|
|
55054
|
+
}
|
|
55055
|
+
}
|
|
55056
|
+
];
|
|
55057
|
+
}
|
|
55058
|
+
});
|
|
54928
55059
|
const Placeholder = Extension.create({
|
|
54929
55060
|
name: "placeholder",
|
|
54930
55061
|
addOptions() {
|
|
@@ -60404,7 +60535,8 @@ const getStarterExtensions = () => {
|
|
|
60404
60535
|
StructuredContent,
|
|
60405
60536
|
DocumentSection,
|
|
60406
60537
|
NodeResizer,
|
|
60407
|
-
CustomSelection
|
|
60538
|
+
CustomSelection,
|
|
60539
|
+
TextTransform
|
|
60408
60540
|
];
|
|
60409
60541
|
};
|
|
60410
60542
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
@@ -71846,7 +71978,7 @@ const _sfc_main$b = {
|
|
|
71846
71978
|
class: "remove-btn__icon",
|
|
71847
71979
|
innerHTML: unref(toolbarIcons).removeLink
|
|
71848
71980
|
}, null, 8, _hoisted_12),
|
|
71849
|
-
_cache[5] || (_cache[5] = createTextVNode(" Remove "
|
|
71981
|
+
_cache[5] || (_cache[5] = createTextVNode(" Remove "))
|
|
71850
71982
|
])) : createCommentVNode("", true),
|
|
71851
71983
|
createBaseVNode("button", {
|
|
71852
71984
|
class: normalizeClass(["submit-btn", { "disable-btn": isDisabled2.value }]),
|
|
@@ -72045,7 +72177,7 @@ const _sfc_main$9 = {
|
|
|
72045
72177
|
innerHTML: unref(DropIcon),
|
|
72046
72178
|
class: "none-icon"
|
|
72047
72179
|
}, null, 8, _hoisted_2$5),
|
|
72048
|
-
_cache[1] || (_cache[1] = createTextVNode(" None "
|
|
72180
|
+
_cache[1] || (_cache[1] = createTextVNode(" None "))
|
|
72049
72181
|
])) : createCommentVNode("", true),
|
|
72050
72182
|
createBaseVNode("div", _hoisted_3$4, [
|
|
72051
72183
|
createVNode(IconGridRow, {
|