@superdoc-dev/cli 0.7.0-next.16 → 0.7.0-next.17
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 +43 -19
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -7984,6 +7984,7 @@ function buildContentControlSchemas() {
|
|
|
7984
7984
|
kind: { enum: ["block", "inline"] },
|
|
7985
7985
|
controlType: { type: "string" },
|
|
7986
7986
|
target: contentControlTargetSchema,
|
|
7987
|
+
at: selectionTargetSchema,
|
|
7987
7988
|
tag: { type: "string" },
|
|
7988
7989
|
alias: { type: "string" },
|
|
7989
7990
|
lockMode: { enum: ["unlocked", "sdtLocked", "contentLocked", "sdtContentLocked"] },
|
|
@@ -17670,9 +17671,15 @@ function executeCreateContentControl(adapter, input, options) {
|
|
|
17670
17671
|
if (input.lockMode !== undefined && !VALID_LOCK_MODES.has(input.lockMode)) {
|
|
17671
17672
|
throw new DocumentApiValidationError("INVALID_INPUT", `create.contentControl lockMode must be one of: ${[...VALID_LOCK_MODES].join(", ")}.`, { field: "lockMode", value: input.lockMode });
|
|
17672
17673
|
}
|
|
17674
|
+
if (input.at !== undefined && input.target !== undefined) {
|
|
17675
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `create.contentControl: "at" and "target" are mutually exclusive — provide one or neither.`, { field: "at" });
|
|
17676
|
+
}
|
|
17673
17677
|
if (input.target !== undefined) {
|
|
17674
17678
|
validateCCTarget(input.target, "create.contentControl");
|
|
17675
17679
|
}
|
|
17680
|
+
if (input.at !== undefined && !isSelectionTarget(input.at)) {
|
|
17681
|
+
throw new DocumentApiValidationError("INVALID_INPUT", `create.contentControl: "at" must be a valid SelectionTarget with kind "selection", start, and end.`, { field: "at", value: input.at });
|
|
17682
|
+
}
|
|
17676
17683
|
if (input.content !== undefined && typeof input.content !== "string") {
|
|
17677
17684
|
throw new DocumentApiValidationError("INVALID_INPUT", `create.contentControl content must be a string, got ${typeof input.content}.`, { field: "content", value: input.content });
|
|
17678
17685
|
}
|
|
@@ -17682,6 +17689,7 @@ var VALID_NODE_KINDS, VALID_LOCK_MODES, VALID_CC_TYPES, VALID_CC_APPEARANCES, VA
|
|
|
17682
17689
|
var init_content_controls = __esm(() => {
|
|
17683
17690
|
init_errors2();
|
|
17684
17691
|
init_validation_primitives();
|
|
17692
|
+
init_selection_target_validator();
|
|
17685
17693
|
init_content_controls_types();
|
|
17686
17694
|
init_base();
|
|
17687
17695
|
VALID_NODE_KINDS = new Set(NODE_KINDS);
|
|
@@ -65493,7 +65501,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
65493
65501
|
emptyOptions2 = {};
|
|
65494
65502
|
});
|
|
65495
65503
|
|
|
65496
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
65504
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-BgwP1GeS.es.js
|
|
65497
65505
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
65498
65506
|
const fieldValue = extension$1.config[field];
|
|
65499
65507
|
if (typeof fieldValue === "function")
|
|
@@ -67608,6 +67616,7 @@ function buildContentControlSchemas2() {
|
|
|
67608
67616
|
kind: { enum: ["block", "inline"] },
|
|
67609
67617
|
controlType: { type: "string" },
|
|
67610
67618
|
target: contentControlTargetSchema2,
|
|
67619
|
+
at: selectionTargetSchema2,
|
|
67611
67620
|
tag: { type: "string" },
|
|
67612
67621
|
alias: { type: "string" },
|
|
67613
67622
|
lockMode: { enum: [
|
|
@@ -71740,8 +71749,15 @@ function executeCreateContentControl2(adapter, input, options) {
|
|
|
71740
71749
|
field: "lockMode",
|
|
71741
71750
|
value: input.lockMode
|
|
71742
71751
|
});
|
|
71752
|
+
if (input.at !== undefined && input.target !== undefined)
|
|
71753
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `create.contentControl: "at" and "target" are mutually exclusive — provide one or neither.`, { field: "at" });
|
|
71743
71754
|
if (input.target !== undefined)
|
|
71744
71755
|
validateCCTarget2(input.target, "create.contentControl");
|
|
71756
|
+
if (input.at !== undefined && !isSelectionTarget2(input.at))
|
|
71757
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", `create.contentControl: "at" must be a valid SelectionTarget with kind "selection", start, and end.`, {
|
|
71758
|
+
field: "at",
|
|
71759
|
+
value: input.at
|
|
71760
|
+
});
|
|
71745
71761
|
if (input.content !== undefined && typeof input.content !== "string")
|
|
71746
71762
|
throw new DocumentApiValidationError2("INVALID_INPUT", `create.contentControl content must be a string, got ${typeof input.content}.`, {
|
|
71747
71763
|
field: "content",
|
|
@@ -117203,7 +117219,7 @@ var isRegExp = (value) => {
|
|
|
117203
117219
|
state.kern = kernNode.attributes["w:val"];
|
|
117204
117220
|
}
|
|
117205
117221
|
}, SuperConverter;
|
|
117206
|
-
var
|
|
117222
|
+
var init_SuperConverter_BgwP1GeS_es = __esm(() => {
|
|
117207
117223
|
init_rolldown_runtime_Bg48TavK_es();
|
|
117208
117224
|
init_jszip_C49i9kUs_es();
|
|
117209
117225
|
init_xml_js_CqGKpaft_es();
|
|
@@ -154449,7 +154465,7 @@ var init_SuperConverter_w6yaFRT5_es = __esm(() => {
|
|
|
154449
154465
|
};
|
|
154450
154466
|
});
|
|
154451
154467
|
|
|
154452
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
154468
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-zEz71NHQ.es.js
|
|
154453
154469
|
function parseSizeUnit(val = "0") {
|
|
154454
154470
|
const length3 = val.toString() || "0";
|
|
154455
154471
|
const value = Number.parseFloat(length3);
|
|
@@ -156060,8 +156076,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
156060
156076
|
return false;
|
|
156061
156077
|
return Boolean(checker(attrs));
|
|
156062
156078
|
};
|
|
156063
|
-
var
|
|
156064
|
-
|
|
156079
|
+
var init_create_headless_toolbar_zEz71NHQ_es = __esm(() => {
|
|
156080
|
+
init_SuperConverter_BgwP1GeS_es();
|
|
156065
156081
|
init_constants_CGhJRd87_es();
|
|
156066
156082
|
init_dist_B8HfvhaK_es();
|
|
156067
156083
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
@@ -204499,7 +204515,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
204499
204515
|
init_remark_gfm_BhnWr3yf_es();
|
|
204500
204516
|
});
|
|
204501
204517
|
|
|
204502
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
204518
|
+
// ../../packages/superdoc/dist/chunks/src-DjgWBzME.es.js
|
|
204503
204519
|
function deleteProps(obj, propOrProps) {
|
|
204504
204520
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
204505
204521
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -238713,8 +238729,7 @@ function groupUngroupWrapper(editor, input2, options) {
|
|
|
238713
238729
|
}
|
|
238714
238730
|
function createWrapper(editor, input2, options) {
|
|
238715
238731
|
const commandName = input2.kind === "block" ? "insertStructuredContentBlock" : "insertStructuredContentInline";
|
|
238716
|
-
|
|
238717
|
-
if (typeof insertCmd !== "function")
|
|
238732
|
+
if (typeof editor.commands?.[commandName] !== "function")
|
|
238718
238733
|
throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", `${commandName} command not available.`);
|
|
238719
238734
|
const id2 = generateSdtId();
|
|
238720
238735
|
const target = {
|
|
@@ -238767,17 +238782,26 @@ function createWrapper(editor, input2, options) {
|
|
|
238767
238782
|
dispatchTransaction(editor, tr);
|
|
238768
238783
|
return true;
|
|
238769
238784
|
}
|
|
238785
|
+
if (input2.at) {
|
|
238786
|
+
const { absFrom, absTo } = resolveSelectionTarget(editor, input2.at);
|
|
238787
|
+
const { tr } = editor.state;
|
|
238788
|
+
tr.setSelection(TextSelection2.create(tr.doc, absFrom, absTo));
|
|
238789
|
+
dispatchTransaction(editor, tr);
|
|
238790
|
+
}
|
|
238791
|
+
const cmd = editor.commands?.[commandName];
|
|
238792
|
+
if (typeof cmd !== "function")
|
|
238793
|
+
return false;
|
|
238770
238794
|
if (contentText !== undefined) {
|
|
238771
238795
|
if (input2.kind === "block") {
|
|
238772
238796
|
if (isCheckboxCreate)
|
|
238773
|
-
return Boolean(
|
|
238797
|
+
return Boolean(cmd({
|
|
238774
238798
|
attrs,
|
|
238775
238799
|
json: {
|
|
238776
238800
|
type: "paragraph",
|
|
238777
238801
|
content: [buildCheckboxTextJson(checkboxSymbol)]
|
|
238778
238802
|
}
|
|
238779
238803
|
}));
|
|
238780
|
-
return Boolean(
|
|
238804
|
+
return Boolean(cmd({
|
|
238781
238805
|
attrs,
|
|
238782
238806
|
json: {
|
|
238783
238807
|
type: "paragraph",
|
|
@@ -238789,16 +238813,16 @@ function createWrapper(editor, input2, options) {
|
|
|
238789
238813
|
}));
|
|
238790
238814
|
}
|
|
238791
238815
|
if (isCheckboxCreate)
|
|
238792
|
-
return Boolean(
|
|
238816
|
+
return Boolean(cmd({
|
|
238793
238817
|
attrs,
|
|
238794
238818
|
json: buildCheckboxTextJson(checkboxSymbol)
|
|
238795
238819
|
}));
|
|
238796
|
-
return Boolean(
|
|
238820
|
+
return Boolean(cmd({
|
|
238797
238821
|
attrs,
|
|
238798
238822
|
text: contentText
|
|
238799
238823
|
}));
|
|
238800
238824
|
}
|
|
238801
|
-
return Boolean(
|
|
238825
|
+
return Boolean(cmd({ attrs }));
|
|
238802
238826
|
});
|
|
238803
238827
|
}
|
|
238804
238828
|
function createContentControlsAdapter(editor) {
|
|
@@ -288134,12 +288158,12 @@ var Node$13 = class Node$14 {
|
|
|
288134
288158
|
return;
|
|
288135
288159
|
console.log(...args$1);
|
|
288136
288160
|
}, 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;
|
|
288137
|
-
var
|
|
288161
|
+
var init_src_DjgWBzME_es = __esm(() => {
|
|
288138
288162
|
init_rolldown_runtime_Bg48TavK_es();
|
|
288139
|
-
|
|
288163
|
+
init_SuperConverter_BgwP1GeS_es();
|
|
288140
288164
|
init_jszip_C49i9kUs_es();
|
|
288141
288165
|
init_uuid_qzgm05fK_es();
|
|
288142
|
-
|
|
288166
|
+
init_create_headless_toolbar_zEz71NHQ_es();
|
|
288143
288167
|
init_constants_CGhJRd87_es();
|
|
288144
288168
|
init_dist_B8HfvhaK_es();
|
|
288145
288169
|
init_unified_Dsuw2be5_es();
|
|
@@ -322894,11 +322918,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
|
|
|
322894
322918
|
|
|
322895
322919
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
322896
322920
|
var init_super_editor_es = __esm(() => {
|
|
322897
|
-
|
|
322898
|
-
|
|
322921
|
+
init_src_DjgWBzME_es();
|
|
322922
|
+
init_SuperConverter_BgwP1GeS_es();
|
|
322899
322923
|
init_jszip_C49i9kUs_es();
|
|
322900
322924
|
init_xml_js_CqGKpaft_es();
|
|
322901
|
-
|
|
322925
|
+
init_create_headless_toolbar_zEz71NHQ_es();
|
|
322902
322926
|
init_constants_CGhJRd87_es();
|
|
322903
322927
|
init_dist_B8HfvhaK_es();
|
|
322904
322928
|
init_unified_Dsuw2be5_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.7.0-next.
|
|
3
|
+
"version": "0.7.0-next.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"@types/node": "22.19.2",
|
|
25
25
|
"@types/ws": "^8.5.13",
|
|
26
26
|
"typescript": "^5.9.2",
|
|
27
|
-
"@superdoc/pm-adapter": "0.0.0",
|
|
28
|
-
"@superdoc/super-editor": "0.0.1",
|
|
29
27
|
"@superdoc/document-api": "0.0.1",
|
|
30
|
-
"superdoc": "
|
|
28
|
+
"@superdoc/pm-adapter": "0.0.0",
|
|
29
|
+
"superdoc": "1.26.0",
|
|
30
|
+
"@superdoc/super-editor": "0.0.1"
|
|
31
31
|
},
|
|
32
32
|
"module": "src/index.ts",
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.7.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-
|
|
40
|
-
"@superdoc-dev/cli-
|
|
41
|
-
"@superdoc-dev/cli-
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.7.0-next.17",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.7.0-next.17",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.7.0-next.17",
|
|
40
|
+
"@superdoc-dev/cli-linux-arm64": "0.7.0-next.17",
|
|
41
|
+
"@superdoc-dev/cli-windows-x64": "0.7.0-next.17"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|