@dimina-kit/devtools 0.4.0-dev.20260702175315 → 0.4.0-dev.20260703051110

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 (50) hide show
  1. package/dist/main/app/app.js +5 -25
  2. package/dist/main/app/native-overview.d.ts +27 -0
  3. package/dist/main/app/native-overview.js +44 -0
  4. package/dist/main/index.bundle.js +826 -690
  5. package/dist/main/ipc/bridge-router.js +180 -141
  6. package/dist/main/ipc/project-fs.js +39 -21
  7. package/dist/main/services/automation/handlers/app.js +143 -109
  8. package/dist/main/services/mcp/tools/simulator-tools.js +118 -97
  9. package/dist/main/services/network-forward/dispatch-batch.d.ts +22 -0
  10. package/dist/main/services/network-forward/dispatch-batch.js +21 -0
  11. package/dist/main/services/network-forward/index.js +5 -20
  12. package/dist/main/services/projects/create-project-service.js +54 -34
  13. package/dist/main/services/projects/types.d.ts +1 -32
  14. package/dist/main/services/service-console/console-api.js +36 -27
  15. package/dist/main/services/simulator-temp-files/disk.js +109 -86
  16. package/dist/main/services/workbench-coi-server.js +58 -45
  17. package/dist/main/utils/logger.d.ts +5 -12
  18. package/dist/main/utils/logger.js +5 -45
  19. package/dist/preload/instrumentation/wxml-extract.js +94 -62
  20. package/dist/preload/runtime/main-api-runner.d.ts +1 -1
  21. package/dist/preload/windows/main.cjs +284 -565
  22. package/dist/preload/windows/main.cjs.map +2 -2
  23. package/dist/preload/windows/simulator.cjs +37 -39
  24. package/dist/preload/windows/simulator.cjs.map +2 -2
  25. package/dist/preload/windows/simulator.js +37 -39
  26. package/dist/render-host/render-inspect.js +63 -52
  27. package/dist/renderer/assets/index-D-ksyN1p.js +49 -0
  28. package/dist/renderer/assets/workbenchSettings-COhuFF-i.js +8 -0
  29. package/dist/renderer/entries/main/index.html +1 -1
  30. package/dist/renderer/entries/workbench-settings/index.html +1 -1
  31. package/dist/shared/appdata-accumulator.js +53 -48
  32. package/dist/shared/open-in-editor-resource-path.d.ts +56 -0
  33. package/dist/shared/open-in-editor-resource-path.js +133 -0
  34. package/dist/shared/open-in-editor.d.ts +2 -9
  35. package/dist/shared/open-in-editor.js +8 -93
  36. package/dist/shared/types.d.ts +13 -0
  37. package/dist/simulator/assets/{device-shell-CUl0ILfn.js → device-shell-CiLAPa0I.js} +2 -2
  38. package/dist/simulator/assets/simulator-Dvnxry3y.js +10 -0
  39. package/dist/simulator/simulator.html +1 -1
  40. package/dist/vscode-workbench/assets/__vite-browser-external-CXi6Kz9W.js +1 -0
  41. package/dist/vscode-workbench/assets/{dist-CS7SQP3K.js → dist-TpGpmMGi.js} +3 -3
  42. package/dist/vscode-workbench/assets/{iconv-lite-umd-D3q-1-o6.js → iconv-lite-umd-C9tiCAJa.js} +1 -1
  43. package/dist/vscode-workbench/assets/{index-zjigpZ25.js → index-DJ1HyMZ7.js} +20 -22
  44. package/dist/vscode-workbench/assets/{jschardet-Cu4ufeHq.js → jschardet-DE1jV513.js} +1 -1
  45. package/dist/vscode-workbench/index.html +1 -1
  46. package/package.json +5 -5
  47. package/dist/renderer/assets/index-B-Dqb7G0.js +0 -49
  48. package/dist/renderer/assets/workbenchSettings-Bim9ol9R.js +0 -8
  49. package/dist/simulator/assets/simulator-Dz8iGcgy.js +0 -10
  50. package/dist/vscode-workbench/assets/__vite-browser-external-B0DTNerG.js +0 -1
@@ -130,25 +130,39 @@ function resolveTagName(instance) {
130
130
  return pascalToKebab(name);
131
131
  return name;
132
132
  }
133
+ /** Props/attrs entries that never surface in the WXML panel (internal Vue plumbing, falsy booleans). */
134
+ function isSkippedProp(key, value) {
135
+ if (typeof value === 'function' || value === undefined)
136
+ return true;
137
+ if (key === 'data' || key.startsWith('__'))
138
+ return true;
139
+ return typeof value === 'boolean' && !value;
140
+ }
141
+ /** Drop the `dd-` internal-marker classes so the panel shows only user-authored classes. */
142
+ function cleanClassAttr(value) {
143
+ return value.split(/\s+/).filter((c) => !c.startsWith('dd-')).join(' ');
144
+ }
145
+ function stringifyPropValue(value) {
146
+ return typeof value === 'object' ? JSON.stringify(value) : String(value);
147
+ }
148
+ function assignProp(out, key, value) {
149
+ if (isSkippedProp(key, value))
150
+ return;
151
+ if (key === 'class' && typeof value === 'string') {
152
+ const cleaned = cleanClassAttr(value);
153
+ if (cleaned)
154
+ out[key] = cleaned;
155
+ return;
156
+ }
157
+ out[key] = stringifyPropValue(value);
158
+ }
133
159
  function extractProps(instance) {
134
160
  const out = {};
135
161
  for (const raw of [instance.props, instance.attrs]) {
136
162
  if (!raw)
137
163
  continue;
138
164
  for (const [k, v] of Object.entries(raw)) {
139
- if (typeof v === 'function' || v === undefined)
140
- continue;
141
- if (k === 'data' || k.startsWith('__'))
142
- continue;
143
- if (typeof v === 'boolean' && !v)
144
- continue;
145
- if (k === 'class' && typeof v === 'string') {
146
- const cleaned = v.split(/\s+/).filter((c) => !c.startsWith('dd-')).join(' ');
147
- if (cleaned)
148
- out[k] = cleaned;
149
- continue;
150
- }
151
- out[k] = typeof v === 'object' ? JSON.stringify(v) : String(v);
165
+ assignProp(out, k, v);
152
166
  }
153
167
  }
154
168
  return out;
@@ -209,65 +223,83 @@ function isCommentVNode(vnode) {
209
223
  const children = typeof vnode.children === 'string' ? vnode.children : '';
210
224
  return /^v-(if|else|else-if|for)$/.test(children);
211
225
  }
226
+ function textNode(text) {
227
+ return { tagName: '#text', attrs: {}, children: [], text };
228
+ }
229
+ /** A component vnode's children come from walking its mounted instance, not `vnode.children`. */
230
+ function childrenFromComponentVNode(component, depth) {
231
+ const result = walkInstance(component, depth + 1);
232
+ if (!result)
233
+ return [];
234
+ return Array.isArray(result) ? result : [result];
235
+ }
236
+ /** A `<Suspense>` vnode's visible content is whichever branch is currently active. */
237
+ function childrenFromSuspenseVNode(suspense, depth) {
238
+ const activeBranch = suspense.activeBranch;
239
+ return activeBranch ? extractChildrenFromVNode(activeBranch, depth + 1) : [];
240
+ }
241
+ /**
242
+ * A vnode whose OWN `children` is a plain string only counts as a text node when
243
+ * its `type` is a symbol/string (a real element or fragment) — a component vnode
244
+ * with string `children` is slot content, not text, and is handled elsewhere.
245
+ * Returns null when this vnode is not (top-level) text, so the caller falls
246
+ * through to the array-children path.
247
+ */
248
+ function directTextChild(vnode) {
249
+ if (typeof vnode.children !== 'string' || !vnode.children.trim())
250
+ return null;
251
+ const vnodeType = vnode.type;
252
+ if (typeof vnodeType !== 'symbol' && typeof vnodeType !== 'string')
253
+ return null;
254
+ return [textNode(vnode.children.trim())];
255
+ }
256
+ function textChildEntry(child) {
257
+ const trimmed = child.trim();
258
+ return trimmed ? [textNode(trimmed)] : [];
259
+ }
260
+ /** A DOM-typed child (`type` is its tag name string): text leaf, internal wrapper, or a normal subtree. */
261
+ function domTypedChildEntries(c, depth) {
262
+ if (isInternalElement(c))
263
+ return extractChildrenFromVNode(c, depth + 1);
264
+ if (typeof c.children === 'string' && c.children.trim())
265
+ return [textNode(c.children.trim())];
266
+ return extractChildrenFromVNode(c, depth + 1);
267
+ }
268
+ /** One entry from a vnode's `children` array, normalized to zero or more WXML nodes. */
269
+ function extractChildEntry(child, depth) {
270
+ if (!child)
271
+ return [];
272
+ if (typeof child === 'string')
273
+ return textChildEntry(child);
274
+ if (typeof child !== 'object')
275
+ return [];
276
+ const c = child;
277
+ if (c.component)
278
+ return childrenFromComponentVNode(c.component, depth);
279
+ if (typeof c.type === 'symbol')
280
+ return extractChildrenFromVNode(c, depth + 1);
281
+ if (typeof c.type === 'string')
282
+ return domTypedChildEntries(c, depth);
283
+ return extractChildrenFromVNode(c, depth + 1);
284
+ }
212
285
  function extractChildrenFromVNode(vnode, depth) {
213
286
  if (!vnode || depth > 50)
214
287
  return [];
215
288
  if (isCommentVNode(vnode))
216
289
  return [];
217
- if (vnode.component) {
218
- const result = walkInstance(vnode.component, depth + 1);
219
- return result ? (Array.isArray(result) ? result : [result]) : [];
220
- }
221
- if (vnode.suspense) {
222
- const suspense = vnode.suspense;
223
- const activeBranch = suspense.activeBranch;
224
- return activeBranch ? extractChildrenFromVNode(activeBranch, depth + 1) : [];
225
- }
226
- if (typeof vnode.children === 'string' && vnode.children.trim()) {
227
- const vnodeType = vnode.type;
228
- if (typeof vnodeType === 'symbol' || typeof vnodeType === 'string') {
229
- return [{ tagName: '#text', attrs: {}, children: [], text: vnode.children.trim() }];
230
- }
231
- }
290
+ if (vnode.component)
291
+ return childrenFromComponentVNode(vnode.component, depth);
292
+ if (vnode.suspense)
293
+ return childrenFromSuspenseVNode(vnode.suspense, depth);
294
+ const directText = directTextChild(vnode);
295
+ if (directText)
296
+ return directText;
232
297
  const kids = vnode.children;
233
298
  if (!Array.isArray(kids))
234
299
  return [];
235
300
  const result = [];
236
301
  for (const child of kids) {
237
- if (!child)
238
- continue;
239
- if (typeof child === 'string') {
240
- const trimmed = child.trim();
241
- if (trimmed)
242
- result.push({ tagName: '#text', attrs: {}, children: [], text: trimmed });
243
- continue;
244
- }
245
- if (typeof child !== 'object')
246
- continue;
247
- const c = child;
248
- if (c.component) {
249
- const walked = walkInstance(c.component, depth + 1);
250
- if (walked)
251
- result.push(...(Array.isArray(walked) ? walked : [walked]));
252
- continue;
253
- }
254
- if (typeof c.type === 'symbol') {
255
- result.push(...extractChildrenFromVNode(c, depth + 1));
256
- continue;
257
- }
258
- if (typeof c.type === 'string') {
259
- if (isInternalElement(c)) {
260
- result.push(...extractChildrenFromVNode(c, depth + 1));
261
- }
262
- else if (typeof c.children === 'string' && c.children.trim()) {
263
- result.push({ tagName: '#text', attrs: {}, children: [], text: c.children.trim() });
264
- }
265
- else {
266
- result.push(...extractChildrenFromVNode(c, depth + 1));
267
- }
268
- continue;
269
- }
270
- result.push(...extractChildrenFromVNode(c, depth + 1));
302
+ result.push(...extractChildEntry(child, depth));
271
303
  }
272
304
  return result;
273
305
  }
@@ -1,4 +1,4 @@
1
- type LooseApiHandler = (this: any, params?: unknown) => unknown | Promise<unknown>;
1
+ type LooseApiHandler = (params?: unknown) => unknown | Promise<unknown>;
2
2
  export interface ApiRunVerdict {
3
3
  ok: boolean;
4
4
  result?: unknown;