@superdoc-dev/cli 0.8.0-next.87 → 0.8.0-next.89
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/index.js +105 -37
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -208407,7 +208407,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
208407
208407
|
init_remark_gfm_BhnWr3yf_es();
|
|
208408
208408
|
});
|
|
208409
208409
|
|
|
208410
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
208410
|
+
// ../../packages/superdoc/dist/chunks/src-BLxaw1d3.es.js
|
|
208411
208411
|
function deleteProps(obj, propOrProps) {
|
|
208412
208412
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
208413
208413
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -293538,7 +293538,10 @@ menclose::after {
|
|
|
293538
293538
|
const attrs = block.attrs;
|
|
293539
293539
|
if (!attrs)
|
|
293540
293540
|
return false;
|
|
293541
|
-
const
|
|
293541
|
+
const directionContext = attrs.directionContext;
|
|
293542
|
+
if (directionContext?.inlineDirection != null)
|
|
293543
|
+
return directionContext.inlineDirection === "rtl";
|
|
293544
|
+
const directionAttr = attrs.direction ?? attrs.dir;
|
|
293542
293545
|
if (typeof directionAttr === "string" && directionAttr.toLowerCase() === "rtl")
|
|
293543
293546
|
return true;
|
|
293544
293547
|
return false;
|
|
@@ -294792,6 +294795,99 @@ menclose::after {
|
|
|
294792
294795
|
mutated = true;
|
|
294793
294796
|
}
|
|
294794
294797
|
return mutated ? mirrored : indent2;
|
|
294798
|
+
}, DEFAULT_PAGE_DIRECTION = "ltr", DEFAULT_WRITING_MODE = "horizontal-tb", isToggleOn = (val) => {
|
|
294799
|
+
if (val === undefined || val === null)
|
|
294800
|
+
return true;
|
|
294801
|
+
if (val === "0" || val === 0 || val === false)
|
|
294802
|
+
return false;
|
|
294803
|
+
if (val === "false" || val === "off")
|
|
294804
|
+
return false;
|
|
294805
|
+
return true;
|
|
294806
|
+
}, writingModeFromTextDirection$1 = (val) => {
|
|
294807
|
+
if (typeof val !== "string")
|
|
294808
|
+
return;
|
|
294809
|
+
switch (val) {
|
|
294810
|
+
case "lrTb":
|
|
294811
|
+
case "lrTbV":
|
|
294812
|
+
case "tb":
|
|
294813
|
+
case "tbV":
|
|
294814
|
+
return "horizontal-tb";
|
|
294815
|
+
case "tbRl":
|
|
294816
|
+
case "tbRlV":
|
|
294817
|
+
case "rl":
|
|
294818
|
+
case "rlV":
|
|
294819
|
+
return "vertical-rl";
|
|
294820
|
+
case "btLr":
|
|
294821
|
+
case "lr":
|
|
294822
|
+
case "lrV":
|
|
294823
|
+
case "tbLrV":
|
|
294824
|
+
return "vertical-lr";
|
|
294825
|
+
default:
|
|
294826
|
+
return;
|
|
294827
|
+
}
|
|
294828
|
+
}, resolveSectionDirection = (sectPr) => {
|
|
294829
|
+
let pageDirection = DEFAULT_PAGE_DIRECTION;
|
|
294830
|
+
let writingMode = DEFAULT_WRITING_MODE;
|
|
294831
|
+
let rtlGutter = false;
|
|
294832
|
+
if (sectPr && typeof sectPr === "object") {
|
|
294833
|
+
const elements = sectPr.elements;
|
|
294834
|
+
if (Array.isArray(elements))
|
|
294835
|
+
for (const el of elements) {
|
|
294836
|
+
if (!el?.name)
|
|
294837
|
+
continue;
|
|
294838
|
+
const val = el.attributes?.["w:val"] ?? el.attributes?.val;
|
|
294839
|
+
if (el.name === "w:bidi" && isToggleOn(val)) {
|
|
294840
|
+
pageDirection = "rtl";
|
|
294841
|
+
continue;
|
|
294842
|
+
}
|
|
294843
|
+
if (el.name === "w:textDirection") {
|
|
294844
|
+
const mode = writingModeFromTextDirection$1(val);
|
|
294845
|
+
if (mode)
|
|
294846
|
+
writingMode = mode;
|
|
294847
|
+
continue;
|
|
294848
|
+
}
|
|
294849
|
+
if (el.name === "w:rtlGutter" && isToggleOn(val)) {
|
|
294850
|
+
rtlGutter = true;
|
|
294851
|
+
continue;
|
|
294852
|
+
}
|
|
294853
|
+
}
|
|
294854
|
+
}
|
|
294855
|
+
return {
|
|
294856
|
+
pageDirection,
|
|
294857
|
+
writingMode,
|
|
294858
|
+
rtlGutter
|
|
294859
|
+
};
|
|
294860
|
+
}, writingModeFromTextDirection = (val) => {
|
|
294861
|
+
switch (val) {
|
|
294862
|
+
case "lrTb":
|
|
294863
|
+
case "lrTbV":
|
|
294864
|
+
case "tb":
|
|
294865
|
+
case "tbV":
|
|
294866
|
+
return "horizontal-tb";
|
|
294867
|
+
case "tbRl":
|
|
294868
|
+
case "tbRlV":
|
|
294869
|
+
case "rl":
|
|
294870
|
+
case "rlV":
|
|
294871
|
+
return "vertical-rl";
|
|
294872
|
+
case "btLr":
|
|
294873
|
+
case "lr":
|
|
294874
|
+
case "lrV":
|
|
294875
|
+
case "tbLrV":
|
|
294876
|
+
return "vertical-lr";
|
|
294877
|
+
default:
|
|
294878
|
+
return;
|
|
294879
|
+
}
|
|
294880
|
+
}, resolveParagraphDirection = (paragraphProperties, parentSection, parentCell) => {
|
|
294881
|
+
let inlineDirection;
|
|
294882
|
+
if (paragraphProperties?.rightToLeft === true)
|
|
294883
|
+
inlineDirection = "rtl";
|
|
294884
|
+
else if (paragraphProperties?.rightToLeft === false)
|
|
294885
|
+
inlineDirection = "ltr";
|
|
294886
|
+
const writingMode = writingModeFromTextDirection(paragraphProperties?.textDirection) ?? parentCell?.writingMode ?? parentSection.writingMode;
|
|
294887
|
+
return {
|
|
294888
|
+
inlineDirection,
|
|
294889
|
+
writingMode
|
|
294890
|
+
};
|
|
294795
294891
|
}, DEFAULT_DECIMAL_SEPARATOR$1 = ".", DEFAULT_TAB_INTERVAL_TWIPS$1 = 720, normalizeColor$1 = (value) => {
|
|
294796
294892
|
if (typeof value !== "string")
|
|
294797
294893
|
return;
|
|
@@ -294809,37 +294905,6 @@ menclose::after {
|
|
|
294809
294905
|
if (Object.prototype.hasOwnProperty.call(obj, key2))
|
|
294810
294906
|
clone[key2] = deepClone3(obj[key2]);
|
|
294811
294907
|
return clone;
|
|
294812
|
-
}, inferDirectionFromRuns = (para) => {
|
|
294813
|
-
const content3 = Array.isArray(para.content) ? para.content : [];
|
|
294814
|
-
let hasExplicitRtl = false;
|
|
294815
|
-
let hasExplicitLtr = false;
|
|
294816
|
-
for (const node3 of content3) {
|
|
294817
|
-
if (node3?.type !== "run")
|
|
294818
|
-
continue;
|
|
294819
|
-
const runProps = node3.attrs?.runProperties ?? {};
|
|
294820
|
-
const runDirection = runProps.rightToLeft ?? runProps.rtl;
|
|
294821
|
-
if (runDirection === true) {
|
|
294822
|
-
hasExplicitRtl = true;
|
|
294823
|
-
continue;
|
|
294824
|
-
}
|
|
294825
|
-
if (runDirection === false)
|
|
294826
|
-
hasExplicitLtr = true;
|
|
294827
|
-
}
|
|
294828
|
-
if (!hasExplicitRtl && !hasExplicitLtr)
|
|
294829
|
-
return;
|
|
294830
|
-
if (hasExplicitLtr)
|
|
294831
|
-
return;
|
|
294832
|
-
return "rtl";
|
|
294833
|
-
}, resolveEffectiveParagraphDirection = (para, resolvedParagraphProperties, _sectionDirection, docDefaultsDirection) => {
|
|
294834
|
-
if (resolvedParagraphProperties.rightToLeft === true)
|
|
294835
|
-
return "rtl";
|
|
294836
|
-
if (resolvedParagraphProperties.rightToLeft === false)
|
|
294837
|
-
return "ltr";
|
|
294838
|
-
const inferredFromRuns = inferDirectionFromRuns(para);
|
|
294839
|
-
if (inferredFromRuns)
|
|
294840
|
-
return inferredFromRuns;
|
|
294841
|
-
if (docDefaultsDirection)
|
|
294842
|
-
return docDefaultsDirection;
|
|
294843
294908
|
}, normalizeIndentTwipsToPx = (indent2) => {
|
|
294844
294909
|
if (!indent2)
|
|
294845
294910
|
return;
|
|
@@ -294962,7 +295027,9 @@ menclose::after {
|
|
|
294962
295027
|
resolvedParagraphProperties = paragraphProperties;
|
|
294963
295028
|
else
|
|
294964
295029
|
resolvedParagraphProperties = resolveParagraphProperties(converterContext, paragraphProperties, converterContext.tableInfo);
|
|
294965
|
-
const
|
|
295030
|
+
const sectionContext = resolveSectionDirection(undefined);
|
|
295031
|
+
const directionContext = resolveParagraphDirection(resolvedParagraphProperties, sectionContext);
|
|
295032
|
+
const normalizedDirection = directionContext.inlineDirection;
|
|
294966
295033
|
const isRtl = normalizedDirection === "rtl";
|
|
294967
295034
|
const normalizedSpacing = normalizeParagraphSpacing(resolvedParagraphProperties.spacing, Boolean(resolvedParagraphProperties.numberingProperties));
|
|
294968
295035
|
const normalizedIndentBase = normalizeIndentTwipsToPx(resolveLogicalIndentToPhysical(resolvedParagraphProperties.indent, normalizedDirection));
|
|
@@ -294996,7 +295063,8 @@ menclose::after {
|
|
|
294996
295063
|
keepLines: resolvedParagraphProperties.keepLines,
|
|
294997
295064
|
floatAlignment,
|
|
294998
295065
|
pageBreakBefore: resolvedParagraphProperties.pageBreakBefore,
|
|
294999
|
-
...normalizedDirection ? { direction: normalizedDirection } : {}
|
|
295066
|
+
...normalizedDirection ? { direction: normalizedDirection } : {},
|
|
295067
|
+
directionContext
|
|
295000
295068
|
};
|
|
295001
295069
|
if (normalizedNumberingProperties && normalizedListRendering) {
|
|
295002
295070
|
const markerRunAttrs = computeRunAttrs(resolveRunProperties(converterContext, resolvedParagraphProperties.runProperties, resolvedParagraphProperties, converterContext.tableInfo, true, Boolean(paragraphProperties.numberingProperties)), converterContext);
|
|
@@ -301650,7 +301718,7 @@ menclose::after {
|
|
|
301650
301718
|
return;
|
|
301651
301719
|
console.log(...args$1);
|
|
301652
301720
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
|
|
301653
|
-
var
|
|
301721
|
+
var init_src_BLxaw1d3_es = __esm(() => {
|
|
301654
301722
|
init_rolldown_runtime_Bg48TavK_es();
|
|
301655
301723
|
init_SuperConverter_BecdrRIX_es();
|
|
301656
301724
|
init_jszip_C49i9kUs_es();
|
|
@@ -339544,7 +339612,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
|
|
|
339544
339612
|
|
|
339545
339613
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
339546
339614
|
var init_super_editor_es = __esm(() => {
|
|
339547
|
-
|
|
339615
|
+
init_src_BLxaw1d3_es();
|
|
339548
339616
|
init_SuperConverter_BecdrRIX_es();
|
|
339549
339617
|
init_jszip_C49i9kUs_es();
|
|
339550
339618
|
init_xml_js_CqGKpaft_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.89",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@types/ws": "^8.5.13",
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
27
|
"@superdoc/document-api": "0.0.1",
|
|
28
|
-
"@superdoc/pm-adapter": "0.0.0",
|
|
29
28
|
"@superdoc/super-editor": "0.0.1",
|
|
29
|
+
"@superdoc/pm-adapter": "0.0.0",
|
|
30
30
|
"superdoc": "1.31.0"
|
|
31
31
|
},
|
|
32
32
|
"module": "src/index.ts",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-x64": "0.8.0-next.
|
|
40
|
-
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.
|
|
41
|
-
"@superdoc-dev/cli-windows-x64": "0.8.0-next.
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.8.0-next.89",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.8.0-next.89",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.8.0-next.89",
|
|
40
|
+
"@superdoc-dev/cli-linux-arm64": "0.8.0-next.89",
|
|
41
|
+
"@superdoc-dev/cli-windows-x64": "0.8.0-next.89"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|