@harbour-enterprises/superdoc 1.5.0-next.1 → 1.5.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-BtOpjOzf.es.js → PdfViewer-BWqysjFE.es.js} +2 -2
- package/dist/chunks/{PdfViewer-D4xjqAhh.cjs → PdfViewer-CkolHMrf.cjs} +2 -2
- package/dist/chunks/{SuperConverter-Qu0fAMVM.es.js → SuperConverter-9G1UwVBf.es.js} +77 -46
- package/dist/chunks/{SuperConverter-BVAV03p6.cjs → SuperConverter-B35ywdgG.cjs} +77 -46
- package/dist/chunks/{index-bCuBL6cv.cjs → index-BmEbRo6D.cjs} +4 -4
- package/dist/chunks/{index-D-E-6bRO.cjs → index-BxgDTX0H.cjs} +1860 -900
- package/dist/chunks/{index-XYOpuq3s.es.js → index-CebB-tdL.es.js} +4 -4
- package/dist/chunks/{index-BgKo9yMZ.es.js → index-CuBynP0z.es.js} +1978 -1018
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +1732 -741
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, c as computed, r as ref, f as onMounted, X as onUnmounted, E as createElementBlock, G as openBlock, K as createBaseVNode, M as createCommentVNode, I as createVNode, v as unref } from "./vue-BnBKJwCW.es.js";
|
|
2
|
-
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-
|
|
3
|
-
import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-
|
|
2
|
+
import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-CebB-tdL.es.js";
|
|
3
|
+
import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-CuBynP0z.es.js";
|
|
4
4
|
function self(vars) {
|
|
5
5
|
const {
|
|
6
6
|
opacityDisabled,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-De9wkgLl.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
5
|
-
const index = require("./index-
|
|
4
|
+
const superdoc = require("./index-BmEbRo6D.cjs");
|
|
5
|
+
const index = require("./index-BxgDTX0H.cjs");
|
|
6
6
|
function self(vars) {
|
|
7
7
|
const {
|
|
8
8
|
opacityDisabled,
|
|
@@ -13438,6 +13438,23 @@ function extractStrokeWidth(spPr) {
|
|
|
13438
13438
|
const STROKE_DPI = 72;
|
|
13439
13439
|
return emu * STROKE_DPI / 914400;
|
|
13440
13440
|
}
|
|
13441
|
+
function extractLineEnds(spPr) {
|
|
13442
|
+
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
13443
|
+
if (!ln?.elements) return null;
|
|
13444
|
+
const parseEnd = (name) => {
|
|
13445
|
+
const end = ln.elements.find((el) => el.name === name);
|
|
13446
|
+
if (!end?.attributes) return null;
|
|
13447
|
+
const type = end.attributes?.["type"];
|
|
13448
|
+
if (!type || type === "none") return null;
|
|
13449
|
+
const width = end.attributes?.["w"];
|
|
13450
|
+
const length = end.attributes?.["len"];
|
|
13451
|
+
return { type, width, length };
|
|
13452
|
+
};
|
|
13453
|
+
const head = parseEnd("a:headEnd");
|
|
13454
|
+
const tail = parseEnd("a:tailEnd");
|
|
13455
|
+
if (!head && !tail) return null;
|
|
13456
|
+
return { head: head ?? void 0, tail: tail ?? void 0 };
|
|
13457
|
+
}
|
|
13441
13458
|
function extractStrokeColor(spPr, style) {
|
|
13442
13459
|
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
13443
13460
|
if (ln) {
|
|
@@ -19041,6 +19058,28 @@ const normalizeTargetPath$1 = (targetPath = "") => {
|
|
|
19041
19058
|
};
|
|
19042
19059
|
const DEFAULT_SHAPE_WIDTH = 100;
|
|
19043
19060
|
const DEFAULT_SHAPE_HEIGHT = 100;
|
|
19061
|
+
const isDocPrHidden = (docPr) => {
|
|
19062
|
+
const hidden = docPr?.attributes?.hidden;
|
|
19063
|
+
if (hidden === true || hidden === 1) return true;
|
|
19064
|
+
if (hidden == null) return false;
|
|
19065
|
+
const normalized = String(hidden).toLowerCase();
|
|
19066
|
+
return normalized === "1" || normalized === "true";
|
|
19067
|
+
};
|
|
19068
|
+
const extractEffectExtent = (node) => {
|
|
19069
|
+
const effectExtent = node?.elements?.find((el) => el.name === "wp:effectExtent");
|
|
19070
|
+
if (!effectExtent?.attributes) return null;
|
|
19071
|
+
const sanitizeEmuValue = (value) => {
|
|
19072
|
+
if (value === null || value === void 0) return 0;
|
|
19073
|
+
const numeric = Number(value);
|
|
19074
|
+
return Number.isFinite(numeric) ? numeric : 0;
|
|
19075
|
+
};
|
|
19076
|
+
const left = emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["l"]));
|
|
19077
|
+
const top = emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["t"]));
|
|
19078
|
+
const right = emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["r"]));
|
|
19079
|
+
const bottom = emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["b"]));
|
|
19080
|
+
if (!left && !top && !right && !bottom) return null;
|
|
19081
|
+
return { left, top, right, bottom };
|
|
19082
|
+
};
|
|
19044
19083
|
function handleImageNode(node, params, isAnchor) {
|
|
19045
19084
|
if (!node) return null;
|
|
19046
19085
|
const { docx, filename, converter } = params;
|
|
@@ -19149,6 +19188,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19149
19188
|
break;
|
|
19150
19189
|
}
|
|
19151
19190
|
const docPr = node.elements.find((el) => el.name === "wp:docPr");
|
|
19191
|
+
const isHidden = isDocPrHidden(docPr);
|
|
19152
19192
|
let anchorData = null;
|
|
19153
19193
|
if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
|
|
19154
19194
|
anchorData = {
|
|
@@ -19170,7 +19210,18 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19170
19210
|
horizontal: positionHValue,
|
|
19171
19211
|
top: positionVValue
|
|
19172
19212
|
};
|
|
19173
|
-
return handleShapeDrawing(
|
|
19213
|
+
return handleShapeDrawing(
|
|
19214
|
+
params,
|
|
19215
|
+
node,
|
|
19216
|
+
graphicData,
|
|
19217
|
+
size,
|
|
19218
|
+
padding,
|
|
19219
|
+
shapeMarginOffset,
|
|
19220
|
+
anchorData,
|
|
19221
|
+
wrap2,
|
|
19222
|
+
isAnchor,
|
|
19223
|
+
isHidden
|
|
19224
|
+
);
|
|
19174
19225
|
}
|
|
19175
19226
|
if (uri === GROUP_URI) {
|
|
19176
19227
|
const shapeMarginOffset = {
|
|
@@ -19178,7 +19229,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19178
19229
|
horizontal: positionHValue,
|
|
19179
19230
|
top: positionVValue
|
|
19180
19231
|
};
|
|
19181
|
-
return handleShapeGroup(params, node, graphicData, size, padding, shapeMarginOffset, anchorData, wrap2);
|
|
19232
|
+
return handleShapeGroup(params, node, graphicData, size, padding, shapeMarginOffset, anchorData, wrap2, isHidden);
|
|
19182
19233
|
}
|
|
19183
19234
|
const picture = graphicData?.elements.find((el) => el.name === "pic:pic");
|
|
19184
19235
|
if (!picture || !picture.elements) {
|
|
@@ -19256,6 +19307,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19256
19307
|
...wasConverted && { originalSrc: path, originalExtension: extension },
|
|
19257
19308
|
id: docPr?.attributes?.id || "",
|
|
19258
19309
|
title: docPr?.attributes?.descr || "Image",
|
|
19310
|
+
...isHidden ? { hidden: true } : {},
|
|
19259
19311
|
inline: true,
|
|
19260
19312
|
// Always true; wrap.type controls actual layout behavior
|
|
19261
19313
|
padding,
|
|
@@ -19292,23 +19344,26 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19292
19344
|
attrs: nodeAttrs
|
|
19293
19345
|
};
|
|
19294
19346
|
}
|
|
19295
|
-
const handleShapeDrawing = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isAnchor) => {
|
|
19347
|
+
const handleShapeDrawing = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isAnchor, isHidden) => {
|
|
19296
19348
|
const wsp = graphicData.elements.find((el) => el.name === "wps:wsp");
|
|
19297
19349
|
const textBox = wsp.elements.find((el) => el.name === "wps:txbx");
|
|
19298
19350
|
const textBoxContent = textBox?.elements?.find((el) => el.name === "w:txbxContent");
|
|
19299
19351
|
const spPr = wsp.elements.find((el) => el.name === "wps:spPr");
|
|
19300
19352
|
const prstGeom = spPr?.elements.find((el) => el.name === "a:prstGeom");
|
|
19301
19353
|
const shapeType = prstGeom?.attributes["prst"];
|
|
19302
|
-
const hasGradientFill = spPr?.elements?.find((el) => el.name === "a:gradFill");
|
|
19303
|
-
if (shapeType === "rect" && !textBoxContent && !hasGradientFill) {
|
|
19304
|
-
return getRectangleShape(params, spPr, node, marginOffset, anchorData, wrap2, isAnchor);
|
|
19305
|
-
}
|
|
19306
19354
|
if (shapeType) {
|
|
19307
19355
|
const result = getVectorShape({ params, node, graphicData, size, marginOffset, anchorData, wrap: wrap2, isAnchor });
|
|
19356
|
+
if (result?.attrs && isHidden) {
|
|
19357
|
+
result.attrs.hidden = true;
|
|
19358
|
+
}
|
|
19308
19359
|
if (result) return result;
|
|
19309
19360
|
}
|
|
19310
19361
|
const fallbackType = textBoxContent ? "textbox" : "drawing";
|
|
19311
|
-
|
|
19362
|
+
const placeholder = buildShapePlaceholder(node, size, padding, marginOffset, fallbackType);
|
|
19363
|
+
if (placeholder?.attrs && isHidden) {
|
|
19364
|
+
placeholder.attrs.hidden = true;
|
|
19365
|
+
}
|
|
19366
|
+
return placeholder;
|
|
19312
19367
|
};
|
|
19313
19368
|
function collectPreservedDrawingChildren(node) {
|
|
19314
19369
|
const order = [];
|
|
@@ -19327,10 +19382,14 @@ function collectPreservedDrawingChildren(node) {
|
|
|
19327
19382
|
});
|
|
19328
19383
|
return { order, originalChildren: original };
|
|
19329
19384
|
}
|
|
19330
|
-
const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2) => {
|
|
19385
|
+
const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isHidden) => {
|
|
19331
19386
|
const wgp = graphicData.elements.find((el) => el.name === "wpg:wgp");
|
|
19332
19387
|
if (!wgp) {
|
|
19333
|
-
|
|
19388
|
+
const placeholder = buildShapePlaceholder(node, size, padding, marginOffset, "group");
|
|
19389
|
+
if (placeholder?.attrs && isHidden) {
|
|
19390
|
+
placeholder.attrs.hidden = true;
|
|
19391
|
+
}
|
|
19392
|
+
return placeholder;
|
|
19334
19393
|
}
|
|
19335
19394
|
const grpSpPr = wgp.elements.find((el) => el.name === "wpg:grpSpPr");
|
|
19336
19395
|
const xfrm = grpSpPr?.elements?.find((el) => el.name === "a:xfrm");
|
|
@@ -19396,6 +19455,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19396
19455
|
const fillColor = extractFillColor(spPr, style);
|
|
19397
19456
|
const strokeColor = extractStrokeColor(spPr, style);
|
|
19398
19457
|
const strokeWidth = extractStrokeWidth(spPr);
|
|
19458
|
+
const lineEnds = extractLineEnds(spPr);
|
|
19399
19459
|
const cNvPr = wsp.elements?.find((el) => el.name === "wps:cNvPr");
|
|
19400
19460
|
const shapeId = cNvPr?.attributes?.["id"];
|
|
19401
19461
|
const shapeName = cNvPr?.attributes?.["name"];
|
|
@@ -19421,6 +19481,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19421
19481
|
fillColor,
|
|
19422
19482
|
strokeColor,
|
|
19423
19483
|
strokeWidth,
|
|
19484
|
+
lineEnds,
|
|
19424
19485
|
shapeId,
|
|
19425
19486
|
shapeName,
|
|
19426
19487
|
textContent,
|
|
@@ -19497,6 +19558,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19497
19558
|
type: "shapeGroup",
|
|
19498
19559
|
attrs: {
|
|
19499
19560
|
...schemaAttrs,
|
|
19561
|
+
...isHidden ? { hidden: true } : {},
|
|
19500
19562
|
groupTransform,
|
|
19501
19563
|
shapes: allShapes,
|
|
19502
19564
|
size,
|
|
@@ -19596,41 +19658,6 @@ function extractTextFromTextBox(textBoxContent, bodyPr) {
|
|
|
19596
19658
|
wrap: wrap2
|
|
19597
19659
|
};
|
|
19598
19660
|
}
|
|
19599
|
-
const getRectangleShape = (params, spPr, node, marginOffset, anchorData, wrap2, isAnchor) => {
|
|
19600
|
-
const schemaAttrs = {};
|
|
19601
|
-
const drawingNode = params.nodes?.[0];
|
|
19602
|
-
if (drawingNode?.name === DRAWING_XML_TAG) {
|
|
19603
|
-
schemaAttrs.drawingContent = drawingNode;
|
|
19604
|
-
}
|
|
19605
|
-
const xfrm = spPr?.elements?.find((el) => el.name === "a:xfrm");
|
|
19606
|
-
const start = xfrm?.elements?.find((el) => el.name === "a:off");
|
|
19607
|
-
const size = xfrm?.elements?.find((el) => el.name === "a:ext");
|
|
19608
|
-
const solidFill = spPr?.elements?.find((el) => el.name === "a:solidFill");
|
|
19609
|
-
if (start && size) {
|
|
19610
|
-
const rectangleSize = {
|
|
19611
|
-
top: emuToPixels(start.attributes?.["y"] || 0),
|
|
19612
|
-
left: emuToPixels(start.attributes?.["x"] || 0),
|
|
19613
|
-
width: emuToPixels(size.attributes?.["cx"] || 0),
|
|
19614
|
-
height: emuToPixels(size.attributes?.["cy"] || 0)
|
|
19615
|
-
};
|
|
19616
|
-
schemaAttrs.size = rectangleSize;
|
|
19617
|
-
}
|
|
19618
|
-
const background = solidFill?.elements[0]?.attributes["val"];
|
|
19619
|
-
if (background) {
|
|
19620
|
-
schemaAttrs.background = "#" + background;
|
|
19621
|
-
}
|
|
19622
|
-
return {
|
|
19623
|
-
type: "contentBlock",
|
|
19624
|
-
attrs: {
|
|
19625
|
-
...schemaAttrs,
|
|
19626
|
-
marginOffset,
|
|
19627
|
-
anchorData,
|
|
19628
|
-
wrap: wrap2,
|
|
19629
|
-
isAnchor,
|
|
19630
|
-
originalAttributes: node?.attributes
|
|
19631
|
-
}
|
|
19632
|
-
};
|
|
19633
|
-
};
|
|
19634
19661
|
const buildShapePlaceholder = (node, size, padding, marginOffset, shapeType) => {
|
|
19635
19662
|
const attrs = {
|
|
19636
19663
|
drawingContent: {
|
|
@@ -19707,6 +19734,8 @@ function getVectorShape({ params, node, graphicData, size, marginOffset, anchorD
|
|
|
19707
19734
|
const fillColor = extractFillColor(spPr, style);
|
|
19708
19735
|
const strokeColor = extractStrokeColor(spPr, style);
|
|
19709
19736
|
const strokeWidth = extractStrokeWidth(spPr);
|
|
19737
|
+
const lineEnds = extractLineEnds(spPr);
|
|
19738
|
+
const effectExtent = extractEffectExtent(node);
|
|
19710
19739
|
const textBox = wsp.elements?.find((el) => el.name === "wps:txbx");
|
|
19711
19740
|
const textBoxContent = textBox?.elements?.find((el) => el.name === "w:txbxContent");
|
|
19712
19741
|
const bodyPr = wsp.elements?.find((el) => el.name === "wps:bodyPr");
|
|
@@ -19728,6 +19757,8 @@ function getVectorShape({ params, node, graphicData, size, marginOffset, anchorD
|
|
|
19728
19757
|
fillColor,
|
|
19729
19758
|
strokeColor,
|
|
19730
19759
|
strokeWidth,
|
|
19760
|
+
lineEnds,
|
|
19761
|
+
effectExtent,
|
|
19731
19762
|
marginOffset,
|
|
19732
19763
|
anchorData,
|
|
19733
19764
|
wrap: wrap2,
|
|
@@ -31533,7 +31564,7 @@ class SuperConverter {
|
|
|
31533
31564
|
static getStoredSuperdocVersion(docx) {
|
|
31534
31565
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
31535
31566
|
}
|
|
31536
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.5.0-next.
|
|
31567
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.5.0-next.3") {
|
|
31537
31568
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
31538
31569
|
}
|
|
31539
31570
|
/**
|
|
@@ -13439,6 +13439,23 @@ function extractStrokeWidth(spPr) {
|
|
|
13439
13439
|
const STROKE_DPI = 72;
|
|
13440
13440
|
return emu * STROKE_DPI / 914400;
|
|
13441
13441
|
}
|
|
13442
|
+
function extractLineEnds(spPr) {
|
|
13443
|
+
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
13444
|
+
if (!ln?.elements) return null;
|
|
13445
|
+
const parseEnd = (name) => {
|
|
13446
|
+
const end = ln.elements.find((el) => el.name === name);
|
|
13447
|
+
if (!end?.attributes) return null;
|
|
13448
|
+
const type = end.attributes?.["type"];
|
|
13449
|
+
if (!type || type === "none") return null;
|
|
13450
|
+
const width = end.attributes?.["w"];
|
|
13451
|
+
const length = end.attributes?.["len"];
|
|
13452
|
+
return { type, width, length };
|
|
13453
|
+
};
|
|
13454
|
+
const head = parseEnd("a:headEnd");
|
|
13455
|
+
const tail = parseEnd("a:tailEnd");
|
|
13456
|
+
if (!head && !tail) return null;
|
|
13457
|
+
return { head: head ?? void 0, tail: tail ?? void 0 };
|
|
13458
|
+
}
|
|
13442
13459
|
function extractStrokeColor(spPr, style) {
|
|
13443
13460
|
const ln = spPr?.elements?.find((el) => el.name === "a:ln");
|
|
13444
13461
|
if (ln) {
|
|
@@ -19042,6 +19059,28 @@ const normalizeTargetPath$1 = (targetPath = "") => {
|
|
|
19042
19059
|
};
|
|
19043
19060
|
const DEFAULT_SHAPE_WIDTH = 100;
|
|
19044
19061
|
const DEFAULT_SHAPE_HEIGHT = 100;
|
|
19062
|
+
const isDocPrHidden = (docPr) => {
|
|
19063
|
+
const hidden = docPr?.attributes?.hidden;
|
|
19064
|
+
if (hidden === true || hidden === 1) return true;
|
|
19065
|
+
if (hidden == null) return false;
|
|
19066
|
+
const normalized = String(hidden).toLowerCase();
|
|
19067
|
+
return normalized === "1" || normalized === "true";
|
|
19068
|
+
};
|
|
19069
|
+
const extractEffectExtent = (node) => {
|
|
19070
|
+
const effectExtent = node?.elements?.find((el) => el.name === "wp:effectExtent");
|
|
19071
|
+
if (!effectExtent?.attributes) return null;
|
|
19072
|
+
const sanitizeEmuValue = (value) => {
|
|
19073
|
+
if (value === null || value === void 0) return 0;
|
|
19074
|
+
const numeric = Number(value);
|
|
19075
|
+
return Number.isFinite(numeric) ? numeric : 0;
|
|
19076
|
+
};
|
|
19077
|
+
const left = helpers.emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["l"]));
|
|
19078
|
+
const top = helpers.emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["t"]));
|
|
19079
|
+
const right = helpers.emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["r"]));
|
|
19080
|
+
const bottom = helpers.emuToPixels(sanitizeEmuValue(effectExtent.attributes?.["b"]));
|
|
19081
|
+
if (!left && !top && !right && !bottom) return null;
|
|
19082
|
+
return { left, top, right, bottom };
|
|
19083
|
+
};
|
|
19045
19084
|
function handleImageNode(node, params, isAnchor) {
|
|
19046
19085
|
if (!node) return null;
|
|
19047
19086
|
const { docx, filename, converter } = params;
|
|
@@ -19150,6 +19189,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19150
19189
|
break;
|
|
19151
19190
|
}
|
|
19152
19191
|
const docPr = node.elements.find((el) => el.name === "wp:docPr");
|
|
19192
|
+
const isHidden = isDocPrHidden(docPr);
|
|
19153
19193
|
let anchorData = null;
|
|
19154
19194
|
if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
|
|
19155
19195
|
anchorData = {
|
|
@@ -19171,7 +19211,18 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19171
19211
|
horizontal: positionHValue,
|
|
19172
19212
|
top: positionVValue
|
|
19173
19213
|
};
|
|
19174
|
-
return handleShapeDrawing(
|
|
19214
|
+
return handleShapeDrawing(
|
|
19215
|
+
params,
|
|
19216
|
+
node,
|
|
19217
|
+
graphicData,
|
|
19218
|
+
size,
|
|
19219
|
+
padding,
|
|
19220
|
+
shapeMarginOffset,
|
|
19221
|
+
anchorData,
|
|
19222
|
+
wrap2,
|
|
19223
|
+
isAnchor,
|
|
19224
|
+
isHidden
|
|
19225
|
+
);
|
|
19175
19226
|
}
|
|
19176
19227
|
if (uri === GROUP_URI) {
|
|
19177
19228
|
const shapeMarginOffset = {
|
|
@@ -19179,7 +19230,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19179
19230
|
horizontal: positionHValue,
|
|
19180
19231
|
top: positionVValue
|
|
19181
19232
|
};
|
|
19182
|
-
return handleShapeGroup(params, node, graphicData, size, padding, shapeMarginOffset, anchorData, wrap2);
|
|
19233
|
+
return handleShapeGroup(params, node, graphicData, size, padding, shapeMarginOffset, anchorData, wrap2, isHidden);
|
|
19183
19234
|
}
|
|
19184
19235
|
const picture = graphicData?.elements.find((el) => el.name === "pic:pic");
|
|
19185
19236
|
if (!picture || !picture.elements) {
|
|
@@ -19257,6 +19308,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19257
19308
|
...wasConverted && { originalSrc: path, originalExtension: extension },
|
|
19258
19309
|
id: docPr?.attributes?.id || "",
|
|
19259
19310
|
title: docPr?.attributes?.descr || "Image",
|
|
19311
|
+
...isHidden ? { hidden: true } : {},
|
|
19260
19312
|
inline: true,
|
|
19261
19313
|
// Always true; wrap.type controls actual layout behavior
|
|
19262
19314
|
padding,
|
|
@@ -19293,23 +19345,26 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
19293
19345
|
attrs: nodeAttrs
|
|
19294
19346
|
};
|
|
19295
19347
|
}
|
|
19296
|
-
const handleShapeDrawing = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isAnchor) => {
|
|
19348
|
+
const handleShapeDrawing = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isAnchor, isHidden) => {
|
|
19297
19349
|
const wsp = graphicData.elements.find((el) => el.name === "wps:wsp");
|
|
19298
19350
|
const textBox = wsp.elements.find((el) => el.name === "wps:txbx");
|
|
19299
19351
|
const textBoxContent = textBox?.elements?.find((el) => el.name === "w:txbxContent");
|
|
19300
19352
|
const spPr = wsp.elements.find((el) => el.name === "wps:spPr");
|
|
19301
19353
|
const prstGeom = spPr?.elements.find((el) => el.name === "a:prstGeom");
|
|
19302
19354
|
const shapeType = prstGeom?.attributes["prst"];
|
|
19303
|
-
const hasGradientFill = spPr?.elements?.find((el) => el.name === "a:gradFill");
|
|
19304
|
-
if (shapeType === "rect" && !textBoxContent && !hasGradientFill) {
|
|
19305
|
-
return getRectangleShape(params, spPr, node, marginOffset, anchorData, wrap2, isAnchor);
|
|
19306
|
-
}
|
|
19307
19355
|
if (shapeType) {
|
|
19308
19356
|
const result = getVectorShape({ params, node, graphicData, size, marginOffset, anchorData, wrap: wrap2, isAnchor });
|
|
19357
|
+
if (result?.attrs && isHidden) {
|
|
19358
|
+
result.attrs.hidden = true;
|
|
19359
|
+
}
|
|
19309
19360
|
if (result) return result;
|
|
19310
19361
|
}
|
|
19311
19362
|
const fallbackType = textBoxContent ? "textbox" : "drawing";
|
|
19312
|
-
|
|
19363
|
+
const placeholder = buildShapePlaceholder(node, size, padding, marginOffset, fallbackType);
|
|
19364
|
+
if (placeholder?.attrs && isHidden) {
|
|
19365
|
+
placeholder.attrs.hidden = true;
|
|
19366
|
+
}
|
|
19367
|
+
return placeholder;
|
|
19313
19368
|
};
|
|
19314
19369
|
function collectPreservedDrawingChildren(node) {
|
|
19315
19370
|
const order = [];
|
|
@@ -19328,10 +19383,14 @@ function collectPreservedDrawingChildren(node) {
|
|
|
19328
19383
|
});
|
|
19329
19384
|
return { order, originalChildren: original };
|
|
19330
19385
|
}
|
|
19331
|
-
const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2) => {
|
|
19386
|
+
const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset, anchorData, wrap2, isHidden) => {
|
|
19332
19387
|
const wgp = graphicData.elements.find((el) => el.name === "wpg:wgp");
|
|
19333
19388
|
if (!wgp) {
|
|
19334
|
-
|
|
19389
|
+
const placeholder = buildShapePlaceholder(node, size, padding, marginOffset, "group");
|
|
19390
|
+
if (placeholder?.attrs && isHidden) {
|
|
19391
|
+
placeholder.attrs.hidden = true;
|
|
19392
|
+
}
|
|
19393
|
+
return placeholder;
|
|
19335
19394
|
}
|
|
19336
19395
|
const grpSpPr = wgp.elements.find((el) => el.name === "wpg:grpSpPr");
|
|
19337
19396
|
const xfrm = grpSpPr?.elements?.find((el) => el.name === "a:xfrm");
|
|
@@ -19397,6 +19456,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19397
19456
|
const fillColor = extractFillColor(spPr, style);
|
|
19398
19457
|
const strokeColor = extractStrokeColor(spPr, style);
|
|
19399
19458
|
const strokeWidth = extractStrokeWidth(spPr);
|
|
19459
|
+
const lineEnds = extractLineEnds(spPr);
|
|
19400
19460
|
const cNvPr = wsp.elements?.find((el) => el.name === "wps:cNvPr");
|
|
19401
19461
|
const shapeId = cNvPr?.attributes?.["id"];
|
|
19402
19462
|
const shapeName = cNvPr?.attributes?.["name"];
|
|
@@ -19422,6 +19482,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19422
19482
|
fillColor,
|
|
19423
19483
|
strokeColor,
|
|
19424
19484
|
strokeWidth,
|
|
19485
|
+
lineEnds,
|
|
19425
19486
|
shapeId,
|
|
19426
19487
|
shapeName,
|
|
19427
19488
|
textContent,
|
|
@@ -19498,6 +19559,7 @@ const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset
|
|
|
19498
19559
|
type: "shapeGroup",
|
|
19499
19560
|
attrs: {
|
|
19500
19561
|
...schemaAttrs,
|
|
19562
|
+
...isHidden ? { hidden: true } : {},
|
|
19501
19563
|
groupTransform,
|
|
19502
19564
|
shapes: allShapes,
|
|
19503
19565
|
size,
|
|
@@ -19597,41 +19659,6 @@ function extractTextFromTextBox(textBoxContent, bodyPr) {
|
|
|
19597
19659
|
wrap: wrap2
|
|
19598
19660
|
};
|
|
19599
19661
|
}
|
|
19600
|
-
const getRectangleShape = (params, spPr, node, marginOffset, anchorData, wrap2, isAnchor) => {
|
|
19601
|
-
const schemaAttrs = {};
|
|
19602
|
-
const drawingNode = params.nodes?.[0];
|
|
19603
|
-
if (drawingNode?.name === DRAWING_XML_TAG) {
|
|
19604
|
-
schemaAttrs.drawingContent = drawingNode;
|
|
19605
|
-
}
|
|
19606
|
-
const xfrm = spPr?.elements?.find((el) => el.name === "a:xfrm");
|
|
19607
|
-
const start = xfrm?.elements?.find((el) => el.name === "a:off");
|
|
19608
|
-
const size = xfrm?.elements?.find((el) => el.name === "a:ext");
|
|
19609
|
-
const solidFill = spPr?.elements?.find((el) => el.name === "a:solidFill");
|
|
19610
|
-
if (start && size) {
|
|
19611
|
-
const rectangleSize = {
|
|
19612
|
-
top: helpers.emuToPixels(start.attributes?.["y"] || 0),
|
|
19613
|
-
left: helpers.emuToPixels(start.attributes?.["x"] || 0),
|
|
19614
|
-
width: helpers.emuToPixels(size.attributes?.["cx"] || 0),
|
|
19615
|
-
height: helpers.emuToPixels(size.attributes?.["cy"] || 0)
|
|
19616
|
-
};
|
|
19617
|
-
schemaAttrs.size = rectangleSize;
|
|
19618
|
-
}
|
|
19619
|
-
const background = solidFill?.elements[0]?.attributes["val"];
|
|
19620
|
-
if (background) {
|
|
19621
|
-
schemaAttrs.background = "#" + background;
|
|
19622
|
-
}
|
|
19623
|
-
return {
|
|
19624
|
-
type: "contentBlock",
|
|
19625
|
-
attrs: {
|
|
19626
|
-
...schemaAttrs,
|
|
19627
|
-
marginOffset,
|
|
19628
|
-
anchorData,
|
|
19629
|
-
wrap: wrap2,
|
|
19630
|
-
isAnchor,
|
|
19631
|
-
originalAttributes: node?.attributes
|
|
19632
|
-
}
|
|
19633
|
-
};
|
|
19634
|
-
};
|
|
19635
19662
|
const buildShapePlaceholder = (node, size, padding, marginOffset, shapeType) => {
|
|
19636
19663
|
const attrs = {
|
|
19637
19664
|
drawingContent: {
|
|
@@ -19708,6 +19735,8 @@ function getVectorShape({ params, node, graphicData, size, marginOffset, anchorD
|
|
|
19708
19735
|
const fillColor = extractFillColor(spPr, style);
|
|
19709
19736
|
const strokeColor = extractStrokeColor(spPr, style);
|
|
19710
19737
|
const strokeWidth = extractStrokeWidth(spPr);
|
|
19738
|
+
const lineEnds = extractLineEnds(spPr);
|
|
19739
|
+
const effectExtent = extractEffectExtent(node);
|
|
19711
19740
|
const textBox = wsp.elements?.find((el) => el.name === "wps:txbx");
|
|
19712
19741
|
const textBoxContent = textBox?.elements?.find((el) => el.name === "w:txbxContent");
|
|
19713
19742
|
const bodyPr = wsp.elements?.find((el) => el.name === "wps:bodyPr");
|
|
@@ -19729,6 +19758,8 @@ function getVectorShape({ params, node, graphicData, size, marginOffset, anchorD
|
|
|
19729
19758
|
fillColor,
|
|
19730
19759
|
strokeColor,
|
|
19731
19760
|
strokeWidth,
|
|
19761
|
+
lineEnds,
|
|
19762
|
+
effectExtent,
|
|
19732
19763
|
marginOffset,
|
|
19733
19764
|
anchorData,
|
|
19734
19765
|
wrap: wrap2,
|
|
@@ -31534,7 +31565,7 @@ class SuperConverter {
|
|
|
31534
31565
|
static getStoredSuperdocVersion(docx) {
|
|
31535
31566
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
31536
31567
|
}
|
|
31537
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.5.0-next.
|
|
31568
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.5.0-next.3") {
|
|
31538
31569
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
31539
31570
|
}
|
|
31540
31571
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const index = require("./index-
|
|
3
|
-
require("./SuperConverter-
|
|
2
|
+
const index = require("./index-BxgDTX0H.cjs");
|
|
3
|
+
require("./SuperConverter-B35ywdgG.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
|
|
6
6
|
const provider = require("@hocuspocus/provider");
|
|
@@ -7530,7 +7530,7 @@ const _sfc_main = {
|
|
|
7530
7530
|
__name: "SuperDoc",
|
|
7531
7531
|
emits: ["selection-update"],
|
|
7532
7532
|
setup(__props, { emit: __emit }) {
|
|
7533
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
7533
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CkolHMrf.cjs")));
|
|
7534
7534
|
const superdocStore = useSuperdocStore();
|
|
7535
7535
|
const commentsStore = useCommentsStore();
|
|
7536
7536
|
const {
|
|
@@ -8484,7 +8484,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
|
|
|
8484
8484
|
this.config.colors = shuffleArray(this.config.colors);
|
|
8485
8485
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
8486
8486
|
this.colorIndex = 0;
|
|
8487
|
-
this.version = "1.5.0-next.
|
|
8487
|
+
this.version = "1.5.0-next.3";
|
|
8488
8488
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
8489
8489
|
this.superdocId = config.superdocId || uuid.v4();
|
|
8490
8490
|
this.colors = this.config.colors;
|