@velarscript/web 0.31.0 → 0.32.0
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/README.md +1 -1
- package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/config.js +19 -0
- package/dist/analysis/calls/intrinsics/config.js.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/forms.js +38 -0
- package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
- package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/http.js +37 -0
- package/dist/analysis/calls/intrinsics/http.js.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/reactive.js +30 -0
- package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts +12 -0
- package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/storage.js +86 -0
- package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
- package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
- package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics/web.js +100 -0
- package/dist/analysis/calls/intrinsics/web.js.map +1 -0
- package/dist/analysis/calls/intrinsics.d.ts +13 -0
- package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
- package/dist/analysis/calls/intrinsics.js +31 -0
- package/dist/analysis/calls/intrinsics.js.map +1 -0
- package/dist/analysis/components/contracts.d.ts +19 -0
- package/dist/analysis/components/contracts.d.ts.map +1 -0
- package/dist/analysis/components/contracts.js +83 -0
- package/dist/analysis/components/contracts.js.map +1 -0
- package/dist/analysis/components/declaration.d.ts +4 -0
- package/dist/analysis/components/declaration.d.ts.map +1 -0
- package/dist/analysis/components/declaration.js +163 -0
- package/dist/analysis/components/declaration.js.map +1 -0
- package/dist/analysis/components/host.d.ts +61 -0
- package/dist/analysis/components/host.d.ts.map +1 -0
- package/dist/analysis/components/host.js +22 -0
- package/dist/analysis/components/host.js.map +1 -0
- package/dist/analysis/components/lifecycle.d.ts +22 -0
- package/dist/analysis/components/lifecycle.d.ts.map +1 -0
- package/dist/analysis/components/lifecycle.js +33 -0
- package/dist/analysis/components/lifecycle.js.map +1 -0
- package/dist/analysis/components/ownership.d.ts +74 -0
- package/dist/analysis/components/ownership.d.ts.map +1 -0
- package/dist/analysis/components/ownership.js +106 -0
- package/dist/analysis/components/ownership.js.map +1 -0
- package/dist/analysis/declarations.d.ts +99 -0
- package/dist/analysis/declarations.d.ts.map +1 -0
- package/dist/analysis/declarations.js +176 -0
- package/dist/analysis/declarations.js.map +1 -0
- package/dist/analysis/inference.d.ts +67 -0
- package/dist/analysis/inference.d.ts.map +1 -0
- package/dist/analysis/inference.js +236 -0
- package/dist/analysis/inference.js.map +1 -0
- package/dist/analysis/jsx/attributes.d.ts +103 -0
- package/dist/analysis/jsx/attributes.d.ts.map +1 -0
- package/dist/analysis/jsx/attributes.js +601 -0
- package/dist/analysis/jsx/attributes.js.map +1 -0
- package/dist/analysis/jsx/elements.d.ts +17 -0
- package/dist/analysis/jsx/elements.d.ts.map +1 -0
- package/dist/analysis/jsx/elements.js +213 -0
- package/dist/analysis/jsx/elements.js.map +1 -0
- package/dist/analysis/jsx/host.d.ts +61 -0
- package/dist/analysis/jsx/host.d.ts.map +1 -0
- package/dist/analysis/jsx/host.js +15 -0
- package/dist/analysis/jsx/host.js.map +1 -0
- package/dist/analysis/jsx/keys.d.ts +15 -0
- package/dist/analysis/jsx/keys.d.ts.map +1 -0
- package/dist/analysis/jsx/keys.js +67 -0
- package/dist/analysis/jsx/keys.js.map +1 -0
- package/dist/analysis/jsx/security.d.ts +29 -0
- package/dist/analysis/jsx/security.d.ts.map +1 -0
- package/dist/analysis/jsx/security.js +61 -0
- package/dist/analysis/jsx/security.js.map +1 -0
- package/dist/analysis/jsx-detection.d.ts +49 -0
- package/dist/analysis/jsx-detection.d.ts.map +1 -0
- package/dist/analysis/jsx-detection.js +196 -0
- package/dist/analysis/jsx-detection.js.map +1 -0
- package/dist/analysis/keyed-rebuild.d.ts +148 -0
- package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
- package/dist/analysis/keyed-rebuild.js +299 -0
- package/dist/analysis/keyed-rebuild.js.map +1 -0
- package/dist/analysis/keyframes-analysis.d.ts +6 -0
- package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
- package/dist/analysis/keyframes-analysis.js +79 -0
- package/dist/analysis/keyframes-analysis.js.map +1 -0
- package/dist/analysis/look/builders.d.ts +29 -0
- package/dist/analysis/look/builders.d.ts.map +1 -0
- package/dist/analysis/look/builders.js +168 -0
- package/dist/analysis/look/builders.js.map +1 -0
- package/dist/analysis/look/conditions.d.ts +13 -0
- package/dist/analysis/look/conditions.d.ts.map +1 -0
- package/dist/analysis/look/conditions.js +84 -0
- package/dist/analysis/look/conditions.js.map +1 -0
- package/dist/analysis/look/edits.d.ts +25 -0
- package/dist/analysis/look/edits.d.ts.map +1 -0
- package/dist/analysis/look/edits.js +57 -0
- package/dist/analysis/look/edits.js.map +1 -0
- package/dist/analysis/look/entries.d.ts +56 -0
- package/dist/analysis/look/entries.d.ts.map +1 -0
- package/dist/analysis/look/entries.js +223 -0
- package/dist/analysis/look/entries.js.map +1 -0
- package/dist/analysis/look/host.d.ts +47 -0
- package/dist/analysis/look/host.d.ts.map +1 -0
- package/dist/analysis/look/host.js +16 -0
- package/dist/analysis/look/host.js.map +1 -0
- package/dist/analysis/look/tokens.d.ts +75 -0
- package/dist/analysis/look/tokens.d.ts.map +1 -0
- package/dist/analysis/look/tokens.js +151 -0
- package/dist/analysis/look/tokens.js.map +1 -0
- package/dist/analysis/look/values.d.ts +45 -0
- package/dist/analysis/look/values.d.ts.map +1 -0
- package/dist/analysis/look/values.js +148 -0
- package/dist/analysis/look/values.js.map +1 -0
- package/dist/analysis/look-conditions.d.ts +47 -0
- package/dist/analysis/look-conditions.d.ts.map +1 -0
- package/dist/analysis/look-conditions.js +157 -0
- package/dist/analysis/look-conditions.js.map +1 -0
- package/dist/analysis/look-sites.d.ts +54 -0
- package/dist/analysis/look-sites.d.ts.map +1 -0
- package/dist/analysis/look-sites.js +104 -0
- package/dist/analysis/look-sites.js.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
- package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
- package/dist/analysis/look-vocabulary-guidance.js +338 -0
- package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
- package/dist/analysis/media-conditions.d.ts +33 -0
- package/dist/analysis/media-conditions.d.ts.map +1 -0
- package/dist/analysis/media-conditions.js +92 -0
- package/dist/analysis/media-conditions.js.map +1 -0
- package/dist/analysis/program-passes.d.ts +106 -0
- package/dist/analysis/program-passes.d.ts.map +1 -0
- package/dist/analysis/program-passes.js +149 -0
- package/dist/analysis/program-passes.js.map +1 -0
- package/dist/analysis/reactivity/bindings.d.ts +37 -0
- package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
- package/dist/analysis/reactivity/bindings.js +88 -0
- package/dist/analysis/reactivity/bindings.js.map +1 -0
- package/dist/analysis/reactivity/derived.d.ts +39 -0
- package/dist/analysis/reactivity/derived.d.ts.map +1 -0
- package/dist/analysis/reactivity/derived.js +80 -0
- package/dist/analysis/reactivity/derived.js.map +1 -0
- package/dist/analysis/reactivity/host.d.ts +38 -0
- package/dist/analysis/reactivity/host.d.ts.map +1 -0
- package/dist/analysis/reactivity/host.js +14 -0
- package/dist/analysis/reactivity/host.js.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
- package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
- package/dist/analysis/reactivity/retired-accessors.js +118 -0
- package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
- package/dist/analysis/renderable.d.ts +47 -0
- package/dist/analysis/renderable.d.ts.map +1 -0
- package/dist/analysis/renderable.js +105 -0
- package/dist/analysis/renderable.js.map +1 -0
- package/dist/analysis/routes.d.ts +64 -0
- package/dist/analysis/routes.d.ts.map +1 -0
- package/dist/analysis/routes.js +182 -0
- package/dist/analysis/routes.js.map +1 -0
- package/dist/analysis/url-attributes.d.ts +12 -0
- package/dist/analysis/url-attributes.d.ts.map +1 -0
- package/dist/analysis/url-attributes.js +48 -0
- package/dist/analysis/url-attributes.js.map +1 -0
- package/dist/analysis/watch-cycles.d.ts +102 -0
- package/dist/analysis/watch-cycles.d.ts.map +1 -1
- package/dist/analysis/watch-cycles.js +240 -1
- package/dist/analysis/watch-cycles.js.map +1 -1
- package/dist/analysis/watch-subject.d.ts +45 -0
- package/dist/analysis/watch-subject.d.ts.map +1 -0
- package/dist/analysis/watch-subject.js +272 -0
- package/dist/analysis/watch-subject.js.map +1 -0
- package/dist/analysis/web-types.d.ts +27 -0
- package/dist/analysis/web-types.d.ts.map +1 -0
- package/dist/analysis/web-types.js +170 -0
- package/dist/analysis/web-types.js.map +1 -0
- package/dist/analyzer.d.ts +18 -617
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +208 -4853
- package/dist/analyzer.js.map +1 -1
- package/dist/compiler.d.ts +20 -0
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +29 -864
- package/dist/compiler.js.map +1 -1
- package/dist/documentation.d.ts +28 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +67 -0
- package/dist/documentation.js.map +1 -0
- package/dist/editor/completions.d.ts +12 -0
- package/dist/editor/completions.d.ts.map +1 -0
- package/dist/editor/completions.js +6 -0
- package/dist/editor/completions.js.map +1 -0
- package/dist/editor/jsx-completion.d.ts +12 -0
- package/dist/editor/jsx-completion.d.ts.map +1 -0
- package/dist/editor/jsx-completion.js +137 -0
- package/dist/editor/jsx-completion.js.map +1 -0
- package/dist/editor/look-completion.d.ts +29 -0
- package/dist/editor/look-completion.d.ts.map +1 -0
- package/dist/editor/look-completion.js +159 -0
- package/dist/editor/look-completion.js.map +1 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +12 -288
- package/dist/editor.js.map +1 -1
- package/dist/emit/components.d.ts +33 -0
- package/dist/emit/components.d.ts.map +1 -0
- package/dist/emit/components.js +135 -0
- package/dist/emit/components.js.map +1 -0
- package/dist/emit/jsx.d.ts +57 -0
- package/dist/emit/jsx.d.ts.map +1 -0
- package/dist/emit/jsx.js +384 -0
- package/dist/emit/jsx.js.map +1 -0
- package/dist/emit/look-css.d.ts +44 -0
- package/dist/emit/look-css.d.ts.map +1 -0
- package/dist/emit/look-css.js +177 -0
- package/dist/emit/look-css.js.map +1 -0
- package/dist/emit/look.d.ts +39 -0
- package/dist/emit/look.d.ts.map +1 -0
- package/dist/emit/look.js +218 -0
- package/dist/emit/look.js.map +1 -0
- package/dist/emit/runtime-imports.d.ts +40 -0
- package/dist/emit/runtime-imports.d.ts.map +1 -0
- package/dist/emit/runtime-imports.js +184 -0
- package/dist/emit/runtime-imports.js.map +1 -0
- package/dist/emitter.d.ts +15 -68
- package/dist/emitter.d.ts.map +1 -1
- package/dist/emitter.js +79 -1008
- package/dist/emitter.js.map +1 -1
- package/dist/look/animation.d.ts +7 -0
- package/dist/look/animation.d.ts.map +1 -0
- package/dist/look/animation.js +13 -0
- package/dist/look/animation.js.map +1 -0
- package/dist/look/builders.d.ts +35 -0
- package/dist/look/builders.d.ts.map +1 -0
- package/dist/look/builders.js +74 -0
- package/dist/look/builders.js.map +1 -0
- package/dist/look/css-functions.d.ts +28 -0
- package/dist/look/css-functions.d.ts.map +1 -0
- package/dist/look/css-functions.js +54 -0
- package/dist/look/css-functions.js.map +1 -0
- package/dist/look/keyword-sets.d.ts +41 -0
- package/dist/look/keyword-sets.d.ts.map +1 -0
- package/dist/look/keyword-sets.js +117 -0
- package/dist/look/keyword-sets.js.map +1 -0
- package/dist/look/keywords.d.ts +55 -0
- package/dist/look/keywords.d.ts.map +1 -0
- package/dist/look/keywords.js +387 -0
- package/dist/look/keywords.js.map +1 -0
- package/dist/look/media.d.ts +19 -0
- package/dist/look/media.d.ts.map +1 -0
- package/dist/look/media.js +27 -0
- package/dist/look/media.js.map +1 -0
- package/dist/look/naming.d.ts +9 -0
- package/dist/look/naming.d.ts.map +1 -0
- package/dist/look/naming.js +45 -0
- package/dist/look/naming.js.map +1 -0
- package/dist/look/properties.d.ts +16 -0
- package/dist/look/properties.d.ts.map +1 -0
- package/dist/look/properties.js +52 -0
- package/dist/look/properties.js.map +1 -0
- package/dist/look/shorthands.d.ts +25 -0
- package/dist/look/shorthands.d.ts.map +1 -0
- package/dist/look/shorthands.js +130 -0
- package/dist/look/shorthands.js.map +1 -0
- package/dist/look/tokens.d.ts +38 -0
- package/dist/look/tokens.d.ts.map +1 -0
- package/dist/look/tokens.js +59 -0
- package/dist/look/tokens.js.map +1 -0
- package/dist/look/units.d.ts +24 -0
- package/dist/look/units.d.ts.map +1 -0
- package/dist/look/units.js +33 -0
- package/dist/look/units.js.map +1 -0
- package/dist/look.d.ts +32 -227
- package/dist/look.d.ts.map +1 -1
- package/dist/look.js +28 -933
- package/dist/look.js.map +1 -1
- package/dist/module-roster.d.ts +16 -0
- package/dist/module-roster.d.ts.map +1 -0
- package/dist/module-roster.js +28 -0
- package/dist/module-roster.js.map +1 -0
- package/dist/modules/app.d.ts +9 -0
- package/dist/modules/app.d.ts.map +1 -0
- package/dist/modules/app.js +20 -0
- package/dist/modules/app.js.map +1 -0
- package/dist/modules/browser-test.d.ts +9 -0
- package/dist/modules/browser-test.d.ts.map +1 -0
- package/dist/modules/browser-test.js +67 -0
- package/dist/modules/browser-test.js.map +1 -0
- package/dist/modules/browser.d.ts +10 -0
- package/dist/modules/browser.d.ts.map +1 -0
- package/dist/modules/browser.js +89 -0
- package/dist/modules/browser.js.map +1 -0
- package/dist/modules/config.d.ts +9 -0
- package/dist/modules/config.d.ts.map +1 -0
- package/dist/modules/config.js +14 -0
- package/dist/modules/config.js.map +1 -0
- package/dist/modules/files.d.ts +9 -0
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/files.js +16 -0
- package/dist/modules/files.js.map +1 -0
- package/dist/modules/forms.d.ts +9 -0
- package/dist/modules/forms.d.ts.map +1 -0
- package/dist/modules/forms.js +26 -0
- package/dist/modules/forms.js.map +1 -0
- package/dist/modules/http.d.ts +9 -0
- package/dist/modules/http.d.ts.map +1 -0
- package/dist/modules/http.js +127 -0
- package/dist/modules/http.js.map +1 -0
- package/dist/modules/look.d.ts +9 -0
- package/dist/modules/look.d.ts.map +1 -0
- package/dist/modules/look.js +58 -0
- package/dist/modules/look.js.map +1 -0
- package/dist/modules/realtime.d.ts +9 -0
- package/dist/modules/realtime.d.ts.map +1 -0
- package/dist/modules/realtime.js +163 -0
- package/dist/modules/realtime.js.map +1 -0
- package/dist/modules/storage.d.ts +9 -0
- package/dist/modules/storage.d.ts.map +1 -0
- package/dist/modules/storage.js +59 -0
- package/dist/modules/storage.js.map +1 -0
- package/dist/modules/types.d.ts +78 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +154 -0
- package/dist/modules/types.js.map +1 -0
- package/dist/modules/web.d.ts +9 -0
- package/dist/modules/web.d.ts.map +1 -0
- package/dist/modules/web.js +63 -0
- package/dist/modules/web.js.map +1 -0
- package/dist/modules/websocket.d.ts +11 -0
- package/dist/modules/websocket.d.ts.map +1 -0
- package/dist/modules/websocket.js +75 -0
- package/dist/modules/websocket.js.map +1 -0
- package/dist/parser/expressions/jsx.d.ts +17 -0
- package/dist/parser/expressions/jsx.d.ts.map +1 -0
- package/dist/parser/expressions/jsx.js +43 -0
- package/dist/parser/expressions/jsx.js.map +1 -0
- package/dist/parser/expressions/keyframes.d.ts +15 -0
- package/dist/parser/expressions/keyframes.d.ts.map +1 -0
- package/dist/parser/expressions/keyframes.js +33 -0
- package/dist/parser/expressions/keyframes.js.map +1 -0
- package/dist/parser/expressions/look.d.ts +16 -0
- package/dist/parser/expressions/look.d.ts.map +1 -0
- package/dist/parser/expressions/look.js +37 -0
- package/dist/parser/expressions/look.js.map +1 -0
- package/dist/parser/expressions/visual-block.d.ts +17 -0
- package/dist/parser/expressions/visual-block.d.ts.map +1 -0
- package/dist/parser/expressions/visual-block.js +21 -0
- package/dist/parser/expressions/visual-block.js.map +1 -0
- package/dist/parser/keyframes-source.d.ts +24 -0
- package/dist/parser/keyframes-source.d.ts.map +1 -0
- package/dist/parser/keyframes-source.js +133 -0
- package/dist/parser/keyframes-source.js.map +1 -0
- package/dist/parser/look-source.d.ts +25 -0
- package/dist/parser/look-source.d.ts.map +1 -0
- package/dist/parser/look-source.js +189 -0
- package/dist/parser/look-source.js.map +1 -0
- package/dist/parser/spans.d.ts +24 -0
- package/dist/parser/spans.d.ts.map +1 -0
- package/dist/parser/spans.js +113 -0
- package/dist/parser/spans.js.map +1 -0
- package/dist/parser/statements/components.d.ts +37 -0
- package/dist/parser/statements/components.d.ts.map +1 -0
- package/dist/parser/statements/components.js +185 -0
- package/dist/parser/statements/components.js.map +1 -0
- package/dist/parser/statements/heads.d.ts +38 -0
- package/dist/parser/statements/heads.d.ts.map +1 -0
- package/dist/parser/statements/heads.js +55 -0
- package/dist/parser/statements/heads.js.map +1 -0
- package/dist/parser/statements/imports.d.ts +9 -0
- package/dist/parser/statements/imports.d.ts.map +1 -0
- package/dist/parser/statements/imports.js +31 -0
- package/dist/parser/statements/imports.js.map +1 -0
- package/dist/parser/statements/reactive.d.ts +31 -0
- package/dist/parser/statements/reactive.d.ts.map +1 -0
- package/dist/parser/statements/reactive.js +68 -0
- package/dist/parser/statements/reactive.js.map +1 -0
- package/dist/parser/statements/unsafe-css.d.ts +21 -0
- package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
- package/dist/parser/statements/unsafe-css.js +42 -0
- package/dist/parser/statements/unsafe-css.js.map +1 -0
- package/dist/parser.d.ts +37 -50
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +98 -882
- package/dist/parser.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A watch subject as the author wrote it: the allowlist of shapes a subject may
|
|
3
|
+
* be, and the reconstruction of one back into the source text a refusal quotes.
|
|
4
|
+
*
|
|
5
|
+
* D115 P4 R3a: the reconstruction is a total function over an expression, so it
|
|
6
|
+
* reads as a module. Its per-kind renderers are named rather than inlined into
|
|
7
|
+
* one switch, because a reader who arrives asking how a call or an f-string is
|
|
8
|
+
* printed should be able to be sent to the answer.
|
|
9
|
+
*/
|
|
10
|
+
import {} from "@velarscript/compiler/extension";
|
|
11
|
+
/**
|
|
12
|
+
* D90 R15(a): a watch subject names a place in the reactive graph — the name of
|
|
13
|
+
* a `state` or a `computed`, or a read path out of one — and never computes a
|
|
14
|
+
* value. The rule is written positively, as this allowlist, because that is
|
|
15
|
+
* what makes the relation between a watch and its source *declared* rather than
|
|
16
|
+
* inferred; every earlier attempt to infer it was defeated by one more
|
|
17
|
+
* indirection. A path is legal at any depth and with any index expression:
|
|
18
|
+
* `rows[i].cells[j]` still selects a place, and whether `i` is a constant or
|
|
19
|
+
* another state changes nothing about that. An operator or a call derives a new
|
|
20
|
+
* value instead, and a derived value already has a spelling that names it,
|
|
21
|
+
* caches it, and declares its dependencies. The conditional is an operator by
|
|
22
|
+
* the charter's own vocabulary, and an f-string builds a new string, so neither
|
|
23
|
+
* needs a clause of its own — they simply are not paths.
|
|
24
|
+
*
|
|
25
|
+
* Whether the root of a legal path is reactive is a different question, and
|
|
26
|
+
* `frozenWatchSubject` keeps it: this answers shape only.
|
|
27
|
+
*/
|
|
28
|
+
export function watchSubjectPath(expression) {
|
|
29
|
+
switch (expression.kind) {
|
|
30
|
+
case "IdentifierExpression":
|
|
31
|
+
return true;
|
|
32
|
+
case "MemberExpression":
|
|
33
|
+
case "IndexExpression":
|
|
34
|
+
return watchSubjectPath(expression.object);
|
|
35
|
+
default:
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** The escapes a text literal carries back into source (`scanStringEscape`). */
|
|
40
|
+
const WATCH_SUBJECT_TEXT_ESCAPES = {
|
|
41
|
+
"\\": "\\\\",
|
|
42
|
+
"\"": "\\\"",
|
|
43
|
+
"\n": "\\n",
|
|
44
|
+
"\r": "\\r",
|
|
45
|
+
"\t": "\\t",
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A text literal written back as source. `LiteralExpression.raw` holds the
|
|
49
|
+
* decoded content without its quotes, so echoing it would quote an expression
|
|
50
|
+
* the author never wrote and hand him a `computed` line that does not compile —
|
|
51
|
+
* `watch term + "!":` would read back as `term + !`. The quote the author chose
|
|
52
|
+
* is not on the node, so every text literal reads back double-quoted; that is a
|
|
53
|
+
* spelling difference, not a meaning one, and it compiles.
|
|
54
|
+
*/
|
|
55
|
+
function renderWatchTextLiteral(value, insideFString) {
|
|
56
|
+
let text = "";
|
|
57
|
+
for (const character of value) {
|
|
58
|
+
const escape = WATCH_SUBJECT_TEXT_ESCAPES[character];
|
|
59
|
+
if (escape !== undefined) {
|
|
60
|
+
text += escape;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// `{{` and `}}` are how an f-string carries a brace that is not a hole.
|
|
64
|
+
if (insideFString && (character === "{" || character === "}")) {
|
|
65
|
+
text += `${character}${character}`;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const code = character.codePointAt(0);
|
|
69
|
+
text += code < 0x20 || code === 0x7f ? `\\u{${code.toString(16)}}` : character;
|
|
70
|
+
}
|
|
71
|
+
return text;
|
|
72
|
+
}
|
|
73
|
+
function renderWatchSubjectLiteral(expression) {
|
|
74
|
+
return typeof expression.value === "string" ? `"${renderWatchTextLiteral(expression.value, false)}"` : expression.raw;
|
|
75
|
+
}
|
|
76
|
+
function renderWatchSubjectMember(expression) {
|
|
77
|
+
const object = renderWatchSubjectOperand(expression.object);
|
|
78
|
+
return object === null ? null : `${object}${expression.optional ? "?." : "."}${expression.property}`;
|
|
79
|
+
}
|
|
80
|
+
function renderWatchSubjectIndex(expression) {
|
|
81
|
+
const object = renderWatchSubjectOperand(expression.object);
|
|
82
|
+
const index = renderWatchSubject(expression.index);
|
|
83
|
+
return object === null || index === null ? null : `${object}${expression.optional ? "?" : ""}[${index}]`;
|
|
84
|
+
}
|
|
85
|
+
function renderWatchSubjectCall(expression) {
|
|
86
|
+
const callee = renderWatchSubjectOperand(expression.callee);
|
|
87
|
+
if (callee === null)
|
|
88
|
+
return null;
|
|
89
|
+
const argumentTexts = [];
|
|
90
|
+
for (const [index, argument] of expression.arguments.entries()) {
|
|
91
|
+
const rendered = renderWatchSubject(argument);
|
|
92
|
+
if (rendered === null)
|
|
93
|
+
return null;
|
|
94
|
+
const name = expression.argumentNames?.[index] ?? null;
|
|
95
|
+
argumentTexts.push(name === null ? rendered : `${name} = ${rendered}`);
|
|
96
|
+
}
|
|
97
|
+
return `${callee}${expression.optional ? "?" : ""}(${argumentTexts.join(", ")})`;
|
|
98
|
+
}
|
|
99
|
+
function renderWatchSubjectList(expression) {
|
|
100
|
+
const elements = expression.elements.map((element) => renderWatchSubject(element));
|
|
101
|
+
if (elements.some((element) => element === null))
|
|
102
|
+
return null;
|
|
103
|
+
return `[${elements.join(", ")}]`;
|
|
104
|
+
}
|
|
105
|
+
function renderWatchSubjectObject(expression) {
|
|
106
|
+
const entries = [];
|
|
107
|
+
for (const property of expression.properties) {
|
|
108
|
+
if (property.kind === "ObjectSpread") {
|
|
109
|
+
const value = renderWatchSubjectOperand(property.value);
|
|
110
|
+
if (value === null)
|
|
111
|
+
return null;
|
|
112
|
+
entries.push(`...${value}`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (property.shorthand === true) {
|
|
116
|
+
entries.push(property.name);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const value = renderWatchSubject(property.value);
|
|
120
|
+
if (value === null)
|
|
121
|
+
return null;
|
|
122
|
+
entries.push(`${property.name}: ${value}`);
|
|
123
|
+
}
|
|
124
|
+
return `{${entries.join(", ")}}`;
|
|
125
|
+
}
|
|
126
|
+
function renderWatchSubjectArrow(expression) {
|
|
127
|
+
// An annotated or defaulted parameter would need a type printer this file
|
|
128
|
+
// has no business owning; the callback shapes a subject carries do not.
|
|
129
|
+
if (expression.parameters.some((parameter) => parameter.type !== null || parameter.defaultValue !== null))
|
|
130
|
+
return null;
|
|
131
|
+
const body = renderWatchSubject(expression.body);
|
|
132
|
+
if (body === null)
|
|
133
|
+
return null;
|
|
134
|
+
const parameters = expression.parameters.map((parameter) => `${parameter.rest ? "..." : ""}${parameter.name}`);
|
|
135
|
+
const head = expression.parameters.length === 1 && !expression.parameters[0].rest
|
|
136
|
+
? parameters[0]
|
|
137
|
+
: `(${parameters.join(", ")})`;
|
|
138
|
+
return `${expression.asynchronous ? "async " : ""}${head} => ${body}`;
|
|
139
|
+
}
|
|
140
|
+
function renderWatchSubjectUnary(expression) {
|
|
141
|
+
const operand = renderWatchSubjectOperand(expression.operand);
|
|
142
|
+
if (operand === null)
|
|
143
|
+
return null;
|
|
144
|
+
const spaced = expression.operator === "not" || expression.operator === "await";
|
|
145
|
+
return `${expression.operator}${spaced ? " " : ""}${operand}`;
|
|
146
|
+
}
|
|
147
|
+
function renderWatchSubjectBinary(expression) {
|
|
148
|
+
const left = renderWatchSubjectOperand(expression.left);
|
|
149
|
+
const right = renderWatchSubjectOperand(expression.right);
|
|
150
|
+
if (left === null || right === null)
|
|
151
|
+
return null;
|
|
152
|
+
return groupWatchSubject(`${left} ${expression.operator} ${right}`, expression.parenthesized);
|
|
153
|
+
}
|
|
154
|
+
function renderWatchSubjectComparisonChain(expression) {
|
|
155
|
+
const operands = expression.operands.map((operand) => renderWatchSubjectOperand(operand));
|
|
156
|
+
const first = operands[0];
|
|
157
|
+
if (first === undefined || first === null || operands.some((operand) => operand === null))
|
|
158
|
+
return null;
|
|
159
|
+
const chain = operands.slice(1).reduce((text, operand, index) => `${text} ${expression.operators[index]} ${operand}`, first);
|
|
160
|
+
return groupWatchSubject(chain, expression.parenthesized);
|
|
161
|
+
}
|
|
162
|
+
function renderWatchSubjectConditional(expression) {
|
|
163
|
+
const condition = renderWatchSubjectOperand(expression.condition);
|
|
164
|
+
const thenValue = renderWatchSubjectOperand(expression.thenValue);
|
|
165
|
+
const elseValue = renderWatchSubject(expression.elseValue);
|
|
166
|
+
if (condition === null || thenValue === null || elseValue === null)
|
|
167
|
+
return null;
|
|
168
|
+
return `${condition} ? ${thenValue} : ${elseValue}`;
|
|
169
|
+
}
|
|
170
|
+
function renderWatchSubjectIs(expression) {
|
|
171
|
+
const value = renderWatchSubjectOperand(expression.value);
|
|
172
|
+
// Only a plain named type reads back as one word; anything generic or
|
|
173
|
+
// optional would need a type printer this file has no business owning.
|
|
174
|
+
if (value === null || expression.type.syntax.kind !== "NamedTypeSyntax")
|
|
175
|
+
return null;
|
|
176
|
+
return groupWatchSubject(`${value} ${expression.operator} ${expression.type.syntax.name}`, expression.parenthesized);
|
|
177
|
+
}
|
|
178
|
+
function renderWatchSubjectFString(expression) {
|
|
179
|
+
let text = "";
|
|
180
|
+
for (const part of expression.parts) {
|
|
181
|
+
if (part.kind === "text") {
|
|
182
|
+
text += renderWatchTextLiteral(part.value, true);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const value = renderWatchSubject(part.value);
|
|
186
|
+
if (value === null)
|
|
187
|
+
return null;
|
|
188
|
+
text += `{${value}}`;
|
|
189
|
+
}
|
|
190
|
+
return `f"${text}"`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The subject as the author wrote it, reconstructed from the AST for exactly
|
|
194
|
+
* the node kinds a subject can be. The analyzer never sees the module text, and
|
|
195
|
+
* a refusal that cannot quote what it refused teaches nothing — so the message
|
|
196
|
+
* quotes this. It is a reconstruction and stays one: it is used in the message
|
|
197
|
+
* only, never in a `fix`, because rewriting an author's source from a
|
|
198
|
+
* reconstruction is a worse defect than the one being reported. Null means
|
|
199
|
+
* "cannot say faithfully", and the message drops the echo rather than guess.
|
|
200
|
+
*
|
|
201
|
+
* Faithfulness is the whole point, so grouping is carried across rather than
|
|
202
|
+
* re-derived: the three nodes that record the author's own parentheses are
|
|
203
|
+
* printed with them, and the low-precedence nodes that record nothing are
|
|
204
|
+
* parenthesized wherever a bare printing would re-associate. The reconstruction
|
|
205
|
+
* therefore parses back to the tree it came from.
|
|
206
|
+
*/
|
|
207
|
+
export function renderWatchSubject(expression) {
|
|
208
|
+
switch (expression.kind) {
|
|
209
|
+
case "IdentifierExpression":
|
|
210
|
+
return expression.name;
|
|
211
|
+
case "LiteralExpression":
|
|
212
|
+
return renderWatchSubjectLiteral(expression);
|
|
213
|
+
case "MemberExpression":
|
|
214
|
+
return renderWatchSubjectMember(expression);
|
|
215
|
+
case "IndexExpression":
|
|
216
|
+
return renderWatchSubjectIndex(expression);
|
|
217
|
+
case "CallExpression":
|
|
218
|
+
return renderWatchSubjectCall(expression);
|
|
219
|
+
case "SpreadExpression": {
|
|
220
|
+
const value = renderWatchSubjectOperand(expression.value);
|
|
221
|
+
return value === null ? null : `...${value}`;
|
|
222
|
+
}
|
|
223
|
+
case "RequiredExpression": {
|
|
224
|
+
const value = renderWatchSubjectOperand(expression.value);
|
|
225
|
+
return value === null ? null : `${value}!`;
|
|
226
|
+
}
|
|
227
|
+
case "TryExpression": {
|
|
228
|
+
const value = renderWatchSubjectOperand(expression.value);
|
|
229
|
+
return value === null ? null : `try ${value}`;
|
|
230
|
+
}
|
|
231
|
+
case "ListExpression":
|
|
232
|
+
return renderWatchSubjectList(expression);
|
|
233
|
+
case "ObjectExpression":
|
|
234
|
+
return renderWatchSubjectObject(expression);
|
|
235
|
+
case "ArrowFunctionExpression":
|
|
236
|
+
return renderWatchSubjectArrow(expression);
|
|
237
|
+
case "UnaryExpression":
|
|
238
|
+
return renderWatchSubjectUnary(expression);
|
|
239
|
+
case "BinaryExpression":
|
|
240
|
+
return renderWatchSubjectBinary(expression);
|
|
241
|
+
case "ComparisonChainExpression":
|
|
242
|
+
return renderWatchSubjectComparisonChain(expression);
|
|
243
|
+
case "ConditionalExpression":
|
|
244
|
+
return renderWatchSubjectConditional(expression);
|
|
245
|
+
case "IsExpression":
|
|
246
|
+
return renderWatchSubjectIs(expression);
|
|
247
|
+
case "FStringExpression":
|
|
248
|
+
return renderWatchSubjectFString(expression);
|
|
249
|
+
default:
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* The same reconstruction in a position where a bare printing would bind
|
|
255
|
+
* differently than the author's source did — a binary operand, the object of a
|
|
256
|
+
* member read, the callee of a call. A conditional or an arrow reaches such a
|
|
257
|
+
* position only through parentheses the author wrote, and neither node records
|
|
258
|
+
* them, so they are restored here.
|
|
259
|
+
*/
|
|
260
|
+
function renderWatchSubjectOperand(expression) {
|
|
261
|
+
const rendered = renderWatchSubject(expression);
|
|
262
|
+
if (rendered === null)
|
|
263
|
+
return null;
|
|
264
|
+
return expression.kind === "ConditionalExpression" || expression.kind === "ArrowFunctionExpression"
|
|
265
|
+
? `(${rendered})`
|
|
266
|
+
: rendered;
|
|
267
|
+
}
|
|
268
|
+
/** Restores the parentheses the author wrote, for the three nodes that record them. */
|
|
269
|
+
function groupWatchSubject(rendered, parenthesized) {
|
|
270
|
+
return parenthesized === true ? `(${rendered})` : rendered;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=watch-subject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-subject.js","sourceRoot":"","sources":["../../src/analysis/watch-subject.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAmB,MAAM,iCAAiC,CAAC;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,CAAC,IAAI,QAAQ,GAAG;QACjB,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED,uFAAuF;AACvF,SAAS,iBAAiB,CAAC,QAAgB,EAAE,aAA+B;IAC1E,OAAO,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Web surface's own answers about names: which record a runtime type name
|
|
3
|
+
* carries, which event type a DOM event name resolves to, which ValueType each
|
|
4
|
+
* Look property accepts, and the small rosters and sentence builders the
|
|
5
|
+
* analyzer reads beside them.
|
|
6
|
+
*
|
|
7
|
+
* D115 P4 R3a: every one of these is a total function over a name, or the table
|
|
8
|
+
* one reads. None of them needs the analyzer's walk state, so they read as a
|
|
9
|
+
* module rather than as 150 lines standing between the analyzer's imports and
|
|
10
|
+
* its first collaborator.
|
|
11
|
+
*/
|
|
12
|
+
import { type Diagnostic, type DiagnosticFix, type Span } from "@velarscript/compiler";
|
|
13
|
+
import { type ValueType } from "@velarscript/compiler/extension";
|
|
14
|
+
export declare const routeContextIdentity = "@velarscript/web:velar/web#type:RouteContext";
|
|
15
|
+
export declare const removedJsxControlAttributes: Set<string>;
|
|
16
|
+
export declare const nativeDomEventNames: Set<string>;
|
|
17
|
+
export declare const htmlEventHandlerAttributes: Set<string>;
|
|
18
|
+
export declare const textualWebPrimitiveNames: Set<string>;
|
|
19
|
+
export declare const webEventTypeNames: ReadonlySet<string>;
|
|
20
|
+
export declare const webEventDeadFields: Set<string>;
|
|
21
|
+
export declare const diagnostic: (code: string, message: string, sourceSpan: Span, fix?: DiagnosticFix) => Diagnostic;
|
|
22
|
+
export declare const bindTargetGuidance: (directive: string) => string;
|
|
23
|
+
export declare const lookLength: ValueType;
|
|
24
|
+
export declare const LOOK_PROPERTY_TYPES: Map<string, ValueType>;
|
|
25
|
+
export declare function webTypeFields(name: string): ReadonlyMap<string, ValueType> | null;
|
|
26
|
+
export declare function webEventType(name: string): ValueType;
|
|
27
|
+
//# sourceMappingURL=web-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-types.d.ts","sourceRoot":"","sources":["../../src/analysis/web-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,iCAAiC,CAAC;AAMzC,eAAO,MAAM,oBAAoB,iDAAiD,CAAC;AAEnF,eAAO,MAAM,2BAA2B,aAAqC,CAAC;AAC9E,eAAO,MAAM,mBAAmB,aAS9B,CAAC;AAWH,eAAO,MAAM,0BAA0B,aAgBrC,CAAC;AACH,eAAO,MAAM,wBAAwB,aAAuG,CAAC;AAE7I,eAAO,MAAM,iBAAiB,qBAAuB,CAAC;AACtD,eAAO,MAAM,kBAAkB,aAA2D,CAAC;AAC3F,eAAO,MAAM,UAAU,SAAU,MAAM,WAAW,MAAM,cAAc,IAAI,QAAQ,aAAa,KAAG,UACZ,CAAC;AACvF,eAAO,MAAM,kBAAkB,cAAe,MAAM,KAAG,MAC0G,CAAC;AAElK,eAAO,MAAM,UAAU,EAAE,SAA6C,CAAC;AAkDvE,eAAO,MAAM,mBAAmB,wBACkC,CAAC;AAEnE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CA2BjF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAOpD"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Web surface's own answers about names: which record a runtime type name
|
|
3
|
+
* carries, which event type a DOM event name resolves to, which ValueType each
|
|
4
|
+
* Look property accepts, and the small rosters and sentence builders the
|
|
5
|
+
* analyzer reads beside them.
|
|
6
|
+
*
|
|
7
|
+
* D115 P4 R3a: every one of these is a total function over a name, or the table
|
|
8
|
+
* one reads. None of them needs the analyzer's walk state, so they read as a
|
|
9
|
+
* module rather than as 150 lines standing between the analyzer's imports and
|
|
10
|
+
* its first collaborator.
|
|
11
|
+
*/
|
|
12
|
+
import {} from "@velarscript/compiler";
|
|
13
|
+
import { boolType, nullType, numberType, optionalOf, stringType, unknownType, } from "@velarscript/compiler/extension";
|
|
14
|
+
import { LOOK_PROPERTY_VALUE_KINDS } from "../look.js";
|
|
15
|
+
import { WEB_EVENT_TYPE_NAMES } from "../types.js";
|
|
16
|
+
// probe with this identity so they succeed in modules that use route() without
|
|
17
|
+
// importing RouteContext by name.
|
|
18
|
+
export const routeContextIdentity = "@velarscript/web:velar/web#type:RouteContext";
|
|
19
|
+
export const removedJsxControlAttributes = new Set(["if", "else-if", "else"]);
|
|
20
|
+
export const nativeDomEventNames = new Set([
|
|
21
|
+
"click", "dblclick", "input", "beforeinput", "change", "submit", "reset", "invalid", "select", "toggle", "close",
|
|
22
|
+
"keydown", "keyup", "keypress", "focus", "blur", "focusin", "focusout", "scroll", "wheel",
|
|
23
|
+
"mousedown", "mouseup", "mousemove", "mouseenter", "mouseleave", "mouseover", "mouseout", "contextmenu",
|
|
24
|
+
"pointerdown", "pointerup", "pointermove", "pointerenter", "pointerleave", "pointerover", "pointerout", "pointercancel",
|
|
25
|
+
"touchstart", "touchend", "touchmove", "touchcancel",
|
|
26
|
+
"dragstart", "dragend", "dragover", "dragenter", "dragleave", "drop", "drag",
|
|
27
|
+
"compositionstart", "compositionupdate", "compositionend",
|
|
28
|
+
"copy", "cut", "paste", "load", "error", "transitionend", "animationend", "play", "pause", "ended",
|
|
29
|
+
]);
|
|
30
|
+
// The attribute names an element really compiles as script: the browser turns
|
|
31
|
+
// the attribute's text into a function body in the document's origin. This is a
|
|
32
|
+
// different roster from `nativeDomEventNames` above, which answers "is there an
|
|
33
|
+
// `on:` directive worth naming for this remainder". The two used to be one set,
|
|
34
|
+
// so `onanimationstart` was told its name is merely reserved while the browser
|
|
35
|
+
// was compiling it, and before that `onward` was told the reverse. Lookups
|
|
36
|
+
// lowercase the written name, because an HTML attribute name is matched
|
|
37
|
+
// ASCII-case-insensitively. Window-reflecting handlers (`onstorage`,
|
|
38
|
+
// `onmessage`, `onunload`) stay out: they take effect only on `<body>`, so the
|
|
39
|
+
// clause would be false of the element the author actually wrote.
|
|
40
|
+
export const htmlEventHandlerAttributes = new Set([
|
|
41
|
+
"onabort", "onauxclick", "onbeforeinput", "onbeforematch", "onbeforetoggle", "onblur", "oncancel",
|
|
42
|
+
"oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextlost", "oncontextmenu",
|
|
43
|
+
"oncontextrestored", "oncopy", "oncuechange", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter",
|
|
44
|
+
"ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror",
|
|
45
|
+
"onfocus", "onformdata", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload",
|
|
46
|
+
"onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave",
|
|
47
|
+
"onmousemove", "onmouseout", "onmouseover", "onmouseup", "onpaste", "onpause", "onplay", "onplaying",
|
|
48
|
+
"onprogress", "onratechange", "onreset", "onresize", "onscroll", "onscrollend", "onsecuritypolicyviolation",
|
|
49
|
+
"onseeked", "onseeking", "onselect", "onslotchange", "onstalled", "onsubmit", "onsuspend", "ontimeupdate",
|
|
50
|
+
"ontoggle", "onvolumechange", "onwaiting", "onwheel",
|
|
51
|
+
"onanimationstart", "onanimationend", "onanimationiteration", "onanimationcancel",
|
|
52
|
+
"ontransitionrun", "ontransitionstart", "ontransitionend", "ontransitioncancel",
|
|
53
|
+
"onpointerdown", "onpointerup", "onpointermove", "onpointerover", "onpointerout", "onpointerenter",
|
|
54
|
+
"onpointerleave", "onpointercancel", "ongotpointercapture", "onlostpointercapture",
|
|
55
|
+
"ontouchstart", "ontouchend", "ontouchmove", "ontouchcancel",
|
|
56
|
+
]);
|
|
57
|
+
export const textualWebPrimitiveNames = new Set(["Length", "Percentage", "LengthPercentage", "TrackFraction", "Color", "Duration", "Angle"]);
|
|
58
|
+
// D72 rule 186: derived from the published table, not restated beside it.
|
|
59
|
+
export const webEventTypeNames = WEB_EVENT_TYPE_NAMES;
|
|
60
|
+
export const webEventDeadFields = new Set(["target", "currentTarget", "value", "checked"]);
|
|
61
|
+
export const diagnostic = (code, message, sourceSpan, fix) => fix ? { code, message, span: sourceSpan, fix } : { code, message, span: sourceSpan };
|
|
62
|
+
export const bindTargetGuidance = (directive) => `${directive} requires a writable reactive location: a state name, or a field or index path on one such as ${directive}={form.name} or ${directive}={items[0]}`;
|
|
63
|
+
export const lookLength = { kind: "named", name: "Length" };
|
|
64
|
+
const lookPercentage = { kind: "named", name: "Percentage" };
|
|
65
|
+
const lookLengthPercentage = { kind: "named", name: "LengthPercentage" };
|
|
66
|
+
// LOK-D3: a length property never accepts a bare number. `width = 100` used to
|
|
67
|
+
// compile and reach CSS as the invalid declaration `width: 100`, which computes
|
|
68
|
+
// to `auto`; the unions below carry only spelled units, and the unitless-legal
|
|
69
|
+
// properties (opacity, zIndex, lineHeight, flex*, order, scale, aspectRatio,
|
|
70
|
+
// fontWeight) keep `number` individually.
|
|
71
|
+
const lookMetric = { kind: "union", members: [lookLength, lookPercentage, lookLengthPercentage] };
|
|
72
|
+
const lookColor = { kind: "named", name: "Color" };
|
|
73
|
+
const lookImage = { kind: "named", name: "Image" };
|
|
74
|
+
const lookBorder = { kind: "named", name: "Border" };
|
|
75
|
+
const lookShadow = { kind: "named", name: "Shadow" };
|
|
76
|
+
const lookFilter = { kind: "named", name: "Filter" };
|
|
77
|
+
const lookDuration = { kind: "named", name: "Duration" };
|
|
78
|
+
const lookAngle = { kind: "named", name: "Angle" };
|
|
79
|
+
const lookTrackList = { kind: "named", name: "TrackList" };
|
|
80
|
+
const lookTransition = { kind: "named", name: "Transition" };
|
|
81
|
+
const lookAnimation = { kind: "named", name: "Animation" };
|
|
82
|
+
const lookSpacing = { kind: "named", name: "Spacing" };
|
|
83
|
+
const lookMetricOrSpacing = { kind: "union", members: [lookMetric, lookSpacing] };
|
|
84
|
+
const lookPropertyType = (kind) => {
|
|
85
|
+
switch (kind) {
|
|
86
|
+
case "animation": return { kind: "union", members: [lookAnimation, { kind: "list", element: lookAnimation }] };
|
|
87
|
+
// D73 rule 187: a published keyword must be reachable. These three kinds
|
|
88
|
+
// used to type-refuse every string, so `zIndex = "auto"` -- the CSS initial
|
|
89
|
+
// value -- and the five CSS-wide keywords every other property takes were
|
|
90
|
+
// refused by the type before the closed set could answer. Accepting the
|
|
91
|
+
// string is what makes the set they now publish a surface rather than a
|
|
92
|
+
// promise (D50 rule 92); a value outside the set is still refused, by name.
|
|
93
|
+
case "angle": return { kind: "union", members: [lookAngle, stringType] };
|
|
94
|
+
case "background": return { kind: "union", members: [lookColor, lookImage, stringType] };
|
|
95
|
+
case "border": return { kind: "union", members: [lookBorder, stringType] };
|
|
96
|
+
case "color": return { kind: "union", members: [lookColor, stringType] };
|
|
97
|
+
case "duration": return { kind: "union", members: [lookDuration, stringType] };
|
|
98
|
+
case "image": return { kind: "union", members: [lookImage, stringType] };
|
|
99
|
+
case "line-height": return { kind: "union", members: [numberType, lookLength, stringType] };
|
|
100
|
+
case "metric": return { kind: "union", members: [lookMetricOrSpacing, stringType] };
|
|
101
|
+
case "number": return { kind: "union", members: [numberType, stringType] };
|
|
102
|
+
case "number-keyword": return { kind: "union", members: [numberType, lookSpacing, stringType] };
|
|
103
|
+
case "shadow": return { kind: "union", members: [lookShadow, stringType] };
|
|
104
|
+
case "track": return { kind: "union", members: [lookTrackList, stringType] };
|
|
105
|
+
case "transition": return { kind: "union", members: [lookTransition, stringType] };
|
|
106
|
+
case "filter": return { kind: "union", members: [lookFilter, stringType] };
|
|
107
|
+
case "keyword":
|
|
108
|
+
case "text":
|
|
109
|
+
case "transform":
|
|
110
|
+
return stringType;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
export const LOOK_PROPERTY_TYPES = new Map([...LOOK_PROPERTY_VALUE_KINDS]
|
|
114
|
+
.map(([name, kind]) => [name, lookPropertyType(kind)]));
|
|
115
|
+
export function webTypeFields(name) {
|
|
116
|
+
const functionType = (parameterNames, parameters, result) => ({ kind: "function", parameterNames, parameters, requiredParameters: parameters.length, result });
|
|
117
|
+
const eventFields = () => new Map([
|
|
118
|
+
["type", stringType], ["defaultPrevented", boolType], ["preventDefault", functionType([], [], nullType)], ["stopPropagation", functionType([], [], nullType)],
|
|
119
|
+
]);
|
|
120
|
+
if (name === "Event")
|
|
121
|
+
return eventFields();
|
|
122
|
+
// `isComposing` is on `InputEvent` below and belongs here for the same
|
|
123
|
+
// reason: while an input method is composing, a keystroke is aimed at the
|
|
124
|
+
// composer's candidate window rather than at the application. An Enter that
|
|
125
|
+
// commits a candidate arrives as `keydown` with `isComposing` true, and a
|
|
126
|
+
// handler that sends on Enter without asking sends half a word — which is the
|
|
127
|
+
// default for every CJK typist rather than an edge case.
|
|
128
|
+
if (name === "KeyboardEvent")
|
|
129
|
+
return new Map([...eventFields(), ["key", stringType], ["code", stringType], ["repeat", boolType], ["isComposing", boolType], ["altKey", boolType], ["ctrlKey", boolType], ["metaKey", boolType], ["shiftKey", boolType]]);
|
|
130
|
+
if (name === "PointerEvent")
|
|
131
|
+
return new Map([...eventFields(), ["pointerId", numberType], ["pointerType", stringType], ["pressure", numberType], ["button", numberType], ["buttons", numberType], ["clientX", numberType], ["clientY", numberType], ["movementX", numberType], ["movementY", numberType], ["altKey", boolType], ["ctrlKey", boolType], ["metaKey", boolType], ["shiftKey", boolType]]);
|
|
132
|
+
if (name === "InputEvent")
|
|
133
|
+
return new Map([...eventFields(), ["data", optionalOf(stringType)], ["inputType", stringType], ["isComposing", boolType]]);
|
|
134
|
+
if (name === "CompositionEvent")
|
|
135
|
+
return new Map([...eventFields(), ["data", stringType]]);
|
|
136
|
+
if (name === "ClipboardEvent")
|
|
137
|
+
return eventFields();
|
|
138
|
+
if (name === "Blob")
|
|
139
|
+
return new Map();
|
|
140
|
+
if (name === "File")
|
|
141
|
+
return new Map([["name", stringType], ["size", numberType], ["type", stringType], ["modified", numberType]]);
|
|
142
|
+
if (name === "Element" || name === "InputElement" || name === "TextAreaElement" || name === "CanvasElement" || name === "DialogElement") {
|
|
143
|
+
const fields = new Map([["focus", functionType([], [], nullType)], ["remove", functionType([], [], nullType)]]);
|
|
144
|
+
if (name === "InputElement" || name === "TextAreaElement")
|
|
145
|
+
fields.set("value", stringType);
|
|
146
|
+
if (name === "InputElement")
|
|
147
|
+
fields.set("checked", boolType);
|
|
148
|
+
if (name === "CanvasElement") {
|
|
149
|
+
fields.set("width", numberType);
|
|
150
|
+
fields.set("height", numberType);
|
|
151
|
+
fields.set("getContext", functionType(["kind"], [stringType], unknownType));
|
|
152
|
+
}
|
|
153
|
+
return fields;
|
|
154
|
+
}
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
export function webEventType(name) {
|
|
158
|
+
if (name === "keydown" || name === "keyup" || name === "keypress")
|
|
159
|
+
return { kind: "named", name: "KeyboardEvent" };
|
|
160
|
+
if (["click", "pointerdown", "pointerup", "pointermove", "pointercancel", "pointerover", "pointerout", "pointerenter", "pointerleave"].includes(name))
|
|
161
|
+
return { kind: "named", name: "PointerEvent" };
|
|
162
|
+
if (name === "beforeinput" || name === "input")
|
|
163
|
+
return { kind: "named", name: "InputEvent" };
|
|
164
|
+
if (name === "compositionstart" || name === "compositionupdate" || name === "compositionend")
|
|
165
|
+
return { kind: "named", name: "CompositionEvent" };
|
|
166
|
+
if (name === "copy" || name === "cut" || name === "paste")
|
|
167
|
+
return { kind: "named", name: "ClipboardEvent" };
|
|
168
|
+
return { kind: "named", name: "Event" };
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=web-types.js.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