@yahoo/uds-create-config 2.45.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,75 @@
|
|
|
1
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
|
+
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/entities/system/Package.ts
|
|
5
|
+
/**
|
|
6
|
+
* One export a system renders through — `package:react-native#Pressable`.
|
|
7
|
+
*
|
|
8
|
+
* A member rather than an entity of its own, because a `/` cannot separate the module from the export
|
|
9
|
+
* and nothing else can either. `react-native/Pressable` reads as a module and an export only by the
|
|
10
|
+
* CONVENTION that the last segment is the export, and that convention has cases it gets wrong:
|
|
11
|
+
* `motion/react` is a module (`import { motion } from 'motion/react'`) but parses as `motion` plus an
|
|
12
|
+
* export called `react`, and `@phosphor-icons/core` — a catalogue named by an icon library's
|
|
13
|
+
* `metadata` and imported by nobody — parsed as a `core` export of `@phosphor-icons`. The grammar
|
|
14
|
+
* already has the separator that says which is which, so it is used.
|
|
15
|
+
*
|
|
16
|
+
* A member's fields are empty because its identity IS its name: there is nothing else this system
|
|
17
|
+
* knows to be true about somebody else's export. `default` for a default import, `Animated.View` for
|
|
18
|
+
* a dotted one — the name as the TARGET spells it, which is what an emitted import has to write.
|
|
19
|
+
*/
|
|
20
|
+
const PackageExport = defineSubEntity({
|
|
21
|
+
name: "exports",
|
|
22
|
+
label: "Export",
|
|
23
|
+
labelPlural: "Exports",
|
|
24
|
+
fields: z.strictObject({})
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Package (`react-native`, `@ariakit/react`, `motion/react`) — one MODULE a system renders through.
|
|
28
|
+
*
|
|
29
|
+
* **The path IS the specifier**, verbatim, subpath and all — the same choice `File` makes for its src.
|
|
30
|
+
* So there is no `module` field: a second copy of the path could disagree with it, which is the
|
|
31
|
+
* reason a `File` computes its `binary` rather than storing one.
|
|
32
|
+
*
|
|
33
|
+
* Verbatim matters because the stored form has to regenerate the import an author wrote. `motion` and
|
|
34
|
+
* `motion/react` are ONE npm package and TWO modules; emitting `from 'motion'` for a source that
|
|
35
|
+
* wrote `from 'motion/react'` names a different entry point that resolves to a different file. That
|
|
36
|
+
* the two are one thing to INSTALL is a separate question, and the seal is the only place it is asked
|
|
37
|
+
* — `packageName` collapses them there.
|
|
38
|
+
*
|
|
39
|
+
* A key derived from the module — a slug like `ariakit` — is what this replaced. The slug was
|
|
40
|
+
* resolved over the whole import SET so two specifiers sharing a scope could both qualify away from
|
|
41
|
+
* it, which made a key depend on what else happened to be imported: `@phosphor-icons/core` arriving
|
|
42
|
+
* beside `@phosphor-icons/react` renamed the latter and stranded every ref that named it. npm has
|
|
43
|
+
* already made a module name unique; nothing here has to.
|
|
44
|
+
*
|
|
45
|
+
* The same shape `Icon` uses for a glyph library, with one difference in where membership comes from.
|
|
46
|
+
* An icon group lists every glyph the package exports, because a person picks one from a picker and
|
|
47
|
+
* all of them are candidates. A package's exports are only what a render actually placed in JSX,
|
|
48
|
+
* because nobody browses a component library's exports; the build registers them from JSX usage. The
|
|
49
|
+
* MODULE set is broader: it records every external module the render closure needs, which is what
|
|
50
|
+
* makes the portable config the source of truth for consumer install requirements.
|
|
51
|
+
*
|
|
52
|
+
* Ordinary component authoring does not maintain this graph: the build derives modules and exports
|
|
53
|
+
* from the source it walked. A human may still author one — to carry a label, or to pin a `version` —
|
|
54
|
+
* and build collection updates rather than replaces it, so that metadata survives. What authoring
|
|
55
|
+
* cannot do is choose the path.
|
|
56
|
+
*/
|
|
57
|
+
const Package = defineEntity({
|
|
58
|
+
kind: "package",
|
|
59
|
+
label: "Package",
|
|
60
|
+
labelPlural: "Packages",
|
|
61
|
+
emergentGroups: false,
|
|
62
|
+
linkable: ({ config, source }) => config.name === source.name,
|
|
63
|
+
bareMember: "exports",
|
|
64
|
+
fields: z.strictObject({
|
|
65
|
+
/** Pinned at build from the package's own `package.json`, like an icon library's already is.
|
|
66
|
+
* Read from the PACKAGE (`motion`), since that is what has a manifest — a subpath has none. */
|
|
67
|
+
version: z.string().optional(),
|
|
68
|
+
/** The exports a render placed in JSX. Absent for a module nothing names by export: a runtime
|
|
69
|
+
* dependency, or a catalogue read for its data. */
|
|
70
|
+
exports: PackageExport.optional()
|
|
71
|
+
}),
|
|
72
|
+
subEntities: { exports: PackageExport }
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Package };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { SubEntityClass } from "../../framework/defineSubEntity.js";
|
|
2
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
3
|
+
import { Config } from "../../framework/Config.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region src/entities/system/Settings.d.ts
|
|
7
|
+
/** The `system` section — what this config is in Create. */
|
|
8
|
+
declare const SystemSection: SubEntityClass<z.ZodObject<{
|
|
9
|
+
id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strict>>;
|
|
11
|
+
/** The `build` section — where a repo keeps this system's sources, where `uds build` writes, and
|
|
12
|
+
* where linked systems are materialised. */
|
|
13
|
+
declare const BuildSection: SubEntityClass<z.ZodObject<{
|
|
14
|
+
inputDir: z.ZodOptional<z.ZodString>;
|
|
15
|
+
outDir: z.ZodOptional<z.ZodString>;
|
|
16
|
+
registryDir: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
/**
|
|
19
|
+
* One prefix for both namespaces, or one each. A string names classes and variables alike; the object
|
|
20
|
+
* names them apart, for a host page that already owns one of the two. Either form may be `''`, which
|
|
21
|
+
* emits that namespace unprefixed.
|
|
22
|
+
*/
|
|
23
|
+
declare const prefix: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
24
|
+
classNames: z.ZodString;
|
|
25
|
+
variables: z.ZodString;
|
|
26
|
+
}, z.core.$strict>]>;
|
|
27
|
+
type CssPrefix = z.output<typeof prefix>;
|
|
28
|
+
/** The `css` section as a config that set nothing reads it, spelled once. */
|
|
29
|
+
declare const CSS_DEFAULTS: {
|
|
30
|
+
readonly prefix: "uds";
|
|
31
|
+
readonly preflight: true;
|
|
32
|
+
};
|
|
33
|
+
/** The `css` section — how a web system names what it emits and where its stylesheet applies. A
|
|
34
|
+
* native system declares no such section, so a native config setting one is refused. */
|
|
35
|
+
declare const CssSection: SubEntityClass<z.ZodObject<{
|
|
36
|
+
prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
37
|
+
classNames: z.ZodString;
|
|
38
|
+
variables: z.ZodString;
|
|
39
|
+
}, z.core.$strict>]>>;
|
|
40
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
41
|
+
preflight: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
safelist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
/** The two namespaces a prefix names, whichever form it was written in, defaulted when unset. */
|
|
45
|
+
declare function cssPrefixes(value: CssPrefix | undefined): {
|
|
46
|
+
classNames: string;
|
|
47
|
+
variables: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The prefix on every emitted class (`uds`). Shared with codegen, which builds class names that must
|
|
51
|
+
* agree with the ones the projections produce.
|
|
52
|
+
*
|
|
53
|
+
* The prefix belongs to this kind's `css` section, so the reader lives beside it: a config type that
|
|
54
|
+
* emits no stylesheet declares no such section, `get` answers `undefined` there, and the default is
|
|
55
|
+
* what it gets. Callable on any `Config` for that reason.
|
|
56
|
+
*/
|
|
57
|
+
declare const classPrefixOf: (config: Config) => string;
|
|
58
|
+
/** The prefix on every emitted custom property (`--uds-…`). The same setting as the class prefix
|
|
59
|
+
* unless the config names the two apart, for a host page that already owns one namespace. */
|
|
60
|
+
declare const varPrefixOf: (config: Config) => string;
|
|
61
|
+
/** The `playground` section as a config that set nothing reads it, spelled once. */
|
|
62
|
+
declare const PLAYGROUND_DEFAULTS: {
|
|
63
|
+
readonly port: 4321;
|
|
64
|
+
};
|
|
65
|
+
/** The `playground` section — dev-server settings for `uds dev --playground`. */
|
|
66
|
+
declare const PlaygroundSection: SubEntityClass<z.ZodObject<{
|
|
67
|
+
pagesDir: z.ZodOptional<z.ZodString>;
|
|
68
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
declare const Settings: EntityClass<z.ZodObject<{
|
|
71
|
+
system: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
74
|
+
build: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
inputDir: z.ZodOptional<z.ZodString>;
|
|
76
|
+
outDir: z.ZodOptional<z.ZodString>;
|
|
77
|
+
registryDir: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
css: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
81
|
+
classNames: z.ZodString;
|
|
82
|
+
variables: z.ZodString;
|
|
83
|
+
}, z.core.$strict>]>>;
|
|
84
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
85
|
+
preflight: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
safelist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
playground: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
pagesDir: z.ZodOptional<z.ZodString>;
|
|
90
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "settings", Record<never, never>, Record<never, never>, true>;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { BuildSection, CSS_DEFAULTS, CssPrefix, CssSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, varPrefixOf };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { buildFields } from "../../configs/build-options.js";
|
|
2
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
|
+
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/entities/system/Settings.ts
|
|
6
|
+
/**
|
|
7
|
+
* `Settings` — what this config is in Create, how a repo builds and serves it, and how its CSS is
|
|
8
|
+
* named. Values about the config rather than about anything in it, so nothing refs them.
|
|
9
|
+
*
|
|
10
|
+
* One singleton kind, registered like every other: `register({ settings: { css: { prefix: 'acme' } } })`
|
|
11
|
+
* authors it, `Settings.get(config)` reads it, and `settings/update` edits it from a tool with field
|
|
12
|
+
* paths (`{ 'css.prefix': 'acme' }`). Each section is a singleton sub-entity, so it has a label of its
|
|
13
|
+
* own, its own `sub-get/<section>` and `sub-update/<section>`, and a row in the changes list.
|
|
14
|
+
*
|
|
15
|
+
* Every section and every field is optional, and no field carries a schema default. A stored body is
|
|
16
|
+
* exactly what was authored: a default that changes later reaches every system that never set the
|
|
17
|
+
* field, and a clone emits only what the system chose. The defaults are the `*_DEFAULTS` constants
|
|
18
|
+
* beside each section, which the readers fall back to.
|
|
19
|
+
*
|
|
20
|
+
* Not borrowed and not refed today. `linkable: false` is a statement about this kind, not about
|
|
21
|
+
* singletons: a consumer's `link: '*'` must not inherit a source's build directories or CSS prefix.
|
|
22
|
+
*/
|
|
23
|
+
const systemFields = z.strictObject({
|
|
24
|
+
/**
|
|
25
|
+
* `id` is optional, and deliberately not required. A config is authored BEFORE the system exists
|
|
26
|
+
* (`uds create-system` mints the id), so requiring it would make a config un-authorable until after a
|
|
27
|
+
* round trip. It is also environment-coupled — the same config pushed to staging and to production is
|
|
28
|
+
* two systems — so `uds push` still takes its target from `--system` or from the server's repo
|
|
29
|
+
* binding; this does not replace either. What declaring it BUYS is an offline check nothing else can
|
|
30
|
+
* make: a pin naming this same id is a system drawing on itself, and `attachLinkedSources` refuses it
|
|
31
|
+
* by name.
|
|
32
|
+
*/
|
|
33
|
+
id: z.string().uuid().meta({
|
|
34
|
+
title: "System ID",
|
|
35
|
+
description: "This system's id in Create. The default target for `uds push` and remote agent edits, and what lets a build refuse a link back to itself. `uds connect` records the repo binding on the server; this is the copy the repo carries."
|
|
36
|
+
}).optional() });
|
|
37
|
+
/** The `system` section — what this config is in Create. */
|
|
38
|
+
const SystemSection = defineSubEntity({
|
|
39
|
+
name: "system",
|
|
40
|
+
label: "System",
|
|
41
|
+
singleton: true,
|
|
42
|
+
fields: systemFields
|
|
43
|
+
});
|
|
44
|
+
/** The `build` section — where a repo keeps this system's sources, where `uds build` writes, and
|
|
45
|
+
* where linked systems are materialised. */
|
|
46
|
+
const BuildSection = defineSubEntity({
|
|
47
|
+
name: "build",
|
|
48
|
+
label: "Build",
|
|
49
|
+
singleton: true,
|
|
50
|
+
fields: buildFields
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* One prefix for both namespaces, or one each. A string names classes and variables alike; the object
|
|
54
|
+
* names them apart, for a host page that already owns one of the two. Either form may be `''`, which
|
|
55
|
+
* emits that namespace unprefixed.
|
|
56
|
+
*/
|
|
57
|
+
const prefix = z.union([z.string(), z.strictObject({
|
|
58
|
+
classNames: z.string(),
|
|
59
|
+
variables: z.string()
|
|
60
|
+
})]);
|
|
61
|
+
/** The `css` section as a config that set nothing reads it, spelled once. */
|
|
62
|
+
const CSS_DEFAULTS = {
|
|
63
|
+
prefix: "uds",
|
|
64
|
+
preflight: true
|
|
65
|
+
};
|
|
66
|
+
const cssFields = z.strictObject({
|
|
67
|
+
prefix: prefix.meta({
|
|
68
|
+
title: "Prefix",
|
|
69
|
+
description: `The prefix on every emitted class and CSS variable, as in \`uds-flex\` and \`--uds-color-brand\`. One string names both; \`{ classNames, variables }\` names them apart. Empty emits that namespace unprefixed. Two systems on one page need different prefixes. Unset, \`${CSS_DEFAULTS.prefix}\`.`,
|
|
70
|
+
default: CSS_DEFAULTS.prefix
|
|
71
|
+
}).optional(),
|
|
72
|
+
/** A selector the shipped stylesheet is confined to, so its rules cannot reach the page around
|
|
73
|
+
* the element that carries it. Unset, the sheet applies to the page. */
|
|
74
|
+
scope: z.string().min(1).meta({
|
|
75
|
+
title: "Scope",
|
|
76
|
+
description: "A selector the stylesheet is confined to, as in `.yos-app`: every rule nests under it and the token variables land on it instead of the document root. Unset, the stylesheet applies to the whole page."
|
|
77
|
+
}).optional(),
|
|
78
|
+
/** Whether the stylesheet opens with the element resets every rule below is written against. */
|
|
79
|
+
preflight: z.boolean().meta({
|
|
80
|
+
title: "Preflight",
|
|
81
|
+
description: "Start the stylesheet with the element resets, so buttons, inputs and headings begin from the same baseline in every browser. Off, the page keeps its own base styles. Unset, on.",
|
|
82
|
+
default: CSS_DEFAULTS.preflight
|
|
83
|
+
}).optional(),
|
|
84
|
+
/** Classes the stylesheet keeps whether or not a scanned file names them — for a class built at
|
|
85
|
+
* runtime, or one used by a file the build does not scan. */
|
|
86
|
+
safelist: z.array(z.string().min(1)).meta({
|
|
87
|
+
title: "Safelist",
|
|
88
|
+
description: "Classes the stylesheet always keeps, whether or not a scanned file names them, as in `uds-bg-brand`. For a class assembled at runtime, or one used by a file the build does not scan."
|
|
89
|
+
}).optional()
|
|
90
|
+
});
|
|
91
|
+
/** The `css` section — how a web system names what it emits and where its stylesheet applies. A
|
|
92
|
+
* native system declares no such section, so a native config setting one is refused. */
|
|
93
|
+
const CssSection = defineSubEntity({
|
|
94
|
+
name: "css",
|
|
95
|
+
label: "CSS",
|
|
96
|
+
singleton: true,
|
|
97
|
+
fields: cssFields
|
|
98
|
+
});
|
|
99
|
+
/** The two namespaces a prefix names, whichever form it was written in, defaulted when unset. */
|
|
100
|
+
function cssPrefixes(value) {
|
|
101
|
+
if (value === void 0) return {
|
|
102
|
+
classNames: CSS_DEFAULTS.prefix,
|
|
103
|
+
variables: CSS_DEFAULTS.prefix
|
|
104
|
+
};
|
|
105
|
+
if (typeof value === "string") return {
|
|
106
|
+
classNames: value,
|
|
107
|
+
variables: value
|
|
108
|
+
};
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The prefix on every emitted class (`uds`). Shared with codegen, which builds class names that must
|
|
113
|
+
* agree with the ones the projections produce.
|
|
114
|
+
*
|
|
115
|
+
* The prefix belongs to this kind's `css` section, so the reader lives beside it: a config type that
|
|
116
|
+
* emits no stylesheet declares no such section, `get` answers `undefined` there, and the default is
|
|
117
|
+
* what it gets. Callable on any `Config` for that reason.
|
|
118
|
+
*/
|
|
119
|
+
const classPrefixOf = (config) => cssPrefixes(Settings.get(config)?.css?.prefix).classNames;
|
|
120
|
+
/** The prefix on every emitted custom property (`--uds-…`). The same setting as the class prefix
|
|
121
|
+
* unless the config names the two apart, for a host page that already owns one namespace. */
|
|
122
|
+
const varPrefixOf = (config) => cssPrefixes(Settings.get(config)?.css?.prefix).variables;
|
|
123
|
+
/** The `playground` section as a config that set nothing reads it, spelled once. */
|
|
124
|
+
const PLAYGROUND_DEFAULTS = { port: 4321 };
|
|
125
|
+
const playgroundFields = z.strictObject({
|
|
126
|
+
/** A path into the REPO, so it is meaningless in a config read from the database. Kept in the one
|
|
127
|
+
* schema rather than split: settings serialize verbatim, and a stale path is inert. */
|
|
128
|
+
pagesDir: z.string().min(1).meta({
|
|
129
|
+
title: "Pages directory",
|
|
130
|
+
description: "Where `uds dev --playground` finds the pages it serves, relative to the config."
|
|
131
|
+
}).optional(),
|
|
132
|
+
port: z.number().int().meta({
|
|
133
|
+
title: "Port",
|
|
134
|
+
description: `The port the playground dev server listens on. Unset, ${PLAYGROUND_DEFAULTS.port}.`,
|
|
135
|
+
default: PLAYGROUND_DEFAULTS.port
|
|
136
|
+
}).optional()
|
|
137
|
+
});
|
|
138
|
+
/** The `playground` section — dev-server settings for `uds dev --playground`. */
|
|
139
|
+
const PlaygroundSection = defineSubEntity({
|
|
140
|
+
name: "playground",
|
|
141
|
+
label: "Playground",
|
|
142
|
+
singleton: true,
|
|
143
|
+
fields: playgroundFields
|
|
144
|
+
});
|
|
145
|
+
const Settings = defineEntity({
|
|
146
|
+
kind: "settings",
|
|
147
|
+
label: "Settings",
|
|
148
|
+
labelPlural: "Settings",
|
|
149
|
+
singleton: true,
|
|
150
|
+
linkable: false,
|
|
151
|
+
authoredRefs: false,
|
|
152
|
+
fields: z.strictObject({
|
|
153
|
+
system: systemFields.meta({ title: "System" }).optional(),
|
|
154
|
+
build: buildFields.meta({ title: "Build" }).optional(),
|
|
155
|
+
css: cssFields.meta({ title: "CSS" }).optional(),
|
|
156
|
+
playground: playgroundFields.meta({ title: "Playground" }).optional()
|
|
157
|
+
}),
|
|
158
|
+
subEntities: {
|
|
159
|
+
system: SystemSection,
|
|
160
|
+
build: BuildSection,
|
|
161
|
+
css: CssSection,
|
|
162
|
+
playground: PlaygroundSection
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
//#endregion
|
|
166
|
+
export { BuildSection, CSS_DEFAULTS, CssSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, varPrefixOf };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Ref } from "../../framework/utils/refs.js";
|
|
2
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
3
|
+
import { Config } from "../../framework/Config.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region src/entities/system/StyleProperty.d.ts
|
|
7
|
+
/** What a form is built against. Both members are absent when a concrete schema is needed with no
|
|
8
|
+
* body in hand: hydration, `register`, tool derivation. */
|
|
9
|
+
interface StylePropValueCtx {
|
|
10
|
+
readonly config?: Config;
|
|
11
|
+
/** The CSS properties the owning style property writes, for a form that is CSS text. */
|
|
12
|
+
readonly properties?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
declare const STYLE_PROP_VALUE_FORMS: {
|
|
15
|
+
readonly keyword: (ctx?: StylePropValueCtx) => z.ZodString;
|
|
16
|
+
readonly number: (_ctx?: StylePropValueCtx) => z.ZodNumber;
|
|
17
|
+
readonly token: ({
|
|
18
|
+
config
|
|
19
|
+
}?: StylePropValueCtx) => z.ZodObject<{
|
|
20
|
+
__ref: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
readonly tokenGroup: ({
|
|
23
|
+
config
|
|
24
|
+
}?: StylePropValueCtx) => z.ZodObject<{
|
|
25
|
+
__ref: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
readonly flag: (_ctx?: StylePropValueCtx) => z.ZodObject<{
|
|
28
|
+
alias: z.ZodBoolean;
|
|
29
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
30
|
+
__ref: z.ZodString;
|
|
31
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
readonly aliasToken: ({
|
|
34
|
+
config
|
|
35
|
+
}?: StylePropValueCtx) => z.ZodObject<{
|
|
36
|
+
alias: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
37
|
+
value: z.ZodObject<{
|
|
38
|
+
__ref: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
readonly aliasLiteral: (ctx?: StylePropValueCtx) => z.ZodObject<{
|
|
42
|
+
alias: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
readonly aliasDeclarations: (_ctx?: StylePropValueCtx) => z.ZodObject<{
|
|
46
|
+
alias: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
47
|
+
value: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
};
|
|
50
|
+
type Forms = typeof STYLE_PROP_VALUE_FORMS;
|
|
51
|
+
/** A form the record declares. */
|
|
52
|
+
type StylePropValueKind = keyof Forms;
|
|
53
|
+
/** One entry of a style property's `values`, as the config stores it. */
|
|
54
|
+
type StylePropValue = { [K in StylePropValueKind]: z.infer<ReturnType<Forms[K]>> }[StylePropValueKind];
|
|
55
|
+
/** One allowed value as both halves: the leaf a consumer authors and the value it resolves to. A leaf
|
|
56
|
+
* that sets several properties to different things carries them as `declarations`. */
|
|
57
|
+
interface StylePropLeaf {
|
|
58
|
+
readonly leaf: string;
|
|
59
|
+
readonly value: string;
|
|
60
|
+
readonly declarations?: Record<string, string>;
|
|
61
|
+
}
|
|
62
|
+
/** One entry a ref names: the leaf it is called and the qualified path it stores. */
|
|
63
|
+
interface RefMember {
|
|
64
|
+
readonly leaf: string;
|
|
65
|
+
readonly path: string;
|
|
66
|
+
}
|
|
67
|
+
type FormValue<K extends StylePropValueKind> = z.infer<ReturnType<Forms[K]>>;
|
|
68
|
+
/**
|
|
69
|
+
* What each form's stored entry stands for as leaves. `members` expands a ref to what it names, one
|
|
70
|
+
* entry for an item and one per member for a folder, since that walk is the config's. A flag's
|
|
71
|
+
* `true` is the bare prop, an empty leaf so the class is its prefix; `false` is its absence and
|
|
72
|
+
* authors nothing. A numeric alias is a leaf once it is a string: `6` names `.uds-grid-cols-6`.
|
|
73
|
+
*/
|
|
74
|
+
declare const STYLE_PROP_VALUE_LEAVES: { readonly [K in StylePropValueKind]: (entry: FormValue<K>, members: (target: Ref) => readonly RefMember[]) => StylePropLeaf[] };
|
|
75
|
+
/** The leaves one stored entry stands for; none for a value no form admits. */
|
|
76
|
+
declare function leavesOfStylePropValue(entry: unknown, members: (target: Ref) => readonly RefMember[]): StylePropLeaf[];
|
|
77
|
+
/** The `values` field's member schema against `ctx`: the union of every form. With no context it is
|
|
78
|
+
* the storage shape; with a config and the owner's properties it is also the judge. */
|
|
79
|
+
declare function stylePropValueSchema(ctx?: StylePropValueCtx): z.ZodType<StylePropValue>;
|
|
80
|
+
/** The form a stored entry is, or `undefined` for a value no form admits. With a config, a ref is
|
|
81
|
+
* `token` or `tokenGroup` as the config says; without one it reads as `token`. */
|
|
82
|
+
declare function stylePropValueFormOf(entry: unknown, ctx?: StylePropValueCtx): StylePropValueKind | undefined;
|
|
83
|
+
/** Which form a stored entry is, asked of the config that holds it. */
|
|
84
|
+
declare function classifyStylePropValue({
|
|
85
|
+
config,
|
|
86
|
+
entry
|
|
87
|
+
}: {
|
|
88
|
+
config: Config;
|
|
89
|
+
entry: StylePropValue;
|
|
90
|
+
}): StylePropValueKind;
|
|
91
|
+
/** StyleProperty (`flex/direction`) — a prop a component can expose, mapped to a CSS
|
|
92
|
+
* property with an allowed value set. Grouping (`flex`) is emergent from the path. */
|
|
93
|
+
declare const StyleProperty: EntityClass<z.ZodObject<{
|
|
94
|
+
properties: z.ZodArray<z.ZodString>;
|
|
95
|
+
values: z.ZodOptional<z.ZodArray<z.ZodType<StylePropValue, unknown, z.core.$ZodTypeInternals<StylePropValue, unknown>>>>;
|
|
96
|
+
responsive: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
classPrefix: z.ZodOptional<z.ZodString>;
|
|
98
|
+
arbitrary: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
+
negates: z.ZodDefault<z.ZodBoolean>;
|
|
100
|
+
opacityOf: z.ZodOptional<z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>>;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<Record<never, never>, z.core.$strip>, "style-property", {
|
|
102
|
+
readonly rename: {
|
|
103
|
+
readonly to: z.ZodString;
|
|
104
|
+
};
|
|
105
|
+
readonly create: {
|
|
106
|
+
readonly path: z.ZodString;
|
|
107
|
+
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.`;
|
|
108
|
+
readonly example: ({
|
|
109
|
+
config
|
|
110
|
+
}: {
|
|
111
|
+
config: Config;
|
|
112
|
+
kind: string;
|
|
113
|
+
path: string;
|
|
114
|
+
}) => {
|
|
115
|
+
path: string;
|
|
116
|
+
data: Record<string, unknown>;
|
|
117
|
+
} | undefined;
|
|
118
|
+
};
|
|
119
|
+
}, Record<never, never>, false>;
|
|
120
|
+
/** `flexDirection` → `flex-direction`. A name already spelled as CSS comes back unchanged. */
|
|
121
|
+
declare function toCssPropertyName(property: string): string;
|
|
122
|
+
/**
|
|
123
|
+
* The CSS property names a style property governs, as the spec spells them.
|
|
124
|
+
*
|
|
125
|
+
* A web style property stores CSS names. A native one stores React Native style keys
|
|
126
|
+
* (`flexDirection`), so a surface keyed on CSS names, the designer panel's controls or a Figma
|
|
127
|
+
* paste's promotion, compares through this rather than against `properties` directly. A key only
|
|
128
|
+
* React Native defines (`paddingHorizontal`) comes back hyphenated and matches no CSS-keyed control,
|
|
129
|
+
* which is the right answer.
|
|
130
|
+
*/
|
|
131
|
+
declare function cssPropertyNames(styleProp: {
|
|
132
|
+
readonly properties: readonly string[];
|
|
133
|
+
}): string[];
|
|
134
|
+
//#endregion
|
|
135
|
+
export { RefMember, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StylePropLeaf, StylePropValue, StylePropValueCtx, StylePropValueKind, StyleProperty, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName };
|