@phoenix-wing/kt-codegen 0.4.2 → 0.5.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.
Files changed (47) hide show
  1. package/README.md +26 -3
  2. package/dist/KtCodegenApply.d.ts +9 -0
  3. package/dist/KtCodegenApply.d.ts.map +1 -1
  4. package/dist/KtCodegenApply.js +29 -2
  5. package/dist/KtCodegenApply.js.map +1 -1
  6. package/dist/KtCodegenMarker.d.ts +8 -3
  7. package/dist/KtCodegenMarker.d.ts.map +1 -1
  8. package/dist/KtCodegenMarker.js +80 -56
  9. package/dist/KtCodegenMarker.js.map +1 -1
  10. package/dist/model/diagnostic.d.ts +18 -0
  11. package/dist/model/diagnostic.d.ts.map +1 -1
  12. package/dist/model/diagnostic.js.map +1 -1
  13. package/dist/table/KtCodegenTable.d.ts +24 -6
  14. package/dist/table/KtCodegenTable.d.ts.map +1 -1
  15. package/dist/table/KtCodegenTable.js +141 -203
  16. package/dist/table/KtCodegenTable.js.map +1 -1
  17. package/dist/table/KtCodegenTableStyle.d.ts +20 -0
  18. package/dist/table/KtCodegenTableStyle.d.ts.map +1 -0
  19. package/dist/table/KtCodegenTableStyle.js +207 -0
  20. package/dist/table/KtCodegenTableStyle.js.map +1 -0
  21. package/dist/table/KtCodegenTableViewModel.d.ts +45 -0
  22. package/dist/table/KtCodegenTableViewModel.d.ts.map +1 -0
  23. package/dist/table/KtCodegenTableViewModel.js +99 -0
  24. package/dist/table/KtCodegenTableViewModel.js.map +1 -0
  25. package/dist/ui/KtCodegenControlPanel.d.ts +35 -0
  26. package/dist/ui/KtCodegenControlPanel.d.ts.map +1 -0
  27. package/dist/ui/KtCodegenControlPanel.js +338 -0
  28. package/dist/ui/KtCodegenControlPanel.js.map +1 -0
  29. package/dist/ui/KtCodegenControlViewModel.d.ts +20 -0
  30. package/dist/ui/KtCodegenControlViewModel.d.ts.map +1 -0
  31. package/dist/ui/KtCodegenControlViewModel.js +57 -0
  32. package/dist/ui/KtCodegenControlViewModel.js.map +1 -0
  33. package/dist/ui/KtCodegenPrimaryPanel.d.ts +40 -0
  34. package/dist/ui/KtCodegenPrimaryPanel.d.ts.map +1 -0
  35. package/dist/ui/KtCodegenPrimaryPanel.js +384 -0
  36. package/dist/ui/KtCodegenPrimaryPanel.js.map +1 -0
  37. package/dist/ui/KtCodegenUiContracts.d.ts +123 -0
  38. package/dist/ui/KtCodegenUiContracts.d.ts.map +1 -0
  39. package/dist/ui/KtCodegenUiContracts.js +3 -0
  40. package/dist/ui/KtCodegenUiContracts.js.map +1 -0
  41. package/dist/ui/index.d.ts +5 -0
  42. package/dist/ui/index.d.ts.map +1 -0
  43. package/dist/ui/index.js +6 -0
  44. package/dist/ui/index.js.map +1 -0
  45. package/doc/KtCodegenTable/345/270/203/345/261/200/344/270/216/346/212/230/345/217/240/345/245/221/347/272/246.md +106 -0
  46. package/doc//350/207/252/345/212/250/344/273/243/347/240/201/346/240/207/350/256/260/346/211/253/346/217/217.md +8 -9
  47. package/package.json +5 -1
@@ -0,0 +1,384 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ import { KT_CODEGEN_BLOCK_PRESENTATIONS, ktCodegenBlockKeysForPreset, } from "../KtCodegenBlockPresentation.js";
3
+ import { KT_CODEGEN_LEGACY_BLOCKS, } from "../blocks/legacy-blocks.js";
4
+ export const KT_CODEGEN_PRIMARY_PANEL_TAG_NAME = "kt-codegen-primary-panel";
5
+ const STYLE = `
6
+ :host {
7
+ --pnw-codegen-border: var(--vscode-panel-border, var(--border, color-mix(in srgb, currentColor 18%, transparent)));
8
+ --pnw-codegen-bg: var(--vscode-editor-background, var(--sidebar-bg, #fff));
9
+ --pnw-codegen-head-bg: var(--vscode-sideBarSectionHeader-background, var(--panel-head-bg, #f6f6f6));
10
+ --pnw-codegen-muted: var(--vscode-descriptionForeground, var(--muted, #666));
11
+ --pnw-codegen-hover: var(--vscode-list-hoverBackground, color-mix(in srgb, currentColor 8%, transparent));
12
+ --pnw-codegen-active-bg: var(--vscode-list-activeSelectionBackground, var(--accent, #007acc));
13
+ --pnw-codegen-active-fg: var(--vscode-list-activeSelectionForeground, #fff);
14
+ --pnw-codegen-focus: var(--vscode-focusBorder, var(--accent, #007acc));
15
+ position: relative; display: grid; gap: 4px; min-height: 0; color: var(--vscode-foreground, var(--text, inherit));
16
+ background: var(--vscode-sideBar-background, var(--sidebar-bg, #fff)); font: 12px/1.35 var(--vscode-font-family, system-ui, sans-serif);
17
+ }
18
+ * { box-sizing: border-box; }
19
+ button, input, select { font: inherit; }
20
+ button { cursor: pointer; }
21
+ button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 1px solid var(--pnw-codegen-focus); outline-offset: 1px; }
22
+ .pnw-codegen-actions { position: sticky; z-index: 12; top: 0; display: flex; flex-wrap: nowrap; gap: 2px; padding: 2px 5px 3px; overflow: hidden; background: var(--vscode-sideBar-background, var(--sidebar-bg, #fff)); border-bottom: 1px solid var(--pnw-codegen-border); }
23
+ .pnw-codegen-action { display: inline-grid; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; place-items: center; padding: 0; color: var(--vscode-button-foreground, inherit); background: var(--vscode-button-background, var(--btn-bg, transparent)); border: 1px solid var(--pnw-codegen-border); border-radius: 3px; font-size: 17px; }
24
+ .pnw-codegen-action.pnw-codegen-secondary { color: inherit; background: var(--vscode-button-secondaryBackground, var(--btn-bg, transparent)); }
25
+ button:disabled { opacity: .5; cursor: not-allowed; }
26
+ .pnw-codegen-mini { min-width: 0; margin: 0 4px; overflow: hidden; border: 1px solid var(--pnw-codegen-border); border-radius: 5px; background: var(--pnw-codegen-bg); }
27
+ .pnw-codegen-mini > summary { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 28px; padding: 3px 5px; color: var(--pnw-codegen-muted); background: var(--pnw-codegen-head-bg); font-size: 11px; font-weight: 650; cursor: pointer; list-style: none; user-select: none; }
28
+ .pnw-codegen-mini > summary::-webkit-details-marker { display: none; }
29
+ .pnw-codegen-mini > summary::before { content: "›"; flex: 0 0 auto; font-size: 16px; line-height: 1; }
30
+ .pnw-codegen-mini[open] > summary::before { transform: rotate(90deg); }
31
+ .pnw-codegen-mini-title { margin-right: auto; color: var(--vscode-foreground, var(--text, inherit)); }
32
+ .pnw-codegen-mini-count { white-space: nowrap; font-weight: 500; }
33
+ .pnw-codegen-current-identity { display: flex; flex: 1 1 auto; min-width: 0; align-items: baseline; gap: 6px; }
34
+ .pnw-codegen-current-file { flex: 0 1 52%; max-width: 52%; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
35
+ .pnw-codegen-current-meta { flex: 1 1 auto; overflow: hidden; color: var(--pnw-codegen-muted); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
36
+ .pnw-codegen-properties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; padding: 5px 6px; border-top: 1px solid var(--pnw-codegen-border); }
37
+ .pnw-codegen-property { display: grid; gap: 1px; min-width: 0; }
38
+ .pnw-codegen-property span { color: var(--pnw-codegen-muted); font-size: 10px; }
39
+ .pnw-codegen-property input { width: 100%; min-width: 0; height: 25px; padding: 2px 5px; color: inherit; background: var(--vscode-input-background, var(--input-bg, transparent)); border: 1px solid var(--pnw-codegen-border); border-radius: 2px; }
40
+ .pnw-codegen-list { display: grid; grid-auto-rows: 40px; max-height: 252px; overflow: auto; border-top: 1px solid var(--pnw-codegen-border); scrollbar-gutter: stable; }
41
+ .pnw-codegen-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 6px; width: 100%; padding: 3px 5px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 0; text-align: left; }
42
+ .pnw-codegen-row:hover { background: var(--pnw-codegen-hover); }
43
+ .pnw-codegen-row.pnw-codegen-active { color: var(--pnw-codegen-active-fg); background: var(--pnw-codegen-active-bg); border-color: var(--pnw-codegen-focus); }
44
+ .pnw-codegen-row-name, .pnw-codegen-row-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
45
+ .pnw-codegen-row-name { font-weight: 600; }
46
+ .pnw-codegen-row-path { color: var(--pnw-codegen-muted); font-size: 11px; }
47
+ .pnw-codegen-tags { display: flex; align-items: center; justify-content: flex-end; gap: 4px; grid-row: 1 / span 2; grid-column: 2; }
48
+ .pnw-codegen-tag { padding: 1px 5px; color: var(--pnw-codegen-muted); border: 1px solid var(--pnw-codegen-border); border-radius: 999px; font-size: 10px; white-space: nowrap; }
49
+ .pnw-codegen-tag.pnw-codegen-warning { color: var(--vscode-editorWarning-foreground, #b45309); border-color: currentColor; }
50
+ .pnw-codegen-tag.pnw-codegen-error { color: var(--vscode-errorForeground, #b91c1c); border-color: currentColor; }
51
+ .pnw-codegen-tag.pnw-codegen-success { color: var(--vscode-testing-iconPassed, #15803d); border-color: currentColor; }
52
+ .pnw-codegen-candidates { grid-auto-rows: 30px; }
53
+ .pnw-codegen-candidate { display: flex; min-width: 0; min-height: 30px; align-items: center; gap: 6px; padding: 2px 4px; border: 0; border-bottom: 1px solid var(--pnw-codegen-border); }
54
+ .pnw-codegen-candidate-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
55
+ .pnw-codegen-candidate-name { font-weight: 600; }
56
+ .pnw-codegen-candidate-path { color: var(--pnw-codegen-muted); font-size: 11px; }
57
+ .pnw-codegen-controls-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; padding: 5px; border-top: 1px solid var(--pnw-codegen-border); border-bottom: 1px solid var(--pnw-codegen-border); }
58
+ .pnw-codegen-controls-toolbar select { min-width: 0; height: 25px; color: inherit; background: var(--vscode-dropdown-background, var(--input-bg, transparent)); border: 1px solid var(--pnw-codegen-border); }
59
+ .pnw-codegen-presets { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(5, 1fr); gap: 3px; }
60
+ .pnw-codegen-presets button { min-height: 24px; padding: 2px 3px; color: inherit; background: var(--vscode-button-secondaryBackground, var(--btn-bg, transparent)); border: 1px solid var(--pnw-codegen-border); border-radius: 3px; }
61
+ .pnw-codegen-control-list { max-height: 290px; overflow: auto; }
62
+ .pnw-codegen-control { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr) auto; align-items: center; gap: 4px; min-height: 29px; padding: 3px 6px; border-bottom: 1px solid var(--pnw-codegen-border); }
63
+ .pnw-codegen-control:hover { background: var(--pnw-codegen-hover); }
64
+ .pnw-codegen-control-id { color: var(--pnw-codegen-muted); }
65
+ .pnw-codegen-control-name { overflow: hidden; font-family: ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
66
+ .pnw-codegen-empty, .pnw-codegen-hint { margin: 0; padding: 12px 8px; color: var(--pnw-codegen-muted); text-align: center; }
67
+ .pnw-codegen-report-directory { min-height: 25px; margin: 5px; padding: 2px 7px; color: inherit; background: var(--vscode-button-secondaryBackground, var(--btn-bg, transparent)); border: 1px solid var(--pnw-codegen-border); border-radius: 3px; }
68
+ .pnw-codegen-overlay { position: absolute; z-index: 20; inset: 0; display: grid; place-content: center; gap: 6px; padding: 16px; background: color-mix(in srgb, var(--pnw-codegen-bg) 88%, transparent); border: 1px solid var(--pnw-codegen-focus); border-radius: 6px; text-align: center; cursor: progress; }
69
+ .pnw-codegen-overlay[hidden] { display: none; }
70
+ `;
71
+ const legacyByKey = new Map(KT_CODEGEN_LEGACY_BLOCKS.map((item) => [item.key, item]));
72
+ export class KtCodegenPrimaryPanel extends HTMLElement {
73
+ root = this.attachShadow({ mode: "open" });
74
+ currentModel;
75
+ expanded = new Map([["current", true], ["documents", true], ["reports", true], ["controls", true], ["candidates", true]]);
76
+ scrollOffsets = new Map();
77
+ statusFilter = "all";
78
+ scopeFilter = "all";
79
+ singleMode = false;
80
+ get model() { return this.currentModel; }
81
+ set model(value) { this.currentModel = value; this.render(); }
82
+ connectedCallback() { this.render(); }
83
+ render() {
84
+ if (!this.isConnected)
85
+ return;
86
+ const style = document.createElement("style");
87
+ style.textContent = STYLE;
88
+ const model = this.currentModel;
89
+ if (!model) {
90
+ this.root.replaceChildren(style, this.empty("Codegen 尚未激活。"));
91
+ return;
92
+ }
93
+ const active = model.documents.find((item) => item.active || item.id === model.activeId);
94
+ const actions = document.createElement("div");
95
+ actions.className = "pnw-codegen-actions";
96
+ actions.append(this.actionButton("▣", "openJson", model.capabilities.openJson, "打开一份 Codegen JSON"), this.actionButton("⇩", "importCsv", model.capabilities.importCsv, "导入 CSV 并转换为 Codegen JSON"), this.actionButton("✓", "applyAll", model.capabilities.applyAll && model.documents.length > 0, "全部应用"), this.actionButton(model.operation === "discovery" ? "×" : "↻", model.operation === "discovery" ? "cancelOperation" : "refresh", true, model.operation === "discovery" ? "取消刷新" : "刷新配置"), this.actionButton(model.operation === "candidates" ? "×" : "⌕", model.operation === "candidates" ? "cancelOperation" : "scanCandidates", model.capabilities.scanCandidates, model.operation === "candidates" ? "取消扫描" : "扫描控制符源码候选"));
97
+ const nodes = [style, actions];
98
+ if (active)
99
+ nodes.push(this.currentConfig(active));
100
+ nodes.push(this.documents(model), this.reports(model), this.controls(model), this.candidates(model));
101
+ const hint = document.createElement("p");
102
+ hint.className = "pnw-codegen-hint";
103
+ hint.textContent = "一份 JSON 对应当前编辑区一个表格 View;Primary 与 JSON View 的控制符目录由 Host session 同步。";
104
+ nodes.push(hint, this.overlay(model));
105
+ this.root.replaceChildren(...nodes);
106
+ }
107
+ actionButton(label, action, enabled, title) {
108
+ const button = document.createElement("button");
109
+ button.type = "button";
110
+ button.className = "pnw-codegen-action pnw-codegen-secondary";
111
+ button.textContent = label;
112
+ button.title = title;
113
+ button.disabled = !enabled || Boolean(this.currentModel?.running) || (Boolean(this.currentModel?.operation) && action !== "cancelOperation");
114
+ button.onclick = () => this.emit({ action });
115
+ return button;
116
+ }
117
+ currentConfig(active) {
118
+ const details = this.details("current");
119
+ const summary = document.createElement("summary");
120
+ const identity = document.createElement("span");
121
+ identity.className = "pnw-codegen-current-identity";
122
+ const name = document.createElement("span");
123
+ name.className = "pnw-codegen-current-file";
124
+ name.textContent = active.fileName;
125
+ const meta = document.createElement("span");
126
+ meta.className = "pnw-codegen-current-meta";
127
+ meta.textContent = `${active.className || "未命名类"} · ${active.itemCount} 行 · 当前编辑 View${active.dirty ? " · 未保存" : ""}${active.externalConflict ? " · 外部文件已变更" : ""}`;
128
+ identity.append(name, meta);
129
+ summary.append(identity);
130
+ const properties = document.createElement("div");
131
+ properties.className = "pnw-codegen-properties";
132
+ properties.append(this.property("Prefix", "namePrefix", active), this.property("Middle", "nameMiddle", active), this.property("Namespace", "nameSpace", active), this.property("Append", "appendFunction", active));
133
+ details.append(summary, properties);
134
+ return details;
135
+ }
136
+ property(label, field, active) {
137
+ const wrapper = document.createElement("label");
138
+ wrapper.className = "pnw-codegen-property";
139
+ const caption = document.createElement("span");
140
+ caption.textContent = label;
141
+ const input = document.createElement("input");
142
+ input.value = active[field];
143
+ input.disabled = Boolean(this.currentModel?.running || this.currentModel?.operation);
144
+ input.spellcheck = false;
145
+ input.onchange = () => this.emit({ action: "updateMeta", id: active.id, field, value: input.value });
146
+ wrapper.append(caption, input);
147
+ return wrapper;
148
+ }
149
+ documents(model) {
150
+ const details = this.details("documents", "JSON 配置", model.documents.length ? `${model.documents.length} 份` : "");
151
+ const list = this.list("documents");
152
+ for (const item of model.documents) {
153
+ const row = this.row(item.fileName, `${item.className || "未命名类"} · ${item.displayPath}`);
154
+ row.classList.toggle("pnw-codegen-active", item.active);
155
+ const tags = row.querySelector(".pnw-codegen-tags");
156
+ tags.append(this.tag(`${item.itemCount} 行`));
157
+ if (item.open)
158
+ tags.append(this.tag(item.active ? "当前" : "已开"));
159
+ if (item.dirty)
160
+ tags.append(this.tag("未保存", "warning"));
161
+ if (item.externalConflict)
162
+ tags.append(this.tag(item.externalState === "deleted" ? "磁盘已删除" : "外部变更", "error"));
163
+ row.onclick = () => this.emit({ action: "openDocument", id: item.id });
164
+ list.append(row);
165
+ }
166
+ if (!model.documents.length)
167
+ list.append(this.empty(model.operation === "discovery" ? "正在查找 Codegen JSON…" : "暂无 Codegen JSON"));
168
+ details.append(list);
169
+ return details;
170
+ }
171
+ reports(model) {
172
+ const details = this.details("reports", "应用报告", model.reports.length ? `${model.reports.length} 份` : "");
173
+ const list = this.list("reports");
174
+ for (const report of model.reports.slice(0, 20)) {
175
+ const row = this.row(report.subject, new Date(report.startedAt).toLocaleString());
176
+ const tags = row.querySelector(".pnw-codegen-tags");
177
+ tags.append(this.tag(report.applyKind === "batch" ? `批量 ${report.itemCount}` : "单次"), this.tag(this.healthLabel(report.health), report.health), this.tag(this.changeLabel(report.change), report.change === "not-applied" ? "error" : report.change === "partial" ? "warning" : "success"));
178
+ row.onclick = () => this.emit({ action: "openReport", id: report.id });
179
+ list.append(row);
180
+ }
181
+ if (!model.reports.length)
182
+ list.append(this.empty("执行 Apply 后会在这里保留报告。"));
183
+ details.append(list);
184
+ if (model.capabilities.openReportDirectory) {
185
+ const directory = document.createElement("button");
186
+ directory.type = "button";
187
+ directory.className = "pnw-codegen-report-directory";
188
+ directory.textContent = "打开报告目录";
189
+ directory.onclick = () => this.emit({ action: "openReportDirectory" });
190
+ details.append(directory);
191
+ }
192
+ return details;
193
+ }
194
+ controls(model) {
195
+ const details = this.details("controls", "控制符目录", "会话级");
196
+ const controls = model.controls;
197
+ if (!controls) {
198
+ details.append(this.empty("打开一份 Codegen 配置后显示控制符目录。"));
199
+ return details;
200
+ }
201
+ const toolbar = document.createElement("div");
202
+ toolbar.className = "pnw-codegen-controls-toolbar";
203
+ const status = document.createElement("select");
204
+ for (const [value, label] of [["all", "全部"], ["hit", "命中"], ["issues", "未闭合/缺失"], ["selected", "已选择"]])
205
+ status.append(new Option(label, value));
206
+ status.value = this.statusFilter;
207
+ status.onchange = () => { this.statusFilter = status.value; this.render(); };
208
+ const scope = document.createElement("select");
209
+ for (const [value, label] of [["all", "全部平台"], ["caa", "CAA"], ["qt", "Qt"], ["cpp", "C++ only"]])
210
+ scope.append(new Option(label, value));
211
+ scope.value = this.scopeFilter;
212
+ scope.onchange = () => { this.scopeFilter = scope.value; this.render(); };
213
+ const presets = document.createElement("div");
214
+ presets.className = "pnw-codegen-presets";
215
+ for (const [label, preset] of [["全选", "all"], ["清空", "none"], ["C++", "cpp-only"], ["Field", "field-code"]]) {
216
+ const button = document.createElement("button");
217
+ button.type = "button";
218
+ button.textContent = label;
219
+ button.onclick = () => this.emitSelection(ktCodegenBlockKeysForPreset(preset), false);
220
+ presets.append(button);
221
+ }
222
+ const single = document.createElement("button");
223
+ single.type = "button";
224
+ single.textContent = "单选";
225
+ single.setAttribute("aria-pressed", String(this.singleMode));
226
+ single.onclick = () => { this.singleMode = !this.singleMode; if (this.singleMode)
227
+ this.emitSelection(controls.selectedBlockKeys.slice(0, 1), true);
228
+ else
229
+ this.render(); };
230
+ presets.append(single);
231
+ toolbar.append(status, scope, presets);
232
+ const list = document.createElement("div");
233
+ list.className = "pnw-codegen-control-list";
234
+ const selected = new Set(controls.selectedBlockKeys);
235
+ for (const presentation of KT_CODEGEN_BLOCK_PRESENTATIONS) {
236
+ const legacy = legacyByKey.get(presentation.key);
237
+ const state = controls.blocks.find((item) => item.key === presentation.key);
238
+ if (this.scopeFilter !== "all" && legacy?.platform !== this.scopeFilter)
239
+ continue;
240
+ if (this.statusFilter === "hit" && state?.status !== "hit")
241
+ continue;
242
+ if (this.statusFilter === "issues" && state?.status !== "unclosed" && state?.status !== "missing")
243
+ continue;
244
+ if (this.statusFilter === "selected" && !selected.has(presentation.key))
245
+ continue;
246
+ const label = document.createElement("label");
247
+ label.className = "pnw-codegen-control";
248
+ const checkbox = document.createElement("input");
249
+ checkbox.type = "checkbox";
250
+ checkbox.checked = selected.has(presentation.key);
251
+ checkbox.onchange = () => this.toggleBlock(presentation.key, checkbox.checked);
252
+ const id = document.createElement("span");
253
+ id.className = "pnw-codegen-control-id";
254
+ id.textContent = String(presentation.legacyId);
255
+ const name = document.createElement("span");
256
+ name.className = "pnw-codegen-control-name";
257
+ name.textContent = presentation.controlWords;
258
+ const tag = this.tag(state?.status === "hit" ? `${state.hitCount} 命中` : state?.status === "unclosed" ? "未闭合" : state?.status === "missing" ? "缺失" : legacy?.platform ?? "caa", state?.status === "unclosed" || state?.status === "missing" ? "warning" : state?.status === "hit" ? "success" : undefined);
259
+ label.append(checkbox, id, name, tag);
260
+ list.append(label);
261
+ }
262
+ details.append(toolbar, list);
263
+ return details;
264
+ }
265
+ candidates(model) {
266
+ const details = this.details("candidates", "控制符候选(工作区级)", model.candidates.length ? `${model.candidates.length} 个` : "");
267
+ const list = this.list("candidates");
268
+ list.classList.add("pnw-codegen-candidates");
269
+ for (const candidate of model.candidates) {
270
+ const separator = Math.max(candidate.displayPath.lastIndexOf("/"), candidate.displayPath.lastIndexOf("\\"));
271
+ const name = separator < 0 ? candidate.displayPath : candidate.displayPath.slice(separator + 1);
272
+ const directory = separator < 0 ? "" : candidate.displayPath.slice(0, separator);
273
+ const row = document.createElement("button");
274
+ row.type = "button";
275
+ row.className = "pnw-codegen-row pnw-codegen-candidate";
276
+ const label = document.createElement("span");
277
+ label.className = "pnw-codegen-candidate-label";
278
+ const strong = document.createElement("span");
279
+ strong.className = "pnw-codegen-candidate-name";
280
+ strong.textContent = name;
281
+ const path = document.createElement("span");
282
+ path.className = "pnw-codegen-candidate-path";
283
+ path.textContent = directory ? ` · ${directory}` : "";
284
+ label.append(strong, path);
285
+ const tags = document.createElement("span");
286
+ tags.className = "pnw-codegen-tags";
287
+ tags.append(this.tag(`${candidate.markerCount} 标记`), this.tag(candidate.encoding));
288
+ row.append(label, tags);
289
+ row.onclick = () => this.emit({ action: "openCandidate", id: candidate.id });
290
+ list.append(row);
291
+ }
292
+ if (!model.candidates.length)
293
+ list.append(this.empty(model.operation === "candidates" ? "正在扫描候选源码…" : "点击“扫描候选源码”建立工作区控制符列表"));
294
+ details.append(list);
295
+ return details;
296
+ }
297
+ details(key, title, count = "") {
298
+ const details = document.createElement("details");
299
+ details.className = "pnw-codegen-mini";
300
+ details.open = this.expanded.get(key) ?? true;
301
+ details.ontoggle = () => this.expanded.set(key, details.open);
302
+ if (title) {
303
+ const summary = document.createElement("summary");
304
+ const name = document.createElement("span");
305
+ name.className = "pnw-codegen-mini-title";
306
+ name.textContent = title;
307
+ const value = document.createElement("span");
308
+ value.className = "pnw-codegen-mini-count";
309
+ value.textContent = count;
310
+ summary.append(name, value);
311
+ details.append(summary);
312
+ }
313
+ return details;
314
+ }
315
+ list(key) {
316
+ const list = document.createElement("div");
317
+ list.className = "pnw-codegen-list";
318
+ list.scrollTop = this.scrollOffsets.get(key) ?? 0;
319
+ list.onscroll = () => this.scrollOffsets.set(key, list.scrollTop);
320
+ return list;
321
+ }
322
+ row(nameText, pathText) {
323
+ const row = document.createElement("button");
324
+ row.type = "button";
325
+ row.className = "pnw-codegen-row";
326
+ const name = document.createElement("span");
327
+ name.className = "pnw-codegen-row-name";
328
+ name.textContent = nameText;
329
+ const path = document.createElement("span");
330
+ path.className = "pnw-codegen-row-path";
331
+ path.textContent = pathText;
332
+ const tags = document.createElement("span");
333
+ tags.className = "pnw-codegen-tags";
334
+ row.append(name, path, tags);
335
+ return row;
336
+ }
337
+ tag(text, tone) {
338
+ const tag = document.createElement("span");
339
+ tag.className = `pnw-codegen-tag${tone ? ` pnw-codegen-${tone}` : ""}`;
340
+ tag.textContent = text;
341
+ return tag;
342
+ }
343
+ toggleBlock(key, checked) {
344
+ const controls = this.currentModel?.controls;
345
+ if (!controls)
346
+ return;
347
+ const selected = new Set(controls.selectedBlockKeys);
348
+ if (this.singleMode && checked)
349
+ this.emitSelection([key], true);
350
+ else {
351
+ if (checked)
352
+ selected.add(key);
353
+ else
354
+ selected.delete(key);
355
+ this.emitSelection([...selected], this.singleMode);
356
+ }
357
+ }
358
+ emitSelection(blockKeys, singleMode) {
359
+ this.dispatchEvent(new CustomEvent("kt-codegen-control-selection-change", { bubbles: true, composed: true, detail: { blockKeys, singleMode } }));
360
+ }
361
+ overlay(model) {
362
+ const overlay = document.createElement("div");
363
+ overlay.className = "pnw-codegen-overlay";
364
+ overlay.hidden = model.operation !== "batch-apply" || !model.batch;
365
+ const title = document.createElement("strong");
366
+ title.textContent = model.batch ? `正在全部应用 ${model.batch.current} / ${model.batch.total}` : "正在全部应用";
367
+ const file = document.createElement("span");
368
+ file.textContent = model.batch?.fileName ?? "正在准备 JSON View…";
369
+ overlay.append(title, file);
370
+ return overlay;
371
+ }
372
+ healthLabel(value) { return value === "success" ? "正常" : value === "warning" ? "有警告" : "有错误"; }
373
+ changeLabel(value) { return value === "updated" ? "已更新" : value === "unchanged" ? "内容一致" : value === "partial" ? "部分更新" : "未应用"; }
374
+ empty(text) { const value = document.createElement("div"); value.className = "pnw-codegen-empty"; value.textContent = text; return value; }
375
+ emit(detail) { this.dispatchEvent(new CustomEvent("kt-codegen-primary-action", { bubbles: true, composed: true, detail })); }
376
+ }
377
+ export function ktCodegenDefinePrimaryPanelElement(tagName = KT_CODEGEN_PRIMARY_PANEL_TAG_NAME) {
378
+ const registered = customElements.get(tagName);
379
+ if (registered)
380
+ return registered;
381
+ customElements.define(tagName, KtCodegenPrimaryPanel);
382
+ return KtCodegenPrimaryPanel;
383
+ }
384
+ //# sourceMappingURL=KtCodegenPrimaryPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KtCodegenPrimaryPanel.js","sourceRoot":"","sources":["../../src/ui/KtCodegenPrimaryPanel.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,wBAAwB,GAEzB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,CAAC;AAE5E,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEb,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,wBAAwB,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QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,GAAG,mBAAmB,CAAC,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;IAChK,IAAI,CAAC,MAAoC,IAAU,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAA+B,2BAA2B,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CACxM;AAED,MAAM,UAAU,kCAAkC,CAAC,OAAO,GAAG,iCAAiC;IAC5F,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/C,IAAI,UAAU;QAAE,OAAO,UAA0C,CAAC;IAClE,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;IACtD,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,123 @@
1
+ import type { KtCodegenBlockKey } from "../blocks/legacy-blocks.js";
2
+ import type { KtCodegenPlan } from "../api/contracts.js";
3
+ /** 三种 Host 共用的 Codegen 预检状态;只有 ready 可用于 Apply。 */
4
+ export type KtCodegenPreflightUiState = "ready" | "applied" | "stale";
5
+ /** Host 已完成安全判断后的预检 UI 投影。组件只展示,不重新推导门禁。 */
6
+ export interface KtCodegenPreflightUiModel {
7
+ readonly plan: KtCodegenPlan;
8
+ readonly reused: boolean;
9
+ readonly createdAt: string;
10
+ readonly state: KtCodegenPreflightUiState;
11
+ readonly message: string;
12
+ }
13
+ /** 控制符目录和预检 View 共用的 Host 无关会话投影。 */
14
+ export interface KtCodegenControlUiModel {
15
+ readonly kind: "kt.codegen.control-ui-model";
16
+ readonly schemaVersion: 1;
17
+ readonly documentId: string;
18
+ readonly fileName: string;
19
+ readonly selectedBlockKeys: readonly KtCodegenBlockKey[];
20
+ readonly blocks: readonly KtCodegenControlBlockStateUiModel[];
21
+ /** Host 根据结构化 marker 上下文生成的只读修复建议;组件不得解析诊断 message。 */
22
+ readonly unclosed: readonly KtCodegenUnclosedUiModel[];
23
+ readonly preflight?: KtCodegenPreflightUiModel;
24
+ }
25
+ export interface KtCodegenControlBlockStateUiModel {
26
+ readonly key: KtCodegenBlockKey;
27
+ readonly status: "unselected" | "pending" | "hit" | "unclosed" | "missing";
28
+ readonly hitCount: number;
29
+ readonly artifactCount: number;
30
+ }
31
+ export interface KtCodegenUnclosedUiModel {
32
+ readonly code: "marker.missing-end";
33
+ readonly path: string;
34
+ readonly line: number;
35
+ readonly blockKey: KtCodegenBlockKey;
36
+ readonly expectedEnd: string;
37
+ }
38
+ export type KtCodegenControlUiFilter = "hits" | "issues" | "all";
39
+ export interface KtCodegenControlOpenDetail {
40
+ readonly path: string;
41
+ readonly line: number;
42
+ }
43
+ export interface KtCodegenControlCopyEndDetail extends KtCodegenControlOpenDetail {
44
+ readonly blockKey: KtCodegenBlockKey;
45
+ readonly expectedEnd: string;
46
+ }
47
+ export interface KtCodegenControlSplitDetail {
48
+ readonly ratio: number;
49
+ }
50
+ export interface KtCodegenPrimaryDocumentUiModel {
51
+ readonly id: string;
52
+ readonly fileName: string;
53
+ readonly displayPath: string;
54
+ readonly itemCount: number;
55
+ readonly className: string;
56
+ readonly namePrefix: string;
57
+ readonly nameMiddle: string;
58
+ readonly nameSpace: string;
59
+ readonly appendFunction: string;
60
+ readonly open: boolean;
61
+ readonly active: boolean;
62
+ readonly dirty: boolean;
63
+ readonly externalConflict: boolean;
64
+ readonly externalState: "current" | "changed" | "deleted";
65
+ readonly diagnosticCount: number;
66
+ }
67
+ export interface KtCodegenPrimaryCandidateUiModel {
68
+ readonly id: string;
69
+ readonly displayPath: string;
70
+ readonly markerCount: number;
71
+ readonly encoding: string;
72
+ readonly eol: "lf" | "crlf";
73
+ }
74
+ export interface KtCodegenPrimaryReportUiModel {
75
+ readonly id: string;
76
+ readonly subject: string;
77
+ readonly startedAt: string;
78
+ readonly applyKind: "single" | "batch";
79
+ readonly itemCount: number;
80
+ readonly health: "success" | "warning" | "error";
81
+ readonly change: "updated" | "unchanged" | "partial" | "not-applied";
82
+ }
83
+ export interface KtCodegenPrimaryUiModel {
84
+ readonly kind: "kt.codegen.primary-ui-model";
85
+ readonly schemaVersion: 1;
86
+ readonly documents: readonly KtCodegenPrimaryDocumentUiModel[];
87
+ readonly activeId?: string;
88
+ readonly controls?: KtCodegenControlUiModel;
89
+ readonly candidates: readonly KtCodegenPrimaryCandidateUiModel[];
90
+ readonly reports: readonly KtCodegenPrimaryReportUiModel[];
91
+ readonly reportInvalidCount: number;
92
+ readonly operation?: "discovery" | "candidates" | "batch-apply";
93
+ readonly batch?: {
94
+ readonly current: number;
95
+ readonly total: number;
96
+ readonly fileName: string;
97
+ };
98
+ readonly running: boolean;
99
+ readonly capabilities: {
100
+ readonly openJson: boolean;
101
+ readonly importCsv: boolean;
102
+ readonly applyAll: boolean;
103
+ readonly scanCandidates: boolean;
104
+ readonly openReportDirectory: boolean;
105
+ };
106
+ }
107
+ export type KtCodegenPrimaryAction = "openJson" | "importCsv" | "applyAll" | "refresh" | "scanCandidates" | "cancelOperation" | "openReportDirectory";
108
+ export type KtCodegenPrimaryActionDetail = {
109
+ readonly action: KtCodegenPrimaryAction;
110
+ } | {
111
+ readonly action: "openDocument" | "openCandidate" | "openReport";
112
+ readonly id: string;
113
+ } | {
114
+ readonly action: "updateMeta";
115
+ readonly id: string;
116
+ readonly field: "namePrefix" | "nameMiddle" | "nameSpace" | "appendFunction";
117
+ readonly value: string;
118
+ };
119
+ export interface KtCodegenControlSelectionDetail {
120
+ readonly blockKeys: readonly KtCodegenBlockKey[];
121
+ readonly singleMode: boolean;
122
+ }
123
+ //# sourceMappingURL=KtCodegenUiContracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KtCodegenUiContracts.d.ts","sourceRoot":"","sources":["../../src/ui/KtCodegenUiContracts.ts"],"names":[],"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ACjD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ export {};
3
+ //# sourceMappingURL=KtCodegenUiContracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KtCodegenUiContracts.js","sourceRoot":"","sources":["../../src/ui/KtCodegenUiContracts.ts"],"names":[],"mappings":"AAAA,sCAAsC"}
@@ -0,0 +1,5 @@
1
+ export * from "./KtCodegenUiContracts.js";
2
+ export * from "./KtCodegenControlViewModel.js";
3
+ export * from "./KtCodegenControlPanel.js";
4
+ export * from "./KtCodegenPrimaryPanel.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,6 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ export * from "./KtCodegenUiContracts.js";
3
+ export * from "./KtCodegenControlViewModel.js";
4
+ export * from "./KtCodegenControlPanel.js";
5
+ export * from "./KtCodegenPrimaryPanel.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}