@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 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/form/validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAU,MAAM,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAEL,sBAAsB,EAItB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAW1B,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AA0VzE,MAAM,mBAAmB,GAAG,MAAe,CAAC;AAC5C,MAAM,oBAAoB,GAAG,OAAgB,CAAC;AAE9C,SAAS,sBAAsB,CAC7B,MAA+B;IAE/B,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,OAAQ,MAAuB,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,IAA+B;IACrD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAMrB,IAAU,EACV,IAAU,EACV,IAAU,EACV,OAAgB;IAEhB,OAAO;QACL,IAAI;QACJ,CAAC,sBAAsB,CAAC,EAAE,IAAI;QAC9B,OAAO;QACP,CAAC,IAAI,CAAC,EAAE,OAAO;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ChC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,EACD,KAAK,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS;YACzC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAE,MAA4D;iBAC1D,QAAQ;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,IAAI,CAClB,MAA0B;IAE1B,OAAO,kBAAkB,CAAS;QAChC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,EACD,KAAK,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS;YACzC,CAAC,CAAC,MAAM,CAAC,GAAG;YACZ,CAAC,CAAE,MAA4D;iBAC1D,QAAQ;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,MAAgC;IAEhC,OAAO,wBAAwB,CAAS,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,MAAgC;IAEhC,OAAO,wBAAwB,CAAS,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,QAAQ,CACtB,MAA8B;IAE9B,OAAO,sBAAsB,CAAS,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAMvB,MAAiE;IAEjE,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AAEpC,MAAM,UAAU,cAAc,CAS5B,WAAyB,EACzB,MAQC;IAeD,OAAO,0BAA0B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC","sourcesContent":["import { computed, effect, Signal, signal, untracked } from '../host/craft-compat';\nimport {\n AnyCraftException,\n CRAFT_EXCEPTION_SYMBOL,\n CraftExceptionResult,\n ExcludeByCode,\n ExtractCodeFromCraftResultUnion,\n isCraftException,\n} from '../craft-exception';\nimport {\n isYieldableReactiveValue,\n rawReactiveFacade,\n rawReactiveValue,\n type YieldableReactiveValue,\n} from '../reactive-read';\nimport { MergeObjects } from '../util/util.type';\nimport {\n CraftField,\n CraftFieldError,\n CraftValidator,\n CraftValidatorContext,\n CraftValidatorOutput,\n FieldAttributeMeta,\n} from './craft-field';\n\nexport const VALIDATOR_OUTPUT_SYMBOL = Symbol('VALIDATOR_OUTPUT_SYMBOL');\n\nexport type ValidatorType = 'sync' | 'async';\n\nexport type ValidatorUtilBrand<\n Name,\n Type extends ValidatorType = ValidatorType,\n Meta extends object = {},\n> = {\n __brand: Name;\n type: Type;\n} & Meta;\n\nexport type ValidatorSuccess<\n Name extends string,\n Type extends ValidatorType = 'sync',\n Meta extends object = {},\n> = {\n valid: true;\n} & ValidatorUtilBrand<Name, Type, Meta>;\n\nexport type ValidatorPending<\n Name extends string,\n Type extends ValidatorType = 'async',\n Meta extends object = {},\n> = {\n valid: false;\n} & ValidatorUtilBrand<Name, Type, Meta>;\n\ntype ValidatorRuntimeKind = 'signal';\n\ntype ValidatorRuntime<\n Name extends string = string,\n Type extends ValidatorType = ValidatorType,\n Kind extends ValidatorRuntimeKind = ValidatorRuntimeKind,\n> = {\n readonly name: Name;\n readonly type: Type;\n readonly kind: Kind;\n};\n\ntype ValidatorRuntimeCarrier<\n Name extends string = string,\n Type extends ValidatorType = ValidatorType,\n Kind extends ValidatorRuntimeKind = ValidatorRuntimeKind,\n> = {\n readonly [VALIDATOR_OUTPUT_SYMBOL]: ValidatorRuntime<Name, Type, Kind>;\n};\n\n/**\n * A Craft validator factory output.\n *\n * Calling the returned function from inside `CraftField.ɵregisterValidator` (which\n * `insertFormAttributes` does internally) yields a `CraftValidatorResult` that the\n * field aggregates into its `errors()` and native-constraint signals.\n */\nexport type ValidatorOutput<\n TValue,\n Name extends string,\n Exceptions,\n Type extends ValidatorType = 'sync',\n Identifier = unknown,\n Meta extends object = {},\n> = CraftValidator<TValue> &\n ValidatorRuntimeCarrier<Name, Type, 'signal'> & {\n /** @internal phantom marker for type extraction */\n readonly __exceptions?: Exceptions;\n /** @internal phantom marker for type extraction */\n readonly __meta?: Meta;\n /** @internal phantom marker for type extraction */\n readonly __identifier?: Identifier;\n };\n\ntype ValidatorOption<TValue> = TValue | (() => TValue);\n\ntype ValidatorConfig = {\n when?: ValidatorOption<boolean>;\n};\n\ntype ValueWithLengthOrSize =\n | {\n length: number;\n }\n | {\n size: number;\n };\n\ntype ValidatorException<\n Code extends string,\n Payload = undefined,\n> = CraftExceptionResult<\n {\n _tag: Code;\n },\n Payload\n>;\n\nexport type CRequiredException = ValidatorException<'required'>;\nexport type CEmailException = ValidatorException<'email'>;\nexport type CMinException = ValidatorException<'min', number>;\nexport type CMaxException = ValidatorException<'max', number>;\nexport type CMinLengthException = ValidatorException<'minLength', number>;\nexport type CMaxLengthException = ValidatorException<'maxLength', number>;\ntype CPatternException = ValidatorException<'pattern', RegExp>;\n\ntype CRequiredConfig<TValue> = ValidatorConfig;\ntype CEmailConfig<TValue extends string | null | undefined> = ValidatorConfig;\ntype CMinConfig<TValue extends number | string | null | undefined> =\n ValidatorConfig &\n (\n | {\n min: ValidatorOption<number | undefined>;\n minValue?: never;\n }\n | {\n min?: never;\n minValue: ValidatorOption<number | undefined>;\n }\n );\ntype CMaxConfig<TValue extends number | string | null | undefined> =\n ValidatorConfig &\n (\n | {\n max: ValidatorOption<number | undefined>;\n maxValue?: never;\n }\n | {\n max?: never;\n maxValue: ValidatorOption<number | undefined>;\n }\n );\ntype CMinLengthConfig<TValue extends ValueWithLengthOrSize> =\n ValidatorConfig & {\n minLength: ValidatorOption<number | undefined>;\n };\ntype CMaxLengthConfig<TValue extends ValueWithLengthOrSize> =\n ValidatorConfig & {\n maxLength: ValidatorOption<number | undefined>;\n };\ntype CPatternConfig<TValue extends string | null | undefined> =\n ValidatorConfig & {\n pattern: ValidatorOption<RegExp | undefined>;\n };\n\ntype CValidateBaseConfig<Name extends string> = {\n name: Name;\n type?: 'sync';\n};\n\ntype CValidateAdvancedSyncConfig<\n TValue,\n Name extends string,\n Exceptions,\n Identifier = unknown,\n> = CValidateBaseConfig<Name> & {\n validate: (\n context: CraftValidatorContext<TValue> & { identifier: Identifier },\n ) => Signal<Exceptions | undefined>;\n};\n\ntype CValidateSimpleSyncConfig<\n TValue,\n Name extends string,\n Exceptions,\n Identifier = unknown,\n> = CValidateBaseConfig<Name> &\n ValidatorConfig & {\n validWhen: ValidatorOption<boolean>;\n exception: ValidatorOption<Exceptions>;\n };\n\ntype CValidateSyncConfig<\n TValue,\n Name extends string,\n Exceptions,\n Identifier = unknown,\n> =\n | CValidateAdvancedSyncConfig<TValue, Name, Exceptions, Identifier>\n | CValidateSimpleSyncConfig<TValue, Name, Exceptions, Identifier>;\n\ntype AsyncReactiveValue<T> = Signal<T> | YieldableReactiveValue<T>;\n\ntype AnyAsyncCraftResourceRef = {\n kind: 'query' | 'mutation';\n exceptions: AsyncReactiveValue<{ list: AnyCraftException[] }>;\n hasException: AsyncReactiveValue<boolean>;\n resourceParamsSrc: AsyncReactiveValue<unknown>;\n call?: (value: any) => unknown;\n mutate?: (value: any) => unknown;\n select?: (identifier: any) => unknown;\n};\n\ntype AsyncValidatorRequest<TResourceRef extends AnyAsyncCraftResourceRef> =\n TResourceRef extends { call: (value: infer Args) => unknown }\n ? Args\n : TResourceRef extends { mutate: (value: infer Args) => unknown }\n ? Args\n : TResourceRef extends {\n resourceParamsSrc: AsyncReactiveValue<infer Params>;\n }\n ? Exclude<Params, undefined>\n : never;\n\ntype AsyncValidatorResourceTarget<TResourceRef> = TResourceRef extends {\n select: (...args: any[]) => infer SelectedResource;\n}\n ? NonNullable<SelectedResource>\n : TResourceRef;\n\ntype AsyncValidatorResourceIdentifier<TResourceRef> = TResourceRef extends {\n select: (identifier: infer Identifier) => unknown;\n}\n ? Identifier\n : unknown;\n\ntype AsyncValidatorResourceExceptionUnion<TResource> = TResource extends {\n exceptions: AsyncReactiveValue<{ list: (infer Exception)[] }>;\n}\n ? Exception\n : never;\n\ntype ExtractValidatorExceptionItems<T> = T extends readonly (infer Item)[]\n ? Item\n : T;\n\ntype AsyncValidatorContext<\n TValue,\n TResourceRef extends AnyAsyncCraftResourceRef,\n Identifier = unknown,\n TResource = AsyncValidatorResourceTarget<TResourceRef>,\n ResourceExceptions = AsyncValidatorResourceExceptionUnion<TResource>,\n ResourceExceptionCodes = ExtractCodeFromCraftResultUnion<ResourceExceptions>,\n> = CraftValidatorContext<TValue> & {\n identifier: Identifier;\n validateAsyncCraftResource: TResource;\n omitExceptions: <C extends ResourceExceptionCodes>(\n codes: readonly C[],\n ) => ExcludeByCode<ResourceExceptions, C>[];\n};\n\ntype IsValidAsyncExceptions<T> = [unknown] extends [T]\n ? true\n : NonNullable<T> extends AnyCraftException\n ? true\n : NonNullable<T> extends readonly (infer Item)[]\n ? Item extends AnyCraftException\n ? true\n : false\n : false;\n\ntype HasValidAsyncExceptionReturn<\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n> =\n IsValidAsyncExceptions<SuccessExceptions> extends true\n ? IsValidAsyncExceptions<ErrorExceptions> extends true\n ? IsValidAsyncExceptions<ExceptionExceptions> extends true\n ? true\n : {\n success: true;\n error: true;\n exceptions: false;\n }\n : {\n success: true;\n error: false;\n exceptions: IsValidAsyncExceptions<ExceptionExceptions>;\n }\n : {\n success: false;\n error: IsValidAsyncExceptions<ErrorExceptions>;\n exceptions: IsValidAsyncExceptions<ExceptionExceptions>;\n };\n\ntype ValidationDetails = {\n success: boolean;\n error: boolean;\n exceptions: boolean;\n};\n\ntype InvalidAsyncExceptionsMessage<T> = T extends true\n ? never\n : T extends ValidationDetails\n ? `Not valid ${\n | (T['success'] extends false ? 'exceptionsOnSuccess callback' : never)\n | (T['error'] extends false ? 'error callback' : never)\n | (T['exceptions'] extends false ? 'onException callback' : never)}`\n : never;\n\ntype CAsyncValidateConfig<\n TValue,\n Name extends string,\n TResourceRef extends AnyAsyncCraftResourceRef,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n Identifier = unknown,\n> = MergeObjects<\n [\n ValidatorConfig & {\n name: Name;\n isValidSuccess?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => boolean;\n exceptionsOnSuccess?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => SuccessExceptions;\n exception?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => ErrorExceptions;\n onException?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => ExceptionExceptions;\n },\n HasValidAsyncExceptionReturn<\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions\n > extends true\n ? {}\n : {\n typingError: `cAsyncValidate callbacks must only return Craft exceptions, arrays of Craft exceptions, or undefined. ${InvalidAsyncExceptionsMessage<HasValidAsyncExceptionReturn<SuccessExceptions, ErrorExceptions, ExceptionExceptions>>}`;\n },\n ]\n>;\n\ntype ToAsyncValidatorExceptions<\n ResourceExceptions,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n> = [unknown] extends [ExceptionExceptions]\n ? Exclude<\n | ResourceExceptions\n | ExtractValidatorExceptionItems<SuccessExceptions>\n | ExtractValidatorExceptionItems<ErrorExceptions>,\n undefined\n >\n : Exclude<\n | ExtractValidatorExceptionItems<SuccessExceptions>\n | ExtractValidatorExceptionItems<ErrorExceptions>\n | ExtractValidatorExceptionItems<ExceptionExceptions>,\n undefined\n >;\n\nconst SYNC_VALIDATOR_TYPE = 'sync' as const;\nconst ASYNC_VALIDATOR_TYPE = 'async' as const;\n\nfunction resolveValidatorOption<TValue>(\n option: ValidatorOption<TValue>,\n): TValue {\n if (typeof option === 'function') {\n return (option as () => TValue)();\n }\n\n return option;\n}\n\nfunction shouldValidate(when?: ValidatorOption<boolean>): boolean {\n return when === undefined ? true : resolveValidatorOption(when);\n}\n\nfunction brandException<\n Name extends string,\n Type extends ValidatorType,\n Code extends string,\n Payload,\n>(\n name: Name,\n type: Type,\n _tag: Code,\n payload: Payload,\n): AnyCraftException & ValidatorUtilBrand<Name, Type, {}> {\n return {\n _tag,\n [CRAFT_EXCEPTION_SYMBOL]: true,\n payload,\n [_tag]: payload,\n __brand: name,\n type,\n } as AnyCraftException & ValidatorUtilBrand<Name, Type, {}>;\n}\n\nfunction brandRawException<Name extends string, Type extends ValidatorType>(\n name: Name,\n type: Type,\n exception: AnyCraftException | AnyCraftException[],\n): CraftFieldError | CraftFieldError[] {\n if (Array.isArray(exception)) {\n return exception.map(\n (e) => ({ ...e, __brand: name, type }) as unknown as CraftFieldError,\n );\n }\n return { ...exception, __brand: name, type } as unknown as CraftFieldError;\n}\n\nfunction withRuntime<\n Name extends string,\n Type extends ValidatorType,\n TValidator extends CraftValidator<any>,\n>(\n validator: TValidator,\n runtime: ValidatorRuntime<Name, Type, 'signal'>,\n): TValidator & ValidatorRuntimeCarrier<Name, Type, 'signal'> {\n return Object.assign(validator, {\n [VALIDATOR_OUTPUT_SYMBOL]: runtime,\n });\n}\n\nfunction isEmptyValue(value: unknown): boolean {\n if (value === null || value === undefined) return true;\n if (typeof value === 'string') return value.length === 0;\n if (Array.isArray(value)) return value.length === 0;\n return false;\n}\n\nfunction asNumber(value: unknown): number | undefined {\n if (value === null || value === undefined || value === '') return undefined;\n const n = typeof value === 'number' ? value : Number(value);\n return Number.isNaN(n) ? undefined : n;\n}\n\nfunction lengthOf(value: unknown): number | undefined {\n if (value === null || value === undefined) return undefined;\n if (typeof value === 'string') return value.length;\n if (Array.isArray(value)) return value.length;\n if (\n typeof value === 'object' &&\n 'length' in value &&\n typeof (value as { length: unknown }).length === 'number'\n ) {\n return (value as { length: number }).length;\n }\n if (\n typeof value === 'object' &&\n 'size' in value &&\n typeof (value as { size: unknown }).size === 'number'\n ) {\n return (value as { size: number }).size;\n }\n return undefined;\n}\n\nfunction normalizeCraftExceptionOutput(\n value: unknown,\n):\n | { raw: AnyCraftException | AnyCraftException[]; list: AnyCraftException[] }\n | undefined {\n if (value === undefined) return undefined;\n if (Array.isArray(value)) {\n const list = value.filter(isCraftException);\n return list.length === 0 ? undefined : { raw: list, list };\n }\n if (!isCraftException(value)) return undefined;\n return { raw: value, list: [value] };\n}\n\nfunction getResourceExceptionList(value: unknown): AnyCraftException[] {\n if (\n typeof value !== 'object' ||\n value === null ||\n !('exceptions' in value) ||\n typeof (value as { exceptions?: unknown }).exceptions !== 'function'\n ) {\n return [];\n }\n const exceptions = (\n value as {\n exceptions: AsyncReactiveValue<{ list?: unknown[] }>;\n }\n ).exceptions;\n const list = readAsyncReactiveValue(exceptions)?.list;\n return Array.isArray(list) ? list.filter(isCraftException) : [];\n}\n\nfunction hasResourceExceptions(value: unknown): boolean {\n if (\n typeof value === 'object' &&\n value !== null &&\n 'hasException' in value &&\n typeof (value as { hasException?: unknown }).hasException === 'function'\n ) {\n return !!readAsyncReactiveValue(\n (value as { hasException: AsyncReactiveValue<boolean> }).hasException,\n );\n }\n return getResourceExceptionList(value).length > 0;\n}\n\nfunction isResourceRefWithSelection(\n value: AnyAsyncCraftResourceRef,\n): value is AnyAsyncCraftResourceRef & {\n select: (identifier: any) => unknown;\n} {\n return 'select' in value && typeof value.select === 'function';\n}\n\nfunction readAsyncReactiveValue<T>(value: AsyncReactiveValue<T>): T {\n return isYieldableReactiveValue(value) ? rawReactiveValue(value)() : value();\n}\n\nfunction resolveAsyncValidatorResourceTarget<\n TResourceRef extends AnyAsyncCraftResourceRef,\n>(\n resourceRef: TResourceRef,\n identifier: AsyncValidatorResourceIdentifier<TResourceRef>,\n): AsyncValidatorResourceTarget<TResourceRef> | undefined {\n if (!isResourceRefWithSelection(resourceRef)) {\n return resourceRef as AsyncValidatorResourceTarget<TResourceRef>;\n }\n if (identifier === undefined || identifier === null) return undefined;\n return resourceRef.select(\n identifier as Parameters<typeof resourceRef.select>[0],\n ) as AsyncValidatorResourceTarget<TResourceRef> | undefined;\n}\n\n// =====================================================================\n// Built-in validators\n// =====================================================================\n\nfunction createRequiredValidator<TValue>({\n when,\n}: {\n when?: ValidatorOption<boolean>;\n}): ValidatorOutput<TValue, 'cRequired', CRequiredException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n return isEmptyValue(value())\n ? (brandException(\n 'cRequired',\n SYNC_VALIDATOR_TYPE,\n 'required',\n undefined,\n ) as CraftFieldError)\n : undefined;\n }),\n attribute: computed<FieldAttributeMeta | undefined>(() => {\n if (!shouldValidate(when)) return undefined;\n return { kind: 'native-constraint', target: 'required', value: true };\n }),\n });\n return withRuntime(validator, {\n name: 'cRequired',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cRequired', CRequiredException>;\n}\n\nconst EMAIL_REGEX = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/;\n\nfunction createEmailValidator<TValue extends string | null | undefined>({\n when,\n}: {\n when?: ValidatorOption<boolean>;\n}): ValidatorOutput<TValue, 'cEmail', CEmailException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const v = value();\n if (v === null || v === undefined || v === '') return undefined;\n if (typeof v !== 'string') return undefined;\n return EMAIL_REGEX.test(v)\n ? undefined\n : (brandException(\n 'cEmail',\n SYNC_VALIDATOR_TYPE,\n 'email',\n undefined,\n ) as CraftFieldError);\n }),\n });\n return withRuntime(validator, {\n name: 'cEmail',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cEmail', CEmailException>;\n}\n\nfunction createMinValidator<TValue extends number | string | null | undefined>({\n when,\n min: minValue,\n}: {\n when?: ValidatorOption<boolean>;\n min: ValidatorOption<number | undefined>;\n}): ValidatorOutput<TValue, 'cMin', CMinException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const m = resolveValidatorOption(minValue);\n if (m === undefined) return undefined;\n const n = asNumber(value());\n if (n === undefined) return undefined;\n return n < m\n ? (brandException(\n 'cMin',\n SYNC_VALIDATOR_TYPE,\n 'min',\n m,\n ) as CraftFieldError)\n : undefined;\n }),\n attribute: computed<FieldAttributeMeta | undefined>(() => {\n const m = resolveValidatorOption(minValue);\n return m !== undefined && shouldValidate(when)\n ? { kind: 'native-constraint', target: 'min', value: m }\n : undefined;\n }),\n });\n return withRuntime(validator, {\n name: 'cMin',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cMin', CMinException>;\n}\n\nfunction createMaxValidator<TValue extends number | string | null | undefined>({\n when,\n max: maxValue,\n}: {\n when?: ValidatorOption<boolean>;\n max: ValidatorOption<number | undefined>;\n}): ValidatorOutput<TValue, 'cMax', CMaxException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const m = resolveValidatorOption(maxValue);\n if (m === undefined) return undefined;\n const n = asNumber(value());\n if (n === undefined) return undefined;\n return n > m\n ? (brandException(\n 'cMax',\n SYNC_VALIDATOR_TYPE,\n 'max',\n m,\n ) as CraftFieldError)\n : undefined;\n }),\n attribute: computed<FieldAttributeMeta | undefined>(() => {\n const m = resolveValidatorOption(maxValue);\n return m !== undefined && shouldValidate(when)\n ? { kind: 'native-constraint', target: 'max', value: m }\n : undefined;\n }),\n });\n return withRuntime(validator, {\n name: 'cMax',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cMax', CMaxException>;\n}\n\nfunction createMinLengthValidator<TValue extends ValueWithLengthOrSize>({\n when,\n minLength,\n}: {\n when?: ValidatorOption<boolean>;\n minLength: ValidatorOption<number | undefined>;\n}): ValidatorOutput<TValue, 'cMinLength', CMinLengthException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const m = resolveValidatorOption(minLength);\n if (m === undefined) return undefined;\n const len = lengthOf(value());\n if (len === undefined) return undefined;\n return len < m\n ? (brandException(\n 'cMinLength',\n SYNC_VALIDATOR_TYPE,\n 'minLength',\n m,\n ) as CraftFieldError)\n : undefined;\n }),\n attribute: computed<FieldAttributeMeta | undefined>(() => {\n const m = resolveValidatorOption(minLength);\n return m !== undefined && shouldValidate(when)\n ? { kind: 'native-constraint', target: 'minLength', value: m }\n : undefined;\n }),\n });\n return withRuntime(validator, {\n name: 'cMinLength',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cMinLength', CMinLengthException>;\n}\n\nfunction createMaxLengthValidator<TValue extends ValueWithLengthOrSize>({\n when,\n maxLength,\n}: {\n when?: ValidatorOption<boolean>;\n maxLength: ValidatorOption<number | undefined>;\n}): ValidatorOutput<TValue, 'cMaxLength', CMaxLengthException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const m = resolveValidatorOption(maxLength);\n if (m === undefined) return undefined;\n const len = lengthOf(value());\n if (len === undefined) return undefined;\n return len > m\n ? (brandException(\n 'cMaxLength',\n SYNC_VALIDATOR_TYPE,\n 'maxLength',\n m,\n ) as CraftFieldError)\n : undefined;\n }),\n attribute: computed<FieldAttributeMeta | undefined>(() => {\n const m = resolveValidatorOption(maxLength);\n return m !== undefined && shouldValidate(when)\n ? { kind: 'native-constraint', target: 'maxLength', value: m }\n : undefined;\n }),\n });\n return withRuntime(validator, {\n name: 'cMaxLength',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cMaxLength', CMaxLengthException>;\n}\n\nfunction createPatternValidator<TValue extends string | null | undefined>({\n when,\n pattern,\n}: {\n when?: ValidatorOption<boolean>;\n pattern: ValidatorOption<RegExp | undefined>;\n}): ValidatorOutput<TValue, 'cPattern', CPatternException> {\n const validator: CraftValidator<TValue> = ({ value }) => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(when)) return undefined;\n const p = resolveValidatorOption(pattern);\n if (p === undefined) return undefined;\n const v = value();\n if (v === null || v === undefined || v === '') return undefined;\n if (typeof v !== 'string') return undefined;\n return p.test(v)\n ? undefined\n : (brandException(\n 'cPattern',\n SYNC_VALIDATOR_TYPE,\n 'pattern',\n p,\n ) as CraftFieldError);\n }),\n });\n return withRuntime(validator, {\n name: 'cPattern',\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<TValue, 'cPattern', CPatternException>;\n}\n\nfunction createCustomSyncValidator<\n TValue,\n Name extends string,\n Exceptions,\n Identifier = unknown,\n>(\n config: CValidateSyncConfig<TValue, Name, Exceptions, Identifier>,\n): ValidatorOutput<TValue, Name, Exceptions, 'sync', Identifier> {\n const { name } = config;\n\n if ('validate' in config) {\n const fn = config.validate;\n const validator: CraftValidator<TValue> = (context) => {\n const inner = fn({\n ...context,\n identifier: context.identifier as Identifier,\n });\n return {\n result: computed<CraftValidatorOutput>(() => {\n const result = inner();\n if (result === undefined) return undefined;\n const normalized = normalizeCraftExceptionOutput(result);\n if (!normalized) return undefined;\n return brandRawException(\n name,\n SYNC_VALIDATOR_TYPE,\n normalized.raw,\n ) as CraftFieldError | CraftFieldError[] | undefined;\n }),\n };\n };\n return withRuntime(validator, {\n name,\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<\n TValue,\n Name,\n Exceptions,\n 'sync',\n Identifier\n >;\n }\n\n const simpleConfig = config;\n const validator: CraftValidator<TValue> = () => ({\n result: computed<CraftValidatorOutput>(() => {\n if (!shouldValidate(simpleConfig.when)) return undefined;\n if (resolveValidatorOption(simpleConfig.validWhen)) return undefined;\n const exception = resolveValidatorOption(simpleConfig.exception);\n const normalized = normalizeCraftExceptionOutput(exception);\n if (!normalized) return undefined;\n return brandRawException(name, SYNC_VALIDATOR_TYPE, normalized.raw) as\n | CraftFieldError\n | CraftFieldError[]\n | undefined;\n }),\n });\n return withRuntime(validator, {\n name,\n type: SYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<\n TValue,\n Name,\n Exceptions,\n 'sync',\n Identifier\n >;\n}\n\nfunction createCustomAsyncValidator<\n TValue,\n TResourceRef extends AnyAsyncCraftResourceRef,\n Name extends string,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n Identifier = unknown,\n>(\n resourceRef: TResourceRef,\n config: CAsyncValidateConfig<\n TValue,\n Name,\n TResourceRef,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n Identifier\n >,\n): ValidatorOutput<\n TValue,\n Name,\n ToAsyncValidatorExceptions<\n AsyncValidatorResourceExceptionUnion<\n AsyncValidatorResourceTarget<TResourceRef>\n >,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions\n >,\n 'async',\n Identifier\n> {\n const { name } = config as { name: Name };\n const cfg = config as unknown as {\n name: Name;\n when?: ValidatorOption<boolean>;\n isValidSuccess?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => boolean;\n exceptionsOnSuccess?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => SuccessExceptions;\n exception?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => ErrorExceptions;\n onException?: (\n context: AsyncValidatorContext<TValue, TResourceRef, Identifier>,\n ) => ExceptionExceptions;\n };\n\n const validator: CraftValidator<TValue> = (context) => {\n const identifier =\n context.identifier as AsyncValidatorResourceIdentifier<TResourceRef>;\n const resourceTarget = computed(() =>\n resolveAsyncValidatorResourceTarget(resourceRef, identifier),\n );\n\n const lastTriggered = signal<\n AsyncValidatorRequest<TResourceRef> | undefined\n >(undefined);\n\n // Trigger the resource when the value changes.\n effect(() => {\n const v = context.value() as AsyncValidatorRequest<TResourceRef>;\n const target = rawReactiveFacade(\n untracked(() => resourceTarget()),\n ) as\n | {\n mutate?: (params: unknown) => void;\n call?: (params: unknown) => void;\n }\n | undefined;\n if (!target) return;\n if (!shouldValidate(cfg.when)) return;\n lastTriggered.set(v);\n if (typeof target.mutate === 'function') {\n target.mutate(v);\n } else if (typeof target.call === 'function') {\n target.call(v);\n }\n });\n\n const buildContext = (\n currentResource: AsyncValidatorResourceTarget<TResourceRef>,\n ): AsyncValidatorContext<TValue, TResourceRef, Identifier> => {\n const exceptions = getResourceExceptionList(currentResource);\n return {\n ...context,\n identifier: identifier as Identifier,\n validateAsyncCraftResource: currentResource,\n omitExceptions: ((codes: readonly string[]) =>\n exceptions.filter(\n (e) => !codes.includes(e._tag as string),\n )) as AsyncValidatorContext<\n TValue,\n TResourceRef,\n Identifier\n >['omitExceptions'],\n };\n };\n\n const result = computed<CraftValidatorOutput>(() => {\n const currentResource = resourceTarget();\n const r = rawReactiveFacade(currentResource) as\n | {\n isLoading: Signal<boolean>;\n status: Signal<string>;\n exceptions?: Signal<{ list: AnyCraftException[] }>;\n hasException?: Signal<boolean>;\n }\n | undefined;\n if (!r) return undefined;\n if (lastTriggered() === undefined) return undefined;\n if (r.isLoading()) return { pending: true };\n\n const status = r.status();\n const asyncCtx = buildContext(\n currentResource as AsyncValidatorResourceTarget<TResourceRef>,\n );\n\n if (hasResourceExceptions(r)) {\n const overridden = normalizeCraftExceptionOutput(\n cfg.onException?.(asyncCtx),\n );\n const fallback = normalizeCraftExceptionOutput(\n getResourceExceptionList(r),\n );\n const final = overridden ?? fallback;\n if (!final) return undefined;\n return brandRawException(name, ASYNC_VALIDATOR_TYPE, final.raw) as\n | CraftFieldError\n | CraftFieldError[];\n }\n\n if (status === 'exception') {\n const errorOutput = normalizeCraftExceptionOutput(\n cfg.exception?.(asyncCtx),\n );\n return errorOutput\n ? (brandRawException(name, ASYNC_VALIDATOR_TYPE, errorOutput.raw) as\n | CraftFieldError\n | CraftFieldError[])\n : undefined;\n }\n\n // Resolved\n const isValid = cfg.isValidSuccess?.(asyncCtx) ?? true;\n const onSuccess = normalizeCraftExceptionOutput(\n cfg.exceptionsOnSuccess?.(asyncCtx),\n );\n if (!isValid || onSuccess) {\n if (onSuccess) {\n return brandRawException(\n name,\n ASYNC_VALIDATOR_TYPE,\n onSuccess.raw,\n ) as CraftFieldError | CraftFieldError[];\n }\n return brandException(\n name,\n ASYNC_VALIDATOR_TYPE,\n 'invalid',\n undefined,\n ) as CraftFieldError;\n }\n return undefined;\n });\n\n return { result };\n };\n\n return withRuntime(validator, {\n name,\n type: ASYNC_VALIDATOR_TYPE,\n kind: 'signal',\n }) as unknown as ValidatorOutput<\n TValue,\n Name,\n ToAsyncValidatorExceptions<\n AsyncValidatorResourceExceptionUnion<\n AsyncValidatorResourceTarget<TResourceRef>\n >,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions\n >,\n 'async',\n Identifier\n >;\n}\n\n// =====================================================================\n// Public API\n// =====================================================================\n\nexport function cRequired<TValue>(\n config?: CRequiredConfig<TValue>,\n): ValidatorOutput<TValue, 'cRequired', CRequiredException> {\n return createRequiredValidator<TValue>(config ?? {});\n}\n\nexport function cEmail<TValue extends string | null | undefined>(\n config?: CEmailConfig<TValue>,\n): ValidatorOutput<TValue, 'cEmail', CEmailException> {\n return createEmailValidator<TValue>(config ?? {});\n}\n\nexport function cMin<TValue extends number | string | null | undefined>(\n config: CMinConfig<TValue>,\n): ValidatorOutput<TValue, 'cMin', CMinException> {\n return createMinValidator<TValue>({\n when: config.when,\n min:\n 'min' in config && config.min !== undefined\n ? config.min\n : (config as { minValue: ValidatorOption<number | undefined> })\n .minValue,\n });\n}\n\nexport function cMax<TValue extends number | string | null | undefined>(\n config: CMaxConfig<TValue>,\n): ValidatorOutput<TValue, 'cMax', CMaxException> {\n return createMaxValidator<TValue>({\n when: config.when,\n max:\n 'max' in config && config.max !== undefined\n ? config.max\n : (config as { maxValue: ValidatorOption<number | undefined> })\n .maxValue,\n });\n}\n\nexport function cMinLength<TValue extends ValueWithLengthOrSize>(\n config: CMinLengthConfig<TValue>,\n): ValidatorOutput<TValue, 'cMinLength', CMinLengthException> {\n return createMinLengthValidator<TValue>(config);\n}\n\nexport function cMaxLength<TValue extends ValueWithLengthOrSize>(\n config: CMaxLengthConfig<TValue>,\n): ValidatorOutput<TValue, 'cMaxLength', CMaxLengthException> {\n return createMaxLengthValidator<TValue>(config);\n}\n\nexport function cPattern<TValue extends string | null | undefined>(\n config: CPatternConfig<TValue>,\n): ValidatorOutput<TValue, 'cPattern', CPatternException> {\n return createPatternValidator<TValue>(config);\n}\n\nexport function cValidate<\n TValue,\n const Name extends string,\n Exceptions,\n Identifier = unknown,\n>(\n config: CValidateSyncConfig<TValue, Name, Exceptions, Identifier>,\n): ValidatorOutput<TValue, Name, Exceptions, 'sync', Identifier> {\n return createCustomSyncValidator(config);\n}\n\nexport const cValidator = cValidate;\n\nexport function cAsyncValidate<\n TValue,\n TResourceRef extends AnyAsyncCraftResourceRef,\n const Name extends string,\n SuccessExceptions = undefined,\n ErrorExceptions = undefined,\n ExceptionExceptions = unknown,\n Identifier = AsyncValidatorResourceIdentifier<TResourceRef>,\n>(\n resourceRef: TResourceRef,\n config: CAsyncValidateConfig<\n TValue,\n Name,\n TResourceRef,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions,\n Identifier\n >,\n): ValidatorOutput<\n TValue,\n Name,\n ToAsyncValidatorExceptions<\n AsyncValidatorResourceExceptionUnion<\n AsyncValidatorResourceTarget<TResourceRef>\n >,\n SuccessExceptions,\n ErrorExceptions,\n ExceptionExceptions\n >,\n 'async',\n Identifier\n> {\n return createCustomAsyncValidator(resourceRef, config);\n}\n\nexport const cAsyncValidator = cAsyncValidate;\n\n// Re-exports for backward compat\nexport type { CraftValidator, CraftValidatorContext, FieldAttributeMeta };\n"]}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { type NamedCraftPrimitiveGen } from './craft-primitive-gen';
|
|
2
|
+
import type { ReadonlySource$ } from './source$';
|
|
3
|
+
type FromEventToSourceInstance<T, Name extends string = string> = ReadonlySource$<T, Name> & {
|
|
4
|
+
dispose: () => void;
|
|
5
|
+
};
|
|
6
|
+
export type FromEventToSource$<T, Name extends string = string> = FromEventToSourceInstance<T, Name> & NamedCraftPrimitiveGen<Name, FromEventToSourceInstance<T, Name>>;
|
|
7
|
+
/**
|
|
8
|
+
* Converts DOM events to a ReadonlySource$ stream with automatic cleanup on component destruction.
|
|
9
|
+
*
|
|
10
|
+
* This function bridges DOM events with craft-ts's source$ reactive system by:
|
|
11
|
+
* - Converting native DOM events to source emissions
|
|
12
|
+
* - Automatically removing event listeners on component destruction
|
|
13
|
+
* - Supporting optional event payload transformation
|
|
14
|
+
* - Providing manual disposal capability
|
|
15
|
+
* - Returning a readonly source with `subscribe` and `value` properties
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* **Automatic Cleanup:**
|
|
19
|
+
* - Event listeners are automatically removed when the injection context is destroyed
|
|
20
|
+
* - Uses Angular's `DestroyRef` for lifecycle management
|
|
21
|
+
* - Manual cleanup available via `dispose()` method
|
|
22
|
+
* - Prevents memory leaks from dangling event listeners
|
|
23
|
+
*
|
|
24
|
+
* **Use Cases:**
|
|
25
|
+
* - **User interactions**: Click, input, scroll, keyboard events
|
|
26
|
+
* - **Window events**: Resize, scroll, focus, online/offline
|
|
27
|
+
* - **Document events**: Visibility changes, custom events
|
|
28
|
+
* - **Media events**: Video/audio play, pause, ended
|
|
29
|
+
* - **Form events**: Submit, change, input
|
|
30
|
+
* - **Custom events**: Application-specific DOM events
|
|
31
|
+
*
|
|
32
|
+
* **Event Transformation:**
|
|
33
|
+
* - Without `computedValue`: Emits the raw event object
|
|
34
|
+
* - With `computedValue`: Transforms event before emission
|
|
35
|
+
* - Useful for extracting specific event properties
|
|
36
|
+
* - Reduces payload size and improves type safety
|
|
37
|
+
*
|
|
38
|
+
* **Integration with Stores:**
|
|
39
|
+
* - Use the readonly source in queries/mutations via `on$()`
|
|
40
|
+
* - Trigger async operations on DOM events
|
|
41
|
+
* - Coordinate multiple components via event sources
|
|
42
|
+
*
|
|
43
|
+
* **Injection Context:**
|
|
44
|
+
* - Must be called within Angular injection context
|
|
45
|
+
* - Typically called in component constructor or class fields
|
|
46
|
+
* - Uses `assertInInjectionContext()` for safety
|
|
47
|
+
*
|
|
48
|
+
* @template T - The type of the event object
|
|
49
|
+
* @template ComputedValue - The type after optional transformation
|
|
50
|
+
*
|
|
51
|
+
* @param target - The DOM element or event target to listen to.
|
|
52
|
+
* Can be any EventTarget (HTMLElement, Window, Document, etc.)
|
|
53
|
+
*
|
|
54
|
+
* @param eventName - The name of the event to listen for.
|
|
55
|
+
* Standard DOM event names: 'click', 'input', 'scroll', etc.
|
|
56
|
+
*
|
|
57
|
+
* @param options - Optional configuration:
|
|
58
|
+
* - `event`: Event listener options (capture, passive, once, etc.)
|
|
59
|
+
* - `computedValue`: Function to transform event before emission
|
|
60
|
+
*
|
|
61
|
+
* @returns A readonly source that emits on DOM events with:
|
|
62
|
+
* - `subscribe()`: Subscribe to event emissions
|
|
63
|
+
* - `value`: Signal containing the last emitted value
|
|
64
|
+
* - `dispose()`: Method to manually remove event listener
|
|
65
|
+
* - Automatic cleanup on component destruction
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* Basic click event source
|
|
69
|
+
* ```ts
|
|
70
|
+
* @Component({
|
|
71
|
+
* selector: 'app-clicker',
|
|
72
|
+
* template: '<button #btn>Click me</button>',
|
|
73
|
+
* })
|
|
74
|
+
* export class ClickerComponent {
|
|
75
|
+
* @ViewChild('btn', { read: ElementRef }) button!: ElementRef<HTMLButtonElement>;
|
|
76
|
+
*
|
|
77
|
+
* click$ = fromEventToSource$<MouseEvent>(
|
|
78
|
+
* this.button.nativeElement,
|
|
79
|
+
* 'click'
|
|
80
|
+
* );
|
|
81
|
+
*
|
|
82
|
+
* counter = craftUse(state(0, ({ update }) => ({
|
|
83
|
+
* increment: on$(this.click$, () => update((v) => v + 1)),
|
|
84
|
+
* })));
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* Window scroll event with transformation
|
|
90
|
+
* ```ts
|
|
91
|
+
* @Component({
|
|
92
|
+
* selector: 'app-infinite-scroll',
|
|
93
|
+
* template: '...',
|
|
94
|
+
* })
|
|
95
|
+
* export class InfiniteScrollComponent {
|
|
96
|
+
* scroll$ = fromEventToSource$(window, 'scroll', {
|
|
97
|
+
* computedValue: () => ({
|
|
98
|
+
* scrollY: window.scrollY,
|
|
99
|
+
* scrollHeight: document.documentElement.scrollHeight,
|
|
100
|
+
* clientHeight: window.innerHeight,
|
|
101
|
+
* }),
|
|
102
|
+
* event: { passive: true },
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* // Access scroll position via signal
|
|
106
|
+
* scrollPosition = this.scroll$.value;
|
|
107
|
+
*
|
|
108
|
+
* // Subscribe to scroll events
|
|
109
|
+
* ngOnInit() {
|
|
110
|
+
* this.scroll$.subscribe((data) => {
|
|
111
|
+
* const nearBottom = data.scrollY + data.clientHeight >= data.scrollHeight - 100;
|
|
112
|
+
* if (nearBottom) {
|
|
113
|
+
* // Load more data
|
|
114
|
+
* }
|
|
115
|
+
* });
|
|
116
|
+
* }
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* Form input event for real-time search
|
|
122
|
+
* ```ts
|
|
123
|
+
* @Component({
|
|
124
|
+
* selector: 'app-search',
|
|
125
|
+
* template: '<input #searchInput type="text" placeholder="Search..." />',
|
|
126
|
+
* })
|
|
127
|
+
* export class SearchComponent {
|
|
128
|
+
* @ViewChild('searchInput', { read: ElementRef }) input!: ElementRef<HTMLInputElement>;
|
|
129
|
+
*
|
|
130
|
+
* input$ = fromEventToSource$(this.input.nativeElement, 'input', {
|
|
131
|
+
* computedValue: (event: Event) => {
|
|
132
|
+
* const target = event.target as HTMLInputElement;
|
|
133
|
+
* return target.value;
|
|
134
|
+
* },
|
|
135
|
+
* });
|
|
136
|
+
*
|
|
137
|
+
* // Current input value as signal
|
|
138
|
+
* searchTerm = this.input$.value;
|
|
139
|
+
*
|
|
140
|
+
* // React to input changes
|
|
141
|
+
* searchResults = craftUse(state([], ({ set }) => ({
|
|
142
|
+
* search: on$(this.input$, async (term) => {
|
|
143
|
+
* if (term.length < 3) {
|
|
144
|
+
* set([]);
|
|
145
|
+
* return;
|
|
146
|
+
* }
|
|
147
|
+
* const results = await fetchResults(term);
|
|
148
|
+
* set(results);
|
|
149
|
+
* }),
|
|
150
|
+
* })));
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* Window resize event
|
|
156
|
+
* ```ts
|
|
157
|
+
* @Component({
|
|
158
|
+
* selector: 'app-responsive',
|
|
159
|
+
* template: '...',
|
|
160
|
+
* })
|
|
161
|
+
* export class ResponsiveComponent {
|
|
162
|
+
* resize$ = fromEventToSource$(window, 'resize', {
|
|
163
|
+
* computedValue: () => ({
|
|
164
|
+
* width: window.innerWidth,
|
|
165
|
+
* height: window.innerHeight,
|
|
166
|
+
* }),
|
|
167
|
+
* });
|
|
168
|
+
*
|
|
169
|
+
* dimensions = this.resize$.value;
|
|
170
|
+
* }
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* Manual disposal for dynamic elements
|
|
175
|
+
* ```ts
|
|
176
|
+
* @Component({
|
|
177
|
+
* selector: 'app-dynamic',
|
|
178
|
+
* template: '...',
|
|
179
|
+
* })
|
|
180
|
+
* export class DynamicComponent {
|
|
181
|
+
* private click$?: FromEventToSource$<MouseEvent>;
|
|
182
|
+
*
|
|
183
|
+
* attachListener(element: HTMLElement) {
|
|
184
|
+
* // Remove previous listener if exists
|
|
185
|
+
* this.click$?.dispose();
|
|
186
|
+
*
|
|
187
|
+
* // Attach to new element
|
|
188
|
+
* this.click$ = fromEventToSource$<MouseEvent>(element, 'click');
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* detachListener() {
|
|
192
|
+
* // Manually remove listener before component destruction
|
|
193
|
+
* this.click$?.dispose();
|
|
194
|
+
* this.click$ = undefined;
|
|
195
|
+
* }
|
|
196
|
+
* }
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @see {@link https://craft-ts.dev/utils/from-event-to-source$ | fromEventToSource$ documentation}
|
|
200
|
+
*/
|
|
201
|
+
export declare function fromEventToSource$<T, Name extends string = string>(target: EventTarget, eventName: Name, options?: {
|
|
202
|
+
event?: boolean | AddEventListenerOptions;
|
|
203
|
+
computedValue?: never;
|
|
204
|
+
}): FromEventToSource$<T, Name>;
|
|
205
|
+
export declare function fromEventToSource$<T, ComputedValue, Name extends string = string>(target: EventTarget, eventName: Name, options?: {
|
|
206
|
+
event?: boolean | AddEventListenerOptions;
|
|
207
|
+
computedValue: (event: T) => ComputedValue;
|
|
208
|
+
}): FromEventToSource$<ComputedValue, Name>;
|
|
209
|
+
export {};
|
|
210
|
+
//# sourceMappingURL=from-event-to-source$.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-event-to-source$.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/from-event-to-source$.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,KAAK,yBAAyB,CAC5B,CAAC,EACD,IAAI,SAAS,MAAM,GAAG,MAAM,IAC1B,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAC5B,CAAC,EACD,IAAI,SAAS,MAAM,GAAG,MAAM,IAC1B,yBAAyB,CAAC,CAAC,EAAE,IAAI,CAAC,GACpC,sBAAsB,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAChE,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACA,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/B,wBAAgB,kBAAkB,CAChC,CAAC,EACD,aAAa,EACb,IAAI,SAAS,MAAM,GAAG,MAAM,EAE5B,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC;CAC5C,GACA,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { assertInInjectionContext, DestroyRef, inject } from './host/craft-compat';
|
|
2
|
+
import { source$ } from './source$';
|
|
3
|
+
import { createNamedPrimitiveGen, } from './craft-primitive-gen';
|
|
4
|
+
export function fromEventToSource$(target, eventName, options) {
|
|
5
|
+
assertInInjectionContext(fromEventToSource$);
|
|
6
|
+
const eventSource$ = source$(eventName);
|
|
7
|
+
const listener = (event) => {
|
|
8
|
+
if (options?.computedValue) {
|
|
9
|
+
const computed = options.computedValue(event);
|
|
10
|
+
eventSource$.emit(computed);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
eventSource$.emit(event);
|
|
14
|
+
};
|
|
15
|
+
target.addEventListener(eventName, listener, options?.event);
|
|
16
|
+
const destroyRef = inject(DestroyRef);
|
|
17
|
+
const dispose = () => {
|
|
18
|
+
target.removeEventListener(eventName, listener, options?.event);
|
|
19
|
+
};
|
|
20
|
+
destroyRef.onDestroy(() => {
|
|
21
|
+
dispose();
|
|
22
|
+
});
|
|
23
|
+
const source = Object.assign(eventSource$.asReadonly(), {
|
|
24
|
+
dispose,
|
|
25
|
+
});
|
|
26
|
+
const generator = createNamedPrimitiveGen(eventName, source);
|
|
27
|
+
return Object.assign(generator, source);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=from-event-to-source$.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-event-to-source$.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/from-event-to-source$.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,uBAAuB,GAExB,MAAM,uBAAuB,CAAC;AAsO/B,MAAM,UAAU,kBAAkB,CAChC,MAAmB,EACnB,SAAiB,EACjB,OAGC;IAED,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;IAE7C,MAAM,YAAY,GAAG,OAAO,CAAU,SAAS,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,CAAC,KAAY,EAAE,EAAE;QAChC,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC9C,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAE7D,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;QACtD,OAAO;KACR,CAAuD,CAAC;IACzD,MAAM,SAAS,GAAG,uBAAuB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAE7D,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAgC,CAAC;AACzE,CAAC","sourcesContent":["import { assertInInjectionContext, DestroyRef, inject } from './host/craft-compat';\nimport { source$ } from './source$';\nimport {\n createNamedPrimitiveGen,\n type NamedCraftPrimitiveGen,\n} from './craft-primitive-gen';\nimport type { ReadonlySource$ } from './source$';\n\ntype FromEventToSourceInstance<\n T,\n Name extends string = string,\n> = ReadonlySource$<T, Name> & {\n dispose: () => void;\n};\n\nexport type FromEventToSource$<\n T,\n Name extends string = string,\n> = FromEventToSourceInstance<T, Name> &\n NamedCraftPrimitiveGen<Name, FromEventToSourceInstance<T, Name>>;\n\n/**\n * Converts DOM events to a ReadonlySource$ stream with automatic cleanup on component destruction.\n *\n * This function bridges DOM events with craft-ts's source$ reactive system by:\n * - Converting native DOM events to source emissions\n * - Automatically removing event listeners on component destruction\n * - Supporting optional event payload transformation\n * - Providing manual disposal capability\n * - Returning a readonly source with `subscribe` and `value` properties\n *\n * @remarks\n * **Automatic Cleanup:**\n * - Event listeners are automatically removed when the injection context is destroyed\n * - Uses Angular's `DestroyRef` for lifecycle management\n * - Manual cleanup available via `dispose()` method\n * - Prevents memory leaks from dangling event listeners\n *\n * **Use Cases:**\n * - **User interactions**: Click, input, scroll, keyboard events\n * - **Window events**: Resize, scroll, focus, online/offline\n * - **Document events**: Visibility changes, custom events\n * - **Media events**: Video/audio play, pause, ended\n * - **Form events**: Submit, change, input\n * - **Custom events**: Application-specific DOM events\n *\n * **Event Transformation:**\n * - Without `computedValue`: Emits the raw event object\n * - With `computedValue`: Transforms event before emission\n * - Useful for extracting specific event properties\n * - Reduces payload size and improves type safety\n *\n * **Integration with Stores:**\n * - Use the readonly source in queries/mutations via `on$()`\n * - Trigger async operations on DOM events\n * - Coordinate multiple components via event sources\n *\n * **Injection Context:**\n * - Must be called within Angular injection context\n * - Typically called in component constructor or class fields\n * - Uses `assertInInjectionContext()` for safety\n *\n * @template T - The type of the event object\n * @template ComputedValue - The type after optional transformation\n *\n * @param target - The DOM element or event target to listen to.\n * Can be any EventTarget (HTMLElement, Window, Document, etc.)\n *\n * @param eventName - The name of the event to listen for.\n * Standard DOM event names: 'click', 'input', 'scroll', etc.\n *\n * @param options - Optional configuration:\n * - `event`: Event listener options (capture, passive, once, etc.)\n * - `computedValue`: Function to transform event before emission\n *\n * @returns A readonly source that emits on DOM events with:\n * - `subscribe()`: Subscribe to event emissions\n * - `value`: Signal containing the last emitted value\n * - `dispose()`: Method to manually remove event listener\n * - Automatic cleanup on component destruction\n *\n * @example\n * Basic click event source\n * ```ts\n * @Component({\n * selector: 'app-clicker',\n * template: '<button #btn>Click me</button>',\n * })\n * export class ClickerComponent {\n * @ViewChild('btn', { read: ElementRef }) button!: ElementRef<HTMLButtonElement>;\n *\n * click$ = fromEventToSource$<MouseEvent>(\n * this.button.nativeElement,\n * 'click'\n * );\n *\n * counter = craftUse(state(0, ({ update }) => ({\n * increment: on$(this.click$, () => update((v) => v + 1)),\n * })));\n * }\n * ```\n *\n * @example\n * Window scroll event with transformation\n * ```ts\n * @Component({\n * selector: 'app-infinite-scroll',\n * template: '...',\n * })\n * export class InfiniteScrollComponent {\n * scroll$ = fromEventToSource$(window, 'scroll', {\n * computedValue: () => ({\n * scrollY: window.scrollY,\n * scrollHeight: document.documentElement.scrollHeight,\n * clientHeight: window.innerHeight,\n * }),\n * event: { passive: true },\n * });\n *\n * // Access scroll position via signal\n * scrollPosition = this.scroll$.value;\n *\n * // Subscribe to scroll events\n * ngOnInit() {\n * this.scroll$.subscribe((data) => {\n * const nearBottom = data.scrollY + data.clientHeight >= data.scrollHeight - 100;\n * if (nearBottom) {\n * // Load more data\n * }\n * });\n * }\n * }\n * ```\n *\n * @example\n * Form input event for real-time search\n * ```ts\n * @Component({\n * selector: 'app-search',\n * template: '<input #searchInput type=\"text\" placeholder=\"Search...\" />',\n * })\n * export class SearchComponent {\n * @ViewChild('searchInput', { read: ElementRef }) input!: ElementRef<HTMLInputElement>;\n *\n * input$ = fromEventToSource$(this.input.nativeElement, 'input', {\n * computedValue: (event: Event) => {\n * const target = event.target as HTMLInputElement;\n * return target.value;\n * },\n * });\n *\n * // Current input value as signal\n * searchTerm = this.input$.value;\n *\n * // React to input changes\n * searchResults = craftUse(state([], ({ set }) => ({\n * search: on$(this.input$, async (term) => {\n * if (term.length < 3) {\n * set([]);\n * return;\n * }\n * const results = await fetchResults(term);\n * set(results);\n * }),\n * })));\n * }\n * ```\n *\n * @example\n * Window resize event\n * ```ts\n * @Component({\n * selector: 'app-responsive',\n * template: '...',\n * })\n * export class ResponsiveComponent {\n * resize$ = fromEventToSource$(window, 'resize', {\n * computedValue: () => ({\n * width: window.innerWidth,\n * height: window.innerHeight,\n * }),\n * });\n *\n * dimensions = this.resize$.value;\n * }\n * ```\n *\n * @example\n * Manual disposal for dynamic elements\n * ```ts\n * @Component({\n * selector: 'app-dynamic',\n * template: '...',\n * })\n * export class DynamicComponent {\n * private click$?: FromEventToSource$<MouseEvent>;\n *\n * attachListener(element: HTMLElement) {\n * // Remove previous listener if exists\n * this.click$?.dispose();\n *\n * // Attach to new element\n * this.click$ = fromEventToSource$<MouseEvent>(element, 'click');\n * }\n *\n * detachListener() {\n * // Manually remove listener before component destruction\n * this.click$?.dispose();\n * this.click$ = undefined;\n * }\n * }\n * ```\n *\n * @see {@link https://craft-ts.dev/utils/from-event-to-source$ | fromEventToSource$ documentation}\n */\nexport function fromEventToSource$<T, Name extends string = string>(\n target: EventTarget,\n eventName: Name,\n options?: {\n event?: boolean | AddEventListenerOptions;\n computedValue?: never;\n },\n): FromEventToSource$<T, Name>;\nexport function fromEventToSource$<\n T,\n ComputedValue,\n Name extends string = string,\n>(\n target: EventTarget,\n eventName: Name,\n options?: {\n event?: boolean | AddEventListenerOptions;\n computedValue: (event: T) => ComputedValue;\n },\n): FromEventToSource$<ComputedValue, Name>;\nexport function fromEventToSource$(\n target: EventTarget,\n eventName: string,\n options?: {\n event?: boolean | AddEventListenerOptions;\n computedValue?: (event: Event) => unknown;\n },\n): FromEventToSource$<unknown> {\n assertInInjectionContext(fromEventToSource$);\n\n const eventSource$ = source$<unknown>(eventName);\n\n const listener = (event: Event) => {\n if (options?.computedValue) {\n const computed = options.computedValue(event);\n eventSource$.emit(computed);\n return;\n }\n eventSource$.emit(event);\n };\n\n target.addEventListener(eventName, listener, options?.event);\n\n const destroyRef = inject(DestroyRef);\n\n const dispose = () => {\n target.removeEventListener(eventName, listener, options?.event);\n };\n\n destroyRef.onDestroy(() => {\n dispose();\n });\n\n const source = Object.assign(eventSource$.asReadonly(), {\n dispose,\n }) as ReadonlySource$<unknown> & { dispose: () => void };\n const generator = createNamedPrimitiveGen(eventName, source);\n\n return Object.assign(generator, source) as FromEventToSource$<unknown>;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CraftServiceApi, type ServiceTrackingMetadata } from './craft-service';
|
|
2
|
+
export type GlobalPersisterHandlerServiceApi = {
|
|
3
|
+
clearAllCache(): void;
|
|
4
|
+
};
|
|
5
|
+
type GlobalPersisterHandlerServiceCraftApi = CraftServiceApi<'GlobalPersisterHandlerService', 'toProvide', {}, GlobalPersisterHandlerServiceApi, ServiceTrackingMetadata<'GlobalPersisterHandlerService', 'toProvide', GlobalPersisterHandlerServiceApi, unknown>>;
|
|
6
|
+
export declare const GlobalPersisterHandlerService: GlobalPersisterHandlerServiceCraftApi['GlobalPersisterHandlerService'];
|
|
7
|
+
export declare const provideGlobalPersisterHandlerService: GlobalPersisterHandlerServiceCraftApi['provideGlobalPersisterHandlerService'];
|
|
8
|
+
export declare const GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA: GlobalPersisterHandlerServiceCraftApi['GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA'];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=global-persister-handler.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-persister-handler.service.d.ts","sourceRoot":"","sources":["../../../../../libs/core/src/lib/global-persister-handler.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,gCAAgC,GAAG;IAC7C,aAAa,IAAI,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,qCAAqC,GAAG,eAAe,CAC1D,+BAA+B,EAC/B,WAAW,EACX,EAAE,EACF,gCAAgC,EAChC,uBAAuB,CACrB,+BAA+B,EAC/B,WAAW,EACX,gCAAgC,EAChC,OAAO,CACR,CACF,CAAC;AA0CF,eAAO,MAAM,6BAA6B,EAAE,qCAAqC,CAAC,+BAA+B,CACpD,CAAC;AAC9D,eAAO,MAAM,oCAAoC,EAAE,qCAAqC,CAAC,sCAAsC,CAC3D,CAAC;AACrE,eAAO,MAAM,0CAA0C,EAAE,qCAAqC,CAAC,4CAA4C,CACjE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { craftService, } from './craft-service';
|
|
2
|
+
import { StoragePersister } from './storage-persister.service';
|
|
3
|
+
/**
|
|
4
|
+
* Yields the global craft service responsible for clearing persisted `@craft-ts`
|
|
5
|
+
* cache entries from the configured storage persister.
|
|
6
|
+
*
|
|
7
|
+
* This helper is provided at the application root and can follow the
|
|
8
|
+
* `StoragePersister` selected by the current injector.
|
|
9
|
+
* It removes every persisted entry from the selected backend, which makes it
|
|
10
|
+
* useful for logout flows, account switches, or any full cache reset.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { GlobalPersisterHandlerService } from '@craft-ts/core';
|
|
15
|
+
*
|
|
16
|
+
* export class AppComponent {
|
|
17
|
+
* // Consume GlobalPersisterHandlerService inside a craft generator.
|
|
18
|
+
*
|
|
19
|
+
* logout() {
|
|
20
|
+
* // Clear all @craft-ts cached data from the configured backend.
|
|
21
|
+
* this.persisterHandler.clearAllCache();
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const globalPersisterHandlerService = craftService({
|
|
27
|
+
name: 'GlobalPersisterHandlerService',
|
|
28
|
+
providedIn: 'toProvide',
|
|
29
|
+
}, function* () {
|
|
30
|
+
const persister = yield* StoragePersister();
|
|
31
|
+
return {
|
|
32
|
+
clearAllCache() {
|
|
33
|
+
persister.clearAllCache();
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
export const GlobalPersisterHandlerService = globalPersisterHandlerService.GlobalPersisterHandlerService;
|
|
38
|
+
export const provideGlobalPersisterHandlerService = globalPersisterHandlerService.provideGlobalPersisterHandlerService;
|
|
39
|
+
export const GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA = globalPersisterHandlerService.GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA;
|
|
40
|
+
//# sourceMappingURL=global-persister-handler.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-persister-handler.service.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/global-persister-handler.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAGb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAmB/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,6BAA6B,GACjC,YAAY,CACV;IACE,IAAI,EAAE,+BAA+B;IACrC,UAAU,EAAE,WAAW;CACxB,EACD,QAAQ,CAAC;IACP,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAE5C,OAAO;QACL,aAAa;YACX,SAAS,CAAC,aAAa,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,MAAM,CAAC,MAAM,6BAA6B,GACxC,6BAA6B,CAAC,6BAA6B,CAAC;AAC9D,MAAM,CAAC,MAAM,oCAAoC,GAC/C,6BAA6B,CAAC,oCAAoC,CAAC;AACrE,MAAM,CAAC,MAAM,0CAA0C,GACrD,6BAA6B,CAAC,0CAA0C,CAAC","sourcesContent":["import {\n craftService,\n type CraftServiceApi,\n type ServiceTrackingMetadata,\n} from './craft-service';\nimport { StoragePersister } from './storage-persister.service';\n\nexport type GlobalPersisterHandlerServiceApi = {\n clearAllCache(): void;\n};\n\ntype GlobalPersisterHandlerServiceCraftApi = CraftServiceApi<\n 'GlobalPersisterHandlerService',\n 'toProvide',\n {},\n GlobalPersisterHandlerServiceApi,\n ServiceTrackingMetadata<\n 'GlobalPersisterHandlerService',\n 'toProvide',\n GlobalPersisterHandlerServiceApi,\n unknown\n >\n>;\n\n/**\n * Yields the global craft service responsible for clearing persisted `@craft-ts`\n * cache entries from the configured storage persister.\n *\n * This helper is provided at the application root and can follow the\n * `StoragePersister` selected by the current injector.\n * It removes every persisted entry from the selected backend, which makes it\n * useful for logout flows, account switches, or any full cache reset.\n *\n * @example\n * ```ts\n * import { GlobalPersisterHandlerService } from '@craft-ts/core';\n *\n * export class AppComponent {\n * // Consume GlobalPersisterHandlerService inside a craft generator.\n *\n * logout() {\n * // Clear all @craft-ts cached data from the configured backend.\n * this.persisterHandler.clearAllCache();\n * }\n * }\n * ```\n */\nconst globalPersisterHandlerService: GlobalPersisterHandlerServiceCraftApi =\n craftService(\n {\n name: 'GlobalPersisterHandlerService',\n providedIn: 'toProvide',\n },\n function* () {\n const persister = yield* StoragePersister();\n\n return {\n clearAllCache(): void {\n persister.clearAllCache();\n },\n };\n },\n );\n\nexport const GlobalPersisterHandlerService: GlobalPersisterHandlerServiceCraftApi['GlobalPersisterHandlerService'] =\n globalPersisterHandlerService.GlobalPersisterHandlerService;\nexport const provideGlobalPersisterHandlerService: GlobalPersisterHandlerServiceCraftApi['provideGlobalPersisterHandlerService'] =\n globalPersisterHandlerService.provideGlobalPersisterHandlerService;\nexport const GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA: GlobalPersisterHandlerServiceCraftApi['GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA'] =\n globalPersisterHandlerService.GLOBAL_PERSISTER_HANDLER_SERVICE_META_DATA;\n"]}
|