@univer-cli/unit-layout-lint-command 1.3.1 → 1.5.2

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(_0x1cdf32,_0x4670db){const _0x41551b=_0xea77,_0x579d1a=_0x1cdf32();while(!![]){try{const _0x438a1d=-parseInt(_0x41551b(0x139))/0x1+parseInt(_0x41551b(0x11d))/0x2*(parseInt(_0x41551b(0x13b))/0x3)+-parseInt(_0x41551b(0x13c))/0x4+-parseInt(_0x41551b(0x134))/0x5*(-parseInt(_0x41551b(0x116))/0x6)+-parseInt(_0x41551b(0x137))/0x7*(parseInt(_0x41551b(0x12d))/0x8)+parseInt(_0x41551b(0x130))/0x9*(parseInt(_0x41551b(0x142))/0xa)+parseInt(_0x41551b(0x124))/0xb*(parseInt(_0x41551b(0x129))/0xc);if(_0x438a1d===_0x4670db)break;else _0x579d1a['push'](_0x579d1a['shift']());}catch(_0x30173f){_0x579d1a['push'](_0x579d1a['shift']());}}}(_0x3fab,0xcd446));import{isUnitLayoutLintError as _0x2185ee}from'@univer-cli/unit-layout-lint';import{Command as _0x13090c}from'commander';var n=0x2710,r=class extends Error{constructor(_0x47d687){const _0x28bc9a=_0xea77;super(_0x47d687),this[_0x28bc9a(0x123)]=_0x28bc9a(0x121);}};function i(_0x550b2d){const _0xd5273f=_0xea77;let _0x5412c7=new _0x13090c(_0xd5273f(0x143))['description'](_0xd5273f(0x11f))[_0xd5273f(0x140)](_0xd5273f(0x132),'Unit\x20to\x20lint;\x20currently\x20requires\x20a\x20Slide\x20Unit')['option'](_0xd5273f(0x13e),'Slide\x20pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover')[_0xd5273f(0x12a)](_0xd5273f(0x119),'write\x20the\x20complete\x20lint\x20report\x20as\x20JSON')[_0xd5273f(0x122)](async _0x334e84=>{const _0x1ece1b=_0xd5273f;let _0x1e17b5;try{let _0x310048=_0x334e84[_0x1ece1b(0x120)]===void 0x0?void 0x0:s(_0x334e84['pages']),_0x569774=await _0x550b2d['loadUnit']({'unitId':_0x334e84[_0x1ece1b(0x11e)]});_0x1e17b5=await _0x550b2d['lint'][_0x1ece1b(0x143)]({..._0x569774,..._0x310048===void 0x0?{}:{'pages':_0x310048}});}catch(_0x489064){throw(_0x489064 instanceof r||_0x2185ee(_0x489064)||c(_0x489064))&&_0x5412c7['error'](''+('code'in _0x489064?String(_0x489064[_0x1ece1b(0x138)])+':\x20':'')+_0x489064[_0x1ece1b(0x11a)],{'code':_0x1ece1b(0x141),'exitCode':0x1}),_0x489064;}_0x5412c7[_0x1ece1b(0x12e)]()[_0x1ece1b(0x11b)]?.((_0x334e84[_0x1ece1b(0x117)]===!0x0?JSON[_0x1ece1b(0x11c)](_0x1e17b5,null,0x2):a(_0x1e17b5))+'\x0a');});return _0x5412c7;}function _0x3fab(){const _0x707b3d=['writeOut','stringify','34226QwYpxv','unit','Lint\x20browser-rendered\x20Unit\x20layout\x20(currently\x20Slide\x20only)','pages','UnitLayoutLintCommandInputError','action','name','29843ZgcTkO','Invalid\x20page\x20selector:\x20','split','Slide\x20layout\x20lint:\x20no\x20findings\x20(','length','6276hbcerS','option','--pages\x20cannot\x20be\x20empty','trim','700064RnQkOy','configureOutput','string','9zCdzvc','coverage','--unit\x20<unit-id>','rule','8605NBaLSC','exec','all','105NlQylU','code','516466janyhK','--pages\x20expands\x20to\x20too\x20many\x20pages','12wKYlix','5389104gNrLyO','--pages\x20contains\x20an\x20empty\x20selector','--pages\x20<pages>','\x20pages\x20checked)','requiredOption','unit-layout-lint.failed','14730910fGASUS','lint','detail','3684SnQDwx','json','push','--json','message'];_0x3fab=function(){return _0x707b3d;};return _0x3fab();}function a(_0xea300){const _0x445489=_0xea77;if(_0xea300['findings']['length']===0x0)return _0x445489(0x127)+String(_0xea300[_0x445489(0x131)][_0x445489(0x120)][_0x445489(0x128)])+_0x445489(0x13f);let _0x59cb06=['Slide\x20layout\x20lint:\x20'+String(_0xea300['findings'][_0x445489(0x128)])+'\x20findings\x20('+String(_0xea300[_0x445489(0x131)][_0x445489(0x120)][_0x445489(0x128)])+'\x20pages\x20checked)'];for(let _0x223dbe of _0xea300['findings'])_0x59cb06[_0x445489(0x118)]('page\x20'+String(_0x223dbe['page'])+'\x20\x20'+_0x223dbe[_0x445489(0x133)]+'\x20\x20'+_0x223dbe['id']),_0x59cb06[_0x445489(0x118)]('\x20\x20'+_0x223dbe[_0x445489(0x144)]);return _0x59cb06['join']('\x0a');}function o(_0x14b6c0){return s(_0x14b6c0);}function _0xea77(_0x497e40,_0x5e2986){_0x497e40=_0x497e40-0x116;const _0x3fab83=_0x3fab();let _0xea77fe=_0x3fab83[_0x497e40];return _0xea77fe;}function s(_0x107c95){const _0x2ac385=_0xea77;if(_0x107c95[_0x2ac385(0x12c)]()===_0x2ac385(0x136))return;if(_0x107c95[_0x2ac385(0x12c)]()==='')throw new r(_0x2ac385(0x12b));let _0x89a1a8=[];for(let _0x3ff83b of _0x107c95[_0x2ac385(0x126)](',')){let _0x50bd4a=_0x3ff83b[_0x2ac385(0x12c)]();if(_0x50bd4a==='')throw new r(_0x2ac385(0x13d));let _0x2bb914=/^(\d+)(?:-(\d+))?$/[_0x2ac385(0x135)](_0x50bd4a);if(_0x2bb914===null){_0x89a1a8['push'](_0x50bd4a);continue;}let _0xcc430b=Number(_0x2bb914[0x1]),_0x18040c=Number(_0x2bb914[0x2]??_0x2bb914[0x1]);if(_0xcc430b<0x1||_0x18040c<_0xcc430b)throw new r(_0x2ac385(0x125)+_0x50bd4a);if(_0x89a1a8[_0x2ac385(0x128)]+_0x18040c-_0xcc430b+0x1>n)throw new r(_0x2ac385(0x13a));for(let _0x488c22=_0xcc430b;_0x488c22<=_0x18040c;_0x488c22+=0x1)_0x89a1a8[_0x2ac385(0x118)](_0x488c22);}return _0x89a1a8;}function c(_0x1229d4){const _0x31be68=_0xea77;return _0x1229d4 instanceof Error&&typeof _0x1229d4[_0x31be68(0x138)]==_0x31be68(0x12f);}export{r as UnitLayoutLintCommandInputError,i as createUnitLayoutLintCommand,o as parseUnitLayoutLintPages,a as renderUnitLayoutLint};
1
+ (function(_0x4fcad0,_0x3dd39e){const _0x25f80e=_0x224d,_0x2fcddb=_0x4fcad0();while(!![]){try{const _0x13894e=parseInt(_0x25f80e(0xab))/0x1+parseInt(_0x25f80e(0xfb))/0x2*(-parseInt(_0x25f80e(0xdc))/0x3)+parseInt(_0x25f80e(0xe8))/0x4+parseInt(_0x25f80e(0xbe))/0x5+-parseInt(_0x25f80e(0xd8))/0x6+parseInt(_0x25f80e(0xd1))/0x7+-parseInt(_0x25f80e(0xb9))/0x8*(parseInt(_0x25f80e(0xa9))/0x9);if(_0x13894e===_0x3dd39e)break;else _0x2fcddb['push'](_0x2fcddb['shift']());}catch(_0x47912a){_0x2fcddb['push'](_0x2fcddb['shift']());}}}(_0x6fd4,0xa45d4));import{isUnitLayoutLintError as _0x1befaa}from'@univer-cli/unit-layout-lint';import{Command as _0x108a4b,InvalidArgumentError as _0x118226,Option as _0xc0870d}from'commander';var i=0x2710,a=class extends Error{constructor(_0x53d9b0){const _0x91d6b0=_0x224d;super(_0x53d9b0),this[_0x91d6b0(0xe9)]=_0x91d6b0(0xc6);}};function o(_0x1c7d7d){const _0x450809=_0x224d;let _0x5beaa7=new _0x108a4b('lint')['description'](_0x450809(0xeb))['requiredOption']('--unit\x20<unit-id>',_0x450809(0xcd))[_0x450809(0xad)]('--pages\x20<pages>',_0x450809(0xa1))['addOption'](new _0xc0870d(_0x450809(0xbd),_0x450809(0xb3))[_0x450809(0xfa)]([_0x450809(0xe0),_0x450809(0xb1),_0x450809(0xb6)]))[_0x450809(0xad)](_0x450809(0xe3),_0x450809(0xbf),p)[_0x450809(0xad)](_0x450809(0xc9),'write\x20the\x20complete\x20lint\x20report\x20as\x20JSON')[_0x450809(0xe1)](new _0xc0870d('--plan\x20<mode>',_0x450809(0xfe))[_0x450809(0xfa)](['graph',_0x450809(0xa6),_0x450809(0xd0),_0x450809(0xdf),_0x450809(0xe4)]))['option']('--plan-ids\x20<id...>',_0x450809(0xdb))[_0x450809(0xad)]('--plan-options\x20<json>','set\x20graph\x20layout\x20options\x20as\x20a\x20JSON\x20object')['option'](_0x450809(0xd3),'include\x20a\x20read-only\x20measured\x20Board\x20label\x20repair\x20plan')['option'](_0x450809(0x93),'include\x20a\x20read-only\x20native\x20Board\x20automatic\x20port-order\x20plan')['option'](_0x450809(0x9e),'include\x20a\x20read-only\x20measured\x20text-size\x20plan\x20for\x20selected\x20generated\x20Board\x20shapes')['option'](_0x450809(0xcc),'limit\x20text\x20sizing\x20width\x20growth\x20to\x20a\x20finite\x20ratio\x20from\x201\x20to\x202\x20for\x20graph\x20or\x20text\x20planning',m)[_0x450809(0xca)](async _0x190fef=>{const _0x3c56f8=_0x450809;let _0x5b9251;try{let _0x181c5a=_0x190fef['pages']===void 0x0?void 0x0:d(_0x190fef[_0x3c56f8(0x96)]),_0x42f4c9=await _0x1c7d7d['loadUnit']({'unitId':_0x190fef[_0x3c56f8(0xa0)]});if(_0x42f4c9[_0x3c56f8(0xc3)]==='slide'&&(_0x190fef[_0x3c56f8(0xde)]!==void 0x0||_0x190fef[_0x3c56f8(0xfc)]!==void 0x0||_0x190fef['planIds']!==void 0x0||_0x190fef[_0x3c56f8(0xf6)]!==void 0x0||_0x190fef[_0x3c56f8(0x9b)]===!0x0||_0x190fef[_0x3c56f8(0xda)]===!0x0||_0x190fef[_0x3c56f8(0xac)]!==void 0x0||_0x190fef[_0x3c56f8(0xbc)]!==void 0x0||_0x190fef[_0x3c56f8(0xb5)]!==void 0x0))throw new a(_0x3c56f8(0xbb));if(_0x190fef[_0x3c56f8(0x9b)]===!0x0&&_0x190fef[_0x3c56f8(0xde)]===_0x3c56f8(0xe0))throw new a('--plan-labels\x20requires\x20rendered\x20or\x20both\x20mode');if(_0x190fef[_0x3c56f8(0xda)]===!0x0&&_0x190fef[_0x3c56f8(0xde)]===_0x3c56f8(0xe0))throw new a('--plan-ports\x20requires\x20rendered\x20or\x20both\x20mode');let _0x309ff0=s(_0x190fef);if(_0x190fef['textWidthGrowth']!==void 0x0&&!_0x309ff0&&!_0x190fef[_0x3c56f8(0xac)]?.[_0x3c56f8(0xa3)])throw new a('--text-width-growth\x20requires\x20--plan-text\x20or\x20--plan\x20graph/text');if(_0x190fef[_0x3c56f8(0xac)]!==void 0x0&&_0x190fef['mode']===_0x3c56f8(0xe0))throw new a(_0x3c56f8(0xf4));if(_0x190fef[_0x3c56f8(0xb5)]!==void 0x0&&_0x190fef[_0x3c56f8(0xde)]===_0x3c56f8(0xe0))throw new a(_0x3c56f8(0xd9));_0x5b9251=await _0x1c7d7d['lint'][_0x3c56f8(0x94)]({..._0x42f4c9,..._0x181c5a===void 0x0?{}:{'pages':_0x181c5a},..._0x42f4c9[_0x3c56f8(0xc3)]==='board'&&_0x309ff0?{'layoutPlan':_0x309ff0}:{},..._0x42f4c9[_0x3c56f8(0xc3)]===_0x3c56f8(0xc2)&&_0x190fef[_0x3c56f8(0xde)]!==void 0x0?{'mode':_0x190fef[_0x3c56f8(0xde)]}:{},..._0x42f4c9['unitType']===_0x3c56f8(0xc2)&&_0x190fef[_0x3c56f8(0xb5)]!==void 0x0?{'maximumAutomaticLabelDistance':_0x190fef['maximumAutomaticLabelDistance']}:{},..._0x42f4c9['unitType']===_0x3c56f8(0xc2)&&_0x190fef['planText']!==void 0x0?{'textPlanElementIds':_0x190fef[_0x3c56f8(0xac)]}:{},..._0x42f4c9[_0x3c56f8(0xc3)]===_0x3c56f8(0xc2)&&!_0x309ff0&&_0x190fef[_0x3c56f8(0xbc)]!==void 0x0?{'textPlanMaximumWidthGrowth':_0x190fef['textWidthGrowth']}:{},..._0x42f4c9[_0x3c56f8(0xc3)]===_0x3c56f8(0xc2)&&_0x190fef[_0x3c56f8(0x9b)]===!0x0?{'includeLabelPlan':!0x0}:{},..._0x42f4c9['unitType']==='board'&&_0x190fef[_0x3c56f8(0xda)]===!0x0?{'includePortPlan':!0x0}:{}});}catch(_0x4b0fe1){throw(_0x4b0fe1 instanceof a||_0x1befaa(_0x4b0fe1)||f(_0x4b0fe1))&&_0x5beaa7[_0x3c56f8(0xaa)](''+('code'in _0x4b0fe1?String(_0x4b0fe1[_0x3c56f8(0xc0)])+':\x20':'')+_0x4b0fe1[_0x3c56f8(0x95)],{'code':'unit-layout-lint.failed','exitCode':0x1}),_0x4b0fe1;}let _0x160fd7=_0x5b9251['unitType']===_0x3c56f8(0xc2)&&(!_0x5b9251[_0x3c56f8(0xc4)][_0x3c56f8(0xc8)]||_0x5b9251[_0x3c56f8(0xe6)]['some'](({severity:_0x5e38f8})=>_0x5e38f8==='error'));if(_0x160fd7&&_0x190fef['json']===!0x0){let _0x355294={..._0x5beaa7['configureOutput']()};_0x355294[_0x3c56f8(0xea)]?.(JSON[_0x3c56f8(0xf7)]({'ok':!0x1,'error':{'code':_0x3c56f8(0xf9),'message':'Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','details':{'report':_0x5b9251}}})+'\x0a'),_0x5beaa7[_0x3c56f8(0xd7)]({'outputError':()=>{}});try{_0x5beaa7['error'](_0x3c56f8(0xae),{'code':_0x3c56f8(0xf9),'exitCode':0x2});}catch(_0x3f9afb){throw _0x3f9afb instanceof Error&&Object[_0x3c56f8(0xe5)](_0x3f9afb,{'details':{'report':_0x5b9251}}),_0x3f9afb;}finally{_0x5beaa7['configureOutput'](_0x355294);}}_0x5beaa7[_0x3c56f8(0xd7)]()['writeOut']?.((_0x190fef[_0x3c56f8(0xb7)]===!0x0?JSON[_0x3c56f8(0xf7)](_0x5b9251,null,0x2):l(_0x5b9251))+'\x0a'),_0x160fd7&&_0x5beaa7[_0x3c56f8(0xaa)](_0x3c56f8(0xba),{'code':_0x3c56f8(0xf9),'exitCode':0x2});});return _0x5beaa7;}function _0x224d(_0x4c7bf4,_0x282b56){_0x4c7bf4=_0x4c7bf4-0x93;const _0x6fd40b=_0x6fd4();let _0x224d63=_0x6fd40b[_0x4c7bf4];return _0x224d63;}function s(_0x2b45c6){const _0x59b072=_0x224d;let {plan:_0x1c9326,planIds:_0x58b6de,planOptions:_0xdce03f,textWidthGrowth:_0x1d9778}=_0x2b45c6;if(_0xdce03f!==void 0x0&&_0x1c9326!=='graph')throw new a(_0x59b072(0xe7));if(_0x1c9326===void 0x0){if(_0x58b6de!==void 0x0)throw new a(_0x59b072(0xc1));return;}if(_0x2b45c6[_0x59b072(0xde)]==='model'||_0x2b45c6['planLabels']||_0x2b45c6[_0x59b072(0xda)]||_0x2b45c6[_0x59b072(0xac)])throw new a(_0x59b072(0xd4));if(_0x1d9778!==void 0x0&&_0x1c9326!==_0x59b072(0xc5)&&_0x1c9326!==_0x59b072(0xe4))throw new a(_0x59b072(0xcf));let _0x4d11de=_0x1d9778===void 0x0?{}:{'maximumWidthGrowth':_0x1d9778};if(_0x1c9326===_0x59b072(0xe4)){if(!_0x58b6de?.[_0x59b072(0xa3)])throw new a(_0x59b072(0xd5));return{'mode':_0x1c9326,'elementIds':_0x58b6de,..._0x4d11de};}return _0x1c9326===_0x59b072(0xc5)?{...c(_0xdce03f),'mode':_0x1c9326,..._0x58b6de===void 0x0?{}:{'elementIds':_0x58b6de},..._0x4d11de}:{'mode':_0x1c9326,..._0x58b6de===void 0x0?{}:{'connectorIds':_0x58b6de}};}function c(_0x3cfe72){const _0xce2d35=_0x224d;if(_0x3cfe72===void 0x0)return{};let _0x493e34=new Set(['direction','layerGap',_0xce2d35(0xa7),'origin',_0xce2d35(0xcb),_0xce2d35(0x98),_0xce2d35(0xa4)]),_0x30e5e0;try{_0x30e5e0=JSON[_0xce2d35(0xaf)](_0x3cfe72);}catch{throw new a(_0xce2d35(0xa2));}if(!_0x30e5e0||typeof _0x30e5e0!=_0xce2d35(0xf5)||Array[_0xce2d35(0x9f)](_0x30e5e0)||Object['keys'](_0x30e5e0)['some'](_0x476249=>!_0x493e34[_0xce2d35(0xe2)](_0x476249)))throw new a(_0xce2d35(0x97));return _0x30e5e0;}function l(_0x30c1b9){const _0x54a1e9=_0x224d;if(_0x30c1b9[_0x54a1e9(0xc3)]===_0x54a1e9(0xc2)){let _0x253a8d=[_0x54a1e9(0xf1)+_0x30c1b9[_0x54a1e9(0xd2)]+'\x20('+String(_0x30c1b9[_0x54a1e9(0xc4)][_0x54a1e9(0x96)]['length'])+'\x20pages,\x20'+_0x30c1b9[_0x54a1e9(0xde)]+')'];for(let _0x58c508 of _0x30c1b9[_0x54a1e9(0xe6)])_0x253a8d['push'](_0x54a1e9(0xee)+String(_0x58c508[_0x54a1e9(0xf0)])+'\x20\x20'+_0x58c508[_0x54a1e9(0xb0)]+'\x20\x20'+_0x58c508[_0x54a1e9(0xf3)]+'\x20\x20'+_0x58c508[_0x54a1e9(0xdd)]+'\x20\x20'+_0x58c508['id']);for(let _0x365824 of _0x30c1b9[_0x54a1e9(0xc4)][_0x54a1e9(0xf2)])_0x253a8d[_0x54a1e9(0xce)](_0x54a1e9(0xd6)+_0x365824['pageId']+'\x20\x20'+_0x365824['source']+'\x20\x20'+_0x365824[_0x54a1e9(0x9d)]);for(let _0x59c028 of _0x30c1b9['coverage']['limitations'])_0x253a8d['push'](_0x54a1e9(0xc7)+_0x59c028);return _0x253a8d['join']('\x0a');}if(_0x30c1b9[_0x54a1e9(0xe6)]['length']===0x0)return _0x54a1e9(0x99)+String(_0x30c1b9[_0x54a1e9(0xc4)]['pages'][_0x54a1e9(0xa3)])+'\x20pages\x20checked)';let _0x54b33f=[_0x54a1e9(0x9a)+String(_0x30c1b9[_0x54a1e9(0xe6)]['length'])+_0x54a1e9(0xfd)+String(_0x30c1b9[_0x54a1e9(0xc4)]['pages']['length'])+_0x54a1e9(0xef)];for(let _0x3e9d03 of _0x30c1b9['findings'])_0x54b33f[_0x54a1e9(0xce)](_0x54a1e9(0xee)+String(_0x3e9d03['page'])+'\x20\x20'+_0x3e9d03[_0x54a1e9(0xdd)]+'\x20\x20'+_0x3e9d03['id']),_0x54b33f[_0x54a1e9(0xce)]('\x20\x20'+_0x3e9d03[_0x54a1e9(0xf8)]);return _0x54b33f['join']('\x0a');}function u(_0x3489c5){return d(_0x3489c5);}function d(_0x388641){const _0x34dfa8=_0x224d;if(_0x388641[_0x34dfa8(0xec)]()===_0x34dfa8(0xb4))return;if(_0x388641[_0x34dfa8(0xec)]()==='')throw new a(_0x34dfa8(0xb2));let _0x4461f1=[];for(let _0x3b5f09 of _0x388641[_0x34dfa8(0xff)](',')){let _0x4370e1=_0x3b5f09[_0x34dfa8(0xec)]();if(_0x4370e1==='')throw new a(_0x34dfa8(0x9c));let _0x45707d=/^(\d+)(?:-(\d+))?$/[_0x34dfa8(0xb8)](_0x4370e1);if(_0x45707d===null){_0x4461f1[_0x34dfa8(0xce)](_0x4370e1);continue;}let _0x501238=Number(_0x45707d[0x1]),_0x54bb3e=Number(_0x45707d[0x2]??_0x45707d[0x1]);if(_0x501238<0x1||_0x54bb3e<_0x501238)throw new a(_0x34dfa8(0xed)+_0x4370e1);if(_0x4461f1[_0x34dfa8(0xa3)]+_0x54bb3e-_0x501238+0x1>i)throw new a('--pages\x20expands\x20to\x20too\x20many\x20pages');for(let _0x18d3cd=_0x501238;_0x18d3cd<=_0x54bb3e;_0x18d3cd+=0x1)_0x4461f1['push'](_0x18d3cd);}return _0x4461f1;}function f(_0x556fa5){const _0x363dd7=_0x224d;return _0x556fa5 instanceof Error&&typeof _0x556fa5[_0x363dd7(0xc0)]=='string';}function _0x6fd4(){const _0x82f9e1=['1743798GckfXg','--maximum-automatic-label-distance\x20requires\x20rendered\x20or\x20both\x20mode','planPorts','limit\x20the\x20layout\x20plan\x20to\x20generated\x20element\x20or\x20connector\x20IDs','321pcZZvD','rule','mode','labels','model','addOption','has','--maximum-automatic-label-distance\x20<board-units>','text','assign','findings','--plan-options\x20requires\x20--plan\x20graph','5016304STgONT','name','writeErr','Lint\x20Slide\x20or\x20Board\x20layout\x20with\x20SDK\x20geometry\x20evidence','trim','Invalid\x20page\x20selector:\x20','page\x20','\x20pages\x20checked)','page','Board\x20layout\x20lint:\x20','incomplete','severity','--plan-text\x20requires\x20rendered\x20or\x20both\x20mode','object','planOptions','stringify','detail','UNIT_LAYOUT_LINT_BOARD_FAILED','choices','23130dWZQRU','plan','\x20findings\x20(','include\x20a\x20read-only\x20native\x20Board\x20layout\x20plan','split','--plan-ports','lint','message','pages','--plan-options\x20accepts\x20direction,\x20layerGap,\x20itemGap,\x20origin,\x20maxNodes,\x20fixedElementIds\x20and\x20feedbackConnectorIds','fixedElementIds','Slide\x20layout\x20lint:\x20no\x20findings\x20(','Slide\x20layout\x20lint:\x20','planLabels','--pages\x20contains\x20an\x20empty\x20selector','reason','--plan-text\x20<element-id...>','isArray','unit','Pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover','--plan-options\x20must\x20contain\x20a\x20JSON\x20object','length','feedbackConnectorIds','must\x20be\x20a\x20finite\x20ratio\x20from\x201\x20to\x202','routes','itemGap','must\x20be\x20a\x20finite\x20non-negative\x20number\x20of\x20Board\x20units','5526342lWlYfZ','error','679691jskqkQ','planText','option','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','parse','source','rendered','--pages\x20cannot\x20be\x20empty','Board\x20analysis\x20mode\x20(default:\x20both)','all','maximumAutomaticLabelDistance','both','json','exec','16kUyjFc','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage;\x20see\x20the\x20report','--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','textWidthGrowth','--mode\x20<mode>','1803170ahhStE','require\x20native\x20automatic\x20Board\x20labels\x20within\x20this\x20distance\x20of\x20their\x20rendered\x20stroke','code','--plan-ids\x20requires\x20--plan','board','unitType','coverage','graph','UnitLayoutLintCommandInputError','coverage:\x20','complete','--json','action','maxNodes','--text-width-growth\x20<ratio>','Slide\x20or\x20Board\x20Unit\x20to\x20lint','push','--text-width-growth\x20requires\x20graph\x20or\x20text\x20planning','ports','7944993qzELHt','status','--plan-labels','--plan\x20requires\x20rendered\x20or\x20both\x20mode\x20and\x20cannot\x20be\x20combined\x20with\x20another\x20plan','--plan\x20text\x20requires\x20--plan-ids','incomplete\x20\x20','configureOutput'];_0x6fd4=function(){return _0x82f9e1;};return _0x6fd4();}function p(_0x4ff477){const _0x5128b1=_0x224d;let _0x442f0f=Number(_0x4ff477);if(_0x4ff477['trim']()===''||!Number['isFinite'](_0x442f0f)||_0x442f0f<0x0)throw new _0x118226(_0x5128b1(0xa8));return _0x442f0f;}function m(_0x51bbfd){const _0x846293=_0x224d;let _0x60c870=Number(_0x51bbfd);if(_0x51bbfd[_0x846293(0xec)]()===''||!Number['isFinite'](_0x60c870)||_0x60c870<0x1||_0x60c870>0x2)throw new _0x118226(_0x846293(0xa5));return _0x60c870;}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.3.1",
4
+ "version": "1.5.2",
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.3.1"
21
+ "@univer-cli/unit-layout-lint": "1.5.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"