@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,535 @@
|
|
|
1
|
+
import { DestroyRef, Injector, inject, isSignal, runInInjectionContext, untracked, } from './host/craft-compat';
|
|
2
|
+
import { takeUntilDestroyed } from './host/craft-compat';
|
|
3
|
+
import { ɵcreateHostTaggedInjector } from './craft-service';
|
|
4
|
+
import { source$ } from './source$';
|
|
5
|
+
import { capitalize, isSource } from './util/util';
|
|
6
|
+
import { INSERTION_SNAPSHOT_REGISTRY, snapshotSelectProxy, } from './take-app-snapshot';
|
|
7
|
+
import { isGenerator, runCraftGenerator } from './craft-generator-runtime';
|
|
8
|
+
import { injectFnWrapper } from './fn-wrapper';
|
|
9
|
+
import { ɵprovidePrimitiveMethodRuntimeContext } from './primitive-method-runtime-context';
|
|
10
|
+
import { createYieldableInsertionMethod, isNonYieldableInsertionMethod, markNonYieldableInsertionMethod, yieldableInvocation, } from './yieldable';
|
|
11
|
+
import { createYieldableReactiveValue, isYieldableReactiveValue, rawReactiveValue, } from './reactive-read';
|
|
12
|
+
import { craftLinkedSignal } from './host/craft-linked-signal';
|
|
13
|
+
function readInsertionState(state) {
|
|
14
|
+
return isYieldableReactiveValue(state) ? rawReactiveValue(state)() : state();
|
|
15
|
+
}
|
|
16
|
+
function isSource$(value) {
|
|
17
|
+
return (typeof value === 'object' &&
|
|
18
|
+
value !== null &&
|
|
19
|
+
'emit' in value &&
|
|
20
|
+
typeof value.emit === 'function' &&
|
|
21
|
+
'subscribe' in value &&
|
|
22
|
+
typeof value.subscribe === 'function');
|
|
23
|
+
}
|
|
24
|
+
function isFlatCrossLayerEvent(value) {
|
|
25
|
+
return (typeof value === 'object' &&
|
|
26
|
+
value !== null &&
|
|
27
|
+
'payload' in value &&
|
|
28
|
+
'path' in value &&
|
|
29
|
+
'leaf' in value &&
|
|
30
|
+
Array.isArray(value.path) &&
|
|
31
|
+
typeof value.leaf === 'object' &&
|
|
32
|
+
value.leaf !== null &&
|
|
33
|
+
'item' in value.leaf &&
|
|
34
|
+
'index' in value.leaf);
|
|
35
|
+
}
|
|
36
|
+
const INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE = 'insertSelect generators can only yield craftService dependencies or exposed dependency helpers.';
|
|
37
|
+
const INSERT_SELECT_APP_START_ERROR_MESSAGE = 'insertSelect generators do not support onAppStart(...).';
|
|
38
|
+
function createInsertSelectItemRuntime(entityName,
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
...itemInsertions) {
|
|
41
|
+
return (
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
context) => {
|
|
44
|
+
const { state, update, insertions: previousInsertions, __primitiveKind: primitiveKind = 'state', } = context;
|
|
45
|
+
const insertionSnapshotRegistry = inject(INSERTION_SNAPSHOT_REGISTRY, {
|
|
46
|
+
optional: true,
|
|
47
|
+
});
|
|
48
|
+
const injector = ɵcreateHostTaggedInjector(inject(Injector), `selectEntity:${entityName}`, [{ provide: INSERTION_SNAPSHOT_REGISTRY, useValue: null }]);
|
|
49
|
+
const selectItemMethodName = `select${capitalize(entityName)}`;
|
|
50
|
+
const selectedStateById = new Map();
|
|
51
|
+
const inheritedInsertions = previousInsertions ?? {};
|
|
52
|
+
const select = (id) => {
|
|
53
|
+
const currentState = readInsertionState(state);
|
|
54
|
+
if (!Array.isArray(currentState)) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
return currentState[id];
|
|
58
|
+
};
|
|
59
|
+
const selectItem = (id) => {
|
|
60
|
+
const cached = selectedStateById.get(id);
|
|
61
|
+
if (cached) {
|
|
62
|
+
return cached;
|
|
63
|
+
}
|
|
64
|
+
const selectedStateValue = select(id);
|
|
65
|
+
if (selectedStateValue === undefined) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const selectedStateSignal = craftLinkedSignal({
|
|
69
|
+
source: () => select(id),
|
|
70
|
+
computation: (selected) => selected,
|
|
71
|
+
injector,
|
|
72
|
+
});
|
|
73
|
+
const itemInjector = ɵcreateHostTaggedInjector(injector, `selectItem:${id}`);
|
|
74
|
+
const { rawInsertionsOutput, exposedInsertionsOutput } = itemInsertions.reduce((acc, insertion) => {
|
|
75
|
+
const wrappedInsertion = runInInjectionContext(itemInjector, () => injectFnWrapper()(insertion));
|
|
76
|
+
const insertionContext = {
|
|
77
|
+
state: createYieldableReactiveValue(selectedStateSignal, 'state', { primitive: 'insertSelect', path: `${name}.state` }),
|
|
78
|
+
__primitiveKind: primitiveKind,
|
|
79
|
+
set: (newState) => yieldableInvocation((() => {
|
|
80
|
+
update((currentState) => {
|
|
81
|
+
if (!Array.isArray(currentState)) {
|
|
82
|
+
return currentState;
|
|
83
|
+
}
|
|
84
|
+
if (id < 0 ||
|
|
85
|
+
id >= currentState.length ||
|
|
86
|
+
!Number.isInteger(id)) {
|
|
87
|
+
return currentState;
|
|
88
|
+
}
|
|
89
|
+
const nextState = [...currentState];
|
|
90
|
+
nextState[id] = newState;
|
|
91
|
+
return nextState;
|
|
92
|
+
});
|
|
93
|
+
return newState;
|
|
94
|
+
})()),
|
|
95
|
+
update: (updateFn) => yieldableInvocation((() => {
|
|
96
|
+
const currentSelectedState = select(id);
|
|
97
|
+
if (currentSelectedState === undefined) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const nextState = updateFn(currentSelectedState);
|
|
101
|
+
update((currentState) => {
|
|
102
|
+
if (!Array.isArray(currentState)) {
|
|
103
|
+
return currentState;
|
|
104
|
+
}
|
|
105
|
+
if (id < 0 ||
|
|
106
|
+
id >= currentState.length ||
|
|
107
|
+
!Number.isInteger(id)) {
|
|
108
|
+
return currentState;
|
|
109
|
+
}
|
|
110
|
+
const nextRootState = [...currentState];
|
|
111
|
+
nextRootState[id] = nextState;
|
|
112
|
+
return nextRootState;
|
|
113
|
+
});
|
|
114
|
+
return nextState;
|
|
115
|
+
})()),
|
|
116
|
+
patch: (patchFn) => yieldableInvocation((() => {
|
|
117
|
+
const currentSelectedState = select(id);
|
|
118
|
+
if (currentSelectedState === undefined) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
const nextState = {
|
|
122
|
+
...currentSelectedState,
|
|
123
|
+
...patchFn(currentSelectedState),
|
|
124
|
+
};
|
|
125
|
+
update((currentState) => {
|
|
126
|
+
if (!Array.isArray(currentState)) {
|
|
127
|
+
return currentState;
|
|
128
|
+
}
|
|
129
|
+
if (id < 0 ||
|
|
130
|
+
id >= currentState.length ||
|
|
131
|
+
!Number.isInteger(id)) {
|
|
132
|
+
return currentState;
|
|
133
|
+
}
|
|
134
|
+
const nextRootState = [...currentState];
|
|
135
|
+
nextRootState[id] = nextState;
|
|
136
|
+
return nextRootState;
|
|
137
|
+
});
|
|
138
|
+
return nextState;
|
|
139
|
+
})()),
|
|
140
|
+
insertions: Object.entries(acc.rawInsertionsOutput).reduce((previous, [key, value]) => {
|
|
141
|
+
if (isSource$(value))
|
|
142
|
+
previous[key] = value;
|
|
143
|
+
return previous;
|
|
144
|
+
}, {
|
|
145
|
+
...inheritedInsertions,
|
|
146
|
+
...acc.exposedInsertionsOutput,
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
const insertionCallResult = wrappedInsertion(insertionContext);
|
|
150
|
+
const nextRawInsertions = (isGenerator(insertionCallResult)
|
|
151
|
+
? runInInjectionContext(itemInjector, () => runCraftGenerator({
|
|
152
|
+
iterator: insertionCallResult,
|
|
153
|
+
injector: itemInjector,
|
|
154
|
+
hostScope: 'function',
|
|
155
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
156
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
157
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
158
|
+
}).value)
|
|
159
|
+
: insertionCallResult);
|
|
160
|
+
const nextExposedInsertions = Object.entries(nextRawInsertions).reduce((exposedAcc, [key, value]) => {
|
|
161
|
+
if (isSource(value)) {
|
|
162
|
+
return exposedAcc;
|
|
163
|
+
}
|
|
164
|
+
if (isSource$(value)) {
|
|
165
|
+
const localSource = value;
|
|
166
|
+
const sourceInjector = ɵcreateHostTaggedInjector(itemInjector, `source:${key}`);
|
|
167
|
+
const wrappedEmit = runInInjectionContext(sourceInjector, () => injectFnWrapper()((payload) => localSource.emit(payload)));
|
|
168
|
+
exposedAcc[key] = createYieldableInsertionMethod((payload) => wrappedEmit(payload), {
|
|
169
|
+
injector: sourceInjector,
|
|
170
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
171
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
172
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
173
|
+
});
|
|
174
|
+
return exposedAcc;
|
|
175
|
+
}
|
|
176
|
+
if (typeof value === 'function' &&
|
|
177
|
+
!isSignal(value) &&
|
|
178
|
+
!isYieldableReactiveValue(value) &&
|
|
179
|
+
!isNonYieldableInsertionMethod(value)) {
|
|
180
|
+
const methodInjector = ɵcreateHostTaggedInjector(itemInjector, `method:${key}`, [
|
|
181
|
+
ɵprovidePrimitiveMethodRuntimeContext(primitiveKind, { ...insertionContext, state: selectedStateSignal }, value),
|
|
182
|
+
]);
|
|
183
|
+
const wrappedFn = runInInjectionContext(methodInjector, () => injectFnWrapper()(value));
|
|
184
|
+
exposedAcc[key] = createYieldableInsertionMethod(wrappedFn, {
|
|
185
|
+
injector: methodInjector,
|
|
186
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
187
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
188
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
exposedAcc[key] = value;
|
|
193
|
+
}
|
|
194
|
+
return exposedAcc;
|
|
195
|
+
}, {});
|
|
196
|
+
return {
|
|
197
|
+
rawInsertionsOutput: {
|
|
198
|
+
...acc.rawInsertionsOutput,
|
|
199
|
+
...nextRawInsertions,
|
|
200
|
+
},
|
|
201
|
+
exposedInsertionsOutput: {
|
|
202
|
+
...acc.exposedInsertionsOutput,
|
|
203
|
+
...nextExposedInsertions,
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}, {
|
|
207
|
+
rawInsertionsOutput: {},
|
|
208
|
+
exposedInsertionsOutput: {},
|
|
209
|
+
});
|
|
210
|
+
const stateProxy = new Proxy(exposedInsertionsOutput, {
|
|
211
|
+
get(target, property, receiver) {
|
|
212
|
+
if (Reflect.has(target, property)) {
|
|
213
|
+
return Reflect.get(target, property, receiver);
|
|
214
|
+
}
|
|
215
|
+
// Read through the per-item signal, NOT `select(id)`.
|
|
216
|
+
//
|
|
217
|
+
// `select(id)` reads the whole array and then indexes it, so a
|
|
218
|
+
// template binding that reached a field this way subscribed to the
|
|
219
|
+
// ENTIRE collection: any write to any item re-ran every binding. A
|
|
220
|
+
// 16x16 grid spent ~400ms of a single paint re-evaluating all 256
|
|
221
|
+
// cells — and re-evaluated them again on changes that touched no
|
|
222
|
+
// cell at all.
|
|
223
|
+
//
|
|
224
|
+
// `selectedStateSignal` recomputes off the same array but keeps its
|
|
225
|
+
// previous value when this item is untouched, so it only notifies
|
|
226
|
+
// the readers of the item that actually changed.
|
|
227
|
+
const stateValue = selectedStateSignal();
|
|
228
|
+
if (!stateValue || typeof stateValue !== 'object') {
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
return Reflect.get(stateValue, property);
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
selectedStateById.set(id, stateProxy);
|
|
235
|
+
return stateProxy;
|
|
236
|
+
};
|
|
237
|
+
const items = () => {
|
|
238
|
+
const currentState = readInsertionState(state);
|
|
239
|
+
if (!Array.isArray(currentState)) {
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
return currentState.reduce((acc, _unused, index) => {
|
|
243
|
+
const selectedItem = selectItem(index);
|
|
244
|
+
if (selectedItem !== undefined) {
|
|
245
|
+
acc.push(selectedItem);
|
|
246
|
+
}
|
|
247
|
+
return acc;
|
|
248
|
+
}, []);
|
|
249
|
+
};
|
|
250
|
+
const currentState = readInsertionState(state);
|
|
251
|
+
if (Array.isArray(currentState) && currentState.length > 0) {
|
|
252
|
+
selectItem(0);
|
|
253
|
+
}
|
|
254
|
+
if (insertionSnapshotRegistry) {
|
|
255
|
+
const destroyRef = inject(DestroyRef);
|
|
256
|
+
insertionSnapshotRegistry.trigger$
|
|
257
|
+
.pipe(takeUntilDestroyed(destroyRef))
|
|
258
|
+
.subscribe(() => {
|
|
259
|
+
const rawState = readInsertionState(state);
|
|
260
|
+
if (!Array.isArray(rawState))
|
|
261
|
+
return;
|
|
262
|
+
const snapshot = rawState.map((rawItem, i) => {
|
|
263
|
+
const proxy = selectItem(i);
|
|
264
|
+
return snapshotSelectProxy(proxy, rawItem);
|
|
265
|
+
});
|
|
266
|
+
insertionSnapshotRegistry.allInsertionSnapshot$.next({
|
|
267
|
+
key: selectItemMethodName,
|
|
268
|
+
value: snapshot,
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
[selectItemMethodName]: markNonYieldableInsertionMethod(selectItem),
|
|
274
|
+
items: markNonYieldableInsertionMethod(items),
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function createInsertSelectPropertyRuntime(propertyKey,
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
280
|
+
...propertyInsertions) {
|
|
281
|
+
return (
|
|
282
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
283
|
+
context) => {
|
|
284
|
+
const { state, update, insertions: previousInsertions, __primitiveKind: primitiveKind = 'state', } = context;
|
|
285
|
+
const insertionSnapshotRegistry = inject(INSERTION_SNAPSHOT_REGISTRY, {
|
|
286
|
+
optional: true,
|
|
287
|
+
});
|
|
288
|
+
const injector = ɵcreateHostTaggedInjector(inject(Injector), `selectProperty:${propertyKey}`, [{ provide: INSERTION_SNAPSHOT_REGISTRY, useValue: null }]);
|
|
289
|
+
let selectedPropertyProxy;
|
|
290
|
+
const crossLayerSourcesByKey = new Map();
|
|
291
|
+
const selectPropertyMethodName = `select${capitalize(propertyKey)}`;
|
|
292
|
+
const inheritedInsertions = previousInsertions ?? {};
|
|
293
|
+
const getOrCreateCrossLayerSource = (key) => {
|
|
294
|
+
const sourceValue = crossLayerSourcesByKey.get(key);
|
|
295
|
+
if (sourceValue) {
|
|
296
|
+
return sourceValue;
|
|
297
|
+
}
|
|
298
|
+
const newSource = source$(key);
|
|
299
|
+
crossLayerSourcesByKey.set(key, newSource);
|
|
300
|
+
return newSource;
|
|
301
|
+
};
|
|
302
|
+
const selectProperty = () => {
|
|
303
|
+
const currentState = readInsertionState(state);
|
|
304
|
+
if (!currentState || typeof currentState !== 'object') {
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
return currentState[propertyKey];
|
|
308
|
+
};
|
|
309
|
+
const setProperty = (newProperty) => {
|
|
310
|
+
update((currentState) => {
|
|
311
|
+
if (!currentState || typeof currentState !== 'object') {
|
|
312
|
+
return currentState;
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
...currentState,
|
|
316
|
+
[propertyKey]: newProperty,
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
return newProperty;
|
|
320
|
+
};
|
|
321
|
+
const updateProperty = (updateFn) => {
|
|
322
|
+
const nextProperty = updateFn(selectProperty());
|
|
323
|
+
setProperty(nextProperty);
|
|
324
|
+
return nextProperty;
|
|
325
|
+
};
|
|
326
|
+
const selectPropertyItem = () => {
|
|
327
|
+
if (selectedPropertyProxy) {
|
|
328
|
+
return selectedPropertyProxy;
|
|
329
|
+
}
|
|
330
|
+
const selectedPropertySignal = craftLinkedSignal({
|
|
331
|
+
source: selectProperty,
|
|
332
|
+
computation: (selected) => selected,
|
|
333
|
+
injector,
|
|
334
|
+
});
|
|
335
|
+
const { rawInsertionsOutput, exposedInsertionsOutput } = propertyInsertions.reduce((acc, insertion) => {
|
|
336
|
+
const wrappedInsertion = runInInjectionContext(injector, () => injectFnWrapper()(insertion));
|
|
337
|
+
const insertionContext = {
|
|
338
|
+
state: createYieldableReactiveValue(selectedPropertySignal, 'state', { primitive: 'insertSelect', path: `${name}.state` }),
|
|
339
|
+
__primitiveKind: primitiveKind,
|
|
340
|
+
set: (newState) => {
|
|
341
|
+
setProperty(newState);
|
|
342
|
+
return yieldableInvocation(newState);
|
|
343
|
+
},
|
|
344
|
+
update: (updateFn) => {
|
|
345
|
+
return yieldableInvocation(updateProperty(updateFn));
|
|
346
|
+
},
|
|
347
|
+
patch: (patchFn) => {
|
|
348
|
+
return yieldableInvocation(updateProperty((current) => ({
|
|
349
|
+
...current,
|
|
350
|
+
...patchFn(current),
|
|
351
|
+
})));
|
|
352
|
+
},
|
|
353
|
+
insertions: Object.entries(acc.rawInsertionsOutput).reduce((previous, [key, value]) => {
|
|
354
|
+
if (isSource$(value))
|
|
355
|
+
previous[key] = value;
|
|
356
|
+
return previous;
|
|
357
|
+
}, {
|
|
358
|
+
...inheritedInsertions,
|
|
359
|
+
...acc.exposedInsertionsOutput,
|
|
360
|
+
}),
|
|
361
|
+
};
|
|
362
|
+
const insertionCallResult = wrappedInsertion(insertionContext);
|
|
363
|
+
const nextRawInsertions = (isGenerator(insertionCallResult)
|
|
364
|
+
? runInInjectionContext(injector, () => runCraftGenerator({
|
|
365
|
+
iterator: insertionCallResult,
|
|
366
|
+
injector,
|
|
367
|
+
hostScope: 'function',
|
|
368
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
369
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
370
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
371
|
+
}).value)
|
|
372
|
+
: insertionCallResult);
|
|
373
|
+
const nextExposedInsertions = Object.entries(nextRawInsertions).reduce((exposedAcc, [key, value]) => {
|
|
374
|
+
if (isSource(value)) {
|
|
375
|
+
return exposedAcc;
|
|
376
|
+
}
|
|
377
|
+
if (isSource$(value)) {
|
|
378
|
+
const localSource = value;
|
|
379
|
+
const crossLayerSource = getOrCreateCrossLayerSource(key);
|
|
380
|
+
localSource.subscribe((payload) => {
|
|
381
|
+
const propertyAtEmit = selectProperty();
|
|
382
|
+
if (isFlatCrossLayerEvent(payload)) {
|
|
383
|
+
crossLayerSource.emit({
|
|
384
|
+
payload: payload.payload,
|
|
385
|
+
path: [propertyKey, ...payload.path],
|
|
386
|
+
leaf: payload.leaf,
|
|
387
|
+
});
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
crossLayerSource.emit({
|
|
391
|
+
payload,
|
|
392
|
+
path: [propertyKey],
|
|
393
|
+
leaf: {
|
|
394
|
+
item: propertyAtEmit,
|
|
395
|
+
index: propertyKey,
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
const sourceInjector = ɵcreateHostTaggedInjector(injector, `source:${key}`);
|
|
400
|
+
const wrappedEmit = runInInjectionContext(sourceInjector, () => injectFnWrapper()((payload) => localSource.emit(payload)));
|
|
401
|
+
exposedAcc[key] = createYieldableInsertionMethod((payload) => wrappedEmit(payload), {
|
|
402
|
+
injector: sourceInjector,
|
|
403
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
404
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
405
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
406
|
+
});
|
|
407
|
+
return exposedAcc;
|
|
408
|
+
}
|
|
409
|
+
if (typeof value === 'function' &&
|
|
410
|
+
!isSignal(value) &&
|
|
411
|
+
!isYieldableReactiveValue(value) &&
|
|
412
|
+
!isNonYieldableInsertionMethod(value)) {
|
|
413
|
+
const methodInjector = ɵcreateHostTaggedInjector(injector, `method:${key}`, [
|
|
414
|
+
ɵprovidePrimitiveMethodRuntimeContext(primitiveKind, { ...insertionContext, state: selectedPropertySignal }, value),
|
|
415
|
+
]);
|
|
416
|
+
const wrappedFn = runInInjectionContext(methodInjector, () => injectFnWrapper()(value));
|
|
417
|
+
exposedAcc[key] = createYieldableInsertionMethod(wrappedFn, {
|
|
418
|
+
injector: methodInjector,
|
|
419
|
+
invalidYieldErrorMessage: INSERT_SELECT_INVALID_YIELD_ERROR_MESSAGE,
|
|
420
|
+
multipleAppStartErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
421
|
+
onAppStartNotSupportedErrorMessage: INSERT_SELECT_APP_START_ERROR_MESSAGE,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
exposedAcc[key] = value;
|
|
426
|
+
}
|
|
427
|
+
return exposedAcc;
|
|
428
|
+
}, {});
|
|
429
|
+
return {
|
|
430
|
+
rawInsertionsOutput: {
|
|
431
|
+
...acc.rawInsertionsOutput,
|
|
432
|
+
...nextRawInsertions,
|
|
433
|
+
},
|
|
434
|
+
exposedInsertionsOutput: {
|
|
435
|
+
...acc.exposedInsertionsOutput,
|
|
436
|
+
...nextExposedInsertions,
|
|
437
|
+
},
|
|
438
|
+
};
|
|
439
|
+
}, {
|
|
440
|
+
rawInsertionsOutput: {},
|
|
441
|
+
exposedInsertionsOutput: {},
|
|
442
|
+
});
|
|
443
|
+
selectedPropertyProxy = new Proxy(exposedInsertionsOutput, {
|
|
444
|
+
get(target, property, receiver) {
|
|
445
|
+
if (Reflect.has(target, property)) {
|
|
446
|
+
return Reflect.get(target, property, receiver);
|
|
447
|
+
}
|
|
448
|
+
const currentProperty = selectProperty();
|
|
449
|
+
if (!currentProperty || typeof currentProperty !== 'object') {
|
|
450
|
+
return undefined;
|
|
451
|
+
}
|
|
452
|
+
return Reflect.get(currentProperty, property);
|
|
453
|
+
},
|
|
454
|
+
});
|
|
455
|
+
return selectedPropertyProxy;
|
|
456
|
+
};
|
|
457
|
+
// Ensure cross-layer sources are available for subsequent state insertions.
|
|
458
|
+
selectPropertyItem();
|
|
459
|
+
if (insertionSnapshotRegistry) {
|
|
460
|
+
const destroyRef = inject(DestroyRef);
|
|
461
|
+
insertionSnapshotRegistry.trigger$
|
|
462
|
+
.pipe(takeUntilDestroyed(destroyRef))
|
|
463
|
+
.subscribe(() => {
|
|
464
|
+
const proxy = selectPropertyItem();
|
|
465
|
+
const rawPropertyValue = readInsertionState(state);
|
|
466
|
+
const rawPropValue = rawPropertyValue &&
|
|
467
|
+
typeof rawPropertyValue === 'object' &&
|
|
468
|
+
propertyKey in rawPropertyValue
|
|
469
|
+
? rawPropertyValue[propertyKey]
|
|
470
|
+
: undefined;
|
|
471
|
+
insertionSnapshotRegistry.allInsertionSnapshot$.next({
|
|
472
|
+
key: selectPropertyMethodName,
|
|
473
|
+
value: snapshotSelectProxy(proxy, rawPropValue),
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
[selectPropertyMethodName]: markNonYieldableInsertionMethod(selectPropertyItem),
|
|
479
|
+
...Object.fromEntries(crossLayerSourcesByKey.entries()),
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
function createDeferredInsertSelectRuntime(entityName,
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
485
|
+
...insertions) {
|
|
486
|
+
return (
|
|
487
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
488
|
+
context) => {
|
|
489
|
+
const selectMethodName = `select${capitalize(entityName)}`;
|
|
490
|
+
const runtimeInjector = inject(Injector);
|
|
491
|
+
let activeIsArray;
|
|
492
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
493
|
+
let activeRuntime;
|
|
494
|
+
const getActiveRuntime = () => {
|
|
495
|
+
// Untracked on purpose. Whether the state is an array picks which runtime
|
|
496
|
+
// to build — a structural question, not a value this selector depends on.
|
|
497
|
+
// Reading it tracked subscribed EVERY caller to the whole collection, so
|
|
498
|
+
// a template binding that selected one item re-ran whenever any item
|
|
499
|
+
// changed, and even when something unrelated did.
|
|
500
|
+
const isArray = Array.isArray(untracked(() => readInsertionState(context.state)));
|
|
501
|
+
if (activeRuntime && activeIsArray === isArray) {
|
|
502
|
+
return activeRuntime;
|
|
503
|
+
}
|
|
504
|
+
activeIsArray = isArray;
|
|
505
|
+
activeRuntime = runInInjectionContext(runtimeInjector, () => isArray
|
|
506
|
+
? createInsertSelectItemRuntime(entityName, ...insertions)(context)
|
|
507
|
+
: createInsertSelectPropertyRuntime(entityName, ...insertions)(context));
|
|
508
|
+
return activeRuntime;
|
|
509
|
+
};
|
|
510
|
+
const select = (...args) => getActiveRuntime()[selectMethodName](...args);
|
|
511
|
+
return {
|
|
512
|
+
[selectMethodName]: markNonYieldableInsertionMethod(select),
|
|
513
|
+
items: markNonYieldableInsertionMethod(() => getActiveRuntime().items?.() ?? []),
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
export function insertSelect(name,
|
|
518
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
519
|
+
...insertions) {
|
|
520
|
+
return (
|
|
521
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
522
|
+
context) => {
|
|
523
|
+
const currentState = readInsertionState(context.state);
|
|
524
|
+
if (currentState === undefined &&
|
|
525
|
+
context.__primitiveKind &&
|
|
526
|
+
context.__primitiveKind !== 'state') {
|
|
527
|
+
return createDeferredInsertSelectRuntime(name, ...insertions)(context);
|
|
528
|
+
}
|
|
529
|
+
if (Array.isArray(currentState)) {
|
|
530
|
+
return createInsertSelectItemRuntime(name, ...insertions)(context);
|
|
531
|
+
}
|
|
532
|
+
return createInsertSelectPropertyRuntime(name, ...insertions)(context);
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
//# sourceMappingURL=insert-select.js.map
|