@craft-ts/core 0.7.0-beta.13
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 +21 -0
- package/package.json +58 -0
- package/src/index.d.ts +148 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +150 -0
- package/src/index.js.map +1 -0
- package/src/lib/after-recomputation.d.ts +327 -0
- package/src/lib/after-recomputation.d.ts.map +1 -0
- package/src/lib/after-recomputation.js +25 -0
- package/src/lib/after-recomputation.js.map +1 -0
- package/src/lib/app-checked-di.d.ts +82 -0
- package/src/lib/app-checked-di.d.ts.map +1 -0
- package/src/lib/app-checked-di.js +1 -0
- package/src/lib/app-checked-di.js.map +1 -0
- package/src/lib/async-process.d.ts +411 -0
- package/src/lib/async-process.d.ts.map +1 -0
- package/src/lib/async-process.js +702 -0
- package/src/lib/async-process.js.map +1 -0
- package/src/lib/branded-component/branded-component.d.ts +129 -0
- package/src/lib/branded-component/branded-component.d.ts.map +1 -0
- package/src/lib/branded-component/branded-component.js +7 -0
- package/src/lib/branded-component/branded-component.js.map +1 -0
- package/src/lib/browser-boundaries.d.ts +165 -0
- package/src/lib/browser-boundaries.d.ts.map +1 -0
- package/src/lib/browser-boundaries.js +550 -0
- package/src/lib/browser-boundaries.js.map +1 -0
- package/src/lib/client-di-requirement.d.ts +28 -0
- package/src/lib/client-di-requirement.d.ts.map +1 -0
- package/src/lib/client-di-requirement.js +11 -0
- package/src/lib/client-di-requirement.js.map +1 -0
- package/src/lib/client-function-middleware.d.ts +130 -0
- package/src/lib/client-function-middleware.d.ts.map +1 -0
- package/src/lib/client-function-middleware.js +144 -0
- package/src/lib/client-function-middleware.js.map +1 -0
- package/src/lib/component-monitoring.d.ts +7 -0
- package/src/lib/component-monitoring.d.ts.map +1 -0
- package/src/lib/component-monitoring.js +28 -0
- package/src/lib/component-monitoring.js.map +1 -0
- package/src/lib/component-register.d.ts +12 -0
- package/src/lib/component-register.d.ts.map +1 -0
- package/src/lib/component-register.js +13 -0
- package/src/lib/component-register.js.map +1 -0
- package/src/lib/computed-source.d.ts +303 -0
- package/src/lib/computed-source.d.ts.map +1 -0
- package/src/lib/computed-source.js +319 -0
- package/src/lib/computed-source.js.map +1 -0
- package/src/lib/correlation-id-plugin.d.ts +3 -0
- package/src/lib/correlation-id-plugin.d.ts.map +1 -0
- package/src/lib/correlation-id-plugin.js +73 -0
- package/src/lib/correlation-id-plugin.js.map +1 -0
- package/src/lib/correlation-id.d.ts +30 -0
- package/src/lib/correlation-id.d.ts.map +1 -0
- package/src/lib/correlation-id.js +86 -0
- package/src/lib/correlation-id.js.map +1 -0
- package/src/lib/craft-a11y.d.ts +22 -0
- package/src/lib/craft-a11y.d.ts.map +1 -0
- package/src/lib/craft-a11y.js +32 -0
- package/src/lib/craft-a11y.js.map +1 -0
- package/src/lib/craft-activated-route.d.ts +21 -0
- package/src/lib/craft-activated-route.d.ts.map +1 -0
- package/src/lib/craft-activated-route.js +20 -0
- package/src/lib/craft-activated-route.js.map +1 -0
- package/src/lib/craft-app-config.d.ts +91 -0
- package/src/lib/craft-app-config.d.ts.map +1 -0
- package/src/lib/craft-app-config.js +64 -0
- package/src/lib/craft-app-config.js.map +1 -0
- package/src/lib/craft-codec.d.ts +16 -0
- package/src/lib/craft-codec.d.ts.map +1 -0
- package/src/lib/craft-codec.js +1 -0
- package/src/lib/craft-codec.js.map +1 -0
- package/src/lib/craft-computed.d.ts +31 -0
- package/src/lib/craft-computed.d.ts.map +1 -0
- package/src/lib/craft-computed.js +81 -0
- package/src/lib/craft-computed.js.map +1 -0
- package/src/lib/craft-control-flow.d.ts +14 -0
- package/src/lib/craft-control-flow.d.ts.map +1 -0
- package/src/lib/craft-control-flow.js +18 -0
- package/src/lib/craft-control-flow.js.map +1 -0
- package/src/lib/craft-effect.d.ts +13 -0
- package/src/lib/craft-effect.d.ts.map +1 -0
- package/src/lib/craft-effect.js +93 -0
- package/src/lib/craft-effect.js.map +1 -0
- package/src/lib/craft-exception.d.ts +40 -0
- package/src/lib/craft-exception.d.ts.map +1 -0
- package/src/lib/craft-exception.js +16 -0
- package/src/lib/craft-exception.js.map +1 -0
- package/src/lib/craft-gen.d.ts +123 -0
- package/src/lib/craft-gen.d.ts.map +1 -0
- package/src/lib/craft-gen.js +90 -0
- package/src/lib/craft-gen.js.map +1 -0
- package/src/lib/craft-generator-runtime.d.ts +110 -0
- package/src/lib/craft-generator-runtime.d.ts.map +1 -0
- package/src/lib/craft-generator-runtime.js +191 -0
- package/src/lib/craft-generator-runtime.js.map +1 -0
- package/src/lib/craft-guard-runtime.d.ts +70 -0
- package/src/lib/craft-guard-runtime.d.ts.map +1 -0
- package/src/lib/craft-guard-runtime.js +195 -0
- package/src/lib/craft-guard-runtime.js.map +1 -0
- package/src/lib/craft-handshake.d.ts +35 -0
- package/src/lib/craft-handshake.d.ts.map +1 -0
- package/src/lib/craft-handshake.js +34 -0
- package/src/lib/craft-handshake.js.map +1 -0
- package/src/lib/craft-http-client.d.ts +236 -0
- package/src/lib/craft-http-client.d.ts.map +1 -0
- package/src/lib/craft-http-client.js +437 -0
- package/src/lib/craft-http-client.js.map +1 -0
- package/src/lib/craft-http-trace.d.ts +12 -0
- package/src/lib/craft-http-trace.d.ts.map +1 -0
- package/src/lib/craft-http-trace.js +28 -0
- package/src/lib/craft-http-trace.js.map +1 -0
- package/src/lib/craft-lazy.d.ts +42 -0
- package/src/lib/craft-lazy.d.ts.map +1 -0
- package/src/lib/craft-lazy.js +83 -0
- package/src/lib/craft-lazy.js.map +1 -0
- package/src/lib/craft-load-retry.d.ts +76 -0
- package/src/lib/craft-load-retry.d.ts.map +1 -0
- package/src/lib/craft-load-retry.js +160 -0
- package/src/lib/craft-load-retry.js.map +1 -0
- package/src/lib/craft-machine-history.d.ts +145 -0
- package/src/lib/craft-machine-history.d.ts.map +1 -0
- package/src/lib/craft-machine-history.js +276 -0
- package/src/lib/craft-machine-history.js.map +1 -0
- package/src/lib/craft-match.d.ts +49 -0
- package/src/lib/craft-match.d.ts.map +1 -0
- package/src/lib/craft-match.js +58 -0
- package/src/lib/craft-match.js.map +1 -0
- package/src/lib/craft-method.d.ts +28 -0
- package/src/lib/craft-method.d.ts.map +1 -0
- package/src/lib/craft-method.js +45 -0
- package/src/lib/craft-method.js.map +1 -0
- package/src/lib/craft-node-directive.d.ts +32 -0
- package/src/lib/craft-node-directive.d.ts.map +1 -0
- package/src/lib/craft-node-directive.js +22 -0
- package/src/lib/craft-node-directive.js.map +1 -0
- package/src/lib/craft-pending.d.ts +115 -0
- package/src/lib/craft-pending.d.ts.map +1 -0
- package/src/lib/craft-pending.js +187 -0
- package/src/lib/craft-pending.js.map +1 -0
- package/src/lib/craft-pipe.d.ts +63 -0
- package/src/lib/craft-pipe.d.ts.map +1 -0
- package/src/lib/craft-pipe.js +57 -0
- package/src/lib/craft-pipe.js.map +1 -0
- package/src/lib/craft-platform.d.ts +50 -0
- package/src/lib/craft-platform.d.ts.map +1 -0
- package/src/lib/craft-platform.js +175 -0
- package/src/lib/craft-platform.js.map +1 -0
- package/src/lib/craft-primitive-gen.d.ts +137 -0
- package/src/lib/craft-primitive-gen.d.ts.map +1 -0
- package/src/lib/craft-primitive-gen.js +76 -0
- package/src/lib/craft-primitive-gen.js.map +1 -0
- package/src/lib/craft-primitive-registry.d.ts +113 -0
- package/src/lib/craft-primitive-registry.d.ts.map +1 -0
- package/src/lib/craft-primitive-registry.js +159 -0
- package/src/lib/craft-primitive-registry.js.map +1 -0
- package/src/lib/craft-program-operators.d.ts +101 -0
- package/src/lib/craft-program-operators.d.ts.map +1 -0
- package/src/lib/craft-program-operators.js +116 -0
- package/src/lib/craft-program-operators.js.map +1 -0
- package/src/lib/craft-program-runtime.d.ts +80 -0
- package/src/lib/craft-program-runtime.d.ts.map +1 -0
- package/src/lib/craft-program-runtime.js +166 -0
- package/src/lib/craft-program-runtime.js.map +1 -0
- package/src/lib/craft-register-for-runtime.d.ts +39 -0
- package/src/lib/craft-register-for-runtime.d.ts.map +1 -0
- package/src/lib/craft-register-for-runtime.js +96 -0
- package/src/lib/craft-register-for-runtime.js.map +1 -0
- package/src/lib/craft-register-for.d.ts +57 -0
- package/src/lib/craft-register-for.d.ts.map +1 -0
- package/src/lib/craft-register-for.js +200 -0
- package/src/lib/craft-register-for.js.map +1 -0
- package/src/lib/craft-render-identity.d.ts +19 -0
- package/src/lib/craft-render-identity.d.ts.map +1 -0
- package/src/lib/craft-render-identity.js +23 -0
- package/src/lib/craft-render-identity.js.map +1 -0
- package/src/lib/craft-replay.d.ts +5 -0
- package/src/lib/craft-replay.d.ts.map +1 -0
- package/src/lib/craft-replay.js +28 -0
- package/src/lib/craft-replay.js.map +1 -0
- package/src/lib/craft-resolve.d.ts +39 -0
- package/src/lib/craft-resolve.d.ts.map +1 -0
- package/src/lib/craft-resolve.js +9 -0
- package/src/lib/craft-resolve.js.map +1 -0
- package/src/lib/craft-resource.d.ts +11 -0
- package/src/lib/craft-resource.d.ts.map +1 -0
- package/src/lib/craft-resource.js +264 -0
- package/src/lib/craft-resource.js.map +1 -0
- package/src/lib/craft-route-exceptions.d.ts +785 -0
- package/src/lib/craft-route-exceptions.d.ts.map +1 -0
- package/src/lib/craft-route-exceptions.js +86 -0
- package/src/lib/craft-route-exceptions.js.map +1 -0
- package/src/lib/craft-route-load-error.d.ts +1145 -0
- package/src/lib/craft-route-load-error.d.ts.map +1 -0
- package/src/lib/craft-route-load-error.js +173 -0
- package/src/lib/craft-route-load-error.js.map +1 -0
- package/src/lib/craft-route-meta.d.ts +52 -0
- package/src/lib/craft-route-meta.d.ts.map +1 -0
- package/src/lib/craft-route-meta.js +16 -0
- package/src/lib/craft-route-meta.js.map +1 -0
- package/src/lib/craft-route-target.d.ts +27 -0
- package/src/lib/craft-route-target.d.ts.map +1 -0
- package/src/lib/craft-route-target.js +22 -0
- package/src/lib/craft-route-target.js.map +1 -0
- package/src/lib/craft-router-outlet.d.ts +105 -0
- package/src/lib/craft-router-outlet.d.ts.map +1 -0
- package/src/lib/craft-router-outlet.js +735 -0
- package/src/lib/craft-router-outlet.js.map +1 -0
- package/src/lib/craft-router-tokens.d.ts +49 -0
- package/src/lib/craft-router-tokens.d.ts.map +1 -0
- package/src/lib/craft-router-tokens.js +15 -0
- package/src/lib/craft-router-tokens.js.map +1 -0
- package/src/lib/craft-router-trace.d.ts +18 -0
- package/src/lib/craft-router-trace.d.ts.map +1 -0
- package/src/lib/craft-router-trace.js +54 -0
- package/src/lib/craft-router-trace.js.map +1 -0
- package/src/lib/craft-router.d.ts +248 -0
- package/src/lib/craft-router.d.ts.map +1 -0
- package/src/lib/craft-router.js +559 -0
- package/src/lib/craft-router.js.map +1 -0
- package/src/lib/craft-routes.d.ts +755 -0
- package/src/lib/craft-routes.d.ts.map +1 -0
- package/src/lib/craft-routes.js +510 -0
- package/src/lib/craft-routes.js.map +1 -0
- package/src/lib/craft-service.d.ts +1034 -0
- package/src/lib/craft-service.d.ts.map +1 -0
- package/src/lib/craft-service.js +1072 -0
- package/src/lib/craft-service.js.map +1 -0
- package/src/lib/craft-service.shared.d.ts +35 -0
- package/src/lib/craft-service.shared.d.ts.map +1 -0
- package/src/lib/craft-service.shared.js +4 -0
- package/src/lib/craft-service.shared.js.map +1 -0
- package/src/lib/craft-settled.d.ts +171 -0
- package/src/lib/craft-settled.d.ts.map +1 -0
- package/src/lib/craft-settled.js +130 -0
- package/src/lib/craft-settled.js.map +1 -0
- package/src/lib/craft-ssr.d.ts +29 -0
- package/src/lib/craft-ssr.d.ts.map +1 -0
- package/src/lib/craft-ssr.js +27 -0
- package/src/lib/craft-ssr.js.map +1 -0
- package/src/lib/craft-state-machine-runtime.d.ts +88 -0
- package/src/lib/craft-state-machine-runtime.d.ts.map +1 -0
- package/src/lib/craft-state-machine-runtime.js +167 -0
- package/src/lib/craft-state-machine-runtime.js.map +1 -0
- package/src/lib/craft-state-machine.d.ts +233 -0
- package/src/lib/craft-state-machine.d.ts.map +1 -0
- package/src/lib/craft-state-machine.js +254 -0
- package/src/lib/craft-state-machine.js.map +1 -0
- package/src/lib/craft-target-runtime.d.ts +20 -0
- package/src/lib/craft-target-runtime.d.ts.map +1 -0
- package/src/lib/craft-target-runtime.js +42 -0
- package/src/lib/craft-target-runtime.js.map +1 -0
- package/src/lib/craft-transfer-snapshot.d.ts +19 -0
- package/src/lib/craft-transfer-snapshot.d.ts.map +1 -0
- package/src/lib/craft-transfer-snapshot.js +90 -0
- package/src/lib/craft-transfer-snapshot.js.map +1 -0
- package/src/lib/craft-unique.d.ts +7 -0
- package/src/lib/craft-unique.d.ts.map +1 -0
- package/src/lib/craft-unique.js +16 -0
- package/src/lib/craft-unique.js.map +1 -0
- package/src/lib/craft-until-settled.d.ts +99 -0
- package/src/lib/craft-until-settled.d.ts.map +1 -0
- package/src/lib/craft-until-settled.js +81 -0
- package/src/lib/craft-until-settled.js.map +1 -0
- package/src/lib/craft-use.d.ts +26 -0
- package/src/lib/craft-use.d.ts.map +1 -0
- package/src/lib/craft-use.js +37 -0
- package/src/lib/craft-use.js.map +1 -0
- package/src/lib/craft-view-transition.d.ts +102 -0
- package/src/lib/craft-view-transition.d.ts.map +1 -0
- package/src/lib/craft-view-transition.js +130 -0
- package/src/lib/craft-view-transition.js.map +1 -0
- package/src/lib/dom-event-hook.d.ts +30 -0
- package/src/lib/dom-event-hook.d.ts.map +1 -0
- package/src/lib/dom-event-hook.js +16 -0
- package/src/lib/dom-event-hook.js.map +1 -0
- package/src/lib/fn-wrapper.d.ts +13 -0
- package/src/lib/fn-wrapper.d.ts.map +1 -0
- package/src/lib/fn-wrapper.js +66 -0
- package/src/lib/fn-wrapper.js.map +1 -0
- package/src/lib/form/craft-field.d.ts +155 -0
- package/src/lib/form/craft-field.d.ts.map +1 -0
- package/src/lib/form/craft-field.directive.d.ts +70 -0
- package/src/lib/form/craft-field.directive.d.ts.map +1 -0
- package/src/lib/form/craft-field.directive.js +549 -0
- package/src/lib/form/craft-field.directive.js.map +1 -0
- package/src/lib/form/craft-field.js +586 -0
- package/src/lib/form/craft-field.js.map +1 -0
- package/src/lib/form/field-exception.d.ts +62 -0
- package/src/lib/form/field-exception.d.ts.map +1 -0
- package/src/lib/form/field-exception.js +37 -0
- package/src/lib/form/field-exception.js.map +1 -0
- package/src/lib/form/field-lens.d.ts +29 -0
- package/src/lib/form/field-lens.d.ts.map +1 -0
- package/src/lib/form/field-lens.js +32 -0
- package/src/lib/form/field-lens.js.map +1 -0
- package/src/lib/form/insert-form-attributes.d.ts +69 -0
- package/src/lib/form/insert-form-attributes.d.ts.map +1 -0
- package/src/lib/form/insert-form-attributes.js +163 -0
- package/src/lib/form/insert-form-attributes.js.map +1 -0
- package/src/lib/form/insert-form-internals.d.ts +110 -0
- package/src/lib/form/insert-form-internals.d.ts.map +1 -0
- package/src/lib/form/insert-form-internals.js +276 -0
- package/src/lib/form/insert-form-internals.js.map +1 -0
- package/src/lib/form/insert-form-schema.d.ts +10 -0
- package/src/lib/form/insert-form-schema.d.ts.map +1 -0
- package/src/lib/form/insert-form-schema.js +62 -0
- package/src/lib/form/insert-form-schema.js.map +1 -0
- package/src/lib/form/insert-form-submit.d.ts +79 -0
- package/src/lib/form/insert-form-submit.d.ts.map +1 -0
- package/src/lib/form/insert-form-submit.js +126 -0
- package/src/lib/form/insert-form-submit.js.map +1 -0
- package/src/lib/form/insert-form.d.ts +39 -0
- package/src/lib/form/insert-form.d.ts.map +1 -0
- package/src/lib/form/insert-form.js +255 -0
- package/src/lib/form/insert-form.js.map +1 -0
- package/src/lib/form/insert-select-form-tree.d.ts +33 -0
- package/src/lib/form/insert-select-form-tree.d.ts.map +1 -0
- package/src/lib/form/insert-select-form-tree.js +144 -0
- package/src/lib/form/insert-select-form-tree.js.map +1 -0
- package/src/lib/form/insert-sub-form-field.d.ts +17 -0
- package/src/lib/form/insert-sub-form-field.d.ts.map +1 -0
- package/src/lib/form/insert-sub-form-field.js +41 -0
- package/src/lib/form/insert-sub-form-field.js.map +1 -0
- package/src/lib/form/make-form-tree-insert.d.ts +22 -0
- package/src/lib/form/make-form-tree-insert.d.ts.map +1 -0
- package/src/lib/form/make-form-tree-insert.js +43 -0
- package/src/lib/form/make-form-tree-insert.js.map +1 -0
- package/src/lib/form/target-form-field.d.ts +11 -0
- package/src/lib/form/target-form-field.d.ts.map +1 -0
- package/src/lib/form/target-form-field.js +1 -0
- package/src/lib/form/target-form-field.js.map +1 -0
- package/src/lib/form/validator.d.ts +174 -0
- package/src/lib/form/validator.d.ts.map +1 -0
- package/src/lib/form/validator.js +465 -0
- package/src/lib/form/validator.js.map +1 -0
- package/src/lib/from-event-to-source$.d.ts +210 -0
- package/src/lib/from-event-to-source$.d.ts.map +1 -0
- package/src/lib/from-event-to-source$.js +29 -0
- package/src/lib/from-event-to-source$.js.map +1 -0
- package/src/lib/global-persister-handler.service.d.ts +10 -0
- package/src/lib/global-persister-handler.service.d.ts.map +1 -0
- package/src/lib/global-persister-handler.service.js +40 -0
- package/src/lib/global-persister-handler.service.js.map +1 -0
- package/src/lib/host/craft-compat.d.ts +242 -0
- package/src/lib/host/craft-compat.d.ts.map +1 -0
- package/src/lib/host/craft-compat.js +444 -0
- package/src/lib/host/craft-compat.js.map +1 -0
- package/src/lib/host/craft-dom.d.ts +16 -0
- package/src/lib/host/craft-dom.d.ts.map +1 -0
- package/src/lib/host/craft-dom.js +24 -0
- package/src/lib/host/craft-dom.js.map +1 -0
- package/src/lib/host/craft-http.d.ts +22 -0
- package/src/lib/host/craft-http.d.ts.map +1 -0
- package/src/lib/host/craft-http.js +80 -0
- package/src/lib/host/craft-http.js.map +1 -0
- package/src/lib/host/craft-injector-host.d.ts +3 -0
- package/src/lib/host/craft-injector-host.d.ts.map +1 -0
- package/src/lib/host/craft-injector-host.js +2 -0
- package/src/lib/host/craft-injector-host.js.map +1 -0
- package/src/lib/host/craft-injector.d.ts +40 -0
- package/src/lib/host/craft-injector.d.ts.map +1 -0
- package/src/lib/host/craft-injector.js +318 -0
- package/src/lib/host/craft-injector.js.map +1 -0
- package/src/lib/host/craft-linked-signal.d.ts +17 -0
- package/src/lib/host/craft-linked-signal.d.ts.map +1 -0
- package/src/lib/host/craft-linked-signal.js +86 -0
- package/src/lib/host/craft-linked-signal.js.map +1 -0
- package/src/lib/host/craft-router-runtime.d.ts +61 -0
- package/src/lib/host/craft-router-runtime.d.ts.map +1 -0
- package/src/lib/host/craft-router-runtime.js +456 -0
- package/src/lib/host/craft-router-runtime.js.map +1 -0
- package/src/lib/host/craft-router-types.d.ts +84 -0
- package/src/lib/host/craft-router-types.d.ts.map +1 -0
- package/src/lib/host/craft-router-types.js +35 -0
- package/src/lib/host/craft-router-types.js.map +1 -0
- package/src/lib/host/craft-signal.d.ts +45 -0
- package/src/lib/host/craft-signal.d.ts.map +1 -0
- package/src/lib/host/craft-signal.js +161 -0
- package/src/lib/host/craft-signal.js.map +1 -0
- package/src/lib/host/craft-test-bed.d.ts +63 -0
- package/src/lib/host/craft-test-bed.d.ts.map +1 -0
- package/src/lib/host/craft-test-bed.js +114 -0
- package/src/lib/host/craft-test-bed.js.map +1 -0
- package/src/lib/host-tag.d.ts +2 -0
- package/src/lib/host-tag.d.ts.map +1 -0
- package/src/lib/host-tag.js +2 -0
- package/src/lib/host-tag.js.map +1 -0
- package/src/lib/insert-entities.d.ts +131 -0
- package/src/lib/insert-entities.d.ts.map +1 -0
- package/src/lib/insert-entities.js +159 -0
- package/src/lib/insert-entities.js.map +1 -0
- package/src/lib/insert-noop-typing-anchor.d.ts +15 -0
- package/src/lib/insert-noop-typing-anchor.d.ts.map +1 -0
- package/src/lib/insert-noop-typing-anchor.js +16 -0
- package/src/lib/insert-noop-typing-anchor.js.map +1 -0
- package/src/lib/insert-pagination-placeholder-data.d.ts +122 -0
- package/src/lib/insert-pagination-placeholder-data.d.ts.map +1 -0
- package/src/lib/insert-pagination-placeholder-data.js +244 -0
- package/src/lib/insert-pagination-placeholder-data.js.map +1 -0
- package/src/lib/insert-react-on-mutation.d.ts +261 -0
- package/src/lib/insert-react-on-mutation.d.ts.map +1 -0
- package/src/lib/insert-react-on-mutation.js +227 -0
- package/src/lib/insert-react-on-mutation.js.map +1 -0
- package/src/lib/insert-select-resource.d.ts +31 -0
- package/src/lib/insert-select-resource.d.ts.map +1 -0
- package/src/lib/insert-select-resource.js +27 -0
- package/src/lib/insert-select-resource.js.map +1 -0
- package/src/lib/insert-select.d.ts +126 -0
- package/src/lib/insert-select.d.ts.map +1 -0
- package/src/lib/insert-select.js +535 -0
- package/src/lib/insert-select.js.map +1 -0
- package/src/lib/insert-storage-persister.d.ts +27 -0
- package/src/lib/insert-storage-persister.d.ts.map +1 -0
- package/src/lib/insert-storage-persister.js +65 -0
- package/src/lib/insert-storage-persister.js.map +1 -0
- package/src/lib/insert-typed-pipes.d.ts +64 -0
- package/src/lib/insert-typed-pipes.d.ts.map +1 -0
- package/src/lib/insert-typed-pipes.js +32 -0
- package/src/lib/insert-typed-pipes.js.map +1 -0
- package/src/lib/linked-source.d.ts +8 -0
- package/src/lib/linked-source.d.ts.map +1 -0
- package/src/lib/linked-source.js +24 -0
- package/src/lib/linked-source.js.map +1 -0
- package/src/lib/local-storage-persister.d.ts +4 -0
- package/src/lib/local-storage-persister.d.ts.map +1 -0
- package/src/lib/local-storage-persister.js +342 -0
- package/src/lib/local-storage-persister.js.map +1 -0
- package/src/lib/middleware-schema-shared.d.ts +67 -0
- package/src/lib/middleware-schema-shared.d.ts.map +1 -0
- package/src/lib/middleware-schema-shared.js +34 -0
- package/src/lib/middleware-schema-shared.js.map +1 -0
- package/src/lib/mock-http-request-for-route.d.ts +173 -0
- package/src/lib/mock-http-request-for-route.d.ts.map +1 -0
- package/src/lib/mock-http-request-for-route.js +127 -0
- package/src/lib/mock-http-request-for-route.js.map +1 -0
- package/src/lib/mutation.d.ts +332 -0
- package/src/lib/mutation.d.ts.map +1 -0
- package/src/lib/mutation.js +923 -0
- package/src/lib/mutation.js.map +1 -0
- package/src/lib/on$.d.ts +26 -0
- package/src/lib/on$.d.ts.map +1 -0
- package/src/lib/on$.js +19 -0
- package/src/lib/on$.js.map +1 -0
- package/src/lib/portable-server-function.d.ts +68 -0
- package/src/lib/portable-server-function.d.ts.map +1 -0
- package/src/lib/portable-server-function.js +97 -0
- package/src/lib/portable-server-function.js.map +1 -0
- package/src/lib/preserved-resource.d.ts +4 -0
- package/src/lib/preserved-resource.d.ts.map +1 -0
- package/src/lib/preserved-resource.js +60 -0
- package/src/lib/preserved-resource.js.map +1 -0
- package/src/lib/primitive-method-runtime-context.d.ts +28 -0
- package/src/lib/primitive-method-runtime-context.d.ts.map +1 -0
- package/src/lib/primitive-method-runtime-context.js +38 -0
- package/src/lib/primitive-method-runtime-context.js.map +1 -0
- package/src/lib/primitive-resource-runtime-context.d.ts +46 -0
- package/src/lib/primitive-resource-runtime-context.d.ts.map +1 -0
- package/src/lib/primitive-resource-runtime-context.js +102 -0
- package/src/lib/primitive-resource-runtime-context.js.map +1 -0
- package/src/lib/query-params.d.ts +216 -0
- package/src/lib/query-params.d.ts.map +1 -0
- package/src/lib/query-params.js +324 -0
- package/src/lib/query-params.js.map +1 -0
- package/src/lib/query.core.d.ts +214 -0
- package/src/lib/query.core.d.ts.map +1 -0
- package/src/lib/query.core.js +210 -0
- package/src/lib/query.core.js.map +1 -0
- package/src/lib/query.d.ts +324 -0
- package/src/lib/query.d.ts.map +1 -0
- package/src/lib/query.js +971 -0
- package/src/lib/query.js.map +1 -0
- package/src/lib/reactive-read.d.ts +162 -0
- package/src/lib/reactive-read.d.ts.map +1 -0
- package/src/lib/reactive-read.js +389 -0
- package/src/lib/reactive-read.js.map +1 -0
- package/src/lib/resource-by-id.d.ts +71 -0
- package/src/lib/resource-by-id.d.ts.map +1 -0
- package/src/lib/resource-by-id.js +294 -0
- package/src/lib/resource-by-id.js.map +1 -0
- package/src/lib/resource-exception.d.ts +30 -0
- package/src/lib/resource-exception.d.ts.map +1 -0
- package/src/lib/resource-exception.js +86 -0
- package/src/lib/resource-exception.js.map +1 -0
- package/src/lib/route-checked-di.d.ts +229 -0
- package/src/lib/route-checked-di.d.ts.map +1 -0
- package/src/lib/route-checked-di.js +1 -0
- package/src/lib/route-checked-di.js.map +1 -0
- package/src/lib/schema-validation.d.ts +89 -0
- package/src/lib/schema-validation.d.ts.map +1 -0
- package/src/lib/schema-validation.js +110 -0
- package/src/lib/schema-validation.js.map +1 -0
- package/src/lib/send-context-to-ai.d.ts +20 -0
- package/src/lib/send-context-to-ai.d.ts.map +1 -0
- package/src/lib/send-context-to-ai.js +18 -0
- package/src/lib/send-context-to-ai.js.map +1 -0
- package/src/lib/send-context-to-ai.tokens.d.ts +12 -0
- package/src/lib/send-context-to-ai.tokens.d.ts.map +1 -0
- package/src/lib/send-context-to-ai.tokens.js +1 -0
- package/src/lib/send-context-to-ai.tokens.js.map +1 -0
- package/src/lib/server-function-client.d.ts +102 -0
- package/src/lib/server-function-client.d.ts.map +1 -0
- package/src/lib/server-function-client.js +106 -0
- package/src/lib/server-function-client.js.map +1 -0
- package/src/lib/server-function-contract.d.ts +42 -0
- package/src/lib/server-function-contract.d.ts.map +1 -0
- package/src/lib/server-function-contract.js +23 -0
- package/src/lib/server-function-contract.js.map +1 -0
- package/src/lib/server-function-middleware.d.ts +222 -0
- package/src/lib/server-function-middleware.d.ts.map +1 -0
- package/src/lib/server-function-middleware.js +189 -0
- package/src/lib/server-function-middleware.js.map +1 -0
- package/src/lib/server-function.d.ts +114 -0
- package/src/lib/server-function.d.ts.map +1 -0
- package/src/lib/server-function.js +80 -0
- package/src/lib/server-function.js.map +1 -0
- package/src/lib/server-layer.d.ts +185 -0
- package/src/lib/server-layer.d.ts.map +1 -0
- package/src/lib/server-layer.js +121 -0
- package/src/lib/server-layer.js.map +1 -0
- package/src/lib/server.d.ts +83 -0
- package/src/lib/server.d.ts.map +1 -0
- package/src/lib/server.js +266 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/setup-craft-service-test.d.ts +90 -0
- package/src/lib/setup-craft-service-test.d.ts.map +1 -0
- package/src/lib/setup-craft-service-test.js +193 -0
- package/src/lib/setup-craft-service-test.js.map +1 -0
- package/src/lib/setup-craft-service-testing-by-register.d.ts +245 -0
- package/src/lib/setup-craft-service-testing-by-register.d.ts.map +1 -0
- package/src/lib/setup-craft-service-testing-by-register.js +316 -0
- package/src/lib/setup-craft-service-testing-by-register.js.map +1 -0
- package/src/lib/signal-proxy.d.ts +21 -0
- package/src/lib/signal-proxy.d.ts.map +1 -0
- package/src/lib/signal-proxy.js +79 -0
- package/src/lib/signal-proxy.js.map +1 -0
- package/src/lib/signal-source.d.ts +392 -0
- package/src/lib/signal-source.d.ts.map +1 -0
- package/src/lib/signal-source.js +433 -0
- package/src/lib/signal-source.js.map +1 -0
- package/src/lib/source$.d.ts +121 -0
- package/src/lib/source$.d.ts.map +1 -0
- package/src/lib/source$.js +171 -0
- package/src/lib/source$.js.map +1 -0
- package/src/lib/source-from-event.d.ts +350 -0
- package/src/lib/source-from-event.d.ts.map +1 -0
- package/src/lib/source-from-event.js +26 -0
- package/src/lib/source-from-event.js.map +1 -0
- package/src/lib/stacked-source.d.ts +6 -0
- package/src/lib/stacked-source.d.ts.map +1 -0
- package/src/lib/stacked-source.js +29 -0
- package/src/lib/stacked-source.js.map +1 -0
- package/src/lib/standard-schema.d.ts +43 -0
- package/src/lib/standard-schema.d.ts.map +1 -0
- package/src/lib/standard-schema.js +1 -0
- package/src/lib/standard-schema.js.map +1 -0
- package/src/lib/state-method-runtime-context.d.ts +13 -0
- package/src/lib/state-method-runtime-context.d.ts.map +1 -0
- package/src/lib/state-method-runtime-context.js +11 -0
- package/src/lib/state-method-runtime-context.js.map +1 -0
- package/src/lib/state.d.ts +158 -0
- package/src/lib/state.d.ts.map +1 -0
- package/src/lib/state.js +388 -0
- package/src/lib/state.js.map +1 -0
- package/src/lib/storage-persister.service.d.ts +25 -0
- package/src/lib/storage-persister.service.d.ts.map +1 -0
- package/src/lib/storage-persister.service.js +27 -0
- package/src/lib/storage-persister.service.js.map +1 -0
- package/src/lib/take-app-snapshot.d.ts +31 -0
- package/src/lib/take-app-snapshot.d.ts.map +1 -0
- package/src/lib/take-app-snapshot.js +93 -0
- package/src/lib/take-app-snapshot.js.map +1 -0
- package/src/lib/template-trace.d.ts +37 -0
- package/src/lib/template-trace.d.ts.map +1 -0
- package/src/lib/template-trace.js +37 -0
- package/src/lib/template-trace.js.map +1 -0
- package/src/lib/temporal-runtime.d.ts +146 -0
- package/src/lib/temporal-runtime.d.ts.map +1 -0
- package/src/lib/temporal-runtime.js +375 -0
- package/src/lib/temporal-runtime.js.map +1 -0
- package/src/lib/to-source.d.ts +335 -0
- package/src/lib/to-source.d.ts.map +1 -0
- package/src/lib/to-source.js +359 -0
- package/src/lib/to-source.js.map +1 -0
- package/src/lib/util/craft-resource-ref.d.ts +29 -0
- package/src/lib/util/craft-resource-ref.d.ts.map +1 -0
- package/src/lib/util/craft-resource-ref.js +1 -0
- package/src/lib/util/craft-resource-ref.js.map +1 -0
- package/src/lib/util/craft-resource-status.d.ts +17 -0
- package/src/lib/util/craft-resource-status.d.ts.map +1 -0
- package/src/lib/util/craft-resource-status.js +14 -0
- package/src/lib/util/craft-resource-status.js.map +1 -0
- package/src/lib/util/entities-util.d.ts +340 -0
- package/src/lib/util/entities-util.d.ts.map +1 -0
- package/src/lib/util/entities-util.js +136 -0
- package/src/lib/util/entities-util.js.map +1 -0
- package/src/lib/util/explicit-effect.d.ts +42 -0
- package/src/lib/util/explicit-effect.d.ts.map +1 -0
- package/src/lib/util/explicit-effect.js +37 -0
- package/src/lib/util/explicit-effect.js.map +1 -0
- package/src/lib/util/extract-signal-props-and-methods.d.ts +20 -0
- package/src/lib/util/extract-signal-props-and-methods.d.ts.map +1 -0
- package/src/lib/util/extract-signal-props-and-methods.js +1 -0
- package/src/lib/util/extract-signal-props-and-methods.js.map +1 -0
- package/src/lib/util/method-trigger-nonce.d.ts +45 -0
- package/src/lib/util/method-trigger-nonce.d.ts.map +1 -0
- package/src/lib/util/method-trigger-nonce.js +58 -0
- package/src/lib/util/method-trigger-nonce.js.map +1 -0
- package/src/lib/util/persister.type.d.ts +37 -0
- package/src/lib/util/persister.type.d.ts.map +1 -0
- package/src/lib/util/persister.type.js +1 -0
- package/src/lib/util/persister.type.js.map +1 -0
- package/src/lib/util/persister.util.d.ts +8 -0
- package/src/lib/util/persister.util.d.ts.map +1 -0
- package/src/lib/util/persister.util.js +71 -0
- package/src/lib/util/persister.util.js.map +1 -0
- package/src/lib/util/react-on-mutation-effect.d.ts +16 -0
- package/src/lib/util/react-on-mutation-effect.d.ts.map +1 -0
- package/src/lib/util/react-on-mutation-effect.js +148 -0
- package/src/lib/util/react-on-mutation-effect.js.map +1 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts +27 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.d.ts.map +1 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.js +97 -0
- package/src/lib/util/resource-by-id-changes-tracker.util.js.map +1 -0
- package/src/lib/util/source.type.d.ts +6 -0
- package/src/lib/util/source.type.d.ts.map +1 -0
- package/src/lib/util/source.type.js +1 -0
- package/src/lib/util/source.type.js.map +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts +4 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.d.ts.map +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js +1 -0
- package/src/lib/util/types/access-type-object-property-by-dotted-path.type.js.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts +27 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.d.ts.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path-by-id.type.js.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts +24 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.d.ts.map +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js +1 -0
- package/src/lib/util/types/boolean-or-mapper-fn-by-path.type.js.map +1 -0
- package/src/lib/util/types/brand.d.ts +7 -0
- package/src/lib/util/types/brand.d.ts.map +1 -0
- package/src/lib/util/types/brand.js +9 -0
- package/src/lib/util/types/brand.js.map +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts +13 -0
- package/src/lib/util/types/object-deep-path-mapper.type.d.ts.map +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.js +1 -0
- package/src/lib/util/types/object-deep-path-mapper.type.js.map +1 -0
- package/src/lib/util/types/resource-by-id-config.type.d.ts +115 -0
- package/src/lib/util/types/resource-by-id-config.type.d.ts.map +1 -0
- package/src/lib/util/types/resource-by-id-config.type.js +1 -0
- package/src/lib/util/types/resource-by-id-config.type.js.map +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts +52 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.d.ts.map +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js +1 -0
- package/src/lib/util/types/resource-with-params-or-params-fn.type.js.map +1 -0
- package/src/lib/util/types/shared.type.d.ts +66 -0
- package/src/lib/util/types/shared.type.d.ts.map +1 -0
- package/src/lib/util/types/shared.type.js +1 -0
- package/src/lib/util/types/shared.type.js.map +1 -0
- package/src/lib/util/types/util.d.ts +16 -0
- package/src/lib/util/types/util.d.ts.map +1 -0
- package/src/lib/util/types/util.js +60 -0
- package/src/lib/util/types/util.js.map +1 -0
- package/src/lib/util/types/util.type.d.ts +67 -0
- package/src/lib/util/types/util.type.d.ts.map +1 -0
- package/src/lib/util/types/util.type.js +5 -0
- package/src/lib/util/types/util.type.js.map +1 -0
- package/src/lib/util/update-state.util.d.ts +10 -0
- package/src/lib/util/update-state.util.d.ts.map +1 -0
- package/src/lib/util/update-state.util.js +31 -0
- package/src/lib/util/update-state.util.js.map +1 -0
- package/src/lib/util/util.d.ts +19 -0
- package/src/lib/util/util.d.ts.map +1 -0
- package/src/lib/util/util.js +50 -0
- package/src/lib/util/util.js.map +1 -0
- package/src/lib/util/util.type.d.ts +107 -0
- package/src/lib/util/util.type.d.ts.map +1 -0
- package/src/lib/util/util.type.js +9 -0
- package/src/lib/util/util.type.js.map +1 -0
- package/src/lib/yieldable.d.ts +94 -0
- package/src/lib/yieldable.d.ts.map +1 -0
- package/src/lib/yieldable.js +109 -0
- package/src/lib/yieldable.js.map +1 -0
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
import { DestroyRef, EnvironmentInjector, inject, Injector, InjectionToken, runInInjectionContext, } from './host/craft-compat';
|
|
2
|
+
import { DOCUMENT } from './host/craft-compat';
|
|
3
|
+
import { CRAFT_A11Y_NAVIGATION_FOCUS } from './craft-a11y';
|
|
4
|
+
import { isCraftException } from './craft-exception';
|
|
5
|
+
import { evaluateCraftGuardSync, runCraftRouteChainAsync, } from './craft-guard-runtime';
|
|
6
|
+
import { CRAFT_BLANK_MS, CRAFT_ERROR_COMPONENT, CRAFT_PENDING_COMPONENT, CRAFT_PENDING_MIN_MS, CRAFT_STAY_MS, } from './craft-pending';
|
|
7
|
+
import { CRAFT_GLOBAL_ERROR, } from './craft-route-exceptions';
|
|
8
|
+
import { createRouteLoadError, isCraftRouteLoadError, setActiveCraftRouteLoadError, } from './craft-route-load-error';
|
|
9
|
+
import { getCraftRouteMeta, } from './craft-route-meta';
|
|
10
|
+
import { CRAFT_START_VIEW_TRANSITION, CRAFT_VIEW_TRANSITION, CRAFT_VIEW_TRANSITION_SKIP_BLANK, CRAFT_VIEW_TRANSITION_STATE_KEY, CRAFT_VIEW_TRANSITIONS_ENABLED, } from './craft-view-transition';
|
|
11
|
+
import { CRAFT_TEMPORAL_RUNTIME, } from './temporal-runtime';
|
|
12
|
+
import { craftRouteTarget, CRAFT_ROUTE_TARGET, isCraftRouteTarget, normalizeCraftRouteTarget, } from './craft-route-target';
|
|
13
|
+
import { craftSignal, craftWatch, } from './host/craft-signal';
|
|
14
|
+
import { serializeLocation, sliceCraftMatchForOutlet, } from './host/craft-router-runtime';
|
|
15
|
+
import { CRAFT_CHILD_MATCH, CRAFT_HISTORY, CRAFT_MATCH, CRAFT_ROUTER, } from './craft-router-tokens';
|
|
16
|
+
import { CRAFT_SSR_RUNTIME } from './craft-ssr';
|
|
17
|
+
import { CRAFT_PLATFORM } from './craft-platform';
|
|
18
|
+
const ROUTE_PROP_SKIP = new Set(['craftComponent', 'craftPendingComponent']);
|
|
19
|
+
export function collectMatchProps(match) {
|
|
20
|
+
if (!match) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const props = {};
|
|
24
|
+
for (const route of match.routes) {
|
|
25
|
+
assignRoutePropBag(props, route.data);
|
|
26
|
+
}
|
|
27
|
+
assignRoutePropBag(props, match.params);
|
|
28
|
+
assignRoutePropBag(props, match.queryParams);
|
|
29
|
+
return props;
|
|
30
|
+
}
|
|
31
|
+
/** @deprecated Use {@link collectMatchProps}. */
|
|
32
|
+
export const collectActivatedRouteProps = collectMatchProps;
|
|
33
|
+
function assignRoutePropBag(target, bag) {
|
|
34
|
+
if (!bag) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
for (const [key, value] of Object.entries(bag)) {
|
|
38
|
+
if (ROUTE_PROP_SKIP.has(key) || typeof value === 'function') {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
target[key] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export const CRAFT_ROUTE_CHAIN_RUNNER = new InjectionToken('CRAFT_ROUTE_CHAIN_RUNNER', {
|
|
45
|
+
providedIn: 'root',
|
|
46
|
+
factory: () => runCraftRouteChainAsync,
|
|
47
|
+
});
|
|
48
|
+
const syncTemplateFlushers = new Set();
|
|
49
|
+
/** Registers a synchronous template patch invoked from view-transition commits. */
|
|
50
|
+
export function registerCraftSyncTemplateFlush(fn) {
|
|
51
|
+
syncTemplateFlushers.add(fn);
|
|
52
|
+
return () => {
|
|
53
|
+
syncTemplateFlushers.delete(fn);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function runRegisteredSyncTemplateFlush() {
|
|
57
|
+
for (const flush of syncTemplateFlushers) {
|
|
58
|
+
flush();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Runs inside `startViewTransition`'s callback after Craft signals commit, so
|
|
63
|
+
* the displayed DOM is patched before the callback returns. Templates driven by
|
|
64
|
+
* `craftEffect` otherwise bump an Angular signal asynchronously.
|
|
65
|
+
*/
|
|
66
|
+
export const CRAFT_SYNC_TEMPLATE_FLUSH = new InjectionToken('CRAFT_SYNC_TEMPLATE_FLUSH', {
|
|
67
|
+
providedIn: 'root',
|
|
68
|
+
factory: () => runRegisteredSyncTemplateFlush,
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* A non-blocking replacement for `<router-outlet>`. The URL commits immediately
|
|
72
|
+
* (history.push); this outlet reads the route's {@link CraftRouteMeta} and
|
|
73
|
+
* drives canMatch → canActivate → resolve **after** commit.
|
|
74
|
+
*/
|
|
75
|
+
export class CraftRouterOutletController {
|
|
76
|
+
name = 'primary';
|
|
77
|
+
rootInjector = inject(EnvironmentInjector);
|
|
78
|
+
router = inject(CRAFT_ROUTER, { optional: true }) ?? silentRouter();
|
|
79
|
+
history = inject(CRAFT_HISTORY, { optional: true });
|
|
80
|
+
destroyRef = inject(DestroyRef);
|
|
81
|
+
temporalRuntime = inject(CRAFT_TEMPORAL_RUNTIME);
|
|
82
|
+
defaultPendingComponent = inject(CRAFT_PENDING_COMPONENT);
|
|
83
|
+
defaultErrorComponent = inject(CRAFT_ERROR_COMPONENT);
|
|
84
|
+
defaultStayMs = inject(CRAFT_STAY_MS);
|
|
85
|
+
defaultBlankMs = inject(CRAFT_BLANK_MS);
|
|
86
|
+
defaultPendingMinMs = inject(CRAFT_PENDING_MIN_MS);
|
|
87
|
+
chainRunner = inject(CRAFT_ROUTE_CHAIN_RUNNER);
|
|
88
|
+
viewTransitionsEnabled = inject(CRAFT_VIEW_TRANSITIONS_ENABLED);
|
|
89
|
+
viewTransitionSkipBlank = inject(CRAFT_VIEW_TRANSITION_SKIP_BLANK);
|
|
90
|
+
startViewTransition = inject(CRAFT_START_VIEW_TRANSITION);
|
|
91
|
+
syncTemplateFlush = inject(CRAFT_SYNC_TEMPLATE_FLUSH);
|
|
92
|
+
viewTransitionSink = inject(CRAFT_VIEW_TRANSITION);
|
|
93
|
+
a11yNavigationFocus = inject(CRAFT_A11Y_NAVIGATION_FOCUS);
|
|
94
|
+
platform = inject(CRAFT_PLATFORM, { optional: true });
|
|
95
|
+
document = this.platform?.document ?? inject(DOCUMENT);
|
|
96
|
+
ssrRuntime = inject(CRAFT_SSR_RUNTIME, { optional: true });
|
|
97
|
+
a11yHasCompletedInitialActivation = false;
|
|
98
|
+
displayedComponent = craftSignal(null);
|
|
99
|
+
displayedTarget = craftSignal(null);
|
|
100
|
+
displayedInjector = craftSignal(undefined);
|
|
101
|
+
displayedProps = craftSignal({});
|
|
102
|
+
state = craftSignal('idle');
|
|
103
|
+
targetComponent = craftSignal(null);
|
|
104
|
+
pendingComponent = craftSignal(null);
|
|
105
|
+
errorComponent = craftSignal(null);
|
|
106
|
+
pendingTarget = craftSignal(null);
|
|
107
|
+
errorTarget = craftSignal(null);
|
|
108
|
+
_match = null;
|
|
109
|
+
_liveMatch = null;
|
|
110
|
+
_childMatch = null;
|
|
111
|
+
_activeRouteInjector = null;
|
|
112
|
+
_meta = null;
|
|
113
|
+
_navId = 0;
|
|
114
|
+
_stayTimer = null;
|
|
115
|
+
_blankTimer = null;
|
|
116
|
+
_pendingCommitTimer = null;
|
|
117
|
+
_pendingShownAt = 0;
|
|
118
|
+
_previousUrl = this.router.url;
|
|
119
|
+
_pendingDeactivation = false;
|
|
120
|
+
_reactiveWatch = null;
|
|
121
|
+
_matchWatch = null;
|
|
122
|
+
_frozen = false;
|
|
123
|
+
_displayVersion = 0;
|
|
124
|
+
get isActivated() {
|
|
125
|
+
return this._match !== null;
|
|
126
|
+
}
|
|
127
|
+
get component() {
|
|
128
|
+
if (!this._match) {
|
|
129
|
+
throw new Error('CraftRouterOutlet is not activated');
|
|
130
|
+
}
|
|
131
|
+
return (this.targetComponent() ?? {});
|
|
132
|
+
}
|
|
133
|
+
constructor() {
|
|
134
|
+
const matchSignal = inject(CRAFT_CHILD_MATCH, { optional: true }) ??
|
|
135
|
+
inject(CRAFT_MATCH, { optional: true });
|
|
136
|
+
if (matchSignal) {
|
|
137
|
+
this._matchWatch = craftWatch(() => {
|
|
138
|
+
const match = matchSignal();
|
|
139
|
+
if (match) {
|
|
140
|
+
this.activateMatch(match, this.rootInjector);
|
|
141
|
+
}
|
|
142
|
+
else if (this._match) {
|
|
143
|
+
this.deactivate();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
this.destroyRef.onDestroy(() => this.destroy());
|
|
148
|
+
}
|
|
149
|
+
destroy() {
|
|
150
|
+
this._matchWatch?.destroy();
|
|
151
|
+
this._matchWatch = null;
|
|
152
|
+
this.teardown();
|
|
153
|
+
}
|
|
154
|
+
deactivate() {
|
|
155
|
+
this.teardown();
|
|
156
|
+
this._match = null;
|
|
157
|
+
this._liveMatch = null;
|
|
158
|
+
this._childMatch = null;
|
|
159
|
+
this._activeRouteInjector = null;
|
|
160
|
+
this._meta = null;
|
|
161
|
+
this._previousUrl = this.router.url;
|
|
162
|
+
this._pendingDeactivation = true;
|
|
163
|
+
queueMicrotask(() => {
|
|
164
|
+
if (this._pendingDeactivation) {
|
|
165
|
+
this._pendingDeactivation = false;
|
|
166
|
+
this.state.set('idle');
|
|
167
|
+
this.displayedComponent.set(null);
|
|
168
|
+
this.displayedTarget.set(null);
|
|
169
|
+
this.targetComponent.set(null);
|
|
170
|
+
this.errorComponent.set(null);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
activateMatch(match, environmentInjector) {
|
|
175
|
+
this._pendingDeactivation = false;
|
|
176
|
+
const previousMatchUrl = this._match
|
|
177
|
+
? serializeLocation(this._match)
|
|
178
|
+
: this._previousUrl;
|
|
179
|
+
const { activated, child } = sliceCraftMatchForOutlet(match);
|
|
180
|
+
if (this._match &&
|
|
181
|
+
this._liveMatch &&
|
|
182
|
+
this._childMatch &&
|
|
183
|
+
this._activeRouteInjector &&
|
|
184
|
+
this.state() !== 'error' &&
|
|
185
|
+
canReuseActivation(this._match, activated, this._meta)) {
|
|
186
|
+
this._liveMatch.set(activated);
|
|
187
|
+
this._childMatch.set(child);
|
|
188
|
+
this.displayedProps.set(collectMatchProps(activated));
|
|
189
|
+
this.publishViewTransitionPayload();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this._previousUrl = previousMatchUrl;
|
|
193
|
+
this.teardown();
|
|
194
|
+
this._match = activated;
|
|
195
|
+
this._liveMatch = craftSignal(activated);
|
|
196
|
+
this._childMatch = craftSignal(child);
|
|
197
|
+
const routeProviders = activated.route.providers;
|
|
198
|
+
this._activeRouteInjector = Injector.create({
|
|
199
|
+
providers: [
|
|
200
|
+
{ provide: CRAFT_MATCH, useValue: this._liveMatch },
|
|
201
|
+
{ provide: CRAFT_CHILD_MATCH, useValue: this._childMatch },
|
|
202
|
+
...(Array.isArray(routeProviders) ? routeProviders : []),
|
|
203
|
+
],
|
|
204
|
+
parent: environmentInjector ?? this.rootInjector,
|
|
205
|
+
name: 'CraftRouterOutlet',
|
|
206
|
+
});
|
|
207
|
+
this.publishViewTransitionPayload();
|
|
208
|
+
const leafMeta = getCraftRouteMeta((activated.route.data ?? activated.data));
|
|
209
|
+
const meta = composeRouteMetas(collectAncestorGuardMetas(match, activated), leafMeta ?? null);
|
|
210
|
+
this._meta = meta ?? null;
|
|
211
|
+
this.clearExceptionSinks(meta);
|
|
212
|
+
const activation = this.finishActivation(activated, meta ?? null);
|
|
213
|
+
if (this.ssrRuntime) {
|
|
214
|
+
this.ssrRuntime.track(`route:${activated.route.path}`, activation);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
void activation;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async finishActivation(match, meta) {
|
|
221
|
+
if (!this.isCurrentActivation(match)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (typeof match.route.loadComponent === 'function' &&
|
|
225
|
+
!match.route.component) {
|
|
226
|
+
try {
|
|
227
|
+
const loaded = await runInInjectionContext(this._activeRouteInjector ?? this.rootInjector, () => Promise.resolve(match.route.loadComponent()));
|
|
228
|
+
if (!this.isCurrentActivation(match)) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const component = loaded && typeof loaded === 'object' && 'default' in loaded
|
|
232
|
+
? loaded.default
|
|
233
|
+
: loaded;
|
|
234
|
+
match.route.component = component;
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if (!this.isCurrentActivation(match)) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const exception = isCraftRouteLoadError(error)
|
|
241
|
+
? error
|
|
242
|
+
: createRouteLoadError({
|
|
243
|
+
phase: 'component',
|
|
244
|
+
routePath: match.route.path,
|
|
245
|
+
targetUrl: this.router.url,
|
|
246
|
+
cause: error,
|
|
247
|
+
attempt: 1,
|
|
248
|
+
});
|
|
249
|
+
setActiveCraftRouteLoadError(exception, this.rootInjector);
|
|
250
|
+
this.publishGlobalError(exception);
|
|
251
|
+
void this.showErrorComponent(this._meta?.errorComponent ?? this.defaultErrorComponent, exception);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
const component = this.resolveRouteComponent(match);
|
|
256
|
+
this.displayedProps.set(collectMatchProps(match));
|
|
257
|
+
if (!meta || (!meta.match && !meta.guard && !meta.resolve)) {
|
|
258
|
+
this.showComponent(component, this._activeRouteInjector, this.resolveRouteTarget(component));
|
|
259
|
+
this.targetComponent.set(component);
|
|
260
|
+
this.state.set('loaded');
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
await this.runChain(meta, component, 'enter');
|
|
264
|
+
}
|
|
265
|
+
runChain(meta, component, phase) {
|
|
266
|
+
const navId = ++this._navId;
|
|
267
|
+
const injector = this._activeRouteInjector ?? this.rootInjector;
|
|
268
|
+
const routeSnapshot = matchToSnapshot(this._match);
|
|
269
|
+
const stateSnapshot = { url: this.router.url, root: routeSnapshot };
|
|
270
|
+
this.state.set('stay');
|
|
271
|
+
void this.resolvePendingComponent(meta);
|
|
272
|
+
const stayMs = meta.stayMs ?? this.defaultStayMs;
|
|
273
|
+
const skipBlank = this.shouldSkipBlank(meta);
|
|
274
|
+
const blankMs = skipBlank ? 0 : (meta.blankMs ?? this.defaultBlankMs);
|
|
275
|
+
if (!skipBlank) {
|
|
276
|
+
this._stayTimer = this.temporalRuntime.schedule(() => {
|
|
277
|
+
if (this._navId === navId && this.state() === 'stay') {
|
|
278
|
+
this.state.set('blank');
|
|
279
|
+
this.displayedComponent.set(null);
|
|
280
|
+
this.displayedTarget.set(null);
|
|
281
|
+
}
|
|
282
|
+
}, stayMs, {
|
|
283
|
+
kind: 'router-stay',
|
|
284
|
+
owner: 'craft-router-outlet',
|
|
285
|
+
destroyRef: this.destroyRef,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
this._blankTimer = this.temporalRuntime.schedule(() => {
|
|
289
|
+
if (this._navId === navId &&
|
|
290
|
+
(this.state() === 'stay' || this.state() === 'blank')) {
|
|
291
|
+
this._pendingShownAt = this.temporalRuntime.now();
|
|
292
|
+
this.state.set('pending');
|
|
293
|
+
this.showComponent(this.pendingComponent(), injector, this.pendingTarget());
|
|
294
|
+
}
|
|
295
|
+
}, stayMs + blankMs, {
|
|
296
|
+
kind: 'router-pending',
|
|
297
|
+
owner: 'craft-router-outlet',
|
|
298
|
+
destroyRef: this.destroyRef,
|
|
299
|
+
});
|
|
300
|
+
return this.chainRunner({
|
|
301
|
+
match: meta.match?.(routeSnapshot, stateSnapshot),
|
|
302
|
+
guard: meta.guard?.(routeSnapshot, stateSnapshot),
|
|
303
|
+
resolve: phase === 'enter'
|
|
304
|
+
? meta.resolve?.(routeSnapshot, stateSnapshot)
|
|
305
|
+
: undefined,
|
|
306
|
+
}, injector, this.router, meta.handleExceptions, phase).then((outcome) => {
|
|
307
|
+
if (this._navId === navId) {
|
|
308
|
+
this.applyOutcome(outcome, meta, component, phase);
|
|
309
|
+
}
|
|
310
|
+
}, (error) => {
|
|
311
|
+
if (this._navId === navId) {
|
|
312
|
+
this.applyOutcome({ kind: 'thrownError', error }, meta, component, phase);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
applyOutcome(outcome, meta, component, _phase) {
|
|
317
|
+
this.clearTimers();
|
|
318
|
+
switch (outcome.kind) {
|
|
319
|
+
case 'data':
|
|
320
|
+
meta.guardDataSink?.set(outcome.guardData);
|
|
321
|
+
meta.resolveDataSink?.set(outcome.resolveData);
|
|
322
|
+
this.showTarget(component, meta);
|
|
323
|
+
this.installReactiveGuard(meta, component);
|
|
324
|
+
return;
|
|
325
|
+
case 'noop':
|
|
326
|
+
this.showTarget(component, meta);
|
|
327
|
+
this.installReactiveGuard(meta, component);
|
|
328
|
+
return;
|
|
329
|
+
case 'redirect':
|
|
330
|
+
void this.router.navigateByUrl(String(outcome.target));
|
|
331
|
+
return;
|
|
332
|
+
case 'stay':
|
|
333
|
+
if (this._previousUrl !== this.router.url) {
|
|
334
|
+
void this.router.navigateByUrl(this._previousUrl);
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
case 'render':
|
|
338
|
+
meta.exceptionSinks[outcome.exception._tag]?.set(outcome.exception);
|
|
339
|
+
void this.showErrorComponent(outcome.component, outcome.exception);
|
|
340
|
+
return;
|
|
341
|
+
case 'global':
|
|
342
|
+
this.publishGlobalError(outcome.exception);
|
|
343
|
+
void this.showErrorComponent(meta.errorComponent ?? this.defaultErrorComponent, outcome.exception);
|
|
344
|
+
return;
|
|
345
|
+
case 'thrownError': {
|
|
346
|
+
const exception = isCraftException(outcome.error)
|
|
347
|
+
? outcome.error
|
|
348
|
+
: null;
|
|
349
|
+
this.publishGlobalError(exception);
|
|
350
|
+
void this.showErrorComponent(meta.errorComponent ?? this.defaultErrorComponent, exception);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
showComponent(component, injector, target = component
|
|
356
|
+
? craftRouteTarget(component)
|
|
357
|
+
: null) {
|
|
358
|
+
const activationId = this._navId;
|
|
359
|
+
const displayVersion = ++this._displayVersion;
|
|
360
|
+
const props = this.routeProps();
|
|
361
|
+
const commit = () => {
|
|
362
|
+
// The browser may invoke a View Transition callback after a newer
|
|
363
|
+
// activation or swap has already been requested. Such a callback must
|
|
364
|
+
// not resurrect its old component, and its props must belong to the
|
|
365
|
+
// component captured at request time rather than the current route.
|
|
366
|
+
if (this._navId !== activationId ||
|
|
367
|
+
this._displayVersion !== displayVersion) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
this.displayedInjector.set(injector ?? undefined);
|
|
371
|
+
this.displayedProps.set(props);
|
|
372
|
+
// Publish the target last: CraftRouterOutlet mounts it as soon as the
|
|
373
|
+
// target becomes visible, so its route injector and inputs must already
|
|
374
|
+
// be available or the first render is created with the parent injector
|
|
375
|
+
// and immediately remounted when the injector signal catches up.
|
|
376
|
+
this.displayedTarget.set(target);
|
|
377
|
+
this.displayedComponent.set(component);
|
|
378
|
+
this.syncTemplateFlush();
|
|
379
|
+
};
|
|
380
|
+
if (!this.viewTransitionsEnabled) {
|
|
381
|
+
commit();
|
|
382
|
+
this.scheduleA11yNavigationFocus();
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
this.startViewTransition(() => {
|
|
386
|
+
commit();
|
|
387
|
+
});
|
|
388
|
+
this.scheduleA11yNavigationFocus();
|
|
389
|
+
}
|
|
390
|
+
scheduleA11yNavigationFocus() {
|
|
391
|
+
if (!this.a11yNavigationFocus) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (!this.a11yHasCompletedInitialActivation) {
|
|
395
|
+
this.a11yHasCompletedInitialActivation = true;
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
queueMicrotask(() => {
|
|
399
|
+
const target = this.document.getElementById('main') ??
|
|
400
|
+
this.document.querySelector('main');
|
|
401
|
+
if (!target || target.nodeType !== 1) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
const element = target;
|
|
405
|
+
if (!element.hasAttribute('tabindex')) {
|
|
406
|
+
element.tabIndex = -1;
|
|
407
|
+
}
|
|
408
|
+
element.focus();
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
showTarget(component, meta) {
|
|
412
|
+
const injector = this._activeRouteInjector ?? this.rootInjector;
|
|
413
|
+
const commit = () => {
|
|
414
|
+
this.showComponent(component, injector, this.resolveRouteTarget(component));
|
|
415
|
+
this.targetComponent.set(component);
|
|
416
|
+
this.state.set('loaded');
|
|
417
|
+
};
|
|
418
|
+
this.commitWithAntiFlicker(commit, meta);
|
|
419
|
+
}
|
|
420
|
+
async showErrorComponent(input, _exception) {
|
|
421
|
+
const resolved = await resolveComponentInput(input);
|
|
422
|
+
const target = resolved ? normalizeCraftRouteTarget(resolved) : null;
|
|
423
|
+
// Removing the Angular interop left this pinned at `null`, which silently
|
|
424
|
+
// emptied the error surface: nothing was reported through
|
|
425
|
+
// `errorComponent()` and nothing was mounted. The component IS the
|
|
426
|
+
// normalized target's — everything Craft renders is a Craft component.
|
|
427
|
+
const component = (target?.component ?? null);
|
|
428
|
+
this.errorComponent.set(component);
|
|
429
|
+
this.errorTarget.set(target);
|
|
430
|
+
this.showComponent(component, this._activeRouteInjector ?? this.rootInjector, target);
|
|
431
|
+
this.state.set('error');
|
|
432
|
+
this._frozen = true;
|
|
433
|
+
}
|
|
434
|
+
commitWithAntiFlicker(commit, meta) {
|
|
435
|
+
const minMs = meta.pendingMinMs ?? this.defaultPendingMinMs;
|
|
436
|
+
if (this.state() === 'pending' && minMs > 0) {
|
|
437
|
+
const elapsed = this.temporalRuntime.now() - this._pendingShownAt;
|
|
438
|
+
const remaining = minMs - elapsed;
|
|
439
|
+
if (remaining > 0) {
|
|
440
|
+
const navId = this._navId;
|
|
441
|
+
this._pendingCommitTimer = this.temporalRuntime.schedule(() => {
|
|
442
|
+
if (this._navId === navId) {
|
|
443
|
+
commit();
|
|
444
|
+
}
|
|
445
|
+
}, remaining, {
|
|
446
|
+
kind: 'router-anti-flicker',
|
|
447
|
+
owner: 'craft-router-outlet',
|
|
448
|
+
destroyRef: this.destroyRef,
|
|
449
|
+
});
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
commit();
|
|
454
|
+
}
|
|
455
|
+
installReactiveGuard(meta, component) {
|
|
456
|
+
this._frozen = false;
|
|
457
|
+
if (meta.reactiveGuards === false || !meta.guard) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const injector = this._activeRouteInjector ?? this.rootInjector;
|
|
461
|
+
const guardFactory = meta.guard;
|
|
462
|
+
const routeSnapshot = matchToSnapshot(this._match);
|
|
463
|
+
const stateSnapshot = { url: this.router.url, root: routeSnapshot };
|
|
464
|
+
this._reactiveWatch = runInInjectionContext(injector, () => craftWatch(() => {
|
|
465
|
+
const result = evaluateCraftGuardSync(guardFactory(routeSnapshot, stateSnapshot), injector);
|
|
466
|
+
if (this._frozen || result.kind !== 'exception') {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
void this.handleReactiveException(result.exception, meta, component);
|
|
470
|
+
}));
|
|
471
|
+
}
|
|
472
|
+
async handleReactiveException(exception, meta, component) {
|
|
473
|
+
const outcome = await this.chainRunner({
|
|
474
|
+
guard: (function* () {
|
|
475
|
+
return exception;
|
|
476
|
+
})(),
|
|
477
|
+
}, this._activeRouteInjector ?? this.rootInjector, this.router, meta.handleExceptions, 'active');
|
|
478
|
+
this.applyOutcome(outcome, meta, component, 'active');
|
|
479
|
+
}
|
|
480
|
+
shouldSkipBlank(meta) {
|
|
481
|
+
return (this.viewTransitionsEnabled &&
|
|
482
|
+
(meta.withLoaderViewTransitionImage === true ||
|
|
483
|
+
this.viewTransitionSkipBlank));
|
|
484
|
+
}
|
|
485
|
+
publishViewTransitionPayload() {
|
|
486
|
+
const extras = this.router.getCurrentNavigation()?.extras;
|
|
487
|
+
const fromNavigation = extras?.state;
|
|
488
|
+
const craftState = this.history?.getState();
|
|
489
|
+
const windowState = typeof history !== 'undefined'
|
|
490
|
+
? history.state
|
|
491
|
+
: undefined;
|
|
492
|
+
const source = this.history
|
|
493
|
+
? craftState
|
|
494
|
+
: extras?.skipLocationChange
|
|
495
|
+
? fromNavigation
|
|
496
|
+
: windowState;
|
|
497
|
+
const raw = source?.[CRAFT_VIEW_TRANSITION_STATE_KEY] ??
|
|
498
|
+
fromNavigation?.[CRAFT_VIEW_TRANSITION_STATE_KEY] ??
|
|
499
|
+
null;
|
|
500
|
+
this.viewTransitionSink.set(raw);
|
|
501
|
+
}
|
|
502
|
+
publishGlobalError(exception) {
|
|
503
|
+
const sink = this.rootInjector.get(CRAFT_GLOBAL_ERROR);
|
|
504
|
+
sink.set(exception);
|
|
505
|
+
}
|
|
506
|
+
async resolvePendingComponent(meta) {
|
|
507
|
+
const resolved = await resolvePendingComponentInput(meta.pendingComponent ?? this.defaultPendingComponent);
|
|
508
|
+
const target = resolved ? normalizeCraftRouteTarget(resolved) : null;
|
|
509
|
+
const component = null;
|
|
510
|
+
this.pendingComponent.set(component);
|
|
511
|
+
this.pendingTarget.set(target);
|
|
512
|
+
}
|
|
513
|
+
resolveRouteComponent(match) {
|
|
514
|
+
const component = match.route.component;
|
|
515
|
+
return component ?? null;
|
|
516
|
+
}
|
|
517
|
+
resolveRouteTarget(component) {
|
|
518
|
+
return (this._activeRouteInjector?.get(CRAFT_ROUTE_TARGET, null) ??
|
|
519
|
+
(component ? craftRouteTarget(component) : null));
|
|
520
|
+
}
|
|
521
|
+
routeProps() {
|
|
522
|
+
return collectMatchProps(this._match);
|
|
523
|
+
}
|
|
524
|
+
clearTimers() {
|
|
525
|
+
if (this._stayTimer !== null) {
|
|
526
|
+
this._stayTimer.cancel();
|
|
527
|
+
this._stayTimer = null;
|
|
528
|
+
}
|
|
529
|
+
if (this._blankTimer !== null) {
|
|
530
|
+
this._blankTimer.cancel();
|
|
531
|
+
this._blankTimer = null;
|
|
532
|
+
}
|
|
533
|
+
if (this._pendingCommitTimer !== null) {
|
|
534
|
+
this._pendingCommitTimer.cancel();
|
|
535
|
+
this._pendingCommitTimer = null;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
teardown() {
|
|
539
|
+
this._navId++;
|
|
540
|
+
this.clearTimers();
|
|
541
|
+
this._reactiveWatch?.destroy();
|
|
542
|
+
this._reactiveWatch = null;
|
|
543
|
+
this._frozen = false;
|
|
544
|
+
this.clearExceptionSinks(this._meta);
|
|
545
|
+
}
|
|
546
|
+
clearExceptionSinks(meta) {
|
|
547
|
+
if (!meta)
|
|
548
|
+
return;
|
|
549
|
+
for (const sink of Object.values(meta.exceptionSinks))
|
|
550
|
+
sink.set(null);
|
|
551
|
+
}
|
|
552
|
+
isCurrentActivation(match) {
|
|
553
|
+
return this._match !== null && isSameActivation(this._match, match);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
export function createCraftRouterOutletController() {
|
|
557
|
+
return new CraftRouterOutletController();
|
|
558
|
+
}
|
|
559
|
+
export async function resolveComponentInput(input) {
|
|
560
|
+
if (!input) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
if (input.loadComponent) {
|
|
564
|
+
const loaded = await input.loadComponent();
|
|
565
|
+
return loaded && typeof loaded === 'object' && 'default' in loaded
|
|
566
|
+
? loaded.default
|
|
567
|
+
: loaded;
|
|
568
|
+
}
|
|
569
|
+
return input.component;
|
|
570
|
+
}
|
|
571
|
+
async function resolvePendingComponentInput(input) {
|
|
572
|
+
if (!input)
|
|
573
|
+
return null;
|
|
574
|
+
if (isLazyPendingComponent(input)) {
|
|
575
|
+
return (await input()).default;
|
|
576
|
+
}
|
|
577
|
+
return input;
|
|
578
|
+
}
|
|
579
|
+
function isLazyPendingComponent(input) {
|
|
580
|
+
return (typeof input === 'function' &&
|
|
581
|
+
!isCraftRouteTarget(input) &&
|
|
582
|
+
input.prototype === undefined);
|
|
583
|
+
}
|
|
584
|
+
export function craftOutletStateOf(outlet) {
|
|
585
|
+
return outlet.state;
|
|
586
|
+
}
|
|
587
|
+
function silentRouter() {
|
|
588
|
+
return {
|
|
589
|
+
url: '/',
|
|
590
|
+
createUrlTree: (input) => ({
|
|
591
|
+
toString: () => `/${input.to}`,
|
|
592
|
+
__craftUrlTree: true,
|
|
593
|
+
}),
|
|
594
|
+
navigate: async () => true,
|
|
595
|
+
navigateByUrl: async () => true,
|
|
596
|
+
serializeUrl: (tree) => tree.toString(),
|
|
597
|
+
getCurrentNavigation: () => null,
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function collectAncestorGuardMetas(fullMatch, activated) {
|
|
601
|
+
const index = fullMatch.routes.indexOf(activated.route);
|
|
602
|
+
if (index <= 0) {
|
|
603
|
+
return [];
|
|
604
|
+
}
|
|
605
|
+
const metas = [];
|
|
606
|
+
for (const route of fullMatch.routes.slice(0, index)) {
|
|
607
|
+
const meta = getCraftRouteMeta(route.data);
|
|
608
|
+
if (meta?.match || meta?.guard) {
|
|
609
|
+
metas.push(meta);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
return metas;
|
|
613
|
+
}
|
|
614
|
+
function composeRouteMetas(ancestors, leaf) {
|
|
615
|
+
if (ancestors.length === 0) {
|
|
616
|
+
return leaf;
|
|
617
|
+
}
|
|
618
|
+
const guard = function* (route, state) {
|
|
619
|
+
for (const ancestor of ancestors) {
|
|
620
|
+
if (ancestor.match) {
|
|
621
|
+
const matchResult = yield* ancestor.match(route, state);
|
|
622
|
+
if (matchResult === false) {
|
|
623
|
+
return false;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (ancestor.guard) {
|
|
627
|
+
const guardResult = yield* ancestor.guard(route, state);
|
|
628
|
+
if (guardResult === false) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
if (leaf?.match) {
|
|
634
|
+
const matchResult = yield* leaf.match(route, state);
|
|
635
|
+
if (matchResult === false) {
|
|
636
|
+
return false;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if (leaf?.guard) {
|
|
640
|
+
return yield* leaf.guard(route, state);
|
|
641
|
+
}
|
|
642
|
+
return true;
|
|
643
|
+
};
|
|
644
|
+
if (!leaf) {
|
|
645
|
+
return {
|
|
646
|
+
match: undefined,
|
|
647
|
+
guard,
|
|
648
|
+
resolve: undefined,
|
|
649
|
+
handleExceptions: Object.assign({}, ...ancestors.map((ancestor) => ancestor.handleExceptions)),
|
|
650
|
+
guardDataSink: null,
|
|
651
|
+
resolveDataSink: null,
|
|
652
|
+
exceptionSinks: {},
|
|
653
|
+
reactiveGuards: false,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
return {
|
|
657
|
+
...leaf,
|
|
658
|
+
match: undefined,
|
|
659
|
+
guard,
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function paramNamesForPath(path) {
|
|
663
|
+
if (!path || path === '**') {
|
|
664
|
+
return [];
|
|
665
|
+
}
|
|
666
|
+
return path
|
|
667
|
+
.split('/')
|
|
668
|
+
.filter((segment) => segment.startsWith(':'))
|
|
669
|
+
.map((segment) => segment.slice(1).replace(/\?$/, ''));
|
|
670
|
+
}
|
|
671
|
+
function paramsForActivatedRoute(route, params) {
|
|
672
|
+
const names = paramNamesForPath(route.path);
|
|
673
|
+
const owned = {};
|
|
674
|
+
for (const name of names) {
|
|
675
|
+
if (params[name] !== undefined) {
|
|
676
|
+
owned[name] = params[name];
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return owned;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Whether the live component survives this navigation.
|
|
683
|
+
*
|
|
684
|
+
* Angular decides this on the route config ALONE — `RouteReuseStrategy` keeps
|
|
685
|
+
* the instance when `future.routeConfig === curr.routeConfig`, and a separate
|
|
686
|
+
* `runGuardsAndResolvers` decides whether the chain re-runs on a param change.
|
|
687
|
+
* Craft drove both from one comparison, so changing `:userId` tore the
|
|
688
|
+
* component down and took with it whatever state it held — which is why a
|
|
689
|
+
* `preservePreviousValue` query could never preserve anything across a
|
|
690
|
+
* navigation.
|
|
691
|
+
*
|
|
692
|
+
* Craft keeps the component and lets reactivity carry the new params: the
|
|
693
|
+
* fast-path publishes them on the live match signal, `injectRouteParamsSignal`
|
|
694
|
+
* derives from it, and reactive guards re-evaluate off their own watch.
|
|
695
|
+
*
|
|
696
|
+
* Resolvers have no such reactivity yet — `meta.resolve` runs once, in the
|
|
697
|
+
* `'enter'` phase — so a route carrying one still gets a full activation
|
|
698
|
+
* instead of silently stale resolve data.
|
|
699
|
+
*/
|
|
700
|
+
function canReuseActivation(current, next, meta) {
|
|
701
|
+
if (current.route !== next.route) {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
704
|
+
return meta?.resolve ? isSameActivation(current, next) : true;
|
|
705
|
+
}
|
|
706
|
+
function isSameActivation(current, next) {
|
|
707
|
+
if (current.route !== next.route) {
|
|
708
|
+
return false;
|
|
709
|
+
}
|
|
710
|
+
const currentParams = paramsForActivatedRoute(current.route, current.params);
|
|
711
|
+
const nextParams = paramsForActivatedRoute(next.route, next.params);
|
|
712
|
+
const currentKeys = Object.keys(currentParams);
|
|
713
|
+
const nextKeys = Object.keys(nextParams);
|
|
714
|
+
if (currentKeys.length !== nextKeys.length) {
|
|
715
|
+
return false;
|
|
716
|
+
}
|
|
717
|
+
return currentKeys.every((key) => currentParams[key] === nextParams[key]);
|
|
718
|
+
}
|
|
719
|
+
function matchToSnapshot(match) {
|
|
720
|
+
return {
|
|
721
|
+
params: match.params,
|
|
722
|
+
queryParams: match.queryParams,
|
|
723
|
+
data: match.data,
|
|
724
|
+
url: [],
|
|
725
|
+
routeConfig: { path: match.route.path },
|
|
726
|
+
pathFromRoot: match.routes.map((route) => ({
|
|
727
|
+
params: match.params,
|
|
728
|
+
data: route.data ?? {},
|
|
729
|
+
queryParams: match.queryParams,
|
|
730
|
+
routeConfig: route,
|
|
731
|
+
})),
|
|
732
|
+
component: match.route.component,
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
//# sourceMappingURL=craft-router-outlet.js.map
|