@univer-cli/unit-layout-lint-command 1.4.0 → 1.6.0

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](./README.zh-CN.md)
4
4
 
5
- Provide a native Commander `lint` preset for `@univer-cli/unit-layout-lint`. The command currently accepts Slide only.
5
+ Provide a native Commander `lint` preset for `@univer-cli/unit-layout-lint`. The command accepts Slide and Board.
6
6
 
7
7
  ## Installation
8
8
 
@@ -24,6 +24,29 @@ program.addCommand(
24
24
  );
25
25
  ```
26
26
 
27
- The command parses a Unit ID, page selectors, rule filters, and `--json`. Default text lists findings; JSON output contains the complete report. No findings is a successful result. Commander exits non-zero when input, loading, rendering, or linting fails.
27
+ The command parses a Unit ID, page selectors, and `--json`. Board also accepts `--mode model|rendered|both` (default: both); Slide rejects this option. The application supplies the matching model/rendered runtimes. Model-only analysis does not require a browser.
28
+
29
+ Board `--plan-labels` opts into a read-only measured label repair plan at `analyses[].labelPlan`; it requires rendered or both mode. Apply a `ready` native plan through the Facade and re-run lint. This command never applies plans.
30
+
31
+ Board `--plan-ports` requests a native automatic port-order plan at `analyses[].portPlan` in rendered or both mode. Missing or incomplete requested planning makes coverage incomplete, and original findings remain in the report. Apply one ready plan through the Board Facade and lint a fresh snapshot before using another plan.
32
+
33
+ Board `--plan-text <element-id...>` selects generated shapes for a native read-only text-size plan in `analyses[].textPlan`; use `--json` to retain the complete plan. It requires rendered or both mode and a producer supporting native text planning. IDs must be unique and exist on selected pages. Missing or incomplete planning makes coverage incomplete and exits with code 2. Apply only a ready plan through the Facade, replan graph/container layout and lint again; the command never resizes content itself.
34
+
35
+ Add `--text-width-growth <ratio>` to bound native text-plan width growth. The finite ratio must be from 1 to 2 and requires `--plan-text`; 1 preserves authored widths, and omission keeps native defaults. Producer plans exceeding the budget are rejected; the limit never shrinks fonts or truncates text.
36
+
37
+ Board `--maximum-automatic-label-distance <board-units>` opts into native automatic-label distance inspection in rendered or both mode. Values must be finite and non-negative, including zero. Fixed/authored and endpoint-role labels are excluded by Univer. A missing producer receipt or unresolved distance makes coverage incomplete; exceeded limits are errors. The metric is distance to the native sampled, marker-trimmed stroke centerline before dash gaps and label clipping, not raster ink. The command only inspects and never moves labels.
38
+
39
+ Default text lists findings and incomplete coverage; JSON contains the complete report. Slide findings retain their existing successful exit behavior. Board errors or incomplete coverage exit with code 2 after writing the report; warnings alone succeed. Input, loading, rendering, or linting failures exit non-zero through Commander.
28
40
 
29
41
  The application owns target resolution and UnitData loading. The package does not access Workspace, files, or servers. The factory returns a native `Command`.
42
+
43
+ ### Board layout plans
44
+
45
+ `layoutPlan` requests one native plan per rendered Board page. Select `graph` for complete layout,
46
+ `routes` for automatic path coordination, `ports` for automatic endpoints, `labels` for caption
47
+ placement, or `text` for grow-only frame sizing. Use element IDs for graph and text or connector IDs
48
+ for the other modes. The Render Page must use a Board SDK with `FBoard.planLayout()`.
49
+
50
+ With the Commander preset, use `lint --unit <id> --mode rendered --plan routes --plan-ids edge-a edge-b --json`.
51
+ Read `analyses[].plan` from the lint report. A ready plan can be applied on its original Board page
52
+ through `board.applyLayoutPlan(plan)`. Reinspect the new snapshot after application.
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](./README.md) | 简体中文
4
4
 
5
- 为 `@univer-cli/unit-layout-lint` 提供原生 Commander `lint` preset。当前 command 明确只接收 Slide。
5
+ 为 `@univer-cli/unit-layout-lint` 提供原生 Commander `lint` preset。Command 接收 Slide 与 Board。
6
6
 
7
7
  ## 安装
8
8
 
@@ -24,8 +24,19 @@ program.addCommand(
24
24
  );
25
25
  ```
26
26
 
27
- Command 解析 Unit ID、page selector、rule filter 和 `--json`。默认文本列出 findings;JSON 输出完整 report。
28
- 没有 finding 时成功退出,输入、加载、渲染或 lint 失败时由 Commander 失败退出。
27
+ Command 解析 Unit ID、page selector 和 `--json`。Board 还支持 `--mode model|rendered|both`,默认 `both`;Slide 不接受此选项。Application 提供对应的 model/rendered runtime,model-only 无需浏览器。
28
+
29
+ Board 的 `--plan-labels` 显式请求只读的实测标签修复 plan,返回于 `analyses[].labelPlan`,仅支持 rendered 或 both 模式。通过 Facade 应用 `ready` 的原生 plan 后重新 lint;本 command 不自动应用 plan。
30
+
31
+ Board 的 `--plan-ports` 在 rendered 或 both 模式请求原生自动端口排序计划,返回于 `analyses[].portPlan`。请求后计划缺失或不完整会使 coverage 不完整,报告仍保留原始 findings。通过 Board Facade 应用一个 ready 计划后,对新 snapshot 重新 lint,再使用其他计划。
32
+
33
+ Board 的 `--plan-text <element-id...>` 选择生成图形,原生只读文字尺寸计划返回于 `analyses[].textPlan`;使用 `--json` 保留完整计划。仅支持 rendered 或 both 模式,并要求 producer 支持原生文字规划。ID 必须唯一且存在于所选页面。规划缺失或不完整会使覆盖不完整,并以 code 2 退出。仅通过 Facade 应用 ready 计划,再重新规划图和容器布局并 lint;command 本身不调整内容尺寸。
34
+
35
+ 可增加 `--text-width-growth <ratio>` 限制文字计划的横向增长,ratio 必须是 1 到 2 的有限数,并同时传入 `--plan-text`。1 保留原宽;省略时沿用原生默认。超过请求预算的 producer 计划会被拒绝,不通过缩小字号或截断文字满足限制。
36
+
37
+ Board `--maximum-automatic-label-distance <board-units>` 可在 rendered 或 both 模式显式请求原生自动标签距离检查;数值必须有限且非负,0 有效。Univer 排除 fixed/authored 和端点角色标签。缺少 producer receipt 或距离未解析会使 coverage 不完整,超限为 error。度量针对原生采样、裁去 marker 的 stroke 中心线,在 dash gaps 和 label clipping 之前计算,不是 raster ink 距离。Command 仅检查,不移动标签。
38
+
39
+ 默认文本列出 findings 和未完成覆盖;JSON 输出完整 report。Slide findings 保持现有成功退出行为。Board 存在 error 或覆盖不完整时先输出报告,再以 code 2 退出;仅 warning 时成功退出。输入、加载、渲染或 lint 失败时由 Commander 非零退出。
29
40
 
30
41
  Application 拥有 target 解析与 UnitData 加载;package 不访问 Workspace、文件或 server。Factory 返回原生
31
42
  `Command`。
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function _0x5d98(){const _0x25539c=['\x20pages\x20checked)','\x20findings\x20(','--pages\x20cannot\x20be\x20empty','action','coverage','Unit\x20to\x20lint;\x20currently\x20requires\x20a\x20Slide\x20Unit','Slide\x20layout\x20lint:\x20','code','detail','error','json','1iUSaSt','Lint\x20browser-rendered\x20Unit\x20layout\x20(currently\x20Slide\x20only)','page\x20','configureOutput','129894DkXZkV','page','stringify','requiredOption','25eHtCem','message','trim','--pages\x20contains\x20an\x20empty\x20selector','all','split','pages','--unit\x20<unit-id>','35jlUAkb','--json','294688oNxiaa','push','findings','write\x20the\x20complete\x20lint\x20report\x20as\x20JSON','join','Slide\x20layout\x20lint:\x20no\x20findings\x20(','1278990vXxYWB','137374oQNRhu','unit-layout-lint.failed','name','--pages\x20<pages>','length','lint','467720JIzAmV','string','4316480PumdPu','exec','writeOut','375807UiRBYK','option'];_0x5d98=function(){return _0x25539c;};return _0x5d98();}(function(_0x457304,_0x1515db){const _0xe4117f=_0x1060,_0x4a4673=_0x457304();while(!![]){try{const _0x4e64cc=-parseInt(_0xe4117f(0x13c))/0x1*(-parseInt(_0xe4117f(0x155))/0x2)+-parseInt(_0xe4117f(0x160))/0x3+-parseInt(_0xe4117f(0x15b))/0x4+parseInt(_0xe4117f(0x144))/0x5*(-parseInt(_0xe4117f(0x140))/0x6)+parseInt(_0xe4117f(0x14c))/0x7*(-parseInt(_0xe4117f(0x14e))/0x8)+parseInt(_0xe4117f(0x154))/0x9+parseInt(_0xe4117f(0x15d))/0xa;if(_0x4e64cc===_0x1515db)break;else _0x4a4673['push'](_0x4a4673['shift']());}catch(_0x367ae0){_0x4a4673['push'](_0x4a4673['shift']());}}}(_0x5d98,0x1a52d));function _0x1060(_0x348831,_0x8fbc72){_0x348831=_0x348831-0x13b;const _0x5d984f=_0x5d98();let _0x10600b=_0x5d984f[_0x348831];return _0x10600b;}import{isUnitLayoutLintError as _0x163f60}from'@univer-cli/unit-layout-lint';import{Command as _0x5d9840}from'commander';var n=0x2710,r=class extends Error{constructor(_0x381a1f){const _0x279e17=_0x1060;super(_0x381a1f),this[_0x279e17(0x157)]='UnitLayoutLintCommandInputError';}};function i(_0x361f42){const _0x51df03=_0x1060;let _0x253aa4=new _0x5d9840('lint')['description'](_0x51df03(0x13d))[_0x51df03(0x143)](_0x51df03(0x14b),_0x51df03(0x167))[_0x51df03(0x161)](_0x51df03(0x158),'Slide\x20pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover')[_0x51df03(0x161)](_0x51df03(0x14d),_0x51df03(0x151))[_0x51df03(0x165)](async _0x30df64=>{const _0x1a5f9a=_0x51df03;let _0x35c1e0;try{let _0x1273f0=_0x30df64[_0x1a5f9a(0x14a)]===void 0x0?void 0x0:s(_0x30df64[_0x1a5f9a(0x14a)]),_0x2384e8=await _0x361f42['loadUnit']({'unitId':_0x30df64['unit']});_0x35c1e0=await _0x361f42[_0x1a5f9a(0x15a)][_0x1a5f9a(0x15a)]({..._0x2384e8,..._0x1273f0===void 0x0?{}:{'pages':_0x1273f0}});}catch(_0x33e544){throw(_0x33e544 instanceof r||_0x163f60(_0x33e544)||c(_0x33e544))&&_0x253aa4[_0x1a5f9a(0x16b)](''+(_0x1a5f9a(0x169)in _0x33e544?String(_0x33e544[_0x1a5f9a(0x169)])+':\x20':'')+_0x33e544[_0x1a5f9a(0x145)],{'code':_0x1a5f9a(0x156),'exitCode':0x1}),_0x33e544;}_0x253aa4[_0x1a5f9a(0x13f)]()[_0x1a5f9a(0x15f)]?.((_0x30df64[_0x1a5f9a(0x13b)]===!0x0?JSON[_0x1a5f9a(0x142)](_0x35c1e0,null,0x2):a(_0x35c1e0))+'\x0a');});return _0x253aa4;}function a(_0xf317f1){const _0x37612c=_0x1060;if(_0xf317f1[_0x37612c(0x150)][_0x37612c(0x159)]===0x0)return _0x37612c(0x153)+String(_0xf317f1[_0x37612c(0x166)][_0x37612c(0x14a)][_0x37612c(0x159)])+'\x20pages\x20checked)';let _0x1cce60=[_0x37612c(0x168)+String(_0xf317f1[_0x37612c(0x150)]['length'])+_0x37612c(0x163)+String(_0xf317f1['coverage']['pages'][_0x37612c(0x159)])+_0x37612c(0x162)];for(let _0x4b1c9e of _0xf317f1[_0x37612c(0x150)])_0x1cce60['push'](_0x37612c(0x13e)+String(_0x4b1c9e[_0x37612c(0x141)])+'\x20\x20'+_0x4b1c9e['rule']+'\x20\x20'+_0x4b1c9e['id']),_0x1cce60[_0x37612c(0x14f)]('\x20\x20'+_0x4b1c9e[_0x37612c(0x16a)]);return _0x1cce60[_0x37612c(0x152)]('\x0a');}function o(_0x1be6d5){return s(_0x1be6d5);}function s(_0x570d81){const _0x1a0bc8=_0x1060;if(_0x570d81['trim']()===_0x1a0bc8(0x148))return;if(_0x570d81[_0x1a0bc8(0x146)]()==='')throw new r(_0x1a0bc8(0x164));let _0x2cfd7d=[];for(let _0x48118a of _0x570d81[_0x1a0bc8(0x149)](',')){let _0x519f2d=_0x48118a['trim']();if(_0x519f2d==='')throw new r(_0x1a0bc8(0x147));let _0x3c72ff=/^(\d+)(?:-(\d+))?$/[_0x1a0bc8(0x15e)](_0x519f2d);if(_0x3c72ff===null){_0x2cfd7d[_0x1a0bc8(0x14f)](_0x519f2d);continue;}let _0x10384f=Number(_0x3c72ff[0x1]),_0x1740be=Number(_0x3c72ff[0x2]??_0x3c72ff[0x1]);if(_0x10384f<0x1||_0x1740be<_0x10384f)throw new r('Invalid\x20page\x20selector:\x20'+_0x519f2d);if(_0x2cfd7d[_0x1a0bc8(0x159)]+_0x1740be-_0x10384f+0x1>n)throw new r('--pages\x20expands\x20to\x20too\x20many\x20pages');for(let _0x3e92ae=_0x10384f;_0x3e92ae<=_0x1740be;_0x3e92ae+=0x1)_0x2cfd7d[_0x1a0bc8(0x14f)](_0x3e92ae);}return _0x2cfd7d;}function c(_0x1f9b45){const _0x2955a5=_0x1060;return _0x1f9b45 instanceof Error&&typeof _0x1f9b45[_0x2955a5(0x169)]==_0x2955a5(0x15c);}export{r as UnitLayoutLintCommandInputError,i as createUnitLayoutLintCommand,o as parseUnitLayoutLintPages,a as renderUnitLayoutLint};
1
+ function _0xa862(){const _0x162c22=['coverage','660929vTcgmo','UnitLayoutLintCommandInputError','must\x20be\x20a\x20finite\x20ratio\x20from\x201\x20to\x202','lint','UNIT_LAYOUT_LINT_BOARD_FAILED','4oKYUnV','Invalid\x20page\x20selector:\x20','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','slide','keys','string','configureOutput','object','217PRvjyU','Slide\x20layout\x20lint:\x20','include\x20a\x20read-only\x20native\x20Board\x20automatic\x20port-order\x20plan','18YbMoHs','findings','planText','--mode,\x20--plan,\x20--plan-ids,\x20--plan-options,\x20--plan-labels,\x20--plan-ports,\x20--plan-text,\x20--text-width-growth\x20and\x20--maximum-automatic-label-distance\x20are\x20only\x20supported\x20for\x20Board\x20Units','fixedElementIds','textWidthGrowth','name','stringify','planPorts','coverage:\x20','origin','some','\x20pages,\x20','--mode\x20<mode>','8673115FjDlGx','\x20pages\x20checked)','action','Slide\x20or\x20Board\x20Unit\x20to\x20lint','planIds','\x20findings\x20(','limitations','maximumAutomaticLabelDistance','rule','option','planLabels','unitType','page\x20','incomplete\x20\x20','direction','--plan-text\x20requires\x20rendered\x20or\x20both\x20mode','pages','mode','Board\x20layout\x20lint:\x20','pageId','--unit\x20<unit-id>','--text-width-growth\x20<ratio>','ports','exec','json','--json','set\x20graph\x20layout\x20options\x20as\x20a\x20JSON\x20object','write\x20the\x20complete\x20lint\x20report\x20as\x20JSON','Pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover','--plan-options\x20must\x20contain\x20a\x20JSON\x20object','writeOut','--plan-options\x20<json>','board','error','addOption','severity','--pages\x20contains\x20an\x20empty\x20selector','source','limit\x20the\x20layout\x20plan\x20to\x20generated\x20element\x20or\x20connector\x20IDs','limit\x20text\x20sizing\x20width\x20growth\x20to\x20a\x20finite\x20ratio\x20from\x201\x20to\x202\x20for\x20graph\x20or\x20text\x20planning','2QgrZDE','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage;\x20see\x20the\x20report','description','choices','planOptions','--maximum-automatic-label-distance\x20<board-units>','model','reason','incomplete','has','8572704tKPydL','isArray','--pages\x20cannot\x20be\x20empty','--plan-ids\x20requires\x20--plan','--maximum-automatic-label-distance\x20requires\x20rendered\x20or\x20both\x20mode','--plan-labels\x20requires\x20rendered\x20or\x20both\x20mode','push','--text-width-growth\x20requires\x20graph\x20or\x20text\x20planning','routes','8719870hJYroe','4567659nundXf','isFinite','text','complete','trim','--plan-ports','--plan-options\x20requires\x20--plan\x20graph','labels','must\x20be\x20a\x20finite\x20non-negative\x20number\x20of\x20Board\x20units','join','message','layerGap','code','graph','unit','rendered','60508239CUCwKf','length','include\x20a\x20read-only\x20measured\x20text-size\x20plan\x20for\x20selected\x20generated\x20Board\x20shapes','include\x20a\x20read-only\x20measured\x20Board\x20label\x20repair\x20plan','Slide\x20layout\x20lint:\x20no\x20findings\x20(','--plan\x20<mode>','471352mVYgYh','--plan-ids\x20<id...>','include\x20a\x20read-only\x20native\x20Board\x20layout\x20plan','assign'];_0xa862=function(){return _0x162c22;};return _0xa862();}(function(_0x289d12,_0x4ccf99){const _0x4c2318=_0x26d9,_0x5ad216=_0x289d12();while(!![]){try{const _0x29fcaf=parseInt(_0x4c2318(0x116))/0x1*(parseInt(_0x4c2318(0xe7))/0x2)+parseInt(_0x4c2318(0xfb))/0x3*(parseInt(_0x4c2318(0x11b))/0x4)+-parseInt(_0x4c2318(0x134))/0x5+-parseInt(_0x4c2318(0xf1))/0x6+parseInt(_0x4c2318(0x123))/0x7*(-parseInt(_0x4c2318(0x111))/0x8)+-parseInt(_0x4c2318(0x126))/0x9*(parseInt(_0x4c2318(0xfa))/0xa)+parseInt(_0x4c2318(0x10b))/0xb;if(_0x29fcaf===_0x4ccf99)break;else _0x5ad216['push'](_0x5ad216['shift']());}catch(_0xcbacb3){_0x5ad216['push'](_0x5ad216['shift']());}}}(_0xa862,0xe8059));import{isUnitLayoutLintError as _0x5f33df}from'@univer-cli/unit-layout-lint';import{Command as _0x16f733,InvalidArgumentError as _0x144bbc,Option as _0x38196e}from'commander';var i=0x2710,a=class extends Error{constructor(_0x35f7fb){const _0x248d47=_0x26d9;super(_0x35f7fb),this[_0x248d47(0x12c)]=_0x248d47(0x117);}};function o(_0x68e077){const _0x2d91b8=_0x26d9;let _0x23cbf3=new _0x16f733('lint')[_0x2d91b8(0xe9)]('Lint\x20Slide\x20or\x20Board\x20layout\x20with\x20SDK\x20geometry\x20evidence')['requiredOption'](_0x2d91b8(0x148),_0x2d91b8(0x137))['option']('--pages\x20<pages>',_0x2d91b8(0xdb))[_0x2d91b8(0xe1)](new _0x38196e(_0x2d91b8(0x133),'Board\x20analysis\x20mode\x20(default:\x20both)')[_0x2d91b8(0xea)]([_0x2d91b8(0xed),_0x2d91b8(0x10a),'both']))[_0x2d91b8(0x13d)](_0x2d91b8(0xec),'require\x20native\x20automatic\x20Board\x20labels\x20within\x20this\x20distance\x20of\x20their\x20rendered\x20stroke',p)['option'](_0x2d91b8(0x14d),_0x2d91b8(0xda))[_0x2d91b8(0xe1)](new _0x38196e(_0x2d91b8(0x110),_0x2d91b8(0x113))[_0x2d91b8(0xea)]([_0x2d91b8(0x108),_0x2d91b8(0xf9),_0x2d91b8(0x14a),_0x2d91b8(0x102),_0x2d91b8(0xfd)]))[_0x2d91b8(0x13d)](_0x2d91b8(0x112),_0x2d91b8(0xe5))[_0x2d91b8(0x13d)](_0x2d91b8(0xde),_0x2d91b8(0xd9))[_0x2d91b8(0x13d)]('--plan-labels',_0x2d91b8(0x10e))['option'](_0x2d91b8(0x100),_0x2d91b8(0x125))[_0x2d91b8(0x13d)]('--plan-text\x20<element-id...>',_0x2d91b8(0x10d))[_0x2d91b8(0x13d)](_0x2d91b8(0x149),_0x2d91b8(0xe6),m)[_0x2d91b8(0x136)](async _0x2e3154=>{const _0x5d4b3f=_0x2d91b8;let _0x3f1520;try{let _0x41b7d7=_0x2e3154['pages']===void 0x0?void 0x0:d(_0x2e3154['pages']),_0x2a6172=await _0x68e077['loadUnit']({'unitId':_0x2e3154[_0x5d4b3f(0x109)]});if(_0x2a6172[_0x5d4b3f(0x13f)]===_0x5d4b3f(0x11e)&&(_0x2e3154[_0x5d4b3f(0x145)]!==void 0x0||_0x2e3154['plan']!==void 0x0||_0x2e3154[_0x5d4b3f(0x138)]!==void 0x0||_0x2e3154[_0x5d4b3f(0xeb)]!==void 0x0||_0x2e3154[_0x5d4b3f(0x13e)]===!0x0||_0x2e3154[_0x5d4b3f(0x12e)]===!0x0||_0x2e3154[_0x5d4b3f(0x128)]!==void 0x0||_0x2e3154[_0x5d4b3f(0x12b)]!==void 0x0||_0x2e3154['maximumAutomaticLabelDistance']!==void 0x0))throw new a(_0x5d4b3f(0x129));if(_0x2e3154[_0x5d4b3f(0x13e)]===!0x0&&_0x2e3154[_0x5d4b3f(0x145)]===_0x5d4b3f(0xed))throw new a(_0x5d4b3f(0xf6));if(_0x2e3154[_0x5d4b3f(0x12e)]===!0x0&&_0x2e3154[_0x5d4b3f(0x145)]===_0x5d4b3f(0xed))throw new a('--plan-ports\x20requires\x20rendered\x20or\x20both\x20mode');let _0x5254bb=s(_0x2e3154);if(_0x2e3154['textWidthGrowth']!==void 0x0&&!_0x5254bb&&!_0x2e3154[_0x5d4b3f(0x128)]?.['length'])throw new a('--text-width-growth\x20requires\x20--plan-text\x20or\x20--plan\x20graph/text');if(_0x2e3154['planText']!==void 0x0&&_0x2e3154[_0x5d4b3f(0x145)]===_0x5d4b3f(0xed))throw new a(_0x5d4b3f(0x143));if(_0x2e3154['maximumAutomaticLabelDistance']!==void 0x0&&_0x2e3154[_0x5d4b3f(0x145)]===_0x5d4b3f(0xed))throw new a(_0x5d4b3f(0xf5));_0x3f1520=await _0x68e077[_0x5d4b3f(0x119)][_0x5d4b3f(0x119)]({..._0x2a6172,..._0x41b7d7===void 0x0?{}:{'pages':_0x41b7d7},..._0x2a6172['unitType']===_0x5d4b3f(0xdf)&&_0x5254bb?{'layoutPlan':_0x5254bb}:{},..._0x2a6172[_0x5d4b3f(0x13f)]===_0x5d4b3f(0xdf)&&_0x2e3154['mode']!==void 0x0?{'mode':_0x2e3154[_0x5d4b3f(0x145)]}:{},..._0x2a6172['unitType']==='board'&&_0x2e3154['maximumAutomaticLabelDistance']!==void 0x0?{'maximumAutomaticLabelDistance':_0x2e3154[_0x5d4b3f(0x13b)]}:{},..._0x2a6172[_0x5d4b3f(0x13f)]===_0x5d4b3f(0xdf)&&_0x2e3154[_0x5d4b3f(0x128)]!==void 0x0?{'textPlanElementIds':_0x2e3154[_0x5d4b3f(0x128)]}:{},..._0x2a6172[_0x5d4b3f(0x13f)]===_0x5d4b3f(0xdf)&&!_0x5254bb&&_0x2e3154[_0x5d4b3f(0x12b)]!==void 0x0?{'textPlanMaximumWidthGrowth':_0x2e3154[_0x5d4b3f(0x12b)]}:{},..._0x2a6172[_0x5d4b3f(0x13f)]===_0x5d4b3f(0xdf)&&_0x2e3154[_0x5d4b3f(0x13e)]===!0x0?{'includeLabelPlan':!0x0}:{},..._0x2a6172[_0x5d4b3f(0x13f)]==='board'&&_0x2e3154[_0x5d4b3f(0x12e)]===!0x0?{'includePortPlan':!0x0}:{}});}catch(_0x5a496d){throw(_0x5a496d instanceof a||_0x5f33df(_0x5a496d)||f(_0x5a496d))&&_0x23cbf3[_0x5d4b3f(0xe0)](''+(_0x5d4b3f(0x107)in _0x5a496d?String(_0x5a496d[_0x5d4b3f(0x107)])+':\x20':'')+_0x5a496d[_0x5d4b3f(0x105)],{'code':'unit-layout-lint.failed','exitCode':0x1}),_0x5a496d;}let _0x140d30=_0x3f1520[_0x5d4b3f(0x13f)]===_0x5d4b3f(0xdf)&&(!_0x3f1520['coverage'][_0x5d4b3f(0xfe)]||_0x3f1520[_0x5d4b3f(0x127)][_0x5d4b3f(0x131)](({severity:_0x5d9d64})=>_0x5d9d64==='error'));if(_0x140d30&&_0x2e3154['json']===!0x0){let _0x126ef2={..._0x23cbf3['configureOutput']()};_0x126ef2['writeErr']?.(JSON[_0x5d4b3f(0x12d)]({'ok':!0x1,'error':{'code':_0x5d4b3f(0x11a),'message':'Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','details':{'report':_0x3f1520}}})+'\x0a'),_0x23cbf3[_0x5d4b3f(0x121)]({'outputError':()=>{}});try{_0x23cbf3['error'](_0x5d4b3f(0x11d),{'code':_0x5d4b3f(0x11a),'exitCode':0x2});}catch(_0x5dc21a){throw _0x5dc21a instanceof Error&&Object[_0x5d4b3f(0x114)](_0x5dc21a,{'details':{'report':_0x3f1520}}),_0x5dc21a;}finally{_0x23cbf3[_0x5d4b3f(0x121)](_0x126ef2);}}_0x23cbf3[_0x5d4b3f(0x121)]()[_0x5d4b3f(0xdd)]?.((_0x2e3154[_0x5d4b3f(0x14c)]===!0x0?JSON[_0x5d4b3f(0x12d)](_0x3f1520,null,0x2):l(_0x3f1520))+'\x0a'),_0x140d30&&_0x23cbf3[_0x5d4b3f(0xe0)](_0x5d4b3f(0xe8),{'code':_0x5d4b3f(0x11a),'exitCode':0x2});});return _0x23cbf3;}function s(_0x5b2f49){const _0x39adcf=_0x26d9;let {plan:_0x2a89da,planIds:_0x264eb8,planOptions:_0x14d7ef,textWidthGrowth:_0x357c72}=_0x5b2f49;if(_0x14d7ef!==void 0x0&&_0x2a89da!==_0x39adcf(0x108))throw new a(_0x39adcf(0x101));if(_0x2a89da===void 0x0){if(_0x264eb8!==void 0x0)throw new a(_0x39adcf(0xf4));return;}if(_0x5b2f49[_0x39adcf(0x145)]===_0x39adcf(0xed)||_0x5b2f49[_0x39adcf(0x13e)]||_0x5b2f49[_0x39adcf(0x12e)]||_0x5b2f49['planText'])throw new a('--plan\x20requires\x20rendered\x20or\x20both\x20mode\x20and\x20cannot\x20be\x20combined\x20with\x20another\x20plan');if(_0x357c72!==void 0x0&&_0x2a89da!=='graph'&&_0x2a89da!==_0x39adcf(0xfd))throw new a(_0x39adcf(0xf8));let _0x5b2a79=_0x357c72===void 0x0?{}:{'maximumWidthGrowth':_0x357c72};if(_0x2a89da===_0x39adcf(0xfd)){if(!_0x264eb8?.[_0x39adcf(0x10c)])throw new a('--plan\x20text\x20requires\x20--plan-ids');return{'mode':_0x2a89da,'elementIds':_0x264eb8,..._0x5b2a79};}return _0x2a89da===_0x39adcf(0x108)?{...c(_0x14d7ef),'mode':_0x2a89da,..._0x264eb8===void 0x0?{}:{'elementIds':_0x264eb8},..._0x5b2a79}:{'mode':_0x2a89da,..._0x264eb8===void 0x0?{}:{'connectorIds':_0x264eb8}};}function c(_0x54c650){const _0x8fb07e=_0x26d9;if(_0x54c650===void 0x0)return{};let _0x1bfc33=new Set([_0x8fb07e(0x142),_0x8fb07e(0x106),'itemGap',_0x8fb07e(0x130),'maxNodes',_0x8fb07e(0x12a),'feedbackConnectorIds']),_0x9aa001;try{_0x9aa001=JSON['parse'](_0x54c650);}catch{throw new a(_0x8fb07e(0xdc));}if(!_0x9aa001||typeof _0x9aa001!=_0x8fb07e(0x122)||Array[_0x8fb07e(0xf2)](_0x9aa001)||Object[_0x8fb07e(0x11f)](_0x9aa001)[_0x8fb07e(0x131)](_0x471b32=>!_0x1bfc33[_0x8fb07e(0xf0)](_0x471b32)))throw new a('--plan-options\x20accepts\x20direction,\x20layerGap,\x20itemGap,\x20origin,\x20maxNodes,\x20fixedElementIds\x20and\x20feedbackConnectorIds');return _0x9aa001;}function l(_0x1bac46){const _0x518932=_0x26d9;if(_0x1bac46[_0x518932(0x13f)]===_0x518932(0xdf)){let _0x139cef=[_0x518932(0x146)+_0x1bac46['status']+'\x20('+String(_0x1bac46[_0x518932(0x115)][_0x518932(0x144)][_0x518932(0x10c)])+_0x518932(0x132)+_0x1bac46[_0x518932(0x145)]+')'];for(let _0x1d496d of _0x1bac46[_0x518932(0x127)])_0x139cef[_0x518932(0xf7)]('page\x20'+String(_0x1d496d['page'])+'\x20\x20'+_0x1d496d[_0x518932(0xe4)]+'\x20\x20'+_0x1d496d[_0x518932(0xe2)]+'\x20\x20'+_0x1d496d[_0x518932(0x13c)]+'\x20\x20'+_0x1d496d['id']);for(let _0x569d36 of _0x1bac46[_0x518932(0x115)][_0x518932(0xef)])_0x139cef['push'](_0x518932(0x141)+_0x569d36[_0x518932(0x147)]+'\x20\x20'+_0x569d36[_0x518932(0xe4)]+'\x20\x20'+_0x569d36[_0x518932(0xee)]);for(let _0x1f1db3 of _0x1bac46[_0x518932(0x115)][_0x518932(0x13a)])_0x139cef[_0x518932(0xf7)](_0x518932(0x12f)+_0x1f1db3);return _0x139cef[_0x518932(0x104)]('\x0a');}if(_0x1bac46['findings'][_0x518932(0x10c)]===0x0)return _0x518932(0x10f)+String(_0x1bac46[_0x518932(0x115)][_0x518932(0x144)][_0x518932(0x10c)])+_0x518932(0x135);let _0x554201=[_0x518932(0x124)+String(_0x1bac46['findings']['length'])+_0x518932(0x139)+String(_0x1bac46[_0x518932(0x115)]['pages'][_0x518932(0x10c)])+_0x518932(0x135)];for(let _0x320717 of _0x1bac46['findings'])_0x554201[_0x518932(0xf7)](_0x518932(0x140)+String(_0x320717['page'])+'\x20\x20'+_0x320717['rule']+'\x20\x20'+_0x320717['id']),_0x554201[_0x518932(0xf7)]('\x20\x20'+_0x320717['detail']);return _0x554201[_0x518932(0x104)]('\x0a');}function u(_0x3e721b){return d(_0x3e721b);}function d(_0x9d9b53){const _0x2c3588=_0x26d9;if(_0x9d9b53[_0x2c3588(0xff)]()==='all')return;if(_0x9d9b53[_0x2c3588(0xff)]()==='')throw new a(_0x2c3588(0xf3));let _0x3681f7=[];for(let _0x5daf96 of _0x9d9b53['split'](',')){let _0x5e04a8=_0x5daf96['trim']();if(_0x5e04a8==='')throw new a(_0x2c3588(0xe3));let _0x548660=/^(\d+)(?:-(\d+))?$/[_0x2c3588(0x14b)](_0x5e04a8);if(_0x548660===null){_0x3681f7[_0x2c3588(0xf7)](_0x5e04a8);continue;}let _0x15f044=Number(_0x548660[0x1]),_0x2b1162=Number(_0x548660[0x2]??_0x548660[0x1]);if(_0x15f044<0x1||_0x2b1162<_0x15f044)throw new a(_0x2c3588(0x11c)+_0x5e04a8);if(_0x3681f7[_0x2c3588(0x10c)]+_0x2b1162-_0x15f044+0x1>i)throw new a('--pages\x20expands\x20to\x20too\x20many\x20pages');for(let _0x3d195a=_0x15f044;_0x3d195a<=_0x2b1162;_0x3d195a+=0x1)_0x3681f7[_0x2c3588(0xf7)](_0x3d195a);}return _0x3681f7;}function _0x26d9(_0x2a42a7,_0x389d82){_0x2a42a7=_0x2a42a7-0xd9;const _0xa86202=_0xa862();let _0x26d9a6=_0xa86202[_0x2a42a7];return _0x26d9a6;}function f(_0x5974a1){const _0x3f5ee7=_0x26d9;return _0x5974a1 instanceof Error&&typeof _0x5974a1[_0x3f5ee7(0x107)]==_0x3f5ee7(0x120);}function p(_0x3e8ed7){const _0xa6438f=_0x26d9;let _0x47b711=Number(_0x3e8ed7);if(_0x3e8ed7[_0xa6438f(0xff)]()===''||!Number[_0xa6438f(0xfc)](_0x47b711)||_0x47b711<0x0)throw new _0x144bbc(_0xa6438f(0x103));return _0x47b711;}function m(_0x211819){const _0x27eab0=_0x26d9;let _0x52d180=Number(_0x211819);if(_0x211819['trim']()===''||!Number[_0x27eab0(0xfc)](_0x52d180)||_0x52d180<0x1||_0x52d180>0x2)throw new _0x144bbc(_0x27eab0(0x118));return _0x52d180;}export{a as UnitLayoutLintCommandInputError,o as createUnitLayoutLintCommand,u as parseUnitLayoutLintPages,l as renderUnitLayoutLint};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/unit-layout-lint-command",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "1.6.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "README.zh-CN.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@univer-cli/unit-layout-lint": "1.4.0"
21
+ "@univer-cli/unit-layout-lint": "1.6.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"