@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.
- package/README.md +129 -0
- package/dist/ai-lanes.d.ts +23 -0
- package/dist/ai-lanes.js +34 -0
- package/dist/authoring/define-component.d.ts +85 -0
- package/dist/configs/CanvasConfig.d.ts +3237 -0
- package/dist/configs/CanvasConfig.js +332 -0
- package/dist/configs/build-options.d.ts +10 -0
- package/dist/configs/build-options.js +68 -0
- package/dist/configs/platform.d.ts +15 -0
- package/dist/configs/platform.js +17 -0
- package/dist/configs/react-native-system.d.ts +3026 -0
- package/dist/configs/react-native-system.js +64 -0
- package/dist/configs/system.d.ts +2771 -0
- package/dist/configs/system.js +74 -0
- package/dist/css/properties.generated.d.ts +14 -0
- package/dist/css/properties.generated.js +6260 -0
- package/dist/css/value-type.d.ts +48 -0
- package/dist/css/value-type.js +131 -0
- package/dist/css/values.d.ts +33 -0
- package/dist/css/values.js +116 -0
- package/dist/entities/native/NativeModifier.d.ts +25 -0
- package/dist/entities/native/NativeModifier.js +41 -0
- package/dist/entities/native/NativeSettings.d.ts +44 -0
- package/dist/entities/native/NativeSettings.js +39 -0
- package/dist/entities/native/NativeStyleProperty.d.ts +355 -0
- package/dist/entities/native/NativeStyleProperty.js +28 -0
- package/dist/entities/native/NativeToken.d.ts +31 -0
- package/dist/entities/native/NativeToken.js +49 -0
- package/dist/entities/system/CanvasRole.d.ts +34 -0
- package/dist/entities/system/CanvasRole.js +45 -0
- package/dist/entities/system/Component.d.ts +1287 -0
- package/dist/entities/system/Component.js +1840 -0
- package/dist/entities/system/Composite.d.ts +12 -0
- package/dist/entities/system/Composite.js +26 -0
- package/dist/entities/system/Device.d.ts +11 -0
- package/dist/entities/system/Device.js +18 -0
- package/dist/entities/system/File.d.ts +72 -0
- package/dist/entities/system/File.js +136 -0
- package/dist/entities/system/Font.d.ts +48 -0
- package/dist/entities/system/Font.js +56 -0
- package/dist/entities/system/GlobalStyle.d.ts +26 -0
- package/dist/entities/system/GlobalStyle.js +54 -0
- package/dist/entities/system/Guidance.d.ts +85 -0
- package/dist/entities/system/Guidance.js +59 -0
- package/dist/entities/system/GuidanceStyle.d.ts +14 -0
- package/dist/entities/system/GuidanceStyle.js +8 -0
- package/dist/entities/system/Icon.d.ts +46 -0
- package/dist/entities/system/Icon.js +46 -0
- package/dist/entities/system/LinkedSystem.d.ts +504 -0
- package/dist/entities/system/LinkedSystem.js +814 -0
- package/dist/entities/system/Modifier.d.ts +92 -0
- package/dist/entities/system/Modifier.js +120 -0
- package/dist/entities/system/Motion.d.ts +28 -0
- package/dist/entities/system/Motion.js +48 -0
- package/dist/entities/system/Operation.d.ts +100 -0
- package/dist/entities/system/Operation.js +236 -0
- package/dist/entities/system/Package.d.ts +42 -0
- package/dist/entities/system/Package.js +75 -0
- package/dist/entities/system/Settings.d.ts +94 -0
- package/dist/entities/system/Settings.js +166 -0
- package/dist/entities/system/StyleProperty.d.ts +135 -0
- package/dist/entities/system/StyleProperty.js +438 -0
- package/dist/entities/system/Token.d.ts +67 -0
- package/dist/entities/system/Token.js +129 -0
- package/dist/entities/system/Tool.d.ts +134 -0
- package/dist/entities/system/Tool.js +124 -0
- package/dist/entities/system/color.d.ts +64 -0
- package/dist/entities/system/color.js +123 -0
- package/dist/entities/system/component-module.d.ts +63 -0
- package/dist/entities/system/component-module.js +258 -0
- package/dist/entities/system/copy-plan.d.ts +98 -0
- package/dist/entities/system/copy-plan.js +451 -0
- package/dist/entities/system/defineComponent.d.ts +428 -0
- package/dist/entities/system/defineComponent.js +337 -0
- package/dist/entities/system/element.d.ts +101 -0
- package/dist/entities/system/element.js +171 -0
- package/dist/entities/system/icon-library.d.ts +64 -0
- package/dist/entities/system/icon-library.js +112 -0
- package/dist/entities/system/icon-metadata.d.ts +72 -0
- package/dist/entities/system/icon-metadata.js +111 -0
- package/dist/entities/system/link-declaration.d.ts +27 -0
- package/dist/entities/system/link-declaration.js +64 -0
- package/dist/entities/system/link-plan.d.ts +160 -0
- package/dist/entities/system/link-plan.js +770 -0
- package/dist/entities/system/runtime-modules.d.ts +25 -0
- package/dist/entities/system/runtime-modules.js +38 -0
- package/dist/entities/system/style-bag.d.ts +20 -0
- package/dist/entities/system/style-bag.js +246 -0
- package/dist/entities/system/token-index.d.ts +89 -0
- package/dist/entities/system/token-index.js +112 -0
- package/dist/framework/Config.d.ts +2472 -0
- package/dist/framework/Config.js +5023 -0
- package/dist/framework/Entity.d.ts +127 -0
- package/dist/framework/Entity.js +125 -0
- package/dist/framework/authoring.d.ts +24 -0
- package/dist/framework/authoring.js +7 -0
- package/dist/framework/change-hooks.d.ts +119 -0
- package/dist/framework/change-hooks.js +131 -0
- package/dist/framework/changes.d.ts +88 -0
- package/dist/framework/changes.js +246 -0
- package/dist/framework/class-names.d.ts +260 -0
- package/dist/framework/class-names.js +630 -0
- package/dist/framework/coalesce.d.ts +25 -0
- package/dist/framework/coalesce.js +60 -0
- package/dist/framework/config-op.d.ts +76 -0
- package/dist/framework/config-op.js +43 -0
- package/dist/framework/config-operation-kind.d.ts +14 -0
- package/dist/framework/config-operation-kind.js +14 -0
- package/dist/framework/config-ops.d.ts +34 -0
- package/dist/framework/config-ops.js +187 -0
- package/dist/framework/defineConfig.d.ts +196 -0
- package/dist/framework/defineConfig.js +100 -0
- package/dist/framework/defineDerivedEntity.d.ts +74 -0
- package/dist/framework/defineDerivedEntity.js +83 -0
- package/dist/framework/defineEntity.d.ts +318 -0
- package/dist/framework/defineEntity.js +183 -0
- package/dist/framework/defineSubEntity.d.ts +148 -0
- package/dist/framework/defineSubEntity.js +121 -0
- package/dist/framework/derived-mutations.d.ts +20 -0
- package/dist/framework/derived-mutations.js +38 -0
- package/dist/framework/entity-search.d.ts +29 -0
- package/dist/framework/entity-search.js +117 -0
- package/dist/framework/inline-sources.d.ts +49 -0
- package/dist/framework/inline-sources.js +388 -0
- package/dist/framework/layer-styles.d.ts +25 -0
- package/dist/framework/layer-styles.js +49 -0
- package/dist/framework/memo.d.ts +48 -0
- package/dist/framework/memo.js +84 -0
- package/dist/framework/overlay.d.ts +49 -0
- package/dist/framework/overlay.js +17 -0
- package/dist/framework/plan.d.ts +49 -0
- package/dist/framework/plan.js +73 -0
- package/dist/framework/projections.d.ts +480 -0
- package/dist/framework/projections.js +974 -0
- package/dist/framework/prop-surface.d.ts +132 -0
- package/dist/framework/prop-surface.js +278 -0
- package/dist/framework/ref-graph.d.ts +71 -0
- package/dist/framework/ref-graph.js +158 -0
- package/dist/framework/ref-integrity.d.ts +55 -0
- package/dist/framework/ref-integrity.js +171 -0
- package/dist/framework/registered.d.ts +95 -0
- package/dist/framework/registry-dir.d.ts +42 -0
- package/dist/framework/registry-dir.js +48 -0
- package/dist/framework/registry.d.ts +300 -0
- package/dist/framework/registry.js +104 -0
- package/dist/framework/rejection.d.ts +58 -0
- package/dist/framework/rejection.js +111 -0
- package/dist/framework/rename-inference.d.ts +26 -0
- package/dist/framework/rename-inference.js +50 -0
- package/dist/framework/render-spec.d.ts +296 -0
- package/dist/framework/render-spec.js +809 -0
- package/dist/framework/schema-version.d.ts +140 -0
- package/dist/framework/schema-version.js +214 -0
- package/dist/framework/schemas.d.ts +109 -0
- package/dist/framework/schemas.js +615 -0
- package/dist/framework/session.d.ts +196 -0
- package/dist/framework/session.js +367 -0
- package/dist/framework/signature.d.ts +15 -0
- package/dist/framework/signature.js +83 -0
- package/dist/framework/snapshot.d.ts +115 -0
- package/dist/framework/snapshot.js +277 -0
- package/dist/framework/source-integrity.d.ts +226 -0
- package/dist/framework/source-integrity.js +478 -0
- package/dist/framework/sources.d.ts +211 -0
- package/dist/framework/sources.js +89 -0
- package/dist/framework/utils/compiled-schema.d.ts +23 -0
- package/dist/framework/utils/compiled-schema.js +46 -0
- package/dist/framework/utils/content-key.d.ts +15 -0
- package/dist/framework/utils/content-key.js +33 -0
- package/dist/framework/utils/enumerated.d.ts +13 -0
- package/dist/framework/utils/enumerated.js +19 -0
- package/dist/framework/utils/field-path.d.ts +95 -0
- package/dist/framework/utils/field-path.js +136 -0
- package/dist/framework/utils/field-schema.d.ts +55 -0
- package/dist/framework/utils/field-schema.js +183 -0
- package/dist/framework/utils/group.d.ts +37 -0
- package/dist/framework/utils/group.js +13 -0
- package/dist/framework/utils/package-path.d.ts +37 -0
- package/dist/framework/utils/package-path.js +61 -0
- package/dist/framework/utils/refs.d.ts +194 -0
- package/dist/framework/utils/refs.js +403 -0
- package/dist/framework/validate-spec.d.ts +27 -0
- package/dist/framework/validate-spec.js +45 -0
- package/dist/framework/value-domain.d.ts +26 -0
- package/dist/framework/value-domain.js +202 -0
- package/dist/framework/views-facade.d.ts +15 -0
- package/dist/framework/views-facade.js +19 -0
- package/dist/index.d.ts +90 -42
- package/dist/index.js +86 -37
- package/dist/migrations/2.0.0/raw-css.d.ts +11 -0
- package/dist/migrations/2.0.0/raw-css.js +72 -0
- package/dist/migrations/2.0.0/v1-artifact.d.ts +1559 -0
- package/dist/migrations/2.0.0/v1-artifact.js +1018 -0
- package/dist/migrations/20260908171448_settings_as_kind.d.ts +22 -0
- package/dist/migrations/20260908171448_settings_as_kind.js +89 -0
- package/dist/migrations/20260908194245_visible_state_pointer.d.ts +19 -0
- package/dist/migrations/20260908194245_visible_state_pointer.js +115 -0
- package/dist/migrations/20260909183001_icon_knockout_variants.d.ts +18 -0
- package/dist/migrations/20260909183001_icon_knockout_variants.js +8 -0
- package/dist/migrations/20260910212453_linked_system_link_ops.d.ts +13 -0
- package/dist/migrations/20260910212453_linked_system_link_ops.js +8 -0
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.js +2 -0
- package/dist/react-native/style-keys.generated.d.ts +10 -0
- package/dist/react-native/style-keys.generated.js +167 -0
- package/dist/renderer/RendererErrorBoundary.d.ts +32 -5
- package/dist/renderer/RendererErrorBoundary.js +59 -10
- package/dist/renderer/UdsRenderer.d.ts +11 -10
- package/dist/renderer/UdsRenderer.js +1 -1
- package/dist/renderer/assetEntries.d.ts +37 -0
- package/dist/renderer/assetEntries.js +39 -0
- package/dist/renderer/assetRenderable.d.ts +14 -6
- package/dist/renderer/assetRenderable.js +8 -2
- package/dist/renderer/componentEntry.d.ts +58 -0
- package/dist/renderer/componentEntry.js +71 -0
- package/dist/renderer/icon-library.d.ts +20 -0
- package/dist/renderer/index.d.ts +7 -7
- package/dist/renderer/index.js +5 -5
- package/dist/renderer/primitives/SlotRenderer.d.ts +1 -1
- package/dist/renderer/primitives/SlotRenderer.js +1 -1
- package/dist/renderer/runtimeComponent.d.ts +33 -0
- package/dist/renderer/runtimeComponent.js +113 -0
- package/dist/renderer/spec-content.d.ts +43 -0
- package/dist/renderer/spec-content.js +95 -0
- package/dist/renderer/wrapRegistry.d.ts +22 -37
- package/dist/renderer/wrapRegistry.js +10 -20
- package/dist/renderer/wrappers/event-bridge.js +6 -5
- package/dist/renderer/wrappers/hex-normalize.js +6 -5
- package/dist/renderer/wrappers/html-aliases.d.ts +7 -2
- package/dist/renderer/wrappers/html-aliases.js +36 -19
- package/dist/renderer/wrappers/inline-styles.js +7 -6
- package/dist/spec/asset-jsx.d.ts +18 -5
- package/dist/spec/asset-jsx.js +27 -16
- package/dist/spec/collapse-text-labels.d.ts +5 -15
- package/dist/spec/collapse-text-labels.js +26 -19
- package/dist/spec/empty-node-slots.d.ts +56 -34
- package/dist/spec/empty-node-slots.js +87 -47
- package/dist/spec/index.d.ts +21 -10
- package/dist/spec/index.js +21 -10
- package/dist/spec/jsxToSpec.d.ts +14 -9
- package/dist/spec/jsxToSpec.js +20 -3
- package/dist/spec/preview-elements.d.ts +63 -0
- package/dist/spec/preview-elements.js +89 -0
- package/dist/spec/rewrite-refs.d.ts +58 -0
- package/dist/spec/rewrite-refs.js +250 -0
- package/dist/spec/specToJsx.js +18 -29
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -52
- package/dist/AssetGroup.d.ts +0 -77
- package/dist/AssetGroup.js +0 -125
- package/dist/Component.d.ts +0 -333
- package/dist/Component.js +0 -1061
- package/dist/ComponentGroup.d.ts +0 -22
- package/dist/ComponentGroup.js +0 -51
- package/dist/CompositeStyle.d.ts +0 -30
- package/dist/CompositeStyle.js +0 -59
- package/dist/Config.d.ts +0 -528
- package/dist/Config.js +0 -1712
- package/dist/Mode.d.ts +0 -41
- package/dist/Mode.js +0 -81
- package/dist/Modifier.d.ts +0 -51
- package/dist/Modifier.js +0 -97
- package/dist/MotionDef.d.ts +0 -81
- package/dist/MotionDef.js +0 -212
- package/dist/Props.d.ts +0 -332
- package/dist/Props.js +0 -35
- package/dist/Provider.d.ts +0 -20
- package/dist/Provider.js +0 -14
- package/dist/StyleProp.d.ts +0 -145
- package/dist/StyleProp.js +0 -239
- package/dist/Token.d.ts +0 -76
- package/dist/Token.js +0 -133
- package/dist/TokenGroup.d.ts +0 -33
- package/dist/TokenGroup.js +0 -69
- package/dist/asset-kind.d.ts +0 -55
- package/dist/asset-kind.js +0 -29
- package/dist/asset-value.d.ts +0 -23
- package/dist/asset-value.js +0 -40
- package/dist/brands.d.ts +0 -30
- package/dist/brands.js +0 -20
- package/dist/captureCallerPath.d.ts +0 -48
- package/dist/captureCallerPath.js +0 -95
- package/dist/colorExpressions.d.ts +0 -131
- package/dist/colorExpressions.js +0 -148
- package/dist/component-referrers.d.ts +0 -30
- package/dist/component-referrers.js +0 -40
- package/dist/config-diagnostics.d.ts +0 -21
- package/dist/config-diagnostics.js +0 -12
- package/dist/defineAssetGroup.d.ts +0 -200
- package/dist/defineAssetGroup.js +0 -323
- package/dist/defineProvider.d.ts +0 -29
- package/dist/defineProvider.js +0 -60
- package/dist/element-marker.d.ts +0 -63
- package/dist/element-marker.js +0 -113
- package/dist/entity-utils.d.ts +0 -56
- package/dist/entity-utils.js +0 -105
- package/dist/extension.d.ts +0 -55
- package/dist/extension.js +0 -214
- package/dist/factories.d.ts +0 -863
- package/dist/factories.js +0 -475
- package/dist/font-face.d.ts +0 -25
- package/dist/font-face.js +0 -72
- package/dist/foreign-component-name.d.ts +0 -21
- package/dist/foreign-component-name.js +0 -42
- package/dist/interpolate.d.ts +0 -20
- package/dist/interpolate.js +0 -10
- package/dist/jsx/__fixtures__/cross-component-preview.d.ts +0 -3
- package/dist/jsx/__fixtures__/cross-component-preview.js +0 -15
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -15
- package/dist/jsx/jsx-dev-runtime.js +0 -11
- package/dist/jsx/jsx-runtime.d.ts +0 -48
- package/dist/jsx/jsx-runtime.js +0 -305
- package/dist/linked-system-pins.d.ts +0 -30
- package/dist/linked-system-pins.js +0 -45
- package/dist/linkedNodePrefixes.d.ts +0 -73
- package/dist/linkedNodePrefixes.js +0 -99
- package/dist/markers.d.ts +0 -235
- package/dist/markers.js +0 -70
- package/dist/motion-constants.d.ts +0 -37
- package/dist/motion-constants.js +0 -61
- package/dist/native/NativeConfig.d.ts +0 -56
- package/dist/native/NativeConfig.js +0 -162
- package/dist/native/assets.d.ts +0 -20
- package/dist/native/assets.js +0 -17
- package/dist/native/components.d.ts +0 -139
- package/dist/native/components.js +0 -67
- package/dist/native/index.d.ts +0 -18
- package/dist/native/index.js +0 -17
- package/dist/native/modes.d.ts +0 -10
- package/dist/native/modes.js +0 -11
- package/dist/native/types.d.ts +0 -95
- package/dist/native/types.js +0 -0
- package/dist/native/validation.d.ts +0 -8
- package/dist/native/validation.js +0 -885
- package/dist/native/values.d.ts +0 -7
- package/dist/native/values.js +0 -15
- package/dist/native.d.ts +0 -12
- package/dist/native.js +0 -10
- package/dist/refs.d.ts +0 -204
- package/dist/refs.js +0 -129
- package/dist/registry-aliases.d.ts +0 -33
- package/dist/registry-aliases.js +0 -35
- package/dist/registry-dir.d.ts +0 -22
- package/dist/registry-dir.js +0 -10
- package/dist/renderer/makeRegistry.d.ts +0 -34
- package/dist/renderer/makeRegistry.js +0 -52
- package/dist/renderer/makeUdsRenderer.d.ts +0 -13
- package/dist/renderer/makeUdsRenderer.js +0 -51
- package/dist/renderer/wrappers/component-slots.d.ts +0 -41
- package/dist/renderer/wrappers/component-slots.js +0 -66
- package/dist/renderer/wrappers/slot-resolution.d.ts +0 -25
- package/dist/renderer/wrappers/slot-resolution.js +0 -68
- package/dist/renderer/wrappers/void-elements.d.ts +0 -37
- package/dist/renderer/wrappers/void-elements.js +0 -40
- package/dist/spec/layer-props.d.ts +0 -52
- package/dist/spec/layer-props.js +0 -149
- package/dist/spec/preview-controls.d.ts +0 -44
- package/dist/spec/preview-controls.js +0 -139
- package/dist/spec/slot-refs.d.ts +0 -39
- package/dist/spec/slot-refs.js +0 -56
- package/dist/token-override-rows.d.ts +0 -68
- package/dist/token-override-rows.js +0 -233
- package/dist/tokenValueType.d.ts +0 -34
- package/dist/tokenValueType.js +0 -138
- package/dist/types/css-properties.d.ts +0 -233
- package/dist/types/css-properties.js +0 -14
- package/dist/types/css-property-keywords.d.ts +0 -156
- package/dist/types/css-property-keywords.js +0 -616
- package/dist/types/css-values.d.ts +0 -63
- package/dist/types/css-values.js +0 -16
- package/dist/types.d.ts +0 -1138
- package/dist/types.js +0 -12
- package/dist/units.d.ts +0 -14
- package/dist/units.js +0 -16
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -4
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { Ref } from "../../framework/utils/refs.js";
|
|
2
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
3
|
+
import { Config } from "../../framework/Config.js";
|
|
4
|
+
import { StylePropValue } from "../system/StyleProperty.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
//#region src/entities/native/NativeStyleProperty.d.ts
|
|
8
|
+
/** One React Native style key, as RN's own types declare them. */
|
|
9
|
+
declare const rnStyleKey: z.ZodEnum<{
|
|
10
|
+
filter: "filter";
|
|
11
|
+
transform: "transform";
|
|
12
|
+
position: "position";
|
|
13
|
+
end: "end";
|
|
14
|
+
start: "start";
|
|
15
|
+
bottom: "bottom";
|
|
16
|
+
left: "left";
|
|
17
|
+
right: "right";
|
|
18
|
+
top: "top";
|
|
19
|
+
color: "color";
|
|
20
|
+
inset: "inset";
|
|
21
|
+
flex: "flex";
|
|
22
|
+
cursor: "cursor";
|
|
23
|
+
direction: "direction";
|
|
24
|
+
display: "display";
|
|
25
|
+
gap: "gap";
|
|
26
|
+
height: "height";
|
|
27
|
+
isolation: "isolation";
|
|
28
|
+
margin: "margin";
|
|
29
|
+
opacity: "opacity";
|
|
30
|
+
overflow: "overflow";
|
|
31
|
+
padding: "padding";
|
|
32
|
+
width: "width";
|
|
33
|
+
alignContent: "alignContent";
|
|
34
|
+
alignItems: "alignItems";
|
|
35
|
+
alignSelf: "alignSelf";
|
|
36
|
+
aspectRatio: "aspectRatio";
|
|
37
|
+
backfaceVisibility: "backfaceVisibility";
|
|
38
|
+
backgroundColor: "backgroundColor";
|
|
39
|
+
borderBlockColor: "borderBlockColor";
|
|
40
|
+
borderBlockEndColor: "borderBlockEndColor";
|
|
41
|
+
borderBlockStartColor: "borderBlockStartColor";
|
|
42
|
+
borderBottomColor: "borderBottomColor";
|
|
43
|
+
borderBottomEndRadius: "borderBottomEndRadius";
|
|
44
|
+
borderBottomLeftRadius: "borderBottomLeftRadius";
|
|
45
|
+
borderBottomRightRadius: "borderBottomRightRadius";
|
|
46
|
+
borderBottomStartRadius: "borderBottomStartRadius";
|
|
47
|
+
borderBottomWidth: "borderBottomWidth";
|
|
48
|
+
borderColor: "borderColor";
|
|
49
|
+
borderCurve: "borderCurve";
|
|
50
|
+
borderEndColor: "borderEndColor";
|
|
51
|
+
borderEndEndRadius: "borderEndEndRadius";
|
|
52
|
+
borderEndStartRadius: "borderEndStartRadius";
|
|
53
|
+
borderEndWidth: "borderEndWidth";
|
|
54
|
+
borderLeftColor: "borderLeftColor";
|
|
55
|
+
borderLeftWidth: "borderLeftWidth";
|
|
56
|
+
borderRadius: "borderRadius";
|
|
57
|
+
borderRightColor: "borderRightColor";
|
|
58
|
+
borderRightWidth: "borderRightWidth";
|
|
59
|
+
borderStartColor: "borderStartColor";
|
|
60
|
+
borderStartEndRadius: "borderStartEndRadius";
|
|
61
|
+
borderStartStartRadius: "borderStartStartRadius";
|
|
62
|
+
borderStartWidth: "borderStartWidth";
|
|
63
|
+
borderStyle: "borderStyle";
|
|
64
|
+
borderTopColor: "borderTopColor";
|
|
65
|
+
borderTopEndRadius: "borderTopEndRadius";
|
|
66
|
+
borderTopLeftRadius: "borderTopLeftRadius";
|
|
67
|
+
borderTopRightRadius: "borderTopRightRadius";
|
|
68
|
+
borderTopStartRadius: "borderTopStartRadius";
|
|
69
|
+
borderTopWidth: "borderTopWidth";
|
|
70
|
+
borderWidth: "borderWidth";
|
|
71
|
+
boxShadow: "boxShadow";
|
|
72
|
+
boxSizing: "boxSizing";
|
|
73
|
+
columnGap: "columnGap";
|
|
74
|
+
elevation: "elevation";
|
|
75
|
+
experimental_backgroundImage: "experimental_backgroundImage";
|
|
76
|
+
experimental_backgroundPosition: "experimental_backgroundPosition";
|
|
77
|
+
experimental_backgroundRepeat: "experimental_backgroundRepeat";
|
|
78
|
+
experimental_backgroundSize: "experimental_backgroundSize";
|
|
79
|
+
flexBasis: "flexBasis";
|
|
80
|
+
flexDirection: "flexDirection";
|
|
81
|
+
flexGrow: "flexGrow";
|
|
82
|
+
flexShrink: "flexShrink";
|
|
83
|
+
flexWrap: "flexWrap";
|
|
84
|
+
fontFamily: "fontFamily";
|
|
85
|
+
fontSize: "fontSize";
|
|
86
|
+
fontStyle: "fontStyle";
|
|
87
|
+
fontVariant: "fontVariant";
|
|
88
|
+
fontWeight: "fontWeight";
|
|
89
|
+
includeFontPadding: "includeFontPadding";
|
|
90
|
+
insetBlock: "insetBlock";
|
|
91
|
+
insetBlockEnd: "insetBlockEnd";
|
|
92
|
+
insetBlockStart: "insetBlockStart";
|
|
93
|
+
insetInline: "insetInline";
|
|
94
|
+
insetInlineEnd: "insetInlineEnd";
|
|
95
|
+
insetInlineStart: "insetInlineStart";
|
|
96
|
+
justifyContent: "justifyContent";
|
|
97
|
+
letterSpacing: "letterSpacing";
|
|
98
|
+
lineHeight: "lineHeight";
|
|
99
|
+
marginBlock: "marginBlock";
|
|
100
|
+
marginBlockEnd: "marginBlockEnd";
|
|
101
|
+
marginBlockStart: "marginBlockStart";
|
|
102
|
+
marginBottom: "marginBottom";
|
|
103
|
+
marginEnd: "marginEnd";
|
|
104
|
+
marginHorizontal: "marginHorizontal";
|
|
105
|
+
marginInline: "marginInline";
|
|
106
|
+
marginInlineEnd: "marginInlineEnd";
|
|
107
|
+
marginInlineStart: "marginInlineStart";
|
|
108
|
+
marginLeft: "marginLeft";
|
|
109
|
+
marginRight: "marginRight";
|
|
110
|
+
marginStart: "marginStart";
|
|
111
|
+
marginTop: "marginTop";
|
|
112
|
+
marginVertical: "marginVertical";
|
|
113
|
+
maxHeight: "maxHeight";
|
|
114
|
+
maxWidth: "maxWidth";
|
|
115
|
+
minHeight: "minHeight";
|
|
116
|
+
minWidth: "minWidth";
|
|
117
|
+
mixBlendMode: "mixBlendMode";
|
|
118
|
+
objectFit: "objectFit";
|
|
119
|
+
outlineColor: "outlineColor";
|
|
120
|
+
outlineOffset: "outlineOffset";
|
|
121
|
+
outlineStyle: "outlineStyle";
|
|
122
|
+
outlineWidth: "outlineWidth";
|
|
123
|
+
overlayColor: "overlayColor";
|
|
124
|
+
paddingBlock: "paddingBlock";
|
|
125
|
+
paddingBlockEnd: "paddingBlockEnd";
|
|
126
|
+
paddingBlockStart: "paddingBlockStart";
|
|
127
|
+
paddingBottom: "paddingBottom";
|
|
128
|
+
paddingEnd: "paddingEnd";
|
|
129
|
+
paddingHorizontal: "paddingHorizontal";
|
|
130
|
+
paddingInline: "paddingInline";
|
|
131
|
+
paddingInlineEnd: "paddingInlineEnd";
|
|
132
|
+
paddingInlineStart: "paddingInlineStart";
|
|
133
|
+
paddingLeft: "paddingLeft";
|
|
134
|
+
paddingRight: "paddingRight";
|
|
135
|
+
paddingStart: "paddingStart";
|
|
136
|
+
paddingTop: "paddingTop";
|
|
137
|
+
paddingVertical: "paddingVertical";
|
|
138
|
+
pointerEvents: "pointerEvents";
|
|
139
|
+
resizeMode: "resizeMode";
|
|
140
|
+
rotation: "rotation";
|
|
141
|
+
rowGap: "rowGap";
|
|
142
|
+
scaleX: "scaleX";
|
|
143
|
+
scaleY: "scaleY";
|
|
144
|
+
shadowColor: "shadowColor";
|
|
145
|
+
shadowOffset: "shadowOffset";
|
|
146
|
+
shadowOpacity: "shadowOpacity";
|
|
147
|
+
shadowRadius: "shadowRadius";
|
|
148
|
+
textAlign: "textAlign";
|
|
149
|
+
textAlignVertical: "textAlignVertical";
|
|
150
|
+
textDecorationColor: "textDecorationColor";
|
|
151
|
+
textDecorationLine: "textDecorationLine";
|
|
152
|
+
textDecorationStyle: "textDecorationStyle";
|
|
153
|
+
textShadowColor: "textShadowColor";
|
|
154
|
+
textShadowOffset: "textShadowOffset";
|
|
155
|
+
textShadowRadius: "textShadowRadius";
|
|
156
|
+
textTransform: "textTransform";
|
|
157
|
+
tintColor: "tintColor";
|
|
158
|
+
transformMatrix: "transformMatrix";
|
|
159
|
+
transformOrigin: "transformOrigin";
|
|
160
|
+
translateX: "translateX";
|
|
161
|
+
translateY: "translateY";
|
|
162
|
+
userSelect: "userSelect";
|
|
163
|
+
verticalAlign: "verticalAlign";
|
|
164
|
+
writingDirection: "writingDirection";
|
|
165
|
+
zIndex: "zIndex";
|
|
166
|
+
}>;
|
|
167
|
+
declare const NativeStyleProperty: EntityClass<z.ZodObject<Omit<{
|
|
168
|
+
properties: z.ZodArray<z.ZodString>;
|
|
169
|
+
values: z.ZodOptional<z.ZodArray<z.ZodType<StylePropValue, unknown, z.core.$ZodTypeInternals<StylePropValue, unknown>>>>;
|
|
170
|
+
responsive: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
classPrefix: z.ZodOptional<z.ZodString>;
|
|
172
|
+
arbitrary: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
+
negates: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
opacityOf: z.ZodOptional<z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>>;
|
|
175
|
+
}, "values" | "properties" | "classPrefix"> & {
|
|
176
|
+
properties: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
|
|
177
|
+
filter: "filter";
|
|
178
|
+
transform: "transform";
|
|
179
|
+
position: "position";
|
|
180
|
+
end: "end";
|
|
181
|
+
start: "start";
|
|
182
|
+
bottom: "bottom";
|
|
183
|
+
left: "left";
|
|
184
|
+
right: "right";
|
|
185
|
+
top: "top";
|
|
186
|
+
color: "color";
|
|
187
|
+
inset: "inset";
|
|
188
|
+
flex: "flex";
|
|
189
|
+
cursor: "cursor";
|
|
190
|
+
direction: "direction";
|
|
191
|
+
display: "display";
|
|
192
|
+
gap: "gap";
|
|
193
|
+
height: "height";
|
|
194
|
+
isolation: "isolation";
|
|
195
|
+
margin: "margin";
|
|
196
|
+
opacity: "opacity";
|
|
197
|
+
overflow: "overflow";
|
|
198
|
+
padding: "padding";
|
|
199
|
+
width: "width";
|
|
200
|
+
alignContent: "alignContent";
|
|
201
|
+
alignItems: "alignItems";
|
|
202
|
+
alignSelf: "alignSelf";
|
|
203
|
+
aspectRatio: "aspectRatio";
|
|
204
|
+
backfaceVisibility: "backfaceVisibility";
|
|
205
|
+
backgroundColor: "backgroundColor";
|
|
206
|
+
borderBlockColor: "borderBlockColor";
|
|
207
|
+
borderBlockEndColor: "borderBlockEndColor";
|
|
208
|
+
borderBlockStartColor: "borderBlockStartColor";
|
|
209
|
+
borderBottomColor: "borderBottomColor";
|
|
210
|
+
borderBottomEndRadius: "borderBottomEndRadius";
|
|
211
|
+
borderBottomLeftRadius: "borderBottomLeftRadius";
|
|
212
|
+
borderBottomRightRadius: "borderBottomRightRadius";
|
|
213
|
+
borderBottomStartRadius: "borderBottomStartRadius";
|
|
214
|
+
borderBottomWidth: "borderBottomWidth";
|
|
215
|
+
borderColor: "borderColor";
|
|
216
|
+
borderCurve: "borderCurve";
|
|
217
|
+
borderEndColor: "borderEndColor";
|
|
218
|
+
borderEndEndRadius: "borderEndEndRadius";
|
|
219
|
+
borderEndStartRadius: "borderEndStartRadius";
|
|
220
|
+
borderEndWidth: "borderEndWidth";
|
|
221
|
+
borderLeftColor: "borderLeftColor";
|
|
222
|
+
borderLeftWidth: "borderLeftWidth";
|
|
223
|
+
borderRadius: "borderRadius";
|
|
224
|
+
borderRightColor: "borderRightColor";
|
|
225
|
+
borderRightWidth: "borderRightWidth";
|
|
226
|
+
borderStartColor: "borderStartColor";
|
|
227
|
+
borderStartEndRadius: "borderStartEndRadius";
|
|
228
|
+
borderStartStartRadius: "borderStartStartRadius";
|
|
229
|
+
borderStartWidth: "borderStartWidth";
|
|
230
|
+
borderStyle: "borderStyle";
|
|
231
|
+
borderTopColor: "borderTopColor";
|
|
232
|
+
borderTopEndRadius: "borderTopEndRadius";
|
|
233
|
+
borderTopLeftRadius: "borderTopLeftRadius";
|
|
234
|
+
borderTopRightRadius: "borderTopRightRadius";
|
|
235
|
+
borderTopStartRadius: "borderTopStartRadius";
|
|
236
|
+
borderTopWidth: "borderTopWidth";
|
|
237
|
+
borderWidth: "borderWidth";
|
|
238
|
+
boxShadow: "boxShadow";
|
|
239
|
+
boxSizing: "boxSizing";
|
|
240
|
+
columnGap: "columnGap";
|
|
241
|
+
elevation: "elevation";
|
|
242
|
+
experimental_backgroundImage: "experimental_backgroundImage";
|
|
243
|
+
experimental_backgroundPosition: "experimental_backgroundPosition";
|
|
244
|
+
experimental_backgroundRepeat: "experimental_backgroundRepeat";
|
|
245
|
+
experimental_backgroundSize: "experimental_backgroundSize";
|
|
246
|
+
flexBasis: "flexBasis";
|
|
247
|
+
flexDirection: "flexDirection";
|
|
248
|
+
flexGrow: "flexGrow";
|
|
249
|
+
flexShrink: "flexShrink";
|
|
250
|
+
flexWrap: "flexWrap";
|
|
251
|
+
fontFamily: "fontFamily";
|
|
252
|
+
fontSize: "fontSize";
|
|
253
|
+
fontStyle: "fontStyle";
|
|
254
|
+
fontVariant: "fontVariant";
|
|
255
|
+
fontWeight: "fontWeight";
|
|
256
|
+
includeFontPadding: "includeFontPadding";
|
|
257
|
+
insetBlock: "insetBlock";
|
|
258
|
+
insetBlockEnd: "insetBlockEnd";
|
|
259
|
+
insetBlockStart: "insetBlockStart";
|
|
260
|
+
insetInline: "insetInline";
|
|
261
|
+
insetInlineEnd: "insetInlineEnd";
|
|
262
|
+
insetInlineStart: "insetInlineStart";
|
|
263
|
+
justifyContent: "justifyContent";
|
|
264
|
+
letterSpacing: "letterSpacing";
|
|
265
|
+
lineHeight: "lineHeight";
|
|
266
|
+
marginBlock: "marginBlock";
|
|
267
|
+
marginBlockEnd: "marginBlockEnd";
|
|
268
|
+
marginBlockStart: "marginBlockStart";
|
|
269
|
+
marginBottom: "marginBottom";
|
|
270
|
+
marginEnd: "marginEnd";
|
|
271
|
+
marginHorizontal: "marginHorizontal";
|
|
272
|
+
marginInline: "marginInline";
|
|
273
|
+
marginInlineEnd: "marginInlineEnd";
|
|
274
|
+
marginInlineStart: "marginInlineStart";
|
|
275
|
+
marginLeft: "marginLeft";
|
|
276
|
+
marginRight: "marginRight";
|
|
277
|
+
marginStart: "marginStart";
|
|
278
|
+
marginTop: "marginTop";
|
|
279
|
+
marginVertical: "marginVertical";
|
|
280
|
+
maxHeight: "maxHeight";
|
|
281
|
+
maxWidth: "maxWidth";
|
|
282
|
+
minHeight: "minHeight";
|
|
283
|
+
minWidth: "minWidth";
|
|
284
|
+
mixBlendMode: "mixBlendMode";
|
|
285
|
+
objectFit: "objectFit";
|
|
286
|
+
outlineColor: "outlineColor";
|
|
287
|
+
outlineOffset: "outlineOffset";
|
|
288
|
+
outlineStyle: "outlineStyle";
|
|
289
|
+
outlineWidth: "outlineWidth";
|
|
290
|
+
overlayColor: "overlayColor";
|
|
291
|
+
paddingBlock: "paddingBlock";
|
|
292
|
+
paddingBlockEnd: "paddingBlockEnd";
|
|
293
|
+
paddingBlockStart: "paddingBlockStart";
|
|
294
|
+
paddingBottom: "paddingBottom";
|
|
295
|
+
paddingEnd: "paddingEnd";
|
|
296
|
+
paddingHorizontal: "paddingHorizontal";
|
|
297
|
+
paddingInline: "paddingInline";
|
|
298
|
+
paddingInlineEnd: "paddingInlineEnd";
|
|
299
|
+
paddingInlineStart: "paddingInlineStart";
|
|
300
|
+
paddingLeft: "paddingLeft";
|
|
301
|
+
paddingRight: "paddingRight";
|
|
302
|
+
paddingStart: "paddingStart";
|
|
303
|
+
paddingTop: "paddingTop";
|
|
304
|
+
paddingVertical: "paddingVertical";
|
|
305
|
+
pointerEvents: "pointerEvents";
|
|
306
|
+
resizeMode: "resizeMode";
|
|
307
|
+
rotation: "rotation";
|
|
308
|
+
rowGap: "rowGap";
|
|
309
|
+
scaleX: "scaleX";
|
|
310
|
+
scaleY: "scaleY";
|
|
311
|
+
shadowColor: "shadowColor";
|
|
312
|
+
shadowOffset: "shadowOffset";
|
|
313
|
+
shadowOpacity: "shadowOpacity";
|
|
314
|
+
shadowRadius: "shadowRadius";
|
|
315
|
+
textAlign: "textAlign";
|
|
316
|
+
textAlignVertical: "textAlignVertical";
|
|
317
|
+
textDecorationColor: "textDecorationColor";
|
|
318
|
+
textDecorationLine: "textDecorationLine";
|
|
319
|
+
textDecorationStyle: "textDecorationStyle";
|
|
320
|
+
textShadowColor: "textShadowColor";
|
|
321
|
+
textShadowOffset: "textShadowOffset";
|
|
322
|
+
textShadowRadius: "textShadowRadius";
|
|
323
|
+
textTransform: "textTransform";
|
|
324
|
+
tintColor: "tintColor";
|
|
325
|
+
transformMatrix: "transformMatrix";
|
|
326
|
+
transformOrigin: "transformOrigin";
|
|
327
|
+
translateX: "translateX";
|
|
328
|
+
translateY: "translateY";
|
|
329
|
+
userSelect: "userSelect";
|
|
330
|
+
verticalAlign: "verticalAlign";
|
|
331
|
+
writingDirection: "writingDirection";
|
|
332
|
+
zIndex: "zIndex";
|
|
333
|
+
}>>>;
|
|
334
|
+
values: z.ZodOptional<z.ZodArray<z.ZodType<StylePropValue, unknown, z.core.$ZodTypeInternals<StylePropValue, unknown>>>>;
|
|
335
|
+
}, z.core.$strip>, z.ZodObject<Omit<Record<never, never>, never> & {}, z.core.$strip>, "style-property", {
|
|
336
|
+
readonly rename: {
|
|
337
|
+
readonly to: z.ZodString;
|
|
338
|
+
};
|
|
339
|
+
readonly create: {
|
|
340
|
+
readonly path: z.ZodString;
|
|
341
|
+
readonly description: `Create a style property \u2014 the prop a component exposes for one CSS effect. \`path\` is the prop's JSX name, camelCase (\`borderRadius\`), never a CSS name; the CSS goes in \`properties\`. \`values\` is a ref to a token GROUP (\`${string}\`), which offers every token in it and keeps the prop in step with modes and edits; \`{ "alias": "brand", "value": ${string} }\` offers one token under a name of the prop's own; a literal (\`"row"\`, \`{ "alias": "full", "value": "9999px" }\`) is for a keyword the system has no token for. Restating a token's value as a literal instead of referencing it is refused.`;
|
|
342
|
+
readonly example: ({
|
|
343
|
+
config
|
|
344
|
+
}: {
|
|
345
|
+
config: Config;
|
|
346
|
+
kind: string;
|
|
347
|
+
path: string;
|
|
348
|
+
}) => {
|
|
349
|
+
path: string;
|
|
350
|
+
data: Record<string, unknown>;
|
|
351
|
+
} | undefined;
|
|
352
|
+
};
|
|
353
|
+
}, Record<never, never>, false>;
|
|
354
|
+
//#endregion
|
|
355
|
+
export { NativeStyleProperty, rnStyleKey };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StyleProperty, stylePropValueSchema } from "../system/StyleProperty.js";
|
|
2
|
+
import { RN_STYLE_KEYS } from "../../react-native/style-keys.generated.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/entities/native/NativeStyleProperty.ts
|
|
5
|
+
/**
|
|
6
|
+
* The native variant of `StyleProperty`. A property names a React Native style key, validated
|
|
7
|
+
* against RN's own vocabulary (`react-native/style-keys.generated.ts`, generated from its type declarations) after a
|
|
8
|
+
* mechanical camel-case pass — so `'background-color'` authors fine and stores as
|
|
9
|
+
* `'backgroundColor'`, while `'grid-template-columns'` is refused by the platform instead of
|
|
10
|
+
* silently emitted into a theme nothing reads.
|
|
11
|
+
*
|
|
12
|
+
* Camel-casing is the only transform, deliberately: a mapping table (`margin-inline` →
|
|
13
|
+
* `marginHorizontal`) would be our judgment, hand-maintained — the native catalog authors native
|
|
14
|
+
* names directly. `classPrefix` is removed: it names emitted CSS classes, and native emits none.
|
|
15
|
+
*/
|
|
16
|
+
const camelize = (property) => property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
17
|
+
/** One React Native style key, as RN's own types declare them. */
|
|
18
|
+
const rnStyleKey = z.enum(RN_STYLE_KEYS);
|
|
19
|
+
const NativeStyleProperty = StyleProperty.extend({
|
|
20
|
+
entityName: "NativeStyleProperty",
|
|
21
|
+
fields: {
|
|
22
|
+
properties: z.array(z.string().transform(camelize).pipe(rnStyleKey)),
|
|
23
|
+
values: z.array(stylePropValueSchema()).optional(),
|
|
24
|
+
classPrefix: null
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { NativeStyleProperty, rnStyleKey };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Ref } from "../../framework/utils/refs.js";
|
|
2
|
+
import { SubEntityClass } from "../../framework/defineSubEntity.js";
|
|
3
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
4
|
+
import { DerivedColor, Gradient } from "../system/color.js";
|
|
5
|
+
import { OverrideCondition } from "../system/Token.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
//#region src/entities/native/NativeToken.d.ts
|
|
9
|
+
declare const nativeTokenValue: z.ZodType<number | boolean | string | Ref | DerivedColor>;
|
|
10
|
+
declare const NativeToken: EntityClass<z.ZodObject<Omit<{
|
|
11
|
+
value: z.ZodType<string | number | Ref | DerivedColor | Gradient, unknown, z.core.$ZodTypeInternals<string | number | Ref | DerivedColor | Gradient, unknown>>;
|
|
12
|
+
type: z.ZodOptional<z.ZodString>;
|
|
13
|
+
overrides: z.ZodOptional<SubEntityClass<z.ZodObject<{
|
|
14
|
+
on: z.ZodType<OverrideCondition, unknown, z.core.$ZodTypeInternals<OverrideCondition, unknown>>;
|
|
15
|
+
value: z.ZodType<string | number | Ref | DerivedColor | Gradient, unknown, z.core.$ZodTypeInternals<string | number | Ref | DerivedColor | Gradient, unknown>>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
}, "value" | "overrides"> & {
|
|
18
|
+
value: z.ZodType<string | number | boolean | Ref | DerivedColor, unknown, z.core.$ZodTypeInternals<string | number | boolean | Ref | DerivedColor, unknown>>;
|
|
19
|
+
overrides: z.ZodOptional<SubEntityClass<z.ZodObject<{
|
|
20
|
+
on: z.ZodType<OverrideCondition, unknown, z.core.$ZodTypeInternals<OverrideCondition, unknown>>;
|
|
21
|
+
value: z.ZodType<string | number | boolean | Ref | DerivedColor, unknown, z.core.$ZodTypeInternals<string | number | boolean | Ref | DerivedColor, unknown>>;
|
|
22
|
+
}, z.core.$strip>>>;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<Omit<{
|
|
24
|
+
cssPrefix: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, "cssPrefix"> & {}, z.core.$strip>, "token", {
|
|
26
|
+
readonly create: {
|
|
27
|
+
readonly description: `Create a token at \`<group>/<name>\` \u2014 \`data.value\` is the CSS value. The first path segment is its group, and a style property takes a whole group as one ref (\`${string}\`), so put the tokens one prop should offer in one group rather than listing values on the prop.`;
|
|
28
|
+
};
|
|
29
|
+
}, Record<never, never>, false>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { NativeToken, nativeTokenValue };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { derivedColor } from "../system/color.js";
|
|
2
|
+
import { Font } from "../system/Font.js";
|
|
3
|
+
import { Token, defineOverride } from "../system/Token.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/entities/native/NativeToken.ts
|
|
6
|
+
/**
|
|
7
|
+
* The native variant of `Token` — same kind, native validation. A value is something React Native
|
|
8
|
+
* can hold: a number (points, opacity, duration), a boolean, a unit string RN itself understands
|
|
9
|
+
* (`'45deg'`, `'50%'`, a hex color, `'transparent'`), an alias to another token, a font-family
|
|
10
|
+
* ref, or a derived color (`mix()`/`alpha()` resolve to a concrete color, so they carry). What
|
|
11
|
+
* deliberately does not validate is web's open string arm — `'1rem'`, `calc(…)`, `'50vh'` mean
|
|
12
|
+
* nothing off the web, and refusing them here is the platform model: the config is the platform,
|
|
13
|
+
* so a native config cannot hold a web value.
|
|
14
|
+
*
|
|
15
|
+
* The `Override` sub-entity is swapped in the same motion (`extend` refuses a half-swap), so a
|
|
16
|
+
* dark-mode override obeys the same value domain as the base value. Inheriting web's Override
|
|
17
|
+
* "for free" would have quietly accepted `'1rem'` under a modifier.
|
|
18
|
+
*/
|
|
19
|
+
/** The string forms native accepts — each one a shape React Native itself parses. Deliberately no
|
|
20
|
+
* bare `z.string()` arm: that is exactly where every web-ism would leak through. Widen only with
|
|
21
|
+
* evidence from a real system's port. */
|
|
22
|
+
const nativeTokenString = z.union([
|
|
23
|
+
z.templateLiteral([z.number(), "deg"]),
|
|
24
|
+
z.templateLiteral([z.number(), "%"]),
|
|
25
|
+
z.string().regex(/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/),
|
|
26
|
+
z.literal("transparent"),
|
|
27
|
+
z.literal("none")
|
|
28
|
+
]);
|
|
29
|
+
const nativeTokenValue = z.union([
|
|
30
|
+
z.number(),
|
|
31
|
+
z.boolean(),
|
|
32
|
+
nativeTokenString,
|
|
33
|
+
Token,
|
|
34
|
+
Font,
|
|
35
|
+
derivedColor
|
|
36
|
+
]);
|
|
37
|
+
/** `Token`'s Override over the native value domain: the same condition and the same derived key. */
|
|
38
|
+
const NativeOverride = defineOverride(nativeTokenValue);
|
|
39
|
+
const NativeToken = Token.extend({
|
|
40
|
+
entityName: "NativeToken",
|
|
41
|
+
fields: {
|
|
42
|
+
value: nativeTokenValue,
|
|
43
|
+
overrides: NativeOverride.optional()
|
|
44
|
+
},
|
|
45
|
+
subEntities: { overrides: NativeOverride },
|
|
46
|
+
groupFields: { cssPrefix: null }
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { NativeToken, nativeTokenValue };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/system/CanvasRole.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The roles a canvas has a tool for — the vocabulary a design system fills in.
|
|
7
|
+
*
|
|
8
|
+
* This is the set of tools an editor offers, and each one is a SLOT: a role a config leaves
|
|
9
|
+
* unregistered has no entries, and its tool is disabled rather than falling back to a guess. So
|
|
10
|
+
* naming a role here offers the slot without asserting anything fills it, and what fills it is
|
|
11
|
+
* never a name the editor chose — it is whichever component the config pointed at.
|
|
12
|
+
*
|
|
13
|
+
* The names live here, with the entity, because the entity is what they are names OF. They were
|
|
14
|
+
* previously kept in `@yahoo/uds-create-platform-types` as a hand-maintained copy, annotated as
|
|
15
|
+
* one ("mirrors `@yahoo/uds-create-config`'s `CanvasRole` union without importing it") — a second
|
|
16
|
+
* source of truth wearing a comment admitting it.
|
|
17
|
+
*/
|
|
18
|
+
declare const CANVAS_ROLES: readonly ["frame", "text", "image"];
|
|
19
|
+
type CanvasRoleName = (typeof CANVAS_ROLES)[number];
|
|
20
|
+
declare const CanvasRole: EntityClass<z.ZodObject<{
|
|
21
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
22
|
+
component: z.ZodObject<{
|
|
23
|
+
__ref: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<Record<never, never>, z.core.$strip>, "canvas-role", {
|
|
29
|
+
readonly create: {
|
|
30
|
+
readonly description: `Register a canvas insert tool for this system. \`path\` is the role, one of ${string}; \`data.entries\` names the components that tool inserts, one marked \`default\`. A system whose roles are unregistered has those canvas tools disabled, so register \`frame\` and \`text\` once a layout primitive and a text primitive exist.`;
|
|
31
|
+
};
|
|
32
|
+
}, Record<never, never>, false>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { CANVAS_ROLES, CanvasRole, CanvasRoleName };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
|
+
import { Component } from "./Component.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/entities/system/CanvasRole.ts
|
|
5
|
+
/**
|
|
6
|
+
* `CanvasRole` — the config-v2 form of old config's `registerCanvasRoles`: maps a canvas INSERT
|
|
7
|
+
* TOOL (a role, keyed by the entity path — `frame`, `text`, …) to the components that tool inserts,
|
|
8
|
+
* each with an optional default flag + default props. A SYSTEM entity; each entry references a
|
|
9
|
+
* system `Component` by ref (so `collectRefs` harvests the canvas-role → component edge for free).
|
|
10
|
+
*
|
|
11
|
+
* system.register(CanvasRole, {
|
|
12
|
+
* frame: { entries: [{ component: Component.ref('Box'), default: true, defaultProps: {…} },
|
|
13
|
+
* { component: Component.ref('HStack') }] },
|
|
14
|
+
* text: { entries: [{ component: Component.ref('Text') }] },
|
|
15
|
+
* });
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The roles a canvas has a tool for — the vocabulary a design system fills in.
|
|
19
|
+
*
|
|
20
|
+
* This is the set of tools an editor offers, and each one is a SLOT: a role a config leaves
|
|
21
|
+
* unregistered has no entries, and its tool is disabled rather than falling back to a guess. So
|
|
22
|
+
* naming a role here offers the slot without asserting anything fills it, and what fills it is
|
|
23
|
+
* never a name the editor chose — it is whichever component the config pointed at.
|
|
24
|
+
*
|
|
25
|
+
* The names live here, with the entity, because the entity is what they are names OF. They were
|
|
26
|
+
* previously kept in `@yahoo/uds-create-platform-types` as a hand-maintained copy, annotated as
|
|
27
|
+
* one ("mirrors `@yahoo/uds-create-config`'s `CanvasRole` union without importing it") — a second
|
|
28
|
+
* source of truth wearing a comment admitting it.
|
|
29
|
+
*/
|
|
30
|
+
const CANVAS_ROLES = [
|
|
31
|
+
"frame",
|
|
32
|
+
"text",
|
|
33
|
+
"image"
|
|
34
|
+
];
|
|
35
|
+
const CanvasRole = defineEntity({
|
|
36
|
+
kind: "canvas-role",
|
|
37
|
+
fields: z.object({ entries: z.array(z.object({
|
|
38
|
+
component: Component.describe("The component this tool inserts, as a ref: `{ \"__ref\": \"component:<path>\" }`."),
|
|
39
|
+
default: z.boolean().optional().describe("The entry the tool inserts when none is chosen; mark one."),
|
|
40
|
+
defaultProps: z.record(z.string(), z.unknown()).optional().describe("Props the inserted component starts with, keyed by prop name.")
|
|
41
|
+
})).describe(`The components a canvas insert tool draws with. The entity's path is the tool: one of ${CANVAS_ROLES.map((role) => `\`${role}\``).join(", ")}. A role with no entity registered has its tool disabled.`) }),
|
|
42
|
+
schemas: { create: { description: `Register a canvas insert tool for this system. \`path\` is the role, one of ${CANVAS_ROLES.map((role) => `\`${role}\``).join(", ")}; \`data.entries\` names the components that tool inserts, one marked \`default\`. A system whose roles are unregistered has those canvas tools disabled, so register \`frame\` and \`text\` once a layout primitive and a text primitive exist.` } }
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { CANVAS_ROLES, CanvasRole };
|