@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,559 @@
|
|
|
1
|
+
import { DestroyRef, EnvironmentInjector, Injector, inject, getCraftRootDefaultProviders, } from './host/craft-compat';
|
|
2
|
+
import { isCraftLoadingFeature, provideCraftLoading, } from './craft-pending';
|
|
3
|
+
import { CRAFT_TITLE_STRATEGY, createCraftTitleStrategy, } from './craft-a11y';
|
|
4
|
+
import { ActivatedRoute, } from './host/craft-router-types';
|
|
5
|
+
import { ɵtoCraftService as toCraftService, } from './craft-service';
|
|
6
|
+
import { CRAFT_VIEW_TRANSITION_STATE_KEY, } from './craft-view-transition';
|
|
7
|
+
import { CRAFT_NODE_EFFECT_FACTORY, craftNodeDirective, } from './craft-node-directive';
|
|
8
|
+
import { executeYieldable } from './yieldable';
|
|
9
|
+
import { executeGeneratorCompatibleFactoryAsync } from './craft-program-runtime';
|
|
10
|
+
import { buildPathFromTemplate, createBrowserHistory, createUrlFromParts, findUnresolvedLoadChildrenRoute, matchCraftRoutes, matchCraftRoutesAsync, parseSearchParams, serializeLocation, splitPath, } from './host/craft-router-runtime';
|
|
11
|
+
import { craftSignal, craftWatch, } from './host/craft-signal';
|
|
12
|
+
import { CRAFT_COMPILED_ROUTES, CRAFT_HISTORY, CRAFT_LOCATION, CRAFT_MATCH, CRAFT_ROUTER, } from './craft-router-tokens';
|
|
13
|
+
import { CRAFT_PLATFORM } from './craft-platform';
|
|
14
|
+
export { createBrowserHistory, createMemoryHistory, matchCraftRoutes, matchCraftRoutesAsync, } from './host/craft-router-runtime';
|
|
15
|
+
export { CRAFT_COMPILED_ROUTES, CRAFT_HISTORY, CRAFT_LOCATION, CRAFT_MATCH, CRAFT_ROUTER, } from './craft-router-tokens';
|
|
16
|
+
// The `toCraftService` return type references internal Angular symbols
|
|
17
|
+
// (`SIGNAL`, `[iterator]`, `[unscopables]`) that ng-packagr cannot serialize to
|
|
18
|
+
// `.d.ts` (TS4023/TS4118). Cast through `unknown` and re-shape the destructured
|
|
19
|
+
// locals as opaque `Function` so declaration emit only sees a serializable
|
|
20
|
+
// shape. The exported `CraftRouter` below re-casts
|
|
21
|
+
// through `as unknown as ...`, so the lost typing here doesn't reach consumers.
|
|
22
|
+
const _routerService = toCraftService({
|
|
23
|
+
name: 'CraftRouter',
|
|
24
|
+
providedIn: 'manuallyProvidedAtRoot',
|
|
25
|
+
token: CRAFT_ROUTER,
|
|
26
|
+
provide: provideCraftRouterRuntime,
|
|
27
|
+
}, (router) => router);
|
|
28
|
+
const provideCraftRouterInternal = _routerService.provideCraftRouter;
|
|
29
|
+
const CraftRouterInternal = _routerService.CraftRouter;
|
|
30
|
+
/**
|
|
31
|
+
* Registers the Craft history matcher AND the non-blocking outlet's
|
|
32
|
+
* pending/error surface in one call. Craft loading features
|
|
33
|
+
* (`withErrorComponent()`, `withTransitionTimings()`, `withPendingComponent()`,
|
|
34
|
+
* `withLoadingText()`, `withCraftViewTransitions()`) are applied; leftover
|
|
35
|
+
* Angular `RouterFeatures` such as `withComponentInputBinding()` are ignored
|
|
36
|
+
* (input binding is owned by the outlet).
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* provideCraftRouter(
|
|
40
|
+
* demoRoutes.toRoutes(),
|
|
41
|
+
* withErrorComponent({ component: CraftGlobalErrorComponentHost }),
|
|
42
|
+
* withTransitionTimings({ stayMs: 300, blankMs: 300, pendingMinMs: 500 }),
|
|
43
|
+
* )
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export function provideCraftRouter(routes, ...features) {
|
|
47
|
+
const loadingFeatures = [];
|
|
48
|
+
const configuredRoutes = [...routes];
|
|
49
|
+
for (const feature of features) {
|
|
50
|
+
if (isCraftLoadingFeature(feature)) {
|
|
51
|
+
loadingFeatures.push(feature);
|
|
52
|
+
if (feature.recoveryRoute) {
|
|
53
|
+
configuredRoutes.push(feature.recoveryRoute);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return [
|
|
58
|
+
...getCraftRootDefaultProviders(),
|
|
59
|
+
provideCraftRouterInternal(configuredRoutes),
|
|
60
|
+
...provideCraftLoading(...loadingFeatures),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Yields the `CraftRouter` inside a generator. Two equivalent forms.
|
|
65
|
+
*
|
|
66
|
+
* # Derived shortcut — recommended
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* yield* CraftRouter.navigate({
|
|
70
|
+
* to: 'query/:userId', // validated against the registry
|
|
71
|
+
* params: { userId: '1' }, // validated against the path's :params
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* `to` must match a path in `CraftRouterRoutesRegistry`; typos produce a
|
|
76
|
+
* "Did you mean…" error. `params` and `queryParams` are validated against
|
|
77
|
+
* that route's declaration.
|
|
78
|
+
*
|
|
79
|
+
* # Full router access
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* const router = yield* CraftRouter();
|
|
83
|
+
* router.events.subscribe(...);
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* Use this when you need a router property the shortcut doesn't expose
|
|
87
|
+
* (e.g. `events`, `routerState`, `url`).
|
|
88
|
+
*
|
|
89
|
+
* # Registry setup
|
|
90
|
+
*
|
|
91
|
+
* For the path validation to work without creating a self-referencing cycle,
|
|
92
|
+
* the registry augmentation must use the slim `META_PATHS` view, not
|
|
93
|
+
* `META_DATA`:
|
|
94
|
+
*
|
|
95
|
+
* ```ts
|
|
96
|
+
* declare module '@craft-ts/core' {
|
|
97
|
+
* interface CraftRouterRoutesRegistry {
|
|
98
|
+
* Demo: typeof demoRoutes.META_PATHS;
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* `META_DATA` stays available on the same `craftRoutes` result for tooling
|
|
104
|
+
* that needs the full per-route component dependencies (e.g. an e2e test
|
|
105
|
+
* runner that mocks every endpoint a route can reach).
|
|
106
|
+
*/
|
|
107
|
+
export const CraftRouter = CraftRouterInternal;
|
|
108
|
+
/**
|
|
109
|
+
* Functional Craft directive for type-safe router links.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* a({ craftRouterLink: { to: 'tasks' } }, 'Tasks').pipe(CraftRouterLink)
|
|
113
|
+
*/
|
|
114
|
+
export const CraftRouterLink = craftNodeDirective('CraftRouterLink', ['craftRouterLink'], (context) => {
|
|
115
|
+
const router = context.injector.get(CRAFT_ROUTER);
|
|
116
|
+
let currentInput;
|
|
117
|
+
let currentUrlTree;
|
|
118
|
+
const syncAriaCurrent = () => {
|
|
119
|
+
if (!currentUrlTree) {
|
|
120
|
+
context.renderer.removeAttribute(context.element, 'aria-current');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const active = router.isActive(currentUrlTree, {
|
|
124
|
+
paths: 'exact',
|
|
125
|
+
queryParams: 'ignored',
|
|
126
|
+
fragment: 'ignored',
|
|
127
|
+
matrixParams: 'ignored',
|
|
128
|
+
});
|
|
129
|
+
if (active) {
|
|
130
|
+
context.renderer.setAttribute(context.element, 'aria-current', 'page');
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
context.renderer.removeAttribute(context.element, 'aria-current');
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const hrefEffect = context.injector.get(CRAFT_NODE_EFFECT_FACTORY)('router-link-href', () => {
|
|
137
|
+
const candidate = context.props.craftRouterLink;
|
|
138
|
+
currentInput =
|
|
139
|
+
typeof candidate === 'function'
|
|
140
|
+
? executeYieldable(candidate, [], context.injector)
|
|
141
|
+
: candidate;
|
|
142
|
+
if (!currentInput) {
|
|
143
|
+
currentUrlTree = undefined;
|
|
144
|
+
context.renderer.removeAttribute(context.element, 'href');
|
|
145
|
+
syncAriaCurrent();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
currentUrlTree = router.createUrlTree(currentInput);
|
|
149
|
+
context.renderer.setAttribute(context.element, 'href', router.serializeUrl(currentUrlTree));
|
|
150
|
+
syncAriaCurrent();
|
|
151
|
+
});
|
|
152
|
+
const navigation = router.events.subscribe((event) => {
|
|
153
|
+
if (event.type === 'NavigationEnd')
|
|
154
|
+
syncAriaCurrent();
|
|
155
|
+
});
|
|
156
|
+
const removeClickListener = context.renderer.listen(context.element, 'click', (event) => {
|
|
157
|
+
const mouseEvent = event;
|
|
158
|
+
if (!currentInput ||
|
|
159
|
+
!currentUrlTree ||
|
|
160
|
+
!shouldHandleCraftRouterLinkClick(mouseEvent, context.element)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
mouseEvent.preventDefault();
|
|
164
|
+
void router.navigateByUrl(currentUrlTree, getNavigationBehaviorOptions(currentInput));
|
|
165
|
+
});
|
|
166
|
+
return () => {
|
|
167
|
+
removeClickListener();
|
|
168
|
+
navigation.unsubscribe();
|
|
169
|
+
hrefEffect.destroy();
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
export function shouldHandleCraftRouterLinkClick(event, element) {
|
|
173
|
+
if (event.defaultPrevented ||
|
|
174
|
+
event.button !== 0 ||
|
|
175
|
+
event.ctrlKey ||
|
|
176
|
+
event.shiftKey ||
|
|
177
|
+
event.altKey ||
|
|
178
|
+
event.metaKey) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
const target = element.getAttribute('target');
|
|
182
|
+
if (target && target.toLowerCase() !== '_self')
|
|
183
|
+
return false;
|
|
184
|
+
if (element.hasAttribute('download'))
|
|
185
|
+
return false;
|
|
186
|
+
if (element.hasAttribute('disabled') ||
|
|
187
|
+
element.getAttribute('aria-disabled') === 'true') {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
function emptyParamMap() {
|
|
193
|
+
return {
|
|
194
|
+
has: () => false,
|
|
195
|
+
get: () => null,
|
|
196
|
+
getAll: () => [],
|
|
197
|
+
keys: [],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function emptyActivatedRouteSnapshot() {
|
|
201
|
+
const snapshot = {
|
|
202
|
+
routeConfig: null,
|
|
203
|
+
url: [],
|
|
204
|
+
params: {},
|
|
205
|
+
queryParams: {},
|
|
206
|
+
fragment: null,
|
|
207
|
+
data: {},
|
|
208
|
+
outlet: 'primary',
|
|
209
|
+
paramMap: emptyParamMap(),
|
|
210
|
+
queryParamMap: emptyParamMap(),
|
|
211
|
+
parent: null,
|
|
212
|
+
root: null,
|
|
213
|
+
firstChild: null,
|
|
214
|
+
children: [],
|
|
215
|
+
pathFromRoot: [],
|
|
216
|
+
};
|
|
217
|
+
snapshot.root = snapshot;
|
|
218
|
+
snapshot.pathFromRoot = [snapshot];
|
|
219
|
+
return snapshot;
|
|
220
|
+
}
|
|
221
|
+
function matchToRouterStateSnapshot(match) {
|
|
222
|
+
const makeNode = (route, firstChild) => ({
|
|
223
|
+
routeConfig: route,
|
|
224
|
+
url: [],
|
|
225
|
+
params: match.params,
|
|
226
|
+
queryParams: match.queryParams,
|
|
227
|
+
fragment: match.hash ? match.hash.replace(/^#/, '') || null : null,
|
|
228
|
+
data: (route.data ?? match.data ?? {}),
|
|
229
|
+
outlet: 'primary',
|
|
230
|
+
title: typeof route.title === 'string' ? route.title : undefined,
|
|
231
|
+
paramMap: emptyParamMap(),
|
|
232
|
+
queryParamMap: emptyParamMap(),
|
|
233
|
+
parent: null,
|
|
234
|
+
root: null,
|
|
235
|
+
firstChild,
|
|
236
|
+
children: firstChild ? [firstChild] : [],
|
|
237
|
+
pathFromRoot: [],
|
|
238
|
+
});
|
|
239
|
+
let child = null;
|
|
240
|
+
for (let index = match.routes.length - 1; index >= 0; index -= 1) {
|
|
241
|
+
child = makeNode(match.routes[index], child);
|
|
242
|
+
}
|
|
243
|
+
const root = child ?? makeNode(match.route, null);
|
|
244
|
+
const path = [];
|
|
245
|
+
let current = root;
|
|
246
|
+
while (current) {
|
|
247
|
+
path.push(current);
|
|
248
|
+
current = current.firstChild;
|
|
249
|
+
}
|
|
250
|
+
path.forEach((node, index) => {
|
|
251
|
+
node.parent = index > 0 ? path[index - 1] : null;
|
|
252
|
+
node.pathFromRoot = path.slice(0, index + 1);
|
|
253
|
+
node.root = root;
|
|
254
|
+
});
|
|
255
|
+
return { url: serializeLocation(match), root };
|
|
256
|
+
}
|
|
257
|
+
function commitCraftMatch(match, history, location, resolved, titleStrategy) {
|
|
258
|
+
match.set(resolved);
|
|
259
|
+
if (resolved && serializeLocation(resolved) !== serializeLocation(location)) {
|
|
260
|
+
history.replace(serializeLocation(resolved), history.getState());
|
|
261
|
+
}
|
|
262
|
+
if (resolved) {
|
|
263
|
+
titleStrategy.updateTitle(matchToRouterStateSnapshot(resolved));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function resolveFunctionRedirectTo(match, parent) {
|
|
267
|
+
const redirectTo = match.route.redirectTo;
|
|
268
|
+
if (typeof redirectTo !== 'function') {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
const providers = Array.isArray(match.route.providers)
|
|
272
|
+
? match.route.providers
|
|
273
|
+
: [];
|
|
274
|
+
const injector = providers.length > 0
|
|
275
|
+
? Injector.create({
|
|
276
|
+
providers,
|
|
277
|
+
parent,
|
|
278
|
+
name: 'CraftRedirectTo',
|
|
279
|
+
})
|
|
280
|
+
: parent;
|
|
281
|
+
const settled = await executeGeneratorCompatibleFactoryAsync({
|
|
282
|
+
factory: redirectTo,
|
|
283
|
+
thisArg: undefined,
|
|
284
|
+
getInjector: () => injector,
|
|
285
|
+
args: [],
|
|
286
|
+
invalidYieldErrorMessage: 'craft redirectTo can only yield craftService dependencies, exposed dependency helpers, or an craftUntilSettled/craftUntilDefined await request.',
|
|
287
|
+
});
|
|
288
|
+
if (settled.kind !== 'done') {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
const value = settled.value;
|
|
292
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
293
|
+
return value;
|
|
294
|
+
}
|
|
295
|
+
if (value &&
|
|
296
|
+
typeof value === 'object' &&
|
|
297
|
+
typeof value.toString === 'function') {
|
|
298
|
+
const url = String(value);
|
|
299
|
+
return url.length > 0 && url !== '[object Object]' ? url : null;
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
function toAbsoluteRedirectUrl(url) {
|
|
304
|
+
return url.startsWith('/') ? url : `/${url}`;
|
|
305
|
+
}
|
|
306
|
+
function provideCraftRouterRuntime(routes = [], ..._features) {
|
|
307
|
+
const navigation = { current: null };
|
|
308
|
+
return [
|
|
309
|
+
{ provide: CRAFT_COMPILED_ROUTES, useValue: routes },
|
|
310
|
+
{
|
|
311
|
+
provide: CRAFT_TITLE_STRATEGY,
|
|
312
|
+
useFactory: () => createCraftTitleStrategy(),
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
// The Angular island used to bridge this token onto Angular's own
|
|
316
|
+
// ActivatedRoute. The Craft router owns it now: it is the leaf of the
|
|
317
|
+
// snapshot built from the current match, and empty before the first one.
|
|
318
|
+
provide: ActivatedRoute,
|
|
319
|
+
useFactory: (match) => {
|
|
320
|
+
const leafOf = (snapshot) => {
|
|
321
|
+
let node = snapshot;
|
|
322
|
+
while (node.firstChild)
|
|
323
|
+
node = node.firstChild;
|
|
324
|
+
return node;
|
|
325
|
+
};
|
|
326
|
+
const snapshot = () => {
|
|
327
|
+
const current = match();
|
|
328
|
+
return current
|
|
329
|
+
? leafOf(matchToRouterStateSnapshot(current).root)
|
|
330
|
+
: emptyActivatedRouteSnapshot();
|
|
331
|
+
};
|
|
332
|
+
return {
|
|
333
|
+
get snapshot() {
|
|
334
|
+
return snapshot();
|
|
335
|
+
},
|
|
336
|
+
get pathFromRoot() {
|
|
337
|
+
return snapshot().pathFromRoot.map((node) => ({
|
|
338
|
+
snapshot: node,
|
|
339
|
+
pathFromRoot: [],
|
|
340
|
+
}));
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
},
|
|
344
|
+
deps: [CRAFT_MATCH],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
provide: CRAFT_HISTORY,
|
|
348
|
+
useFactory: () => {
|
|
349
|
+
const platform = inject(Injector).get(CRAFT_PLATFORM, null);
|
|
350
|
+
const history = platform?.history ?? createBrowserHistory(globalThis.window);
|
|
351
|
+
inject(DestroyRef).onDestroy(() => history.dispose());
|
|
352
|
+
return history;
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
provide: CRAFT_LOCATION,
|
|
357
|
+
useFactory: (history) => {
|
|
358
|
+
const location = craftSignal(history.get());
|
|
359
|
+
const stop = history.listen((next) => location.set(next));
|
|
360
|
+
inject(DestroyRef).onDestroy(stop);
|
|
361
|
+
return location;
|
|
362
|
+
},
|
|
363
|
+
deps: [CRAFT_HISTORY],
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
provide: CRAFT_MATCH,
|
|
367
|
+
useFactory: (location, compiled, history) => {
|
|
368
|
+
const environmentInjector = inject(EnvironmentInjector);
|
|
369
|
+
const titleStrategy = inject(CRAFT_TITLE_STRATEGY, { optional: true }) ??
|
|
370
|
+
createCraftTitleStrategy();
|
|
371
|
+
const match = craftSignal(null);
|
|
372
|
+
let generation = 0;
|
|
373
|
+
craftWatch(() => {
|
|
374
|
+
const nextLocation = location();
|
|
375
|
+
const current = ++generation;
|
|
376
|
+
const syncMatch = matchCraftRoutes(compiled, nextLocation);
|
|
377
|
+
if (typeof syncMatch?.route.redirectTo === 'function') {
|
|
378
|
+
void resolveFunctionRedirectTo(syncMatch, environmentInjector)
|
|
379
|
+
.then((redirectUrl) => {
|
|
380
|
+
if (current !== generation || !redirectUrl) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const target = toAbsoluteRedirectUrl(redirectUrl);
|
|
384
|
+
if (target === serializeLocation(nextLocation)) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
history.replace(target, history.getState());
|
|
388
|
+
})
|
|
389
|
+
.catch(() => {
|
|
390
|
+
// Keep the previous match instead of mounting the redirect route.
|
|
391
|
+
});
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const pendingLocation = syncMatch ?? nextLocation;
|
|
395
|
+
const pending = findUnresolvedLoadChildrenRoute(compiled, splitPath(pendingLocation.pathname || '/'));
|
|
396
|
+
if (pending) {
|
|
397
|
+
void matchCraftRoutesAsync(compiled, {
|
|
398
|
+
...nextLocation,
|
|
399
|
+
pathname: pendingLocation.pathname || '/',
|
|
400
|
+
search: pendingLocation.search,
|
|
401
|
+
hash: pendingLocation.hash,
|
|
402
|
+
}).then((resolved) => {
|
|
403
|
+
if (current !== generation) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
commitCraftMatch(match, history, nextLocation, resolved, titleStrategy);
|
|
407
|
+
navigation.current = null;
|
|
408
|
+
}, () => {
|
|
409
|
+
// Keep the previous match. Inflight is cleared in
|
|
410
|
+
// ensureChildrenLoaded so a later navigation can retry.
|
|
411
|
+
});
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
commitCraftMatch(match, history, nextLocation, syncMatch, titleStrategy);
|
|
415
|
+
navigation.current = null;
|
|
416
|
+
});
|
|
417
|
+
return match;
|
|
418
|
+
},
|
|
419
|
+
deps: [CRAFT_LOCATION, CRAFT_COMPILED_ROUTES, CRAFT_HISTORY],
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
provide: CRAFT_ROUTER,
|
|
423
|
+
useFactory: (history, location) => createNativeCraftRouter(history, location, navigation),
|
|
424
|
+
deps: [CRAFT_HISTORY, CRAFT_LOCATION],
|
|
425
|
+
},
|
|
426
|
+
];
|
|
427
|
+
}
|
|
428
|
+
function createNativeCraftRouter(history, location, navigation) {
|
|
429
|
+
const listeners = new Set();
|
|
430
|
+
const toUrl = (input) => {
|
|
431
|
+
const current = history.get();
|
|
432
|
+
let query = input.queryParams ?? undefined;
|
|
433
|
+
if (input.queryParamsHandling === 'preserve') {
|
|
434
|
+
query = parseSearchParams(current.search);
|
|
435
|
+
}
|
|
436
|
+
else if (input.queryParamsHandling === 'merge') {
|
|
437
|
+
query = {
|
|
438
|
+
...parseSearchParams(current.search),
|
|
439
|
+
...(input.queryParams ?? {}),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
const fragment = input.preserveFragment
|
|
443
|
+
? current.hash.replace(/^#/, '') || undefined
|
|
444
|
+
: (input.fragment ?? undefined);
|
|
445
|
+
return createUrlFromParts(buildPathFromTemplate(input.to, input.params), query, fragment);
|
|
446
|
+
};
|
|
447
|
+
const createUrlTree = (input) => {
|
|
448
|
+
const url = toUrl(input);
|
|
449
|
+
return { toString: () => url, __craftUrlTree: true };
|
|
450
|
+
};
|
|
451
|
+
const commit = (url, extras) => {
|
|
452
|
+
const withVt = extras
|
|
453
|
+
? {
|
|
454
|
+
...extras,
|
|
455
|
+
state: withViewTransitionState(extras, extras.state),
|
|
456
|
+
}
|
|
457
|
+
: extras;
|
|
458
|
+
navigation.current = { extras: withVt };
|
|
459
|
+
for (const listener of listeners) {
|
|
460
|
+
listener({ type: 'NavigationStart', url });
|
|
461
|
+
}
|
|
462
|
+
if (withVt?.skipLocationChange) {
|
|
463
|
+
history.skip(url, withVt.state ?? null);
|
|
464
|
+
}
|
|
465
|
+
else if (withVt?.replaceUrl) {
|
|
466
|
+
history.replace(url, withVt.state ?? null);
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
history.push(url, withVt?.state ?? null);
|
|
470
|
+
}
|
|
471
|
+
for (const listener of listeners) {
|
|
472
|
+
listener({ type: 'NavigationEnd', url });
|
|
473
|
+
}
|
|
474
|
+
return Promise.resolve(true);
|
|
475
|
+
};
|
|
476
|
+
return {
|
|
477
|
+
get url() {
|
|
478
|
+
return serializeLocation(location());
|
|
479
|
+
},
|
|
480
|
+
createUrlTree,
|
|
481
|
+
navigate: (input) => commit(toUrl(input), input),
|
|
482
|
+
navigateByUrl: ((input, extras) => {
|
|
483
|
+
if (typeof input === 'string') {
|
|
484
|
+
return commit(input, extras);
|
|
485
|
+
}
|
|
486
|
+
if (input &&
|
|
487
|
+
typeof input === 'object' &&
|
|
488
|
+
'to' in input &&
|
|
489
|
+
typeof input.to === 'string') {
|
|
490
|
+
const navigationInput = input;
|
|
491
|
+
return commit(toUrl(navigationInput), {
|
|
492
|
+
...extras,
|
|
493
|
+
...navigationInput,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
return commit(String(input), extras);
|
|
497
|
+
}),
|
|
498
|
+
serializeUrl: (tree) => tree.toString(),
|
|
499
|
+
isActive: (tree, extras) => {
|
|
500
|
+
const target = String(tree).split('?')[0]?.split('#')[0] ?? '';
|
|
501
|
+
const current = location().pathname;
|
|
502
|
+
if (extras?.paths === 'subset') {
|
|
503
|
+
return current === target || current.startsWith(`${target}/`);
|
|
504
|
+
}
|
|
505
|
+
return current === target;
|
|
506
|
+
},
|
|
507
|
+
events: {
|
|
508
|
+
subscribe(fn) {
|
|
509
|
+
listeners.add(fn);
|
|
510
|
+
return {
|
|
511
|
+
unsubscribe: () => {
|
|
512
|
+
listeners.delete(fn);
|
|
513
|
+
},
|
|
514
|
+
};
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
getCurrentNavigation: () => navigation.current,
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
export function createCraftRouterCommands(input) {
|
|
521
|
+
if (input.to === '') {
|
|
522
|
+
return ['/'];
|
|
523
|
+
}
|
|
524
|
+
const segments = input.to.split('/').filter(Boolean);
|
|
525
|
+
if (segments.length === 0) {
|
|
526
|
+
return ['/'];
|
|
527
|
+
}
|
|
528
|
+
return segments.map((segment, index) => {
|
|
529
|
+
const value = segment.startsWith(':')
|
|
530
|
+
? resolveRouteParamValue(segment, input)
|
|
531
|
+
: segment;
|
|
532
|
+
return index === 0 ? `/${value}` : value;
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
function resolveRouteParamValue(segment, input) {
|
|
536
|
+
const paramName = segment.slice(1).replace(/\?$/, '');
|
|
537
|
+
const value = input.params?.[paramName];
|
|
538
|
+
if (value === undefined) {
|
|
539
|
+
throw new Error(`Missing route param "${paramName}" for route "${input.to}".`);
|
|
540
|
+
}
|
|
541
|
+
return value;
|
|
542
|
+
}
|
|
543
|
+
function getNavigationBehaviorOptions(input) {
|
|
544
|
+
return {
|
|
545
|
+
replaceUrl: input.replaceUrl,
|
|
546
|
+
skipLocationChange: input.skipLocationChange,
|
|
547
|
+
state: withViewTransitionState(input, input.state),
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function withViewTransitionState(input, state) {
|
|
551
|
+
if (input.viewTransition === undefined) {
|
|
552
|
+
return state;
|
|
553
|
+
}
|
|
554
|
+
return {
|
|
555
|
+
...(state ?? {}),
|
|
556
|
+
[CRAFT_VIEW_TRANSITION_STATE_KEY]: input.viewTransition,
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
//# sourceMappingURL=craft-router.js.map
|