@gyral/core 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +129 -0
- package/NOTICE +19 -0
- package/README.md +35 -8
- package/dist/call.d.ts +32 -0
- package/dist/call.js +63 -0
- package/dist/call.js.map +1 -0
- package/dist/children.d.ts +30 -5
- package/dist/children.js +26 -4
- package/dist/children.js.map +1 -1
- package/dist/cli/gyral-types.d.ts +2 -0
- package/dist/cli/gyral-types.js +23 -0
- package/dist/cli/gyral-types.js.map +1 -0
- package/dist/command.d.ts +54 -12
- package/dist/command.js +31 -11
- package/dist/command.js.map +1 -1
- package/dist/compiler/ast.d.ts +23 -0
- package/dist/compiler/ast.js +149 -0
- package/dist/compiler/ast.js.map +1 -0
- package/dist/compiler/compile.d.ts +41 -0
- package/dist/compiler/compile.js +148 -0
- package/dist/compiler/compile.js.map +1 -0
- package/dist/compiler/component-entries.d.ts +7 -0
- package/dist/compiler/component-entries.js +42 -0
- package/dist/compiler/component-entries.js.map +1 -0
- package/dist/compiler/components.d.ts +4 -0
- package/dist/compiler/components.js +182 -0
- package/dist/compiler/components.js.map +1 -0
- package/dist/compiler/facts.d.ts +31 -0
- package/dist/compiler/facts.js +285 -0
- package/dist/compiler/facts.js.map +1 -0
- package/dist/compiler/features.d.ts +34 -0
- package/dist/compiler/features.js +158 -0
- package/dist/compiler/features.js.map +1 -0
- package/dist/compiler/hooks.d.ts +22 -0
- package/dist/compiler/hooks.js +241 -0
- package/dist/compiler/hooks.js.map +1 -0
- package/dist/compiler/loader-source.d.ts +14 -0
- package/dist/compiler/loader-source.js +86 -0
- package/dist/compiler/loader-source.js.map +1 -0
- package/dist/compiler/locate.d.ts +14 -0
- package/dist/compiler/locate.js +78 -0
- package/dist/compiler/locate.js.map +1 -0
- package/dist/compiler/parse5-check.d.ts +21 -0
- package/dist/compiler/parse5-check.js +60 -0
- package/dist/compiler/parse5-check.js.map +1 -0
- package/dist/compiler/prop-schemas.d.ts +4 -0
- package/dist/compiler/prop-schemas.js +108 -0
- package/dist/compiler/prop-schemas.js.map +1 -0
- package/dist/compiler/scan.d.ts +41 -0
- package/dist/compiler/scan.js +160 -0
- package/dist/compiler/scan.js.map +1 -0
- package/dist/compiler/scope.d.ts +8 -0
- package/dist/compiler/scope.js +116 -0
- package/dist/compiler/scope.js.map +1 -0
- package/dist/compiler/source.d.ts +34 -0
- package/dist/compiler/source.js +114 -0
- package/dist/compiler/source.js.map +1 -0
- package/dist/compiler/tag-map.d.ts +41 -0
- package/dist/compiler/tag-map.js +126 -0
- package/dist/compiler/tag-map.js.map +1 -0
- package/dist/components-ready.d.ts +7 -0
- package/dist/components-ready.js +19 -0
- package/dist/components-ready.js.map +1 -0
- package/dist/define.d.ts +13 -4
- package/dist/define.js +35 -331
- package/dist/define.js.map +1 -1
- package/dist/devtools-events.d.ts +13 -0
- package/dist/devtools-events.js.map +1 -1
- package/dist/devtools-off.d.ts +2 -0
- package/dist/devtools-off.js +2 -0
- package/dist/devtools-off.js.map +1 -1
- package/dist/devtools.d.ts +4 -0
- package/dist/devtools.js +17 -2
- package/dist/devtools.js.map +1 -1
- package/dist/drivers-scope.d.ts +1 -1
- package/dist/drivers-scope.js +1 -8
- package/dist/drivers-scope.js.map +1 -1
- package/dist/element-internals.d.ts +1 -0
- package/dist/element-internals.js +11 -0
- package/dist/element-internals.js.map +1 -0
- package/dist/element-types.d.ts +11 -5
- package/dist/element-types.js.map +1 -1
- package/dist/element.d.ts +3 -0
- package/dist/element.js +322 -0
- package/dist/element.js.map +1 -0
- package/dist/error-view.d.ts +10 -0
- package/dist/error-view.js +30 -0
- package/dist/error-view.js.map +1 -0
- package/dist/errors.d.ts +21 -0
- package/dist/errors.js +47 -0
- package/dist/errors.js.map +1 -0
- package/dist/errors.json +289 -0
- package/dist/eslint/imports.d.ts +26 -0
- package/dist/eslint/imports.js +78 -0
- package/dist/eslint/imports.js.map +1 -0
- package/dist/eslint/index.d.ts +16 -0
- package/dist/eslint/index.js +23 -0
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/locate.d.ts +33 -0
- package/dist/eslint/locate.js +132 -0
- package/dist/eslint/locate.js.map +1 -0
- package/dist/eslint/row-purity-rule.d.ts +2 -0
- package/dist/eslint/row-purity-rule.js +103 -0
- package/dist/eslint/row-purity-rule.js.map +1 -0
- package/dist/eslint/template-rule.d.ts +6 -0
- package/dist/eslint/template-rule.js +76 -0
- package/dist/eslint/template-rule.js.map +1 -0
- package/dist/eslint/unused-intent-rule.d.ts +2 -0
- package/dist/eslint/unused-intent-rule.js +186 -0
- package/dist/eslint/unused-intent-rule.js.map +1 -0
- package/dist/features.d.ts +39 -0
- package/dist/features.js +2 -0
- package/dist/features.js.map +1 -0
- package/dist/focus.d.ts +13 -12
- package/dist/focus.js +44 -11
- package/dist/focus.js.map +1 -1
- package/dist/form-associated.d.ts +46 -0
- package/dist/form-associated.js +77 -0
- package/dist/form-associated.js.map +1 -0
- package/dist/forms.d.ts +42 -30
- package/dist/forms.js +85 -41
- package/dist/forms.js.map +1 -1
- package/dist/frame-lane.d.ts +11 -0
- package/dist/frame-lane.js +28 -0
- package/dist/frame-lane.js.map +1 -0
- package/dist/head.d.ts +61 -0
- package/dist/head.js +85 -0
- package/dist/head.js.map +1 -0
- package/dist/hooks/invalid.d.ts +14 -0
- package/dist/hooks/invalid.js +72 -0
- package/dist/hooks/invalid.js.map +1 -0
- package/dist/host-model.d.ts +77 -0
- package/dist/host-model.js +278 -0
- package/dist/host-model.js.map +1 -0
- package/dist/hydration-client.d.ts +9 -0
- package/dist/hydration-client.js +35 -0
- package/dist/hydration-client.js.map +1 -0
- package/dist/hydration-loader.d.ts +13 -0
- package/dist/hydration-loader.js +58 -0
- package/dist/hydration-loader.js.map +1 -0
- package/dist/hydration-off.d.ts +8 -0
- package/dist/hydration-off.js +25 -0
- package/dist/hydration-off.js.map +1 -0
- package/dist/hydration.d.ts +3 -21
- package/dist/hydration.js +14 -63
- package/dist/hydration.js.map +1 -1
- package/dist/index.d.ts +24 -36
- package/dist/index.js +14 -32
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-types.d.ts +97 -0
- package/dist/indexeddb-types.js +2 -0
- package/dist/indexeddb-types.js.map +1 -0
- package/dist/indexeddb.d.ts +5 -0
- package/dist/indexeddb.js +118 -0
- package/dist/indexeddb.js.map +1 -0
- package/dist/intent.d.ts +62 -17
- package/dist/intent.js +193 -100
- package/dist/intent.js.map +1 -1
- package/dist/internal/indexeddb-open.d.ts +8 -0
- package/dist/internal/indexeddb-open.js +96 -0
- package/dist/internal/indexeddb-open.js.map +1 -0
- package/dist/internal/indexeddb-transaction.d.ts +4 -0
- package/dist/internal/indexeddb-transaction.js +134 -0
- package/dist/internal/indexeddb-transaction.js.map +1 -0
- package/dist/internal/interpreter.d.ts +15 -1
- package/dist/internal/interpreter.js +42 -47
- package/dist/internal/interpreter.js.map +1 -1
- package/dist/internal/token.d.ts +1 -0
- package/dist/internal/token.js +7 -0
- package/dist/internal/token.js.map +1 -0
- package/dist/internal.d.ts +20 -0
- package/dist/internal.js +22 -0
- package/dist/internal.js.map +1 -0
- package/dist/invoker-fallback-used.d.ts +4 -0
- package/dist/invoker-fallback-used.js +10 -0
- package/dist/invoker-fallback-used.js.map +1 -0
- package/dist/invoker-fallback.d.ts +4 -0
- package/dist/invoker-fallback.js +15 -0
- package/dist/invoker-fallback.js.map +1 -0
- package/dist/invokers-shim.d.ts +6 -0
- package/dist/invokers-shim.js +32 -0
- package/dist/invokers-shim.js.map +1 -0
- package/dist/invokers.d.ts +3 -5
- package/dist/invokers.js +11 -51
- package/dist/invokers.js.map +1 -1
- package/dist/islands.d.ts +0 -2
- package/dist/islands.js +4 -11
- package/dist/islands.js.map +1 -1
- package/dist/light-dom.d.ts +4 -53
- package/dist/light-dom.js +5 -100
- package/dist/light-dom.js.map +1 -1
- package/dist/prop.d.ts +89 -0
- package/dist/prop.js +41 -0
- package/dist/prop.js.map +1 -0
- package/dist/props.d.ts +57 -21
- package/dist/props.js +157 -34
- package/dist/props.js.map +1 -1
- package/dist/retry.d.ts +15 -0
- package/dist/retry.js +48 -0
- package/dist/retry.js.map +1 -0
- package/dist/scheduler.d.ts +43 -0
- package/dist/scheduler.js +212 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/script-json.d.ts +2 -0
- package/dist/script-json.js +13 -0
- package/dist/script-json.js.map +1 -0
- package/dist/server-component.d.ts +10 -0
- package/dist/server-component.js +133 -0
- package/dist/server-component.js.map +1 -0
- package/dist/server-specs.d.ts +6 -0
- package/dist/server-specs.js +13 -0
- package/dist/server-specs.js.map +1 -0
- package/dist/server.d.ts +34 -0
- package/dist/server.js +59 -0
- package/dist/server.js.map +1 -0
- package/dist/settled.d.ts +11 -0
- package/dist/settled.js +62 -0
- package/dist/settled.js.map +1 -0
- package/dist/spec-features-used.d.ts +21 -0
- package/dist/spec-features-used.js +50 -0
- package/dist/spec-features-used.js.map +1 -0
- package/dist/spec-features.d.ts +28 -0
- package/dist/spec-features.js +42 -0
- package/dist/spec-features.js.map +1 -0
- package/dist/states.d.ts +3 -5
- package/dist/states.js +22 -11
- package/dist/states.js.map +1 -1
- package/dist/storage.d.ts +69 -0
- package/dist/storage.js +158 -0
- package/dist/storage.js.map +1 -0
- package/dist/store-binding.d.ts +6 -3
- package/dist/store-binding.js +7 -8
- package/dist/store-binding.js.map +1 -1
- package/dist/store-scope.d.ts +8 -11
- package/dist/store-scope.js +15 -40
- package/dist/store-scope.js.map +1 -1
- package/dist/store.d.ts +3 -0
- package/dist/store.js +45 -10
- package/dist/store.js.map +1 -1
- package/dist/stores-provider.d.ts +2 -6
- package/dist/stores-provider.js +21 -55
- package/dist/stores-provider.js.map +1 -1
- package/dist/subscription.d.ts +35 -0
- package/dist/subscription.js +74 -0
- package/dist/subscription.js.map +1 -0
- package/dist/subscriptions.d.ts +26 -0
- package/dist/subscriptions.js +98 -0
- package/dist/subscriptions.js.map +1 -0
- package/dist/transitions.d.ts +5 -7
- package/dist/transitions.js +17 -20
- package/dist/transitions.js.map +1 -1
- package/dist/types.d.ts +142 -49
- package/dist/types.js.map +1 -1
- package/dist/use-dialogs.d.ts +2 -0
- package/dist/use-dialogs.js +9 -0
- package/dist/use-dialogs.js.map +1 -0
- package/dist/use-disposal.d.ts +2 -0
- package/dist/use-disposal.js +9 -0
- package/dist/use-disposal.js.map +1 -0
- package/dist/use-error-view.d.ts +2 -0
- package/dist/use-error-view.js +9 -0
- package/dist/use-error-view.js.map +1 -0
- package/dist/use-errored.d.ts +2 -0
- package/dist/use-errored.js +9 -0
- package/dist/use-errored.js.map +1 -0
- package/dist/use-form-associated.d.ts +2 -0
- package/dist/use-form-associated.js +7 -0
- package/dist/use-form-associated.js.map +1 -0
- package/dist/use-frame-lane.d.ts +2 -0
- package/dist/use-frame-lane.js +10 -0
- package/dist/use-frame-lane.js.map +1 -0
- package/dist/use-invokers.d.ts +2 -0
- package/dist/use-invokers.js +10 -0
- package/dist/use-invokers.js.map +1 -0
- package/dist/use-states.d.ts +2 -0
- package/dist/use-states.js +10 -0
- package/dist/use-states.js.map +1 -0
- package/dist/use-subscriptions.d.ts +2 -0
- package/dist/use-subscriptions.js +10 -0
- package/dist/use-subscriptions.js.map +1 -0
- package/dist/use-transitions.d.ts +2 -0
- package/dist/use-transitions.js +10 -0
- package/dist/use-transitions.js.map +1 -0
- package/dist/view/attributes.d.ts +11 -0
- package/dist/view/attributes.js +15 -0
- package/dist/view/attributes.js.map +1 -0
- package/dist/view/compiled.d.ts +1 -0
- package/dist/view/compiled.js +6 -0
- package/dist/view/compiled.js.map +1 -0
- package/dist/view/dev-off.d.ts +1 -0
- package/dist/view/dev-off.js +4 -0
- package/dist/view/dev-off.js.map +1 -0
- package/dist/view/dev.d.ts +1 -0
- package/dist/view/dev.js +5 -0
- package/dist/view/dev.js.map +1 -0
- package/dist/view/flags.d.ts +1 -0
- package/dist/view/flags.js +4 -0
- package/dist/view/flags.js.map +1 -0
- package/dist/view/index.d.ts +26 -0
- package/dist/view/index.js +27 -0
- package/dist/view/index.js.map +1 -0
- package/dist/view/loc.d.ts +9 -0
- package/dist/view/loc.js +50 -0
- package/dist/view/loc.js.map +1 -0
- package/dist/view/message.d.ts +17 -0
- package/dist/view/message.js +40 -0
- package/dist/view/message.js.map +1 -0
- package/dist/view/messages.d.ts +43 -0
- package/dist/view/messages.js +84 -0
- package/dist/view/messages.js.map +1 -0
- package/dist/view/normalize/check.d.ts +23 -0
- package/dist/view/normalize/check.js +81 -0
- package/dist/view/normalize/check.js.map +1 -0
- package/dist/view/normalize/emit.d.ts +15 -0
- package/dist/view/normalize/emit.js +165 -0
- package/dist/view/normalize/emit.js.map +1 -0
- package/dist/view/normalize/entities.d.ts +4 -0
- package/dist/view/normalize/entities.js +38 -0
- package/dist/view/normalize/entities.js.map +1 -0
- package/dist/view/normalize/errors.d.ts +9 -0
- package/dist/view/normalize/errors.js +19 -0
- package/dist/view/normalize/errors.js.map +1 -0
- package/dist/view/normalize/id.d.ts +10 -0
- package/dist/view/normalize/id.js +55 -0
- package/dist/view/normalize/id.js.map +1 -0
- package/dist/view/normalize/normalize.d.ts +18 -0
- package/dist/view/normalize/normalize.js +42 -0
- package/dist/view/normalize/normalize.js.map +1 -0
- package/dist/view/normalize/repairs.d.ts +24 -0
- package/dist/view/normalize/repairs.js +166 -0
- package/dist/view/normalize/repairs.js.map +1 -0
- package/dist/view/normalize/rules.d.ts +39 -0
- package/dist/view/normalize/rules.js +120 -0
- package/dist/view/normalize/rules.js.map +1 -0
- package/dist/view/normalize/shape.d.ts +5 -0
- package/dist/view/normalize/shape.js +38 -0
- package/dist/view/normalize/shape.js.map +1 -0
- package/dist/view/normalize/source.d.ts +13 -0
- package/dist/view/normalize/source.js +34 -0
- package/dist/view/normalize/source.js.map +1 -0
- package/dist/view/normalize/svg.d.ts +14 -0
- package/dist/view/normalize/svg.js +40 -0
- package/dist/view/normalize/svg.js.map +1 -0
- package/dist/view/normalize/tag-states.d.ts +23 -0
- package/dist/view/normalize/tag-states.js +192 -0
- package/dist/view/normalize/tag-states.js.map +1 -0
- package/dist/view/normalize/tokenizer.d.ts +5 -0
- package/dist/view/normalize/tokenizer.js +233 -0
- package/dist/view/normalize/tokenizer.js.map +1 -0
- package/dist/view/normalize/tokens.d.ts +55 -0
- package/dist/view/normalize/tokens.js +24 -0
- package/dist/view/normalize/tokens.js.map +1 -0
- package/dist/view/normalize/tree.d.ts +65 -0
- package/dist/view/normalize/tree.js +235 -0
- package/dist/view/normalize/tree.js.map +1 -0
- package/dist/view/normalize/types.d.ts +146 -0
- package/dist/view/normalize/types.js +29 -0
- package/dist/view/normalize/types.js.map +1 -0
- package/dist/view/normalize/whitespace.d.ts +2 -0
- package/dist/{template-whitespace.js → view/normalize/whitespace.js} +27 -36
- package/dist/view/normalize/whitespace.js.map +1 -0
- package/dist/view/prepare-stub.d.ts +3 -0
- package/dist/view/prepare-stub.js +7 -0
- package/dist/view/prepare-stub.js.map +1 -0
- package/dist/view/prepare.d.ts +11 -0
- package/dist/view/prepare.js +63 -0
- package/dist/view/prepare.js.map +1 -0
- package/dist/view/registry.d.ts +78 -0
- package/dist/view/registry.js +27 -0
- package/dist/view/registry.js.map +1 -0
- package/dist/view/render/adopt-attr.d.ts +14 -0
- package/dist/view/render/adopt-attr.js +83 -0
- package/dist/view/render/adopt-attr.js.map +1 -0
- package/dist/view/render/adopt-plan.d.ts +10 -0
- package/dist/view/render/adopt-plan.js +26 -0
- package/dist/view/render/adopt-plan.js.map +1 -0
- package/dist/view/render/adopt.d.ts +3 -0
- package/dist/view/render/adopt.js +286 -0
- package/dist/view/render/adopt.js.map +1 -0
- package/dist/view/render/attr-parts.d.ts +72 -0
- package/dist/view/render/attr-parts.js +262 -0
- package/dist/view/render/attr-parts.js.map +1 -0
- package/dist/view/render/child-part.d.ts +51 -0
- package/dist/view/render/child-part.js +173 -0
- package/dist/view/render/child-part.js.map +1 -0
- package/dist/view/render/dev-check.d.ts +12 -0
- package/dist/view/render/dev-check.js +122 -0
- package/dist/view/render/dev-check.js.map +1 -0
- package/dist/view/render/dispose.d.ts +3 -0
- package/dist/view/render/dispose.js +76 -0
- package/dist/view/render/dispose.js.map +1 -0
- package/dist/view/render/hook-part.d.ts +5 -0
- package/dist/view/render/hook-part.js +36 -0
- package/dist/view/render/hook-part.js.map +1 -0
- package/dist/view/render/hook-run.d.ts +2 -0
- package/dist/view/render/hook-run.js +72 -0
- package/dist/view/render/hook-run.js.map +1 -0
- package/dist/view/render/hooks.d.ts +108 -0
- package/dist/view/render/hooks.js +108 -0
- package/dist/view/render/hooks.js.map +1 -0
- package/dist/view/render/hydrate.d.ts +10 -0
- package/dist/view/render/hydrate.js +33 -0
- package/dist/view/render/hydrate.js.map +1 -0
- package/dist/view/render/instance.d.ts +33 -0
- package/dist/view/render/instance.js +107 -0
- package/dist/view/render/instance.js.map +1 -0
- package/dist/view/render/keyed.d.ts +6 -0
- package/dist/view/render/keyed.js +15 -0
- package/dist/view/render/keyed.js.map +1 -0
- package/dist/view/render/list.d.ts +20 -0
- package/dist/view/render/list.js +156 -0
- package/dist/view/render/list.js.map +1 -0
- package/dist/view/render/mismatch.d.ts +10 -0
- package/dist/view/render/mismatch.js +55 -0
- package/dist/view/render/mismatch.js.map +1 -0
- package/dist/view/render/modal.d.ts +3 -0
- package/dist/view/render/modal.js +39 -0
- package/dist/view/render/modal.js.map +1 -0
- package/dist/view/render/nodes.d.ts +10 -0
- package/dist/view/render/nodes.js +37 -0
- package/dist/view/render/nodes.js.map +1 -0
- package/dist/view/render/place.d.ts +18 -0
- package/dist/view/render/place.js +69 -0
- package/dist/view/render/place.js.map +1 -0
- package/dist/view/render/plan.d.ts +26 -0
- package/dist/view/render/plan.js +124 -0
- package/dist/view/render/plan.js.map +1 -0
- package/dist/view/render/raw.d.ts +21 -0
- package/dist/view/render/raw.js +72 -0
- package/dist/view/render/raw.js.map +1 -0
- package/dist/view/render/render.d.ts +15 -0
- package/dist/view/render/render.js +65 -0
- package/dist/view/render/render.js.map +1 -0
- package/dist/view/render/reorder.d.ts +4 -0
- package/dist/view/render/reorder.js +101 -0
- package/dist/view/render/reorder.js.map +1 -0
- package/dist/view/render/rows.d.ts +23 -0
- package/dist/view/render/rows.js +95 -0
- package/dist/view/render/rows.js.map +1 -0
- package/dist/view/render/seen.d.ts +11 -0
- package/dist/view/render/seen.js +17 -0
- package/dist/view/render/seen.js.map +1 -0
- package/dist/view/render/toggles.d.ts +6 -0
- package/dist/view/render/toggles.js +6 -0
- package/dist/view/render/toggles.js.map +1 -0
- package/dist/view/render/values.d.ts +29 -0
- package/dist/view/render/values.js +13 -0
- package/dist/view/render/values.js.map +1 -0
- package/dist/view/render/warn.d.ts +28 -0
- package/dist/view/render/warn.js +114 -0
- package/dist/view/render/warn.js.map +1 -0
- package/dist/view/server/component.d.ts +12 -0
- package/dist/view/server/component.js +64 -0
- package/dist/view/server/component.js.map +1 -0
- package/dist/view/server/escape.d.ts +10 -0
- package/dist/view/server/escape.js +34 -0
- package/dist/view/server/escape.js.map +1 -0
- package/dist/view/server/index.d.ts +48 -0
- package/dist/view/server/index.js +80 -0
- package/dist/view/server/index.js.map +1 -0
- package/dist/view/server/sha256.d.ts +2 -0
- package/dist/view/server/sha256.js +75 -0
- package/dist/view/server/sha256.js.map +1 -0
- package/dist/view/server/tags.d.ts +68 -0
- package/dist/view/server/tags.js +132 -0
- package/dist/view/server/tags.js.map +1 -0
- package/dist/view/server/values.d.ts +18 -0
- package/dist/view/server/values.js +94 -0
- package/dist/view/server/values.js.map +1 -0
- package/dist/view/server/writer.d.ts +21 -0
- package/dist/view/server/writer.js +170 -0
- package/dist/view/server/writer.js.map +1 -0
- package/dist/view/styles.d.ts +25 -0
- package/dist/view/styles.js +58 -0
- package/dist/view/styles.js.map +1 -0
- package/dist/view/template-element.d.ts +10 -0
- package/dist/view/template-element.js +45 -0
- package/dist/view/template-element.js.map +1 -0
- package/dist/view/template.d.ts +29 -0
- package/dist/view/template.js +84 -0
- package/dist/view/template.js.map +1 -0
- package/dist/view/trusted-html.d.ts +6 -0
- package/dist/view/trusted-html.js +34 -0
- package/dist/view/trusted-html.js.map +1 -0
- package/dist/vite.d.ts +57 -11
- package/dist/vite.js +319 -27
- package/dist/vite.js.map +1 -1
- package/package.json +70 -4
- package/dist/accessible-name.d.ts +0 -19
- package/dist/accessible-name.js +0 -56
- package/dist/accessible-name.js.map +0 -1
- package/dist/element-directive.d.ts +0 -20
- package/dist/element-directive.js +0 -31
- package/dist/element-directive.js.map +0 -1
- package/dist/invalid.d.ts +0 -21
- package/dist/invalid.js +0 -70
- package/dist/invalid.js.map +0 -1
- package/dist/lit-html-check.d.ts +0 -6
- package/dist/lit-html-check.js +0 -48
- package/dist/lit-html-check.js.map +0 -1
- package/dist/live-boolean.d.ts +0 -22
- package/dist/live-boolean.js +0 -34
- package/dist/live-boolean.js.map +0 -1
- package/dist/random.d.ts +0 -13
- package/dist/random.js +0 -19
- package/dist/random.js.map +0 -1
- package/dist/styles.d.ts +0 -12
- package/dist/styles.js +0 -11
- package/dist/styles.js.map +0 -1
- package/dist/template-whitespace.d.ts +0 -7
- package/dist/template-whitespace.js.map +0 -1
- package/dist/templates.d.ts +0 -5
- package/dist/templates.js +0 -15
- package/dist/templates.js.map +0 -1
- package/dist/textarea.d.ts +0 -26
- package/dist/textarea.js +0 -85
- package/dist/textarea.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** A frame-lane flush that no animation frame has run by then runs from a timer (hidden pages). */
|
|
2
|
+
const FRAME_FALLBACK_MS = 100;
|
|
3
|
+
/** Hosts marked only in the frame lane: they join the scheduler's dirty set when the frame comes. */
|
|
4
|
+
const framed = new Set();
|
|
5
|
+
let frameRaf = 0;
|
|
6
|
+
/** Set while a frame-lane flush is requested. */
|
|
7
|
+
let frameTimer;
|
|
8
|
+
export const frameLane = {
|
|
9
|
+
add(task, mark) {
|
|
10
|
+
framed.add(task);
|
|
11
|
+
if (frameTimer !== undefined)
|
|
12
|
+
return;
|
|
13
|
+
const run = () => {
|
|
14
|
+
cancelAnimationFrame(frameRaf);
|
|
15
|
+
clearTimeout(frameTimer);
|
|
16
|
+
frameTimer = undefined;
|
|
17
|
+
for (const host of framed)
|
|
18
|
+
mark(host);
|
|
19
|
+
};
|
|
20
|
+
frameRaf = requestAnimationFrame(run);
|
|
21
|
+
frameTimer = setTimeout(run, FRAME_FALLBACK_MS);
|
|
22
|
+
},
|
|
23
|
+
drop(task) {
|
|
24
|
+
framed.delete(task);
|
|
25
|
+
},
|
|
26
|
+
pending: () => framed.size > 0,
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=frame-lane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-lane.js","sourceRoot":"","sources":["../src/frame-lane.ts"],"names":[],"mappings":"AAQA,mGAAmG;AACnG,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,qGAAqG;AACrG,MAAM,MAAM,GAAG,IAAI,GAAG,EAAY,CAAC;AACnC,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,iDAAiD;AACjD,IAAI,UAAqD,CAAC;AAY1D,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,GAAG,CAAC,IAAI,EAAE,IAAI;QACZ,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO;QACrC,MAAM,GAAG,GAAG,GAAS,EAAE;YACrB,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAC/B,YAAY,CAAC,UAAU,CAAC,CAAC;YACzB,UAAU,GAAG,SAAS,CAAC;YACvB,KAAK,MAAM,IAAI,IAAI,MAAM;gBAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC;QACF,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;QACtC,UAAU,GAAG,UAAU,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,IAAI;QACP,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;CAC/B,CAAC","sourcesContent":["// The scheduler's frame lane (view/04-scheduler.md \"Frame lane\"): hosts marked by a message\n// their spec lists in `renderOnFrame` wait for the next animation frame, then join a microtask\n// flush, so many such messages in one frame cost one render. `requestAnimationFrame` doesn't\n// run in hidden pages, so a timer runs the frame's flush if no frame came first. Reached\n// through core's `#spec-features` (spec-features.ts): compiled builds bundle it only when a\n// module names `renderOnFrame` (compiler/features.ts, gyral-c5d.12).\nimport type { HostTask } from './scheduler.js';\n\n/** A frame-lane flush that no animation frame has run by then runs from a timer (hidden pages). */\nconst FRAME_FALLBACK_MS = 100;\n\n/** Hosts marked only in the frame lane: they join the scheduler's dirty set when the frame comes. */\nconst framed = new Set<HostTask>();\nlet frameRaf = 0;\n/** Set while a frame-lane flush is requested. */\nlet frameTimer: ReturnType<typeof setTimeout> | undefined;\n\n/** The frame lane as the scheduler uses it. */\nexport interface FrameLane {\n /** Marks `task` for the next frame; then `mark` moves each waiting host to a microtask flush. */\n add(task: HostTask, mark: (task: HostTask) => void): void;\n /** A microtask mark took `task` out of the frame lane. */\n drop(task: HostTask): void;\n /** Hosts are waiting for a frame (settled() waits for them). */\n pending(): boolean;\n}\n\nexport const frameLane: FrameLane = {\n add(task, mark) {\n framed.add(task);\n if (frameTimer !== undefined) return;\n const run = (): void => {\n cancelAnimationFrame(frameRaf);\n clearTimeout(frameTimer);\n frameTimer = undefined;\n for (const host of framed) mark(host);\n };\n frameRaf = requestAnimationFrame(run);\n frameTimer = setTimeout(run, FRAME_FALLBACK_MS);\n },\n drop(task) {\n framed.delete(task);\n },\n pending: () => framed.size > 0,\n};\n"]}
|
package/dist/head.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** A JSON value: what a JSON-LD block holds. */
|
|
2
|
+
export type JsonValue = string | number | boolean | null | readonly JsonValue[] | {
|
|
3
|
+
readonly [key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* `<meta name content>`, or `<meta property content>` (Open Graph uses `property`). `media`
|
|
7
|
+
* makes one entry per media query (`theme-color` for light and dark).
|
|
8
|
+
*/
|
|
9
|
+
export type HeadMeta = {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly content: string;
|
|
12
|
+
readonly media?: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly property: string;
|
|
15
|
+
readonly content: string;
|
|
16
|
+
readonly media?: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A metadata `<link>`: `alternate` (with `hreflang`), `icon` (with `sizes`, `type`), `manifest`
|
|
20
|
+
* (with `crossorigin`), `prev`/`next`, … Any other attribute is written as given.
|
|
21
|
+
*/
|
|
22
|
+
export interface HeadLink {
|
|
23
|
+
readonly rel: string;
|
|
24
|
+
readonly href: string;
|
|
25
|
+
readonly [attribute: string]: string;
|
|
26
|
+
}
|
|
27
|
+
/** A page's head: what `renderPage()` writes on the server and `setHead()` applies on the client. */
|
|
28
|
+
export interface Head {
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly description?: string;
|
|
31
|
+
/** Absolute URL, usually `new URL(match.path, origin).href` (ADR 0009 "Canonical paths"). */
|
|
32
|
+
readonly canonical?: string;
|
|
33
|
+
/** `<meta name="robots">`, e.g. `'noindex, follow'`. */
|
|
34
|
+
readonly robots?: string;
|
|
35
|
+
/** Later entries win over earlier ones with the same name or property. */
|
|
36
|
+
readonly meta?: readonly HeadMeta[];
|
|
37
|
+
/** Later entries win over earlier ones with the same attributes other than `href`. */
|
|
38
|
+
readonly links?: readonly HeadLink[];
|
|
39
|
+
/** Structured data, each written as one `<script type="application/ld+json">`. */
|
|
40
|
+
readonly jsonLd?: readonly JsonValue[];
|
|
41
|
+
/** `<html lang>`. */
|
|
42
|
+
readonly lang?: string;
|
|
43
|
+
/** `<html dir>`. */
|
|
44
|
+
readonly dir?: 'ltr' | 'rtl' | 'auto';
|
|
45
|
+
}
|
|
46
|
+
/** The attribute that marks an element the head model manages; its value is the entry's key. */
|
|
47
|
+
export declare const HEAD_ATTRIBUTE = "data-gyral-head";
|
|
48
|
+
/** One managed element: its key, tag, attributes (in order) and, for JSON-LD, its text. */
|
|
49
|
+
export interface HeadEntry {
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly tag: 'meta' | 'link' | 'script';
|
|
52
|
+
readonly attributes: readonly (readonly [name: string, value: string])[];
|
|
53
|
+
readonly text?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A head's managed elements, in document order and without duplicates: description, robots,
|
|
57
|
+
* canonical, `meta`, `links`, then JSON-LD. Later `meta`/`links` entries with the same key win
|
|
58
|
+
* (at the later position); the typed description and robots win over `meta` entries. The
|
|
59
|
+
* title, `lang` and `dir` are not elements here.
|
|
60
|
+
*/
|
|
61
|
+
export declare function headEntries(head: Head): readonly HeadEntry[];
|
package/dist/head.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// The head model (ADR 0019): one description of a page's managed <head> elements, shared by the
|
|
2
|
+
// server's page shell (@gyral/ssr `renderPage()`) and the router's `setHead()`. Types and a pure
|
|
3
|
+
// normalizer only, no DOM, so both halves agree on keys, order and duplicates.
|
|
4
|
+
import { DEV } from '#view-dev';
|
|
5
|
+
import { scriptSafeJson } from './script-json.js';
|
|
6
|
+
/** The attribute that marks an element the head model manages; its value is the entry's key. */
|
|
7
|
+
export const HEAD_ATTRIBUTE = 'data-gyral-head';
|
|
8
|
+
// Belong to renderPage() itself: changing them per navigation would unstyle the page, refetch
|
|
9
|
+
// modules, or apply policy too late. Checked in development only.
|
|
10
|
+
const REFUSED_REL = /(^|\s)(stylesheet|preload|modulepreload|canonical)(\s|$)/i;
|
|
11
|
+
function check(head) {
|
|
12
|
+
const refuse = (what) => {
|
|
13
|
+
throw new Error(`gyral head: ${what} is not a managed head entry (ADR 0019 "Keys, dedupe and order"). ` +
|
|
14
|
+
'Write it with renderPage() options or extraHead.');
|
|
15
|
+
};
|
|
16
|
+
for (const m of head.meta ?? []) {
|
|
17
|
+
if ('http-equiv' in m || 'charset' in m)
|
|
18
|
+
refuse('<meta http-equiv> or <meta charset>');
|
|
19
|
+
if ('name' in m && /^viewport$/i.test(m.name))
|
|
20
|
+
refuse('<meta name="viewport">');
|
|
21
|
+
}
|
|
22
|
+
for (const link of head.links ?? []) {
|
|
23
|
+
if (REFUSED_REL.test(link.rel))
|
|
24
|
+
refuse(`<link rel="${link.rel}">`);
|
|
25
|
+
}
|
|
26
|
+
if (head.canonical !== undefined && !/^[a-z][a-z\d+.-]*:/i.test(head.canonical)) {
|
|
27
|
+
console.warn(`gyral head: canonical "${head.canonical}" is not an absolute URL. Build it from a ` +
|
|
28
|
+
'configured origin: new URL(match.path, origin).href (ADR 0019).');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A head's managed elements, in document order and without duplicates: description, robots,
|
|
33
|
+
* canonical, `meta`, `links`, then JSON-LD. Later `meta`/`links` entries with the same key win
|
|
34
|
+
* (at the later position); the typed description and robots win over `meta` entries. The
|
|
35
|
+
* title, `lang` and `dir` are not elements here.
|
|
36
|
+
*/
|
|
37
|
+
export function headEntries(head) {
|
|
38
|
+
if (DEV)
|
|
39
|
+
check(head);
|
|
40
|
+
const out = new Map();
|
|
41
|
+
const add = (key, tag, attributes, text) => {
|
|
42
|
+
out.delete(key);
|
|
43
|
+
out.set(key, text === undefined ? { key, tag, attributes } : { key, tag, attributes, text });
|
|
44
|
+
};
|
|
45
|
+
const meta = (attr, name, content, media) => {
|
|
46
|
+
add(media === undefined ? `${attr}:${name}` : `${attr}:${name}|${media}`, 'meta', [
|
|
47
|
+
[attr, name],
|
|
48
|
+
['content', content],
|
|
49
|
+
...(media === undefined ? [] : [['media', media]]),
|
|
50
|
+
]);
|
|
51
|
+
};
|
|
52
|
+
if (head.description !== undefined)
|
|
53
|
+
meta('name', 'description', head.description);
|
|
54
|
+
if (head.robots !== undefined)
|
|
55
|
+
meta('name', 'robots', head.robots);
|
|
56
|
+
if (head.canonical !== undefined) {
|
|
57
|
+
add('canonical', 'link', [
|
|
58
|
+
['rel', 'canonical'],
|
|
59
|
+
['href', head.canonical],
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
const typed = new Set(out.keys());
|
|
63
|
+
for (const m of head.meta ?? []) {
|
|
64
|
+
const [attr, name] = 'name' in m ? ['name', m.name] : ['property', m.property];
|
|
65
|
+
if (!typed.has(`${attr}:${name}`))
|
|
66
|
+
meta(attr, name, m.content, m.media);
|
|
67
|
+
}
|
|
68
|
+
for (const link of head.links ?? []) {
|
|
69
|
+
const attributes = Object.entries(link);
|
|
70
|
+
const key = attributes
|
|
71
|
+
.filter(([name]) => name !== 'href')
|
|
72
|
+
.map(([name, value]) => `${name}=${value}`)
|
|
73
|
+
.sort()
|
|
74
|
+
.join(';');
|
|
75
|
+
add(`link:${key}`, 'link', [
|
|
76
|
+
['rel', link.rel],
|
|
77
|
+
...attributes.filter(([name]) => name !== 'rel'),
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
head.jsonLd?.forEach((value, n) => {
|
|
81
|
+
add(`ld:${String(n)}`, 'script', [['type', 'application/ld+json']], scriptSafeJson(value));
|
|
82
|
+
});
|
|
83
|
+
return [...out.values()];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=head.js.map
|
package/dist/head.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head.js","sourceRoot":"","sources":["../src/head.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,iGAAiG;AACjG,+EAA+E;AAC/E,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA4ClD,gGAAgG;AAChG,MAAM,CAAC,MA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G,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["// The head model (ADR 0019): one description of a page's managed <head> elements, shared by the\n// server's page shell (@gyral/ssr `renderPage()`) and the router's `setHead()`. Types and a pure\n// normalizer only, no DOM, so both halves agree on keys, order and duplicates.\nimport { DEV } from '#view-dev';\nimport { scriptSafeJson } from './script-json.js';\n\n/** A JSON value: what a JSON-LD block holds. */\nexport type JsonValue =\n string | number | boolean | null | readonly JsonValue[] | { readonly [key: string]: JsonValue };\n\n/**\n * `<meta name content>`, or `<meta property content>` (Open Graph uses `property`). `media`\n * makes one entry per media query (`theme-color` for light and dark).\n */\nexport type HeadMeta =\n | { readonly name: string; readonly content: string; readonly media?: string }\n | { readonly property: string; readonly content: string; readonly media?: string };\n\n/**\n * A metadata `<link>`: `alternate` (with `hreflang`), `icon` (with `sizes`, `type`), `manifest`\n * (with `crossorigin`), `prev`/`next`, … Any other attribute is written as given.\n */\nexport interface HeadLink {\n readonly rel: string;\n readonly href: string;\n readonly [attribute: string]: string;\n}\n\n/** A page's head: what `renderPage()` writes on the server and `setHead()` applies on the client. */\nexport interface Head {\n readonly title: string;\n readonly description?: string;\n /** Absolute URL, usually `new URL(match.path, origin).href` (ADR 0009 \"Canonical paths\"). */\n readonly canonical?: string;\n /** `<meta name=\"robots\">`, e.g. `'noindex, follow'`. */\n readonly robots?: string;\n /** Later entries win over earlier ones with the same name or property. */\n readonly meta?: readonly HeadMeta[];\n /** Later entries win over earlier ones with the same attributes other than `href`. */\n readonly links?: readonly HeadLink[];\n /** Structured data, each written as one `<script type=\"application/ld+json\">`. */\n readonly jsonLd?: readonly JsonValue[];\n /** `<html lang>`. */\n readonly lang?: string;\n /** `<html dir>`. */\n readonly dir?: 'ltr' | 'rtl' | 'auto';\n}\n\n/** The attribute that marks an element the head model manages; its value is the entry's key. */\nexport const HEAD_ATTRIBUTE = 'data-gyral-head';\n\n/** One managed element: its key, tag, attributes (in order) and, for JSON-LD, its text. */\nexport interface HeadEntry {\n readonly key: string;\n readonly tag: 'meta' | 'link' | 'script';\n readonly attributes: readonly (readonly [name: string, value: string])[];\n readonly text?: string;\n}\n\n// Belong to renderPage() itself: changing them per navigation would unstyle the page, refetch\n// modules, or apply policy too late. Checked in development only.\nconst REFUSED_REL = /(^|\\s)(stylesheet|preload|modulepreload|canonical)(\\s|$)/i;\n\nfunction check(head: Head): void {\n const refuse = (what: string): never => {\n throw new Error(\n `gyral head: ${what} is not a managed head entry (ADR 0019 \"Keys, dedupe and order\"). ` +\n 'Write it with renderPage() options or extraHead.',\n );\n };\n for (const m of head.meta ?? []) {\n if ('http-equiv' in m || 'charset' in m) refuse('<meta http-equiv> or <meta charset>');\n if ('name' in m && /^viewport$/i.test(m.name)) refuse('<meta name=\"viewport\">');\n }\n for (const link of head.links ?? []) {\n if (REFUSED_REL.test(link.rel)) refuse(`<link rel=\"${link.rel}\">`);\n }\n if (head.canonical !== undefined && !/^[a-z][a-z\\d+.-]*:/i.test(head.canonical)) {\n console.warn(\n `gyral head: canonical \"${head.canonical}\" is not an absolute URL. Build it from a ` +\n 'configured origin: new URL(match.path, origin).href (ADR 0019).',\n );\n }\n}\n\n/**\n * A head's managed elements, in document order and without duplicates: description, robots,\n * canonical, `meta`, `links`, then JSON-LD. Later `meta`/`links` entries with the same key win\n * (at the later position); the typed description and robots win over `meta` entries. The\n * title, `lang` and `dir` are not elements here.\n */\nexport function headEntries(head: Head): readonly HeadEntry[] {\n if (DEV) check(head);\n const out = new Map<string, HeadEntry>();\n const add = (\n key: string,\n tag: HeadEntry['tag'],\n attributes: HeadEntry['attributes'],\n text?: string,\n ): void => {\n out.delete(key);\n out.set(key, text === undefined ? { key, tag, attributes } : { key, tag, attributes, text });\n };\n const meta = (attr: string, name: string, content: string, media?: string): void => {\n add(media === undefined ? `${attr}:${name}` : `${attr}:${name}|${media}`, 'meta', [\n [attr, name],\n ['content', content],\n ...(media === undefined ? [] : [['media', media] as const]),\n ]);\n };\n if (head.description !== undefined) meta('name', 'description', head.description);\n if (head.robots !== undefined) meta('name', 'robots', head.robots);\n if (head.canonical !== undefined) {\n add('canonical', 'link', [\n ['rel', 'canonical'],\n ['href', head.canonical],\n ]);\n }\n const typed = new Set(out.keys());\n for (const m of head.meta ?? []) {\n const [attr, name] = 'name' in m ? ['name', m.name] : ['property', m.property];\n if (!typed.has(`${attr}:${name}`)) meta(attr, name, m.content, m.media);\n }\n for (const link of head.links ?? []) {\n const attributes = Object.entries(link);\n const key = attributes\n .filter(([name]) => name !== 'href')\n .map(([name, value]) => `${name}=${value}`)\n .sort()\n .join(';');\n add(`link:${key}`, 'link', [\n ['rel', link.rel],\n ...attributes.filter(([name]) => name !== 'rel'),\n ]);\n }\n head.jsonLd?.forEach((value, n) => {\n add(`ld:${String(n)}`, 'script', [['type', 'application/ld+json']], scriptSafeJson(value));\n });\n return [...out.values()];\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Errors = readonly string[] | string | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Mirrors model errors to native validity: `setCustomValidity` and `aria-invalid`.
|
|
4
|
+
*
|
|
5
|
+
* <input name="email" ${invalid(s.errors.email)} />
|
|
6
|
+
*
|
|
7
|
+
* The custom error clears when the control fires `input` or `change` (the user edited it), when
|
|
8
|
+
* the bound errors become `undefined` or empty (the model cleared them), or when a submit finds
|
|
9
|
+
* the error stale (the value changed without an event, e.g. set from code): then the error is
|
|
10
|
+
* dropped and the form is submitted again once. An error is applied again only when a new value
|
|
11
|
+
* arrives (keep `fieldErrors()` results in state): `client` runs only when the errors change.
|
|
12
|
+
*/
|
|
13
|
+
export declare const invalid: (errors?: Errors) => import("../index.js").HookResult<[errors?: Errors]>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// `invalid(errors)` as an element hook (view/02-bindings.md "Element hooks", ADR 0008): model
|
|
2
|
+
// errors mirrored to native validity, so `:user-invalid` and native bubbles agree with the
|
|
3
|
+
// model. The server half writes `aria-invalid` into the start tag, so it is no longer written
|
|
4
|
+
// twice.
|
|
5
|
+
import { defineHook } from '../view/index.js';
|
|
6
|
+
const isValidatable = (el) => 'setCustomValidity' in el;
|
|
7
|
+
const valueOf = (el) => ('value' in el ? el.value : undefined);
|
|
8
|
+
const formOf = (el) => {
|
|
9
|
+
const form = 'form' in el ? el.form : undefined;
|
|
10
|
+
return form instanceof HTMLFormElement ? form : undefined;
|
|
11
|
+
};
|
|
12
|
+
const messageOf = (errors) => typeof errors === 'string' ? errors : (errors ?? []).join(' ');
|
|
13
|
+
/** The listeners that clear the current error, per element (hooks keep no instance state). */
|
|
14
|
+
const listening = new WeakMap();
|
|
15
|
+
// Forms with a resubmit already queued: several stale fields in one validation pass resubmit once.
|
|
16
|
+
const resubmitting = new WeakSet();
|
|
17
|
+
function apply(el, errors) {
|
|
18
|
+
listening.get(el)?.abort();
|
|
19
|
+
listening.delete(el);
|
|
20
|
+
const message = messageOf(errors);
|
|
21
|
+
if (isValidatable(el))
|
|
22
|
+
el.setCustomValidity(message);
|
|
23
|
+
if (message === '') {
|
|
24
|
+
el.removeAttribute('aria-invalid');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
el.setAttribute('aria-invalid', 'true');
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
listening.set(el, controller);
|
|
30
|
+
const { signal } = controller;
|
|
31
|
+
const rejectedValue = valueOf(el);
|
|
32
|
+
const clear = () => {
|
|
33
|
+
controller.abort();
|
|
34
|
+
if (isValidatable(el))
|
|
35
|
+
el.setCustomValidity('');
|
|
36
|
+
el.removeAttribute('aria-invalid');
|
|
37
|
+
};
|
|
38
|
+
el.addEventListener('input', clear, { signal });
|
|
39
|
+
el.addEventListener('change', clear, { signal });
|
|
40
|
+
el.addEventListener('invalid', (event) => {
|
|
41
|
+
if (Object.is(valueOf(el), rejectedValue))
|
|
42
|
+
return; // still the rejected value
|
|
43
|
+
event.preventDefault(); // no bubble for an error that no longer applies
|
|
44
|
+
clear();
|
|
45
|
+
const form = formOf(el);
|
|
46
|
+
if (form === undefined || resubmitting.has(form))
|
|
47
|
+
return;
|
|
48
|
+
resubmitting.add(form);
|
|
49
|
+
queueMicrotask(() => {
|
|
50
|
+
resubmitting.delete(form);
|
|
51
|
+
form.requestSubmit();
|
|
52
|
+
});
|
|
53
|
+
}, { signal });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Mirrors model errors to native validity: `setCustomValidity` and `aria-invalid`.
|
|
57
|
+
*
|
|
58
|
+
* <input name="email" ${invalid(s.errors.email)} />
|
|
59
|
+
*
|
|
60
|
+
* The custom error clears when the control fires `input` or `change` (the user edited it), when
|
|
61
|
+
* the bound errors become `undefined` or empty (the model cleared them), or when a submit finds
|
|
62
|
+
* the error stale (the value changed without an event, e.g. set from code): then the error is
|
|
63
|
+
* dropped and the form is submitted again once. An error is applied again only when a new value
|
|
64
|
+
* arrives (keep `fieldErrors()` results in state): `client` runs only when the errors change.
|
|
65
|
+
*/
|
|
66
|
+
export const invalid = defineHook({
|
|
67
|
+
server: ([errors]) => (messageOf(errors) === '' ? {} : { 'aria-invalid': 'true' }),
|
|
68
|
+
client: (el, [errors]) => {
|
|
69
|
+
apply(el, errors);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=invalid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid.js","sourceRoot":"","sources":["../../src/hooks/invalid.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,2FAA2F;AAC3F,8FAA8F;AAC9F,SAAS;AACT,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC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AAC,CAAC;IACL,CAAC,EACD,EAAE,MAAM,EAAE,CACX,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAoB;IACnD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;IAClF,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;QACvB,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACpB,CAAC;CACF,CAAC,CAAC","sourcesContent":["// `invalid(errors)` as an element hook (view/02-bindings.md \"Element hooks\", ADR 0008): model\n// errors mirrored to native validity, so `:user-invalid` and native bubbles agree with the\n// model. The server half writes `aria-invalid` into the start tag, so it is no longer written\n// twice.\nimport { defineHook } from '../view/index.js';\n\ntype Errors = readonly string[] | string | undefined;\n\ninterface Validatable extends Element {\n setCustomValidity(message: string): void;\n}\n\nconst isValidatable = (el: Element): el is Validatable => 'setCustomValidity' in el;\n\nconst valueOf = (el: Element): unknown => ('value' in el ? el.value : undefined);\n\nconst formOf = (el: Element): HTMLFormElement | undefined => {\n const form = 'form' in el ? el.form : undefined;\n return form instanceof HTMLFormElement ? form : undefined;\n};\n\nconst messageOf = (errors: Errors): string =>\n typeof errors === 'string' ? errors : (errors ?? []).join(' ');\n\n/** The listeners that clear the current error, per element (hooks keep no instance state). */\nconst listening = new WeakMap<Element, AbortController>();\n\n// Forms with a resubmit already queued: several stale fields in one validation pass resubmit once.\nconst resubmitting = new WeakSet<HTMLFormElement>();\n\nfunction apply(el: Element, errors: Errors): void {\n listening.get(el)?.abort();\n listening.delete(el);\n const message = messageOf(errors);\n if (isValidatable(el)) el.setCustomValidity(message);\n if (message === '') {\n el.removeAttribute('aria-invalid');\n return;\n }\n el.setAttribute('aria-invalid', 'true');\n\n const controller = new AbortController();\n listening.set(el, controller);\n const { signal } = controller;\n const rejectedValue = valueOf(el);\n const clear = (): void => {\n controller.abort();\n if (isValidatable(el)) el.setCustomValidity('');\n el.removeAttribute('aria-invalid');\n };\n el.addEventListener('input', clear, { signal });\n el.addEventListener('change', clear, { signal });\n el.addEventListener(\n 'invalid',\n (event) => {\n if (Object.is(valueOf(el), rejectedValue)) return; // still the rejected value\n event.preventDefault(); // no bubble for an error that no longer applies\n clear();\n const form = formOf(el);\n if (form === undefined || resubmitting.has(form)) return;\n resubmitting.add(form);\n queueMicrotask(() => {\n resubmitting.delete(form);\n form.requestSubmit();\n });\n },\n { signal },\n );\n}\n\n/**\n * Mirrors model errors to native validity: `setCustomValidity` and `aria-invalid`.\n *\n * <input name=\"email\" ${invalid(s.errors.email)} />\n *\n * The custom error clears when the control fires `input` or `change` (the user edited it), when\n * the bound errors become `undefined` or empty (the model cleared them), or when a submit finds\n * the error stale (the value changed without an event, e.g. set from code): then the error is\n * dropped and the form is submitted again once. An error is applied again only when a new value\n * arrives (keep `fieldErrors()` results in state): `client` runs only when the errors change.\n */\nexport const invalid = defineHook<[errors?: Errors]>({\n server: ([errors]) => (messageOf(errors) === '' ? {} : { 'aria-invalid': 'true' }),\n client: (el, [errors]) => {\n apply(el, errors);\n },\n});\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type Command, type Next } from './command.js';
|
|
2
|
+
import { type FeatureHost, type LocalHost, type StoreLink } from './features.js';
|
|
3
|
+
import { type ErrorPhase, type GyralError } from './errors.js';
|
|
4
|
+
import type { Seed } from './hydration.js';
|
|
5
|
+
import type { ComponentSpec, IntentRejected, ParserCtx, Tagged } from './types.js';
|
|
6
|
+
type Bag = Readonly<Record<string, unknown>>;
|
|
7
|
+
/** A command as the model runs it. */
|
|
8
|
+
export type ModelCommand = Command<Tagged | IntentRejected>;
|
|
9
|
+
type Cmd = ModelCommand;
|
|
10
|
+
/** What the model needs from its element. */
|
|
11
|
+
export interface ModelHost {
|
|
12
|
+
readonly el: FeatureHost;
|
|
13
|
+
readonly tag: string;
|
|
14
|
+
/** The declared props as components see them (defaults applied). */
|
|
15
|
+
readonly props: () => Bag;
|
|
16
|
+
/** The host's root once it has one (focus commands run against it). */
|
|
17
|
+
readonly root: () => ParentNode | undefined;
|
|
18
|
+
/** Something changed that the next render must show; `onFrame`: in the frame lane (04). */
|
|
19
|
+
readonly invalidate: (onFrame: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare class HostModel<S, P> implements LocalHost {
|
|
22
|
+
#private;
|
|
23
|
+
readonly el: FeatureHost;
|
|
24
|
+
readonly tag: string;
|
|
25
|
+
readonly root: () => ParentNode | undefined;
|
|
26
|
+
constructor(host: ModelHost, spec: ComponentSpec<S, Tagged, P>);
|
|
27
|
+
/** The store binding, created on first use. Only reached once `defineStore()` has run. */
|
|
28
|
+
readonly stores: () => StoreLink;
|
|
29
|
+
get ready(): boolean;
|
|
30
|
+
/** Set when `init` threw; the host has no state then. */
|
|
31
|
+
get failure(): GyralError | undefined;
|
|
32
|
+
/** The current state, running `init` (and `initialMessages`) on first read. */
|
|
33
|
+
state(initialMessages?: readonly Tagged[]): S;
|
|
34
|
+
/**
|
|
35
|
+
* Reports a failure of this host (ADR 0024) and, for a failed update, parse or command, sends
|
|
36
|
+
* `Errored` to its optional reducer. A failure while handling `Errored` is only reported.
|
|
37
|
+
*/
|
|
38
|
+
fail(cause: unknown, phase: ErrorPhase, text: string, msg?: string): GyralError;
|
|
39
|
+
hasReducer(tag: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Resumes from a server seed (ADR 0012): the server's state, or `init(props)`'s when the
|
|
42
|
+
* seed left it out. Returns init's commands, to start after the first render.
|
|
43
|
+
*/
|
|
44
|
+
resume(seed: Seed): readonly Cmd[];
|
|
45
|
+
/**
|
|
46
|
+
* PropsChanged when props differ from the last ones seen (`Object.is` per prop). A reducer
|
|
47
|
+
* that throws leaves them unseen, so the next render sends PropsChanged again (ADR 0024).
|
|
48
|
+
*/
|
|
49
|
+
syncProps(names: readonly string[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Runs `msg`'s reducer. A reducer that throws changes nothing (no state, no commands): the
|
|
52
|
+
* failure is reported (ADR 0024) and dispatch returns false.
|
|
53
|
+
*/
|
|
54
|
+
dispatch(msg: Tagged, schedule?: boolean): boolean;
|
|
55
|
+
apply(next: Next<S, Tagged> | Next<S, Tagged | IntentRejected>): void;
|
|
56
|
+
/** Starts commands kept for later (init's, after a server-rendered host's first render). */
|
|
57
|
+
run(commands: readonly Cmd[]): void;
|
|
58
|
+
ctx(): ParserCtx<P, S>;
|
|
59
|
+
/**
|
|
60
|
+
* Resolves stores and runs kept commands; after a real detach, starts the subscriptions again
|
|
61
|
+
* (05 "Lifecycle"). Returns true if store instances were bound.
|
|
62
|
+
*/
|
|
63
|
+
connect(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Starts `spec.subscriptions` (ADR 0025): after the first render, as init's commands of a
|
|
66
|
+
* server-rendered host are, so nothing they emit can change what hydration adopts.
|
|
67
|
+
*/
|
|
68
|
+
subscribe(): void;
|
|
69
|
+
/** Aborts the running command of `lane` (a subscription that left, ADR 0025). */
|
|
70
|
+
cancel(lane: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* Stops the commands one microtask later, unless the host is connected again first: a move
|
|
73
|
+
* (`appendChild`, `insertBefore`) disconnects and connects in one task and keeps them running.
|
|
74
|
+
*/
|
|
75
|
+
disconnect(): void;
|
|
76
|
+
}
|
|
77
|
+
export {};
|