@superdoc-dev/cli 0.3.0-next.4 → 0.3.0-next.5
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 +17 -3
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -131315,7 +131315,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
131315
131315
|
init_remark_gfm_z_sDF4ss_es();
|
|
131316
131316
|
});
|
|
131317
131317
|
|
|
131318
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
131318
|
+
// ../../packages/superdoc/dist/chunks/src-BQ8I1JWL.es.js
|
|
131319
131319
|
function deleteProps(obj, propOrProps) {
|
|
131320
131320
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
131321
131321
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -189822,6 +189822,13 @@ function scrollToElement(targetElement, options = {
|
|
|
189822
189822
|
behavior: options.behavior
|
|
189823
189823
|
});
|
|
189824
189824
|
}
|
|
189825
|
+
function getParagraphFontFamilyFromProperties(paragraphProps, convertedXml = {}) {
|
|
189826
|
+
const fontFamilyProps = paragraphProps?.runProperties?.fontFamily;
|
|
189827
|
+
if (!fontFamilyProps)
|
|
189828
|
+
return null;
|
|
189829
|
+
const [markDef] = encodeMarksFromRPr({ fontFamily: fontFamilyProps }, convertedXml);
|
|
189830
|
+
return markDef?.attrs?.fontFamily ?? null;
|
|
189831
|
+
}
|
|
189825
189832
|
var Node$13 = class Node$14 {
|
|
189826
189833
|
constructor(config2) {
|
|
189827
189834
|
this.type = "node";
|
|
@@ -217740,7 +217747,7 @@ var Node$13 = class Node$14 {
|
|
|
217740
217747
|
return false;
|
|
217741
217748
|
return Boolean(checker(attrs));
|
|
217742
217749
|
}, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
|
|
217743
|
-
var
|
|
217750
|
+
var init_src_BQ8I1JWL_es = __esm(() => {
|
|
217744
217751
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
217745
217752
|
init_SuperConverter_C2Sw7Q5Z_es();
|
|
217746
217753
|
init_jszip_ChlR43oI_es();
|
|
@@ -251352,8 +251359,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
251352
251359
|
const inTable = isInTable(this.activeEditor.state);
|
|
251353
251360
|
const paragraphParent = findParentNode((n) => n.type.name === "paragraph")(selection);
|
|
251354
251361
|
const paragraphProps = paragraphParent ? calculateResolvedParagraphProperties(this.activeEditor, paragraphParent.node, state.doc.resolve(paragraphParent.pos)) : null;
|
|
251362
|
+
const selectionIsCollapsed = selection.empty;
|
|
251363
|
+
const paragraphIsEmpty = paragraphParent?.node?.content?.size === 0;
|
|
251364
|
+
const paragraphFontFamily = getParagraphFontFamilyFromProperties(paragraphProps, this.activeEditor?.converter?.convertedXml ?? {});
|
|
251355
251365
|
this.toolbarItems.forEach((item) => {
|
|
251356
251366
|
item.resetDisabled();
|
|
251367
|
+
let activatedFromLinkedStyle = false;
|
|
251357
251368
|
if (item.name.value === "undo")
|
|
251358
251369
|
item.setDisabled(this.undoDepth === 0);
|
|
251359
251370
|
if (item.name.value === "redo")
|
|
@@ -251390,10 +251401,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
251390
251401
|
const linkedStylesItem = linkedStyles.definition.styles[markToStyleMap[item.name.value]];
|
|
251391
251402
|
const value = { [item.name.value]: linkedStylesItem };
|
|
251392
251403
|
item.activate(value);
|
|
251404
|
+
activatedFromLinkedStyle = true;
|
|
251393
251405
|
}
|
|
251394
251406
|
}
|
|
251395
251407
|
if (item.name.value === "textAlign" && paragraphProps?.justification)
|
|
251396
251408
|
item.activate({ textAlign: paragraphProps.justification });
|
|
251409
|
+
if (item.name.value === "fontFamily" && selectionIsCollapsed && paragraphIsEmpty && !activeMark && !markNegated && !activatedFromLinkedStyle && paragraphFontFamily)
|
|
251410
|
+
item.activate({ fontFamily: paragraphFontFamily });
|
|
251397
251411
|
if (item.name.value === "lineHeight")
|
|
251398
251412
|
if (paragraphProps?.spacing)
|
|
251399
251413
|
item.selectedValue.value = twipsToLines(paragraphProps.spacing.line);
|
|
@@ -251836,7 +251850,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
251836
251850
|
|
|
251837
251851
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
251838
251852
|
var init_super_editor_es = __esm(() => {
|
|
251839
|
-
|
|
251853
|
+
init_src_BQ8I1JWL_es();
|
|
251840
251854
|
init_SuperConverter_C2Sw7Q5Z_es();
|
|
251841
251855
|
init_jszip_ChlR43oI_es();
|
|
251842
251856
|
init_xml_js_BtmJ6bNs_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"typescript": "^5.9.2",
|
|
23
23
|
"@superdoc/document-api": "0.0.1",
|
|
24
24
|
"@superdoc/super-editor": "0.0.1",
|
|
25
|
-
"
|
|
26
|
-
"superdoc": "
|
|
25
|
+
"superdoc": "1.19.0",
|
|
26
|
+
"@superdoc/pm-adapter": "0.0.0"
|
|
27
27
|
},
|
|
28
28
|
"module": "src/index.ts",
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@superdoc-dev/cli-darwin-arm64": "0.3.0-next.
|
|
34
|
-
"@superdoc-dev/cli-darwin-x64": "0.3.0-next.
|
|
35
|
-
"@superdoc-dev/cli-
|
|
36
|
-
"@superdoc-dev/cli-linux-arm64": "0.3.0-next.
|
|
37
|
-
"@superdoc-dev/cli-
|
|
33
|
+
"@superdoc-dev/cli-darwin-arm64": "0.3.0-next.5",
|
|
34
|
+
"@superdoc-dev/cli-darwin-x64": "0.3.0-next.5",
|
|
35
|
+
"@superdoc-dev/cli-linux-x64": "0.3.0-next.5",
|
|
36
|
+
"@superdoc-dev/cli-linux-arm64": "0.3.0-next.5",
|
|
37
|
+
"@superdoc-dev/cli-windows-x64": "0.3.0-next.5"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "bun run src/index.ts",
|