@rien7/design-surface 0.0.0-stage → 0.1.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 (214) hide show
  1. package/bin/design-surface.mjs +286 -0
  2. package/dist/cli/init.mjs +411 -0
  3. package/dist/cli/propose.mjs +172 -0
  4. package/dist/cli/reviewOps.mjs +127 -0
  5. package/dist/editor/AgentProposalCard.d.ts +10 -0
  6. package/dist/editor/AgentProposalCard.d.ts.map +1 -0
  7. package/dist/editor/AgentProposalCard.js +28 -0
  8. package/dist/editor/AgentProposalCard.js.map +1 -0
  9. package/dist/editor/App.d.ts +2 -0
  10. package/dist/editor/App.d.ts.map +1 -0
  11. package/dist/editor/App.js +1813 -0
  12. package/dist/editor/App.js.map +1 -0
  13. package/dist/editor/CanvasHud.d.ts +12 -0
  14. package/dist/editor/CanvasHud.d.ts.map +1 -0
  15. package/dist/editor/CanvasHud.js +13 -0
  16. package/dist/editor/CanvasHud.js.map +1 -0
  17. package/dist/editor/CanvasSurface.d.ts +20 -0
  18. package/dist/editor/CanvasSurface.d.ts.map +1 -0
  19. package/dist/editor/CanvasSurface.js +252 -0
  20. package/dist/editor/CanvasSurface.js.map +1 -0
  21. package/dist/editor/Changes.d.ts +17 -0
  22. package/dist/editor/Changes.d.ts.map +1 -0
  23. package/dist/editor/Changes.js +59 -0
  24. package/dist/editor/Changes.js.map +1 -0
  25. package/dist/editor/CommentPopover.d.ts +17 -0
  26. package/dist/editor/CommentPopover.d.ts.map +1 -0
  27. package/dist/editor/CommentPopover.js +62 -0
  28. package/dist/editor/CommentPopover.js.map +1 -0
  29. package/dist/editor/Comments.d.ts +13 -0
  30. package/dist/editor/Comments.d.ts.map +1 -0
  31. package/dist/editor/Comments.js +39 -0
  32. package/dist/editor/Comments.js.map +1 -0
  33. package/dist/editor/History.d.ts +7 -0
  34. package/dist/editor/History.d.ts.map +1 -0
  35. package/dist/editor/History.js +43 -0
  36. package/dist/editor/History.js.map +1 -0
  37. package/dist/editor/Inspector.d.ts +22 -0
  38. package/dist/editor/Inspector.d.ts.map +1 -0
  39. package/dist/editor/Inspector.js +241 -0
  40. package/dist/editor/Inspector.js.map +1 -0
  41. package/dist/editor/LazyMount.d.ts +10 -0
  42. package/dist/editor/LazyMount.d.ts.map +1 -0
  43. package/dist/editor/LazyMount.js +29 -0
  44. package/dist/editor/LazyMount.js.map +1 -0
  45. package/dist/editor/LocaleSwitch.d.ts +2 -0
  46. package/dist/editor/LocaleSwitch.d.ts.map +1 -0
  47. package/dist/editor/LocaleSwitch.js +13 -0
  48. package/dist/editor/LocaleSwitch.js.map +1 -0
  49. package/dist/editor/NodeInspector.d.ts +9 -0
  50. package/dist/editor/NodeInspector.d.ts.map +1 -0
  51. package/dist/editor/NodeInspector.js +9 -0
  52. package/dist/editor/NodeInspector.js.map +1 -0
  53. package/dist/editor/PreviewFrame.d.ts +10 -0
  54. package/dist/editor/PreviewFrame.d.ts.map +1 -0
  55. package/dist/editor/PreviewFrame.js +22 -0
  56. package/dist/editor/PreviewFrame.js.map +1 -0
  57. package/dist/editor/ProjectIndex.d.ts +12 -0
  58. package/dist/editor/ProjectIndex.d.ts.map +1 -0
  59. package/dist/editor/ProjectIndex.js +43 -0
  60. package/dist/editor/ProjectIndex.js.map +1 -0
  61. package/dist/editor/StyleEditor.d.ts +37 -0
  62. package/dist/editor/StyleEditor.d.ts.map +1 -0
  63. package/dist/editor/StyleEditor.js +275 -0
  64. package/dist/editor/StyleEditor.js.map +1 -0
  65. package/dist/editor/TokenWorkbench.d.ts +37 -0
  66. package/dist/editor/TokenWorkbench.d.ts.map +1 -0
  67. package/dist/editor/TokenWorkbench.js +146 -0
  68. package/dist/editor/TokenWorkbench.js.map +1 -0
  69. package/dist/editor/Tokens.d.ts +21 -0
  70. package/dist/editor/Tokens.d.ts.map +1 -0
  71. package/dist/editor/Tokens.js +56 -0
  72. package/dist/editor/Tokens.js.map +1 -0
  73. package/dist/editor/VariablesPage.d.ts +28 -0
  74. package/dist/editor/VariablesPage.d.ts.map +1 -0
  75. package/dist/editor/VariablesPage.js +14 -0
  76. package/dist/editor/VariablesPage.js.map +1 -0
  77. package/dist/editor/api.d.ts +13 -0
  78. package/dist/editor/api.d.ts.map +1 -0
  79. package/dist/editor/api.js +70 -0
  80. package/dist/editor/api.js.map +1 -0
  81. package/dist/editor/camera.d.ts +18 -0
  82. package/dist/editor/camera.d.ts.map +1 -0
  83. package/dist/editor/camera.js +40 -0
  84. package/dist/editor/camera.js.map +1 -0
  85. package/dist/editor/canvas.d.ts +26 -0
  86. package/dist/editor/canvas.d.ts.map +1 -0
  87. package/dist/editor/canvas.js +51 -0
  88. package/dist/editor/canvas.js.map +1 -0
  89. package/dist/editor/chrome/EditorChrome.d.ts +42 -0
  90. package/dist/editor/chrome/EditorChrome.d.ts.map +1 -0
  91. package/dist/editor/chrome/EditorChrome.js +21 -0
  92. package/dist/editor/chrome/EditorChrome.js.map +1 -0
  93. package/dist/editor/i18n.d.ts +18 -0
  94. package/dist/editor/i18n.d.ts.map +1 -0
  95. package/dist/editor/i18n.js +762 -0
  96. package/dist/editor/i18n.js.map +1 -0
  97. package/dist/editor/main.d.ts +3 -0
  98. package/dist/editor/main.d.ts.map +1 -0
  99. package/dist/editor/main.js +12 -0
  100. package/dist/editor/main.js.map +1 -0
  101. package/dist/editor/model.d.ts +17 -0
  102. package/dist/editor/model.d.ts.map +1 -0
  103. package/dist/editor/model.js +12 -0
  104. package/dist/editor/model.js.map +1 -0
  105. package/dist/editor/reviewLifecycle.d.ts +9 -0
  106. package/dist/editor/reviewLifecycle.d.ts.map +1 -0
  107. package/dist/editor/reviewLifecycle.js +30 -0
  108. package/dist/editor/reviewLifecycle.js.map +1 -0
  109. package/dist/editor/styles.css +6626 -0
  110. package/dist/editor/ui/Button.d.ts +3 -0
  111. package/dist/editor/ui/Button.d.ts.map +1 -0
  112. package/dist/editor/ui/Button.js +6 -0
  113. package/dist/editor/ui/Button.js.map +1 -0
  114. package/dist/editor/ui/CommentBox.d.ts +23 -0
  115. package/dist/editor/ui/CommentBox.d.ts.map +1 -0
  116. package/dist/editor/ui/CommentBox.js +41 -0
  117. package/dist/editor/ui/CommentBox.js.map +1 -0
  118. package/dist/editor/ui/Icon.d.ts +9 -0
  119. package/dist/editor/ui/Icon.d.ts.map +1 -0
  120. package/dist/editor/ui/Icon.js +6 -0
  121. package/dist/editor/ui/Icon.js.map +1 -0
  122. package/dist/editor/ui/IconButton.d.ts +11 -0
  123. package/dist/editor/ui/IconButton.d.ts.map +1 -0
  124. package/dist/editor/ui/IconButton.js +6 -0
  125. package/dist/editor/ui/IconButton.js.map +1 -0
  126. package/dist/editor/ui/NumberInput.d.ts +14 -0
  127. package/dist/editor/ui/NumberInput.d.ts.map +1 -0
  128. package/dist/editor/ui/NumberInput.js +6 -0
  129. package/dist/editor/ui/NumberInput.js.map +1 -0
  130. package/dist/editor/ui/PageLine.d.ts +14 -0
  131. package/dist/editor/ui/PageLine.d.ts.map +1 -0
  132. package/dist/editor/ui/PageLine.js +7 -0
  133. package/dist/editor/ui/PageLine.js.map +1 -0
  134. package/dist/editor/ui/Select.d.ts +15 -0
  135. package/dist/editor/ui/Select.d.ts.map +1 -0
  136. package/dist/editor/ui/Select.js +11 -0
  137. package/dist/editor/ui/Select.js.map +1 -0
  138. package/dist/editor/ui/TokenField.d.ts +14 -0
  139. package/dist/editor/ui/TokenField.d.ts.map +1 -0
  140. package/dist/editor/ui/TokenField.js +41 -0
  141. package/dist/editor/ui/TokenField.js.map +1 -0
  142. package/dist/editor-ui.d.ts +14 -0
  143. package/dist/editor-ui.d.ts.map +1 -0
  144. package/dist/editor-ui.js +13 -0
  145. package/dist/editor-ui.js.map +1 -0
  146. package/dist/inspector/runtime.d.ts +18 -0
  147. package/dist/inspector/runtime.d.ts.map +1 -0
  148. package/dist/inspector/runtime.js +987 -0
  149. package/dist/inspector/runtime.js.map +1 -0
  150. package/dist/preview/main.d.ts +3 -0
  151. package/dist/preview/main.d.ts.map +1 -0
  152. package/dist/preview/main.js +72 -0
  153. package/dist/preview/main.js.map +1 -0
  154. package/dist/preview/preview.css +39 -0
  155. package/dist/runtime/flow.d.ts +15 -0
  156. package/dist/runtime/flow.d.ts.map +1 -0
  157. package/dist/runtime/flow.js +48 -0
  158. package/dist/runtime/flow.js.map +1 -0
  159. package/dist/runtime/free.d.ts +18 -0
  160. package/dist/runtime/free.d.ts.map +1 -0
  161. package/dist/runtime/free.js +8 -0
  162. package/dist/runtime/free.js.map +1 -0
  163. package/dist/runtime/index.d.ts +11 -0
  164. package/dist/runtime/index.d.ts.map +1 -0
  165. package/dist/runtime/index.js +46 -0
  166. package/dist/runtime/index.js.map +1 -0
  167. package/dist/runtime/types.d.ts +57 -0
  168. package/dist/runtime/types.d.ts.map +1 -0
  169. package/dist/runtime/types.js +14 -0
  170. package/dist/runtime/types.js.map +1 -0
  171. package/dist/shared/prompt.d.mts +13 -0
  172. package/dist/shared/prompt.mjs +97 -0
  173. package/dist/shared/protocol.d.ts +79 -0
  174. package/dist/shared/protocol.d.ts.map +1 -0
  175. package/dist/shared/protocol.js +7 -0
  176. package/dist/shared/protocol.js.map +1 -0
  177. package/dist/shared/tokens.d.ts +66 -0
  178. package/dist/shared/tokens.d.ts.map +1 -0
  179. package/dist/shared/tokens.js +2 -0
  180. package/dist/shared/tokens.js.map +1 -0
  181. package/dist/shared/types.d.ts +301 -0
  182. package/dist/shared/types.d.ts.map +1 -0
  183. package/dist/shared/types.js +13 -0
  184. package/dist/shared/types.js.map +1 -0
  185. package/dist/tokens/adapters/css.mjs +44 -0
  186. package/dist/tokens/adapters/cssInCode.mjs +277 -0
  187. package/dist/tokens/adapters/oxcShared.mjs +59 -0
  188. package/dist/tokens/adapters/preprocessor.mjs +63 -0
  189. package/dist/tokens/adapters/registry.mjs +53 -0
  190. package/dist/tokens/adapters/tailwindcss.mjs +360 -0
  191. package/dist/tokens/adapters/types.mjs +117 -0
  192. package/dist/tokens/extract.mjs +328 -0
  193. package/dist/tokens/pipeline.mjs +688 -0
  194. package/dist/vite/events.d.ts +25 -0
  195. package/dist/vite/events.d.ts.map +1 -0
  196. package/dist/vite/events.js +137 -0
  197. package/dist/vite/events.js.map +1 -0
  198. package/dist/vite/layout.d.ts +4 -0
  199. package/dist/vite/layout.d.ts.map +1 -0
  200. package/dist/vite/layout.js +78 -0
  201. package/dist/vite/layout.js.map +1 -0
  202. package/dist/vite/plugin.d.ts +33 -0
  203. package/dist/vite/plugin.d.ts.map +1 -0
  204. package/dist/vite/plugin.js +403 -0
  205. package/dist/vite/plugin.js.map +1 -0
  206. package/dist/vite/review.d.ts +7 -0
  207. package/dist/vite/review.d.ts.map +1 -0
  208. package/dist/vite/review.js +334 -0
  209. package/dist/vite/review.js.map +1 -0
  210. package/package.json +87 -4
  211. package/skills/design-surface/SKILL.md +190 -0
  212. package/skills/design-surface-authoring/SKILL.md +257 -0
  213. package/skills/design-surface-tokens/SKILL.md +235 -0
  214. package/README.md +0 -3
@@ -0,0 +1,762 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from 'react';
3
+ const en = {
4
+ 'brand.subtitle': 'TSX-native design review',
5
+ 'topbar.copyPrompt': 'Copy to agent',
6
+ 'topbar.copied': 'Copied',
7
+ 'topbar.fit': 'Fit',
8
+ 'topbar.zoomIn': 'Zoom in',
9
+ 'topbar.zoomOut': 'Zoom out',
10
+ 'topbar.locale': '中文',
11
+ 'topbar.language': 'Language',
12
+ 'topbar.design': 'Design',
13
+ 'left.tabs': 'Panels',
14
+ 'bottom.tabs': 'Panels',
15
+ 'topbar.meta': '{pages} · {tokens} tokens',
16
+ 'left.designs': 'Designs',
17
+ 'project.title': 'Projects',
18
+ 'project.back': 'Projects',
19
+ 'project.breadcrumb': 'Breadcrumb',
20
+ 'project.artboards': '{count} artboards',
21
+ 'project.artboardsOne': '1 artboard',
22
+ 'project.artboardsTitle': 'Artboards',
23
+ 'project.subtitle': 'Open an artboard to review its pages and design variables.',
24
+ 'project.pageCount': '{count} pages',
25
+ 'project.designPages': '{count} design pages',
26
+ 'project.designPageOne': '1 design page',
27
+ 'project.pageCountOne': '1 page',
28
+ 'project.empty': 'No artboards found. Add design/<id>/design.tsx and reload.',
29
+ 'project.noPages': 'No pages',
30
+ 'left.pages': 'Pages',
31
+ 'left.filter': 'Filter…',
32
+ 'left.noMatches': 'No matches',
33
+ 'variables.kicker': 'Design tokens',
34
+ 'variables.title': 'Variables',
35
+ 'variables.pageHint': 'Changes apply to every design page in this artboard. The agent writes them back to the token source.',
36
+ 'variables.count': '{count} tokens',
37
+ 'components.kicker': 'Basic component',
38
+ 'components.preview': 'preview',
39
+ 'components.pageHint': 'Rendered with the project providers and CSS.',
40
+ 'mobile.tools': 'Editor panels',
41
+ 'mobile.close': 'Close',
42
+ 'components.title': 'Components',
43
+ 'components.overviewKicker': 'Component pages',
44
+ 'components.overviewTitle': 'Component overview',
45
+ 'components.overviewHint': 'All component pages at a glance. Open one to inspect its states. Desktop is reviewed separately.',
46
+ 'components.states': '{count} states',
47
+ 'components.heading': 'Basic components',
48
+ 'components.hint': 'Discovered from the componentGlobs paths. Open a file to see the source.',
49
+ 'components.search': 'Filter components…',
50
+ 'components.source': 'Open source',
51
+ 'components.export': 'export',
52
+ 'components.empty': 'No components found. Add componentGroups to the design plugin.',
53
+ 'components.missing': 'Missing pages',
54
+ 'components.missingHint': 'These components are scanned but have no registered page yet.',
55
+ 'components.tokenStatus.literals': '{count} literals',
56
+ 'components.tokenStatus.tokenized': 'Tokenized',
57
+ 'components.tokenStatus.tokenizedHint': 'Uses {count} design token(s) with no hardcoded colors',
58
+ 'components.tokenStatus.clean': 'No literals',
59
+ 'left.frames': 'Frames',
60
+ 'left.layers': 'Layers',
61
+ 'left.components': 'Components',
62
+ 'left.allDom': 'All DOM',
63
+ 'left.anchorsOnly': 'Anchors only',
64
+ 'left.layersHint': 'Anchors are structural. Drag one onto another to record a move.',
65
+ 'left.layersEmpty': 'No DOM yet. The preview is still loading.',
66
+ 'left.componentsEmpty': 'No components found in this frame.',
67
+ 'left.pagesHint': 'All non-component pages. State frames live inside each page.',
68
+ 'left.componentsHint': 'Component instances in this frame. Focus one to deep-dive.',
69
+ 'left.variablesHint': 'Design tokens and their overrides.',
70
+ 'left.anchor': 'anchor',
71
+ 'left.frameCount': '{count} frames',
72
+ 'left.frameCountOne': '1 frame',
73
+ 'left.scopeAll': 'All layers',
74
+ 'left.scopeHint': 'Focused on {name}',
75
+ 'left.focus': 'Focus',
76
+ 'left.back': 'Back',
77
+ 'inspector.title': 'Inspector',
78
+ 'inspector.empty': 'Select an element to inspect its component and variables.',
79
+ 'inspector.node': 'Element',
80
+ 'inspector.component': 'Component',
81
+ 'inspector.componentStack': 'Component path',
82
+ 'inspector.source': 'Source',
83
+ 'inspector.copyPath': 'Copy path',
84
+ 'inspector.focus': 'Focus',
85
+ 'inspector.variables': 'Variables',
86
+ 'inspector.typography': 'Typography',
87
+ 'inspector.appearance': 'Appearance',
88
+ 'style.fontFamily': 'Font',
89
+ 'style.fontSize': 'Size',
90
+ 'style.fontWeight': 'Weight',
91
+ 'style.lineHeight': 'Line height',
92
+ 'style.letterSpacing': 'Letter spacing',
93
+ 'style.color': 'Color',
94
+ 'style.background': 'Fill',
95
+ 'style.border': 'Border',
96
+ 'inspector.boundToken': 'Bound to {token}',
97
+ 'inspector.editValue': 'Click to edit',
98
+ 'inspector.suggestToken': 'Suggest a variable for this value',
99
+ 'inspector.suggested': 'Suggested',
100
+ 'style.borderColor': 'Border color',
101
+ 'style.typography': 'Typography',
102
+ 'style.borderWidth': 'Border width',
103
+ 'style.borderStyle': 'Border style',
104
+ 'changes.styles': 'Styles',
105
+ 'changes.suggestions': 'Suggestions',
106
+ 'style.radius': 'Radius',
107
+ 'style.opacity': 'Opacity',
108
+ 'style.shadow': 'Shadow',
109
+ 'style.display': 'Display',
110
+ 'style.padding': 'Padding',
111
+ 'style.gap': 'Gap',
112
+ 'inspector.variablesEmpty': 'This layer does not reference a token directly.',
113
+ 'inspector.layout': 'Layout',
114
+ 'inspector.fill': 'Fill',
115
+ 'inspector.stroke': 'Stroke',
116
+ 'inspector.effects': 'Effects',
117
+ 'inspector.corner': 'Corner',
118
+ 'inspector.addFill': 'Add fill',
119
+ 'inspector.addStroke': 'Add stroke',
120
+ 'inspector.addEffect': 'Add effect',
121
+ 'inspector.addCorner': 'Add corner',
122
+ 'style.fill': 'Fill',
123
+ 'style.stroke': 'Stroke',
124
+ 'style.direction': 'Direction',
125
+ 'style.justify': 'Justify',
126
+ 'style.align': 'Align',
127
+ 'style.wrap': 'Wrap',
128
+ 'style.textAlign': 'Text align',
129
+ 'inspector.anchor': 'Anchor',
130
+ 'inspector.noAnchor': 'No anchor',
131
+ 'inspector.free': 'Free layout',
132
+ 'inspector.freeHint': 'In Inspect mode, Alt-drag on the canvas moves the item.',
133
+ 'inspector.freeX': 'X',
134
+ 'inspector.freeY': 'Y',
135
+ 'inspector.freeW': 'W',
136
+ 'inspector.freeH': 'H',
137
+ 'inspector.size': 'Size',
138
+ 'inspector.previewValues': 'Preview values',
139
+ 'inspector.sourceMissing': 'No source mapping for this component.',
140
+ 'inspector.openComponentPage': 'Open component page',
141
+ 'tokens.title': 'Tokens',
142
+ 'tokens.resetAll': 'Reset all',
143
+ 'tokens.used': '{count} uses',
144
+ 'tokens.unused': 'Unused',
145
+ 'tokens.hint': 'Source values plus preview overrides. Changes become review items.',
146
+ 'styleEditor.title': 'Edit style',
147
+ 'styleEditor.tokens': 'Tokens',
148
+ 'styleEditor.custom': 'Custom',
149
+ 'styleEditor.searchTokens': 'Search tokens…',
150
+ 'styleEditor.noTokens': 'No tokens for this property',
151
+ 'styleEditor.border': 'Border',
152
+ 'styleEditor.borderWidth': 'Width',
153
+ 'styleEditor.borderStyle': 'Style',
154
+ 'styleEditor.borderColor': 'Color',
155
+ 'styleEditor.typography': 'Typography',
156
+ 'styleEditor.fontFamily': 'Font family',
157
+ 'styleEditor.fontSize': 'Font size',
158
+ 'styleEditor.fontWeight': 'Weight',
159
+ 'styleEditor.lineHeight': 'Line height',
160
+ 'styleEditor.letterSpacing': 'Letter spacing',
161
+ 'styleEditor.contrast': 'Contrast',
162
+ 'styleEditor.colorHint': 'Contrast is measured against the current background. The value stays a literal until a token is bound.',
163
+ 'styleEditor.colorTokens': 'Color tokens',
164
+ 'styleEditor.offScale': 'Off-scale: {value}',
165
+ 'styleEditor.offScaleShort': 'Off the token length scale',
166
+ 'styleEditor.linkSides': 'Link sides',
167
+ 'styleEditor.top': 'Top',
168
+ 'styleEditor.right': 'Right',
169
+ 'styleEditor.bottom': 'Bottom',
170
+ 'styleEditor.left': 'Left',
171
+ 'styleEditor.layer': 'Layer {index}',
172
+ 'styleEditor.layerCount': '{count} layers',
173
+ 'styleEditor.removeLayer': 'Remove layer',
174
+ 'styleEditor.addLayer': 'Add layer',
175
+ 'styleEditor.noShadow': 'No shadow layers.',
176
+ 'tokens.health': 'Token health',
177
+ 'tokens.lens': 'Token lens',
178
+ 'tokens.lensHint': 'Hover a token to highlight its uses',
179
+ 'tokens.literals': 'Literals',
180
+ 'tokens.lensClear': 'Clear lens',
181
+ 'tokens.health.duplicates': 'Duplicated values',
182
+ 'tokens.health.orphans': 'Orphan tokens',
183
+ 'tokens.health.semanticLiterals': 'Semantic literals',
184
+ 'tokens.health.componentPrimitive': 'Component to primitive',
185
+ 'tokens.health.hardcoded': 'Hardcoded colors',
186
+ 'tokens.health.none': 'All clear',
187
+ 'tokens.health.alias': 'Alias',
188
+ 'tokens.health.deprecate': 'Deprecate',
189
+ 'tokens.health.promote': 'Promote',
190
+ 'tokens.health.aliasTarget': 'Alias to semantic…',
191
+ 'tokenDialog.title': 'Token',
192
+ 'tokenDialog.bound': 'Bound to',
193
+ 'tokenDialog.unbound': 'Not bound',
194
+ 'tokenDialog.use': 'Use token',
195
+ 'tokenDialog.create': 'Create token',
196
+ 'tokenDialog.change': 'Change token value',
197
+ 'tokenDialog.detach': 'Detach',
198
+ 'tokenDialog.openVariables': 'Open in Variables',
199
+ 'tokenDialog.search': 'Search tokens',
200
+ 'tokenDialog.empty': 'No matching tokens.',
201
+ 'tokenDialog.alias': 'Alias',
202
+ 'tokenDialog.used': '{count} uses',
203
+ 'tokenDialog.scope': 'Apply to',
204
+ 'tokenDialog.scope.instance': 'This instance',
205
+ 'tokenDialog.scope.component': 'This component',
206
+ 'tokenDialog.scope.all': 'All matching uses',
207
+ 'tokenDialog.name': 'Name',
208
+ 'tokenDialog.tier': 'Tier',
209
+ 'tokenDialog.tier.primitive': 'Primitive',
210
+ 'tokenDialog.tier.semantic': 'Semantic',
211
+ 'tokenDialog.tier.component': 'Component',
212
+ 'tokenDialog.aliasTarget': 'Alias target',
213
+ 'tokenDialog.description': 'Description',
214
+ 'tokenDialog.createAction': 'Create token',
215
+ 'tokenDialog.changeAction': 'Update value',
216
+ 'tokenDialog.createHint': 'Primitive tokens hold literal values. Semantic tokens alias a primitive. Component tokens alias a semantic token.',
217
+ 'tokenDialog.current': 'Current',
218
+ 'tokenDialog.value': 'Value',
219
+ 'tokenDialog.selectAlias': 'Select a token',
220
+ 'tokenDialog.suggested': 'Suggested from the current style',
221
+ 'tokenDialog.cancel': 'Cancel',
222
+ 'tokenDialog.save': 'Save',
223
+ 'tokens.tier.primitive': 'Primitive',
224
+ 'tokens.tier.semantic': 'Semantic',
225
+ 'tokens.tier.component': 'Component',
226
+ 'tokens.alias': 'Alias of {target}',
227
+ 'tokens.aliasedBy': 'Aliased by {targets}',
228
+ 'tokens.sourceUsed': '{count} source files',
229
+ 'tokens.source': 'Source',
230
+ 'tokens.empty': 'No token schema. Add design/tokens.ts exporting tokenGroups.',
231
+ 'tokens.reset': 'Reset {name}',
232
+ 'tokens.changed': 'Changed',
233
+ 'tokens.group': 'Group',
234
+ 'tokens.color': 'color',
235
+ 'flow.title': 'Flow',
236
+ 'flow.current': 'Current state',
237
+ 'flow.events': 'Available events',
238
+ 'flow.noEvents': 'This state has no outgoing transitions.',
239
+ 'flow.history': 'History',
240
+ 'flow.noHistory': 'Interact with the frame or fire an event to see the path.',
241
+ 'flow.empty': 'This design has no flow. Add defineFlow to expose states and events, or keep using plain React state.',
242
+ 'flow.fire': 'Fire {event}',
243
+ 'changes.title': 'Changes',
244
+ 'changes.pending': '{count} intents waiting for the agent.',
245
+ 'changes.none': 'No pending changes. The code is still the source of truth.',
246
+ 'changes.clear': 'Clear',
247
+ 'changes.tokens': 'Tokens',
248
+ 'changes.structure': 'Structure',
249
+ 'changes.free': 'Free layout',
250
+ 'changes.session': 'Session file',
251
+ 'changes.copy': 'Copy to agent',
252
+ 'changes.status': 'Status',
253
+ 'changes.status.open': 'Open',
254
+ 'changes.status.in_progress': 'In progress',
255
+ 'changes.status.resolved': 'Resolved',
256
+ 'changes.status.archived': 'Archived',
257
+ 'changes.reviewFile': 'Review ledger',
258
+ 'changes.agentReply': 'Agent reply',
259
+ 'changes.source': 'Source',
260
+ 'changes.verified': 'Source verified',
261
+ 'changes.tokenAction.create': 'Create',
262
+ 'changes.tokenAction.update': 'Update',
263
+ 'changes.tokenAction.merge': 'Merge',
264
+ 'changes.tokenAction.deprecate': 'Deprecate',
265
+ 'changes.tokenAction.alias': 'Alias',
266
+ 'changes.scope.design': 'Design',
267
+ 'changes.scope.frame': 'This frame',
268
+ 'changes.scope.component': 'This component',
269
+ 'changes.scope.page': 'This page',
270
+ 'changes.scope.editor': 'Editor chrome',
271
+ 'changes.awaitingSource': 'Awaiting generated source',
272
+ 'changes.copied': 'Copied',
273
+ 'proposal.badge': 'Agent proposal',
274
+ 'proposal.sectionTitle': 'Agent proposals',
275
+ 'proposal.sectionHint': 'Review proposed tokens before handing them back to the agent.',
276
+ 'proposal.approve': 'Approve',
277
+ 'proposal.reject': 'Reject',
278
+ 'proposal.undo': 'Undo',
279
+ 'proposal.approved': 'Approved',
280
+ 'proposal.rejected': 'Rejected',
281
+ 'proposal.rationale': 'Rationale',
282
+ 'proposal.valueLabel': 'Proposed value',
283
+ 'proposal.aliasLabel': 'Alias',
284
+ 'proposal.noteLabel': 'Note',
285
+ 'proposal.notePlaceholder': 'Optional note or fallback token…',
286
+ 'right.inspect': 'Inspect',
287
+ 'right.inspectHint': 'Select an element to inspect its component and variables.',
288
+ 'right.comments': 'Comments',
289
+ 'right.commentsHint': 'Comments pinned to this frame, with agent replies.',
290
+ 'right.changes': 'Changes',
291
+ 'right.changesHint': 'Style, token and layout changes for this frame. Resolved changes stay here until archived.',
292
+ 'right.history': 'History',
293
+ 'right.historyHint': 'Resolved comments and changes, archived after 10 minutes.',
294
+ 'right.collapse': 'Collapse sidebar',
295
+ 'right.expand': 'Expand sidebar',
296
+ 'comments.mode': 'Comment mode',
297
+ 'comments.modeOn': 'Comment mode on',
298
+ 'comments.select': 'Select element',
299
+ 'comments.done': 'Done',
300
+ 'comments.hint': 'Click an element in the preview to comment on it.',
301
+ 'comments.placeholder': 'Write a comment...',
302
+ 'comments.add': 'Comment',
303
+ 'comments.cancel': 'Cancel',
304
+ 'comments.empty': 'No comments on this page.',
305
+ 'comments.thread': 'Thread',
306
+ 'comments.new': 'New comment',
307
+ 'comments.close': 'Close comment',
308
+ 'comments.resolved': 'Resolved',
309
+ 'comments.open': 'Open',
310
+ 'comments.resolve': 'Resolve',
311
+ 'comments.reopen': 'Reopen',
312
+ 'comments.delete': 'Delete comment',
313
+ 'comments.edit': 'Edit',
314
+ 'comments.replies': 'Replies',
315
+ 'comments.agent': 'Agent',
316
+ 'comments.you': 'You',
317
+ 'comments.save': 'Save',
318
+ 'comments.edited': 'Edited',
319
+ 'comments.shortcut': '⌘/Ctrl + Enter',
320
+ 'history.hint': '{count} archived changes',
321
+ 'history.empty': 'No archived changes yet. Resolved changes are archived after 10 minutes.',
322
+ 'history.kind.token': 'Token',
323
+ 'history.kind.style': 'Style',
324
+ 'history.kind.free': 'Free layout',
325
+ 'history.kind.structure': 'Structure',
326
+ 'history.kind.suggestion': 'Suggestion',
327
+ 'history.kind.comment': 'Comment',
328
+ 'history.resolvedAt': 'resolved {time}',
329
+ 'agent.ready': 'Agent ready',
330
+ 'agent.pending': '{count} pending',
331
+ 'resource.groups': 'Groups',
332
+ 'resource.previewFrame': 'Preview frame',
333
+ 'resource.overrides': 'Overrides',
334
+ 'changes.remove': 'Remove',
335
+ 'changes.moveTo': 'to {target} in {parent}',
336
+ 'changes.freeTo': '{fromX},{fromY} to {toX},{toY}',
337
+ 'status.preview': 'Preview only — the agent writes the code.',
338
+ 'status.design': 'Design',
339
+ 'status.session': 'Session',
340
+ 'status.review': 'Review',
341
+ 'canvas.hand': 'Hand',
342
+ 'canvas.hint': 'Space to pan · ⌘/Ctrl + wheel to zoom',
343
+ 'frame.inspect': 'Inspect',
344
+ 'frame.play': 'Play',
345
+ 'frame.inspectTitle': 'Switch to Inspect',
346
+ 'frame.playTitle': 'Switch to Play',
347
+ 'empty.title': 'Design Surface',
348
+ 'empty.body': 'No designs found. Add design/<id>/design.tsx and reload.',
349
+ 'error.clipboard': 'Clipboard unavailable. Copy the session path from Changes.',
350
+ 'error.save': 'Could not save the session',
351
+ 'error.clear': 'Could not clear the session',
352
+ 'error.open': 'Could not open the source. The path was copied.',
353
+ 'common.reset': 'Reset',
354
+ 'common.clear': 'Clear',
355
+ 'common.remove': 'Remove',
356
+ 'common.copy': 'Copy',
357
+ 'common.all': 'All',
358
+ 'common.unknown': 'Unknown',
359
+ 'common.loading': 'Loading…',
360
+ 'preview.loading': 'Loading preview',
361
+ 'preview.error': 'Preview unavailable',
362
+ 'preview.retry': 'Retry',
363
+ 'common.collapse': 'Collapse panel',
364
+ 'common.expand': 'Expand panel',
365
+ };
366
+ const zh = {
367
+ 'brand.subtitle': 'TSX 原生设计评审',
368
+ 'topbar.copyPrompt': '复制给 Agent',
369
+ 'topbar.copied': '已复制',
370
+ 'topbar.fit': '适应',
371
+ 'topbar.zoomIn': '放大',
372
+ 'topbar.zoomOut': '缩小',
373
+ 'topbar.locale': 'EN',
374
+ 'topbar.language': '语言',
375
+ 'topbar.design': '设计',
376
+ 'left.tabs': '面板',
377
+ 'bottom.tabs': '面板',
378
+ 'topbar.meta': '{pages} · {tokens} 个变量',
379
+ 'left.designs': '设计',
380
+ 'project.title': '项目',
381
+ 'project.back': '项目',
382
+ 'project.breadcrumb': '路径',
383
+ 'project.artboards': '{count} 个画板',
384
+ 'project.artboardsOne': '1 个画板',
385
+ 'project.artboardsTitle': '画板',
386
+ 'project.subtitle': '打开一个画板,查看页面和设计变量。',
387
+ 'project.pageCount': '{count} 个页面',
388
+ 'project.designPages': '{count} 个设计页面',
389
+ 'project.designPageOne': '1 个设计页面',
390
+ 'project.pageCountOne': '1 个页面',
391
+ 'project.empty': '没有找到画板。添加 design/<id>/design.tsx 后刷新。',
392
+ 'project.noPages': '暂无页面',
393
+ 'left.pages': '页面',
394
+ 'left.filter': '筛选…',
395
+ 'left.noMatches': '没有匹配项',
396
+ 'variables.kicker': '设计变量',
397
+ 'variables.title': '变量',
398
+ 'variables.pageHint': '修改会应用到本画板的所有设计页面,由 agent 写回 token 源。',
399
+ 'variables.count': '{count} 个变量',
400
+ 'components.kicker': '基础组件',
401
+ 'components.preview': '预览',
402
+ 'components.pageHint': '使用项目的 Providers 和 CSS 渲染。',
403
+ 'mobile.tools': '编辑面板',
404
+ 'mobile.close': '关闭',
405
+ 'components.title': '组件',
406
+ 'components.overviewKicker': '组件页面',
407
+ 'components.overviewTitle': '组件总览',
408
+ 'components.overviewHint': '所有组件页一览;打开一个查看它的状态。桌面页单独审阅。',
409
+ 'components.states': '{count} 个状态',
410
+ 'components.heading': '基础组件',
411
+ 'components.hint': '由 componentGlobs 路径自动发现。打开文件查看源码。',
412
+ 'components.search': '筛选组件…',
413
+ 'components.source': '打开源码',
414
+ 'components.export': '导出',
415
+ 'components.empty': '没有找到组件。在 design 插件中添加 componentGroups。',
416
+ 'components.missing': '缺少页面',
417
+ 'components.missingHint': '这些组件已被扫描,但还没有注册组件页面。',
418
+ 'components.tokenStatus.literals': '{count} 处写死',
419
+ 'components.tokenStatus.tokenized': '已统一',
420
+ 'components.tokenStatus.tokenizedHint': '已引用 {count} 个设计 Token 且无硬编码颜色',
421
+ 'components.tokenStatus.clean': '无硬编码',
422
+ 'left.frames': '画板',
423
+ 'left.layers': '图层',
424
+ 'left.components': '组件',
425
+ 'left.allDom': '全部 DOM',
426
+ 'left.anchorsOnly': '仅锚点',
427
+ 'left.layersHint': '锚点用于结构。把一个锚点拖到另一个上即可记录移动。',
428
+ 'left.layersEmpty': '还没有 DOM,预览仍在加载。',
429
+ 'left.componentsEmpty': '此画板没有识别到组件。',
430
+ 'left.pagesHint': '所有非组件页面。state frame 在页面内部。',
431
+ 'left.componentsHint': '此画板中的组件实例。点一个即可深入。',
432
+ 'left.variablesHint': '设计 token 及其覆盖值。',
433
+ 'left.anchor': '锚点',
434
+ 'left.frameCount': '{count} 个画板',
435
+ 'left.frameCountOne': '1 个画板',
436
+ 'left.scopeAll': '全部图层',
437
+ 'left.scopeHint': '已进入 {name}',
438
+ 'left.focus': '深入',
439
+ 'left.back': '返回',
440
+ 'inspector.title': '检查器',
441
+ 'inspector.empty': '选中一个元素,查看它的组件和变量引用。',
442
+ 'inspector.node': '元素',
443
+ 'inspector.component': '组件',
444
+ 'inspector.componentStack': '组件路径',
445
+ 'inspector.source': '源码',
446
+ 'inspector.copyPath': '复制路径',
447
+ 'inspector.focus': '深入',
448
+ 'inspector.variables': '变量',
449
+ 'inspector.typography': '字体',
450
+ 'inspector.appearance': '外观',
451
+ 'style.fontFamily': '字体',
452
+ 'style.fontSize': '字号',
453
+ 'style.fontWeight': '字重',
454
+ 'style.lineHeight': '行高',
455
+ 'style.letterSpacing': '字距',
456
+ 'style.color': '颜色',
457
+ 'style.background': '填充',
458
+ 'style.border': '边框',
459
+ 'inspector.boundToken': '绑定到 {token}',
460
+ 'inspector.editValue': '点击修改',
461
+ 'inspector.suggestToken': '建议将该值提升为变量',
462
+ 'inspector.suggested': '已建议',
463
+ 'style.borderColor': '边框颜色',
464
+ 'style.typography': '文字',
465
+ 'style.borderWidth': '边框宽度',
466
+ 'style.borderStyle': '边框样式',
467
+ 'changes.styles': '样式',
468
+ 'changes.suggestions': '建议',
469
+ 'style.radius': '圆角',
470
+ 'style.opacity': '不透明度',
471
+ 'style.shadow': '阴影',
472
+ 'style.display': '布局',
473
+ 'style.padding': '内边距',
474
+ 'style.gap': '间隙',
475
+ 'inspector.variablesEmpty': '这个图层没有直接引用 token。',
476
+ 'inspector.layout': '布局',
477
+ 'inspector.fill': '填充',
478
+ 'inspector.stroke': '描边',
479
+ 'inspector.effects': '效果',
480
+ 'inspector.corner': '圆角',
481
+ 'inspector.addFill': '添加填充',
482
+ 'inspector.addStroke': '添加描边',
483
+ 'inspector.addEffect': '添加效果',
484
+ 'inspector.addCorner': '添加圆角',
485
+ 'style.fill': '填充',
486
+ 'style.stroke': '描边',
487
+ 'style.direction': '方向',
488
+ 'style.justify': '主轴对齐',
489
+ 'style.align': '交叉轴对齐',
490
+ 'style.wrap': '换行',
491
+ 'style.textAlign': '文本对齐',
492
+ 'inspector.anchor': '锚点',
493
+ 'inspector.noAnchor': '无锚点',
494
+ 'inspector.free': '自由布局',
495
+ 'inspector.freeHint': '在检查模式下,按住 Alt 拖动可移动该项。',
496
+ 'inspector.freeX': 'X',
497
+ 'inspector.freeY': 'Y',
498
+ 'inspector.freeW': 'W',
499
+ 'inspector.freeH': 'H',
500
+ 'inspector.size': '尺寸',
501
+ 'inspector.previewValues': '预览值',
502
+ 'inspector.sourceMissing': '这个组件没有源码映射。',
503
+ 'tokens.title': '变量',
504
+ 'tokens.resetAll': '全部重置',
505
+ 'tokens.used': '{count} 处使用',
506
+ 'tokens.unused': '未使用',
507
+ 'tokens.hint': '源码值加当前预览覆盖。修改会生成 review item。',
508
+ 'styleEditor.title': '编辑样式',
509
+ 'styleEditor.tokens': 'Token 候选',
510
+ 'styleEditor.custom': '自定义',
511
+ 'styleEditor.searchTokens': '搜索 Token…',
512
+ 'styleEditor.noTokens': '这个属性还没有对应 Token',
513
+ 'styleEditor.border': '边框',
514
+ 'styleEditor.borderWidth': '宽度',
515
+ 'styleEditor.borderStyle': '样式',
516
+ 'styleEditor.borderColor': '颜色',
517
+ 'styleEditor.typography': '文字',
518
+ 'styleEditor.fontFamily': '字体',
519
+ 'styleEditor.fontSize': '字号',
520
+ 'styleEditor.fontWeight': '字重',
521
+ 'styleEditor.lineHeight': '行高',
522
+ 'styleEditor.letterSpacing': '字距',
523
+ 'styleEditor.contrast': '对比度',
524
+ 'styleEditor.colorHint': '对比度基于当前背景计算。未绑定 token 前,这个值仍然是字面量。',
525
+ 'styleEditor.colorTokens': '颜色 Token',
526
+ 'styleEditor.offScale': '不在比例上:{value}',
527
+ 'styleEditor.offScaleShort': '不在 token 长度比例上',
528
+ 'styleEditor.linkSides': '联动四边',
529
+ 'styleEditor.top': '上',
530
+ 'styleEditor.right': '右',
531
+ 'styleEditor.bottom': '下',
532
+ 'styleEditor.left': '左',
533
+ 'styleEditor.layer': '第 {index} 层',
534
+ 'styleEditor.layerCount': '{count} 层',
535
+ 'styleEditor.removeLayer': '删除这一层',
536
+ 'styleEditor.addLayer': '添加阴影层',
537
+ 'styleEditor.noShadow': '没有阴影层。',
538
+ 'tokens.health': 'Token 健康',
539
+ 'tokens.lens': 'Token Lens',
540
+ 'tokens.lensHint': '悬停 Token 高亮使用位置',
541
+ 'tokens.literals': '字面量',
542
+ 'tokens.lensClear': '清除 Lens',
543
+ 'tokens.health.duplicates': '重复值',
544
+ 'tokens.health.orphans': '孤儿 Token',
545
+ 'tokens.health.semanticLiterals': '语义层字面量',
546
+ 'tokens.health.componentPrimitive': '组件直连原始',
547
+ 'tokens.health.hardcoded': '硬编码颜色',
548
+ 'tokens.health.none': '全部正常',
549
+ 'tokens.health.alias': '设为引用',
550
+ 'tokens.health.deprecate': '废弃',
551
+ 'tokens.health.promote': '提升为 Token',
552
+ 'tokens.health.aliasTarget': '引用到语义 Token…',
553
+ 'tokenDialog.title': 'Token',
554
+ 'tokenDialog.bound': '绑定到',
555
+ 'tokenDialog.unbound': '未绑定',
556
+ 'tokenDialog.use': '使用 Token',
557
+ 'tokenDialog.create': '创建 Token',
558
+ 'tokenDialog.change': '修改 Token 值',
559
+ 'tokenDialog.detach': '解除绑定',
560
+ 'tokenDialog.openVariables': '在变量页打开',
561
+ 'tokenDialog.search': '搜索 Token',
562
+ 'tokenDialog.empty': '没有匹配的 Token。',
563
+ 'tokenDialog.alias': '引用',
564
+ 'tokenDialog.used': '{count} 处使用',
565
+ 'tokenDialog.scope': '应用范围',
566
+ 'tokenDialog.scope.instance': '当前实例',
567
+ 'tokenDialog.scope.component': '当前组件',
568
+ 'tokenDialog.scope.all': '所有匹配使用',
569
+ 'tokenDialog.name': '名称',
570
+ 'tokenDialog.tier': '层级',
571
+ 'tokenDialog.tier.primitive': '原始',
572
+ 'tokenDialog.tier.semantic': '语义',
573
+ 'tokenDialog.tier.component': '组件',
574
+ 'tokenDialog.aliasTarget': '引用目标',
575
+ 'tokenDialog.description': '描述',
576
+ 'tokenDialog.createAction': '创建 Token',
577
+ 'tokenDialog.changeAction': '更新值',
578
+ 'tokenDialog.createHint': '原始 Token 存储字面量;语义 Token 引用原始 Token;组件 Token 引用语义 Token。',
579
+ 'tokenDialog.current': '当前',
580
+ 'tokenDialog.value': '值',
581
+ 'tokenDialog.selectAlias': '选择一个 Token',
582
+ 'tokenDialog.suggested': '根据当前样式推荐',
583
+ 'tokenDialog.cancel': '取消',
584
+ 'tokenDialog.save': '保存',
585
+ 'tokens.tier.primitive': '原始',
586
+ 'tokens.tier.semantic': '语义',
587
+ 'tokens.tier.component': '组件',
588
+ 'tokens.alias': '引用 {target}',
589
+ 'tokens.aliasedBy': '被 {targets} 引用',
590
+ 'tokens.sourceUsed': '源码 {count} 处',
591
+ 'tokens.source': '源码',
592
+ 'tokens.empty': '没有 token schema。在 design/tokens.ts 中导出 tokenGroups。',
593
+ 'tokens.reset': '重置 {name}',
594
+ 'tokens.changed': '已修改',
595
+ 'tokens.group': '分组',
596
+ 'tokens.color': '颜色',
597
+ 'flow.title': '状态',
598
+ 'flow.current': '当前状态',
599
+ 'flow.events': '可用事件',
600
+ 'flow.noEvents': '此状态没有后续迁移。',
601
+ 'flow.history': '历史',
602
+ 'flow.noHistory': '与画板交互或触发事件,即可看到路径。',
603
+ 'flow.empty': '此设计没有 flow。用 defineFlow 暴露状态和事件,或直接使用 React state。',
604
+ 'flow.fire': '触发 {event}',
605
+ 'changes.title': '变更',
606
+ 'changes.pending': '{count} 条意图等待 agent 应用。',
607
+ 'changes.none': '没有待应用的变更。代码仍是唯一源。',
608
+ 'changes.clear': '清空',
609
+ 'changes.tokens': '变量',
610
+ 'changes.structure': '结构',
611
+ 'changes.free': '自由布局',
612
+ 'changes.session': '会话文件',
613
+ 'changes.copy': '复制给 agent 的提示词',
614
+ 'changes.source': '源码',
615
+ 'changes.verified': '源码已验证',
616
+ 'changes.awaitingSource': '等待生成源码',
617
+ 'changes.tokenAction.create': '创建',
618
+ 'changes.tokenAction.update': '更新',
619
+ 'changes.tokenAction.merge': '合并',
620
+ 'changes.tokenAction.deprecate': '废弃',
621
+ 'changes.tokenAction.alias': '别名',
622
+ 'changes.scope.design': '整套设计',
623
+ 'changes.scope.frame': '当前 frame',
624
+ 'changes.scope.component': '当前组件',
625
+ 'changes.scope.page': '当前页面',
626
+ 'changes.scope.editor': '编辑器 Chrome',
627
+ 'changes.copied': '已复制',
628
+ 'proposal.badge': 'Agent 提案',
629
+ 'proposal.sectionTitle': '待审查的 Agent 提案',
630
+ 'proposal.sectionHint': '请先批准或拒绝以下 Token 提案,再复制给 Agent 执行。',
631
+ 'proposal.approve': '批准',
632
+ 'proposal.reject': '拒绝',
633
+ 'proposal.undo': '撤销决定',
634
+ 'proposal.approved': '已批准',
635
+ 'proposal.rejected': '已拒绝',
636
+ 'proposal.rationale': '提案理由',
637
+ 'proposal.valueLabel': '建议值',
638
+ 'proposal.aliasLabel': '引用',
639
+ 'proposal.noteLabel': '说明',
640
+ 'proposal.notePlaceholder': '可选:填写拒绝原因或改用现有 Token…',
641
+ 'right.inspect': '检查',
642
+ 'right.inspectHint': '选中元素,查看它的组件和变量引用。',
643
+ 'right.comments': '评论',
644
+ 'right.commentsHint': '固定在此 frame 上的评论,以及 Agent 的回复。',
645
+ 'right.changes': '更改',
646
+ 'right.changesHint': '此 frame 的样式、token 和布局更改。已解决的更改会留在这里直到归档。',
647
+ 'right.history': '历史',
648
+ 'right.historyHint': '已解决的评论和更改,10 分钟后归档。',
649
+ 'right.collapse': '收起侧边栏',
650
+ 'right.expand': '展开侧边栏',
651
+ 'comments.mode': '评论模式',
652
+ 'comments.modeOn': '评论模式已开启',
653
+ 'comments.select': '选择元素',
654
+ 'comments.done': '完成',
655
+ 'comments.hint': '在预览中点击元素,即可对它评论。',
656
+ 'comments.placeholder': '写下评论...',
657
+ 'comments.add': '评论',
658
+ 'comments.cancel': '取消',
659
+ 'comments.empty': '这个页面还没有评论。',
660
+ 'comments.thread': '评论',
661
+ 'comments.new': '新评论',
662
+ 'comments.close': '关闭评论',
663
+ 'comments.resolved': '已解决',
664
+ 'comments.open': '待处理',
665
+ 'comments.resolve': '解决',
666
+ 'comments.reopen': '重新打开',
667
+ 'comments.delete': '删除评论',
668
+ 'comments.edit': '编辑',
669
+ 'comments.replies': '回复',
670
+ 'comments.agent': 'Agent',
671
+ 'comments.you': '你',
672
+ 'comments.save': '保存',
673
+ 'comments.edited': '已编辑',
674
+ 'comments.shortcut': '⌘/Ctrl + Enter',
675
+ 'history.hint': '{count} 条归档记录',
676
+ 'history.empty': '还没有归档记录。已解决的改动会在 10 分钟后归档。',
677
+ 'history.kind.token': 'Token',
678
+ 'history.kind.style': '样式',
679
+ 'history.kind.free': '自由布局',
680
+ 'history.kind.structure': '结构',
681
+ 'history.kind.suggestion': '建议',
682
+ 'history.kind.comment': '评论',
683
+ 'history.resolvedAt': '{time} 解决',
684
+ 'agent.ready': 'Agent 就绪',
685
+ 'agent.pending': '{count} 项待处理',
686
+ 'resource.groups': '分组',
687
+ 'resource.previewFrame': '预览页面',
688
+ 'resource.overrides': '覆盖项',
689
+ 'changes.remove': '移除',
690
+ 'changes.moveTo': '到 {parent} 中的 {target}',
691
+ 'changes.freeTo': '{fromX},{fromY} 到 {toX},{toY}',
692
+ 'status.preview': '仅预览 — 代码由 agent 写入。',
693
+ 'status.design': '设计',
694
+ 'status.session': '会话',
695
+ 'status.review': '审阅',
696
+ 'canvas.hand': '抓手',
697
+ 'canvas.hint': '空格平移 · ⌘/Ctrl + 滚轮缩放',
698
+ 'frame.inspect': '检查',
699
+ 'frame.play': '运行',
700
+ 'frame.inspectTitle': '切换到检查',
701
+ 'frame.playTitle': '切换到运行',
702
+ 'empty.title': 'Design Surface',
703
+ 'empty.body': '没有找到设计。添加 design/<id>/design.tsx 后刷新。',
704
+ 'error.clipboard': '剪贴板不可用,请从 Changes 复制 session 路径。',
705
+ 'error.save': '无法保存 session',
706
+ 'error.clear': '无法清空 session',
707
+ 'error.open': '无法打开源码,路径已复制。',
708
+ 'common.reset': '重置',
709
+ 'common.clear': '清除',
710
+ 'common.remove': '移除',
711
+ 'common.copy': '复制',
712
+ 'common.all': '全部',
713
+ 'common.unknown': '未知',
714
+ 'common.loading': '加载中…',
715
+ 'preview.loading': '正在加载预览',
716
+ 'preview.error': '预览不可用',
717
+ 'preview.retry': '重试',
718
+ 'common.collapse': '收起面板',
719
+ 'common.expand': '展开面板',
720
+ };
721
+ const MESSAGES = { en, 'zh-CN': zh };
722
+ const STORAGE_KEY = 'design-surface:locale';
723
+ const fallback = {
724
+ locale: 'en',
725
+ setLocale: () => { },
726
+ t: (key) => en[key] ?? key,
727
+ };
728
+ const I18nContext = createContext(fallback);
729
+ const readLocale = () => {
730
+ try {
731
+ const stored = localStorage.getItem(STORAGE_KEY);
732
+ if (stored === 'en' || stored === 'zh-CN')
733
+ return stored;
734
+ }
735
+ catch {
736
+ // ignore storage access
737
+ }
738
+ return navigator.language.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en';
739
+ };
740
+ export function I18nProvider({ children }) {
741
+ const [locale, setLocale] = useState(readLocale);
742
+ useEffect(() => {
743
+ document.documentElement.lang = locale;
744
+ try {
745
+ localStorage.setItem(STORAGE_KEY, locale);
746
+ }
747
+ catch {
748
+ // ignore storage access
749
+ }
750
+ }, [locale]);
751
+ const t = useCallback((key, vars) => {
752
+ const template = MESSAGES[locale][key] ?? en[key] ?? key;
753
+ if (!vars)
754
+ return template;
755
+ return template.replace(/\{(\w+)\}/g, (_, name) => String(vars[name] ?? `{${name}}`));
756
+ }, [locale]);
757
+ const value = useMemo(() => ({ locale, setLocale, t }), [locale, t]);
758
+ return _jsx(I18nContext.Provider, { value: value, children: children });
759
+ }
760
+ export const useI18n = () => useContext(I18nContext);
761
+ export const localized = (item, locale) => (locale === 'zh-CN' ? item.labelZh ?? item.label : item.label) ?? '';
762
+ //# sourceMappingURL=i18n.js.map