@yahoo/uds-create-config 2.44.0 → 3.0.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 (376) hide show
  1. package/README.md +129 -0
  2. package/dist/ai-lanes.d.ts +23 -0
  3. package/dist/ai-lanes.js +34 -0
  4. package/dist/authoring/define-component.d.ts +85 -0
  5. package/dist/configs/CanvasConfig.d.ts +3237 -0
  6. package/dist/configs/CanvasConfig.js +332 -0
  7. package/dist/configs/build-options.d.ts +10 -0
  8. package/dist/configs/build-options.js +68 -0
  9. package/dist/configs/platform.d.ts +15 -0
  10. package/dist/configs/platform.js +17 -0
  11. package/dist/configs/react-native-system.d.ts +3026 -0
  12. package/dist/configs/react-native-system.js +64 -0
  13. package/dist/configs/system.d.ts +2771 -0
  14. package/dist/configs/system.js +74 -0
  15. package/dist/css/properties.generated.d.ts +14 -0
  16. package/dist/css/properties.generated.js +6260 -0
  17. package/dist/css/value-type.d.ts +48 -0
  18. package/dist/css/value-type.js +131 -0
  19. package/dist/css/values.d.ts +33 -0
  20. package/dist/css/values.js +116 -0
  21. package/dist/entities/native/NativeModifier.d.ts +25 -0
  22. package/dist/entities/native/NativeModifier.js +41 -0
  23. package/dist/entities/native/NativeSettings.d.ts +44 -0
  24. package/dist/entities/native/NativeSettings.js +39 -0
  25. package/dist/entities/native/NativeStyleProperty.d.ts +355 -0
  26. package/dist/entities/native/NativeStyleProperty.js +28 -0
  27. package/dist/entities/native/NativeToken.d.ts +31 -0
  28. package/dist/entities/native/NativeToken.js +49 -0
  29. package/dist/entities/system/CanvasRole.d.ts +34 -0
  30. package/dist/entities/system/CanvasRole.js +45 -0
  31. package/dist/entities/system/Component.d.ts +1287 -0
  32. package/dist/entities/system/Component.js +1840 -0
  33. package/dist/entities/system/Composite.d.ts +12 -0
  34. package/dist/entities/system/Composite.js +26 -0
  35. package/dist/entities/system/Device.d.ts +11 -0
  36. package/dist/entities/system/Device.js +18 -0
  37. package/dist/entities/system/File.d.ts +72 -0
  38. package/dist/entities/system/File.js +136 -0
  39. package/dist/entities/system/Font.d.ts +48 -0
  40. package/dist/entities/system/Font.js +56 -0
  41. package/dist/entities/system/GlobalStyle.d.ts +26 -0
  42. package/dist/entities/system/GlobalStyle.js +54 -0
  43. package/dist/entities/system/Guidance.d.ts +85 -0
  44. package/dist/entities/system/Guidance.js +59 -0
  45. package/dist/entities/system/GuidanceStyle.d.ts +14 -0
  46. package/dist/entities/system/GuidanceStyle.js +8 -0
  47. package/dist/entities/system/Icon.d.ts +46 -0
  48. package/dist/entities/system/Icon.js +46 -0
  49. package/dist/entities/system/LinkedSystem.d.ts +504 -0
  50. package/dist/entities/system/LinkedSystem.js +814 -0
  51. package/dist/entities/system/Modifier.d.ts +92 -0
  52. package/dist/entities/system/Modifier.js +120 -0
  53. package/dist/entities/system/Motion.d.ts +28 -0
  54. package/dist/entities/system/Motion.js +48 -0
  55. package/dist/entities/system/Operation.d.ts +100 -0
  56. package/dist/entities/system/Operation.js +236 -0
  57. package/dist/entities/system/Package.d.ts +42 -0
  58. package/dist/entities/system/Package.js +75 -0
  59. package/dist/entities/system/Settings.d.ts +94 -0
  60. package/dist/entities/system/Settings.js +166 -0
  61. package/dist/entities/system/StyleProperty.d.ts +135 -0
  62. package/dist/entities/system/StyleProperty.js +438 -0
  63. package/dist/entities/system/Token.d.ts +67 -0
  64. package/dist/entities/system/Token.js +129 -0
  65. package/dist/entities/system/Tool.d.ts +134 -0
  66. package/dist/entities/system/Tool.js +124 -0
  67. package/dist/entities/system/color.d.ts +64 -0
  68. package/dist/entities/system/color.js +123 -0
  69. package/dist/entities/system/component-module.d.ts +63 -0
  70. package/dist/entities/system/component-module.js +258 -0
  71. package/dist/entities/system/copy-plan.d.ts +98 -0
  72. package/dist/entities/system/copy-plan.js +451 -0
  73. package/dist/entities/system/defineComponent.d.ts +428 -0
  74. package/dist/entities/system/defineComponent.js +337 -0
  75. package/dist/entities/system/element.d.ts +101 -0
  76. package/dist/entities/system/element.js +171 -0
  77. package/dist/entities/system/icon-library.d.ts +64 -0
  78. package/dist/entities/system/icon-library.js +112 -0
  79. package/dist/entities/system/icon-metadata.d.ts +72 -0
  80. package/dist/entities/system/icon-metadata.js +111 -0
  81. package/dist/entities/system/link-declaration.d.ts +27 -0
  82. package/dist/entities/system/link-declaration.js +64 -0
  83. package/dist/entities/system/link-plan.d.ts +160 -0
  84. package/dist/entities/system/link-plan.js +770 -0
  85. package/dist/entities/system/runtime-modules.d.ts +25 -0
  86. package/dist/entities/system/runtime-modules.js +38 -0
  87. package/dist/entities/system/style-bag.d.ts +20 -0
  88. package/dist/entities/system/style-bag.js +246 -0
  89. package/dist/entities/system/token-index.d.ts +89 -0
  90. package/dist/entities/system/token-index.js +112 -0
  91. package/dist/framework/Config.d.ts +2472 -0
  92. package/dist/framework/Config.js +5023 -0
  93. package/dist/framework/Entity.d.ts +127 -0
  94. package/dist/framework/Entity.js +125 -0
  95. package/dist/framework/authoring.d.ts +24 -0
  96. package/dist/framework/authoring.js +7 -0
  97. package/dist/framework/change-hooks.d.ts +119 -0
  98. package/dist/framework/change-hooks.js +131 -0
  99. package/dist/framework/changes.d.ts +88 -0
  100. package/dist/framework/changes.js +246 -0
  101. package/dist/framework/class-names.d.ts +260 -0
  102. package/dist/framework/class-names.js +630 -0
  103. package/dist/framework/coalesce.d.ts +25 -0
  104. package/dist/framework/coalesce.js +60 -0
  105. package/dist/framework/config-op.d.ts +76 -0
  106. package/dist/framework/config-op.js +43 -0
  107. package/dist/framework/config-operation-kind.d.ts +14 -0
  108. package/dist/framework/config-operation-kind.js +14 -0
  109. package/dist/framework/config-ops.d.ts +34 -0
  110. package/dist/framework/config-ops.js +187 -0
  111. package/dist/framework/defineConfig.d.ts +196 -0
  112. package/dist/framework/defineConfig.js +100 -0
  113. package/dist/framework/defineDerivedEntity.d.ts +74 -0
  114. package/dist/framework/defineDerivedEntity.js +83 -0
  115. package/dist/framework/defineEntity.d.ts +318 -0
  116. package/dist/framework/defineEntity.js +183 -0
  117. package/dist/framework/defineSubEntity.d.ts +148 -0
  118. package/dist/framework/defineSubEntity.js +121 -0
  119. package/dist/framework/derived-mutations.d.ts +20 -0
  120. package/dist/framework/derived-mutations.js +38 -0
  121. package/dist/framework/entity-search.d.ts +29 -0
  122. package/dist/framework/entity-search.js +117 -0
  123. package/dist/framework/inline-sources.d.ts +49 -0
  124. package/dist/framework/inline-sources.js +388 -0
  125. package/dist/framework/layer-styles.d.ts +25 -0
  126. package/dist/framework/layer-styles.js +49 -0
  127. package/dist/framework/memo.d.ts +48 -0
  128. package/dist/framework/memo.js +84 -0
  129. package/dist/framework/overlay.d.ts +49 -0
  130. package/dist/framework/overlay.js +17 -0
  131. package/dist/framework/plan.d.ts +49 -0
  132. package/dist/framework/plan.js +73 -0
  133. package/dist/framework/projections.d.ts +480 -0
  134. package/dist/framework/projections.js +974 -0
  135. package/dist/framework/prop-surface.d.ts +132 -0
  136. package/dist/framework/prop-surface.js +278 -0
  137. package/dist/framework/ref-graph.d.ts +71 -0
  138. package/dist/framework/ref-graph.js +158 -0
  139. package/dist/framework/ref-integrity.d.ts +55 -0
  140. package/dist/framework/ref-integrity.js +171 -0
  141. package/dist/framework/registered.d.ts +95 -0
  142. package/dist/framework/registry-dir.d.ts +42 -0
  143. package/dist/framework/registry-dir.js +48 -0
  144. package/dist/framework/registry.d.ts +300 -0
  145. package/dist/framework/registry.js +104 -0
  146. package/dist/framework/rejection.d.ts +58 -0
  147. package/dist/framework/rejection.js +111 -0
  148. package/dist/framework/rename-inference.d.ts +26 -0
  149. package/dist/framework/rename-inference.js +50 -0
  150. package/dist/framework/render-spec.d.ts +296 -0
  151. package/dist/framework/render-spec.js +809 -0
  152. package/dist/framework/schema-version.d.ts +140 -0
  153. package/dist/framework/schema-version.js +214 -0
  154. package/dist/framework/schemas.d.ts +109 -0
  155. package/dist/framework/schemas.js +615 -0
  156. package/dist/framework/session.d.ts +196 -0
  157. package/dist/framework/session.js +367 -0
  158. package/dist/framework/signature.d.ts +15 -0
  159. package/dist/framework/signature.js +83 -0
  160. package/dist/framework/snapshot.d.ts +115 -0
  161. package/dist/framework/snapshot.js +277 -0
  162. package/dist/framework/source-integrity.d.ts +226 -0
  163. package/dist/framework/source-integrity.js +478 -0
  164. package/dist/framework/sources.d.ts +211 -0
  165. package/dist/framework/sources.js +89 -0
  166. package/dist/framework/utils/compiled-schema.d.ts +23 -0
  167. package/dist/framework/utils/compiled-schema.js +46 -0
  168. package/dist/framework/utils/content-key.d.ts +15 -0
  169. package/dist/framework/utils/content-key.js +33 -0
  170. package/dist/framework/utils/enumerated.d.ts +13 -0
  171. package/dist/framework/utils/enumerated.js +19 -0
  172. package/dist/framework/utils/field-path.d.ts +95 -0
  173. package/dist/framework/utils/field-path.js +136 -0
  174. package/dist/framework/utils/field-schema.d.ts +55 -0
  175. package/dist/framework/utils/field-schema.js +183 -0
  176. package/dist/framework/utils/group.d.ts +37 -0
  177. package/dist/framework/utils/group.js +13 -0
  178. package/dist/framework/utils/package-path.d.ts +37 -0
  179. package/dist/framework/utils/package-path.js +61 -0
  180. package/dist/framework/utils/refs.d.ts +194 -0
  181. package/dist/framework/utils/refs.js +403 -0
  182. package/dist/framework/validate-spec.d.ts +27 -0
  183. package/dist/framework/validate-spec.js +45 -0
  184. package/dist/framework/value-domain.d.ts +26 -0
  185. package/dist/framework/value-domain.js +202 -0
  186. package/dist/framework/views-facade.d.ts +15 -0
  187. package/dist/framework/views-facade.js +19 -0
  188. package/dist/index.d.ts +90 -42
  189. package/dist/index.js +86 -37
  190. package/dist/migrations/2.0.0/raw-css.d.ts +11 -0
  191. package/dist/migrations/2.0.0/raw-css.js +72 -0
  192. package/dist/migrations/2.0.0/v1-artifact.d.ts +1559 -0
  193. package/dist/migrations/2.0.0/v1-artifact.js +1018 -0
  194. package/dist/migrations/20260908171448_settings_as_kind.d.ts +22 -0
  195. package/dist/migrations/20260908171448_settings_as_kind.js +89 -0
  196. package/dist/migrations/20260908194245_visible_state_pointer.d.ts +19 -0
  197. package/dist/migrations/20260908194245_visible_state_pointer.js +115 -0
  198. package/dist/migrations/20260909183001_icon_knockout_variants.d.ts +18 -0
  199. package/dist/migrations/20260909183001_icon_knockout_variants.js +8 -0
  200. package/dist/migrations/20260910212453_linked_system_link_ops.d.ts +13 -0
  201. package/dist/migrations/20260910212453_linked_system_link_ops.js +8 -0
  202. package/dist/migrations/index.d.ts +2 -0
  203. package/dist/migrations/index.js +2 -0
  204. package/dist/react-native/style-keys.generated.d.ts +10 -0
  205. package/dist/react-native/style-keys.generated.js +167 -0
  206. package/dist/renderer/RendererErrorBoundary.d.ts +32 -5
  207. package/dist/renderer/RendererErrorBoundary.js +59 -10
  208. package/dist/renderer/UdsRenderer.d.ts +11 -10
  209. package/dist/renderer/UdsRenderer.js +1 -1
  210. package/dist/renderer/assetEntries.d.ts +37 -0
  211. package/dist/renderer/assetEntries.js +39 -0
  212. package/dist/renderer/assetRenderable.d.ts +14 -6
  213. package/dist/renderer/assetRenderable.js +8 -2
  214. package/dist/renderer/componentEntry.d.ts +58 -0
  215. package/dist/renderer/componentEntry.js +71 -0
  216. package/dist/renderer/icon-library.d.ts +20 -0
  217. package/dist/renderer/index.d.ts +7 -7
  218. package/dist/renderer/index.js +5 -5
  219. package/dist/renderer/primitives/SlotRenderer.d.ts +1 -1
  220. package/dist/renderer/primitives/SlotRenderer.js +1 -1
  221. package/dist/renderer/runtimeComponent.d.ts +33 -0
  222. package/dist/renderer/runtimeComponent.js +113 -0
  223. package/dist/renderer/spec-content.d.ts +43 -0
  224. package/dist/renderer/spec-content.js +95 -0
  225. package/dist/renderer/wrapRegistry.d.ts +22 -37
  226. package/dist/renderer/wrapRegistry.js +10 -20
  227. package/dist/renderer/wrappers/event-bridge.js +6 -5
  228. package/dist/renderer/wrappers/hex-normalize.js +6 -5
  229. package/dist/renderer/wrappers/html-aliases.d.ts +7 -2
  230. package/dist/renderer/wrappers/html-aliases.js +36 -19
  231. package/dist/renderer/wrappers/inline-styles.js +7 -6
  232. package/dist/spec/asset-jsx.d.ts +18 -5
  233. package/dist/spec/asset-jsx.js +27 -16
  234. package/dist/spec/collapse-text-labels.d.ts +5 -15
  235. package/dist/spec/collapse-text-labels.js +26 -19
  236. package/dist/spec/empty-node-slots.d.ts +56 -34
  237. package/dist/spec/empty-node-slots.js +87 -47
  238. package/dist/spec/index.d.ts +21 -10
  239. package/dist/spec/index.js +21 -10
  240. package/dist/spec/jsxToSpec.d.ts +14 -9
  241. package/dist/spec/jsxToSpec.js +20 -3
  242. package/dist/spec/preview-elements.d.ts +63 -0
  243. package/dist/spec/preview-elements.js +89 -0
  244. package/dist/spec/rewrite-refs.d.ts +58 -0
  245. package/dist/spec/rewrite-refs.js +250 -0
  246. package/dist/spec/specToJsx.js +18 -29
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +39 -52
  249. package/dist/AssetGroup.d.ts +0 -77
  250. package/dist/AssetGroup.js +0 -125
  251. package/dist/Component.d.ts +0 -333
  252. package/dist/Component.js +0 -1061
  253. package/dist/ComponentGroup.d.ts +0 -22
  254. package/dist/ComponentGroup.js +0 -51
  255. package/dist/CompositeStyle.d.ts +0 -30
  256. package/dist/CompositeStyle.js +0 -59
  257. package/dist/Config.d.ts +0 -528
  258. package/dist/Config.js +0 -1712
  259. package/dist/Mode.d.ts +0 -41
  260. package/dist/Mode.js +0 -81
  261. package/dist/Modifier.d.ts +0 -51
  262. package/dist/Modifier.js +0 -97
  263. package/dist/MotionDef.d.ts +0 -81
  264. package/dist/MotionDef.js +0 -212
  265. package/dist/Props.d.ts +0 -332
  266. package/dist/Props.js +0 -35
  267. package/dist/Provider.d.ts +0 -20
  268. package/dist/Provider.js +0 -14
  269. package/dist/StyleProp.d.ts +0 -145
  270. package/dist/StyleProp.js +0 -239
  271. package/dist/Token.d.ts +0 -76
  272. package/dist/Token.js +0 -133
  273. package/dist/TokenGroup.d.ts +0 -33
  274. package/dist/TokenGroup.js +0 -69
  275. package/dist/asset-kind.d.ts +0 -55
  276. package/dist/asset-kind.js +0 -29
  277. package/dist/asset-value.d.ts +0 -23
  278. package/dist/asset-value.js +0 -40
  279. package/dist/brands.d.ts +0 -30
  280. package/dist/brands.js +0 -20
  281. package/dist/captureCallerPath.d.ts +0 -48
  282. package/dist/captureCallerPath.js +0 -95
  283. package/dist/colorExpressions.d.ts +0 -131
  284. package/dist/colorExpressions.js +0 -148
  285. package/dist/component-referrers.d.ts +0 -30
  286. package/dist/component-referrers.js +0 -40
  287. package/dist/config-diagnostics.d.ts +0 -21
  288. package/dist/config-diagnostics.js +0 -12
  289. package/dist/defineAssetGroup.d.ts +0 -200
  290. package/dist/defineAssetGroup.js +0 -323
  291. package/dist/defineProvider.d.ts +0 -29
  292. package/dist/defineProvider.js +0 -60
  293. package/dist/element-marker.d.ts +0 -63
  294. package/dist/element-marker.js +0 -113
  295. package/dist/entity-utils.d.ts +0 -56
  296. package/dist/entity-utils.js +0 -105
  297. package/dist/extension.d.ts +0 -55
  298. package/dist/extension.js +0 -214
  299. package/dist/factories.d.ts +0 -863
  300. package/dist/factories.js +0 -475
  301. package/dist/font-face.d.ts +0 -25
  302. package/dist/font-face.js +0 -72
  303. package/dist/foreign-component-name.d.ts +0 -21
  304. package/dist/foreign-component-name.js +0 -42
  305. package/dist/interpolate.d.ts +0 -20
  306. package/dist/interpolate.js +0 -10
  307. package/dist/jsx/__fixtures__/cross-component-preview.d.ts +0 -3
  308. package/dist/jsx/__fixtures__/cross-component-preview.js +0 -15
  309. package/dist/jsx/jsx-dev-runtime.d.ts +0 -15
  310. package/dist/jsx/jsx-dev-runtime.js +0 -11
  311. package/dist/jsx/jsx-runtime.d.ts +0 -48
  312. package/dist/jsx/jsx-runtime.js +0 -305
  313. package/dist/linked-system-pins.d.ts +0 -30
  314. package/dist/linked-system-pins.js +0 -45
  315. package/dist/linkedNodePrefixes.d.ts +0 -73
  316. package/dist/linkedNodePrefixes.js +0 -99
  317. package/dist/markers.d.ts +0 -235
  318. package/dist/markers.js +0 -70
  319. package/dist/motion-constants.d.ts +0 -37
  320. package/dist/motion-constants.js +0 -61
  321. package/dist/native/NativeConfig.d.ts +0 -56
  322. package/dist/native/NativeConfig.js +0 -162
  323. package/dist/native/assets.d.ts +0 -20
  324. package/dist/native/assets.js +0 -17
  325. package/dist/native/components.d.ts +0 -139
  326. package/dist/native/components.js +0 -67
  327. package/dist/native/index.d.ts +0 -18
  328. package/dist/native/index.js +0 -17
  329. package/dist/native/modes.d.ts +0 -10
  330. package/dist/native/modes.js +0 -11
  331. package/dist/native/types.d.ts +0 -95
  332. package/dist/native/types.js +0 -0
  333. package/dist/native/validation.d.ts +0 -8
  334. package/dist/native/validation.js +0 -885
  335. package/dist/native/values.d.ts +0 -7
  336. package/dist/native/values.js +0 -15
  337. package/dist/native.d.ts +0 -12
  338. package/dist/native.js +0 -10
  339. package/dist/refs.d.ts +0 -204
  340. package/dist/refs.js +0 -129
  341. package/dist/registry-aliases.d.ts +0 -33
  342. package/dist/registry-aliases.js +0 -35
  343. package/dist/registry-dir.d.ts +0 -22
  344. package/dist/registry-dir.js +0 -10
  345. package/dist/renderer/makeRegistry.d.ts +0 -34
  346. package/dist/renderer/makeRegistry.js +0 -52
  347. package/dist/renderer/makeUdsRenderer.d.ts +0 -13
  348. package/dist/renderer/makeUdsRenderer.js +0 -51
  349. package/dist/renderer/wrappers/component-slots.d.ts +0 -41
  350. package/dist/renderer/wrappers/component-slots.js +0 -66
  351. package/dist/renderer/wrappers/slot-resolution.d.ts +0 -25
  352. package/dist/renderer/wrappers/slot-resolution.js +0 -68
  353. package/dist/renderer/wrappers/void-elements.d.ts +0 -37
  354. package/dist/renderer/wrappers/void-elements.js +0 -40
  355. package/dist/spec/layer-props.d.ts +0 -52
  356. package/dist/spec/layer-props.js +0 -149
  357. package/dist/spec/preview-controls.d.ts +0 -44
  358. package/dist/spec/preview-controls.js +0 -139
  359. package/dist/spec/slot-refs.d.ts +0 -39
  360. package/dist/spec/slot-refs.js +0 -56
  361. package/dist/token-override-rows.d.ts +0 -68
  362. package/dist/token-override-rows.js +0 -233
  363. package/dist/tokenValueType.d.ts +0 -34
  364. package/dist/tokenValueType.js +0 -138
  365. package/dist/types/css-properties.d.ts +0 -233
  366. package/dist/types/css-properties.js +0 -14
  367. package/dist/types/css-property-keywords.d.ts +0 -156
  368. package/dist/types/css-property-keywords.js +0 -616
  369. package/dist/types/css-values.d.ts +0 -63
  370. package/dist/types/css-values.js +0 -16
  371. package/dist/types.d.ts +0 -1138
  372. package/dist/types.js +0 -12
  373. package/dist/units.d.ts +0 -14
  374. package/dist/units.js +0 -16
  375. package/dist/utils/index.d.ts +0 -4
  376. package/dist/utils/index.js +0 -4
@@ -1,7 +0,0 @@
1
- import { OperatingSystemInput, OperatingSystemValue } from "./types.js";
2
-
3
- //#region src/native/values.d.ts
4
- declare function operatingSystem(input: OperatingSystemInput): OperatingSystemValue;
5
- declare function isOperatingSystemValue(value: unknown): value is OperatingSystemValue;
6
- //#endregion
7
- export { isOperatingSystemValue, operatingSystem };
@@ -1,15 +0,0 @@
1
- //#region src/native/values.ts
2
- function operatingSystem(input) {
3
- if (input.default === void 0 && (input.ios === void 0 || input.android === void 0)) throw new Error("operatingSystem() requires a default value or explicit ios and android values.");
4
- return {
5
- __kind: "operatingSystem",
6
- ...input.default !== void 0 ? { default: input.default } : {},
7
- ...input.ios !== void 0 ? { ios: input.ios } : {},
8
- ...input.android !== void 0 ? { android: input.android } : {}
9
- };
10
- }
11
- function isOperatingSystemValue(value) {
12
- return typeof value === "object" && value !== null && value.__kind === "operatingSystem";
13
- }
14
- //#endregion
15
- export { isOperatingSystemValue, operatingSystem };
package/dist/native.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { AssetRef, TokenRef, asset, token } from "./refs.js";
2
- import { ColorSpace, MixExpr, alpha, mix } from "./colorExpressions.js";
3
- import { SystemLink, TokenType } from "./types.js";
4
- import { NativeComponentBuilder, NativeComponentDefinition, NativeComponentGroupDefinition, NativeComponentProps, NativeComponentStyleHelpers, NativeComponentStyledBuilder, NativeComponentStyles, NativeLayerDefinition, NativeLayerKind, NativeLayerStyle, NativeLayerStyles, NativeRenderProps, NativeStyleValue, RegisteredNativeComponent, SerializedNativeComponentGroup, defineNativeComponent, defineNativeComponentGroup, nativeLayer } from "./native/components.js";
5
- import { ModeDefinition, NativeAppearanceModeOption, NativeAssetGroupDefinition, NativeBuildOptions, NativeColorExpression, NativeDefaultModes, NativeDependencyPolicy, NativeDependencyPolicyEntry, NativeFontAssetGroupDefinition, NativeFontAssetMember, NativeLiteral, NativeModeDefinition, NativeModeOptionDefinition, NativeSelectableValue, NativeStyleEngine, NativeTokenDefinition, NativeTokenGroupDefinition, NativeTokenValue, NativeViewportModeOption, OperatingSystemInput, OperatingSystemValue, SerializedNativeConfig } from "./native/types.js";
6
- import { NativeAssetGroupBuilder, NativeFontAssetGroupConfig, defineAssetGroup } from "./native/assets.js";
7
- import { defineMode } from "./native/modes.js";
8
- import { NativeConfigDiagnostic, NativeConfigDiagnosticCode, validateSerializedNativeConfig } from "./native/validation.js";
9
- import { NativeConfig, NativeConfigValidationError } from "./native/NativeConfig.js";
10
- import { isOperatingSystemValue, operatingSystem } from "./native/values.js";
11
- import { DefinedNativeTokenGroup, defineTokenGroup } from "./native/index.js";
12
- export { AssetRef, ColorSpace, DefinedNativeTokenGroup, MixExpr, ModeDefinition, NativeAppearanceModeOption, NativeAssetGroupBuilder, NativeAssetGroupDefinition, NativeBuildOptions, NativeColorExpression, NativeComponentBuilder, NativeComponentDefinition, NativeComponentGroupDefinition, NativeComponentProps, NativeComponentStyleHelpers, NativeComponentStyledBuilder, NativeComponentStyles, NativeConfig, NativeConfigDiagnostic, NativeConfigDiagnosticCode, NativeConfigValidationError, NativeDefaultModes, NativeDependencyPolicy, NativeDependencyPolicyEntry, NativeFontAssetGroupConfig, NativeFontAssetGroupDefinition, NativeFontAssetMember, NativeLayerDefinition, NativeLayerKind, NativeLayerStyle, NativeLayerStyles, NativeLiteral, NativeModeDefinition, NativeModeOptionDefinition, NativeRenderProps, NativeSelectableValue, NativeStyleEngine, NativeStyleValue, NativeTokenDefinition, NativeTokenGroupDefinition, NativeTokenValue, NativeViewportModeOption, OperatingSystemInput, OperatingSystemValue, RegisteredNativeComponent, SerializedNativeComponentGroup, SerializedNativeConfig, SystemLink, TokenRef, TokenType, alpha, asset, defineAssetGroup, defineMode, defineNativeComponent, defineNativeComponentGroup, defineTokenGroup, isOperatingSystemValue, mix, nativeLayer, operatingSystem, token, validateSerializedNativeConfig };
package/dist/native.js DELETED
@@ -1,10 +0,0 @@
1
- import { asset, token } from "./refs.js";
2
- import { alpha, mix } from "./colorExpressions.js";
3
- import { defineAssetGroup } from "./native/assets.js";
4
- import { defineNativeComponent, defineNativeComponentGroup, nativeLayer } from "./native/components.js";
5
- import { defineMode } from "./native/modes.js";
6
- import { isOperatingSystemValue, operatingSystem } from "./native/values.js";
7
- import { validateSerializedNativeConfig } from "./native/validation.js";
8
- import { NativeConfig, NativeConfigValidationError } from "./native/NativeConfig.js";
9
- import { defineTokenGroup } from "./native/index.js";
10
- export { NativeConfig, NativeConfigValidationError, alpha, asset, defineAssetGroup, defineMode, defineNativeComponent, defineNativeComponentGroup, defineTokenGroup, isOperatingSystemValue, mix, nativeLayer, operatingSystem, token, validateSerializedNativeConfig };
package/dist/refs.d.ts DELETED
@@ -1,204 +0,0 @@
1
- //#region src/refs.d.ts
2
- /**
3
- * Cross-reference markers — the `{ __kind, ref }` shapes that appear in
4
- * authored values and in the wire format. Each one represents "this
5
- * position holds a pointer to another resource, not a literal."
6
- *
7
- * Naming:
8
- *
9
- * - `<X>Name` — the string-side identifier (`'color/brand'`, `'Box'`).
10
- * Narrowed when the matching `Registered*` interface is augmented;
11
- * falls open to `string` otherwise.
12
- * - `<X>Ref` — the boxed marker shape `{ __kind, ref }` carrying an
13
- * `<X>Name`. Distinguishes a pointer from a literal at every position
14
- * that can hold either.
15
- * - `<x>()` — the helper that constructs an `<X>Ref` from an `<X>Name`.
16
- * - `is<X>Ref(value)` — type guard for use by the resolver and patch
17
- * system.
18
- *
19
- * # Augmented refs
20
- *
21
- * The `Registered*` interfaces below are augmentation seams that
22
- * consumer codegen populates via `declare module '@yahoo/uds-create-config' {
23
- * interface Registered* { ... } }`. When augmented, each ref's `ref`
24
- * field narrows to only valid references — `token('color/brand')` is OK
25
- * but `token('color/nope')` is a compile error. When un-augmented (this
26
- * package's own tests, fresh consumers before first build), the ref
27
- * accepts any string — codegen narrows it later.
28
- */
29
- interface RegisteredTokenGroups {}
30
- interface RegisteredModifiers<T> {}
31
- interface RegisteredModes {}
32
- interface RegisteredCompositeStyles {}
33
- interface RegisteredStyleProps {}
34
- interface RegisteredComponents {}
35
- interface RegisteredMotion {}
36
- interface RegisteredAssetGroups {}
37
- interface TokenRawNameRegistry {}
38
- /** `<groupName>/<tokenName>` for every registered token. */
39
- type TokenName = [keyof RegisteredTokenGroups] extends [never] ? string : { [G in keyof RegisteredTokenGroups & string]: `${G}/${keyof RegisteredTokenGroups[G] & string}` }[keyof RegisteredTokenGroups & string];
40
- /** Bare group names — `'color'`, `'spacing'`. */
41
- type TokenGroupName = [keyof RegisteredTokenGroups] extends [never] ? string : keyof RegisteredTokenGroups & string;
42
- /**
43
- * Bare composite name (`'elevation'`) or `<name>/<variant>`
44
- * (`'elevation/1'`).
45
- *
46
- * Indexes straight into `['styles']` rather than routing each member
47
- * through an `extends { styles: infer V } ? … : never` conditional, for
48
- * the same reason as `ModeName` — same resulting union, but no per-member
49
- * conditional check + `infer`, and one consistent shape across every
50
- * `*Name` union.
51
- */
52
- type CompositeName = [keyof RegisteredCompositeStyles] extends [never] ? `${string}/${string}` : (keyof RegisteredCompositeStyles & string) | { [C in keyof RegisteredCompositeStyles & string]: `${C}/${keyof RegisteredCompositeStyles[C]['styles'] & string}` }[keyof RegisteredCompositeStyles & string];
53
- /**
54
- * `<modeName>/<optionName>` for every registered mode option.
55
- *
56
- * Indexes straight into `['options']` rather than routing each member
57
- * through an `extends { options: infer O } ? … : never` conditional.
58
- * Both yield the same union, but the indexed access skips a per-member
59
- * conditional assignability check + `infer`, so it's cheaper for the
60
- * checker and keeps every `*Name` union on the one shape `TokenName`
61
- * uses.
62
- */
63
- type ModeName = [keyof RegisteredModes] extends [never] ? `${string}/${string}` : { [M in keyof RegisteredModes & string]: `${M}/${keyof RegisteredModes[M]['options'] & string}` }[keyof RegisteredModes & string];
64
- /** Style-prop names — `'bg'`, `'padding'`. */
65
- type StylePropName = [keyof RegisteredStyleProps] extends [never] ? string : keyof RegisteredStyleProps & string;
66
- /** Registered component names — `'Box'`, `'Alert'`. */
67
- type ComponentName = [keyof RegisteredComponents] extends [never] ? string : keyof RegisteredComponents & string;
68
- /** Registered `registerMotion({...})` preset names — `'fadeIn'`, `'slideUp'`.
69
- * Falls open to `string` when the registry isn't augmented (this package's
70
- * own compilation), so a `motion()` prop still typechecks in isolation. */
71
- type MotionName = [keyof RegisteredMotion] extends [never] ? string : keyof RegisteredMotion & string;
72
- /** Bare asset-group slugs — `'icons'`, `'fonts'`. */
73
- type AssetGroupName = [keyof RegisteredAssetGroups] extends [never] ? string : keyof RegisteredAssetGroups & string;
74
- /**
75
- * Member-level asset name — `<slug>/<member>` (`'fonts/yas'`). Narrows the
76
- * group slug against the registered set; the member segment stays open
77
- * `string` for now (codegen doesn't yet emit per-group member keys into
78
- * `RegisteredAssetGroups`, so we can't narrow it without collapsing the
79
- * union to `never`). Falls fully open to `${string}/${string}` before any
80
- * asset group is registered.
81
- */
82
- type AssetName = [keyof RegisteredAssetGroups] extends [never] ? `${string}/${string}` : `${keyof RegisteredAssetGroups & string}/${string}`;
83
- /** HTML tag names — open string for now; could narrow against `keyof JSX.IntrinsicElements`. */
84
- type TagName = string;
85
- interface TokenRef<TName extends string = string> {
86
- readonly __kind: 'token';
87
- readonly ref: TName;
88
- /**
89
- * Namespace scope for refs authored in extension payloads. Absent on
90
- * source-authored refs (they resolve in their own system's namespace).
91
- * `'consumer'` is stamped by the extension merge on plain `token()` refs
92
- * — a consumer-authored ref always means the consumer's own tokens.
93
- */
94
- readonly scope?: 'consumer';
95
- /** Pinned-system scope from a registry barrel's `token()` utility. */
96
- readonly system?: {
97
- readonly id: string;
98
- readonly version: string;
99
- };
100
- }
101
- interface TokenGroupRef<TName extends string = string> {
102
- readonly __kind: 'tokenGroup';
103
- readonly ref: TName;
104
- }
105
- interface CompositeRef<TName extends string = string, TLayer extends string | undefined = string | undefined> {
106
- readonly __kind: 'composite';
107
- readonly ref: TName;
108
- /**
109
- * Layer the marker should land on when used as a `.config()` prop
110
- * binding (set by `composite(ref).on(layer)`). Absent when the ref
111
- * is used as a token value, modifier selector, or as a bare prop
112
- * binding that defaults to the `'root'` layer downstream.
113
- */
114
- readonly layer?: TLayer;
115
- }
116
- interface ModeRef<TName extends string = string> {
117
- readonly __kind: 'mode';
118
- readonly ref: TName;
119
- }
120
- interface StylePropRef<TName extends string = string> {
121
- readonly __kind: 'styleProp';
122
- readonly ref: TName;
123
- readonly layer?: string;
124
- /**
125
- * Bind the style-prop to a specific layer — `styleProp('bg').on('root')`
126
- * routes the JSX prop into the named layer instead of the component's
127
- * own layer. Codegen reads the `layer` field and emits a class on
128
- * that layer. Mirrors the old `@yahoo/uds-create-config` `styleProp().on()` chain.
129
- */
130
- on(layer: string): StylePropRef<TName>;
131
- }
132
- interface TagRef<TName extends string = string> {
133
- readonly __kind: 'tag';
134
- readonly ref: TName;
135
- }
136
- interface ComponentRef<TName extends string = string> {
137
- readonly __kind: 'component';
138
- readonly ref: TName;
139
- }
140
- /**
141
- * Asset-group pointer. The same `{ __kind, ref }` tag is *embedded* on
142
- * the full group definition `defineAssetGroup(...)` returns (the
143
- * definition object doubles as its own ref), so `isAssetGroupRef()` accepts
144
- * both the bare marker and the live group object. The definition's
145
- * `ref` is late-bound at `registerAssetGroups` and throws when read
146
- * before registration; the guard only inspects `__kind`, so it is safe
147
- * on unregistered groups.
148
- */
149
- interface AssetGroupRef<TName extends string = string> {
150
- readonly __kind: 'assetGroup';
151
- readonly ref: TName;
152
- }
153
- /**
154
- * Member-level asset pointer used as a token value — `asset('fonts/yas')`.
155
- * Unlike `AssetGroupRef` (slug-only, late-bound, embedded on the live
156
- * `defineAssetGroup` object), this is a plain eager marker carrying a
157
- * `<slug>/<member>` ref. It only ever appears as a token value, so it
158
- * mirrors `TokenRef`, not `AssetGroupRef` — no `.on()`, no late binding.
159
- */
160
- interface AssetRef<TName extends string = string> {
161
- readonly __kind: 'asset';
162
- readonly ref: TName;
163
- }
164
- type AnyRef = TokenRef | TokenGroupRef | CompositeRef | ModeRef | StylePropRef | TagRef | ComponentRef | AssetGroupRef | AssetRef;
165
- /** Doc-alignment alias kept for ergonomic import. */
166
- type TokenQualifiedName = TokenName;
167
- declare function token<TName extends TokenName>(ref: TName): TokenRef<TName>;
168
- /**
169
- * Curried factory behind a registry barrel's `token()` utility —
170
- * `yahooOs.token('color/red-1')` names THAT system's token, letting a
171
- * consumer mix references across pinned systems unambiguously. The plain
172
- * `token()` import always means the consumer's own namespace.
173
- */
174
- declare function systemToken(systemId: string, version: string): <TName extends TokenName>(ref: TName) => TokenRef<TName>;
175
- declare function tokenGroup<TName extends TokenGroupName>(ref: TName): TokenGroupRef<TName>;
176
- /**
177
- * `composite(ref)` returns a bare `CompositeRef` plus an `.on(layer)`
178
- * method that produces the same shape with `layer` filled in — both
179
- * forms are `CompositeRef`. Codegen's marker probe in
180
- * `transformAuthoringSource.ts` reads `{ __kind, ref, layer? }`
181
- * uniformly, so the on-layer marker is just a `CompositeRef` with a
182
- * concrete `layer` field.
183
- */
184
- interface CompositeRefBuilder<TName extends string> extends CompositeRef<TName, undefined> {
185
- on<TLayer extends string>(layer: TLayer): CompositeRef<TName, TLayer>;
186
- }
187
- declare function composite<TName extends CompositeName>(ref: TName): CompositeRefBuilder<TName>;
188
- declare function mode<TName extends ModeName>(ref: TName): ModeRef<TName>;
189
- declare function styleProp<TName extends StylePropName>(ref: TName): StylePropRef<TName>;
190
- declare function tag<TName extends TagName>(ref: TName): TagRef<TName>;
191
- declare function component<TName extends ComponentName>(ref: TName): ComponentRef<TName>;
192
- declare function assetGroup<TName extends AssetGroupName>(ref: TName): AssetGroupRef<TName>;
193
- declare function asset<TName extends AssetName>(ref: TName): AssetRef<TName>;
194
- declare function isTokenRef(value: unknown): value is TokenRef;
195
- declare function isTokenGroupRef(value: unknown): value is TokenGroupRef;
196
- declare function isCompositeRef(value: unknown): value is CompositeRef;
197
- declare function isModeRef(value: unknown): value is ModeRef;
198
- declare function isStylePropRef(value: unknown): value is StylePropRef;
199
- declare function isTagRef(value: unknown): value is TagRef;
200
- declare function isComponentRef(value: unknown): value is ComponentRef;
201
- declare function isAssetGroupRef(value: unknown): value is AssetGroupRef;
202
- declare function isAssetRef(value: unknown): value is AssetRef;
203
- //#endregion
204
- export { AnyRef, AssetGroupName, AssetGroupRef, AssetName, AssetRef, ComponentName, ComponentRef, CompositeName, CompositeRef, CompositeRefBuilder, ModeName, ModeRef, MotionName, RegisteredAssetGroups, RegisteredComponents, RegisteredCompositeStyles, RegisteredModes, RegisteredModifiers, RegisteredMotion, RegisteredStyleProps, RegisteredTokenGroups, StylePropName, StylePropRef, TagName, TagRef, TokenGroupName, TokenGroupRef, TokenName, TokenQualifiedName, TokenRawNameRegistry, TokenRef, asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, systemToken, tag, token, tokenGroup };
package/dist/refs.js DELETED
@@ -1,129 +0,0 @@
1
- //#region src/refs.ts
2
- function token(ref) {
3
- return {
4
- __kind: "token",
5
- ref
6
- };
7
- }
8
- /**
9
- * Curried factory behind a registry barrel's `token()` utility —
10
- * `yahooOs.token('color/red-1')` names THAT system's token, letting a
11
- * consumer mix references across pinned systems unambiguously. The plain
12
- * `token()` import always means the consumer's own namespace.
13
- */
14
- function systemToken(systemId, version) {
15
- return (ref) => ({
16
- __kind: "token",
17
- ref,
18
- system: {
19
- id: systemId,
20
- version
21
- }
22
- });
23
- }
24
- function tokenGroup(ref) {
25
- return {
26
- __kind: "tokenGroup",
27
- ref
28
- };
29
- }
30
- function composite(ref) {
31
- return Object.assign({
32
- __kind: "composite",
33
- ref
34
- }, { on(layer) {
35
- return {
36
- __kind: "composite",
37
- ref,
38
- layer
39
- };
40
- } });
41
- }
42
- function mode(ref) {
43
- return {
44
- __kind: "mode",
45
- ref
46
- };
47
- }
48
- function styleProp(ref) {
49
- const marker = {
50
- __kind: "styleProp",
51
- ref
52
- };
53
- Object.defineProperty(marker, "on", {
54
- enumerable: false,
55
- configurable: true,
56
- writable: true,
57
- value(layer) {
58
- const next = {
59
- __kind: "styleProp",
60
- ref,
61
- layer
62
- };
63
- Object.defineProperty(next, "on", {
64
- enumerable: false,
65
- configurable: true,
66
- writable: true,
67
- value: marker.on
68
- });
69
- return next;
70
- }
71
- });
72
- return marker;
73
- }
74
- function tag(ref) {
75
- return {
76
- __kind: "tag",
77
- ref
78
- };
79
- }
80
- function component(ref) {
81
- return {
82
- __kind: "component",
83
- ref
84
- };
85
- }
86
- function assetGroup(ref) {
87
- return {
88
- __kind: "assetGroup",
89
- ref
90
- };
91
- }
92
- function asset(ref) {
93
- return {
94
- __kind: "asset",
95
- ref
96
- };
97
- }
98
- function isRefOf(value, kind) {
99
- return typeof value === "object" && value !== null && value.__kind === kind;
100
- }
101
- function isTokenRef(value) {
102
- return isRefOf(value, "token");
103
- }
104
- function isTokenGroupRef(value) {
105
- return isRefOf(value, "tokenGroup");
106
- }
107
- function isCompositeRef(value) {
108
- return isRefOf(value, "composite");
109
- }
110
- function isModeRef(value) {
111
- return isRefOf(value, "mode");
112
- }
113
- function isStylePropRef(value) {
114
- return isRefOf(value, "styleProp");
115
- }
116
- function isTagRef(value) {
117
- return isRefOf(value, "tag");
118
- }
119
- function isComponentRef(value) {
120
- return isRefOf(value, "component");
121
- }
122
- function isAssetGroupRef(value) {
123
- return isRefOf(value, "assetGroup");
124
- }
125
- function isAssetRef(value) {
126
- return isRefOf(value, "asset");
127
- }
128
- //#endregion
129
- export { asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, systemToken, tag, token, tokenGroup };
@@ -1,33 +0,0 @@
1
- //#region src/registry-aliases.d.ts
2
- /**
3
- * Folder slugs for the linked-system registry (UDS-2771).
4
- * Each top-level linked dependency gets a stable folder slug — derived
5
- * from the entry's `name` in the consumer's own `registerLinkedSystems`
6
- * pin (stable across remote renames, fixable locally on collision). The
7
- * pull materializer names each system's data-barrel folder
8
- * (`<registryDir>/<slug>/index.ts`) with it, and the link patch applier
9
- * writes the matching relative import — both sides derive the slug from
10
- * the same pin set so they can never disagree.
11
- */
12
- /** One top-level declared dependency, as needed for alias building. */
13
- interface RegistryAliasSource {
14
- systemId: string;
15
- version: string;
16
- /** Display name from the consumer's registerLinkedSystems pin. */
17
- name: string;
18
- }
19
- /**
20
- * Slug for one linked system's import alias: lowercase, hyphen-separated,
21
- * ASCII-safe. Names that reduce to nothing get a generic fallback (the
22
- * collision suffix in {@link buildRegistryAliases} keeps them distinct).
23
- */
24
- declare function slugifyLinkedName(name: string): string;
25
- /**
26
- * Map top-level declared dependencies to `slug → {systemId}@{version}` (the
27
- * registry folder name). Colliding slugs keep declaration order: the first
28
- * wins the bare slug, later ones get a `-{systemId-prefix}` suffix — still
29
- * deterministic across machines.
30
- */
31
- declare function buildRegistryAliases(roots: RegistryAliasSource[]): Record<string, string>;
32
- //#endregion
33
- export { RegistryAliasSource, buildRegistryAliases, slugifyLinkedName };
@@ -1,35 +0,0 @@
1
- //#region src/registry-aliases.ts
2
- /**
3
- * Slug for one linked system's import alias: lowercase, hyphen-separated,
4
- * ASCII-safe. Names that reduce to nothing get a generic fallback (the
5
- * collision suffix in {@link buildRegistryAliases} keeps them distinct).
6
- */
7
- function slugifyLinkedName(name) {
8
- const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
9
- return slug === "" ? "linked-system" : slug;
10
- }
11
- /**
12
- * Map top-level declared dependencies to `slug → {systemId}@{version}` (the
13
- * registry folder name). Colliding slugs keep declaration order: the first
14
- * wins the bare slug, later ones get a `-{systemId-prefix}` suffix — still
15
- * deterministic across machines.
16
- */
17
- function buildRegistryAliases(roots) {
18
- const aliases = {};
19
- for (const root of roots) {
20
- let slug = slugifyLinkedName(root.name);
21
- if (aliases[slug] !== void 0) {
22
- const collisionBase = `${slug}-${root.systemId.slice(0, 8)}`;
23
- slug = collisionBase;
24
- let collisionIndex = 2;
25
- while (aliases[slug] !== void 0) {
26
- slug = `${collisionBase}-${collisionIndex}`;
27
- collisionIndex++;
28
- }
29
- }
30
- aliases[slug] = `${root.systemId}@${root.version}`;
31
- }
32
- return aliases;
33
- }
34
- //#endregion
35
- export { buildRegistryAliases, slugifyLinkedName };
@@ -1,22 +0,0 @@
1
- //#region src/registry-dir.d.ts
2
- /**
3
- * Where a project's linked-system registry lives, relative to the project
4
- * root. One resolution rule shared by every consumer — `uds pull` (writes the
5
- * registry), `uds build` (regenerates linked CSS from it), the bundler
6
- * loaders (skip its files), and the push seal (excludes its files from a
7
- * consumer's own sealed sources):
8
- *
9
- * 1. `buildOptions.registryDir` when the consumer sets one;
10
- * 2. `<componentsDir>/registry` — the default, keeping the registry inside
11
- * the design system's own subtree;
12
- * 3. `registry` at the project root, for configs that declare no
13
- * `componentsDir`.
14
- */
15
- interface RegistryDirOptions {
16
- componentsDir?: string;
17
- registryDir?: string;
18
- }
19
- /** Project-root-relative POSIX path of the linked-system registry. */
20
- declare function resolveRegistryDir(buildOptions: RegistryDirOptions | undefined): string;
21
- //#endregion
22
- export { resolveRegistryDir };
@@ -1,10 +0,0 @@
1
- //#region src/registry-dir.ts
2
- const normalize = (p) => p.replace(/\\/g, "/").replace(/\/+$/, "");
3
- /** Project-root-relative POSIX path of the linked-system registry. */
4
- function resolveRegistryDir(buildOptions) {
5
- if (buildOptions?.registryDir) return normalize(buildOptions.registryDir);
6
- if (buildOptions?.componentsDir) return `${normalize(buildOptions.componentsDir)}/registry`;
7
- return "registry";
8
- }
9
- //#endregion
10
- export { resolveRegistryDir };
@@ -1,34 +0,0 @@
1
- import { AssetGroup } from "../AssetGroup.js";
2
- import { AssetRenderProps } from "./assetRenderable.js";
3
- import { RegistryDescriptor } from "./wrapRegistry.js";
4
- import React from "react";
5
- import { ComponentRegistry } from "@json-render/react";
6
-
7
- //#region src/renderer/makeRegistry.d.ts
8
- /** Plain, provider-free asset renderables indexed `slug → name → component`.
9
- * Each is `makeAssetRenderable(SystemComponent, member, name)` — the SAME
10
- * component identity the registry keys under the namespaced asset type, but
11
- * surfaced directly so callers (e.g. the icon picker) can render a single
12
- * glyph without standing up a json-render engine per cell. */
13
- type AssetMembers = ReadonlyMap<string, ReadonlyMap<string, React.ComponentType<AssetRenderProps>>>;
14
- interface MakeRegistryResult {
15
- registry: ComponentRegistry;
16
- /** @see AssetMembers — empty when the config registers no placeable assets. */
17
- assetMembers: AssetMembers;
18
- }
19
- /**
20
- * Compose a complete json-render `ComponentRegistry` from a project's
21
- * UDS components. Wraps each component with a uniform prop-forwarding
22
- * + error-boundary `ComponentFn` (`makeUdsRenderer`), routes through
23
- * `defineRegistry` to adapt to the `ComponentRenderer` shape, then
24
- * applies the standard wrapper stack (`wrapRegistry`) so consumers
25
- * can render any Spec from any source (author-emitted, AI-emitted,
26
- * Figma import) without per-call normalisation.
27
- *
28
- * Replaces the per-project codegen that used to emit ~50 lines of
29
- * `${name}Renderer` function definitions plus a flat registry literal.
30
- * Codegen now emits a single `makeRegistry({...components})` call.
31
- */
32
- declare function makeRegistry(components: Record<string, React.ComponentType<any>>, foreignComponents?: readonly React.ComponentType<any>[], descriptor?: RegistryDescriptor, assetGroups?: Iterable<AssetGroup>): MakeRegistryResult;
33
- //#endregion
34
- export { AssetMembers, MakeRegistryResult, makeRegistry };
@@ -1,52 +0,0 @@
1
- import { isPlaceable } from "../asset-kind.js";
2
- import { foreignRegistryKey } from "../foreign-component-name.js";
3
- import { makeAssetRenderable } from "./assetRenderable.js";
4
- import { makeUdsRenderer } from "./makeUdsRenderer.js";
5
- import { wrapRegistry } from "./wrapRegistry.js";
6
- import { defineRegistry } from "@json-render/react";
7
- //#region src/renderer/makeRegistry.ts
8
- /**
9
- * Compose a complete json-render `ComponentRegistry` from a project's
10
- * UDS components. Wraps each component with a uniform prop-forwarding
11
- * + error-boundary `ComponentFn` (`makeUdsRenderer`), routes through
12
- * `defineRegistry` to adapt to the `ComponentRenderer` shape, then
13
- * applies the standard wrapper stack (`wrapRegistry`) so consumers
14
- * can render any Spec from any source (author-emitted, AI-emitted,
15
- * Figma import) without per-call normalisation.
16
- *
17
- * Replaces the per-project codegen that used to emit ~50 lines of
18
- * `${name}Renderer` function definitions plus a flat registry literal.
19
- * Codegen now emits a single `makeRegistry({...components})` call.
20
- */
21
- function makeRegistry(components, foreignComponents = [], descriptor, assetGroups = []) {
22
- const componentFns = {};
23
- for (const [name, Comp] of Object.entries(components)) componentFns[name] = makeUdsRenderer(Comp, name);
24
- for (const Comp of foreignComponents) {
25
- const key = foreignRegistryKey(Comp);
26
- if (key !== null) componentFns[key] = makeUdsRenderer(Comp, key);
27
- }
28
- const assetMembersBySlug = /* @__PURE__ */ new Map();
29
- for (const group of assetGroups) {
30
- if (!isPlaceable(group)) continue;
31
- const members = group.members;
32
- if (!members) continue;
33
- const SystemComponent = group.component !== void 0 ? components[group.component] : void 0;
34
- const bySlug = /* @__PURE__ */ new Map();
35
- for (const name of group.assetNames) {
36
- const member = members[name];
37
- if (member === void 0) continue;
38
- const key = group.assetType(name);
39
- const Renderable = makeAssetRenderable(SystemComponent, member, name);
40
- componentFns[key] = makeUdsRenderer(Renderable, key);
41
- bySlug.set(name, Renderable);
42
- }
43
- assetMembersBySlug.set(group.name, bySlug);
44
- }
45
- const { registry } = defineRegistry(null, { components: componentFns });
46
- return {
47
- registry: wrapRegistry(registry, descriptor, assetMembersBySlug),
48
- assetMembers: assetMembersBySlug
49
- };
50
- }
51
- //#endregion
52
- export { makeRegistry };
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { BaseComponentProps } from "@json-render/react";
3
-
4
- //#region src/renderer/makeUdsRenderer.d.ts
5
- /**
6
- * Component-fn signature used in `defineRegistry`'s `components` map.
7
- * Matches `@json-render/react`'s `BaseComponentProps` so the registry
8
- * lookup hands us `{ props, children, emit, bindings, ... }` directly.
9
- */
10
- type UdsComponentFn = (ctx: BaseComponentProps<Record<string, unknown>>) => React.ReactElement;
11
- declare function makeUdsRenderer(Comp: React.ComponentType<any>, name: string): UdsComponentFn;
12
- //#endregion
13
- export { makeUdsRenderer };
@@ -1,51 +0,0 @@
1
- import { RendererErrorBoundary } from "./RendererErrorBoundary.js";
2
- import React from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- //#region src/renderer/makeUdsRenderer.tsx
5
- /**
6
- * Minimal pass-through `ComponentFn` for any UDS component. The
7
- * component's own `bindRender` (codegen-emitted FC) owns variant /
8
- * style-prop / modifier resolution at runtime — this wrapper just
9
- * forwards `props` + `children` inside an error boundary.
10
- *
11
- * Replaces the per-component wrapper functions codegen used to emit
12
- * as a dedent string (one `${name}Renderer` function per registered
13
- * component, all structurally identical). The new factory composes
14
- * once at runtime; codegen just calls `makeRegistry({ ...components })`.
15
- *
16
- * Returns a `ComponentFn` (hoisted-props shape) so it can flow through
17
- * `defineRegistry` the same way the original codegen-emitted wrappers
18
- * did — `defineRegistry` adapts it to a `ComponentRenderer` (element-
19
- * shape) before `wrapRegistry` runs.
20
- */
21
- /**
22
- * An injected drop-target `Slot` placeholder (`withContainerChildSlots` /
23
- * `withEmptyNodeSlots` in `../spec/empty-node-slots.ts`) arrives here as a
24
- * rendered json-render element wrapper whose spec element is `Slot`-typed —
25
- * the same `props.element.type` detection child-enumerating render fns use.
26
- * It is editing scaffolding (a canvas insertion affordance), not content.
27
- */
28
- function isSlotPlaceholder(child) {
29
- return React.isValidElement(child) && child.props.element?.type === "Slot";
30
- }
31
- function makeUdsRenderer(Comp, name) {
32
- return function UdsComponentRenderer({ props, children }) {
33
- const { children: propChildren, ...rest } = props;
34
- const childArray = React.Children.toArray(children);
35
- const hasRealChildren = childArray.some((c) => !isSlotPlaceholder(c));
36
- let finalChildren;
37
- if (hasRealChildren) finalChildren = children;
38
- else if (propChildren != null && childArray.length > 0) finalChildren = [propChildren, ...childArray];
39
- else if (childArray.length > 0) finalChildren = children;
40
- else finalChildren = propChildren;
41
- return /* @__PURE__ */ jsx(RendererErrorBoundary, {
42
- name,
43
- children: finalChildren !== void 0 && finalChildren !== null ? /* @__PURE__ */ jsx(Comp, {
44
- ...rest,
45
- children: finalChildren
46
- }) : /* @__PURE__ */ jsx(Comp, { ...rest })
47
- });
48
- };
49
- }
50
- //#endregion
51
- export { makeUdsRenderer };