@harbour-enterprises/superdoc 1.0.0-beta.22 → 1.0.0-beta.23
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-CswYWp1h.cjs → PdfViewer-C9mryfp4.cjs} +1 -1
- package/dist/chunks/{PdfViewer-B42JCeYb.es.js → PdfViewer-umOKwA1g.es.js} +1 -1
- package/dist/chunks/{index-895wSAjT-CWlZl8zz.cjs → index-DYBG7Xab-CoI6fike.cjs} +1 -1
- package/dist/chunks/{index-895wSAjT-C4ksiI6n.es.js → index-DYBG7Xab-mIeLdlWI.es.js} +1 -1
- package/dist/chunks/{index-DBmh710D.es.js → index-DyY842H4.es.js} +3 -3
- package/dist/chunks/{index-CK4eX_iu.cjs → index-Q-l_lwcU.cjs} +3 -3
- package/dist/chunks/{super-editor.es-BkRizaIE.cjs → super-editor.es-49DW4_-r.cjs} +243 -62
- package/dist/chunks/{super-editor.es-V792hb-6.es.js → super-editor.es-Cj9Sb-Qv.es.js} +243 -62
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DhkZt4Pv.js → converter-DJyfDFNm.js} +33 -29
- package/dist/super-editor/chunks/{docx-zipper-Bajmc-RM.js → docx-zipper-C-9Tqy8I.js} +1 -1
- package/dist/super-editor/chunks/{editor-oZjoYNA0.js → editor-f37DOCIX.js} +212 -35
- package/dist/super-editor/chunks/{index-895wSAjT.js → index-DYBG7Xab.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Bn5LTbq9.js → toolbar-Devgq8w3.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/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +245 -64
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -24984,24 +24984,32 @@ function extractGradientFill(gradFill) {
|
|
|
24984
24984
|
const DRAWING_XML_TAG = "w:drawing";
|
|
24985
24985
|
const SHAPE_URI = "http://schemas.microsoft.com/office/word/2010/wordprocessingShape";
|
|
24986
24986
|
const GROUP_URI = "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup";
|
|
24987
|
+
const normalizeTargetPath = (targetPath = "") => {
|
|
24988
|
+
if (!targetPath) return targetPath;
|
|
24989
|
+
const trimmed = targetPath.replace(/^\/+/, "");
|
|
24990
|
+
if (trimmed.startsWith("word/")) return trimmed;
|
|
24991
|
+
if (trimmed.startsWith("media/")) return `word/${trimmed}`;
|
|
24992
|
+
return `word/${trimmed}`;
|
|
24993
|
+
};
|
|
24987
24994
|
const DEFAULT_SHAPE_WIDTH = 100;
|
|
24988
24995
|
const DEFAULT_SHAPE_HEIGHT = 100;
|
|
24989
24996
|
function handleImageNode(node, params, isAnchor) {
|
|
24997
|
+
if (!node) return null;
|
|
24990
24998
|
const { docx, filename } = params;
|
|
24991
|
-
const
|
|
24999
|
+
const attributes = node?.attributes || {};
|
|
24992
25000
|
const padding = {
|
|
24993
|
-
top: emuToPixels(attributes["distT"]),
|
|
24994
|
-
bottom: emuToPixels(attributes["distB"]),
|
|
24995
|
-
left: emuToPixels(attributes["distL"]),
|
|
24996
|
-
right: emuToPixels(attributes["distR"])
|
|
25001
|
+
top: emuToPixels(attributes?.["distT"]),
|
|
25002
|
+
bottom: emuToPixels(attributes?.["distB"]),
|
|
25003
|
+
left: emuToPixels(attributes?.["distL"]),
|
|
25004
|
+
right: emuToPixels(attributes?.["distR"])
|
|
24997
25005
|
};
|
|
24998
|
-
const extent = node
|
|
25006
|
+
const extent = node?.elements?.find((el) => el.name === "wp:extent");
|
|
24999
25007
|
const size = {
|
|
25000
25008
|
width: emuToPixels(extent?.attributes?.cx),
|
|
25001
25009
|
height: emuToPixels(extent?.attributes?.cy)
|
|
25002
25010
|
};
|
|
25003
25011
|
let transformData = {};
|
|
25004
|
-
const effectExtent = node
|
|
25012
|
+
const effectExtent = node?.elements?.find((el) => el.name === "wp:effectExtent");
|
|
25005
25013
|
if (effectExtent) {
|
|
25006
25014
|
const sanitizeEmuValue = (value) => {
|
|
25007
25015
|
if (value === null || value === void 0) return 0;
|
|
@@ -25015,12 +25023,12 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
25015
25023
|
bottom: emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["b"]))
|
|
25016
25024
|
};
|
|
25017
25025
|
}
|
|
25018
|
-
const positionHTag = node
|
|
25019
|
-
const positionH = positionHTag?.elements
|
|
25026
|
+
const positionHTag = node?.elements?.find((el) => el.name === "wp:positionH");
|
|
25027
|
+
const positionH = positionHTag?.elements?.find((el) => el.name === "wp:posOffset");
|
|
25020
25028
|
const positionHValue = emuToPixels(positionH?.elements[0]?.text);
|
|
25021
25029
|
const hRelativeFrom = positionHTag?.attributes?.relativeFrom;
|
|
25022
|
-
const alignH = positionHTag?.elements
|
|
25023
|
-
const positionVTag = node
|
|
25030
|
+
const alignH = positionHTag?.elements?.find((el) => el.name === "wp:align")?.elements?.[0]?.text;
|
|
25031
|
+
const positionVTag = node?.elements?.find((el) => el.name === "wp:positionV");
|
|
25024
25032
|
const positionV = positionVTag?.elements?.find((el) => el.name === "wp:posOffset");
|
|
25025
25033
|
const positionVValue = emuToPixels(positionV?.elements[0]?.text);
|
|
25026
25034
|
const vRelativeFrom = positionVTag?.attributes?.relativeFrom;
|
|
@@ -25030,8 +25038,8 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
25030
25038
|
top: positionVValue
|
|
25031
25039
|
};
|
|
25032
25040
|
const useSimplePos = attributes["simplePos"] === "1" || attributes["simplePos"] === 1 || attributes["simplePos"] === true;
|
|
25033
|
-
const simplePosNode = node
|
|
25034
|
-
const wrapNode = isAnchor ? node
|
|
25041
|
+
const simplePosNode = node?.elements?.find((el) => el.name === "wp:simplePos");
|
|
25042
|
+
const wrapNode = isAnchor ? node?.elements?.find(
|
|
25035
25043
|
(el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
|
|
25036
25044
|
) : null;
|
|
25037
25045
|
const wrap2 = isAnchor ? { type: wrapNode?.name.slice(7) || "None", attrs: {} } : { type: "Inline" };
|
|
@@ -25152,9 +25160,8 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
25152
25160
|
if (!rel) return null;
|
|
25153
25161
|
const { attributes: relAttributes } = rel;
|
|
25154
25162
|
const targetPath = relAttributes["Target"];
|
|
25155
|
-
|
|
25156
|
-
|
|
25157
|
-
const extension = targetPath.substring(targetPath.lastIndexOf(".") + 1);
|
|
25163
|
+
const path = normalizeTargetPath(targetPath);
|
|
25164
|
+
const extension = path.substring(path.lastIndexOf(".") + 1);
|
|
25158
25165
|
return {
|
|
25159
25166
|
type: "image",
|
|
25160
25167
|
attrs: {
|
|
@@ -25172,8 +25179,8 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
25172
25179
|
transformData,
|
|
25173
25180
|
...useSimplePos && {
|
|
25174
25181
|
simplePos: {
|
|
25175
|
-
x: simplePosNode
|
|
25176
|
-
y: simplePosNode
|
|
25182
|
+
x: simplePosNode?.attributes?.x,
|
|
25183
|
+
y: simplePosNode?.attributes?.y
|
|
25177
25184
|
}
|
|
25178
25185
|
},
|
|
25179
25186
|
wrap: wrap2,
|
|
@@ -25183,12 +25190,12 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
25183
25190
|
wrapTopAndBottom: wrap2.type === "TopAndBottom",
|
|
25184
25191
|
shouldStretch,
|
|
25185
25192
|
originalPadding: {
|
|
25186
|
-
distT: attributes["distT"],
|
|
25187
|
-
distB: attributes["distB"],
|
|
25188
|
-
distL: attributes["distL"],
|
|
25189
|
-
distR: attributes["distR"]
|
|
25193
|
+
distT: attributes?.["distT"],
|
|
25194
|
+
distB: attributes?.["distB"],
|
|
25195
|
+
distL: attributes?.["distL"],
|
|
25196
|
+
distR: attributes?.["distR"]
|
|
25190
25197
|
},
|
|
25191
|
-
originalAttributes: node
|
|
25198
|
+
originalAttributes: node?.attributes || {},
|
|
25192
25199
|
rId: relAttributes["Id"]
|
|
25193
25200
|
}
|
|
25194
25201
|
};
|
|
@@ -25352,11 +25359,8 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
25352
25359
|
const { elements } = relationships || [];
|
|
25353
25360
|
const rel = elements?.find((el) => el.attributes["Id"] === rEmbed);
|
|
25354
25361
|
if (!rel) return null;
|
|
25355
|
-
const targetPath = rel.attributes?.["Target"];
|
|
25356
|
-
|
|
25357
|
-
if (targetPath.startsWith("/word") || targetPath.startsWith("/media")) {
|
|
25358
|
-
path = targetPath.substring(1);
|
|
25359
|
-
}
|
|
25362
|
+
const targetPath = normalizeTargetPath(rel.attributes?.["Target"]);
|
|
25363
|
+
const path = targetPath;
|
|
25360
25364
|
const nvPicPr = pic.elements?.find((el) => el.name === "pic:nvPicPr");
|
|
25361
25365
|
const cNvPr = nvPicPr?.elements?.find((el) => el.name === "pic:cNvPr");
|
|
25362
25366
|
const picId = cNvPr?.attributes?.["id"];
|
|
@@ -36652,7 +36656,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
36652
36656
|
static getStoredSuperdocVersion(docx) {
|
|
36653
36657
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
36654
36658
|
}
|
|
36655
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
36659
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.23") {
|
|
36656
36660
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
36657
36661
|
}
|
|
36658
36662
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-DJyfDFNm.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
|
}
|