cardbuddy 0.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.
Files changed (167) hide show
  1. package/README.md +211 -0
  2. package/dist/cli.js +76 -0
  3. package/dist/config.js +63 -0
  4. package/dist/core.js +2 -0
  5. package/dist/preview-editor/assets/apple-touch-icon-BQcES9QK.png +0 -0
  6. package/dist/preview-editor/assets/default-image-wzZYQ86K.png +0 -0
  7. package/dist/preview-editor/assets/favicon-16-Cg6Nrosk.png +0 -0
  8. package/dist/preview-editor/assets/favicon-32-B_1744sp.png +0 -0
  9. package/dist/preview-editor/assets/index-BYB0hngG.js +72 -0
  10. package/dist/preview-editor/assets/index-CpBZEQDy.css +1 -0
  11. package/dist/preview-editor/assets/site-icon-CFMif8z4.png +0 -0
  12. package/dist/preview-editor/assets/svg-symbols-B2exBrAr.svg +118 -0
  13. package/dist/preview-editor/index.html +17 -0
  14. package/dist/server-core/_vendor/finmall-env.mjs +96 -0
  15. package/dist/server-core/assetProxy.js +154 -0
  16. package/dist/server-core/bbox.js +153 -0
  17. package/dist/server-core/browser.js +108 -0
  18. package/dist/server-core/buildDataFromSchema.js +50 -0
  19. package/dist/server-core/cardFiles.js +188 -0
  20. package/dist/server-core/cardHistory.js +156 -0
  21. package/dist/server-core/cardImage.js +85 -0
  22. package/dist/server-core/cardImportMeta.js +139 -0
  23. package/dist/server-core/cardListCache.js +68 -0
  24. package/dist/server-core/cardOpenFolder.js +135 -0
  25. package/dist/server-core/cardSave.js +127 -0
  26. package/dist/server-core/cardSidecar.js +72 -0
  27. package/dist/server-core/cardSync.js +259 -0
  28. package/dist/server-core/cardValidate.js +134 -0
  29. package/dist/server-core/index.js +82 -0
  30. package/dist/server-core/logger.js +241 -0
  31. package/dist/server-core/nodeModels.js +52 -0
  32. package/dist/server-core/renderStatus.js +207 -0
  33. package/dist/server-core/screenshot.js +123 -0
  34. package/dist/server-core/sliceStatic.js +44 -0
  35. package/dist/standalone.js +447 -0
  36. package/dist/vendored/App.vue +2330 -0
  37. package/dist/vendored/api.js +142 -0
  38. package/dist/vendored/assets/apple-touch-icon.png +0 -0
  39. package/dist/vendored/assets/default-image.png +0 -0
  40. package/dist/vendored/assets/favicon-16.png +0 -0
  41. package/dist/vendored/assets/favicon-32.png +0 -0
  42. package/dist/vendored/assets/logo.png +0 -0
  43. package/dist/vendored/assets/site-icon.png +0 -0
  44. package/dist/vendored/assets/svg-symbols.svg +118 -0
  45. package/dist/vendored/assets/svgIcons/icons.svg +54 -0
  46. package/dist/vendored/assets/svgIcons/index.js +39 -0
  47. package/dist/vendored/components/AbsoluteLayout.vue +42 -0
  48. package/dist/vendored/components/AlertCardInstance.vue +58 -0
  49. package/dist/vendored/components/AlertCardLayer.vue +59 -0
  50. package/dist/vendored/components/ApiPayloadTree.vue +168 -0
  51. package/dist/vendored/components/AppToast.vue +37 -0
  52. package/dist/vendored/components/Button.vue +37 -0
  53. package/dist/vendored/components/Canvas.vue +65 -0
  54. package/dist/vendored/components/CardGallery.vue +243 -0
  55. package/dist/vendored/components/CardPreview.vue +72 -0
  56. package/dist/vendored/components/CardSelect.vue +200 -0
  57. package/dist/vendored/components/CheckGroup.vue +131 -0
  58. package/dist/vendored/components/Column.vue +25 -0
  59. package/dist/vendored/components/ComponentPalette.vue +294 -0
  60. package/dist/vendored/components/ConfirmDialog.vue +39 -0
  61. package/dist/vendored/components/CustomPlaceholder.vue +33 -0
  62. package/dist/vendored/components/DatePickerOverlay.vue +345 -0
  63. package/dist/vendored/components/DebugPanel.vue +806 -0
  64. package/dist/vendored/components/DeviceOverlay.vue +70 -0
  65. package/dist/vendored/components/Divider.vue +22 -0
  66. package/dist/vendored/components/Dropdown.vue +191 -0
  67. package/dist/vendored/components/EventEditor.vue +247 -0
  68. package/dist/vendored/components/GridLayout.vue +67 -0
  69. package/dist/vendored/components/HoverGuides.vue +122 -0
  70. package/dist/vendored/components/Icon.vue +34 -0
  71. package/dist/vendored/components/Image.vue +34 -0
  72. package/dist/vendored/components/Input.vue +90 -0
  73. package/dist/vendored/components/JsonTree.vue +516 -0
  74. package/dist/vendored/components/ListLayout.vue +68 -0
  75. package/dist/vendored/components/LogValue.vue +51 -0
  76. package/dist/vendored/components/Map.vue +110 -0
  77. package/dist/vendored/components/MultiColumn.vue +49 -0
  78. package/dist/vendored/components/MultiText.vue +58 -0
  79. package/dist/vendored/components/NodeInspector.vue +295 -0
  80. package/dist/vendored/components/PickerOverlay.vue +131 -0
  81. package/dist/vendored/components/ProgressSlider.vue +167 -0
  82. package/dist/vendored/components/PropControl.vue +241 -0
  83. package/dist/vendored/components/PropTree.vue +128 -0
  84. package/dist/vendored/components/RadioButton.vue +74 -0
  85. package/dist/vendored/components/RemotePreview.vue +171 -0
  86. package/dist/vendored/components/RenderTree.vue +437 -0
  87. package/dist/vendored/components/Root.vue +30 -0
  88. package/dist/vendored/components/Row.vue +25 -0
  89. package/dist/vendored/components/SelectionOverlay.vue +105 -0
  90. package/dist/vendored/components/StructureTree.vue +949 -0
  91. package/dist/vendored/components/SvgCode.vue +19 -0
  92. package/dist/vendored/components/SvgSymbols.vue +30 -0
  93. package/dist/vendored/components/Switch.vue +38 -0
  94. package/dist/vendored/components/Text.vue +32 -0
  95. package/dist/vendored/components/Video.vue +70 -0
  96. package/dist/vendored/components/ViewContainer.vue +52 -0
  97. package/dist/vendored/components/base.js +12 -0
  98. package/dist/vendored/components/icons.js +47 -0
  99. package/dist/vendored/components/index.js +58 -0
  100. package/dist/vendored/components/setters/SetBgPosition.vue +64 -0
  101. package/dist/vendored/components/setters/SetBgSize.vue +90 -0
  102. package/dist/vendored/components/setters/SetCode.vue +90 -0
  103. package/dist/vendored/components/setters/SetColor.vue +244 -0
  104. package/dist/vendored/components/setters/SetCustomSelect.vue +58 -0
  105. package/dist/vendored/components/setters/SetExpr.vue +107 -0
  106. package/dist/vendored/components/setters/SetGradient.vue +125 -0
  107. package/dist/vendored/components/setters/SetGrid9.vue +68 -0
  108. package/dist/vendored/components/setters/SetIconSelect.vue +67 -0
  109. package/dist/vendored/components/setters/SetIfForm.vue +61 -0
  110. package/dist/vendored/components/setters/SetImage.vue +43 -0
  111. package/dist/vendored/components/setters/SetList.vue +139 -0
  112. package/dist/vendored/components/setters/SetNumber.vue +118 -0
  113. package/dist/vendored/components/setters/SetNumberStyle.vue +113 -0
  114. package/dist/vendored/components/setters/SetPadding.vue +77 -0
  115. package/dist/vendored/components/setters/SetSegment.vue +160 -0
  116. package/dist/vendored/components/setters/SetSelect.vue +51 -0
  117. package/dist/vendored/components/setters/SetSwitch.vue +49 -0
  118. package/dist/vendored/components/setters/SetText.vue +52 -0
  119. package/dist/vendored/components/setters/props.js +23 -0
  120. package/dist/vendored/fidelity/baseline-messageOverview.json +87 -0
  121. package/dist/vendored/fidelity/calibration.json +29 -0
  122. package/dist/vendored/fidelity/fidelity-messageOverview-after.html +114 -0
  123. package/dist/vendored/fidelity/fidelity-messageOverview-after.json +272 -0
  124. package/dist/vendored/fidelity/fidelity-messageOverview.html +185 -0
  125. package/dist/vendored/fidelity/fidelity-messageOverview.json +336 -0
  126. package/dist/vendored/fidelity/fidelity-messageOverview_v2.html +262 -0
  127. package/dist/vendored/fidelity/fidelity-messageOverview_v2.json +502 -0
  128. package/dist/vendored/fidelity/fidelity-messageOverview_v3.html +201 -0
  129. package/dist/vendored/fidelity/fidelity-messageOverview_v3.json +417 -0
  130. package/dist/vendored/fidelity/fidelity-messageOverview_visual.html +125 -0
  131. package/dist/vendored/fidelity/fidelity-messageOverview_visual.json +338 -0
  132. package/dist/vendored/index.html +16 -0
  133. package/dist/vendored/main.js +36 -0
  134. package/dist/vendored/meta/action-meta.json +141 -0
  135. package/dist/vendored/meta/component-meta.json +2714 -0
  136. package/dist/vendored/meta/directive-meta.json +40 -0
  137. package/dist/vendored/meta/style-meta.json +1086 -0
  138. package/dist/vendored/runtime/StyleParser.js +179 -0
  139. package/dist/vendored/runtime/adapter.js +166 -0
  140. package/dist/vendored/runtime/alert-card.js +125 -0
  141. package/dist/vendored/runtime/app-toast.js +33 -0
  142. package/dist/vendored/runtime/assets.js +16 -0
  143. package/dist/vendored/runtime/canvas-context.js +141 -0
  144. package/dist/vendored/runtime/card-runtime.js +289 -0
  145. package/dist/vendored/runtime/clipboard-node.js +83 -0
  146. package/dist/vendored/runtime/clipboard.js +29 -0
  147. package/dist/vendored/runtime/evaluate.js +152 -0
  148. package/dist/vendored/runtime/event-model.js +300 -0
  149. package/dist/vendored/runtime/hoverGuide.js +31 -0
  150. package/dist/vendored/runtime/jsapi-mock.js +256 -0
  151. package/dist/vendored/runtime/node-model.js +217 -0
  152. package/dist/vendored/runtime/property.js +364 -0
  153. package/dist/vendored/runtime/selectionOverlay.js +53 -0
  154. package/dist/vendored/runtime/toPreview.js +648 -0
  155. package/dist/vendored/standalone-main.js +36 -0
  156. package/dist/vendored/standalone.html +12 -0
  157. package/dist/vendored/styles/app.css +2565 -0
  158. package/dist/vendored/styles/card-gallery.css +234 -0
  159. package/dist/vendored/styles/card-select.css +281 -0
  160. package/dist/vendored/styles/components.css +383 -0
  161. package/dist/vendored/styles/dropdown.css +337 -0
  162. package/dist/vendored/styles/json-tree.css +308 -0
  163. package/dist/vendored/styles/node-inspector.css +1003 -0
  164. package/dist/vendored/styles/setters.css +962 -0
  165. package/dist/vendored/styles/standalone.css +27 -0
  166. package/dist/vendored/styles/structure-tree.css +320 -0
  167. package/package.json +42 -0
@@ -0,0 +1,125 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN"><head><meta charset="utf-8"><title>UI 还原度对拍 · messageOverview_visual</title>
3
+ <style>
4
+ body{font-family:-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;margin:0;background:#f5f6f8;color:#1f2329}
5
+ .wrap{max-width:1080px;margin:0 auto;padding:24px 20px 60px}
6
+ h1{font-size:20px;margin:0 0 4px}
7
+ .sub{color:#666;font-size:12px;margin-bottom:18px}
8
+ .cards{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:20px}
9
+ .card{flex:1;min-width:150px;background:#fff;border:1px solid #e5e6eb;border-radius:8px;padding:14px 16px}
10
+ .card .num{font-size:26px;font-weight:700}
11
+ .card .lbl{font-size:12px;color:#666;margin-top:2px}
12
+ table{border-collapse:collapse;width:100%;background:#fff;font-size:13px;border:1px solid #e5e6eb;border-radius:8px;overflow:hidden}
13
+ th,td{padding:7px 10px;border-bottom:1px solid #f0f1f3;text-align:left;white-space:nowrap}
14
+ th{background:#fafbfc;color:#333;font-weight:600}
15
+ tr:last-child td{border-bottom:none}
16
+ .sec{margin-top:22px;font-size:15px;font-weight:600}
17
+ .tips{background:#fff;border:1px solid #e5e6eb;border-radius:8px;padding:12px 16px 12px 34px;font-size:13px;line-height:1.8}
18
+ .muted{color:#999}
19
+ </style></head><body><div class="wrap">
20
+ <h1>UI 还原度对拍报告 · messageOverview_visual</h1>
21
+ <div class="sub">spec: UI/01、泛化消息-有未读消息-没有待办/spec.json · 阈值 ±2px · 2026/8/19 17:55:53 · 生成:fidelity_report.mjs</div>
22
+ <div style="display:flex;gap:16px;align-items:stretch;margin-bottom:16px">
23
+ <div style="min-width:150px;background:#fff;border:1px solid #e5e6eb;border-radius:8px;padding:14px 18px;display:flex;flex-direction:column;justify-content:center;text-align:center">
24
+ <div style="font-size:44px;font-weight:800;line-height:1;color:#c62828">20</div>
25
+ <div style="font-size:13px;color:#666;margin-top:6px">还原度 · 需修复</div>
26
+ </div>
27
+ <div style="flex:1;background:#fff;border:1px solid #e5e6eb;border-radius:8px;padding:12px 16px"><div style="display:flex;align-items:center;gap:8px;margin:3px 0">
28
+ <span style="width:64px;font-size:12px;color:#666">覆盖率</span>
29
+ <div style="flex:1;height:8px;background:#eef0f3;border-radius:4px;overflow:hidden">
30
+ <div style="width:27%;height:100%;background:#c62828"></div>
31
+ </div>
32
+ <span style="width:34px;text-align:right;font-size:12px;color:#666">27</span>
33
+ </div><div style="display:flex;align-items:center;gap:8px;margin:3px 0">
34
+ <span style="width:64px;font-size:12px;color:#666">位置</span>
35
+ <div style="flex:1;height:8px;background:#eef0f3;border-radius:4px;overflow:hidden">
36
+ <div style="width:0%;height:100%;background:#c62828"></div>
37
+ </div>
38
+ <span style="width:34px;text-align:right;font-size:12px;color:#666">0</span>
39
+ </div><div style="display:flex;align-items:center;gap:8px;margin:3px 0">
40
+ <span style="width:64px;font-size:12px;color:#666">尺寸</span>
41
+ <div style="flex:1;height:8px;background:#eef0f3;border-radius:4px;overflow:hidden">
42
+ <div style="width:30%;height:100%;background:#c62828"></div>
43
+ </div>
44
+ <span style="width:34px;text-align:right;font-size:12px;color:#666">30</span>
45
+ </div><div style="display:flex;align-items:center;gap:8px;margin:3px 0">
46
+ <span style="width:64px;font-size:12px;color:#666">文本</span>
47
+ <div style="flex:1;height:8px;background:#eef0f3;border-radius:4px;overflow:hidden">
48
+ <div style="width:45%;height:100%;background:#c62828"></div>
49
+ </div>
50
+ <span style="width:34px;text-align:right;font-size:12px;color:#666">45</span>
51
+ </div><div style="display:flex;align-items:center;gap:8px;margin:3px 0">
52
+ <span style="width:64px;font-size:12px;color:#666">一致性</span>
53
+ <div style="flex:1;height:8px;background:#eef0f3;border-radius:4px;overflow:hidden">
54
+ <div style="width:0%;height:100%;background:#c62828"></div>
55
+ </div>
56
+ <span style="width:34px;text-align:right;font-size:12px;color:#666">0</span>
57
+ </div></div>
58
+ </div>
59
+ <div class="cards">
60
+ <div class="card"><div class="num">3</div><div class="lbl">已匹配元素</div></div>
61
+ <div class="card"><div class="num" style="color:#c62828">3</div><div class="lbl">超差(&gt;4px)</div></div>
62
+ <div class="card"><div class="num" style="color:#b26a00">0</div><div class="lbl">偏差(&gt;2px)</div></div>
63
+ <div class="card"><div class="num">8</div><div class="lbl">未匹配(设计稿)</div></div>
64
+ <div class="card"><div class="num">-58.0</div><div class="lbl">公共偏移 Δx</div></div>
65
+ <div class="card"><div class="num">-220.0</div><div class="lbl">公共偏移 Δy</div></div>
66
+ <div class="card"><div class="num" style="color:#888">9</div><div class="lbl">chrome 裁剪(不参与对拍)</div></div>
67
+ </div>
68
+ <div class="sec">系统性误差(按组件类中位数,≥2 样本;供生成器补偿校准)</div>
69
+ <table>
70
+ <tr><th>组件类</th><th>Δx</th><th>Δy</th><th>Δw</th><th>Δh</th><th>最大偏差</th></tr>
71
+ <tr>
72
+ <td><b>Text</b> ×2</td>
73
+ <td>+21.0</td><td>+8.5</td><td>-7.4</td><td>-0.5</td>
74
+ <td style="color:#666">42.0</td>
75
+ </tr>
76
+ </table>
77
+ <div class="sec">归因建议</div>
78
+ <ul class="tips"><li>整卡水平偏移 -58.0px(公共偏移已扣除,不影响逐元素评估;若渲染卡含外层留白/容器 padding 请检查根容器)</li>
79
+ <li>整卡垂直偏移 -220.0px(通常来自设计稿含状态栏/导航而渲染卡仅卡片主体;若渲染卡内确有同类元素整体偏移,请检查根容器 padding)</li>
80
+ <li>[Text×2] 水平系统性偏移 +21.0px → 疑似父容器 padding/margin 或 align-items/justify-content 配置</li>
81
+ <li>[Text×2] 垂直系统性偏移 +8.5px → 疑似父容器 padding 或行高 lineHeight/间距配置</li>
82
+ <li>[Text×2] 宽度系统性偏差 -7.4px → 疑似 width/flexGrow/flexBasis 配置</li>
83
+ <li>单元素离群:「重点摘要」(Text)偏离同类中位 21.0px → 检查该元素自身 align/padding/fontSize</li>
84
+ <li>单元素离群:「动账 5 · 转账 2 · 站内」(Text)偏离同类中位 21.0px → 检查该元素自身 align/padding/fontSize</li></ul>
85
+ <div class="sec">逐元素差异(局部 Δ = 已扣除公共偏移)</div>
86
+ <table>
87
+ <tr><th>状态</th><th>文本/元素</th><th>组件类</th><th>匹配</th><th>期望 rect</th><th>实际 rect</th><th>Δx</th><th>Δy</th><th>Δw</th><th>Δh</th></tr>
88
+ <tr style="background:#fdecea">
89
+ <td style="color:#c62828;font-weight:600">超差</td>
90
+ <td title="重点摘要">重点摘要</td>
91
+ <td>Text</td>
92
+ <td title="通过 text-far">文本远</td>
93
+ <td style="color:#666">32, 396 · 60×22</td>
94
+ <td style="color:#666">16, 176 · 60×21</td>
95
+ <td style="color:#c62828">+42.0</td>
96
+ <td style="color:#666">0.0</td>
97
+ <td style="color:#666">0.0</td>
98
+ <td style="color:#666">-1.0</td>
99
+ </tr>
100
+ <tr style="background:#fdecea">
101
+ <td style="color:#c62828;font-weight:600">超差</td>
102
+ <td title="动账 5 · 转账 2 · 站内 1 · 其他 4">动账 5 · 转账 2 · 站内 1 · 其他 </td>
103
+ <td>Text</td>
104
+ <td title="通过 text">文本</td>
105
+ <td style="color:#666">74, 352 · 196×18</td>
106
+ <td style="color:#666">16, 149 · 181.1×18</td>
107
+ <td style="color:#666">0.0</td>
108
+ <td style="color:#c62828">+17.0</td>
109
+ <td style="color:#c62828">-14.9</td>
110
+ <td style="color:#666">0.0</td>
111
+ </tr>
112
+ <tr style="background:#fdecea">
113
+ <td style="color:#c62828;font-weight:600">超差</td>
114
+ <td title="查看全部">查看全部</td>
115
+ <td>Row</td>
116
+ <td title="通过 text-far">文本远</td>
117
+ <td style="color:#666">263, 328 · 56×20</td>
118
+ <td style="color:#666">26, 69.5 · 339×22</td>
119
+ <td style="color:#c62828">-179.0</td>
120
+ <td style="color:#c62828">-38.5</td>
121
+ <td style="color:#c62828">+283.0</td>
122
+ <td style="color:#666">+2.0</td>
123
+ </tr>
124
+ </table>
125
+ </div></body></html>
@@ -0,0 +1,338 @@
1
+ {
2
+ "cardId": "messageOverview_visual",
3
+ "specFile": "UI/01、泛化消息-有未读消息-没有待办/spec.json",
4
+ "generatedAt": "2026-08-19T10:17:34.469Z",
5
+ "tolerance": 2,
6
+ "matchRadius": 30,
7
+ "fidelityScore": 30,
8
+ "grade": "需修复",
9
+ "scoreDims": {
10
+ "coverage": 0.5714285714285714,
11
+ "position": 0.21250000000000002,
12
+ "size": 0.35250000000000004,
13
+ "typography": 0.18571428571428572,
14
+ "alignment": 0
15
+ },
16
+ "commonOffset": {
17
+ "dx": -16,
18
+ "dy": -287
19
+ },
20
+ "classStats": {
21
+ "Text": {
22
+ "samples": 7,
23
+ "dxL": 0,
24
+ "dyL": 5,
25
+ "dw": 0,
26
+ "dh": 0,
27
+ "maxAbs": 42.9
28
+ }
29
+ },
30
+ "env": {
31
+ "screen": {
32
+ "width": 375,
33
+ "height": 800
34
+ },
35
+ "renderCardWidth": 375,
36
+ "renderCardHeight": 510,
37
+ "specCanvasHeight": 874
38
+ },
39
+ "counts": {
40
+ "expected": 14,
41
+ "chromeSkipped": 6,
42
+ "actual": 39,
43
+ "matched": 8,
44
+ "unmatchedSpec": 6,
45
+ "unmatchedActual": 31
46
+ },
47
+ "rows": [
48
+ {
49
+ "idx": 0,
50
+ "type": "text",
51
+ "cid": "comp_12",
52
+ "className": "Text",
53
+ "expectText": "重点摘要",
54
+ "actualText": "重点摘要",
55
+ "via": "text",
56
+ "expRect": {
57
+ "x": 32,
58
+ "y": 396,
59
+ "width": 60,
60
+ "height": 22
61
+ },
62
+ "actRect": {
63
+ "x": 16,
64
+ "y": 104,
65
+ "width": 60,
66
+ "height": 31
67
+ },
68
+ "dx": -16,
69
+ "dy": -292,
70
+ "dw": 0,
71
+ "dh": 9,
72
+ "dxL": 0,
73
+ "dyL": -5
74
+ },
75
+ {
76
+ "idx": 1,
77
+ "type": "text",
78
+ "cid": "comp_13",
79
+ "className": "Text",
80
+ "expectText": "按强重要、待关注、时间倒序展示,不超过3条",
81
+ "actualText": "按强重要、待关注、时间倒序展示,不超过3条",
82
+ "via": "text",
83
+ "expRect": {
84
+ "x": 32,
85
+ "y": 420,
86
+ "width": 311,
87
+ "height": 18
88
+ },
89
+ "actRect": {
90
+ "x": 16,
91
+ "y": 139,
92
+ "width": 268.1,
93
+ "height": 40
94
+ },
95
+ "dx": -16,
96
+ "dy": -281,
97
+ "dw": -42.9,
98
+ "dh": 22,
99
+ "dxL": 0,
100
+ "dyL": 6
101
+ },
102
+ {
103
+ "idx": 2,
104
+ "type": "text",
105
+ "cid": "comp_6",
106
+ "className": "Text",
107
+ "expectText": "条未读消息",
108
+ "actualText": "条未读消息",
109
+ "via": "text",
110
+ "expRect": {
111
+ "x": 74,
112
+ "y": 328,
113
+ "width": 75,
114
+ "height": 22
115
+ },
116
+ "actRect": {
117
+ "x": 55.8,
118
+ "y": 36,
119
+ "width": 75,
120
+ "height": 21
121
+ },
122
+ "dx": -18.2,
123
+ "dy": -292,
124
+ "dw": 0,
125
+ "dh": -1,
126
+ "dxL": -2.2,
127
+ "dyL": -5
128
+ },
129
+ {
130
+ "idx": 3,
131
+ "type": "text",
132
+ "cid": "comp_5",
133
+ "className": "Text",
134
+ "expectText": "12",
135
+ "actualText": "12",
136
+ "via": "text",
137
+ "expRect": {
138
+ "x": 32,
139
+ "y": 314,
140
+ "width": 31,
141
+ "height": 42
142
+ },
143
+ "actRect": {
144
+ "x": 20,
145
+ "y": 20,
146
+ "width": 31.8,
147
+ "height": 42
148
+ },
149
+ "dx": -12,
150
+ "dy": -294,
151
+ "dw": 0.8,
152
+ "dh": 0,
153
+ "dxL": 4,
154
+ "dyL": -7
155
+ },
156
+ {
157
+ "idx": 4,
158
+ "type": "text",
159
+ "cid": "comp_10",
160
+ "className": "Text",
161
+ "expectText": "动账 5 · 转账 2 · 站内 1 · 其他 4",
162
+ "actualText": "动账 5 · 转账 2 · 站内 1 · 其他 4",
163
+ "via": "text",
164
+ "expRect": {
165
+ "x": 74,
166
+ "y": 352,
167
+ "width": 196,
168
+ "height": 18
169
+ },
170
+ "actRect": {
171
+ "x": 16,
172
+ "y": 70,
173
+ "width": 223.1,
174
+ "height": 25
175
+ },
176
+ "dx": -58,
177
+ "dy": -282,
178
+ "dw": 27.1,
179
+ "dh": 7,
180
+ "dxL": -42,
181
+ "dyL": 5
182
+ },
183
+ {
184
+ "idx": 5,
185
+ "type": "text",
186
+ "cid": "comp_7",
187
+ "className": "Row",
188
+ "expectText": "查看全部",
189
+ "actualText": "查看全部",
190
+ "via": "text",
191
+ "expRect": {
192
+ "x": 263,
193
+ "y": 328,
194
+ "width": 56,
195
+ "height": 20
196
+ },
197
+ "actRect": {
198
+ "x": 187.5,
199
+ "y": 30,
200
+ "width": 169.5,
201
+ "height": 22
202
+ },
203
+ "dx": -75.5,
204
+ "dy": -298,
205
+ "dw": 113.5,
206
+ "dh": 2,
207
+ "dxL": -59.5,
208
+ "dyL": -11
209
+ },
210
+ {
211
+ "idx": 6,
212
+ "type": "text",
213
+ "cid": "comp_20",
214
+ "className": "Text",
215
+ "expectText": "今日有一笔支出动账",
216
+ "actualText": "今日有一笔支出动账",
217
+ "via": "text",
218
+ "expRect": {
219
+ "x": 58,
220
+ "y": 464,
221
+ "width": 135,
222
+ "height": 22
223
+ },
224
+ "actRect": {
225
+ "x": 58,
226
+ "y": 187,
227
+ "width": 135,
228
+ "height": 21
229
+ },
230
+ "dx": 0,
231
+ "dy": -277,
232
+ "dw": 0,
233
+ "dh": -1,
234
+ "dxL": 16,
235
+ "dyL": 10
236
+ },
237
+ {
238
+ "idx": 7,
239
+ "type": "text",
240
+ "cid": "comp_21",
241
+ "className": "Text",
242
+ "expectText": "金额1,280.00元,建议核对资金变动。",
243
+ "actualText": "金额1,280.00元,建议核对资金变动。",
244
+ "via": "text",
245
+ "expRect": {
246
+ "x": 58,
247
+ "y": 490,
248
+ "width": 254,
249
+ "height": 18
250
+ },
251
+ "actRect": {
252
+ "x": 58,
253
+ "y": 212,
254
+ "width": 221.3,
255
+ "height": 18
256
+ },
257
+ "dx": 0,
258
+ "dy": -278,
259
+ "dw": -32.7,
260
+ "dh": 0,
261
+ "dxL": 16,
262
+ "dyL": 9
263
+ }
264
+ ],
265
+ "unmatchedSpec": [
266
+ {
267
+ "type": "text",
268
+ "text": "对话",
269
+ "rect": {
270
+ "x": 170.5,
271
+ "y": 54,
272
+ "width": 34,
273
+ "height": 24
274
+ }
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "9:41",
279
+ "rect": {
280
+ "x": 35,
281
+ "y": 15.9,
282
+ "width": 26,
283
+ "height": 14
284
+ }
285
+ },
286
+ {
287
+ "type": "text",
288
+ "text": "9:4",
289
+ "rect": {
290
+ "x": 35,
291
+ "y": 15.9,
292
+ "width": 20,
293
+ "height": 14
294
+ }
295
+ },
296
+ {
297
+ "type": "text",
298
+ "text": "1",
299
+ "rect": {
300
+ "x": 54.5,
301
+ "y": 15.9,
302
+ "width": 6,
303
+ "height": 14
304
+ }
305
+ },
306
+ {
307
+ "type": "text",
308
+ "text": "最近有什么消息",
309
+ "rect": {
310
+ "x": 238,
311
+ "y": 110,
312
+ "width": 105,
313
+ "height": 22
314
+ }
315
+ },
316
+ {
317
+ "type": "text",
318
+ "text": "查询到您最近有未读消息12条,其中动账通知5条、转账消息2条、站内消息1条。优先提醒您:今日有3笔账户动账,合计支出2,580.00元;1笔转账已成功;另有1条站内服务提醒消息,需要查看。",
319
+ "rect": {
320
+ "x": 32,
321
+ "y": 168,
322
+ "width": 311,
323
+ "height": 110
324
+ }
325
+ }
326
+ ],
327
+ "suggestions": [
328
+ "整卡水平偏移 -16.0px(公共偏移已扣除,不影响逐元素评估;若渲染卡含外层留白/容器 padding 请检查根容器)",
329
+ "整卡垂直偏移 -287.0px(通常来自设计稿含状态栏/导航而渲染卡仅卡片主体;若渲染卡内确有同类元素整体偏移,请检查根容器 padding)",
330
+ "[Text×7] 垂直系统性偏移 +5.0px → 疑似父容器 padding 或行高 lineHeight/间距配置",
331
+ "单元素离群:「重点摘要」(Text)偏离同类中位 10.0px → 检查该元素自身 align/padding/fontSize",
332
+ "单元素离群:「条未读消息」(Text)偏离同类中位 10.0px → 检查该元素自身 align/padding/fontSize",
333
+ "单元素离群:「12」(Text)偏离同类中位 12.0px → 检查该元素自身 align/padding/fontSize",
334
+ "单元素离群:「动账 5 · 转账 2 · 站内」(Text)偏离同类中位 42.0px → 检查该元素自身 align/padding/fontSize",
335
+ "单元素离群:「今日有一笔支出动账」(Text)偏离同类中位 16.0px → 检查该元素自身 align/padding/fontSize",
336
+ "单元素离群:「金额1,280.00元,建议核对」(Text)偏离同类中位 16.0px → 检查该元素自身 align/padding/fontSize"
337
+ ]
338
+ }
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>CardBuddy 卡片开发平台</title>
7
+ <link rel="icon" type="image/png" href="/assets/site-icon.png" />
8
+ <link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16.png" />
9
+ <link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32.png" />
10
+ <link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png" />
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script type="module" src="/main.js"></script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,36 @@
1
+ // 注入全局 SVG 图标 sprite(preview/assets/svgIcons/icons.svg),须在 App 挂载前加载,
2
+ // 使 <use href="#icon-*"> 引用即时可用,避免首帧图标缺失闪烁。
3
+ import './assets/svgIcons/index.js'
4
+
5
+ import { createApp } from 'vue'
6
+ import App from './App.vue'
7
+ import './styles/components.css'
8
+ import './styles/app.css'
9
+ import './styles/card-select.css'
10
+ import './styles/card-gallery.css'
11
+ import './styles/json-tree.css'
12
+ import './styles/structure-tree.css'
13
+ import './styles/node-inspector.css'
14
+ import './styles/dropdown.css'
15
+ import './styles/setters.css'
16
+
17
+ import PropControl from './components/PropControl.vue'
18
+ import PropTree from './components/PropTree.vue'
19
+ import Dropdown from './components/Dropdown.vue'
20
+
21
+ const app = createApp(App)
22
+
23
+ // 全局注册:prop-control 被 PropTree / SetList 递归引用,prop-tree 自递归,
24
+ // 全局注册可避免组件间互相 import 造成的循环依赖。
25
+ app.component('prop-control', PropControl)
26
+ app.component('prop-tree', PropTree)
27
+ app.component('Dropdown', Dropdown)
28
+
29
+ // 渲染期异常不要炸整棵树,收集到调试面板
30
+ app.config.errorHandler = (err, vm, info) => {
31
+ // eslint-disable-next-line no-console
32
+ console.error('[render error]', info, err)
33
+ if (window.__cardDebug) window.__cardDebug.pushError('render', `${info}: ${err.message}`)
34
+ }
35
+
36
+ app.mount('#app')
@@ -0,0 +1,141 @@
1
+ {
2
+ "_source": "docs/动态卡片方案详细说明.md(JSAPI 章节)+ src/cards/*/schema.json 实测形态",
3
+ "_note": "事件动作元数据。properties 采用与 component-meta / style-meta 完全一致的 Property meta 形态,可直接喂给 Property / PropTree / PropControl,无需任何专用渲染分支。itemRequired 的项在导出时总是写回 schema(对齐线上:customAction 永远带 function 项);非必填项只有在 schema 原本就有、或用户改过值时才写回,避免把默认值污染进 DSL 产品数据。",
4
+
5
+ "lifecycleEvents": [
6
+ { "eventKey": "onReady", "eventName": "初始化完成", "eventDesc": "卡片渲染就绪时执行一次" }
7
+ ],
8
+
9
+ "actions": [
10
+ {
11
+ "actionType": "customAction",
12
+ "actionName": "自定义动作",
13
+ "actionDesc": "执行一段 JavaScript。this 为卡片上下文:state / data / setData / setRootData / postMessage / addEventListener",
14
+ "properties": [
15
+ {
16
+ "itemId": "001",
17
+ "itemKey": "function",
18
+ "itemName": "脚本",
19
+ "itemType": "Code",
20
+ "itemTypeRange": "const",
21
+ "itemRequired": true,
22
+ "itemDefaultValue": {},
23
+ "itemOption": { "language": "javascript", "codeKey": "code" },
24
+ "itemDesc": "事件回调函数体,形参为 event"
25
+ }
26
+ ]
27
+ },
28
+
29
+ {
30
+ "actionType": "startRouter",
31
+ "actionName": "路由跳转",
32
+ "actionDesc": "ynet.callJSAPI('startRouter', { targetUrl, urlType, isLoginNeeded, extra })",
33
+ "properties": [
34
+ {
35
+ "itemId": "001",
36
+ "itemKey": "targetUrl",
37
+ "itemName": "跳转地址",
38
+ "itemType": "Input",
39
+ "itemTypeRange": "const,var",
40
+ "itemRequired": true,
41
+ "itemDefaultValue": "",
42
+ "itemDesc": "目标页面地址"
43
+ },
44
+ {
45
+ "itemId": "002",
46
+ "itemKey": "urlType",
47
+ "itemName": "地址类型",
48
+ "itemType": "Select",
49
+ "itemTypeRange": "const",
50
+ "itemRequired": true,
51
+ "itemDefaultValue": "3",
52
+ "itemOption": {
53
+ "iParamList": [
54
+ { "key": "2", "value": "离线包" },
55
+ { "key": "3", "value": "在线页面" },
56
+ { "key": "4", "value": "原生页面" }
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "itemId": "003",
62
+ "itemKey": "isLoginNeeded",
63
+ "itemName": "是否需要登录",
64
+ "itemType": "Select",
65
+ "itemTypeRange": "const",
66
+ "itemRequired": true,
67
+ "itemDefaultValue": "1",
68
+ "itemOption": {
69
+ "iParamList": [
70
+ { "key": "1", "value": "需要登录" },
71
+ { "key": "0", "value": "不需要登录" }
72
+ ]
73
+ }
74
+ },
75
+ {
76
+ "itemId": "004",
77
+ "itemKey": "extra",
78
+ "itemName": "备用参数",
79
+ "itemType": "Textarea",
80
+ "itemTypeRange": "const,var",
81
+ "itemDefaultValue": "",
82
+ "itemDesc": "JSON 文本,透传给原生"
83
+ }
84
+ ]
85
+ },
86
+
87
+ {
88
+ "actionType": "sendAiChatMessage",
89
+ "actionName": "发送智能体消息",
90
+ "actionDesc": "ynet.callJSAPI('sendAiChatMessage', { message })",
91
+ "properties": [
92
+ {
93
+ "itemId": "001",
94
+ "itemKey": "message",
95
+ "itemName": "消息内容",
96
+ "itemType": "Input",
97
+ "itemTypeRange": "const,var",
98
+ "itemRequired": true,
99
+ "itemDefaultValue": "",
100
+ "itemDesc": "发送给智能体的文本"
101
+ }
102
+ ]
103
+ },
104
+
105
+ {
106
+ "actionType": "closeAlertCard",
107
+ "actionName": "关闭弹窗卡片",
108
+ "actionDesc": "ynet.callJSAPI('closeAlertCard', { cardCode, index, data });三项均可不填,默认关闭最上层弹窗",
109
+ "properties": [
110
+ {
111
+ "itemId": "001",
112
+ "itemKey": "cardCode",
113
+ "itemName": "卡片编码",
114
+ "itemType": "Input",
115
+ "itemTypeRange": "const,var",
116
+ "itemDefaultValue": "",
117
+ "itemDesc": "按 cardCode 从堆栈自上而下关闭一个;不填则关最上层"
118
+ },
119
+ {
120
+ "itemId": "002",
121
+ "itemKey": "index",
122
+ "itemName": "关闭层数",
123
+ "itemType": "InputNumber",
124
+ "itemTypeRange": "const",
125
+ "itemDefaultValue": "",
126
+ "itemOption": { "max": 0, "min": -10, "step": 1 },
127
+ "itemDesc": "-1 关一层,-2 关两层,以此类推;优先级高于卡片编码"
128
+ },
129
+ {
130
+ "itemId": "003",
131
+ "itemKey": "data",
132
+ "itemName": "回传数据",
133
+ "itemType": "Textarea",
134
+ "itemTypeRange": "const,var",
135
+ "itemDefaultValue": "",
136
+ "itemDesc": "JSON 文本,作为 alertCard 的回调参数"
137
+ }
138
+ ]
139
+ }
140
+ ]
141
+ }