@pwfabric/runtime 0.0.0-stage → 1.0.0-rc.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/LICENSE +90 -0
- package/README.md +43 -2
- package/dist/a11y/announcer.d.ts +65 -0
- package/dist/a11y/announcer.js +140 -0
- package/dist/a11y/announcer.js.map +1 -0
- package/dist/a11y/contrast.d.ts +54 -0
- package/dist/a11y/contrast.js +93 -0
- package/dist/a11y/contrast.js.map +1 -0
- package/dist/a11y/focus.d.ts +123 -0
- package/dist/a11y/focus.js +282 -0
- package/dist/a11y/focus.js.map +1 -0
- package/dist/a11y/index.d.ts +21 -0
- package/dist/a11y/index.js +18 -0
- package/dist/a11y/index.js.map +1 -0
- package/dist/a11y/keyboard.d.ts +144 -0
- package/dist/a11y/keyboard.js +317 -0
- package/dist/a11y/keyboard.js.map +1 -0
- package/dist/adapters/default-image.d.ts +25 -0
- package/dist/adapters/default-image.js +37 -0
- package/dist/adapters/default-image.js.map +1 -0
- package/dist/adapters/index.d.ts +27 -0
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/next-image.d.ts +38 -0
- package/dist/adapters/next-image.js +124 -0
- package/dist/adapters/next-image.js.map +1 -0
- package/dist/adapters/types.d.ts +61 -0
- package/dist/adapters/types.js +11 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/analytics/index.d.ts +14 -0
- package/dist/analytics/index.js +15 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics/tracker.d.ts +65 -0
- package/dist/analytics/tracker.js +251 -0
- package/dist/analytics/tracker.js.map +1 -0
- package/dist/analytics/types.d.ts +130 -0
- package/dist/analytics/types.js +11 -0
- package/dist/analytics/types.js.map +1 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.js +14 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/provider.d.ts +132 -0
- package/dist/auth/provider.js +473 -0
- package/dist/auth/provider.js.map +1 -0
- package/dist/auth/types.d.ts +117 -0
- package/dist/auth/types.js +9 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/binding/collection.d.ts +190 -0
- package/dist/binding/collection.js +358 -0
- package/dist/binding/collection.js.map +1 -0
- package/dist/binding/datasource.d.ts +319 -0
- package/dist/binding/datasource.js +556 -0
- package/dist/binding/datasource.js.map +1 -0
- package/dist/binding/engine.d.ts +65 -0
- package/dist/binding/engine.js +268 -0
- package/dist/binding/engine.js.map +1 -0
- package/dist/binding/expression.d.ts +150 -0
- package/dist/binding/expression.js +787 -0
- package/dist/binding/expression.js.map +1 -0
- package/dist/binding/index.d.ts +19 -0
- package/dist/binding/index.js +14 -0
- package/dist/binding/index.js.map +1 -0
- package/dist/binding/two-way.d.ts +149 -0
- package/dist/binding/two-way.js +462 -0
- package/dist/binding/two-way.js.map +1 -0
- package/dist/binding/types.d.ts +119 -0
- package/dist/binding/types.js +9 -0
- package/dist/binding/types.js.map +1 -0
- package/dist/blocks/component-types.d.ts +81 -0
- package/dist/blocks/component-types.js +11 -0
- package/dist/blocks/component-types.js.map +1 -0
- package/dist/blocks/composition-rules.d.ts +168 -0
- package/dist/blocks/composition-rules.js +391 -0
- package/dist/blocks/composition-rules.js.map +1 -0
- package/dist/blocks/hooks.d.ts +31 -0
- package/dist/blocks/hooks.js +42 -0
- package/dist/blocks/hooks.js.map +1 -0
- package/dist/blocks/index.d.ts +14 -0
- package/dist/blocks/index.js +23 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/registry.d.ts +84 -0
- package/dist/blocks/registry.js +136 -0
- package/dist/blocks/registry.js.map +1 -0
- package/dist/blocks/rule-engine.d.ts +131 -0
- package/dist/blocks/rule-engine.js +321 -0
- package/dist/blocks/rule-engine.js.map +1 -0
- package/dist/blocks/surface-event-context.d.ts +13 -0
- package/dist/blocks/surface-event-context.js +14 -0
- package/dist/blocks/surface-event-context.js.map +1 -0
- package/dist/blocks/surface-id-context.d.ts +13 -0
- package/dist/blocks/surface-id-context.js +15 -0
- package/dist/blocks/surface-id-context.js.map +1 -0
- package/dist/bus.d.ts +41 -0
- package/dist/bus.js +158 -0
- package/dist/bus.js.map +1 -0
- package/dist/cache/index.d.ts +9 -0
- package/dist/cache/index.js +10 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/memory.d.ts +32 -0
- package/dist/cache/memory.js +138 -0
- package/dist/cache/memory.js.map +1 -0
- package/dist/cache/types.d.ts +62 -0
- package/dist/cache/types.js +9 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/capability/index.d.ts +72 -0
- package/dist/capability/index.js +87 -0
- package/dist/capability/index.js.map +1 -0
- package/dist/capability/kernel-capabilities.d.ts +31 -0
- package/dist/capability/kernel-capabilities.js +36 -0
- package/dist/capability/kernel-capabilities.js.map +1 -0
- package/dist/capability/platform-capabilities.d.ts +71 -0
- package/dist/capability/platform-capabilities.js +267 -0
- package/dist/capability/platform-capabilities.js.map +1 -0
- package/dist/capability/type-mapping.d.ts +70 -0
- package/dist/capability/type-mapping.js +107 -0
- package/dist/capability/type-mapping.js.map +1 -0
- package/dist/capability/validation.d.ts +46 -0
- package/dist/capability/validation.js +54 -0
- package/dist/capability/validation.js.map +1 -0
- package/dist/connectors/declared-connector.d.ts +48 -0
- package/dist/connectors/declared-connector.js +333 -0
- package/dist/connectors/declared-connector.js.map +1 -0
- package/dist/connectors/engine-registry.d.ts +50 -0
- package/dist/connectors/engine-registry.js +135 -0
- package/dist/connectors/engine-registry.js.map +1 -0
- package/dist/connectors/index.d.ts +14 -0
- package/dist/connectors/index.js +14 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/module-loader.d.ts +70 -0
- package/dist/connectors/module-loader.js +143 -0
- package/dist/connectors/module-loader.js.map +1 -0
- package/dist/connectors/types.d.ts +174 -0
- package/dist/connectors/types.js +23 -0
- package/dist/connectors/types.js.map +1 -0
- package/dist/context.d.ts +27 -0
- package/dist/context.js +38 -0
- package/dist/context.js.map +1 -0
- package/dist/data/DataCapabilityProvider.d.ts +39 -0
- package/dist/data/DataCapabilityProvider.js +58 -0
- package/dist/data/DataCapabilityProvider.js.map +1 -0
- package/dist/data/index.d.ts +17 -0
- package/dist/data/index.js +18 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/manager.d.ts +40 -0
- package/dist/data/manager.js +442 -0
- package/dist/data/manager.js.map +1 -0
- package/dist/data/types.d.ts +218 -0
- package/dist/data/types.js +2 -0
- package/dist/data/types.js.map +1 -0
- package/dist/entity/aggregate.d.ts +8 -0
- package/dist/entity/aggregate.js +24 -0
- package/dist/entity/aggregate.js.map +1 -0
- package/dist/entity/apply-query.d.ts +58 -0
- package/dist/entity/apply-query.js +264 -0
- package/dist/entity/apply-query.js.map +1 -0
- package/dist/entity/behavior.d.ts +94 -0
- package/dist/entity/behavior.js +78 -0
- package/dist/entity/behavior.js.map +1 -0
- package/dist/entity/connector.d.ts +141 -0
- package/dist/entity/connector.js +89 -0
- package/dist/entity/connector.js.map +1 -0
- package/dist/entity/connectors/index.d.ts +12 -0
- package/dist/entity/connectors/index.js +11 -0
- package/dist/entity/connectors/index.js.map +1 -0
- package/dist/entity/connectors/static.d.ts +51 -0
- package/dist/entity/connectors/static.js +245 -0
- package/dist/entity/connectors/static.js.map +1 -0
- package/dist/entity/entity-datasource.d.ts +50 -0
- package/dist/entity/entity-datasource.js +33 -0
- package/dist/entity/entity-datasource.js.map +1 -0
- package/dist/entity/facade.d.ts +70 -0
- package/dist/entity/facade.js +70 -0
- package/dist/entity/facade.js.map +1 -0
- package/dist/entity/http-connector.d.ts +123 -0
- package/dist/entity/http-connector.js +295 -0
- package/dist/entity/http-connector.js.map +1 -0
- package/dist/entity/index.d.ts +38 -0
- package/dist/entity/index.js +31 -0
- package/dist/entity/index.js.map +1 -0
- package/dist/entity/postgres-connector.d.ts +64 -0
- package/dist/entity/postgres-connector.js +239 -0
- package/dist/entity/postgres-connector.js.map +1 -0
- package/dist/entity/registry.d.ts +59 -0
- package/dist/entity/registry.js +90 -0
- package/dist/entity/registry.js.map +1 -0
- package/dist/entity/store.d.ts +66 -0
- package/dist/entity/store.js +349 -0
- package/dist/entity/store.js.map +1 -0
- package/dist/entity/types.d.ts +180 -0
- package/dist/entity/types.js +10 -0
- package/dist/entity/types.js.map +1 -0
- package/dist/execution-context.d.ts +88 -0
- package/dist/execution-context.js +146 -0
- package/dist/execution-context.js.map +1 -0
- package/dist/executor.d.ts +27 -0
- package/dist/executor.js +33 -0
- package/dist/executor.js.map +1 -0
- package/dist/forms/form-entity-bridge.d.ts +94 -0
- package/dist/forms/form-entity-bridge.js +96 -0
- package/dist/forms/form-entity-bridge.js.map +1 -0
- package/dist/forms/form-write-target.d.ts +34 -0
- package/dist/forms/form-write-target.js +81 -0
- package/dist/forms/form-write-target.js.map +1 -0
- package/dist/forms/index.d.ts +22 -0
- package/dist/forms/index.js +25 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/forms/named-control-values.d.ts +27 -0
- package/dist/forms/named-control-values.js +42 -0
- package/dist/forms/named-control-values.js.map +1 -0
- package/dist/forms/processor.d.ts +55 -0
- package/dist/forms/processor.js +154 -0
- package/dist/forms/processor.js.map +1 -0
- package/dist/forms/types.d.ts +174 -0
- package/dist/forms/types.js +33 -0
- package/dist/forms/types.js.map +1 -0
- package/dist/forms/validator.d.ts +61 -0
- package/dist/forms/validator.js +218 -0
- package/dist/forms/validator.js.map +1 -0
- package/dist/graph/index.d.ts +10 -0
- package/dist/graph/index.js +9 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/resolver.d.ts +66 -0
- package/dist/graph/resolver.js +243 -0
- package/dist/graph/resolver.js.map +1 -0
- package/dist/graph/types.d.ts +125 -0
- package/dist/graph/types.js +9 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/hooks/useInstalledAtoms.d.ts +96 -0
- package/dist/hooks/useInstalledAtoms.js +92 -0
- package/dist/hooks/useInstalledAtoms.js.map +1 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +14 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/translator.d.ts +76 -0
- package/dist/i18n/translator.js +357 -0
- package/dist/i18n/translator.js.map +1 -0
- package/dist/i18n/types.d.ts +93 -0
- package/dist/i18n/types.js +9 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel.d.ts +47 -0
- package/dist/kernel.js +258 -0
- package/dist/kernel.js.map +1 -0
- package/dist/perf/budget.d.ts +92 -0
- package/dist/perf/budget.js +122 -0
- package/dist/perf/budget.js.map +1 -0
- package/dist/perf/index.d.ts +16 -0
- package/dist/perf/index.js +13 -0
- package/dist/perf/index.js.map +1 -0
- package/dist/perf/render-timer.d.ts +90 -0
- package/dist/perf/render-timer.js +136 -0
- package/dist/perf/render-timer.js.map +1 -0
- package/dist/perf/reporter.d.ts +126 -0
- package/dist/perf/reporter.js +241 -0
- package/dist/perf/reporter.js.map +1 -0
- package/dist/perf/web-vitals.d.ts +111 -0
- package/dist/perf/web-vitals.js +268 -0
- package/dist/perf/web-vitals.js.map +1 -0
- package/dist/registry.d.ts +63 -0
- package/dist/registry.js +126 -0
- package/dist/registry.js.map +1 -0
- package/dist/render/BehaviorSurfaceProvider.d.ts +65 -0
- package/dist/render/BehaviorSurfaceProvider.js +185 -0
- package/dist/render/BehaviorSurfaceProvider.js.map +1 -0
- package/dist/render/BlockErrorBoundary.d.ts +26 -0
- package/dist/render/BlockErrorBoundary.js +41 -0
- package/dist/render/BlockErrorBoundary.js.map +1 -0
- package/dist/render/DataBoundSurfaceRenderer.d.ts +78 -0
- package/dist/render/DataBoundSurfaceRenderer.js +998 -0
- package/dist/render/DataBoundSurfaceRenderer.js.map +1 -0
- package/dist/render/DynamicBlockWrapper.d.ts +23 -0
- package/dist/render/DynamicBlockWrapper.js +117 -0
- package/dist/render/DynamicBlockWrapper.js.map +1 -0
- package/dist/render/appearance-resolver.d.ts +50 -0
- package/dist/render/appearance-resolver.js +78 -0
- package/dist/render/appearance-resolver.js.map +1 -0
- package/dist/render/capability-gate.d.ts +69 -0
- package/dist/render/capability-gate.js +94 -0
- package/dist/render/capability-gate.js.map +1 -0
- package/dist/render/conditional-states-css.d.ts +41 -0
- package/dist/render/conditional-states-css.js +82 -0
- package/dist/render/conditional-states-css.js.map +1 -0
- package/dist/render/connections-context.d.ts +31 -0
- package/dist/render/connections-context.js +34 -0
- package/dist/render/connections-context.js.map +1 -0
- package/dist/render/dark-theme-css.d.ts +36 -0
- package/dist/render/dark-theme-css.js +67 -0
- package/dist/render/dark-theme-css.js.map +1 -0
- package/dist/render/data-binding-types.d.ts +191 -0
- package/dist/render/data-binding-types.js +11 -0
- package/dist/render/data-binding-types.js.map +1 -0
- package/dist/render/data-cache.d.ts +30 -0
- package/dist/render/data-cache.js +37 -0
- package/dist/render/data-cache.js.map +1 -0
- package/dist/render/derive-dark-theme.d.ts +17 -0
- package/dist/render/derive-dark-theme.js +18 -0
- package/dist/render/derive-dark-theme.js.map +1 -0
- package/dist/render/dynamic-artifact-context.d.ts +77 -0
- package/dist/render/dynamic-artifact-context.js +89 -0
- package/dist/render/dynamic-artifact-context.js.map +1 -0
- package/dist/render/dynamic-block-loader.d.ts +80 -0
- package/dist/render/dynamic-block-loader.js +197 -0
- package/dist/render/dynamic-block-loader.js.map +1 -0
- package/dist/render/endpoint.d.ts +18 -0
- package/dist/render/endpoint.js +109 -0
- package/dist/render/endpoint.js.map +1 -0
- package/dist/render/entity-facade-context.d.ts +34 -0
- package/dist/render/entity-facade-context.js +37 -0
- package/dist/render/entity-facade-context.js.map +1 -0
- package/dist/render/group-states-css.d.ts +41 -0
- package/dist/render/group-states-css.js +73 -0
- package/dist/render/group-states-css.js.map +1 -0
- package/dist/render/hooks/useSurfaceEvents.d.ts +8 -0
- package/dist/render/hooks/useSurfaceEvents.js +9 -0
- package/dist/render/hooks/useSurfaceEvents.js.map +1 -0
- package/dist/render/hooks/useSurfaceId.d.ts +8 -0
- package/dist/render/hooks/useSurfaceId.js +9 -0
- package/dist/render/hooks/useSurfaceId.js.map +1 -0
- package/dist/render/index.d.ts +48 -0
- package/dist/render/index.js +61 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/interaction-rule-engine.d.ts +12 -0
- package/dist/render/interaction-rule-engine.js +47 -0
- package/dist/render/interaction-rule-engine.js.map +1 -0
- package/dist/render/keyframes-css.d.ts +31 -0
- package/dist/render/keyframes-css.js +44 -0
- package/dist/render/keyframes-css.js.map +1 -0
- package/dist/render/query-state.d.ts +3 -0
- package/dist/render/query-state.js +70 -0
- package/dist/render/query-state.js.map +1 -0
- package/dist/render/renderer.d.ts +44 -0
- package/dist/render/renderer.js +937 -0
- package/dist/render/renderer.js.map +1 -0
- package/dist/render/resolve-expressions.d.ts +37 -0
- package/dist/render/resolve-expressions.js +309 -0
- package/dist/render/resolve-expressions.js.map +1 -0
- package/dist/render/responsive-style-css.d.ts +42 -0
- package/dist/render/responsive-style-css.js +123 -0
- package/dist/render/responsive-style-css.js.map +1 -0
- package/dist/render/responsive.d.ts +49 -0
- package/dist/render/responsive.js +99 -0
- package/dist/render/responsive.js.map +1 -0
- package/dist/render/scoped-css.d.ts +71 -0
- package/dist/render/scoped-css.js +102 -0
- package/dist/render/scoped-css.js.map +1 -0
- package/dist/render/shell-selection.d.ts +69 -0
- package/dist/render/shell-selection.js +117 -0
- package/dist/render/shell-selection.js.map +1 -0
- package/dist/render/states-css.d.ts +32 -0
- package/dist/render/states-css.js +63 -0
- package/dist/render/states-css.js.map +1 -0
- package/dist/render/surface-data-context.d.ts +18 -0
- package/dist/render/surface-data-context.js +21 -0
- package/dist/render/surface-data-context.js.map +1 -0
- package/dist/render/surface-event-bus.d.ts +19 -0
- package/dist/render/surface-event-bus.js +68 -0
- package/dist/render/surface-event-bus.js.map +1 -0
- package/dist/render/surface-event-context.d.ts +11 -0
- package/dist/render/surface-event-context.js +12 -0
- package/dist/render/surface-event-context.js.map +1 -0
- package/dist/render/surface-id-context.d.ts +8 -0
- package/dist/render/surface-id-context.js +9 -0
- package/dist/render/surface-id-context.js.map +1 -0
- package/dist/render/theme-utils.d.ts +14 -0
- package/dist/render/theme-utils.js +15 -0
- package/dist/render/theme-utils.js.map +1 -0
- package/dist/render/types.d.ts +282 -0
- package/dist/render/types.js +9 -0
- package/dist/render/types.js.map +1 -0
- package/dist/render/visibility-css.d.ts +42 -0
- package/dist/render/visibility-css.js +119 -0
- package/dist/render/visibility-css.js.map +1 -0
- package/dist/render/width-scope.d.ts +34 -0
- package/dist/render/width-scope.js +44 -0
- package/dist/render/width-scope.js.map +1 -0
- package/dist/render/write-only-sources.d.ts +33 -0
- package/dist/render/write-only-sources.js +99 -0
- package/dist/render/write-only-sources.js.map +1 -0
- package/dist/routing/index.d.ts +14 -0
- package/dist/routing/index.js +15 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/router.d.ts +42 -0
- package/dist/routing/router.js +218 -0
- package/dist/routing/router.js.map +1 -0
- package/dist/routing/types.d.ts +124 -0
- package/dist/routing/types.js +9 -0
- package/dist/routing/types.js.map +1 -0
- package/dist/seo/generator.d.ts +39 -0
- package/dist/seo/generator.js +236 -0
- package/dist/seo/generator.js.map +1 -0
- package/dist/seo/index.d.ts +14 -0
- package/dist/seo/index.js +15 -0
- package/dist/seo/index.js.map +1 -0
- package/dist/seo/types.d.ts +181 -0
- package/dist/seo/types.js +9 -0
- package/dist/seo/types.js.map +1 -0
- package/dist/state/index.d.ts +15 -0
- package/dist/state/index.js +16 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/manager.d.ts +33 -0
- package/dist/state/manager.js +81 -0
- package/dist/state/manager.js.map +1 -0
- package/dist/state/store.d.ts +40 -0
- package/dist/state/store.js +145 -0
- package/dist/state/store.js.map +1 -0
- package/dist/state/types.d.ts +107 -0
- package/dist/state/types.js +9 -0
- package/dist/state/types.js.map +1 -0
- package/dist/surface/expression.d.ts +65 -0
- package/dist/surface/expression.js +179 -0
- package/dist/surface/expression.js.map +1 -0
- package/dist/surface/index.d.ts +32 -0
- package/dist/surface/index.js +25 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/surface/interpreter.d.ts +96 -0
- package/dist/surface/interpreter.js +231 -0
- package/dist/surface/interpreter.js.map +1 -0
- package/dist/surface/layout.d.ts +54 -0
- package/dist/surface/layout.js +288 -0
- package/dist/surface/layout.js.map +1 -0
- package/dist/surface/output.d.ts +90 -0
- package/dist/surface/output.js +104 -0
- package/dist/surface/output.js.map +1 -0
- package/dist/surface/primitives.d.ts +180 -0
- package/dist/surface/primitives.js +339 -0
- package/dist/surface/primitives.js.map +1 -0
- package/dist/surface/renderer.d.ts +96 -0
- package/dist/surface/renderer.js +190 -0
- package/dist/surface/renderer.js.map +1 -0
- package/dist/surface/schemas.d.ts +181 -0
- package/dist/surface/schemas.js +142 -0
- package/dist/surface/schemas.js.map +1 -0
- package/dist/surface/transforms.d.ts +144 -0
- package/dist/surface/transforms.js +120 -0
- package/dist/surface/transforms.js.map +1 -0
- package/dist/surface/types.d.ts +160 -0
- package/dist/surface/types.js +51 -0
- package/dist/surface/types.js.map +1 -0
- package/dist/surface/validation.d.ts +123 -0
- package/dist/surface/validation.js +147 -0
- package/dist/surface/validation.js.map +1 -0
- package/dist/validator.d.ts +55 -0
- package/dist/validator.js +100 -0
- package/dist/validator.js.map +1 -0
- package/package.json +106 -3
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Shell selection — the state a SPLIT shell runs on.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS IS IN THE RUNTIME AND NOT IN THE BLOCK. A split surface (list on the
|
|
6
|
+
* left, detail on the right) has exactly one piece of state: which item is
|
|
7
|
+
* selected. Kept inside the block it is invisible to everything else — the URL
|
|
8
|
+
* does not move, so the page cannot be linked to, the browser Back button does
|
|
9
|
+
* nothing, and a second block on the same surface (a header showing the
|
|
10
|
+
* selected record's title, a toolbar acting on it) has no way to read it.
|
|
11
|
+
*
|
|
12
|
+
* So selection is a SURFACE-level fact with a URL projection:
|
|
13
|
+
*
|
|
14
|
+
* ?<key>=<itemId>
|
|
15
|
+
*
|
|
16
|
+
* and this module is the single place that reads and writes it.
|
|
17
|
+
*
|
|
18
|
+
* THE URL IS THE SOURCE OF TRUTH when syncing is on. React state mirrors it
|
|
19
|
+
* rather than the other way round, which is what makes a pasted link, a Back
|
|
20
|
+
* press and a click on the list all land in the same place — three paths, one
|
|
21
|
+
* rule.
|
|
22
|
+
*
|
|
23
|
+
* INERT HOSTS DO NOT NAVIGATE. An editor or preview canvas renders the same
|
|
24
|
+
* block with `interactionMode: 'inert'`; there the selection stays in memory and
|
|
25
|
+
* the host's own URL is never touched. That mirrors the existing rule for blocks
|
|
26
|
+
* that navigate or write data.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
function readFromUrl(key) {
|
|
30
|
+
if (typeof window === 'undefined')
|
|
31
|
+
return undefined;
|
|
32
|
+
const value = new URLSearchParams(window.location.search).get(key);
|
|
33
|
+
return value === null || value === '' ? undefined : value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a selection store.
|
|
37
|
+
*
|
|
38
|
+
* `syncUrl: false` gives an in-memory store with identical semantics — the same
|
|
39
|
+
* hook, the same cross-block sharing, no address-bar side effects.
|
|
40
|
+
*/
|
|
41
|
+
export function createShellSelectionStore(syncUrl) {
|
|
42
|
+
const memory = new Map();
|
|
43
|
+
const listeners = new Set();
|
|
44
|
+
const emit = () => {
|
|
45
|
+
for (const l of [...listeners])
|
|
46
|
+
l();
|
|
47
|
+
};
|
|
48
|
+
if (syncUrl && typeof window !== 'undefined') {
|
|
49
|
+
window.addEventListener('popstate', emit);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
syncUrl,
|
|
53
|
+
get(key) {
|
|
54
|
+
// URL first: a Back press changes the address without going through
|
|
55
|
+
// `set`, so reading memory would serve a stale value.
|
|
56
|
+
if (syncUrl)
|
|
57
|
+
return readFromUrl(key) ?? memory.get(key);
|
|
58
|
+
return memory.get(key);
|
|
59
|
+
},
|
|
60
|
+
set(key, id) {
|
|
61
|
+
memory.set(key, id);
|
|
62
|
+
if (syncUrl && typeof window !== 'undefined') {
|
|
63
|
+
const url = new URL(window.location.href);
|
|
64
|
+
if (id === undefined)
|
|
65
|
+
url.searchParams.delete(key);
|
|
66
|
+
else
|
|
67
|
+
url.searchParams.set(key, id);
|
|
68
|
+
// pushState, not replaceState: selecting a record is a navigation the
|
|
69
|
+
// user expects Back to undo. That is the whole point of putting it in
|
|
70
|
+
// the URL rather than in a ref.
|
|
71
|
+
if (url.href !== window.location.href)
|
|
72
|
+
window.history.pushState({}, '', url);
|
|
73
|
+
}
|
|
74
|
+
emit();
|
|
75
|
+
},
|
|
76
|
+
subscribe(listener) {
|
|
77
|
+
listeners.add(listener);
|
|
78
|
+
return () => {
|
|
79
|
+
listeners.delete(listener);
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// ============================================================
|
|
85
|
+
// CONTEXT
|
|
86
|
+
// ============================================================
|
|
87
|
+
export const ShellSelectionContext = React.createContext(null);
|
|
88
|
+
export function ShellSelectionProvider({ syncUrl = true, children, }) {
|
|
89
|
+
const store = React.useMemo(() => createShellSelectionStore(syncUrl), [syncUrl]);
|
|
90
|
+
return _jsx(ShellSelectionContext.Provider, { value: store, children: children });
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Read and write the shell selection for `key`.
|
|
94
|
+
*
|
|
95
|
+
* Works with OR without a provider: with no `ShellSelectionProvider` above it,
|
|
96
|
+
* the hook makes its own store, so a block dropped into a bare React tree keeps
|
|
97
|
+
* behaving instead of throwing. The provider only widens the scope — one store
|
|
98
|
+
* per surface means two blocks reading the same key see the same value.
|
|
99
|
+
*/
|
|
100
|
+
export function useShellSelection(key, options = {}) {
|
|
101
|
+
const provided = React.useContext(ShellSelectionContext);
|
|
102
|
+
const wantsSync = options.syncUrl ?? provided?.syncUrl ?? true;
|
|
103
|
+
// A provider whose sync setting disagrees with this block's is not usable —
|
|
104
|
+
// an inert block inside a live surface must not push history.
|
|
105
|
+
const usable = provided && provided.syncUrl === wantsSync ? provided : null;
|
|
106
|
+
const fallbackStore = React.useMemo(() => (usable ? null : createShellSelectionStore(wantsSync)), [usable, wantsSync]);
|
|
107
|
+
const store = usable ?? fallbackStore;
|
|
108
|
+
const subscribe = React.useCallback((l) => store.subscribe(l), [store]);
|
|
109
|
+
const selected = React.useSyncExternalStore(subscribe, () => store.get(key),
|
|
110
|
+
// Server render: no URL, no memory — the fallback is the honest answer.
|
|
111
|
+
() => undefined);
|
|
112
|
+
const select = React.useCallback((id) => {
|
|
113
|
+
store.set(key, id);
|
|
114
|
+
}, [store, key]);
|
|
115
|
+
return [selected ?? options.fallback, select];
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=shell-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-selection.js","sourceRoot":"","sources":["../../src/render/shell-selection.tsx"],"names":[],"mappings":"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","sourcesContent":["/**\n * Shell selection — the state a SPLIT shell runs on.\n *\n * WHY THIS IS IN THE RUNTIME AND NOT IN THE BLOCK. A split surface (list on the\n * left, detail on the right) has exactly one piece of state: which item is\n * selected. Kept inside the block it is invisible to everything else — the URL\n * does not move, so the page cannot be linked to, the browser Back button does\n * nothing, and a second block on the same surface (a header showing the\n * selected record's title, a toolbar acting on it) has no way to read it.\n *\n * So selection is a SURFACE-level fact with a URL projection:\n *\n * ?<key>=<itemId>\n *\n * and this module is the single place that reads and writes it.\n *\n * THE URL IS THE SOURCE OF TRUTH when syncing is on. React state mirrors it\n * rather than the other way round, which is what makes a pasted link, a Back\n * press and a click on the list all land in the same place — three paths, one\n * rule.\n *\n * INERT HOSTS DO NOT NAVIGATE. An editor or preview canvas renders the same\n * block with `interactionMode: 'inert'`; there the selection stays in memory and\n * the host's own URL is never touched. That mirrors the existing rule for blocks\n * that navigate or write data.\n */\nimport * as React from 'react'\n\n// ============================================================\n// STORE\n// ============================================================\n\ntype Listener = () => void\n\nexport interface ShellSelectionStore {\n /** Current selection for a key, or undefined when nothing is selected. */\n get(key: string): string | undefined\n /** Select an item. Writes the URL when this store syncs. */\n set(key: string, id: string | undefined): void\n subscribe(listener: Listener): () => void\n readonly syncUrl: boolean\n}\n\nfunction readFromUrl(key: string): string | undefined {\n if (typeof window === 'undefined') return undefined\n const value = new URLSearchParams(window.location.search).get(key)\n return value === null || value === '' ? undefined : value\n}\n\n/**\n * Create a selection store.\n *\n * `syncUrl: false` gives an in-memory store with identical semantics — the same\n * hook, the same cross-block sharing, no address-bar side effects.\n */\nexport function createShellSelectionStore(syncUrl: boolean): ShellSelectionStore {\n const memory = new Map<string, string | undefined>()\n const listeners = new Set<Listener>()\n const emit = (): void => {\n for (const l of [...listeners]) l()\n }\n\n if (syncUrl && typeof window !== 'undefined') {\n window.addEventListener('popstate', emit)\n }\n\n return {\n syncUrl,\n get(key) {\n // URL first: a Back press changes the address without going through\n // `set`, so reading memory would serve a stale value.\n if (syncUrl) return readFromUrl(key) ?? memory.get(key)\n return memory.get(key)\n },\n set(key, id) {\n memory.set(key, id)\n if (syncUrl && typeof window !== 'undefined') {\n const url = new URL(window.location.href)\n if (id === undefined) url.searchParams.delete(key)\n else url.searchParams.set(key, id)\n // pushState, not replaceState: selecting a record is a navigation the\n // user expects Back to undo. That is the whole point of putting it in\n // the URL rather than in a ref.\n if (url.href !== window.location.href) window.history.pushState({}, '', url)\n }\n emit()\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\n// ============================================================\n// CONTEXT\n// ============================================================\n\nexport const ShellSelectionContext = React.createContext<ShellSelectionStore | null>(null)\n\nexport interface ShellSelectionProviderProps {\n /** Off for editor/preview canvases — selection works, the address bar does not move. */\n readonly syncUrl?: boolean\n readonly children: React.ReactNode\n}\n\nexport function ShellSelectionProvider({\n syncUrl = true,\n children,\n}: ShellSelectionProviderProps): React.ReactElement {\n const store = React.useMemo(() => createShellSelectionStore(syncUrl), [syncUrl])\n return <ShellSelectionContext.Provider value={store}>{children}</ShellSelectionContext.Provider>\n}\n\n// ============================================================\n// HOOK\n// ============================================================\n\nexport interface ShellSelectionOptions {\n /** Selected when the URL carries nothing — normally the first list item. */\n readonly fallback?: string | undefined\n /**\n * Override the provider. A block rendered inert must not move the host's URL\n * even when the surrounding surface is live.\n */\n readonly syncUrl?: boolean\n}\n\n/**\n * Read and write the shell selection for `key`.\n *\n * Works with OR without a provider: with no `ShellSelectionProvider` above it,\n * the hook makes its own store, so a block dropped into a bare React tree keeps\n * behaving instead of throwing. The provider only widens the scope — one store\n * per surface means two blocks reading the same key see the same value.\n */\nexport function useShellSelection(\n key: string,\n options: ShellSelectionOptions = {}\n): readonly [string | undefined, (id: string | undefined) => void] {\n const provided = React.useContext(ShellSelectionContext)\n const wantsSync = options.syncUrl ?? provided?.syncUrl ?? true\n // A provider whose sync setting disagrees with this block's is not usable —\n // an inert block inside a live surface must not push history.\n const usable = provided && provided.syncUrl === wantsSync ? provided : null\n const fallbackStore = React.useMemo(\n () => (usable ? null : createShellSelectionStore(wantsSync)),\n [usable, wantsSync]\n )\n const store = usable ?? (fallbackStore as ShellSelectionStore)\n\n const subscribe = React.useCallback((l: Listener) => store.subscribe(l), [store])\n const selected = React.useSyncExternalStore(\n subscribe,\n () => store.get(key),\n // Server render: no URL, no memory — the fallback is the honest answer.\n () => undefined\n )\n\n const select = React.useCallback(\n (id: string | undefined) => {\n store.set(key, id)\n },\n [store, key]\n )\n\n return [selected ?? options.fallback, select] as const\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction-state CSS generation (token-driven hover/active/focus).
|
|
3
|
+
*
|
|
4
|
+
* `block.style` sits inline and cannot express pseudo-classes, so per-state
|
|
5
|
+
* styling lives in `block.states` and the runtime emits scoped CSS rules —
|
|
6
|
+
* keyed by the block's `data-block-id` — into the surface's generated
|
|
7
|
+
* `<style>` (the SAME mechanism `layout.hideOn`/`showOn` use). For a block
|
|
8
|
+
* with `states`, the runtime emits:
|
|
9
|
+
*
|
|
10
|
+
* `[data-pw-surface] [data-block-id="<id>"]:hover{ … }`
|
|
11
|
+
* `[data-pw-surface] [data-block-id="<id>"]:active{ … }`
|
|
12
|
+
* `[data-pw-surface] [data-block-id="<id>"]:focus-visible{ … }`
|
|
13
|
+
*
|
|
14
|
+
* Keys are CSS camelCase property names (converted to kebab-case); values pass
|
|
15
|
+
* through untouched, so `var(--pw-color-primary-subtle)` works. Blocks without
|
|
16
|
+
* `states` emit zero bytes so existing surfaces are byte-identical.
|
|
17
|
+
*
|
|
18
|
+
* @module @pwfabric/runtime/render/states-css
|
|
19
|
+
*/
|
|
20
|
+
import type { Block } from '@pwfabric/core';
|
|
21
|
+
/**
|
|
22
|
+
* Emit the scoped CSS rule(s) for a single block's interaction states. Targets
|
|
23
|
+
* `[data-block-id="<id>"]<pseudo>` scoped under the surface root so it cannot
|
|
24
|
+
* leak to the host page. Returns '' when the block declares no non-empty state.
|
|
25
|
+
*/
|
|
26
|
+
export declare function blockStatesCss(blockId: string, states: NonNullable<Block['states']>, surfaceId?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Walk a surface block tree and concatenate the per-block interaction-state CSS
|
|
29
|
+
* for every block declaring `states`. Blocks without `states` are skipped (zero
|
|
30
|
+
* bytes emitted) so existing surfaces are byte-identical.
|
|
31
|
+
*/
|
|
32
|
+
export declare function collectStatesCss(blocks: readonly Block[], surfaceId?: string): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction-state CSS generation (token-driven hover/active/focus).
|
|
3
|
+
*
|
|
4
|
+
* `block.style` sits inline and cannot express pseudo-classes, so per-state
|
|
5
|
+
* styling lives in `block.states` and the runtime emits scoped CSS rules —
|
|
6
|
+
* keyed by the block's `data-block-id` — into the surface's generated
|
|
7
|
+
* `<style>` (the SAME mechanism `layout.hideOn`/`showOn` use). For a block
|
|
8
|
+
* with `states`, the runtime emits:
|
|
9
|
+
*
|
|
10
|
+
* `[data-pw-surface] [data-block-id="<id>"]:hover{ … }`
|
|
11
|
+
* `[data-pw-surface] [data-block-id="<id>"]:active{ … }`
|
|
12
|
+
* `[data-pw-surface] [data-block-id="<id>"]:focus-visible{ … }`
|
|
13
|
+
*
|
|
14
|
+
* Keys are CSS camelCase property names (converted to kebab-case); values pass
|
|
15
|
+
* through untouched, so `var(--pw-color-primary-subtle)` works. Blocks without
|
|
16
|
+
* `states` emit zero bytes so existing surfaces are byte-identical.
|
|
17
|
+
*
|
|
18
|
+
* @module @pwfabric/runtime/render/states-css
|
|
19
|
+
*/
|
|
20
|
+
import { blockSelector, camelToKebab, collectScopedCss } from './scoped-css.js';
|
|
21
|
+
/** Pseudo-state → selector suffix. `focus` maps to `:focus-visible`. */
|
|
22
|
+
const STATE_SELECTORS = {
|
|
23
|
+
hover: ':hover',
|
|
24
|
+
active: ':active',
|
|
25
|
+
focus: ':focus-visible',
|
|
26
|
+
};
|
|
27
|
+
/** Serialize a camelCase decl record to `prop:value;…` (values pass through). */
|
|
28
|
+
function declsToCss(decls) {
|
|
29
|
+
return Object.entries(decls)
|
|
30
|
+
.map(([prop, value]) => `${camelToKebab(prop)}:${value}`)
|
|
31
|
+
.join(';');
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Emit the scoped CSS rule(s) for a single block's interaction states. Targets
|
|
35
|
+
* `[data-block-id="<id>"]<pseudo>` scoped under the surface root so it cannot
|
|
36
|
+
* leak to the host page. Returns '' when the block declares no non-empty state.
|
|
37
|
+
*/
|
|
38
|
+
export function blockStatesCss(blockId, states, surfaceId) {
|
|
39
|
+
const selector = blockSelector(blockId, surfaceId);
|
|
40
|
+
let css = '';
|
|
41
|
+
for (const key of ['hover', 'active', 'focus']) {
|
|
42
|
+
const decls = states[key];
|
|
43
|
+
if (!decls || Object.keys(decls).length === 0)
|
|
44
|
+
continue;
|
|
45
|
+
// `data-block-id` lives on BOTH the renderer wrapper and the component root
|
|
46
|
+
// (the wrapper keeps `data-block-wrapper`). A state rule keyed on the bare
|
|
47
|
+
// id therefore fired twice: the square wrapper took the hover box-shadow
|
|
48
|
+
// (square corners bleeding out from under a rounded card) and transforms
|
|
49
|
+
// compounded. Exclude the wrapper — visual states belong to the styled
|
|
50
|
+
// component root only.
|
|
51
|
+
css += `${selector}:not([data-block-wrapper])${STATE_SELECTORS[key]}{${declsToCss(decls)}}`;
|
|
52
|
+
}
|
|
53
|
+
return css;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Walk a surface block tree and concatenate the per-block interaction-state CSS
|
|
57
|
+
* for every block declaring `states`. Blocks without `states` are skipped (zero
|
|
58
|
+
* bytes emitted) so existing surfaces are byte-identical.
|
|
59
|
+
*/
|
|
60
|
+
export function collectStatesCss(blocks, surfaceId) {
|
|
61
|
+
return collectScopedCss(blocks, (block) => block.states ? blockStatesCss(block.id, block.states, surfaceId) : '');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=states-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"states-css.js","sourceRoot":"","sources":["../../src/render/states-css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAE/E,wEAAwE;AACxE,MAAM,eAAe,GAAiD;IACpE,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,gBAAgB;CACxB,CAAA;AAED,iFAAiF;AACjF,SAAS,UAAU,CAAC,KAAuC;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;SACxD,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,MAAoC,EACpC,SAAkB;IAElB,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAClD,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU,EAAE,CAAC;QACxD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QACzB,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,SAAQ;QACvD,4EAA4E;QAC5E,2EAA2E;QAC3E,yEAAyE;QACzE,yEAAyE;QACzE,uEAAuE;QACvE,uBAAuB;QACvB,GAAG,IAAI,GAAG,QAAQ,6BAA6B,eAAe,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAA;IAC7F,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAwB,EAAE,SAAkB;IAC3E,OAAO,gBAAgB,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CACxC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CACtE,CAAA;AACH,CAAC","sourcesContent":["/**\n * Interaction-state CSS generation (token-driven hover/active/focus).\n *\n * `block.style` sits inline and cannot express pseudo-classes, so per-state\n * styling lives in `block.states` and the runtime emits scoped CSS rules —\n * keyed by the block's `data-block-id` — into the surface's generated\n * `<style>` (the SAME mechanism `layout.hideOn`/`showOn` use). For a block\n * with `states`, the runtime emits:\n *\n * `[data-pw-surface] [data-block-id=\"<id>\"]:hover{ … }`\n * `[data-pw-surface] [data-block-id=\"<id>\"]:active{ … }`\n * `[data-pw-surface] [data-block-id=\"<id>\"]:focus-visible{ … }`\n *\n * Keys are CSS camelCase property names (converted to kebab-case); values pass\n * through untouched, so `var(--pw-color-primary-subtle)` works. Blocks without\n * `states` emit zero bytes so existing surfaces are byte-identical.\n *\n * @module @pwfabric/runtime/render/states-css\n */\n\nimport type { Block } from '@pwfabric/core'\nimport { blockSelector, camelToKebab, collectScopedCss } from './scoped-css.js'\n\n/** Pseudo-state → selector suffix. `focus` maps to `:focus-visible`. */\nconst STATE_SELECTORS: Record<'hover' | 'active' | 'focus', string> = {\n hover: ':hover',\n active: ':active',\n focus: ':focus-visible',\n}\n\n/** Serialize a camelCase decl record to `prop:value;…` (values pass through). */\nfunction declsToCss(decls: Readonly<Record<string, string>>): string {\n return Object.entries(decls)\n .map(([prop, value]) => `${camelToKebab(prop)}:${value}`)\n .join(';')\n}\n\n/**\n * Emit the scoped CSS rule(s) for a single block's interaction states. Targets\n * `[data-block-id=\"<id>\"]<pseudo>` scoped under the surface root so it cannot\n * leak to the host page. Returns '' when the block declares no non-empty state.\n */\nexport function blockStatesCss(\n blockId: string,\n states: NonNullable<Block['states']>,\n surfaceId?: string\n): string {\n const selector = blockSelector(blockId, surfaceId)\n let css = ''\n for (const key of ['hover', 'active', 'focus'] as const) {\n const decls = states[key]\n if (!decls || Object.keys(decls).length === 0) continue\n // `data-block-id` lives on BOTH the renderer wrapper and the component root\n // (the wrapper keeps `data-block-wrapper`). A state rule keyed on the bare\n // id therefore fired twice: the square wrapper took the hover box-shadow\n // (square corners bleeding out from under a rounded card) and transforms\n // compounded. Exclude the wrapper — visual states belong to the styled\n // component root only.\n css += `${selector}:not([data-block-wrapper])${STATE_SELECTORS[key]}{${declsToCss(decls)}}`\n }\n return css\n}\n\n/**\n * Walk a surface block tree and concatenate the per-block interaction-state CSS\n * for every block declaring `states`. Blocks without `states` are skipped (zero\n * bytes emitted) so existing surfaces are byte-identical.\n */\nexport function collectStatesCss(blocks: readonly Block[], surfaceId?: string): string {\n return collectScopedCss(blocks, (block) =>\n block.states ? blockStatesCss(block.id, block.states, surfaceId) : ''\n )\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Data Context
|
|
3
|
+
*
|
|
4
|
+
* What the data-bound renderer has CURRENTLY bound, keyed by source id — the
|
|
5
|
+
* same object block expressions resolve `{{<sourceId>}}` against, offered to
|
|
6
|
+
* the providers that sit between the data layer and the blocks.
|
|
7
|
+
*
|
|
8
|
+
* The form writer needs it: a binding that says `PATCH` can only name a
|
|
9
|
+
* record the page has loaded, and until this context existed the writer
|
|
10
|
+
* could not see one — so it patched the collection path and the API said
|
|
11
|
+
* 404. `null` outside the data-bound path (behaviours-only surfaces, plain
|
|
12
|
+
* `SurfaceRenderer`), where there is nothing bound to consult.
|
|
13
|
+
*
|
|
14
|
+
* @module @pwfabric/runtime/render/surface-data-context
|
|
15
|
+
*/
|
|
16
|
+
export type SurfaceData = Readonly<Record<string, unknown>>;
|
|
17
|
+
export declare const SurfaceDataContext: import("react").Context<Readonly<Record<string, unknown>> | null>;
|
|
18
|
+
export declare function useSurfaceData(): SurfaceData | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Data Context
|
|
3
|
+
*
|
|
4
|
+
* What the data-bound renderer has CURRENTLY bound, keyed by source id — the
|
|
5
|
+
* same object block expressions resolve `{{<sourceId>}}` against, offered to
|
|
6
|
+
* the providers that sit between the data layer and the blocks.
|
|
7
|
+
*
|
|
8
|
+
* The form writer needs it: a binding that says `PATCH` can only name a
|
|
9
|
+
* record the page has loaded, and until this context existed the writer
|
|
10
|
+
* could not see one — so it patched the collection path and the API said
|
|
11
|
+
* 404. `null` outside the data-bound path (behaviours-only surfaces, plain
|
|
12
|
+
* `SurfaceRenderer`), where there is nothing bound to consult.
|
|
13
|
+
*
|
|
14
|
+
* @module @pwfabric/runtime/render/surface-data-context
|
|
15
|
+
*/
|
|
16
|
+
import { createContext, useContext } from 'react';
|
|
17
|
+
export const SurfaceDataContext = createContext(null);
|
|
18
|
+
export function useSurfaceData() {
|
|
19
|
+
return useContext(SurfaceDataContext);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=surface-data-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-data-context.js","sourceRoot":"","sources":["../../src/render/surface-data-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAEzE,MAAM,UAAU,cAAc;IAC5B,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAA;AACvC,CAAC","sourcesContent":["/**\n * Surface Data Context\n *\n * What the data-bound renderer has CURRENTLY bound, keyed by source id — the\n * same object block expressions resolve `{{<sourceId>}}` against, offered to\n * the providers that sit between the data layer and the blocks.\n *\n * The form writer needs it: a binding that says `PATCH` can only name a\n * record the page has loaded, and until this context existed the writer\n * could not see one — so it patched the collection path and the API said\n * 404. `null` outside the data-bound path (behaviours-only surfaces, plain\n * `SurfaceRenderer`), where there is nothing bound to consult.\n *\n * @module @pwfabric/runtime/render/surface-data-context\n */\n\nimport { createContext, useContext } from 'react'\n\nexport type SurfaceData = Readonly<Record<string, unknown>>\n\nexport const SurfaceDataContext = createContext<SurfaceData | null>(null)\n\nexport function useSurfaceData(): SurfaceData | null {\n return useContext(SurfaceDataContext)\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Event Bus Implementation
|
|
3
|
+
*
|
|
4
|
+
* In-process pub/sub bus scoped to a single rendered surface.
|
|
5
|
+
*
|
|
6
|
+
* @module @pwfabric/runtime/render/surface-event-bus
|
|
7
|
+
*/
|
|
8
|
+
import type { SurfaceEventBus } from '@pwfabric/contracts';
|
|
9
|
+
/**
|
|
10
|
+
* Create a new `SurfaceEventBus` instance.
|
|
11
|
+
*
|
|
12
|
+
* Each surface renderer creates its own bus so that events from one surface
|
|
13
|
+
* do not leak into sibling or parent surfaces.
|
|
14
|
+
*
|
|
15
|
+
* Wildcard support: listeners registered as `"<namespace>:*"` (e.g.
|
|
16
|
+
* `"capability:*"`) receive every event whose type starts with that namespace
|
|
17
|
+
* prefix (e.g. `"capability:data-loaded"`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSurfaceEventBus(): SurfaceEventBus;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Event Bus Implementation
|
|
3
|
+
*
|
|
4
|
+
* In-process pub/sub bus scoped to a single rendered surface.
|
|
5
|
+
*
|
|
6
|
+
* @module @pwfabric/runtime/render/surface-event-bus
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create a new `SurfaceEventBus` instance.
|
|
10
|
+
*
|
|
11
|
+
* Each surface renderer creates its own bus so that events from one surface
|
|
12
|
+
* do not leak into sibling or parent surfaces.
|
|
13
|
+
*
|
|
14
|
+
* Wildcard support: listeners registered as `"<namespace>:*"` (e.g.
|
|
15
|
+
* `"capability:*"`) receive every event whose type starts with that namespace
|
|
16
|
+
* prefix (e.g. `"capability:data-loaded"`).
|
|
17
|
+
*/
|
|
18
|
+
export function createSurfaceEventBus() {
|
|
19
|
+
const handlers = new Map();
|
|
20
|
+
return {
|
|
21
|
+
emit(event) {
|
|
22
|
+
// Dev-mode payload validation — async/lazy, does not block emit
|
|
23
|
+
if (process.env.NODE_ENV === 'development') {
|
|
24
|
+
// Import lazily to avoid prod bundle size impact
|
|
25
|
+
void import('@pwfabric/contracts').then(({ SURFACE_EVENT_PAYLOAD_SCHEMAS }) => {
|
|
26
|
+
const schema = SURFACE_EVENT_PAYLOAD_SCHEMAS[event.type];
|
|
27
|
+
if (schema && event.payload !== undefined) {
|
|
28
|
+
const result = schema.safeParse(event.payload);
|
|
29
|
+
if (!result.success) {
|
|
30
|
+
console.warn(`[SurfaceEventBus] Payload validation warning for '${event.type}':`, result.error.flatten());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
// Exact-match listeners
|
|
36
|
+
const exactSet = handlers.get(event.type);
|
|
37
|
+
if (exactSet) {
|
|
38
|
+
exactSet.forEach((h) => h(event));
|
|
39
|
+
}
|
|
40
|
+
// Wildcard listeners for the namespace prefix (e.g. "block:*")
|
|
41
|
+
const ns = event.type.split(':')[0];
|
|
42
|
+
const wildcardSet = handlers.get(`${ns}:*`);
|
|
43
|
+
if (wildcardSet) {
|
|
44
|
+
wildcardSet.forEach((h) => h(event));
|
|
45
|
+
}
|
|
46
|
+
// Global wildcard "*" — every event. The surface renderer subscribes its
|
|
47
|
+
// single event handler here so block-emitted events (with their full
|
|
48
|
+
// payload, incl. a declarative `action`) reach the action dispatcher. This
|
|
49
|
+
// is what lets a form's submit→setState run via the canonical bus path
|
|
50
|
+
// instead of the retired legacy `context.onEvent` shim.
|
|
51
|
+
const globalSet = handlers.get('*');
|
|
52
|
+
if (globalSet) {
|
|
53
|
+
globalSet.forEach((h) => h(event));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
on(eventType, handler) {
|
|
57
|
+
if (!handlers.has(eventType)) {
|
|
58
|
+
handlers.set(eventType, new Set());
|
|
59
|
+
}
|
|
60
|
+
handlers.get(eventType)?.add(handler);
|
|
61
|
+
return () => handlers.get(eventType)?.delete(handler);
|
|
62
|
+
},
|
|
63
|
+
off(eventType, handler) {
|
|
64
|
+
handlers.get(eventType)?.delete(handler);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=surface-event-bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-event-bus.js","sourceRoot":"","sources":["../../src/render/surface-event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoC,CAAA;IAE5D,OAAO;QACL,IAAI,CAAC,KAA6B;YAChC,gEAAgE;YAChE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC3C,iDAAiD;gBACjD,KAAK,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,6BAA6B,EAAE,EAAE,EAAE;oBAC5E,MAAM,MAAM,GACV,6BAA6B,CAAC,KAAK,CAAC,IAAkD,CAAC,CAAA;oBACzF,IAAI,MAAM,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;wBAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;wBAC9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;4BACpB,OAAO,CAAC,IAAI,CACV,qDAAqD,KAAK,CAAC,IAAI,IAAI,EACnE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CACvB,CAAA;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC;YAED,wBAAwB;YACxB,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACzC,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YACnC,CAAC;YAED,+DAA+D;YAC/D,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACnC,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YAC3C,IAAI,WAAW,EAAE,CAAC;gBAChB,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YACtC,CAAC;YAED,yEAAyE;YACzE,qEAAqE;YACrE,2EAA2E;YAC3E,uEAAuE;YACvE,wDAAwD;YACxD,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACnC,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YACpC,CAAC;QACH,CAAC;QAED,EAAE,CAAC,SAAiB,EAAE,OAA4B;YAChD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,EAAE,CAAC,CAAA;YACpC,CAAC;YACD,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;YACrC,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QACvD,CAAC;QAED,GAAG,CAAC,SAAiB,EAAE,OAA4B;YACjD,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;QAC1C,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["/**\n * Surface Event Bus Implementation\n *\n * In-process pub/sub bus scoped to a single rendered surface.\n *\n * @module @pwfabric/runtime/render/surface-event-bus\n */\n\nimport type {\n SurfaceEventBus,\n SurfaceEventDescriptor,\n SurfaceEventHandler,\n Unsubscribe,\n} from '@pwfabric/contracts'\n\n/**\n * Create a new `SurfaceEventBus` instance.\n *\n * Each surface renderer creates its own bus so that events from one surface\n * do not leak into sibling or parent surfaces.\n *\n * Wildcard support: listeners registered as `\"<namespace>:*\"` (e.g.\n * `\"capability:*\"`) receive every event whose type starts with that namespace\n * prefix (e.g. `\"capability:data-loaded\"`).\n */\nexport function createSurfaceEventBus(): SurfaceEventBus {\n const handlers = new Map<string, Set<SurfaceEventHandler>>()\n\n return {\n emit(event: SurfaceEventDescriptor): void {\n // Dev-mode payload validation — async/lazy, does not block emit\n if (process.env.NODE_ENV === 'development') {\n // Import lazily to avoid prod bundle size impact\n void import('@pwfabric/contracts').then(({ SURFACE_EVENT_PAYLOAD_SCHEMAS }) => {\n const schema =\n SURFACE_EVENT_PAYLOAD_SCHEMAS[event.type as keyof typeof SURFACE_EVENT_PAYLOAD_SCHEMAS]\n if (schema && event.payload !== undefined) {\n const result = schema.safeParse(event.payload)\n if (!result.success) {\n console.warn(\n `[SurfaceEventBus] Payload validation warning for '${event.type}':`,\n result.error.flatten()\n )\n }\n }\n })\n }\n\n // Exact-match listeners\n const exactSet = handlers.get(event.type)\n if (exactSet) {\n exactSet.forEach((h) => h(event))\n }\n\n // Wildcard listeners for the namespace prefix (e.g. \"block:*\")\n const ns = event.type.split(':')[0]\n const wildcardSet = handlers.get(`${ns}:*`)\n if (wildcardSet) {\n wildcardSet.forEach((h) => h(event))\n }\n\n // Global wildcard \"*\" — every event. The surface renderer subscribes its\n // single event handler here so block-emitted events (with their full\n // payload, incl. a declarative `action`) reach the action dispatcher. This\n // is what lets a form's submit→setState run via the canonical bus path\n // instead of the retired legacy `context.onEvent` shim.\n const globalSet = handlers.get('*')\n if (globalSet) {\n globalSet.forEach((h) => h(event))\n }\n },\n\n on(eventType: string, handler: SurfaceEventHandler): Unsubscribe {\n if (!handlers.has(eventType)) {\n handlers.set(eventType, new Set())\n }\n handlers.get(eventType)?.add(handler)\n return () => handlers.get(eventType)?.delete(handler)\n },\n\n off(eventType: string, handler: SurfaceEventHandler): void {\n handlers.get(eventType)?.delete(handler)\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Event Context
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the canonical `SurfaceEventContext` from `@pwfabric/runtime/blocks`.
|
|
5
|
+
* Runtime code that sets the context via
|
|
6
|
+
* `BehaviorSurfaceProvider` and block components that consume it via
|
|
7
|
+
* `useSurfaceEvents` share the same context object through this re-export.
|
|
8
|
+
*
|
|
9
|
+
* @module @pwfabric/runtime/render/surface-event-context
|
|
10
|
+
*/
|
|
11
|
+
export { SurfaceEventContext } from '../blocks/surface-event-context.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Event Context
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the canonical `SurfaceEventContext` from `@pwfabric/runtime/blocks`.
|
|
5
|
+
* Runtime code that sets the context via
|
|
6
|
+
* `BehaviorSurfaceProvider` and block components that consume it via
|
|
7
|
+
* `useSurfaceEvents` share the same context object through this re-export.
|
|
8
|
+
*
|
|
9
|
+
* @module @pwfabric/runtime/render/surface-event-context
|
|
10
|
+
*/
|
|
11
|
+
export { SurfaceEventContext } from '../blocks/surface-event-context.js';
|
|
12
|
+
//# sourceMappingURL=surface-event-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-event-context.js","sourceRoot":"","sources":["../../src/render/surface-event-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA","sourcesContent":["/**\n * Surface Event Context\n *\n * Re-exports the canonical `SurfaceEventContext` from `@pwfabric/runtime/blocks`.\n * Runtime code that sets the context via\n * `BehaviorSurfaceProvider` and block components that consume it via\n * `useSurfaceEvents` share the same context object through this re-export.\n *\n * @module @pwfabric/runtime/render/surface-event-context\n */\n\nexport { SurfaceEventContext } from '../blocks/surface-event-context.js'\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface ID Context
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the canonical `SurfaceIdContext` from `@pwfabric/runtime/blocks`.
|
|
5
|
+
*
|
|
6
|
+
* @module @pwfabric/runtime/render/surface-id-context
|
|
7
|
+
*/
|
|
8
|
+
export { SurfaceIdContext } from '../blocks/surface-id-context.js';
|
|
9
|
+
//# sourceMappingURL=surface-id-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-id-context.js","sourceRoot":"","sources":["../../src/render/surface-id-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA","sourcesContent":["/**\n * Surface ID Context\n *\n * Re-exports the canonical `SurfaceIdContext` from `@pwfabric/runtime/blocks`.\n *\n * @module @pwfabric/runtime/render/surface-id-context\n */\n\nexport { SurfaceIdContext } from '../blocks/surface-id-context.js'\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Theme Utilities
|
|
3
|
+
*
|
|
4
|
+
* Surface Theme Engine — converts SurfaceTheme to CSS custom properties.
|
|
5
|
+
*
|
|
6
|
+
* The implementation MOVED to `@pwfabric/contracts`
|
|
7
|
+
* (`fabric/appearance-cascade`) shared with the theme exporter (export
|
|
8
|
+
* `theme.css`) and the authoring studio (bake the dark variant at write time) need the same
|
|
9
|
+
* transform, and `contracts` is the only leaf all three can reach. This module
|
|
10
|
+
* stays as the runtime-facing name so existing import paths keep working.
|
|
11
|
+
*
|
|
12
|
+
* @module @pwfabric/runtime/render/theme-utils
|
|
13
|
+
*/
|
|
14
|
+
export { surfaceThemeToCSS } from '@pwfabric/contracts';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface Theme Utilities
|
|
3
|
+
*
|
|
4
|
+
* Surface Theme Engine — converts SurfaceTheme to CSS custom properties.
|
|
5
|
+
*
|
|
6
|
+
* The implementation MOVED to `@pwfabric/contracts`
|
|
7
|
+
* (`fabric/appearance-cascade`) shared with the theme exporter (export
|
|
8
|
+
* `theme.css`) and the authoring studio (bake the dark variant at write time) need the same
|
|
9
|
+
* transform, and `contracts` is the only leaf all three can reach. This module
|
|
10
|
+
* stays as the runtime-facing name so existing import paths keep working.
|
|
11
|
+
*
|
|
12
|
+
* @module @pwfabric/runtime/render/theme-utils
|
|
13
|
+
*/
|
|
14
|
+
export { surfaceThemeToCSS } from '@pwfabric/contracts';
|
|
15
|
+
//# sourceMappingURL=theme-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-utils.js","sourceRoot":"","sources":["../../src/render/theme-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA","sourcesContent":["/**\n * Surface Theme Utilities\n *\n * Surface Theme Engine — converts SurfaceTheme to CSS custom properties.\n *\n * The implementation MOVED to `@pwfabric/contracts`\n * (`fabric/appearance-cascade`) shared with the theme exporter (export\n * `theme.css`) and the authoring studio (bake the dark variant at write time) need the same\n * transform, and `contracts` is the only leaf all three can reach. This module\n * stays as the runtime-facing name so existing import paths keep working.\n *\n * @module @pwfabric/runtime/render/theme-utils\n */\n\nexport { surfaceThemeToCSS } from '@pwfabric/contracts'\n"]}
|