@harbour-enterprises/superdoc 0.29.0-next.13 → 0.29.0-next.15
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-DOihIaKT.cjs → PdfViewer-B7X4xur3.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BkHpL2td.es.js → PdfViewer-BL9hLN-A.es.js} +1 -1
- package/dist/chunks/{index-BG7aufxd.es.js → index-CCTDIDk7.es.js} +3 -3
- package/dist/chunks/{index-Bky221GX.cjs → index-CCVmXx2r.cjs} +3 -3
- package/dist/chunks/{index-p_HoYQ4L-YNisXWt0.es.js → index-x0B8ORNX--SLHZ7wS.es.js} +1 -1
- package/dist/chunks/{index-p_HoYQ4L-BvUq1_h3.cjs → index-x0B8ORNX-D9kjqjf9.cjs} +1 -1
- package/dist/chunks/{super-editor.es-DA-FFY2A.cjs → super-editor.es-BkV-6f5K.cjs} +404 -12
- package/dist/chunks/{super-editor.es-vCpzMs9V.es.js → super-editor.es-LUVoGFZl.es.js} +404 -12
- package/dist/style.css +45 -3
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-C0Fd9g-U.js → converter-Bt0gPwYj.js} +149 -7
- package/dist/super-editor/chunks/{docx-zipper-BqIh8tzQ.js → docx-zipper-JVCnlDBn.js} +1 -1
- package/dist/super-editor/chunks/{editor-Dg538FVw.js → editor-BF7w_sd7.js} +257 -7
- package/dist/super-editor/chunks/{index-p_HoYQ4L.js → index-x0B8ORNX.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-Des2y7IP.js → toolbar-CI9lB3KI.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/style.css +45 -3
- package/dist/super-editor/super-editor/src/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/relationship-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/wp/helpers/decode-image-node-helpers.d.ts +6 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/wp/helpers/decode-image-node-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/wp/helpers/encode-image-node-helpers.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/index.d.ts +2 -1
- package/dist/super-editor/super-editor/src/extensions/index.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/search/prosemirror-search-patched.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/extensions/shape-group/ShapeGroupView.d.ts +22 -0
- package/dist/super-editor/super-editor/src/extensions/shape-group/ShapeGroupView.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/extensions/shape-group/index.d.ts +3 -0
- package/dist/super-editor/super-editor/src/extensions/shape-group/index.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/extensions/shape-group/shape-group.d.ts +3 -0
- package/dist/super-editor/super-editor/src/extensions/shape-group/shape-group.d.ts.map +1 -0
- 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 +406 -14
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -28442,6 +28442,7 @@ function extractFillColor(spPr, style) {
|
|
|
28442
28442
|
}
|
|
28443
28443
|
const DRAWING_XML_TAG = "w:drawing";
|
|
28444
28444
|
const SHAPE_URI = "http://schemas.microsoft.com/office/word/2010/wordprocessingShape";
|
|
28445
|
+
const GROUP_URI = "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup";
|
|
28445
28446
|
function handleImageNode(node, params, isAnchor) {
|
|
28446
28447
|
const { docx, filename } = params;
|
|
28447
28448
|
const { attributes } = node;
|
|
@@ -28559,7 +28560,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
28559
28560
|
const graphic = node.elements.find((el) => el.name === "a:graphic");
|
|
28560
28561
|
const graphicData = graphic?.elements.find((el) => el.name === "a:graphicData");
|
|
28561
28562
|
const { uri: uri2 } = graphicData?.attributes || {};
|
|
28562
|
-
if (
|
|
28563
|
+
if (uri2 === SHAPE_URI) {
|
|
28563
28564
|
const shapeMarginOffset = {
|
|
28564
28565
|
left: positionHValue,
|
|
28565
28566
|
horizontal: positionHValue,
|
|
@@ -28567,6 +28568,14 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
28567
28568
|
};
|
|
28568
28569
|
return handleShapeDrawing(params, node, graphicData, size, padding, shapeMarginOffset);
|
|
28569
28570
|
}
|
|
28571
|
+
if (uri2 === GROUP_URI) {
|
|
28572
|
+
const shapeMarginOffset = {
|
|
28573
|
+
left: positionHValue,
|
|
28574
|
+
horizontal: positionHValue,
|
|
28575
|
+
top: positionVValue
|
|
28576
|
+
};
|
|
28577
|
+
return handleShapeGroup(params, node, graphicData, size, padding, shapeMarginOffset);
|
|
28578
|
+
}
|
|
28570
28579
|
const picture = graphicData?.elements.find((el) => el.name === "pic:pic");
|
|
28571
28580
|
if (!picture || !picture.elements) return null;
|
|
28572
28581
|
const blipFill = picture.elements.find((el) => el.name === "pic:blipFill");
|
|
@@ -28656,6 +28665,114 @@ const handleShapeDrawing = (params, node, graphicData, size, padding, marginOffs
|
|
|
28656
28665
|
}
|
|
28657
28666
|
return buildShapePlaceholder(node, size, padding, marginOffset, "textbox");
|
|
28658
28667
|
};
|
|
28668
|
+
const handleShapeGroup = (params, node, graphicData, size, padding, marginOffset) => {
|
|
28669
|
+
const wgp = graphicData.elements.find((el) => el.name === "wpg:wgp");
|
|
28670
|
+
if (!wgp) {
|
|
28671
|
+
return buildShapePlaceholder(node, size, padding, marginOffset, "group");
|
|
28672
|
+
}
|
|
28673
|
+
const grpSpPr = wgp.elements.find((el) => el.name === "wpg:grpSpPr");
|
|
28674
|
+
const xfrm = grpSpPr?.elements?.find((el) => el.name === "a:xfrm");
|
|
28675
|
+
const groupTransform = {};
|
|
28676
|
+
if (xfrm) {
|
|
28677
|
+
const off = xfrm.elements?.find((el) => el.name === "a:off");
|
|
28678
|
+
const ext = xfrm.elements?.find((el) => el.name === "a:ext");
|
|
28679
|
+
const chOff = xfrm.elements?.find((el) => el.name === "a:chOff");
|
|
28680
|
+
const chExt = xfrm.elements?.find((el) => el.name === "a:chExt");
|
|
28681
|
+
if (off) {
|
|
28682
|
+
groupTransform.x = emuToPixels(off.attributes?.["x"] || 0);
|
|
28683
|
+
groupTransform.y = emuToPixels(off.attributes?.["y"] || 0);
|
|
28684
|
+
}
|
|
28685
|
+
if (ext) {
|
|
28686
|
+
groupTransform.width = emuToPixels(ext.attributes?.["cx"] || 0);
|
|
28687
|
+
groupTransform.height = emuToPixels(ext.attributes?.["cy"] || 0);
|
|
28688
|
+
}
|
|
28689
|
+
if (chOff) {
|
|
28690
|
+
groupTransform.childX = emuToPixels(chOff.attributes?.["x"] || 0);
|
|
28691
|
+
groupTransform.childY = emuToPixels(chOff.attributes?.["y"] || 0);
|
|
28692
|
+
groupTransform.childOriginXEmu = parseFloat(chOff.attributes?.["x"] || 0);
|
|
28693
|
+
groupTransform.childOriginYEmu = parseFloat(chOff.attributes?.["y"] || 0);
|
|
28694
|
+
}
|
|
28695
|
+
if (chExt) {
|
|
28696
|
+
groupTransform.childWidth = emuToPixels(chExt.attributes?.["cx"] || 0);
|
|
28697
|
+
groupTransform.childHeight = emuToPixels(chExt.attributes?.["cy"] || 0);
|
|
28698
|
+
}
|
|
28699
|
+
}
|
|
28700
|
+
const childShapes = wgp.elements.filter((el) => el.name === "wps:wsp");
|
|
28701
|
+
const shapes = childShapes.map((wsp) => {
|
|
28702
|
+
const spPr = wsp.elements?.find((el) => el.name === "wps:spPr");
|
|
28703
|
+
if (!spPr) return null;
|
|
28704
|
+
const prstGeom = spPr.elements?.find((el) => el.name === "a:prstGeom");
|
|
28705
|
+
const shapeKind = prstGeom?.attributes?.["prst"];
|
|
28706
|
+
const shapeXfrm = spPr.elements?.find((el) => el.name === "a:xfrm");
|
|
28707
|
+
const shapeOff = shapeXfrm?.elements?.find((el) => el.name === "a:off");
|
|
28708
|
+
const shapeExt = shapeXfrm?.elements?.find((el) => el.name === "a:ext");
|
|
28709
|
+
const rawX = shapeOff?.attributes?.["x"] ? parseFloat(shapeOff.attributes["x"]) : 0;
|
|
28710
|
+
const rawY = shapeOff?.attributes?.["y"] ? parseFloat(shapeOff.attributes["y"]) : 0;
|
|
28711
|
+
const rawWidth = shapeExt?.attributes?.["cx"] ? parseFloat(shapeExt.attributes["cx"]) : 914400;
|
|
28712
|
+
const rawHeight = shapeExt?.attributes?.["cy"] ? parseFloat(shapeExt.attributes["cy"]) : 914400;
|
|
28713
|
+
let x2, y2, width, height;
|
|
28714
|
+
if (groupTransform.childWidth && groupTransform.childHeight) {
|
|
28715
|
+
const scaleX = groupTransform.width / groupTransform.childWidth;
|
|
28716
|
+
const scaleY = groupTransform.height / groupTransform.childHeight;
|
|
28717
|
+
const childOriginX = groupTransform.childOriginXEmu || 0;
|
|
28718
|
+
const childOriginY = groupTransform.childOriginYEmu || 0;
|
|
28719
|
+
x2 = groupTransform.x + emuToPixels((rawX - childOriginX) * scaleX);
|
|
28720
|
+
y2 = groupTransform.y + emuToPixels((rawY - childOriginY) * scaleY);
|
|
28721
|
+
width = emuToPixels(rawWidth * scaleX);
|
|
28722
|
+
height = emuToPixels(rawHeight * scaleY);
|
|
28723
|
+
} else {
|
|
28724
|
+
x2 = emuToPixels(rawX);
|
|
28725
|
+
y2 = emuToPixels(rawY);
|
|
28726
|
+
width = emuToPixels(rawWidth);
|
|
28727
|
+
height = emuToPixels(rawHeight);
|
|
28728
|
+
}
|
|
28729
|
+
const rotation = shapeXfrm?.attributes?.["rot"] ? rotToDegrees(shapeXfrm.attributes["rot"]) : 0;
|
|
28730
|
+
const flipH = shapeXfrm?.attributes?.["flipH"] === "1";
|
|
28731
|
+
const flipV = shapeXfrm?.attributes?.["flipV"] === "1";
|
|
28732
|
+
const style = wsp.elements?.find((el) => el.name === "wps:style");
|
|
28733
|
+
const fillColor = extractFillColor(spPr, style);
|
|
28734
|
+
const strokeColor = extractStrokeColor(spPr, style);
|
|
28735
|
+
const strokeWidth = extractStrokeWidth(spPr);
|
|
28736
|
+
const cNvPr = wsp.elements?.find((el) => el.name === "wps:cNvPr");
|
|
28737
|
+
const shapeId = cNvPr?.attributes?.["id"];
|
|
28738
|
+
const shapeName = cNvPr?.attributes?.["name"];
|
|
28739
|
+
return {
|
|
28740
|
+
shapeType: "vectorShape",
|
|
28741
|
+
attrs: {
|
|
28742
|
+
kind: shapeKind,
|
|
28743
|
+
x: x2,
|
|
28744
|
+
y: y2,
|
|
28745
|
+
width,
|
|
28746
|
+
height,
|
|
28747
|
+
rotation,
|
|
28748
|
+
flipH,
|
|
28749
|
+
flipV,
|
|
28750
|
+
fillColor,
|
|
28751
|
+
strokeColor,
|
|
28752
|
+
strokeWidth,
|
|
28753
|
+
shapeId,
|
|
28754
|
+
shapeName
|
|
28755
|
+
}
|
|
28756
|
+
};
|
|
28757
|
+
}).filter(Boolean);
|
|
28758
|
+
const schemaAttrs = {};
|
|
28759
|
+
const drawingNode = params.nodes?.[0];
|
|
28760
|
+
if (drawingNode?.name === DRAWING_XML_TAG) {
|
|
28761
|
+
schemaAttrs.drawingContent = drawingNode;
|
|
28762
|
+
}
|
|
28763
|
+
const result = {
|
|
28764
|
+
type: "shapeGroup",
|
|
28765
|
+
attrs: {
|
|
28766
|
+
...schemaAttrs,
|
|
28767
|
+
groupTransform,
|
|
28768
|
+
shapes,
|
|
28769
|
+
size,
|
|
28770
|
+
padding,
|
|
28771
|
+
marginOffset
|
|
28772
|
+
}
|
|
28773
|
+
};
|
|
28774
|
+
return result;
|
|
28775
|
+
};
|
|
28659
28776
|
const getRectangleShape = (params, node) => {
|
|
28660
28777
|
const schemaAttrs = {};
|
|
28661
28778
|
const [drawingNode] = params.nodes;
|
|
@@ -29098,6 +29215,30 @@ function translateVectorShape(params) {
|
|
|
29098
29215
|
};
|
|
29099
29216
|
return wrapTextInRun(alternateContent);
|
|
29100
29217
|
}
|
|
29218
|
+
function translateShapeGroup(params) {
|
|
29219
|
+
const { node } = params;
|
|
29220
|
+
const { drawingContent } = node.attrs;
|
|
29221
|
+
if (drawingContent) {
|
|
29222
|
+
const drawing = {
|
|
29223
|
+
name: "w:drawing",
|
|
29224
|
+
elements: [...drawingContent.elements || []]
|
|
29225
|
+
};
|
|
29226
|
+
const choice = {
|
|
29227
|
+
name: "mc:Choice",
|
|
29228
|
+
attributes: { Requires: "wpg" },
|
|
29229
|
+
elements: [drawing]
|
|
29230
|
+
};
|
|
29231
|
+
const alternateContent = {
|
|
29232
|
+
name: "mc:AlternateContent",
|
|
29233
|
+
elements: [choice]
|
|
29234
|
+
};
|
|
29235
|
+
return wrapTextInRun(alternateContent);
|
|
29236
|
+
}
|
|
29237
|
+
return wrapTextInRun({
|
|
29238
|
+
name: "w:drawing",
|
|
29239
|
+
elements: []
|
|
29240
|
+
});
|
|
29241
|
+
}
|
|
29101
29242
|
function translateAnchorNode(params) {
|
|
29102
29243
|
const { attrs } = params.node;
|
|
29103
29244
|
const anchorElements = [];
|
|
@@ -29261,11 +29402,11 @@ function translateAnchorNode(params) {
|
|
|
29261
29402
|
};
|
|
29262
29403
|
}
|
|
29263
29404
|
const XML_NODE_NAME$f = "wp:anchor";
|
|
29264
|
-
const SD_NODE_NAME$c = ["image"];
|
|
29405
|
+
const SD_NODE_NAME$c = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
29265
29406
|
const validXmlAttributes$a = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29266
29407
|
function encode$l(params) {
|
|
29267
29408
|
const { node } = params.extraParams;
|
|
29268
|
-
if (!node || !node.
|
|
29409
|
+
if (!node || !node.name) {
|
|
29269
29410
|
return null;
|
|
29270
29411
|
}
|
|
29271
29412
|
return handleAnchorNode(params);
|
|
@@ -29302,11 +29443,11 @@ function translateInlineNode(params) {
|
|
|
29302
29443
|
};
|
|
29303
29444
|
}
|
|
29304
29445
|
const XML_NODE_NAME$e = "wp:inline";
|
|
29305
|
-
const SD_NODE_NAME$b = ["image"];
|
|
29446
|
+
const SD_NODE_NAME$b = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
29306
29447
|
const validXmlAttributes$9 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29307
29448
|
function encode$k(params) {
|
|
29308
29449
|
const { node } = params.extraParams;
|
|
29309
|
-
if (!node || !node.
|
|
29450
|
+
if (!node || !node.name) {
|
|
29310
29451
|
return null;
|
|
29311
29452
|
}
|
|
29312
29453
|
return handleInlineNode(params);
|
|
@@ -32727,6 +32868,7 @@ const bookmarkEndNodeHandlerEntity = {
|
|
|
32727
32868
|
};
|
|
32728
32869
|
const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
32729
32870
|
"wps",
|
|
32871
|
+
"wpg",
|
|
32730
32872
|
"wp14",
|
|
32731
32873
|
"w14",
|
|
32732
32874
|
"w15",
|
|
@@ -34662,6 +34804,7 @@ function exportSchemaToJson(params) {
|
|
|
34662
34804
|
shapeTextbox: translator,
|
|
34663
34805
|
contentBlock: translator,
|
|
34664
34806
|
vectorShape: translateVectorShape,
|
|
34807
|
+
shapeGroup: translateShapeGroup,
|
|
34665
34808
|
structuredContent: translator$r,
|
|
34666
34809
|
structuredContentBlock: translator$r,
|
|
34667
34810
|
documentPartObject: translator$r,
|
|
@@ -35674,7 +35817,6 @@ const mergeRelationshipElements = (existingRelationships = [], newRelationships
|
|
|
35674
35817
|
const currentId = attributes.Id || "";
|
|
35675
35818
|
attributes.Target = attributes?.Target?.replace(/&/g, "&");
|
|
35676
35819
|
const existingTarget = existingRelationships.find((el) => el.attributes.Target === attributes.Target);
|
|
35677
|
-
attributes.Target?.startsWith("media/");
|
|
35678
35820
|
const isNewHyperlink = attributes.Type === HYPERLINK_RELATIONSHIP_TYPE && currentId.length > 6;
|
|
35679
35821
|
const isNewHeadFoot = (attributes.Type === HEADER_RELATIONSHIP_TYPE || attributes.Type === FOOTER_RELATIONSHIP_TYPE) && currentId.length > 6;
|
|
35680
35822
|
const hasSeenId = currentId && seenIds.has(currentId);
|
|
@@ -35903,7 +36045,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
35903
36045
|
static getStoredSuperdocVersion(docx) {
|
|
35904
36046
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
35905
36047
|
}
|
|
35906
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.29.0-next.
|
|
36048
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.29.0-next.15") {
|
|
35907
36049
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
35908
36050
|
}
|
|
35909
36051
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-Bt0gPwYj.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
|
}
|
|
@@ -12,8 +12,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, applyIndentStyling_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-
|
|
16
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-Bt0gPwYj.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-JVCnlDBn.js";
|
|
17
17
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
@@ -15072,7 +15072,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
15072
15072
|
{ default: remarkStringify },
|
|
15073
15073
|
{ default: remarkGfm }
|
|
15074
15074
|
] = await Promise.all([
|
|
15075
|
-
import("./index-
|
|
15075
|
+
import("./index-x0B8ORNX.js"),
|
|
15076
15076
|
import("./index-DRCvimau.js"),
|
|
15077
15077
|
import("./index-C_x_N6Uh.js"),
|
|
15078
15078
|
import("./index-D_sWOSiG.js"),
|
|
@@ -15290,7 +15290,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
15290
15290
|
* @returns {Object | void} Migration results
|
|
15291
15291
|
*/
|
|
15292
15292
|
processCollaborationMigrations() {
|
|
15293
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.29.0-next.
|
|
15293
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.29.0-next.15");
|
|
15294
15294
|
if (!this.options.ydoc) return;
|
|
15295
15295
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
15296
15296
|
let docVersion = metaMap.get("version");
|
|
@@ -31470,6 +31470,255 @@ const VectorShape = Node$1.create({
|
|
|
31470
31470
|
};
|
|
31471
31471
|
}
|
|
31472
31472
|
});
|
|
31473
|
+
class ShapeGroupView {
|
|
31474
|
+
constructor(props) {
|
|
31475
|
+
__publicField(this, "node");
|
|
31476
|
+
__publicField(this, "view");
|
|
31477
|
+
__publicField(this, "getPos");
|
|
31478
|
+
__publicField(this, "decorations");
|
|
31479
|
+
__publicField(this, "innerDecorations");
|
|
31480
|
+
__publicField(this, "editor");
|
|
31481
|
+
__publicField(this, "extension");
|
|
31482
|
+
__publicField(this, "htmlAttributes");
|
|
31483
|
+
__publicField(this, "root");
|
|
31484
|
+
this.node = props.node;
|
|
31485
|
+
this.view = props.editor.view;
|
|
31486
|
+
this.getPos = props.getPos;
|
|
31487
|
+
this.decorations = props.decorations;
|
|
31488
|
+
this.innerDecorations = props.innerDecorations;
|
|
31489
|
+
this.editor = props.editor;
|
|
31490
|
+
this.extension = props.extension;
|
|
31491
|
+
this.htmlAttributes = props.htmlAttributes;
|
|
31492
|
+
this.mount();
|
|
31493
|
+
}
|
|
31494
|
+
mount() {
|
|
31495
|
+
this.buildView();
|
|
31496
|
+
}
|
|
31497
|
+
get dom() {
|
|
31498
|
+
return this.root;
|
|
31499
|
+
}
|
|
31500
|
+
get contentDOM() {
|
|
31501
|
+
return null;
|
|
31502
|
+
}
|
|
31503
|
+
createElement() {
|
|
31504
|
+
const attrs = this.node.attrs;
|
|
31505
|
+
const { groupTransform, shapes, size } = attrs;
|
|
31506
|
+
const container = document.createElement("div");
|
|
31507
|
+
container.classList.add("sd-shape-group");
|
|
31508
|
+
container.setAttribute("data-shape-group", "");
|
|
31509
|
+
const width = size?.width || groupTransform?.width || 300;
|
|
31510
|
+
const height = size?.height || groupTransform?.height || 200;
|
|
31511
|
+
container.style.width = `${width}px`;
|
|
31512
|
+
container.style.height = `${height}px`;
|
|
31513
|
+
container.style.position = "relative";
|
|
31514
|
+
container.style.display = "inline-block";
|
|
31515
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
31516
|
+
svg.setAttribute("version", "1.1");
|
|
31517
|
+
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
31518
|
+
svg.setAttribute("width", width.toString());
|
|
31519
|
+
svg.setAttribute("height", height.toString());
|
|
31520
|
+
svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
31521
|
+
svg.style.display = "block";
|
|
31522
|
+
if (shapes && Array.isArray(shapes)) {
|
|
31523
|
+
shapes.forEach((shape) => {
|
|
31524
|
+
if (shape.shapeType === "vectorShape") {
|
|
31525
|
+
const shapeElement = this.createShapeElement(shape, groupTransform);
|
|
31526
|
+
if (shapeElement) {
|
|
31527
|
+
svg.appendChild(shapeElement);
|
|
31528
|
+
}
|
|
31529
|
+
}
|
|
31530
|
+
});
|
|
31531
|
+
}
|
|
31532
|
+
container.appendChild(svg);
|
|
31533
|
+
return { element: container };
|
|
31534
|
+
}
|
|
31535
|
+
createShapeElement(shape, groupTransform) {
|
|
31536
|
+
const attrs = shape.attrs;
|
|
31537
|
+
if (!attrs) return null;
|
|
31538
|
+
const x = attrs.x || 0;
|
|
31539
|
+
const y = attrs.y || 0;
|
|
31540
|
+
const width = attrs.width || 100;
|
|
31541
|
+
const height = attrs.height || 100;
|
|
31542
|
+
const g = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
31543
|
+
const transforms = [];
|
|
31544
|
+
transforms.push(`translate(${x}, ${y})`);
|
|
31545
|
+
if (attrs.rotation !== 0) {
|
|
31546
|
+
transforms.push(`rotate(${attrs.rotation} ${width / 2} ${height / 2})`);
|
|
31547
|
+
}
|
|
31548
|
+
if (attrs.flipH) {
|
|
31549
|
+
transforms.push(`scale(-1, 1) translate(${-width}, 0)`);
|
|
31550
|
+
}
|
|
31551
|
+
if (attrs.flipV) {
|
|
31552
|
+
transforms.push(`scale(1, -1) translate(0, ${-height})`);
|
|
31553
|
+
}
|
|
31554
|
+
if (transforms.length > 0) {
|
|
31555
|
+
g.setAttribute("transform", transforms.join(" "));
|
|
31556
|
+
}
|
|
31557
|
+
const shapeKind = attrs.kind || "rect";
|
|
31558
|
+
const fillColor = attrs.fillColor || "#5b9bd5";
|
|
31559
|
+
const strokeColor = attrs.strokeColor || "#000000";
|
|
31560
|
+
const strokeWidth = attrs.strokeWidth || 1;
|
|
31561
|
+
try {
|
|
31562
|
+
const svgContent = k({
|
|
31563
|
+
preset: shapeKind,
|
|
31564
|
+
styleOverrides: {
|
|
31565
|
+
fill: fillColor || "none",
|
|
31566
|
+
stroke: strokeColor || "none",
|
|
31567
|
+
strokeWidth: strokeWidth || 0
|
|
31568
|
+
},
|
|
31569
|
+
width,
|
|
31570
|
+
height
|
|
31571
|
+
});
|
|
31572
|
+
if (svgContent) {
|
|
31573
|
+
const tempDiv = document.createElement("div");
|
|
31574
|
+
tempDiv.innerHTML = svgContent;
|
|
31575
|
+
const svgElement = tempDiv.querySelector("svg");
|
|
31576
|
+
if (svgElement) {
|
|
31577
|
+
Array.from(svgElement.children).forEach((child) => {
|
|
31578
|
+
const clonedChild = child.cloneNode(true);
|
|
31579
|
+
if (clonedChild.tagName === "ellipse") {
|
|
31580
|
+
clonedChild.setAttribute("cx", (width / 2).toString());
|
|
31581
|
+
clonedChild.setAttribute("cy", (height / 2).toString());
|
|
31582
|
+
clonedChild.setAttribute("rx", (width / 2).toString());
|
|
31583
|
+
clonedChild.setAttribute("ry", (height / 2).toString());
|
|
31584
|
+
} else if (clonedChild.tagName === "circle") {
|
|
31585
|
+
if (width !== height) {
|
|
31586
|
+
const ellipse = document.createElementNS("http://www.w3.org/2000/svg", "ellipse");
|
|
31587
|
+
ellipse.setAttribute("cx", (width / 2).toString());
|
|
31588
|
+
ellipse.setAttribute("cy", (height / 2).toString());
|
|
31589
|
+
ellipse.setAttribute("rx", (width / 2).toString());
|
|
31590
|
+
ellipse.setAttribute("ry", (height / 2).toString());
|
|
31591
|
+
Array.from(clonedChild.attributes).forEach((attr) => {
|
|
31592
|
+
if (!["cx", "cy", "r"].includes(attr.name)) {
|
|
31593
|
+
ellipse.setAttribute(attr.name, attr.value);
|
|
31594
|
+
}
|
|
31595
|
+
});
|
|
31596
|
+
g.appendChild(ellipse);
|
|
31597
|
+
return;
|
|
31598
|
+
} else {
|
|
31599
|
+
clonedChild.setAttribute("cx", (width / 2).toString());
|
|
31600
|
+
clonedChild.setAttribute("cy", (height / 2).toString());
|
|
31601
|
+
clonedChild.setAttribute("r", (width / 2).toString());
|
|
31602
|
+
}
|
|
31603
|
+
} else if (clonedChild.tagName === "rect") {
|
|
31604
|
+
clonedChild.setAttribute("width", width.toString());
|
|
31605
|
+
clonedChild.setAttribute("height", height.toString());
|
|
31606
|
+
} else if (clonedChild.tagName === "path" && svgElement.hasAttribute("viewBox")) {
|
|
31607
|
+
const viewBox = svgElement.getAttribute("viewBox").split(" ").map(Number);
|
|
31608
|
+
if (viewBox.length === 4) {
|
|
31609
|
+
const [, , vbWidth, vbHeight] = viewBox;
|
|
31610
|
+
const scaleX = width / vbWidth;
|
|
31611
|
+
const scaleY = height / vbHeight;
|
|
31612
|
+
if (scaleX !== 1 || scaleY !== 1) {
|
|
31613
|
+
const pathTransform = `scale(${scaleX}, ${scaleY})`;
|
|
31614
|
+
const existingTransform = clonedChild.getAttribute("transform");
|
|
31615
|
+
clonedChild.setAttribute(
|
|
31616
|
+
"transform",
|
|
31617
|
+
existingTransform ? `${existingTransform} ${pathTransform}` : pathTransform
|
|
31618
|
+
);
|
|
31619
|
+
}
|
|
31620
|
+
}
|
|
31621
|
+
} else if (clonedChild.hasAttribute("width")) {
|
|
31622
|
+
clonedChild.setAttribute("width", width.toString());
|
|
31623
|
+
}
|
|
31624
|
+
if (clonedChild.hasAttribute("height") && clonedChild.tagName !== "ellipse") {
|
|
31625
|
+
clonedChild.setAttribute("height", height.toString());
|
|
31626
|
+
}
|
|
31627
|
+
g.appendChild(clonedChild);
|
|
31628
|
+
});
|
|
31629
|
+
}
|
|
31630
|
+
}
|
|
31631
|
+
} catch (error) {
|
|
31632
|
+
console.warn("Failed to generate shape SVG:", error);
|
|
31633
|
+
const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
31634
|
+
rect.setAttribute("width", width.toString());
|
|
31635
|
+
rect.setAttribute("height", height.toString());
|
|
31636
|
+
rect.setAttribute("fill", fillColor);
|
|
31637
|
+
rect.setAttribute("stroke", strokeColor);
|
|
31638
|
+
rect.setAttribute("stroke-width", strokeWidth.toString());
|
|
31639
|
+
g.appendChild(rect);
|
|
31640
|
+
}
|
|
31641
|
+
return g;
|
|
31642
|
+
}
|
|
31643
|
+
buildView() {
|
|
31644
|
+
const { element } = this.createElement();
|
|
31645
|
+
this.root = element;
|
|
31646
|
+
}
|
|
31647
|
+
update() {
|
|
31648
|
+
return false;
|
|
31649
|
+
}
|
|
31650
|
+
}
|
|
31651
|
+
const ShapeGroup = Node$1.create({
|
|
31652
|
+
name: "shapeGroup",
|
|
31653
|
+
group: "inline",
|
|
31654
|
+
inline: true,
|
|
31655
|
+
atom: true,
|
|
31656
|
+
addOptions() {
|
|
31657
|
+
return {
|
|
31658
|
+
htmlAttributes: {
|
|
31659
|
+
contenteditable: false
|
|
31660
|
+
}
|
|
31661
|
+
};
|
|
31662
|
+
},
|
|
31663
|
+
addAttributes() {
|
|
31664
|
+
return {
|
|
31665
|
+
groupTransform: {
|
|
31666
|
+
default: {},
|
|
31667
|
+
renderDOM: () => ({})
|
|
31668
|
+
},
|
|
31669
|
+
shapes: {
|
|
31670
|
+
default: [],
|
|
31671
|
+
renderDOM: () => ({})
|
|
31672
|
+
},
|
|
31673
|
+
size: {
|
|
31674
|
+
default: null,
|
|
31675
|
+
renderDOM: (attrs) => {
|
|
31676
|
+
if (!attrs.size) return {};
|
|
31677
|
+
const sizeData = {};
|
|
31678
|
+
if (attrs.size.width) sizeData["data-width"] = attrs.size.width;
|
|
31679
|
+
if (attrs.size.height) sizeData["data-height"] = attrs.size.height;
|
|
31680
|
+
return sizeData;
|
|
31681
|
+
}
|
|
31682
|
+
},
|
|
31683
|
+
padding: {
|
|
31684
|
+
default: null,
|
|
31685
|
+
renderDOM: (attrs) => {
|
|
31686
|
+
if (!attrs.padding) return {};
|
|
31687
|
+
const paddingData = {};
|
|
31688
|
+
if (attrs.padding.top != null) paddingData["data-padding-top"] = attrs.padding.top;
|
|
31689
|
+
if (attrs.padding.right != null) paddingData["data-padding-right"] = attrs.padding.right;
|
|
31690
|
+
if (attrs.padding.bottom != null) paddingData["data-padding-bottom"] = attrs.padding.bottom;
|
|
31691
|
+
if (attrs.padding.left != null) paddingData["data-padding-left"] = attrs.padding.left;
|
|
31692
|
+
return paddingData;
|
|
31693
|
+
}
|
|
31694
|
+
},
|
|
31695
|
+
marginOffset: {
|
|
31696
|
+
default: null,
|
|
31697
|
+
renderDOM: (attrs) => {
|
|
31698
|
+
if (!attrs.marginOffset) return {};
|
|
31699
|
+
const offsetData = {};
|
|
31700
|
+
if (attrs.marginOffset.horizontal != null) offsetData["data-offset-x"] = attrs.marginOffset.horizontal;
|
|
31701
|
+
if (attrs.marginOffset.top != null) offsetData["data-offset-y"] = attrs.marginOffset.top;
|
|
31702
|
+
return offsetData;
|
|
31703
|
+
}
|
|
31704
|
+
},
|
|
31705
|
+
drawingContent: {
|
|
31706
|
+
rendered: false
|
|
31707
|
+
}
|
|
31708
|
+
};
|
|
31709
|
+
},
|
|
31710
|
+
parseDOM() {
|
|
31711
|
+
return false;
|
|
31712
|
+
},
|
|
31713
|
+
renderDOM({ htmlAttributes }) {
|
|
31714
|
+
return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-shape-group": "" })];
|
|
31715
|
+
},
|
|
31716
|
+
addNodeView() {
|
|
31717
|
+
return (props) => {
|
|
31718
|
+
return new ShapeGroupView({ ...props });
|
|
31719
|
+
};
|
|
31720
|
+
}
|
|
31721
|
+
});
|
|
31473
31722
|
const TextStyle = Mark.create({
|
|
31474
31723
|
name: "textStyle",
|
|
31475
31724
|
addOptions() {
|
|
@@ -37710,6 +37959,7 @@ function validRegExp(source) {
|
|
|
37710
37959
|
}
|
|
37711
37960
|
}
|
|
37712
37961
|
const TextContentCache = /* @__PURE__ */ new WeakMap();
|
|
37962
|
+
const transparentInlineNodes = /* @__PURE__ */ new Set(["run", "bookmarkStart"]);
|
|
37713
37963
|
function textContent(node) {
|
|
37714
37964
|
let cached = TextContentCache.get(node);
|
|
37715
37965
|
if (cached) return cached;
|
|
@@ -37718,7 +37968,7 @@ function textContent(node) {
|
|
|
37718
37968
|
let child = node.child(i);
|
|
37719
37969
|
if (child.isText) content += child.text;
|
|
37720
37970
|
else if (child.isLeaf) content += "";
|
|
37721
|
-
else if (child.type && child.type.name
|
|
37971
|
+
else if (child.type && transparentInlineNodes.has(child.type.name)) content += textContent(child);
|
|
37722
37972
|
else content += " " + textContent(child) + " ";
|
|
37723
37973
|
}
|
|
37724
37974
|
TextContentCache.set(node, content);
|
|
@@ -37769,7 +38019,6 @@ function mapIndexWithinNode(node, start2, index2) {
|
|
|
37769
38019
|
}
|
|
37770
38020
|
return start2 + node.content.size;
|
|
37771
38021
|
}
|
|
37772
|
-
const transparentInlineNodes = /* @__PURE__ */ new Set(["run"]);
|
|
37773
38022
|
function scanTextblocks(node, from2, to, f2, nodeStart = 0) {
|
|
37774
38023
|
const isTransparentInline = node.inlineContent && node.type && transparentInlineNodes.has(node.type.name);
|
|
37775
38024
|
if (node.inlineContent && !isTransparentInline) {
|
|
@@ -38367,7 +38616,8 @@ const getStarterExtensions = () => {
|
|
|
38367
38616
|
NodeResizer,
|
|
38368
38617
|
CustomSelection,
|
|
38369
38618
|
TextTransform,
|
|
38370
|
-
VectorShape
|
|
38619
|
+
VectorShape,
|
|
38620
|
+
ShapeGroup
|
|
38371
38621
|
];
|
|
38372
38622
|
};
|
|
38373
38623
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-Bt0gPwYj.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BF7w_sd7.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-BF7w_sd7.js";
|
|
2
|
+
import "./chunks/converter-Bt0gPwYj.js";
|
|
3
|
+
import "./chunks/docx-zipper-JVCnlDBn.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|