@harbour-enterprises/superdoc 1.0.0-next.6 → 1.0.0-next.7
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-BYeEi4Kx.es.js → PdfViewer-CCU0Mzny.es.js} +1 -1
- package/dist/chunks/{PdfViewer-CF4W_li8.cjs → PdfViewer-Ca1KqMaU.cjs} +1 -1
- package/dist/chunks/{index-BcHbK1Ip.cjs → index-DfbOKJbz.cjs} +3 -3
- package/dist/chunks/{index-CKb2zoi7-aboErZCf.es.js → index-IZySkMqb-BRW0f_kL.es.js} +1 -1
- package/dist/chunks/{index-CKb2zoi7-BEMsbmpK.cjs → index-IZySkMqb-OvIaFsnt.cjs} +1 -1
- package/dist/chunks/{index-CocFivpQ.es.js → index-q8FicN0U.es.js} +3 -3
- package/dist/chunks/{super-editor.es-C7JZxENm.es.js → super-editor.es--rLTKCxc.es.js} +330 -252
- package/dist/chunks/{super-editor.es-TXxmZOAu.cjs → super-editor.es-D_13cWx3.cjs} +330 -252
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CyZvCMe8.js → converter-BUHD74_1.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-DPV5rnMJ.js → docx-zipper-CtdkK288.js} +1 -1
- package/dist/super-editor/chunks/{editor-uiCiCr8n.js → editor-BV718qjr.js} +331 -253
- package/dist/super-editor/chunks/{index-CKb2zoi7.js → index-IZySkMqb.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Icc3CdW0.js → toolbar-CnlEeYqx.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 +332 -254
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -42428,7 +42428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
42428
42428
|
static getStoredSuperdocVersion(docx) {
|
|
42429
42429
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42430
42430
|
}
|
|
42431
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.
|
|
42431
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.7") {
|
|
42432
42432
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42433
42433
|
}
|
|
42434
42434
|
/**
|
|
@@ -62681,11 +62681,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
62681
62681
|
const selectAll = () => ({ state: state2, dispatch }) => selectAll$1(state2, dispatch);
|
|
62682
62682
|
const deleteSelection = () => ({ state: state2, tr, dispatch }) => {
|
|
62683
62683
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
62684
|
-
if (
|
|
62684
|
+
if (document && document.getSelection) {
|
|
62685
62685
|
const currentDomSelection = document.getSelection();
|
|
62686
|
-
|
|
62687
|
-
const isCollapsed = currentDomSelection?.isCollapsed;
|
|
62688
|
-
if (!isCollapsed && selectedLength === 1) {
|
|
62686
|
+
if (currentDomSelection?.baseNode?.data?.length == 1) {
|
|
62689
62687
|
return false;
|
|
62690
62688
|
}
|
|
62691
62689
|
}
|
|
@@ -67513,7 +67511,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67513
67511
|
const shouldSkipNodeView = (editor) => {
|
|
67514
67512
|
return isHeadless(editor);
|
|
67515
67513
|
};
|
|
67516
|
-
const summaryVersion = "1.0.0-next.
|
|
67514
|
+
const summaryVersion = "1.0.0-next.7";
|
|
67517
67515
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
67518
67516
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
67519
67517
|
function mapAttributes(attrs) {
|
|
@@ -68302,7 +68300,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68302
68300
|
{ default: remarkStringify2 },
|
|
68303
68301
|
{ default: remarkGfm2 }
|
|
68304
68302
|
] = await Promise.all([
|
|
68305
|
-
Promise.resolve().then(() =>
|
|
68303
|
+
Promise.resolve().then(() => indexIZySkMqb),
|
|
68306
68304
|
Promise.resolve().then(() => indexDRCvimau),
|
|
68307
68305
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
68308
68306
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -68507,7 +68505,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68507
68505
|
* Process collaboration migrations
|
|
68508
68506
|
*/
|
|
68509
68507
|
processCollaborationMigrations() {
|
|
68510
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.
|
|
68508
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.7");
|
|
68511
68509
|
if (!this.options.ydoc) return;
|
|
68512
68510
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
68513
68511
|
let docVersion = metaMap.get("version");
|
|
@@ -75869,6 +75867,271 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
75869
75867
|
}
|
|
75870
75868
|
}
|
|
75871
75869
|
}
|
|
75870
|
+
const WRAP_TYPES$1 = /* @__PURE__ */ new Set(["None", "Square", "Tight", "Through", "TopAndBottom", "Inline"]);
|
|
75871
|
+
const WRAP_TEXT_VALUES$1 = /* @__PURE__ */ new Set(["bothSides", "left", "right", "largest"]);
|
|
75872
|
+
const H_RELATIVE_VALUES$1 = /* @__PURE__ */ new Set(["column", "page", "margin"]);
|
|
75873
|
+
const V_RELATIVE_VALUES$1 = /* @__PURE__ */ new Set(["paragraph", "page", "margin"]);
|
|
75874
|
+
const H_ALIGN_VALUES$1 = /* @__PURE__ */ new Set(["left", "center", "right"]);
|
|
75875
|
+
const V_ALIGN_VALUES$1 = /* @__PURE__ */ new Set(["top", "center", "bottom"]);
|
|
75876
|
+
const getAttrs$1 = (node2) => {
|
|
75877
|
+
return isPlainObject$2$1(node2.attrs) ? node2.attrs : {};
|
|
75878
|
+
};
|
|
75879
|
+
const normalizeWrapType$1 = (value) => {
|
|
75880
|
+
if (typeof value !== "string") return void 0;
|
|
75881
|
+
return WRAP_TYPES$1.has(value) ? value : void 0;
|
|
75882
|
+
};
|
|
75883
|
+
const normalizeWrapText$1 = (value) => {
|
|
75884
|
+
if (typeof value !== "string") return void 0;
|
|
75885
|
+
return WRAP_TEXT_VALUES$1.has(value) ? value : void 0;
|
|
75886
|
+
};
|
|
75887
|
+
const normalizePolygon$1 = (value) => {
|
|
75888
|
+
if (!Array.isArray(value)) return void 0;
|
|
75889
|
+
const polygon = [];
|
|
75890
|
+
value.forEach((point2) => {
|
|
75891
|
+
if (!Array.isArray(point2) || point2.length < 2) return;
|
|
75892
|
+
const x2 = pickNumber(point2[0]);
|
|
75893
|
+
const y2 = pickNumber(point2[1]);
|
|
75894
|
+
if (x2 == null || y2 == null) return;
|
|
75895
|
+
polygon.push([x2, y2]);
|
|
75896
|
+
});
|
|
75897
|
+
return polygon.length > 0 ? polygon : void 0;
|
|
75898
|
+
};
|
|
75899
|
+
const normalizeWrap$2 = (value) => {
|
|
75900
|
+
if (!isPlainObject$2$1(value)) {
|
|
75901
|
+
return void 0;
|
|
75902
|
+
}
|
|
75903
|
+
const type2 = normalizeWrapType$1(value.type);
|
|
75904
|
+
if (!type2 || type2 === "Inline") {
|
|
75905
|
+
return void 0;
|
|
75906
|
+
}
|
|
75907
|
+
const wrap2 = { type: type2 };
|
|
75908
|
+
const attrs = isPlainObject$2$1(value.attrs) ? value.attrs : {};
|
|
75909
|
+
const wrapText = normalizeWrapText$1(attrs.wrapText);
|
|
75910
|
+
if (wrapText) {
|
|
75911
|
+
wrap2.wrapText = wrapText;
|
|
75912
|
+
}
|
|
75913
|
+
const distTop = pickNumber(attrs.distTop ?? attrs.distT);
|
|
75914
|
+
if (distTop != null) wrap2.distTop = distTop;
|
|
75915
|
+
const distBottom = pickNumber(attrs.distBottom ?? attrs.distB);
|
|
75916
|
+
if (distBottom != null) wrap2.distBottom = distBottom;
|
|
75917
|
+
const distLeft = pickNumber(attrs.distLeft ?? attrs.distL);
|
|
75918
|
+
if (distLeft != null) wrap2.distLeft = distLeft;
|
|
75919
|
+
const distRight = pickNumber(attrs.distRight ?? attrs.distR);
|
|
75920
|
+
if (distRight != null) wrap2.distRight = distRight;
|
|
75921
|
+
const polygon = normalizePolygon$1(attrs.polygon);
|
|
75922
|
+
if (polygon) {
|
|
75923
|
+
wrap2.polygon = polygon;
|
|
75924
|
+
}
|
|
75925
|
+
const behindDoc = toBoolean$3(attrs.behindDoc);
|
|
75926
|
+
if (behindDoc != null) {
|
|
75927
|
+
wrap2.behindDoc = behindDoc;
|
|
75928
|
+
}
|
|
75929
|
+
return wrap2;
|
|
75930
|
+
};
|
|
75931
|
+
const normalizeAnchorRelative$1 = (value, allowed) => {
|
|
75932
|
+
if (typeof value !== "string") return void 0;
|
|
75933
|
+
return allowed.has(value) ? value : void 0;
|
|
75934
|
+
};
|
|
75935
|
+
const normalizeAnchorAlign$1 = (value, allowed) => {
|
|
75936
|
+
if (typeof value !== "string") return void 0;
|
|
75937
|
+
return allowed.has(value) ? value : void 0;
|
|
75938
|
+
};
|
|
75939
|
+
const normalizeAnchorData$1 = (value, attrs, wrapBehindDoc) => {
|
|
75940
|
+
const raw = isPlainObject$2$1(value) ? value : void 0;
|
|
75941
|
+
const marginOffset = isPlainObject$2$1(attrs.marginOffset) ? attrs.marginOffset : void 0;
|
|
75942
|
+
const simplePos = isPlainObject$2$1(attrs.simplePos) ? attrs.simplePos : void 0;
|
|
75943
|
+
const originalAttrs = isPlainObject$2$1(attrs.originalAttributes) ? attrs.originalAttributes : void 0;
|
|
75944
|
+
const isAnchored = attrs.isAnchor === true || Boolean(raw);
|
|
75945
|
+
const anchor = {};
|
|
75946
|
+
if (isAnchored) {
|
|
75947
|
+
anchor.isAnchored = true;
|
|
75948
|
+
}
|
|
75949
|
+
const hRelative = normalizeAnchorRelative$1(raw?.hRelativeFrom, H_RELATIVE_VALUES$1);
|
|
75950
|
+
if (hRelative) anchor.hRelativeFrom = hRelative;
|
|
75951
|
+
const vRelative = normalizeAnchorRelative$1(raw?.vRelativeFrom, V_RELATIVE_VALUES$1);
|
|
75952
|
+
if (vRelative) anchor.vRelativeFrom = vRelative;
|
|
75953
|
+
const alignH = normalizeAnchorAlign$1(raw?.alignH, H_ALIGN_VALUES$1);
|
|
75954
|
+
if (alignH) anchor.alignH = alignH;
|
|
75955
|
+
const alignV = normalizeAnchorAlign$1(raw?.alignV, V_ALIGN_VALUES$1);
|
|
75956
|
+
if (alignV) anchor.alignV = alignV;
|
|
75957
|
+
const offsetH = pickNumber(marginOffset?.horizontal ?? marginOffset?.left ?? raw?.offsetH ?? simplePos?.x);
|
|
75958
|
+
if (offsetH != null) anchor.offsetH = offsetH;
|
|
75959
|
+
const offsetV = pickNumber(marginOffset?.top ?? marginOffset?.vertical ?? raw?.offsetV ?? simplePos?.y);
|
|
75960
|
+
if (offsetV != null) anchor.offsetV = offsetV;
|
|
75961
|
+
const behindDoc = toBoolean$3(raw?.behindDoc ?? wrapBehindDoc ?? originalAttrs?.behindDoc);
|
|
75962
|
+
if (behindDoc != null) anchor.behindDoc = behindDoc;
|
|
75963
|
+
const hasData = anchor.isAnchored || anchor.hRelativeFrom != null || anchor.vRelativeFrom != null || anchor.alignH != null || anchor.alignV != null || anchor.offsetH != null || anchor.offsetV != null || anchor.behindDoc != null;
|
|
75964
|
+
return hasData ? anchor : void 0;
|
|
75965
|
+
};
|
|
75966
|
+
const buildDrawingBlock = (rawAttrs, nextBlockId, positions, node2, geometry, drawingKind, extraProps) => {
|
|
75967
|
+
const normalizedWrap = normalizeWrap$2(rawAttrs.wrap);
|
|
75968
|
+
const baseAnchor = normalizeAnchorData$1(rawAttrs.anchorData, rawAttrs, normalizedWrap?.behindDoc);
|
|
75969
|
+
const pos = positions.get(node2);
|
|
75970
|
+
const attrsWithPm = { ...rawAttrs };
|
|
75971
|
+
if (pos) {
|
|
75972
|
+
attrsWithPm.pmStart = pos.start;
|
|
75973
|
+
attrsWithPm.pmEnd = pos.end;
|
|
75974
|
+
}
|
|
75975
|
+
const zIndexFromRelativeHeight = normalizeZIndex(rawAttrs.originalAttributes);
|
|
75976
|
+
const finalZIndex = zIndexFromRelativeHeight ?? coerceNumber(rawAttrs.zIndex);
|
|
75977
|
+
return {
|
|
75978
|
+
kind: "drawing",
|
|
75979
|
+
id: nextBlockId("drawing"),
|
|
75980
|
+
drawingKind,
|
|
75981
|
+
padding: toBoxSpacing$1(rawAttrs.padding),
|
|
75982
|
+
margin: toBoxSpacing$1(rawAttrs.marginOffset) ?? toBoxSpacing$1(rawAttrs.margin),
|
|
75983
|
+
anchor: baseAnchor,
|
|
75984
|
+
wrap: normalizedWrap,
|
|
75985
|
+
zIndex: finalZIndex,
|
|
75986
|
+
drawingContentId: typeof rawAttrs.drawingContentId === "string" ? rawAttrs.drawingContentId : void 0,
|
|
75987
|
+
drawingContent: toDrawingContentSnapshot(rawAttrs.drawingContent),
|
|
75988
|
+
attrs: attrsWithPm,
|
|
75989
|
+
geometry,
|
|
75990
|
+
shapeKind: typeof rawAttrs.kind === "string" ? rawAttrs.kind : void 0,
|
|
75991
|
+
fillColor: normalizeFillColor(rawAttrs.fillColor),
|
|
75992
|
+
strokeColor: normalizeStrokeColor(rawAttrs.strokeColor),
|
|
75993
|
+
strokeWidth: coerceNumber(rawAttrs.strokeWidth),
|
|
75994
|
+
textContent: normalizeTextContent(rawAttrs.textContent),
|
|
75995
|
+
textAlign: typeof rawAttrs.textAlign === "string" ? rawAttrs.textAlign : void 0,
|
|
75996
|
+
textVerticalAlign: normalizeTextVerticalAlign(rawAttrs.textVerticalAlign),
|
|
75997
|
+
textInsets: normalizeTextInsets(rawAttrs.textInsets),
|
|
75998
|
+
...extraProps
|
|
75999
|
+
};
|
|
76000
|
+
};
|
|
76001
|
+
function vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
76002
|
+
const rawAttrs = getAttrs$1(node2);
|
|
76003
|
+
const geometry = {
|
|
76004
|
+
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
76005
|
+
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
76006
|
+
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
76007
|
+
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
76008
|
+
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
76009
|
+
};
|
|
76010
|
+
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
76011
|
+
}
|
|
76012
|
+
function shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
76013
|
+
const rawAttrs = getAttrs$1(node2);
|
|
76014
|
+
const groupTransform = isShapeGroupTransform(rawAttrs.groupTransform) ? { ...rawAttrs.groupTransform } : void 0;
|
|
76015
|
+
const size2 = normalizeShapeSize(rawAttrs.size);
|
|
76016
|
+
const width = size2?.width ?? groupTransform?.width ?? 1;
|
|
76017
|
+
const height = size2?.height ?? groupTransform?.height ?? 1;
|
|
76018
|
+
const geometry = {
|
|
76019
|
+
width: coercePositiveNumber(width, 1),
|
|
76020
|
+
height: coercePositiveNumber(height, 1),
|
|
76021
|
+
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
76022
|
+
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
76023
|
+
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
76024
|
+
};
|
|
76025
|
+
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "shapeGroup", {
|
|
76026
|
+
groupTransform,
|
|
76027
|
+
shapes: normalizeShapeGroupChildren(rawAttrs.shapes),
|
|
76028
|
+
size: size2
|
|
76029
|
+
});
|
|
76030
|
+
}
|
|
76031
|
+
function shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
76032
|
+
const rawAttrs = getAttrs$1(node2);
|
|
76033
|
+
const geometry = {
|
|
76034
|
+
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
76035
|
+
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
76036
|
+
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
76037
|
+
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
76038
|
+
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
76039
|
+
};
|
|
76040
|
+
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
76041
|
+
}
|
|
76042
|
+
function shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
76043
|
+
const rawAttrs = getAttrs$1(node2);
|
|
76044
|
+
const geometry = {
|
|
76045
|
+
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
76046
|
+
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
76047
|
+
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
76048
|
+
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
76049
|
+
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
76050
|
+
};
|
|
76051
|
+
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
76052
|
+
}
|
|
76053
|
+
function handleVectorShapeNode(node2, context) {
|
|
76054
|
+
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
76055
|
+
const drawingBlock = vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
76056
|
+
if (drawingBlock) {
|
|
76057
|
+
blocks2.push(drawingBlock);
|
|
76058
|
+
recordBlockKind(drawingBlock.kind);
|
|
76059
|
+
}
|
|
76060
|
+
}
|
|
76061
|
+
function handleShapeGroupNode(node2, context) {
|
|
76062
|
+
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
76063
|
+
const drawingBlock = shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
76064
|
+
if (drawingBlock) {
|
|
76065
|
+
blocks2.push(drawingBlock);
|
|
76066
|
+
recordBlockKind(drawingBlock.kind);
|
|
76067
|
+
}
|
|
76068
|
+
}
|
|
76069
|
+
function handleShapeContainerNode(node2, context) {
|
|
76070
|
+
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
76071
|
+
const drawingBlock = shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
76072
|
+
if (drawingBlock) {
|
|
76073
|
+
blocks2.push(drawingBlock);
|
|
76074
|
+
recordBlockKind(drawingBlock.kind);
|
|
76075
|
+
}
|
|
76076
|
+
}
|
|
76077
|
+
function handleShapeTextboxNode(node2, context) {
|
|
76078
|
+
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
76079
|
+
const drawingBlock = shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
76080
|
+
if (drawingBlock) {
|
|
76081
|
+
blocks2.push(drawingBlock);
|
|
76082
|
+
recordBlockKind(drawingBlock.kind);
|
|
76083
|
+
}
|
|
76084
|
+
}
|
|
76085
|
+
const getAttrs = (node2) => {
|
|
76086
|
+
return isPlainObject$2$1(node2.attrs) ? { ...node2.attrs } : {};
|
|
76087
|
+
};
|
|
76088
|
+
const parseFullWidth = (value) => {
|
|
76089
|
+
if (typeof value === "string") {
|
|
76090
|
+
const trimmed = value.trim();
|
|
76091
|
+
if (trimmed.endsWith("%")) {
|
|
76092
|
+
return { width: trimmed === "100%" ? 1 : null, isFullWidth: trimmed === "100%" };
|
|
76093
|
+
}
|
|
76094
|
+
return { width: pickNumber(trimmed) ?? null, isFullWidth: false };
|
|
76095
|
+
}
|
|
76096
|
+
return { width: pickNumber(value) ?? null, isFullWidth: false };
|
|
76097
|
+
};
|
|
76098
|
+
function contentBlockNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
76099
|
+
const rawAttrs = getAttrs(node2);
|
|
76100
|
+
const indentLeft = pickNumber(rawAttrs.hrIndentLeft);
|
|
76101
|
+
const indentRight = pickNumber(rawAttrs.hrIndentRight);
|
|
76102
|
+
if (rawAttrs.horizontalRule !== true) {
|
|
76103
|
+
return null;
|
|
76104
|
+
}
|
|
76105
|
+
const size2 = isPlainObject$2$1(rawAttrs.size) ? rawAttrs.size : void 0;
|
|
76106
|
+
const { width, isFullWidth } = parseFullWidth(size2?.width);
|
|
76107
|
+
const height = pickNumber(size2?.height);
|
|
76108
|
+
if (!height || height <= 0) {
|
|
76109
|
+
return null;
|
|
76110
|
+
}
|
|
76111
|
+
if (!isFullWidth && (!width || width <= 0)) {
|
|
76112
|
+
return null;
|
|
76113
|
+
}
|
|
76114
|
+
if (isFullWidth) {
|
|
76115
|
+
rawAttrs.isFullWidth = true;
|
|
76116
|
+
}
|
|
76117
|
+
if (indentLeft != null || indentRight != null) {
|
|
76118
|
+
rawAttrs.hrIndentLeft = indentLeft;
|
|
76119
|
+
rawAttrs.hrIndentRight = indentRight;
|
|
76120
|
+
}
|
|
76121
|
+
if (typeof rawAttrs.background === "string" && rawAttrs.background.trim()) {
|
|
76122
|
+
rawAttrs.fillColor = rawAttrs.background;
|
|
76123
|
+
}
|
|
76124
|
+
const geometry = {
|
|
76125
|
+
width: isFullWidth ? 1 : width ?? 1,
|
|
76126
|
+
height,
|
|
76127
|
+
rotation: 0,
|
|
76128
|
+
flipH: false,
|
|
76129
|
+
flipV: false
|
|
76130
|
+
};
|
|
76131
|
+
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape", {
|
|
76132
|
+
strokeColor: null
|
|
76133
|
+
});
|
|
76134
|
+
}
|
|
75872
76135
|
const extractValue = (value) => {
|
|
75873
76136
|
if (value && typeof value === "object" && "value" in value) {
|
|
75874
76137
|
return value.value;
|
|
@@ -76592,6 +76855,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76592
76855
|
}
|
|
76593
76856
|
return;
|
|
76594
76857
|
}
|
|
76858
|
+
if (node2.type === "contentBlock") {
|
|
76859
|
+
const attrs = node2.attrs ?? {};
|
|
76860
|
+
if (attrs.horizontalRule === true) {
|
|
76861
|
+
flushParagraph();
|
|
76862
|
+
const indent2 = paragraphAttrs?.indent;
|
|
76863
|
+
const hrIndentLeft = typeof indent2?.left === "number" ? indent2.left : void 0;
|
|
76864
|
+
const hrIndentRight = typeof indent2?.right === "number" ? indent2.right : void 0;
|
|
76865
|
+
const hasIndent = typeof hrIndentLeft === "number" && hrIndentLeft !== 0 || typeof hrIndentRight === "number" && hrIndentRight !== 0;
|
|
76866
|
+
const hrNode = hasIndent ? { ...node2, attrs: { ...attrs, hrIndentLeft, hrIndentRight } } : node2;
|
|
76867
|
+
const convert2 = converters?.contentBlockNodeToDrawingBlock ?? contentBlockNodeToDrawingBlock;
|
|
76868
|
+
const drawingBlock = convert2(hrNode, nextBlockId, positions);
|
|
76869
|
+
if (drawingBlock) {
|
|
76870
|
+
blocks2.push(drawingBlock);
|
|
76871
|
+
}
|
|
76872
|
+
}
|
|
76873
|
+
return;
|
|
76874
|
+
}
|
|
76595
76875
|
if (node2.type === "vectorShape") {
|
|
76596
76876
|
flushParagraph();
|
|
76597
76877
|
if (converters?.vectorShapeNodeToDrawingBlock) {
|
|
@@ -76804,12 +77084,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76804
77084
|
});
|
|
76805
77085
|
sectionState.currentParagraphIndex++;
|
|
76806
77086
|
}
|
|
76807
|
-
const WRAP_TYPES
|
|
76808
|
-
const WRAP_TEXT_VALUES
|
|
76809
|
-
const H_RELATIVE_VALUES
|
|
76810
|
-
const V_RELATIVE_VALUES
|
|
76811
|
-
const H_ALIGN_VALUES
|
|
76812
|
-
const V_ALIGN_VALUES
|
|
77087
|
+
const WRAP_TYPES = /* @__PURE__ */ new Set(["None", "Square", "Tight", "Through", "TopAndBottom", "Inline"]);
|
|
77088
|
+
const WRAP_TEXT_VALUES = /* @__PURE__ */ new Set(["bothSides", "left", "right", "largest"]);
|
|
77089
|
+
const H_RELATIVE_VALUES = /* @__PURE__ */ new Set(["column", "page", "margin"]);
|
|
77090
|
+
const V_RELATIVE_VALUES = /* @__PURE__ */ new Set(["paragraph", "page", "margin"]);
|
|
77091
|
+
const H_ALIGN_VALUES = /* @__PURE__ */ new Set(["left", "center", "right"]);
|
|
77092
|
+
const V_ALIGN_VALUES = /* @__PURE__ */ new Set(["top", "center", "bottom"]);
|
|
76813
77093
|
const isPlainObject$4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
76814
77094
|
const isAllowedObjectFit = (value) => {
|
|
76815
77095
|
return value === "contain" || value === "cover" || value === "fill" || value === "scale-down";
|
|
@@ -76827,15 +77107,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76827
77107
|
});
|
|
76828
77108
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
76829
77109
|
}
|
|
76830
|
-
const normalizeWrapType
|
|
77110
|
+
const normalizeWrapType = (value) => {
|
|
76831
77111
|
if (typeof value !== "string") return void 0;
|
|
76832
|
-
return WRAP_TYPES
|
|
77112
|
+
return WRAP_TYPES.has(value) ? value : void 0;
|
|
76833
77113
|
};
|
|
76834
|
-
const normalizeWrapText
|
|
77114
|
+
const normalizeWrapText = (value) => {
|
|
76835
77115
|
if (typeof value !== "string") return void 0;
|
|
76836
|
-
return WRAP_TEXT_VALUES
|
|
77116
|
+
return WRAP_TEXT_VALUES.has(value) ? value : void 0;
|
|
76837
77117
|
};
|
|
76838
|
-
const normalizePolygon
|
|
77118
|
+
const normalizePolygon = (value) => {
|
|
76839
77119
|
if (!Array.isArray(value)) return void 0;
|
|
76840
77120
|
const polygon = [];
|
|
76841
77121
|
value.forEach((point2) => {
|
|
@@ -76861,17 +77141,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76861
77141
|
}
|
|
76862
77142
|
return void 0;
|
|
76863
77143
|
};
|
|
76864
|
-
const normalizeWrap$
|
|
77144
|
+
const normalizeWrap$1 = (value) => {
|
|
76865
77145
|
if (!isPlainObject$4(value)) {
|
|
76866
77146
|
return void 0;
|
|
76867
77147
|
}
|
|
76868
|
-
const type2 = normalizeWrapType
|
|
77148
|
+
const type2 = normalizeWrapType(value.type);
|
|
76869
77149
|
if (!type2) {
|
|
76870
77150
|
return void 0;
|
|
76871
77151
|
}
|
|
76872
77152
|
const wrap2 = { type: type2 };
|
|
76873
77153
|
const attrs = isPlainObject$4(value.attrs) ? value.attrs : {};
|
|
76874
|
-
const wrapText = normalizeWrapText
|
|
77154
|
+
const wrapText = normalizeWrapText(attrs.wrapText);
|
|
76875
77155
|
if (wrapText) {
|
|
76876
77156
|
wrap2.wrapText = wrapText;
|
|
76877
77157
|
}
|
|
@@ -76883,7 +77163,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76883
77163
|
if (distLeft != null) wrap2.distLeft = distLeft;
|
|
76884
77164
|
const distRight = pickNumber(attrs.distRight ?? attrs.distR);
|
|
76885
77165
|
if (distRight != null) wrap2.distRight = distRight;
|
|
76886
|
-
const polygon = normalizePolygon
|
|
77166
|
+
const polygon = normalizePolygon(attrs.polygon);
|
|
76887
77167
|
if (polygon) {
|
|
76888
77168
|
wrap2.polygon = polygon;
|
|
76889
77169
|
}
|
|
@@ -76893,15 +77173,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76893
77173
|
}
|
|
76894
77174
|
return wrap2;
|
|
76895
77175
|
};
|
|
76896
|
-
const normalizeAnchorRelative
|
|
77176
|
+
const normalizeAnchorRelative = (value, allowed) => {
|
|
76897
77177
|
if (typeof value !== "string") return void 0;
|
|
76898
77178
|
return allowed.has(value) ? value : void 0;
|
|
76899
77179
|
};
|
|
76900
|
-
const normalizeAnchorAlign
|
|
77180
|
+
const normalizeAnchorAlign = (value, allowed) => {
|
|
76901
77181
|
if (typeof value !== "string") return void 0;
|
|
76902
77182
|
return allowed.has(value) ? value : void 0;
|
|
76903
77183
|
};
|
|
76904
|
-
const normalizeAnchorData
|
|
77184
|
+
const normalizeAnchorData = (value, attrs, wrapBehindDoc) => {
|
|
76905
77185
|
const raw = isPlainObject$4(value) ? value : void 0;
|
|
76906
77186
|
const marginOffset = isPlainObject$4(attrs.marginOffset) ? attrs.marginOffset : void 0;
|
|
76907
77187
|
const simplePos = isPlainObject$4(attrs.simplePos) ? attrs.simplePos : void 0;
|
|
@@ -76911,13 +77191,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76911
77191
|
if (isAnchored) {
|
|
76912
77192
|
anchor.isAnchored = true;
|
|
76913
77193
|
}
|
|
76914
|
-
const hRelative = normalizeAnchorRelative
|
|
77194
|
+
const hRelative = normalizeAnchorRelative(raw?.hRelativeFrom, H_RELATIVE_VALUES);
|
|
76915
77195
|
if (hRelative) anchor.hRelativeFrom = hRelative;
|
|
76916
|
-
const vRelative = normalizeAnchorRelative
|
|
77196
|
+
const vRelative = normalizeAnchorRelative(raw?.vRelativeFrom, V_RELATIVE_VALUES);
|
|
76917
77197
|
if (vRelative) anchor.vRelativeFrom = vRelative;
|
|
76918
|
-
const alignH = normalizeAnchorAlign
|
|
77198
|
+
const alignH = normalizeAnchorAlign(raw?.alignH, H_ALIGN_VALUES);
|
|
76919
77199
|
if (alignH) anchor.alignH = alignH;
|
|
76920
|
-
const alignV = normalizeAnchorAlign
|
|
77200
|
+
const alignV = normalizeAnchorAlign(raw?.alignV, V_ALIGN_VALUES);
|
|
76921
77201
|
if (alignV) anchor.alignV = alignV;
|
|
76922
77202
|
const offsetH = pickNumber(marginOffset?.horizontal ?? marginOffset?.left ?? raw?.offsetH ?? simplePos?.x);
|
|
76923
77203
|
if (offsetH != null) anchor.offsetH = offsetH;
|
|
@@ -76943,8 +77223,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76943
77223
|
const width = typeof size2.width === "number" && Number.isFinite(size2.width) ? size2.width : void 0;
|
|
76944
77224
|
const height = typeof size2.height === "number" && Number.isFinite(size2.height) ? size2.height : void 0;
|
|
76945
77225
|
const explicitDisplay = typeof attrs.display === "string" ? attrs.display : void 0;
|
|
76946
|
-
const normalizedWrap = normalizeWrap$
|
|
76947
|
-
let anchor = normalizeAnchorData
|
|
77226
|
+
const normalizedWrap = normalizeWrap$1(attrs.wrap);
|
|
77227
|
+
let anchor = normalizeAnchorData(attrs.anchorData, attrs, normalizedWrap?.behindDoc);
|
|
76948
77228
|
if (!anchor && normalizedWrap) {
|
|
76949
77229
|
anchor = { isAnchored: true };
|
|
76950
77230
|
if (normalizedWrap.behindDoc != null) {
|
|
@@ -76986,221 +77266,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
76986
77266
|
recordBlockKind(imageBlock.kind);
|
|
76987
77267
|
}
|
|
76988
77268
|
}
|
|
76989
|
-
const WRAP_TYPES = /* @__PURE__ */ new Set(["None", "Square", "Tight", "Through", "TopAndBottom", "Inline"]);
|
|
76990
|
-
const WRAP_TEXT_VALUES = /* @__PURE__ */ new Set(["bothSides", "left", "right", "largest"]);
|
|
76991
|
-
const H_RELATIVE_VALUES = /* @__PURE__ */ new Set(["column", "page", "margin"]);
|
|
76992
|
-
const V_RELATIVE_VALUES = /* @__PURE__ */ new Set(["paragraph", "page", "margin"]);
|
|
76993
|
-
const H_ALIGN_VALUES = /* @__PURE__ */ new Set(["left", "center", "right"]);
|
|
76994
|
-
const V_ALIGN_VALUES = /* @__PURE__ */ new Set(["top", "center", "bottom"]);
|
|
76995
|
-
const getAttrs = (node2) => {
|
|
76996
|
-
return isPlainObject$2$1(node2.attrs) ? node2.attrs : {};
|
|
76997
|
-
};
|
|
76998
|
-
const normalizeWrapType = (value) => {
|
|
76999
|
-
if (typeof value !== "string") return void 0;
|
|
77000
|
-
return WRAP_TYPES.has(value) ? value : void 0;
|
|
77001
|
-
};
|
|
77002
|
-
const normalizeWrapText = (value) => {
|
|
77003
|
-
if (typeof value !== "string") return void 0;
|
|
77004
|
-
return WRAP_TEXT_VALUES.has(value) ? value : void 0;
|
|
77005
|
-
};
|
|
77006
|
-
const normalizePolygon = (value) => {
|
|
77007
|
-
if (!Array.isArray(value)) return void 0;
|
|
77008
|
-
const polygon = [];
|
|
77009
|
-
value.forEach((point2) => {
|
|
77010
|
-
if (!Array.isArray(point2) || point2.length < 2) return;
|
|
77011
|
-
const x2 = pickNumber(point2[0]);
|
|
77012
|
-
const y2 = pickNumber(point2[1]);
|
|
77013
|
-
if (x2 == null || y2 == null) return;
|
|
77014
|
-
polygon.push([x2, y2]);
|
|
77015
|
-
});
|
|
77016
|
-
return polygon.length > 0 ? polygon : void 0;
|
|
77017
|
-
};
|
|
77018
|
-
const normalizeWrap$1 = (value) => {
|
|
77019
|
-
if (!isPlainObject$2$1(value)) {
|
|
77020
|
-
return void 0;
|
|
77021
|
-
}
|
|
77022
|
-
const type2 = normalizeWrapType(value.type);
|
|
77023
|
-
if (!type2 || type2 === "Inline") {
|
|
77024
|
-
return void 0;
|
|
77025
|
-
}
|
|
77026
|
-
const wrap2 = { type: type2 };
|
|
77027
|
-
const attrs = isPlainObject$2$1(value.attrs) ? value.attrs : {};
|
|
77028
|
-
const wrapText = normalizeWrapText(attrs.wrapText);
|
|
77029
|
-
if (wrapText) {
|
|
77030
|
-
wrap2.wrapText = wrapText;
|
|
77031
|
-
}
|
|
77032
|
-
const distTop = pickNumber(attrs.distTop ?? attrs.distT);
|
|
77033
|
-
if (distTop != null) wrap2.distTop = distTop;
|
|
77034
|
-
const distBottom = pickNumber(attrs.distBottom ?? attrs.distB);
|
|
77035
|
-
if (distBottom != null) wrap2.distBottom = distBottom;
|
|
77036
|
-
const distLeft = pickNumber(attrs.distLeft ?? attrs.distL);
|
|
77037
|
-
if (distLeft != null) wrap2.distLeft = distLeft;
|
|
77038
|
-
const distRight = pickNumber(attrs.distRight ?? attrs.distR);
|
|
77039
|
-
if (distRight != null) wrap2.distRight = distRight;
|
|
77040
|
-
const polygon = normalizePolygon(attrs.polygon);
|
|
77041
|
-
if (polygon) {
|
|
77042
|
-
wrap2.polygon = polygon;
|
|
77043
|
-
}
|
|
77044
|
-
const behindDoc = toBoolean$3(attrs.behindDoc);
|
|
77045
|
-
if (behindDoc != null) {
|
|
77046
|
-
wrap2.behindDoc = behindDoc;
|
|
77047
|
-
}
|
|
77048
|
-
return wrap2;
|
|
77049
|
-
};
|
|
77050
|
-
const normalizeAnchorRelative = (value, allowed) => {
|
|
77051
|
-
if (typeof value !== "string") return void 0;
|
|
77052
|
-
return allowed.has(value) ? value : void 0;
|
|
77053
|
-
};
|
|
77054
|
-
const normalizeAnchorAlign = (value, allowed) => {
|
|
77055
|
-
if (typeof value !== "string") return void 0;
|
|
77056
|
-
return allowed.has(value) ? value : void 0;
|
|
77057
|
-
};
|
|
77058
|
-
const normalizeAnchorData = (value, attrs, wrapBehindDoc) => {
|
|
77059
|
-
const raw = isPlainObject$2$1(value) ? value : void 0;
|
|
77060
|
-
const marginOffset = isPlainObject$2$1(attrs.marginOffset) ? attrs.marginOffset : void 0;
|
|
77061
|
-
const simplePos = isPlainObject$2$1(attrs.simplePos) ? attrs.simplePos : void 0;
|
|
77062
|
-
const originalAttrs = isPlainObject$2$1(attrs.originalAttributes) ? attrs.originalAttributes : void 0;
|
|
77063
|
-
const isAnchored = attrs.isAnchor === true || Boolean(raw);
|
|
77064
|
-
const anchor = {};
|
|
77065
|
-
if (isAnchored) {
|
|
77066
|
-
anchor.isAnchored = true;
|
|
77067
|
-
}
|
|
77068
|
-
const hRelative = normalizeAnchorRelative(raw?.hRelativeFrom, H_RELATIVE_VALUES);
|
|
77069
|
-
if (hRelative) anchor.hRelativeFrom = hRelative;
|
|
77070
|
-
const vRelative = normalizeAnchorRelative(raw?.vRelativeFrom, V_RELATIVE_VALUES);
|
|
77071
|
-
if (vRelative) anchor.vRelativeFrom = vRelative;
|
|
77072
|
-
const alignH = normalizeAnchorAlign(raw?.alignH, H_ALIGN_VALUES);
|
|
77073
|
-
if (alignH) anchor.alignH = alignH;
|
|
77074
|
-
const alignV = normalizeAnchorAlign(raw?.alignV, V_ALIGN_VALUES);
|
|
77075
|
-
if (alignV) anchor.alignV = alignV;
|
|
77076
|
-
const offsetH = pickNumber(marginOffset?.horizontal ?? marginOffset?.left ?? raw?.offsetH ?? simplePos?.x);
|
|
77077
|
-
if (offsetH != null) anchor.offsetH = offsetH;
|
|
77078
|
-
const offsetV = pickNumber(marginOffset?.top ?? marginOffset?.vertical ?? raw?.offsetV ?? simplePos?.y);
|
|
77079
|
-
if (offsetV != null) anchor.offsetV = offsetV;
|
|
77080
|
-
const behindDoc = toBoolean$3(raw?.behindDoc ?? wrapBehindDoc ?? originalAttrs?.behindDoc);
|
|
77081
|
-
if (behindDoc != null) anchor.behindDoc = behindDoc;
|
|
77082
|
-
const hasData = anchor.isAnchored || anchor.hRelativeFrom != null || anchor.vRelativeFrom != null || anchor.alignH != null || anchor.alignV != null || anchor.offsetH != null || anchor.offsetV != null || anchor.behindDoc != null;
|
|
77083
|
-
return hasData ? anchor : void 0;
|
|
77084
|
-
};
|
|
77085
|
-
const buildDrawingBlock = (rawAttrs, nextBlockId, positions, node2, geometry, drawingKind, extraProps) => {
|
|
77086
|
-
const normalizedWrap = normalizeWrap$1(rawAttrs.wrap);
|
|
77087
|
-
const baseAnchor = normalizeAnchorData(rawAttrs.anchorData, rawAttrs, normalizedWrap?.behindDoc);
|
|
77088
|
-
const pos = positions.get(node2);
|
|
77089
|
-
const attrsWithPm = { ...rawAttrs };
|
|
77090
|
-
if (pos) {
|
|
77091
|
-
attrsWithPm.pmStart = pos.start;
|
|
77092
|
-
attrsWithPm.pmEnd = pos.end;
|
|
77093
|
-
}
|
|
77094
|
-
const zIndexFromRelativeHeight = normalizeZIndex(rawAttrs.originalAttributes);
|
|
77095
|
-
const finalZIndex = zIndexFromRelativeHeight ?? coerceNumber(rawAttrs.zIndex);
|
|
77096
|
-
return {
|
|
77097
|
-
kind: "drawing",
|
|
77098
|
-
id: nextBlockId("drawing"),
|
|
77099
|
-
drawingKind,
|
|
77100
|
-
padding: toBoxSpacing$1(rawAttrs.padding),
|
|
77101
|
-
margin: toBoxSpacing$1(rawAttrs.marginOffset) ?? toBoxSpacing$1(rawAttrs.margin),
|
|
77102
|
-
anchor: baseAnchor,
|
|
77103
|
-
wrap: normalizedWrap,
|
|
77104
|
-
zIndex: finalZIndex,
|
|
77105
|
-
drawingContentId: typeof rawAttrs.drawingContentId === "string" ? rawAttrs.drawingContentId : void 0,
|
|
77106
|
-
drawingContent: toDrawingContentSnapshot(rawAttrs.drawingContent),
|
|
77107
|
-
attrs: attrsWithPm,
|
|
77108
|
-
geometry,
|
|
77109
|
-
shapeKind: typeof rawAttrs.kind === "string" ? rawAttrs.kind : void 0,
|
|
77110
|
-
fillColor: normalizeFillColor(rawAttrs.fillColor),
|
|
77111
|
-
strokeColor: normalizeStrokeColor(rawAttrs.strokeColor),
|
|
77112
|
-
strokeWidth: coerceNumber(rawAttrs.strokeWidth),
|
|
77113
|
-
textContent: normalizeTextContent(rawAttrs.textContent),
|
|
77114
|
-
textAlign: typeof rawAttrs.textAlign === "string" ? rawAttrs.textAlign : void 0,
|
|
77115
|
-
textVerticalAlign: normalizeTextVerticalAlign(rawAttrs.textVerticalAlign),
|
|
77116
|
-
textInsets: normalizeTextInsets(rawAttrs.textInsets),
|
|
77117
|
-
...extraProps
|
|
77118
|
-
};
|
|
77119
|
-
};
|
|
77120
|
-
function vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
77121
|
-
const rawAttrs = getAttrs(node2);
|
|
77122
|
-
const geometry = {
|
|
77123
|
-
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
77124
|
-
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
77125
|
-
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
77126
|
-
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
77127
|
-
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
77128
|
-
};
|
|
77129
|
-
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
77130
|
-
}
|
|
77131
|
-
function shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
77132
|
-
const rawAttrs = getAttrs(node2);
|
|
77133
|
-
const groupTransform = isShapeGroupTransform(rawAttrs.groupTransform) ? { ...rawAttrs.groupTransform } : void 0;
|
|
77134
|
-
const size2 = normalizeShapeSize(rawAttrs.size);
|
|
77135
|
-
const width = size2?.width ?? groupTransform?.width ?? 1;
|
|
77136
|
-
const height = size2?.height ?? groupTransform?.height ?? 1;
|
|
77137
|
-
const geometry = {
|
|
77138
|
-
width: coercePositiveNumber(width, 1),
|
|
77139
|
-
height: coercePositiveNumber(height, 1),
|
|
77140
|
-
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
77141
|
-
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
77142
|
-
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
77143
|
-
};
|
|
77144
|
-
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "shapeGroup", {
|
|
77145
|
-
groupTransform,
|
|
77146
|
-
shapes: normalizeShapeGroupChildren(rawAttrs.shapes),
|
|
77147
|
-
size: size2
|
|
77148
|
-
});
|
|
77149
|
-
}
|
|
77150
|
-
function shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
77151
|
-
const rawAttrs = getAttrs(node2);
|
|
77152
|
-
const geometry = {
|
|
77153
|
-
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
77154
|
-
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
77155
|
-
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
77156
|
-
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
77157
|
-
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
77158
|
-
};
|
|
77159
|
-
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
77160
|
-
}
|
|
77161
|
-
function shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions) {
|
|
77162
|
-
const rawAttrs = getAttrs(node2);
|
|
77163
|
-
const geometry = {
|
|
77164
|
-
width: coercePositiveNumber(rawAttrs.width, 1),
|
|
77165
|
-
height: coercePositiveNumber(rawAttrs.height, 1),
|
|
77166
|
-
rotation: coerceNumber(rawAttrs.rotation) ?? 0,
|
|
77167
|
-
flipH: coerceBoolean(rawAttrs.flipH) ?? false,
|
|
77168
|
-
flipV: coerceBoolean(rawAttrs.flipV) ?? false
|
|
77169
|
-
};
|
|
77170
|
-
return buildDrawingBlock(rawAttrs, nextBlockId, positions, node2, geometry, "vectorShape");
|
|
77171
|
-
}
|
|
77172
|
-
function handleVectorShapeNode(node2, context) {
|
|
77173
|
-
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
77174
|
-
const drawingBlock = vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
77175
|
-
if (drawingBlock) {
|
|
77176
|
-
blocks2.push(drawingBlock);
|
|
77177
|
-
recordBlockKind(drawingBlock.kind);
|
|
77178
|
-
}
|
|
77179
|
-
}
|
|
77180
|
-
function handleShapeGroupNode(node2, context) {
|
|
77181
|
-
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
77182
|
-
const drawingBlock = shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
77183
|
-
if (drawingBlock) {
|
|
77184
|
-
blocks2.push(drawingBlock);
|
|
77185
|
-
recordBlockKind(drawingBlock.kind);
|
|
77186
|
-
}
|
|
77187
|
-
}
|
|
77188
|
-
function handleShapeContainerNode(node2, context) {
|
|
77189
|
-
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
77190
|
-
const drawingBlock = shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
77191
|
-
if (drawingBlock) {
|
|
77192
|
-
blocks2.push(drawingBlock);
|
|
77193
|
-
recordBlockKind(drawingBlock.kind);
|
|
77194
|
-
}
|
|
77195
|
-
}
|
|
77196
|
-
function handleShapeTextboxNode(node2, context) {
|
|
77197
|
-
const { blocks: blocks2, recordBlockKind, nextBlockId, positions } = context;
|
|
77198
|
-
const drawingBlock = shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions);
|
|
77199
|
-
if (drawingBlock) {
|
|
77200
|
-
blocks2.push(drawingBlock);
|
|
77201
|
-
recordBlockKind(drawingBlock.kind);
|
|
77202
|
-
}
|
|
77203
|
-
}
|
|
77204
77269
|
const hydrateTableStyleAttrs = (tableNode, context) => {
|
|
77205
77270
|
const hydration = {};
|
|
77206
77271
|
const tableProps = tableNode.attrs?.tableProperties ?? null;
|
|
@@ -78006,6 +78071,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
78006
78071
|
hyperlinkConfig,
|
|
78007
78072
|
themeColors,
|
|
78008
78073
|
{
|
|
78074
|
+
contentBlockNodeToDrawingBlock,
|
|
78009
78075
|
imageNodeToBlock,
|
|
78010
78076
|
vectorShapeNodeToDrawingBlock,
|
|
78011
78077
|
shapeGroupNodeToDrawingBlock,
|
|
@@ -87790,9 +87856,13 @@ ${l}
|
|
|
87790
87856
|
const maxWidth = Math.max(0, columns.width - (marginLeft + marginRight));
|
|
87791
87857
|
let width = measure.width;
|
|
87792
87858
|
let height = measure.height;
|
|
87793
|
-
|
|
87794
|
-
|
|
87795
|
-
|
|
87859
|
+
const attrs = block.attrs;
|
|
87860
|
+
const indentLeft = typeof attrs?.hrIndentLeft === "number" ? attrs.hrIndentLeft : 0;
|
|
87861
|
+
const indentRight = typeof attrs?.hrIndentRight === "number" ? attrs.hrIndentRight : 0;
|
|
87862
|
+
const maxWidthForBlock = attrs?.isFullWidth === true && maxWidth > 0 ? Math.max(1, maxWidth - indentLeft - indentRight) : maxWidth;
|
|
87863
|
+
if (width > maxWidthForBlock && maxWidthForBlock > 0) {
|
|
87864
|
+
const scale = maxWidthForBlock / width;
|
|
87865
|
+
width = maxWidthForBlock;
|
|
87796
87866
|
height *= scale;
|
|
87797
87867
|
}
|
|
87798
87868
|
let state2 = ensurePage();
|
|
@@ -87811,7 +87881,7 @@ ${l}
|
|
|
87811
87881
|
kind: "drawing",
|
|
87812
87882
|
blockId: block.id,
|
|
87813
87883
|
drawingKind: block.drawingKind,
|
|
87814
|
-
x: columnX(state2.columnIndex) + marginLeft,
|
|
87884
|
+
x: columnX(state2.columnIndex) + marginLeft + indentLeft,
|
|
87815
87885
|
y: state2.cursorY + marginTop,
|
|
87816
87886
|
width,
|
|
87817
87887
|
height,
|
|
@@ -94653,10 +94723,18 @@ ${l}
|
|
|
94653
94723
|
};
|
|
94654
94724
|
}
|
|
94655
94725
|
const geometry = ensureDrawingGeometry(block.geometry);
|
|
94726
|
+
const attrs = block.attrs;
|
|
94727
|
+
const indentLeft = typeof attrs?.hrIndentLeft === "number" ? attrs.hrIndentLeft : 0;
|
|
94728
|
+
const indentRight = typeof attrs?.hrIndentRight === "number" ? attrs.hrIndentRight : 0;
|
|
94729
|
+
const hasFullWidth = attrs?.isFullWidth === true && constraints.maxWidth > 0;
|
|
94730
|
+
const fullWidthMax = hasFullWidth ? Math.max(1, constraints.maxWidth - indentLeft - indentRight) : void 0;
|
|
94731
|
+
if (fullWidthMax != null) {
|
|
94732
|
+
geometry.width = fullWidthMax;
|
|
94733
|
+
}
|
|
94656
94734
|
const rotatedBounds = calculateRotatedBounds(geometry);
|
|
94657
94735
|
const naturalWidth = Math.max(1, rotatedBounds.width);
|
|
94658
94736
|
const naturalHeight = Math.max(1, rotatedBounds.height);
|
|
94659
|
-
const maxWidth = constraints.maxWidth > 0 ? constraints.maxWidth : naturalWidth;
|
|
94737
|
+
const maxWidth = fullWidthMax ?? (constraints.maxWidth > 0 ? constraints.maxWidth : naturalWidth);
|
|
94660
94738
|
const hasNegativeVerticalPosition = block.anchor?.isAnchored && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0);
|
|
94661
94739
|
const maxHeight = hasNegativeVerticalPosition || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
|
|
94662
94740
|
const widthScale = maxWidth / naturalWidth;
|
|
@@ -153745,7 +153823,7 @@ ${style2}
|
|
|
153745
153823
|
this.config.colors = shuffleArray(this.config.colors);
|
|
153746
153824
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
153747
153825
|
this.colorIndex = 0;
|
|
153748
|
-
this.version = "1.0.0-next.
|
|
153826
|
+
this.version = "1.0.0-next.7";
|
|
153749
153827
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
153750
153828
|
this.superdocId = config2.superdocId || v4();
|
|
153751
153829
|
this.colors = this.config.colors;
|
|
@@ -156218,7 +156296,7 @@ ${style2}
|
|
|
156218
156296
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
156219
156297
|
);
|
|
156220
156298
|
}
|
|
156221
|
-
const
|
|
156299
|
+
const indexIZySkMqb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
156222
156300
|
__proto__: null,
|
|
156223
156301
|
unified
|
|
156224
156302
|
}, Symbol.toStringTag, { value: "Module" }));
|