@yahoo/uds-create-config 2.45.0 → 3.0.1
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,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings became a KIND.
|
|
3
|
+
*
|
|
4
|
+
* Version 1 kept a system's settings in an `options` slot on the envelope: build settings flat under
|
|
5
|
+
* `options.buildOptions`, the dev server's under `options.playgroundOptions`. This version keeps
|
|
6
|
+
* them as the one `settings` item, in sections. `up` places each stored value in its section and
|
|
7
|
+
* takes it out of the slot; a value with no section stays under `build`, where the section's schema
|
|
8
|
+
* refuses it by name rather than losing it. Options nothing reads any more are dropped.
|
|
9
|
+
*
|
|
10
|
+
* The slot leaves the wire entirely. `Config.hydrateFrom` refuses, naming them, any keys still in it
|
|
11
|
+
* after the chain has run — the only way a key survives is a `buildOptions`/`playgroundOptions`
|
|
12
|
+
* that was not an object, which no writer ever produced.
|
|
13
|
+
*
|
|
14
|
+
* A short-lived scheme stamped this same shape as a dense counter `2`; `schemaVersionOf` reads that
|
|
15
|
+
* stamp as this version, so such an artifact never enters `up`.
|
|
16
|
+
*
|
|
17
|
+
* Deletable once no stored config artifact is at version 1 or carries an `options` slot.
|
|
18
|
+
*/
|
|
19
|
+
import { type RawWireConfig, type SchemaMigration, SETTINGS_AS_KIND_VERSION } from '../framework/schema-version';
|
|
20
|
+
export { SETTINGS_AS_KIND_VERSION };
|
|
21
|
+
export declare function settingsFromOptions(json: RawWireConfig): RawWireConfig;
|
|
22
|
+
export declare const settingsAsKindMigration: SchemaMigration;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isPlainObject } from "../framework/utils/field-path.js";
|
|
2
|
+
import { SETTINGS_AS_KIND_VERSION } from "../framework/schema-version.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/migrations/20260908171448_settings_as_kind.ts
|
|
5
|
+
/**
|
|
6
|
+
* Settings became a KIND.
|
|
7
|
+
*
|
|
8
|
+
* Version 1 kept a system's settings in an `options` slot on the envelope: build settings flat under
|
|
9
|
+
* `options.buildOptions`, the dev server's under `options.playgroundOptions`. This version keeps
|
|
10
|
+
* them as the one `settings` item, in sections. `up` places each stored value in its section and
|
|
11
|
+
* takes it out of the slot; a value with no section stays under `build`, where the section's schema
|
|
12
|
+
* refuses it by name rather than losing it. Options nothing reads any more are dropped.
|
|
13
|
+
*
|
|
14
|
+
* The slot leaves the wire entirely. `Config.hydrateFrom` refuses, naming them, any keys still in it
|
|
15
|
+
* after the chain has run — the only way a key survives is a `buildOptions`/`playgroundOptions`
|
|
16
|
+
* that was not an object, which no writer ever produced.
|
|
17
|
+
*
|
|
18
|
+
* A short-lived scheme stamped this same shape as a dense counter `2`; `schemaVersionOf` reads that
|
|
19
|
+
* stamp as this version, so such an artifact never enters `up`.
|
|
20
|
+
*
|
|
21
|
+
* Deletable once no stored config artifact is at version 1 or carries an `options` slot.
|
|
22
|
+
*/
|
|
23
|
+
/** Where each `buildOptions` field lives now, as `[section, field]`. */
|
|
24
|
+
const BUILD_OPTION_HOMES = {
|
|
25
|
+
systemId: ["system", "id"],
|
|
26
|
+
registryDir: ["build", "registryDir"],
|
|
27
|
+
inputDir: ["build", "inputDir"],
|
|
28
|
+
outDir: ["build", "outDir"],
|
|
29
|
+
cssPrefix: ["css", "prefix"],
|
|
30
|
+
cssScope: ["css", "scope"],
|
|
31
|
+
preflight: ["css", "preflight"],
|
|
32
|
+
canvasPackageAliases: ["canvas", "packageAliases"]
|
|
33
|
+
};
|
|
34
|
+
/** Build options nothing reads any more, so a stored value has no section to land in. */
|
|
35
|
+
const RETIRED_BUILD_OPTIONS = new Set(["content", "skipCssVariables"]);
|
|
36
|
+
/** The envelope this reads — version 1, loose, asserting only the slot it moves. `items` is left to
|
|
37
|
+
* the hydrate guard, which refuses a non-config by name; a refusal here would name this migration. */
|
|
38
|
+
const before = z.looseObject({ options: z.record(z.string(), z.unknown()).optional() });
|
|
39
|
+
/** What it produces — the slot is gone unless something unplaceable stayed in it. */
|
|
40
|
+
const after = z.looseObject({ options: z.record(z.string(), z.unknown()).optional() });
|
|
41
|
+
function settingsFromOptions(json) {
|
|
42
|
+
if (!isPlainObject(json.options)) return json;
|
|
43
|
+
const { buildOptions, playgroundOptions, ...unplaced } = json.options;
|
|
44
|
+
const sections = {};
|
|
45
|
+
const place = (section, field, value) => {
|
|
46
|
+
if (value === void 0) return;
|
|
47
|
+
const target = sections[section] ?? {};
|
|
48
|
+
target[field] = value;
|
|
49
|
+
sections[section] = target;
|
|
50
|
+
};
|
|
51
|
+
if (isPlainObject(buildOptions)) for (const [key, value] of Object.entries(buildOptions)) {
|
|
52
|
+
if (RETIRED_BUILD_OPTIONS.has(key)) continue;
|
|
53
|
+
const [section, field] = BUILD_OPTION_HOMES[key] ?? ["build", key];
|
|
54
|
+
place(section, field, value);
|
|
55
|
+
}
|
|
56
|
+
else if (buildOptions !== void 0) unplaced.buildOptions = buildOptions;
|
|
57
|
+
if (isPlainObject(playgroundOptions)) for (const [key, value] of Object.entries(playgroundOptions)) place("playground", key, value);
|
|
58
|
+
else if (playgroundOptions !== void 0) unplaced.playgroundOptions = playgroundOptions;
|
|
59
|
+
const { options: _moved, ...rest } = json;
|
|
60
|
+
const withOptions = Object.keys(unplaced).length > 0 ? {
|
|
61
|
+
...rest,
|
|
62
|
+
options: unplaced
|
|
63
|
+
} : rest;
|
|
64
|
+
if (Object.keys(sections).length === 0) return withOptions;
|
|
65
|
+
const items = isPlainObject(json.items) ? json.items : {};
|
|
66
|
+
const existing = isPlainObject(items.settings) ? items.settings : {};
|
|
67
|
+
const item = isPlainObject(existing.settings) ? existing.settings : {};
|
|
68
|
+
return {
|
|
69
|
+
...withOptions,
|
|
70
|
+
items: {
|
|
71
|
+
...items,
|
|
72
|
+
settings: {
|
|
73
|
+
...existing,
|
|
74
|
+
settings: {
|
|
75
|
+
...item,
|
|
76
|
+
...sections
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const settingsAsKindMigration = {
|
|
83
|
+
version: SETTINGS_AS_KIND_VERSION,
|
|
84
|
+
up: settingsFromOptions,
|
|
85
|
+
fromSchema: before,
|
|
86
|
+
toSchema: after
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { settingsAsKindMigration };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `visible` condition's `$state` is stored as a JSON pointer.
|
|
3
|
+
*
|
|
4
|
+
* An anatomy node's condition named its prop bare (`{ $state: "tone" }`) or slashed (`"/tone"`),
|
|
5
|
+
* and the two spellings compared as different values. The entity now stores one — slash-prefixed —
|
|
6
|
+
* and refuses a pointer with an interior slash (`resolveVisibility` reads one prop, so `/a/b` has
|
|
7
|
+
* nothing to descend into). `up` slashes every stored condition, including those inside `$or` and
|
|
8
|
+
* lists; a condition already slashed is left alone. The flat `{ prop: value }` form was never stored,
|
|
9
|
+
* only accepted at the op boundary, so nothing here compiles it.
|
|
10
|
+
*
|
|
11
|
+
* `upPatch` slashes the same field on the component patches that carry an anatomy node: a whole-body
|
|
12
|
+
* `create`/`update`/`replace` and `sub-create`/`sub-upsert`/`sub-update` on the `anatomy` field.
|
|
13
|
+
*
|
|
14
|
+
* Deletable once no stored config artifact or draft patch is at a version below this one.
|
|
15
|
+
*/
|
|
16
|
+
import type { RawWireConfig, SchemaMigration } from '../framework/schema-version';
|
|
17
|
+
export declare const VISIBLE_STATE_POINTER_VERSION = 20260908194245;
|
|
18
|
+
export declare function visibleStatePointer(json: RawWireConfig): RawWireConfig;
|
|
19
|
+
export declare const visibleStatePointerMigration: SchemaMigration;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { isPlainObject } from "../framework/utils/field-path.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/migrations/20260908194245_visible_state_pointer.ts
|
|
4
|
+
/**
|
|
5
|
+
* A `visible` condition's `$state` is stored as a JSON pointer.
|
|
6
|
+
*
|
|
7
|
+
* An anatomy node's condition named its prop bare (`{ $state: "tone" }`) or slashed (`"/tone"`),
|
|
8
|
+
* and the two spellings compared as different values. The entity now stores one — slash-prefixed —
|
|
9
|
+
* and refuses a pointer with an interior slash (`resolveVisibility` reads one prop, so `/a/b` has
|
|
10
|
+
* nothing to descend into). `up` slashes every stored condition, including those inside `$or` and
|
|
11
|
+
* lists; a condition already slashed is left alone. The flat `{ prop: value }` form was never stored,
|
|
12
|
+
* only accepted at the op boundary, so nothing here compiles it.
|
|
13
|
+
*
|
|
14
|
+
* `upPatch` slashes the same field on the component patches that carry an anatomy node: a whole-body
|
|
15
|
+
* `create`/`update`/`replace` and `sub-create`/`sub-upsert`/`sub-update` on the `anatomy` field.
|
|
16
|
+
*
|
|
17
|
+
* Deletable once no stored config artifact or draft patch is at a version below this one.
|
|
18
|
+
*/
|
|
19
|
+
const VISIBLE_STATE_POINTER_VERSION = 20260908194245;
|
|
20
|
+
function slashed(state) {
|
|
21
|
+
if (typeof state !== "string") return state;
|
|
22
|
+
return state.startsWith("/") ? state : `/${state}`;
|
|
23
|
+
}
|
|
24
|
+
/** One condition in json-render's grammar: a `$state` test, an `$or`, or a list of either. Hands
|
|
25
|
+
* back the input when nothing in it moves. */
|
|
26
|
+
function pointerCondition(visible) {
|
|
27
|
+
if (Array.isArray(visible)) {
|
|
28
|
+
const next = visible.map(pointerCondition);
|
|
29
|
+
return next.every((item, i) => item === visible[i]) ? visible : next;
|
|
30
|
+
}
|
|
31
|
+
if (!isPlainObject(visible)) return visible;
|
|
32
|
+
if ("$or" in visible && Array.isArray(visible.$or)) {
|
|
33
|
+
const or = pointerCondition(visible.$or);
|
|
34
|
+
return or === visible.$or ? visible : {
|
|
35
|
+
...visible,
|
|
36
|
+
$or: or
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if ("$state" in visible) {
|
|
40
|
+
const state = slashed(visible.$state);
|
|
41
|
+
return state === visible.$state ? visible : {
|
|
42
|
+
...visible,
|
|
43
|
+
$state: state
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return visible;
|
|
47
|
+
}
|
|
48
|
+
function pointerNode(node) {
|
|
49
|
+
if (!isPlainObject(node) || node.visible === void 0) return node;
|
|
50
|
+
const visible = pointerCondition(node.visible);
|
|
51
|
+
return visible === node.visible ? node : {
|
|
52
|
+
...node,
|
|
53
|
+
visible
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Maps values, handing back the input record when no value moved. */
|
|
57
|
+
function mapRecord(record, map) {
|
|
58
|
+
let moved = false;
|
|
59
|
+
const out = {};
|
|
60
|
+
for (const [key, value] of Object.entries(record)) {
|
|
61
|
+
const next = map(value);
|
|
62
|
+
if (next !== value) moved = true;
|
|
63
|
+
out[key] = next;
|
|
64
|
+
}
|
|
65
|
+
return moved ? out : record;
|
|
66
|
+
}
|
|
67
|
+
function pointerAnatomy(anatomy) {
|
|
68
|
+
return isPlainObject(anatomy) ? mapRecord(anatomy, pointerNode) : anatomy;
|
|
69
|
+
}
|
|
70
|
+
function pointerComponent(body) {
|
|
71
|
+
if (!isPlainObject(body) || body.anatomy === void 0) return body;
|
|
72
|
+
const anatomy = pointerAnatomy(body.anatomy);
|
|
73
|
+
return anatomy === body.anatomy ? body : {
|
|
74
|
+
...body,
|
|
75
|
+
anatomy
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function visibleStatePointer(json) {
|
|
79
|
+
const items = json.items;
|
|
80
|
+
if (!isPlainObject(items) || !isPlainObject(items.component)) return json;
|
|
81
|
+
const component = mapRecord(items.component, pointerComponent);
|
|
82
|
+
if (component === items.component) return json;
|
|
83
|
+
return {
|
|
84
|
+
...json,
|
|
85
|
+
items: {
|
|
86
|
+
...items,
|
|
87
|
+
component
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const visibleStatePointerMigration = {
|
|
92
|
+
version: VISIBLE_STATE_POINTER_VERSION,
|
|
93
|
+
up: visibleStatePointer,
|
|
94
|
+
upPatch(patch) {
|
|
95
|
+
if (patch.kind !== "component" || !("data" in patch)) return patch;
|
|
96
|
+
const { operation } = patch;
|
|
97
|
+
if (operation === "create" || operation === "update" || operation === "replace") return {
|
|
98
|
+
...patch,
|
|
99
|
+
data: pointerComponent(patch.data)
|
|
100
|
+
};
|
|
101
|
+
if ((operation === "sub-create" || operation === "sub-upsert" || operation === "sub-update") && patch.field === "anatomy") return {
|
|
102
|
+
...patch,
|
|
103
|
+
data: pointerNode(patch.data)
|
|
104
|
+
};
|
|
105
|
+
return patch;
|
|
106
|
+
},
|
|
107
|
+
fromSchema: z.looseObject({}),
|
|
108
|
+
toSchema: z.looseObject({}).refine((json) => {
|
|
109
|
+
const items = json.items;
|
|
110
|
+
if (!isPlainObject(items) || !isPlainObject(items.component)) return true;
|
|
111
|
+
return mapRecord(items.component, pointerComponent) === items.component;
|
|
112
|
+
}, { message: "every stored `$state` must be a slash-prefixed pointer" })
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { VISIBLE_STATE_POINTER_VERSION, visibleStatePointerMigration };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An additive fence: three schema changes that move no stored byte.
|
|
3
|
+
*
|
|
4
|
+
* - An icon member's metadata gains an optional `knockoutVariants` list. An artifact without it
|
|
5
|
+
* reads as before; only a source that flags its own knockouts writes one.
|
|
6
|
+
* - A layer element's `__foreign` marker arm is gone. It was an input-only shape the loader wrote
|
|
7
|
+
* and the schema transformed to a `package:` ref on parse, so a stored artifact never held it.
|
|
8
|
+
* - Guidance `appliesTo` is typed on `GUIDANCE_LANES`, the same four values `GUIDANCE_SURFACES`
|
|
9
|
+
* named.
|
|
10
|
+
*
|
|
11
|
+
* Identity, so a stamp below this version means "may lack `knockoutVariants`" and one at it means
|
|
12
|
+
* the field is understood — which is what lets the pull gate keep an older client from stripping it.
|
|
13
|
+
*
|
|
14
|
+
* Deletable once no stored config artifact is below this version.
|
|
15
|
+
*/
|
|
16
|
+
import type { SchemaMigration } from '../framework/schema-version';
|
|
17
|
+
export declare const ICON_KNOCKOUT_VARIANTS_VERSION = 20260909183001;
|
|
18
|
+
export declare const iconKnockoutVariantsMigration: SchemaMigration;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/migrations/20260909183001_icon_knockout_variants.ts
|
|
2
|
+
const ICON_KNOCKOUT_VARIANTS_VERSION = 20260909183001;
|
|
3
|
+
const iconKnockoutVariantsMigration = {
|
|
4
|
+
version: ICON_KNOCKOUT_VARIANTS_VERSION,
|
|
5
|
+
up: (json) => json
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ICON_KNOCKOUT_VARIANTS_VERSION, iconKnockoutVariantsMigration };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An additive fence: the `linked-system` kind gains the ops `link`, `link-plan`, `unlink`,
|
|
3
|
+
* `unlink-plan`, `break`, `break-plan` and `rows`, so the operation catalogue's fingerprint moves.
|
|
4
|
+
* No stored byte changes — every op writes the pin's existing `link` field and ordinary rows.
|
|
5
|
+
*
|
|
6
|
+
* Identity, so a stamp below this version means "does not know the link ops" and one at it means the
|
|
7
|
+
* catalogue is understood.
|
|
8
|
+
*
|
|
9
|
+
* Deletable once no stored config artifact is below this version.
|
|
10
|
+
*/
|
|
11
|
+
import type { SchemaMigration } from '../framework/schema-version';
|
|
12
|
+
export declare const LINKED_SYSTEM_LINK_OPS_VERSION = 20260910212453;
|
|
13
|
+
export declare const linkedSystemLinkOpsMigration: SchemaMigration;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/migrations/20260910212453_linked_system_link_ops.ts
|
|
2
|
+
const LINKED_SYSTEM_LINK_OPS_VERSION = 20260910212453;
|
|
3
|
+
const linkedSystemLinkOpsMigration = {
|
|
4
|
+
version: LINKED_SYSTEM_LINK_OPS_VERSION,
|
|
5
|
+
up: (json) => json
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { LINKED_SYSTEM_LINK_OPS_VERSION, linkedSystemLinkOpsMigration };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { LoadV1Options, V1Artifact, V1Diagnostic, V1DiagnosticCode, V1_DIAGNOSTIC_CODES, loadV1Artifact, v1ComponentRenames } from "./2.0.0/v1-artifact.js";
|
|
2
|
+
export { type LoadV1Options, type V1Artifact, type V1Diagnostic, type V1DiagnosticCode, V1_DIAGNOSTIC_CODES, loadV1Artifact, v1ComponentRenames };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/react-native/style-keys.generated.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* GENERATED — do not edit. `bun scripts/generate-rn-style-keys.ts` regenerates this from React
|
|
4
|
+
* Native's own StyleSheetTypes declarations (react-native@0.86.2): every key `ViewStyle`,
|
|
5
|
+
* `TextStyle` and `ImageStyle` accept, including inherited interfaces. `NativeStyleProperty`
|
|
6
|
+
* validates against this, so the native style vocabulary is React Native's, not a hand-kept list.
|
|
7
|
+
*/
|
|
8
|
+
declare const RN_STYLE_KEYS: readonly ["alignContent", "alignItems", "alignSelf", "aspectRatio", "backfaceVisibility", "backgroundColor", "borderBlockColor", "borderBlockEndColor", "borderBlockStartColor", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderCurve", "borderEndColor", "borderEndEndRadius", "borderEndStartRadius", "borderEndWidth", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStartEndRadius", "borderStartStartRadius", "borderStartWidth", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth", "bottom", "boxShadow", "boxSizing", "color", "columnGap", "cursor", "direction", "display", "elevation", "end", "experimental_backgroundImage", "experimental_backgroundPosition", "experimental_backgroundRepeat", "experimental_backgroundSize", "filter", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "fontFamily", "fontSize", "fontStyle", "fontVariant", "fontWeight", "gap", "height", "includeFontPadding", "inset", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "isolation", "justifyContent", "left", "letterSpacing", "lineHeight", "margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginEnd", "marginHorizontal", "marginInline", "marginInlineEnd", "marginInlineStart", "marginLeft", "marginRight", "marginStart", "marginTop", "marginVertical", "maxHeight", "maxWidth", "minHeight", "minWidth", "mixBlendMode", "objectFit", "opacity", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "overflow", "overlayColor", "padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingEnd", "paddingHorizontal", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingLeft", "paddingRight", "paddingStart", "paddingTop", "paddingVertical", "pointerEvents", "position", "resizeMode", "right", "rotation", "rowGap", "scaleX", "scaleY", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "start", "textAlign", "textAlignVertical", "textDecorationColor", "textDecorationLine", "textDecorationStyle", "textShadowColor", "textShadowOffset", "textShadowRadius", "textTransform", "tintColor", "top", "transform", "transformMatrix", "transformOrigin", "translateX", "translateY", "userSelect", "verticalAlign", "width", "writingDirection", "zIndex"];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { RN_STYLE_KEYS };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
//#region src/react-native/style-keys.generated.ts
|
|
2
|
+
/**
|
|
3
|
+
* GENERATED — do not edit. `bun scripts/generate-rn-style-keys.ts` regenerates this from React
|
|
4
|
+
* Native's own StyleSheetTypes declarations (react-native@0.86.2): every key `ViewStyle`,
|
|
5
|
+
* `TextStyle` and `ImageStyle` accept, including inherited interfaces. `NativeStyleProperty`
|
|
6
|
+
* validates against this, so the native style vocabulary is React Native's, not a hand-kept list.
|
|
7
|
+
*/
|
|
8
|
+
const RN_STYLE_KEYS = [
|
|
9
|
+
"alignContent",
|
|
10
|
+
"alignItems",
|
|
11
|
+
"alignSelf",
|
|
12
|
+
"aspectRatio",
|
|
13
|
+
"backfaceVisibility",
|
|
14
|
+
"backgroundColor",
|
|
15
|
+
"borderBlockColor",
|
|
16
|
+
"borderBlockEndColor",
|
|
17
|
+
"borderBlockStartColor",
|
|
18
|
+
"borderBottomColor",
|
|
19
|
+
"borderBottomEndRadius",
|
|
20
|
+
"borderBottomLeftRadius",
|
|
21
|
+
"borderBottomRightRadius",
|
|
22
|
+
"borderBottomStartRadius",
|
|
23
|
+
"borderBottomWidth",
|
|
24
|
+
"borderColor",
|
|
25
|
+
"borderCurve",
|
|
26
|
+
"borderEndColor",
|
|
27
|
+
"borderEndEndRadius",
|
|
28
|
+
"borderEndStartRadius",
|
|
29
|
+
"borderEndWidth",
|
|
30
|
+
"borderLeftColor",
|
|
31
|
+
"borderLeftWidth",
|
|
32
|
+
"borderRadius",
|
|
33
|
+
"borderRightColor",
|
|
34
|
+
"borderRightWidth",
|
|
35
|
+
"borderStartColor",
|
|
36
|
+
"borderStartEndRadius",
|
|
37
|
+
"borderStartStartRadius",
|
|
38
|
+
"borderStartWidth",
|
|
39
|
+
"borderStyle",
|
|
40
|
+
"borderTopColor",
|
|
41
|
+
"borderTopEndRadius",
|
|
42
|
+
"borderTopLeftRadius",
|
|
43
|
+
"borderTopRightRadius",
|
|
44
|
+
"borderTopStartRadius",
|
|
45
|
+
"borderTopWidth",
|
|
46
|
+
"borderWidth",
|
|
47
|
+
"bottom",
|
|
48
|
+
"boxShadow",
|
|
49
|
+
"boxSizing",
|
|
50
|
+
"color",
|
|
51
|
+
"columnGap",
|
|
52
|
+
"cursor",
|
|
53
|
+
"direction",
|
|
54
|
+
"display",
|
|
55
|
+
"elevation",
|
|
56
|
+
"end",
|
|
57
|
+
"experimental_backgroundImage",
|
|
58
|
+
"experimental_backgroundPosition",
|
|
59
|
+
"experimental_backgroundRepeat",
|
|
60
|
+
"experimental_backgroundSize",
|
|
61
|
+
"filter",
|
|
62
|
+
"flex",
|
|
63
|
+
"flexBasis",
|
|
64
|
+
"flexDirection",
|
|
65
|
+
"flexGrow",
|
|
66
|
+
"flexShrink",
|
|
67
|
+
"flexWrap",
|
|
68
|
+
"fontFamily",
|
|
69
|
+
"fontSize",
|
|
70
|
+
"fontStyle",
|
|
71
|
+
"fontVariant",
|
|
72
|
+
"fontWeight",
|
|
73
|
+
"gap",
|
|
74
|
+
"height",
|
|
75
|
+
"includeFontPadding",
|
|
76
|
+
"inset",
|
|
77
|
+
"insetBlock",
|
|
78
|
+
"insetBlockEnd",
|
|
79
|
+
"insetBlockStart",
|
|
80
|
+
"insetInline",
|
|
81
|
+
"insetInlineEnd",
|
|
82
|
+
"insetInlineStart",
|
|
83
|
+
"isolation",
|
|
84
|
+
"justifyContent",
|
|
85
|
+
"left",
|
|
86
|
+
"letterSpacing",
|
|
87
|
+
"lineHeight",
|
|
88
|
+
"margin",
|
|
89
|
+
"marginBlock",
|
|
90
|
+
"marginBlockEnd",
|
|
91
|
+
"marginBlockStart",
|
|
92
|
+
"marginBottom",
|
|
93
|
+
"marginEnd",
|
|
94
|
+
"marginHorizontal",
|
|
95
|
+
"marginInline",
|
|
96
|
+
"marginInlineEnd",
|
|
97
|
+
"marginInlineStart",
|
|
98
|
+
"marginLeft",
|
|
99
|
+
"marginRight",
|
|
100
|
+
"marginStart",
|
|
101
|
+
"marginTop",
|
|
102
|
+
"marginVertical",
|
|
103
|
+
"maxHeight",
|
|
104
|
+
"maxWidth",
|
|
105
|
+
"minHeight",
|
|
106
|
+
"minWidth",
|
|
107
|
+
"mixBlendMode",
|
|
108
|
+
"objectFit",
|
|
109
|
+
"opacity",
|
|
110
|
+
"outlineColor",
|
|
111
|
+
"outlineOffset",
|
|
112
|
+
"outlineStyle",
|
|
113
|
+
"outlineWidth",
|
|
114
|
+
"overflow",
|
|
115
|
+
"overlayColor",
|
|
116
|
+
"padding",
|
|
117
|
+
"paddingBlock",
|
|
118
|
+
"paddingBlockEnd",
|
|
119
|
+
"paddingBlockStart",
|
|
120
|
+
"paddingBottom",
|
|
121
|
+
"paddingEnd",
|
|
122
|
+
"paddingHorizontal",
|
|
123
|
+
"paddingInline",
|
|
124
|
+
"paddingInlineEnd",
|
|
125
|
+
"paddingInlineStart",
|
|
126
|
+
"paddingLeft",
|
|
127
|
+
"paddingRight",
|
|
128
|
+
"paddingStart",
|
|
129
|
+
"paddingTop",
|
|
130
|
+
"paddingVertical",
|
|
131
|
+
"pointerEvents",
|
|
132
|
+
"position",
|
|
133
|
+
"resizeMode",
|
|
134
|
+
"right",
|
|
135
|
+
"rotation",
|
|
136
|
+
"rowGap",
|
|
137
|
+
"scaleX",
|
|
138
|
+
"scaleY",
|
|
139
|
+
"shadowColor",
|
|
140
|
+
"shadowOffset",
|
|
141
|
+
"shadowOpacity",
|
|
142
|
+
"shadowRadius",
|
|
143
|
+
"start",
|
|
144
|
+
"textAlign",
|
|
145
|
+
"textAlignVertical",
|
|
146
|
+
"textDecorationColor",
|
|
147
|
+
"textDecorationLine",
|
|
148
|
+
"textDecorationStyle",
|
|
149
|
+
"textShadowColor",
|
|
150
|
+
"textShadowOffset",
|
|
151
|
+
"textShadowRadius",
|
|
152
|
+
"textTransform",
|
|
153
|
+
"tintColor",
|
|
154
|
+
"top",
|
|
155
|
+
"transform",
|
|
156
|
+
"transformMatrix",
|
|
157
|
+
"transformOrigin",
|
|
158
|
+
"translateX",
|
|
159
|
+
"translateY",
|
|
160
|
+
"userSelect",
|
|
161
|
+
"verticalAlign",
|
|
162
|
+
"width",
|
|
163
|
+
"writingDirection",
|
|
164
|
+
"zIndex"
|
|
165
|
+
];
|
|
166
|
+
//#endregion
|
|
167
|
+
export { RN_STYLE_KEYS };
|
|
@@ -2,23 +2,50 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
//#region src/renderer/RendererErrorBoundary.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Error boundary wrapped around each component's render entry
|
|
6
|
-
*
|
|
7
|
-
* the
|
|
5
|
+
* Error boundary wrapped around each component's render entry — the INNERMOST
|
|
6
|
+
* boundary, inside json-render's own per-element `ElementErrorBoundary`. That
|
|
7
|
+
* placement is the point: json-render's boundary latches to `null` and logs
|
|
8
|
+
* the full component stack, so a throwing component painted NOTHING (an empty
|
|
9
|
+
* preview with no visible signal) and, on surfaces that remount elements per
|
|
10
|
+
* re-render, re-threw and re-logged every cycle. Catching here instead keeps
|
|
11
|
+
* one broken component as one labeled tile while the rest of the Spec keeps
|
|
12
|
+
* rendering.
|
|
13
|
+
*
|
|
14
|
+
* The tile clears when `resetKey` changes by content. The entry passes the
|
|
15
|
+
* element's props, so a component that threw on one render — a node painted
|
|
16
|
+
* mid-stream, before the props batch that carries a required value arrived —
|
|
17
|
+
* shows a tile only until those props settle, then renders. While the props
|
|
18
|
+
* read the same it stays latched: a component that throws on the same input
|
|
19
|
+
* every render (a deliberately-broken preview) is one tile and never
|
|
20
|
+
* re-throws, which is the re-log storm this boundary exists to stop. Content
|
|
21
|
+
* rather than identity because json-render resolves a fresh props object on
|
|
22
|
+
* every render of the element.
|
|
8
23
|
*/
|
|
9
24
|
declare class RendererErrorBoundary extends React.Component<{
|
|
10
25
|
name: string;
|
|
11
|
-
|
|
26
|
+
resetKey?: unknown;
|
|
27
|
+
children?: React.ReactNode;
|
|
12
28
|
}, {
|
|
13
29
|
error: string | null;
|
|
30
|
+
resetKey: unknown;
|
|
14
31
|
}> {
|
|
15
32
|
constructor(props: {
|
|
16
33
|
name: string;
|
|
17
|
-
|
|
34
|
+
resetKey?: unknown;
|
|
35
|
+
children?: React.ReactNode;
|
|
18
36
|
});
|
|
19
37
|
static getDerivedStateFromError(err: unknown): {
|
|
20
38
|
error: string;
|
|
21
39
|
};
|
|
40
|
+
static getDerivedStateFromProps(props: {
|
|
41
|
+
resetKey?: unknown;
|
|
42
|
+
}, state: {
|
|
43
|
+
error: string | null;
|
|
44
|
+
resetKey: unknown;
|
|
45
|
+
}): {
|
|
46
|
+
error: null;
|
|
47
|
+
resetKey: unknown;
|
|
48
|
+
} | null;
|
|
22
49
|
componentDidCatch(err: unknown): void;
|
|
23
50
|
render(): React.ReactNode;
|
|
24
51
|
}
|
|
@@ -1,30 +1,79 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
//#region src/renderer/RendererErrorBoundary.tsx
|
|
3
3
|
/**
|
|
4
|
-
* Error boundary wrapped around each component's render entry
|
|
5
|
-
*
|
|
6
|
-
* the
|
|
4
|
+
* Error boundary wrapped around each component's render entry — the INNERMOST
|
|
5
|
+
* boundary, inside json-render's own per-element `ElementErrorBoundary`. That
|
|
6
|
+
* placement is the point: json-render's boundary latches to `null` and logs
|
|
7
|
+
* the full component stack, so a throwing component painted NOTHING (an empty
|
|
8
|
+
* preview with no visible signal) and, on surfaces that remount elements per
|
|
9
|
+
* re-render, re-threw and re-logged every cycle. Catching here instead keeps
|
|
10
|
+
* one broken component as one labeled tile while the rest of the Spec keeps
|
|
11
|
+
* rendering.
|
|
12
|
+
*
|
|
13
|
+
* The tile clears when `resetKey` changes by content. The entry passes the
|
|
14
|
+
* element's props, so a component that threw on one render — a node painted
|
|
15
|
+
* mid-stream, before the props batch that carries a required value arrived —
|
|
16
|
+
* shows a tile only until those props settle, then renders. While the props
|
|
17
|
+
* read the same it stays latched: a component that throws on the same input
|
|
18
|
+
* every render (a deliberately-broken preview) is one tile and never
|
|
19
|
+
* re-throws, which is the re-log storm this boundary exists to stop. Content
|
|
20
|
+
* rather than identity because json-render resolves a fresh props object on
|
|
21
|
+
* every render of the element.
|
|
7
22
|
*/
|
|
8
23
|
var RendererErrorBoundary = class extends React.Component {
|
|
9
24
|
constructor(props) {
|
|
10
25
|
super(props);
|
|
11
|
-
this.state = {
|
|
26
|
+
this.state = {
|
|
27
|
+
error: null,
|
|
28
|
+
resetKey: props.resetKey
|
|
29
|
+
};
|
|
12
30
|
}
|
|
13
31
|
static getDerivedStateFromError(err) {
|
|
14
32
|
return { error: err instanceof Error ? err.message : String(err) };
|
|
15
33
|
}
|
|
34
|
+
static getDerivedStateFromProps(props, state) {
|
|
35
|
+
if (sameKey(props.resetKey, state.resetKey)) return null;
|
|
36
|
+
return {
|
|
37
|
+
error: null,
|
|
38
|
+
resetKey: props.resetKey
|
|
39
|
+
};
|
|
40
|
+
}
|
|
16
41
|
componentDidCatch(err) {
|
|
17
42
|
console.error(`[json-render] Rendering error in <${this.props.name}>:`, err);
|
|
18
43
|
}
|
|
19
44
|
render() {
|
|
20
|
-
if (this.state.error)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
45
|
+
if (this.state.error) {
|
|
46
|
+
if (typeof document === "undefined") return null;
|
|
47
|
+
return React.createElement("div", {
|
|
48
|
+
"data-uds-render-error": this.props.name,
|
|
49
|
+
style: {
|
|
50
|
+
padding: 8,
|
|
51
|
+
fontSize: 11,
|
|
52
|
+
color: "#ef4444",
|
|
53
|
+
fontFamily: "monospace"
|
|
54
|
+
}
|
|
55
|
+
}, `<${this.props.name}> render error`);
|
|
56
|
+
}
|
|
26
57
|
return this.props.children;
|
|
27
58
|
}
|
|
28
59
|
};
|
|
60
|
+
/** Structural equality over the JSON-shaped values element props hold. Anything else compares by
|
|
61
|
+
* identity. */
|
|
62
|
+
function sameKey(a, b) {
|
|
63
|
+
if (Object.is(a, b)) return true;
|
|
64
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
65
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
66
|
+
return a.every((item, index) => sameKey(item, b[index]));
|
|
67
|
+
}
|
|
68
|
+
if (!isPlainObject(a) || !isPlainObject(b)) return false;
|
|
69
|
+
const keys = Object.keys(a);
|
|
70
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
71
|
+
return keys.every((key) => Object.hasOwn(b, key) && sameKey(a[key], b[key]));
|
|
72
|
+
}
|
|
73
|
+
function isPlainObject(value) {
|
|
74
|
+
if (typeof value !== "object" || value === null) return false;
|
|
75
|
+
const proto = Object.getPrototypeOf(value);
|
|
76
|
+
return proto === Object.prototype || proto === null;
|
|
77
|
+
}
|
|
29
78
|
//#endregion
|
|
30
79
|
export { RendererErrorBoundary };
|