@superdoc-dev/cli 0.3.0-next.35 → 0.3.0-next.36

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.
Files changed (2) hide show
  1. package/dist/index.js +65 -19
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -10563,8 +10563,8 @@ var init_schemas = __esm(() => {
10563
10563
  ...objectSchema({
10564
10564
  target: tableAddressSchema,
10565
10565
  nodeId: { type: "string" },
10566
- atRowIndex: { type: "integer", minimum: 1 }
10567
- }, ["atRowIndex"]),
10566
+ rowIndex: { type: "integer", minimum: 1 }
10567
+ }, ["rowIndex"]),
10568
10568
  oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
10569
10569
  },
10570
10570
  output: tableMutationResultSchema,
@@ -14548,6 +14548,16 @@ function validateCellOrTableScopedCellLocator(input, operationName) {
14548
14548
  }
14549
14549
  }
14550
14550
  }
14551
+ function normalizeTablesSplitInput(input) {
14552
+ const legacy = input.atRowIndex;
14553
+ if (legacy === undefined)
14554
+ return input;
14555
+ if (input.rowIndex !== undefined && input.rowIndex !== legacy) {
14556
+ throw new DocumentApiValidationError("INVALID_TARGET", "tables.split: cannot provide both rowIndex and atRowIndex with different values.", { fields: ["rowIndex", "atRowIndex"] });
14557
+ }
14558
+ const { atRowIndex: _legacy, ...rest } = input;
14559
+ return { ...rest, rowIndex: legacy };
14560
+ }
14551
14561
  function executeTableLocatorOp(operationName, adapter, input, options) {
14552
14562
  validateTableLocator(input, operationName);
14553
14563
  return adapter(input, normalizeMutationOptions(options));
@@ -16685,7 +16695,8 @@ function createDocumentApi(adapters) {
16685
16695
  return executeTableLocatorOp("tables.move", adapters.tables.move.bind(adapters.tables), input, options);
16686
16696
  },
16687
16697
  split(input, options) {
16688
- return executeTableLocatorOp("tables.split", adapters.tables.split.bind(adapters.tables), input, options);
16698
+ const normalized = normalizeTablesSplitInput(input);
16699
+ return executeRowLocatorOp("tables.split", adapters.tables.split.bind(adapters.tables), normalized, options);
16689
16700
  },
16690
16701
  convertToText(input, options) {
16691
16702
  return executeTableLocatorOp("tables.convertToText", adapters.tables.convertToText.bind(adapters.tables), input, options);
@@ -39682,7 +39693,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
39682
39693
  emptyOptions2 = {};
39683
39694
  });
39684
39695
 
39685
- // ../../packages/superdoc/dist/chunks/SuperConverter-hJPjNp5G.es.js
39696
+ // ../../packages/superdoc/dist/chunks/SuperConverter-htgbtdmP.es.js
39686
39697
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
39687
39698
  const fieldValue = extension$1.config[field];
39688
39699
  if (typeof fieldValue === "function")
@@ -43863,6 +43874,18 @@ function validateCellOrTableScopedCellLocator2(input, operationName) {
43863
43874
  throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName}: rowIndex and columnIndex are required when target is a table.`, { fields: ["rowIndex", "columnIndex"] });
43864
43875
  }
43865
43876
  }
43877
+ function normalizeTablesSplitInput2(input) {
43878
+ const legacy = input.atRowIndex;
43879
+ if (legacy === undefined)
43880
+ return input;
43881
+ if (input.rowIndex !== undefined && input.rowIndex !== legacy)
43882
+ throw new DocumentApiValidationError2("INVALID_TARGET", "tables.split: cannot provide both rowIndex and atRowIndex with different values.", { fields: ["rowIndex", "atRowIndex"] });
43883
+ const { atRowIndex: _legacy, ...rest } = input;
43884
+ return {
43885
+ ...rest,
43886
+ rowIndex: legacy
43887
+ };
43888
+ }
43866
43889
  function executeTableLocatorOp2(operationName, adapter, input, options) {
43867
43890
  validateTableLocator2(input, operationName);
43868
43891
  return adapter(input, normalizeMutationOptions2(options));
@@ -45720,7 +45743,8 @@ function createDocumentApi2(adapters) {
45720
45743
  return executeTableLocatorOp2("tables.move", adapters.tables.move.bind(adapters.tables), input, options);
45721
45744
  },
45722
45745
  split(input, options) {
45723
- return executeTableLocatorOp2("tables.split", adapters.tables.split.bind(adapters.tables), input, options);
45746
+ const normalized = normalizeTablesSplitInput2(input);
45747
+ return executeRowLocatorOp2("tables.split", adapters.tables.split.bind(adapters.tables), normalized, options);
45724
45748
  },
45725
45749
  convertToText(input, options) {
45726
45750
  return executeTableLocatorOp2("tables.convertToText", adapters.tables.convertToText.bind(adapters.tables), input, options);
@@ -85700,7 +85724,7 @@ var isRegExp = (value) => {
85700
85724
  state.kern = kernNode.attributes["w:val"];
85701
85725
  }
85702
85726
  }, SuperConverter;
85703
- var init_SuperConverter_hJPjNp5G_es = __esm(() => {
85727
+ var init_SuperConverter_htgbtdmP_es = __esm(() => {
85704
85728
  init_rolldown_runtime_B2q5OVn9_es();
85705
85729
  init_jszip_ChlR43oI_es();
85706
85730
  init_xml_js_BtmJ6bNs_es();
@@ -97753,11 +97777,11 @@ var init_SuperConverter_hJPjNp5G_es = __esm(() => {
97753
97777
  }, ["destination"]) }, { ...objectSchema2({
97754
97778
  target: tableAddressSchema2,
97755
97779
  nodeId: { type: "string" },
97756
- atRowIndex: {
97780
+ rowIndex: {
97757
97781
  type: "integer",
97758
97782
  minimum: 1
97759
97783
  }
97760
- }, ["atRowIndex"]) }, { ...objectSchema2({
97784
+ }, ["rowIndex"]) }, { ...objectSchema2({
97761
97785
  target: tableAddressSchema2,
97762
97786
  nodeId: { type: "string" },
97763
97787
  delimiter: { enum: [
@@ -148302,7 +148326,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
148302
148326
  init_remark_gfm_z_sDF4ss_es();
148303
148327
  });
148304
148328
 
148305
- // ../../packages/superdoc/dist/chunks/src-99pz_-W7.es.js
148329
+ // ../../packages/superdoc/dist/chunks/src-D2teG0gz.es.js
148306
148330
  function deleteProps(obj, propOrProps) {
148307
148331
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
148308
148332
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -166467,7 +166491,7 @@ function tablesSplitAdapter(editor, input2, options) {
166467
166491
  rejectTrackedMode("tables.split", options);
166468
166492
  const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.split");
166469
166493
  const tableNode = candidate.node;
166470
- if (input2.atRowIndex <= 0 || input2.atRowIndex >= tableNode.childCount)
166494
+ if (input2.rowIndex <= 0 || input2.rowIndex >= tableNode.childCount)
166471
166495
  return toTableFailure("INVALID_TARGET", "Split row index must be between 1 and rowCount-1.");
166472
166496
  if (options?.dryRun)
166473
166497
  return buildTableSuccess(address2);
@@ -166476,7 +166500,7 @@ function tablesSplitAdapter(editor, input2, options) {
166476
166500
  const tablePos = candidate.pos;
166477
166501
  const schema = editor.state.schema;
166478
166502
  const secondTableRows = [];
166479
- for (let i4 = input2.atRowIndex;i4 < tableNode.childCount; i4++)
166503
+ for (let i4 = input2.rowIndex;i4 < tableNode.childCount; i4++)
166480
166504
  secondTableRows.push(tableNode.child(i4));
166481
166505
  let rowPos = tablePos + 1;
166482
166506
  const rowPositions = [];
@@ -166485,7 +166509,7 @@ function tablesSplitAdapter(editor, input2, options) {
166485
166509
  rowPos += tableNode.child(i4).nodeSize;
166486
166510
  }
166487
166511
  const mapFrom = tr.mapping.maps.length;
166488
- for (let i4 = tableNode.childCount - 1;i4 >= input2.atRowIndex; i4--) {
166512
+ for (let i4 = tableNode.childCount - 1;i4 >= input2.rowIndex; i4--) {
166489
166513
  const rp = tr.mapping.slice(mapFrom).map(rowPositions[i4]);
166490
166514
  const rEnd = tr.mapping.slice(mapFrom).map(rowPositions[i4] + tableNode.child(i4).nodeSize);
166491
166515
  tr.delete(rp, rEnd);
@@ -228447,9 +228471,9 @@ var Node$13 = class Node$14 {
228447
228471
  return false;
228448
228472
  return Boolean(checker(attrs));
228449
228473
  }, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
228450
- var init_src_99pz__W7_es = __esm(() => {
228474
+ var init_src_D2teG0gz_es = __esm(() => {
228451
228475
  init_rolldown_runtime_B2q5OVn9_es();
228452
- init_SuperConverter_hJPjNp5G_es();
228476
+ init_SuperConverter_htgbtdmP_es();
228453
228477
  init_jszip_ChlR43oI_es();
228454
228478
  init_uuid_qzgm05fK_es();
228455
228479
  init_constants_ep1_Gwqi_es();
@@ -261752,8 +261776,8 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
261752
261776
 
261753
261777
  // ../../packages/superdoc/dist/super-editor.es.js
261754
261778
  var init_super_editor_es = __esm(() => {
261755
- init_src_99pz__W7_es();
261756
- init_SuperConverter_hJPjNp5G_es();
261779
+ init_src_D2teG0gz_es();
261780
+ init_SuperConverter_htgbtdmP_es();
261757
261781
  init_jszip_ChlR43oI_es();
261758
261782
  init_xml_js_BtmJ6bNs_es();
261759
261783
  init_constants_ep1_Gwqi_es();
@@ -318412,7 +318436,7 @@ function buildAllMetadata() {
318412
318436
  return [operationId, metadata];
318413
318437
  }));
318414
318438
  }
318415
- function deriveOptionSpecs(params4) {
318439
+ function deriveOptionSpecs(operationId, params4) {
318416
318440
  const specs = [];
318417
318441
  for (const param of params4) {
318418
318442
  if (param.kind === "doc" && param.name !== "doc")
@@ -318423,9 +318447,17 @@ function deriveOptionSpecs(params4) {
318423
318447
  type: optionType
318424
318448
  });
318425
318449
  }
318450
+ const aliases = OPTION_FLAG_ALIASES[operationId];
318451
+ if (aliases) {
318452
+ for (const spec of specs) {
318453
+ if (aliases[spec.name]) {
318454
+ spec.aliases = aliases[spec.name];
318455
+ }
318456
+ }
318457
+ }
318426
318458
  return specs;
318427
318459
  }
318428
- var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, INSERT_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, CLI_OPERATION_OPTION_SPECS;
318460
+ var DOC_PARAM, SESSION_PARAM, OUT_PARAM, FORCE_PARAM, DRY_RUN_PARAM, CHANGE_MODE_PARAM, EXPECTED_REVISION_PARAM, USER_NAME_PARAM, USER_EMAIL_PARAM, AGENT_HIDDEN_PARAM_NAMES, OPERATION_CONSTRAINTS, PARAM_FLAG_OVERRIDES, PARAM_SCHEMA_OVERRIDES, PARAM_EXCLUSIONS, TEXT_TARGET_FLAT_PARAMS, INSERT_FLAT_PARAMS, LIST_TARGET_FLAT_PARAMS, FORMAT_OPERATION_IDS, EXTRA_CLI_PARAMS, CLI_ONLY_METADATA, CLI_OPERATION_METADATA, OPTION_FLAG_ALIASES, CLI_OPERATION_OPTION_SPECS;
318429
318461
  var init_operation_params = __esm(() => {
318430
318462
  init_src();
318431
318463
  init_operation_set();
@@ -318714,7 +318746,13 @@ var init_operation_params = __esm(() => {
318714
318746
  }
318715
318747
  };
318716
318748
  CLI_OPERATION_METADATA = buildAllMetadata();
318717
- CLI_OPERATION_OPTION_SPECS = Object.fromEntries(CLI_OPERATION_IDS.map((operationId) => [operationId, deriveOptionSpecs(CLI_OPERATION_METADATA[operationId].params)]));
318749
+ OPTION_FLAG_ALIASES = {
318750
+ "doc.tables.split": { "row-index": ["at-row-index"] }
318751
+ };
318752
+ CLI_OPERATION_OPTION_SPECS = Object.fromEntries(CLI_OPERATION_IDS.map((operationId) => [
318753
+ operationId,
318754
+ deriveOptionSpecs(operationId, CLI_OPERATION_METADATA[operationId].params)
318755
+ ]));
318718
318756
  });
318719
318757
 
318720
318758
  // src/cli/response-schemas.ts
@@ -320782,6 +320820,13 @@ async function preflightCallContext(operationId, input2, context) {
320782
320820
  throw new CliError("NO_ACTIVE_DOCUMENT", `call: ${operationId} requires an active session or input.sessionId.`);
320783
320821
  }
320784
320822
  }
320823
+ function normalizeLegacyInput(operationId, input2) {
320824
+ if (operationId === "doc.tables.split" && input2.atRowIndex !== undefined) {
320825
+ const { atRowIndex, ...rest } = input2;
320826
+ return rest.rowIndex !== undefined ? rest : { ...rest, rowIndex: atRowIndex };
320827
+ }
320828
+ return input2;
320829
+ }
320785
320830
  async function executeOperation(request) {
320786
320831
  let input2;
320787
320832
  const baseContext = request.context;
@@ -320806,6 +320851,7 @@ async function executeOperation(request) {
320806
320851
  }
320807
320852
  input2 = pruneUndefinedDeep(request.input) ?? {};
320808
320853
  }
320854
+ input2 = normalizeLegacyInput(request.operationId, input2);
320809
320855
  validateOperationInputData(request.operationId, input2, commandName);
320810
320856
  await preflightCallContext(request.operationId, input2, baseContext);
320811
320857
  const effectiveContext = applySessionInputToContext(baseContext, input2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.3.0-next.35",
3
+ "version": "0.3.0-next.36",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -21,20 +21,20 @@
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
23
  "@superdoc/document-api": "0.0.1",
24
- "@superdoc/pm-adapter": "0.0.0",
25
24
  "@superdoc/super-editor": "0.0.1",
26
- "superdoc": "1.20.0"
25
+ "superdoc": "1.20.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.35",
34
- "@superdoc-dev/cli-linux-x64": "0.3.0-next.35",
35
- "@superdoc-dev/cli-darwin-x64": "0.3.0-next.35",
36
- "@superdoc-dev/cli-linux-arm64": "0.3.0-next.35",
37
- "@superdoc-dev/cli-windows-x64": "0.3.0-next.35"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.36",
34
+ "@superdoc-dev/cli-darwin-x64": "0.3.0-next.36",
35
+ "@superdoc-dev/cli-linux-x64": "0.3.0-next.36",
36
+ "@superdoc-dev/cli-linux-arm64": "0.3.0-next.36",
37
+ "@superdoc-dev/cli-windows-x64": "0.3.0-next.36"
38
38
  },
39
39
  "scripts": {
40
40
  "predev": "node scripts/ensure-superdoc-build.js",