marko 6.3.42 → 6.3.44
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/cheatsheet.md +5 -4
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/controllable-input.feat.js +1 -1
- package/dist/debug/dom/controllable-input.feat.mjs +1 -1
- package/dist/debug/dom/controllable-open.feat.js +1 -1
- package/dist/debug/dom/controllable-open.feat.mjs +1 -1
- package/dist/debug/dom/controllable-select.feat.js +1 -1
- package/dist/debug/dom/controllable-select.feat.mjs +1 -1
- package/dist/debug/dom/controllable-textarea.feat.js +1 -1
- package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/debug/dom/controllable.feat.js +1 -1
- package/dist/debug/dom/controllable.feat.mjs +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/debug/dom/placeholder.feat.js +1 -1
- package/dist/debug/dom/placeholder.feat.mjs +1 -1
- package/dist/debug/{dom-BbtmY5_5.js → dom-DBuLwSOh.js} +10 -0
- package/dist/debug/{dom-DYV177a1.mjs → dom-ky42a_qY.mjs} +5 -1
- package/dist/debug/dom.js +2 -1
- package/dist/debug/dom.mjs +2 -2
- package/dist/dom/catch.feat.js +3 -3
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/controllable-input.feat.js +1 -1
- package/dist/dom/controllable-input.feat.mjs +1 -1
- package/dist/dom/controllable-open.feat.js +1 -1
- package/dist/dom/controllable-open.feat.mjs +1 -1
- package/dist/dom/controllable-select.feat.js +1 -1
- package/dist/dom/controllable-select.feat.mjs +1 -1
- package/dist/dom/controllable-textarea.feat.js +1 -1
- package/dist/dom/controllable-textarea.feat.mjs +1 -1
- package/dist/dom/controllable.feat.js +1 -1
- package/dist/dom/controllable.feat.mjs +1 -1
- package/dist/dom/dynamic-tag-var.feat.js +2 -2
- package/dist/dom/dynamic-tag-var.feat.mjs +2 -2
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +2 -2
- package/dist/dom/signals.d.ts +1 -0
- package/dist/{dom-BVNolGe1.mjs → dom-BSAs0ur8.mjs} +5 -2
- package/dist/{dom-BfloYt04.js → dom-DHJCbngT.js} +46 -38
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +21 -21
- package/dist/dom.mjs +2 -2
- package/dist/html.js +3 -3
- package/dist/html.mjs +3 -3
- package/dist/translator/index.js +59 -12
- package/dist/translator/util/constants/structure-kind.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +5 -1
- package/dist/translator/util/structure.d.ts +1 -0
- package/dist/translator/util/tag-name-type.d.ts +1 -0
- package/dist/translator/visitors/tag/custom-tag.d.ts +1 -0
- package/package.json +4 -4
package/cheatsheet.md
CHANGED
|
@@ -7,17 +7,17 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
|
|
|
7
7
|
1. Text interpolation: `${expr}` inside tag bodies. A bare line at the template root parses as a tag (concise mode): `Welcome aboard` fails to compile, but `p is a tag` compiles **silently** to `<p is a tag></p>`, since any line starting with a real tag name loses its words to attributes. Wrap text in an element (`<p>Welcome aboard</p>`) or prefix the line with `--` and a space (`-- Welcome ${name}`). Attributes take raw JS after `=` with no braces or quotes: `<div title=user.name data-n=1 + 1>`.
|
|
8
8
|
2. A top-level `>` hugging its operand in an attribute value **ends the tag** silently: `<button disabled=count>=8 onClick() {…}>More</button>` is `disabled=count` plus the text `=8 onClick() {…}>`, so the handler never binds. Space a `>=` (`disabled=count >= 8`), and parenthesize a bare `>` comparison (`hidden=(a > b)`) and a TS type argument `<let/s=(new Set<string>())>`. Do not move the type onto the tag variable instead: `<let/s:Set<string>=new Set()>` compiles but fails type-check with TS2322 (the annotation does not flow into the initializer). A `>` nested inside `(…)`/`{…}`/`[…]` is safe (`class={ big: n > 1 }`). `<` never closes a tag (`disabled=count<=1` is fine).
|
|
9
9
|
3. State: `<let/name=initial>` (slash then var name!). Update by plain assignment in an event handler: `count++`, `text = "hi"`. No setState, no hooks.
|
|
10
|
-
4. Derived values: `<const/total=items.length * price>` auto-recomputes. Never use an effect to derive state.
|
|
10
|
+
4. Derived values: `<const/total=items.length * price>` auto-recomputes. Never use an effect to derive state. A tag variable is whatever the tag returns, not the attribute you passed. `<let/draft=input.text>` re-runs on every `input.text` change but returns state it controls, so `draft` keeps your edits. Pick by intent: recomputes → `<const>`, seeds then diverges → `<let>`. A `<let>` you never assign is just a frozen `<const>`. Updates batch: mid-handler a reassigned `<let>` reads current but its derived `<const>` reads stale, so recompute from the `<let>`.
|
|
11
11
|
5. Never mutate state in place: `items.push(x)` does not update the UI. Always reassign:
|
|
12
12
|
- add: `items = items.concat(x)`
|
|
13
13
|
- remove: `items = items.toSpliced(i, 1)`
|
|
14
14
|
- update: `items = items.toSpliced(i, 1, { ...item, done: true })`
|
|
15
15
|
- object: `user = { ...user, name }`
|
|
16
16
|
6. Events: method shorthand `onClick() { ... }` or `onClick=fn`. Handlers receive `(event, element)`; delegation means the element is the second parameter, not `event.currentTarget`: `onSubmit(e) { e.preventDefault(); save() }`, `onClick(e, el) { el.focus() }`. Don't sync input values through `onInput`/`onChange`; that's what the change handlers below are for. Prefix with `async` to `await` in the body: `async onClick() { await save() }`.
|
|
17
|
-
7. Native inputs are uncontrolled by default: `value=` sets the default value — later writes update what `form.reset()` restores, never a dirty field's display. Adding the matching `*Change` handler is what makes them controlled: `valueChange` on `<input>`/`<textarea>`/`<select>`, `checkedChange` on checkboxes/radios, `openChange` on `<details>`/`<dialog>`. `value:=text` is the shorthand for `value=text valueChange(v) { text = v }`. (`<textarea value:=text/>`: value attribute, not body.)
|
|
17
|
+
7. Native inputs are uncontrolled by default: `value=` sets the default value — later writes update what `form.reset()` restores, never a dirty field's display. Adding the matching `*Change` handler is what makes them controlled: `valueChange` on `<input>`/`<textarea>`/`<select>`, `checkedChange` on checkboxes/radios, `openChange` on `<details>`/`<dialog>`. `value:=text` is the shorthand for `value=text valueChange(v) { text = v }`. (`<textarea value:=text/>`: value attribute, not body.) `:=` differs by operand: on an identifier (`value:=text`) it assigns that variable; on a member expression (`<let/count:=input.count>` in a child) it wires `input.countChange`, so the child is controlled when the parent passes that handler and keeps its own state when it doesn't.
|
|
18
18
|
8. Transform in the handler when needed; number inputs give strings: `<input type="number" value=n valueChange(v) { n = +v }>`, or `value:parseFloat:=n`.
|
|
19
19
|
9. Radio/checkbox groups: `checkedValue:=picked` on each input (shared var, distinct `value=`); the match is checked; array var for multi-checkbox. Dropdown: `<select value:=picked>`.
|
|
20
|
-
10. Module-level values and
|
|
20
|
+
10. Module-level values, helpers and type aliases need `static`: `static const LIMIT = 10`, `static function fmt(n) {…}`, `static type Row = {…}`. Without it `function fmt(n) {` parses as a tag: ``Unable to find entry point for custom tag `<function>` ``, an error that never says `static`. Prefer it to `<const>` for anything that never changes: `<const/LIMIT=10>` emits a per-instance signal plus a `$setup` call. `server`/`client` narrow `static` to one platform (`client import { Chart } from "chart"`); the binding is `undefined` on the other, so read a `client` one only from `<script>`/handlers/`<lifecycle>` — reading it while rendering throws `is not a function` during SSR.
|
|
21
21
|
|
|
22
22
|
## Canonical component
|
|
23
23
|
|
|
@@ -69,7 +69,7 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
|
|
|
69
69
|
<show=open> stays mounted, keeps state (form drafts) when hidden </show>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
`<if>` destroys/rebuilds its content; `<show>`
|
|
72
|
+
`<if>` destroys/rebuilds its content; `<show>` renders it and hides it, on the server too (use for toggles that must keep state).
|
|
73
73
|
|
|
74
74
|
## Async (`<await>`)
|
|
75
75
|
|
|
@@ -202,6 +202,7 @@ Each left-hand habit is an error or silently wrong.
|
|
|
202
202
|
| `$ const y = x * 2;` (scriptlets are removed) | `<const/y=x * 2>` |
|
|
203
203
|
| `<let/n=a + b>` for a value that should recompute | `<const/n=a + b>`; `<let>` seeds an initial value, then de-syncs by design |
|
|
204
204
|
| `function fmt(n) {…}` / `const LIMIT = 10` at module level | `static function fmt(n) {…}` / `static const LIMIT = 10` |
|
|
205
|
+
| `type Row = {…}` at module level | `static type Row = {…}` |
|
|
205
206
|
| `<let x=0>` | `<let/x=0>` |
|
|
206
207
|
| `<if(cond)>` | `<if=cond>` |
|
|
207
208
|
| `items.push(x)` | `items = items.concat(x)` |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { An as PendingRenders, Cn as ClosestBranch, On as ParentBranch, bn as Pending, en as caughtError, g as renderCatch, kn as PendingEffects, nn as placeholderShown, tn as installCatch, xn as Scope } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/catch.feat.ts
|
|
3
3
|
const handlePendingTry = (fn, scope, branch) => {
|
|
4
4
|
while (branch) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/controllable-input.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
|
|
5
5
|
require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/controllable-input.feat.ts
|
|
3
3
|
controllableScripts[0] = _attr_input_checked_script;
|
|
4
4
|
controllableScripts[1] = _attr_input_checkedValue_script;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/controllable-open.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/controllable-select.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/controllable-textarea.feat.ts
|
|
4
4
|
require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
|
|
5
5
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-
|
|
1
|
+
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/dynamic-tag-var.feat.ts
|
|
4
4
|
const elementGetter = (branch) => () => require_control_flow._el_read(branch[require_control_flow.StartNode]);
|
|
5
5
|
require_control_flow.installDynamicTagVar((branch) => branch[require_control_flow.TagVariable](elementGetter(branch)));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mn as TagVariable, Ot as _el_read,
|
|
1
|
+
import { Mn as StartNode, Nn as TagVariable, Ot as _el_read, Xt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, m as installDynamicTagVar } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/dynamic-tag-var.feat.ts
|
|
3
3
|
const elementGetter = (branch) => () => _el_read(branch[StartNode]);
|
|
4
4
|
installDynamicTagVar((branch) => branch[TagVariable](elementGetter(branch)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_control_flow = require("../dom-
|
|
2
|
+
const require_control_flow = require("../dom-DBuLwSOh.js");
|
|
3
3
|
//#region src/dom/placeholder.feat.ts
|
|
4
4
|
require_control_flow.registeredValues[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
5
5
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as destroyBranch, St as registeredValues, Zt as PLACEHOLDER_DISMISS_REGISTER_ID, jn as PlaceholderBranch } from "../dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
registeredValues[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
4
4
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -773,6 +773,10 @@ function _script(id, fn) {
|
|
|
773
773
|
queueEffect(scope, fn);
|
|
774
774
|
};
|
|
775
775
|
}
|
|
776
|
+
function _global_read($global, key) {
|
|
777
|
+
if (!(key in $global)) console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`. Add \`${key}\` to \`serializedGlobals\` at the render call.`);
|
|
778
|
+
return $global[key];
|
|
779
|
+
}
|
|
776
780
|
function _el_read(value) {
|
|
777
781
|
if (rendering) _el_read_error();
|
|
778
782
|
return value;
|
|
@@ -2548,6 +2552,12 @@ Object.defineProperty(exports, "_for_until", {
|
|
|
2548
2552
|
return _for_until;
|
|
2549
2553
|
}
|
|
2550
2554
|
});
|
|
2555
|
+
Object.defineProperty(exports, "_global_read", {
|
|
2556
|
+
enumerable: true,
|
|
2557
|
+
get: function() {
|
|
2558
|
+
return _global_read;
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2551
2561
|
Object.defineProperty(exports, "_hoist", {
|
|
2552
2562
|
enumerable: true,
|
|
2553
2563
|
get: function() {
|
|
@@ -772,6 +772,10 @@ function _script(id, fn) {
|
|
|
772
772
|
queueEffect(scope, fn);
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
|
+
function _global_read($global, key) {
|
|
776
|
+
if (!(key in $global)) console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`. Add \`${key}\` to \`serializedGlobals\` at the render call.`);
|
|
777
|
+
return $global[key];
|
|
778
|
+
}
|
|
775
779
|
function _el_read(value) {
|
|
776
780
|
if (rendering) _el_read_error();
|
|
777
781
|
return value;
|
|
@@ -2073,4 +2077,4 @@ function byFirstArg(name) {
|
|
|
2073
2077
|
return name;
|
|
2074
2078
|
}
|
|
2075
2079
|
//#endregion
|
|
2076
|
-
export { _attrs_script as $,
|
|
2080
|
+
export { _attrs_script as $, $signalReset as $t, _attr_input_value_script as A, PendingRenders as An, _for_selector as At, _attr as B, _return_change as Bt, _attr_input_checkedValue_script as C, ClosestBranch as Cn, withLazy as Ct, _attr_input_value_attribute_default as D, Load as Dn, _const as Dt, _attr_input_value as E, Global as En, _closure_get as Et, _controllable_open as F, _if_closure as Ft, _attr_nonce as G, destroyBranch as Gt, _attr_class_item as H, _var as Ht, _controllable_select as I, _let as It, _attr_style_items as J, syncGen as Jt, _attr_style as K, insertBranchBefore as Kt, _controllable_textarea as L, _let_change as Lt, _attr_select_value_default as M, StartNode as Mn, _hoist as Mt, _attr_select_value_script as N, TagVariable as Nn, _hoist_resume as Nt, _attr_input_value_default as O, ParentBranch as On, _el_read as Ot, _controllable_input as P, _id as Pt, _attrs_partial_content as Q, $signal as Qt, controllableRenders as R, _or as Rt, _attr_input_checkedValue_default as S, AwaitCounter as Sn, registeredValues as St, _attr_input_checked_script as T, Gen$1 as Tn, _closure as Tt, _attr_class_items as U, _var_change as Ut, _attr_class as V, _script as Vt, _attr_content as W, _assert_init as Wt, _attrs_content as X, DYNAMIC_TAG_VAR_REGISTER_ID as Xt, _attrs as Y, _on as Yt, _attrs_partial as Z, PLACEHOLDER_DISMISS_REGISTER_ID as Zt, _attr_details_or_dialog_open as _, Owner as _n, _var_resume as _t, _for_in as a, queueEffect as an, _text_content as at, _attr_input_checked as b, Pending as bn, initEmbedded as bt, _for_until as c, runId as cn, toInsertNode as ct, _show as d, forTo as dn, _content_resume as dt, caughtError as en, _html as et, _try as f, forUntil as fn, createAndSetupBranch as ft, renderCatch as g, Clone as gn, _resume as gt, patchDynamicTag as h, _call as hn, _el as ht, _dynamic_tag_content as i, queueAsyncRender as in, _text as it, _attr_select_value as j, PlaceholderBranch as jn, _global_read as jt, _attr_input_value_dynamic_default as k, PendingEffects as kn, _for_closure as kt, _if as l, forIn as ln, _content as lt, installDynamicTagVar as m, _hoist_read_error as mn, setupBranch as mt, _await_promise as n, placeholderShown as nn, _style_rule_item as nt, _for_of as o, run as on, _to_text as ot, addAwaitCounter as p, _assert_hoist as pn, createBranch as pt, _attr_style_item as q, removeAndDestroyBranch as qt, _dynamic_tag as r, prepareEffects as rn, _style_shell as rt, _for_to as s, runEffects as sn, insertChildNodes as st, _await_content as t, installCatch as tn, _lifecycle as tt, _resume_dynamic_tag as u, forOf as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, Params as vn, getRegisteredWithScope as vt, _attr_input_checked_default as w, EndNode as wn, _child_setup as wt, _attr_input_checkedValue as x, Scope as xn, ready as xt, _attr_details_or_dialog_open_script as y, Setup as yn, init as yt, controllableScripts as z, _return as zt };
|
package/dist/debug/dom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_control_flow = require("./dom-
|
|
3
|
+
const require_control_flow = require("./dom-DBuLwSOh.js");
|
|
4
4
|
//#region src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
|
@@ -366,6 +366,7 @@ exports._for_of = require_control_flow._for_of;
|
|
|
366
366
|
exports._for_selector = require_control_flow._for_selector;
|
|
367
367
|
exports._for_to = require_control_flow._for_to;
|
|
368
368
|
exports._for_until = require_control_flow._for_until;
|
|
369
|
+
exports._global_read = require_control_flow._global_read;
|
|
369
370
|
exports._hoist = require_control_flow._hoist;
|
|
370
371
|
exports._hoist_read_error = require_control_flow._hoist_read_error;
|
|
371
372
|
exports._hoist_resume = require_control_flow._hoist_resume;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_selector, B as _attr, Bt as
|
|
1
|
+
import { $ as _attrs_script, $t as $signalReset, A as _attr_input_value_script, At as _for_selector, B as _attr, Bt as _return_change, C as _attr_input_checkedValue_script, Ct as withLazy, D as _attr_input_value_attribute_default, Dn as Load, Dt as _const, E as _attr_input_value, En as Global, Et as _closure_get, F as _controllable_open, Ft as _if_closure, G as _attr_nonce, Gt as destroyBranch, H as _attr_class_item, Ht as _var, I as _controllable_select, It as _let, J as _attr_style_items, Jt as syncGen, K as _attr_style, Kt as insertBranchBefore, L as _controllable_textarea, Lt as _let_change, M as _attr_select_value_default, Mn as StartNode, Mt as _hoist, N as _attr_select_value_script, Nn as TagVariable, Nt as _hoist_resume, O as _attr_input_value_default, Ot as _el_read, P as _controllable_input, Pt as _id, Q as _attrs_partial_content, Qt as $signal, Rt as _or, S as _attr_input_checkedValue_default, T as _attr_input_checked_script, Tt as _closure, U as _attr_class_items, Ut as _var_change, V as _attr_class, Vt as _script, W as _attr_content, Wt as _assert_init, X as _attrs_content, Y as _attrs, Yt as _on, Z as _attrs_partial, _ as _attr_details_or_dialog_open, _n as Owner, _t as _var_resume, a as _for_in, an as queueEffect, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as runId, ct as toInsertNode, d as _show, dn as forTo, dt as _content_resume, et as _html, f as _try, fn as forUntil, ft as createAndSetupBranch, g as renderCatch, gn as Clone, gt as _resume, h as patchDynamicTag, hn as _call, ht as _el, i as _dynamic_tag_content, in as queueAsyncRender, it as _text, j as _attr_select_value, jt as _global_read, k as _attr_input_value_dynamic_default, kt as _for_closure, l as _if, ln as forIn, lt as _content, mn as _hoist_read_error, mt as setupBranch, n as _await_promise, nt as _style_rule_item, o as _for_of, on as run, ot as _to_text, p as addAwaitCounter, pn as _assert_hoist, pt as createBranch, q as _attr_style_item, qt as removeAndDestroyBranch, r as _dynamic_tag, rn as prepareEffects, rt as _style_shell, s as _for_to, sn as runEffects, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forOf, ut as _content_closures, v as _attr_details_or_dialog_open_default, vn as Params, vt as getRegisteredWithScope, w as _attr_input_checked_default, wn as EndNode, wt as _child_setup, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yn as Setup, yt as init, zt as _return } from "./dom-ky42a_qY.mjs";
|
|
2
2
|
//#region src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
|
@@ -294,4 +294,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
294
294
|
return document.querySelector(selector) || (console.warn(`A lazy load trigger could not find an element matching "${selector}". The module was loaded immediately.`), resolve());
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
|
-
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
|
297
|
+
export { $signal, $signalReset, _assert_hoist, _assert_init, _attr, _attr_class, _attr_class_item, _attr_class_items, _attr_content, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_details_or_dialog_open_default as _attr_details_open_default, _attr_details_or_dialog_open_default as _attr_dialog_open_default, _attr_details_or_dialog_open_script as _attr_details_open_script, _attr_details_or_dialog_open_script as _attr_dialog_open_script, _attr_input_checked, _attr_input_checkedValue, _attr_input_checkedValue_default, _attr_input_checkedValue_script, _attr_input_checked_default, _attr_input_checked_script, _attr_input_value, _attr_input_value as _attr_textarea_value, _attr_input_value_attribute_default, _attr_input_value_default, _attr_input_value_default as _attr_textarea_value_default, _attr_input_value_dynamic_default, _attr_input_value_script, _attr_input_value_script as _attr_textarea_value_script, _attr_nonce, _attr_select_value, _attr_select_value_default, _attr_select_value_script, _attr_style, _attr_style_item, _attr_style_items, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, _attrs_script, _await_content, _await_promise, _call, _child_setup, _closure, _closure_get, _const, _content, _content_closures, _content_resume, _controllable_input, _controllable_open, _controllable_select, _controllable_textarea, _dynamic_tag, _dynamic_tag_content, _el, _el_read, _for_closure, _for_in, _for_of, _for_selector, _for_to, _for_until, _global_read, _hoist, _hoist_read_error, _hoist_resume, _html, _id, _if, _if_closure, _let, _let_change, _lifecycle, _load_event_trigger, _load_idle_trigger, _load_media_trigger, _load_race_trigger, _load_setup, _load_signal, _load_template, _load_visible_trigger, _on, _or, _resume, _resume_dynamic_tag, _return, _return_change, _script, _show, _style_rule_item, _style_shell, _template, _text, _text_content, _to_text, _try, _var, _var_change, _var_resume, attrTag, attrTags, compat, forIn, forOf, forTo, forUntil, init, initEmbedded, ready, run };
|
package/dist/dom/catch.feat.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DHJCbngT.js"), handlePendingTry = (fn, scope, branch) => {
|
|
2
2
|
for (; branch;) {
|
|
3
3
|
if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
|
|
4
4
|
branch = branch.N;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
7
|
//#region src/dom/catch.feat.ts
|
|
8
|
-
require_control_flow
|
|
9
|
-
if (checkPending || require_control_flow.
|
|
8
|
+
require_control_flow.$t((runEffects) => (effects, checkPending = require_control_flow.en.has(effects)) => {
|
|
9
|
+
if (checkPending || require_control_flow.Qt.has(effects)) {
|
|
10
10
|
let i = 0, fn, scope, branch;
|
|
11
11
|
for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
|
|
12
12
|
} else runEffects(effects);
|
package/dist/dom/catch.feat.mjs
CHANGED
|
@@ -4,7 +4,7 @@ let handlePendingTry = (fn, scope, branch) => {
|
|
|
4
4
|
branch = branch.N;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
import { $t as
|
|
7
|
+
import { $t as installCatch, Qt as caughtError, en as placeholderShown, g as renderCatch } from "../dom-BSAs0ur8.mjs";
|
|
8
8
|
//#region src/dom/catch.feat.ts
|
|
9
9
|
installCatch((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
|
|
10
10
|
if (checkPending || caughtError.has(effects)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DHJCbngT.js");
|
|
2
2
|
require_control_flow.z[0] = require_control_flow.T, require_control_flow.z[1] = require_control_flow.C, require_control_flow.z[2] = require_control_flow.A;
|
|
3
3
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, C as _attr_input_checkedValue_script, T as _attr_input_checked_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { y as _attr_details_or_dialog_open_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
//#region src/dom/controllable-open.feat.ts
|
|
3
3
|
controllableScripts[4] = _attr_details_or_dialog_open_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { N as _attr_select_value_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
//#region src/dom/controllable-select.feat.ts
|
|
3
3
|
controllableScripts[3] = _attr_select_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-
|
|
1
|
+
import { A as _attr_input_value_script, z as controllableScripts } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
//#region src/dom/controllable-textarea.feat.ts
|
|
3
3
|
controllableScripts[2] = _attr_input_value_script;
|
|
4
4
|
//#endregion
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DHJCbngT.js");
|
|
2
2
|
require("./controllable-input.feat.js"), require("./controllable-open.feat.js"), require("./controllable-select.feat.js"), require_control_flow.R.INPUT = require_control_flow.P, require_control_flow.R.TEXTAREA = require_control_flow.L, require_control_flow.R.SELECT = require_control_flow.I, require_control_flow.R.DETAILS = require_control_flow.R.DIALOG = require_control_flow.F;
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-
|
|
1
|
+
import { F as _controllable_open, I as _controllable_select, L as _controllable_textarea, P as _controllable_input, R as controllableRenders } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
import "./controllable-input.feat.mjs";
|
|
3
3
|
import "./controllable-open.feat.mjs";
|
|
4
4
|
import "./controllable-select.feat.mjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
2
|
-
require_control_flow.m((branch) => branch.T(elementGetter(branch))), require_control_flow.gt("
|
|
1
|
+
let require_control_flow = require("../dom-DHJCbngT.js"), elementGetter = (branch) => () => branch.S;
|
|
2
|
+
require_control_flow.m((branch) => branch.T(elementGetter(branch))), require_control_flow.gt("_e", elementGetter);
|
|
3
3
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
let elementGetter = (branch) => () => branch.S;
|
|
2
|
-
import { gt as _resume, m as installDynamicTagVar } from "../dom-
|
|
3
|
-
installDynamicTagVar((branch) => branch.T(elementGetter(branch))), _resume("
|
|
2
|
+
import { gt as _resume, m as installDynamicTagVar } from "../dom-BSAs0ur8.mjs";
|
|
3
|
+
installDynamicTagVar((branch) => branch.T(elementGetter(branch))), _resume("_e", elementGetter);
|
|
4
4
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-DHJCbngT.js");
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
|
-
require_control_flow.St.
|
|
4
|
-
tryBranch.P &&= (require_control_flow.
|
|
3
|
+
require_control_flow.St._f = (tryBranch) => {
|
|
4
|
+
tryBranch.P &&= (require_control_flow.Gt(tryBranch.P), 0);
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as destroyBranch, St as registeredValues } from "../dom-BSAs0ur8.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
|
-
registeredValues.
|
|
3
|
+
registeredValues._f = (tryBranch) => {
|
|
4
4
|
tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
|
|
5
5
|
};
|
|
6
6
|
//#endregion
|
package/dist/dom/signals.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare function _return_change(scope: Scope, changeHandler?: ((value: un
|
|
|
26
26
|
export declare const _var_change: (scope: Scope, value: unknown, name?: string) => void;
|
|
27
27
|
export declare function _id(scope: Scope, accessor?: Accessor): string;
|
|
28
28
|
export declare function _script(id: string, fn: (scope: Scope) => void): (scope: Scope) => void;
|
|
29
|
+
export declare function _global_read($global: Record<string, unknown>, key: string): unknown;
|
|
29
30
|
export declare function _el_read<T>(value: T): T;
|
|
30
31
|
type Hoistable<T> = (...args: unknown[]) => T;
|
|
31
32
|
type Hoisted<T> = Hoistable<T> & Iterable<T>;
|
|
@@ -80,7 +80,7 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
80
80
|
return (scope, renderer) => {
|
|
81
81
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = rendererKey(renderer)) && (setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch), renderer?.f && subscribeToScopeSet(renderer.e, renderer.f, scope[childScopeAccessor])), renderer) for (let accessor in renderer.g) renderer.g[accessor](scope[childScopeAccessor], renderer.h[accessor]);
|
|
82
82
|
};
|
|
83
|
-
}), bindNativeTagVar, _resume_dynamic_tag = /*@__PURE__*/ withBranches(() => _resume("
|
|
83
|
+
}), bindNativeTagVar, _resume_dynamic_tag = /*@__PURE__*/ withBranches(() => _resume("_d", dynamicTagScript)), loop = /*@__PURE__*/ withBranches((forEach) => (nodeAccessor, template, walks, setup, params) => {
|
|
84
84
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
85
85
|
let scopesAccessor = "A" + nodeAccessor, keyedScopesAccessor = "O" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
86
86
|
return (scope, value) => {
|
|
@@ -475,6 +475,9 @@ function _script(id, fn) {
|
|
|
475
475
|
queueEffect(scope, fn);
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
+
function _global_read($global, key) {
|
|
479
|
+
return key in $global || console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`. Add \`${key}\` to \`serializedGlobals\` at the render call.`), $global[key];
|
|
480
|
+
}
|
|
478
481
|
function _el_read(value) {
|
|
479
482
|
return value;
|
|
480
483
|
}
|
|
@@ -1150,4 +1153,4 @@ function byFirstArg(name) {
|
|
|
1150
1153
|
return name;
|
|
1151
1154
|
}
|
|
1152
1155
|
//#endregion
|
|
1153
|
-
export { _attrs_script as $,
|
|
1156
|
+
export { _attrs_script as $, installCatch as $t, _attr_input_value_script as A, _for_selector as At, _attr as B, _return_change as Bt, _attr_input_checkedValue_script as C, withLazy as Ct, _attr_input_value_attribute_default as D, _const as Dt, _attr_input_value as E, _closure_get as Et, _controllable_open as F, _if_closure as Ft, _attr_nonce as G, destroyBranch as Gt, _attr_class_item as H, _var as Ht, _controllable_select as I, _let as It, _attr_style_items as J, syncGen as Jt, _attr_style as K, insertBranchBefore as Kt, _controllable_textarea as L, _let_change as Lt, _attr_select_value_default as M, _hoist as Mt, _attr_select_value_script as N, _hoist_resume as Nt, _attr_input_value_default as O, _el_read as Ot, _controllable_input as P, _id as Pt, _attrs_partial_content as Q, caughtError as Qt, controllableRenders as R, _or as Rt, _attr_input_checkedValue_default as S, registeredValues as St, _attr_input_checked_script as T, _closure as Tt, _attr_class_items as U, _var_change as Ut, _attr_class as V, _script as Vt, _attr_content as W, _assert_init as Wt, _attrs_content as X, $signal as Xt, _attrs as Y, _on as Yt, _attrs_partial as Z, $signalReset as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a, runEffects as an, _text_content as at, _attr_input_checked as b, initEmbedded as bt, _for_until as c, forOf as cn, toInsertNode as ct, _show as d, _assert_hoist as dn, _content_resume as dt, placeholderShown as en, _html as et, _try as f, _hoist_read_error as fn, createAndSetupBranch as ft, renderCatch as g, _resume as gt, patchDynamicTag as h, _el as ht, _dynamic_tag_content as i, run as in, _text as it, _attr_select_value as j, _global_read as jt, _attr_input_value_dynamic_default as k, _for_closure as kt, _if as l, forTo as ln, _content as lt, installDynamicTagVar as m, decodeAccessor as mn, setupBranch as mt, _await_promise as n, queueAsyncRender as nn, _style_rule_item as nt, _for_of as o, runId as on, _to_text as ot, addAwaitCounter as p, _call as pn, createBranch as pt, _attr_style_item as q, removeAndDestroyBranch as qt, _dynamic_tag as r, queueEffect as rn, _style_shell as rt, _for_to as s, forIn as sn, insertChildNodes as st, _await_content as t, prepareEffects as tn, _lifecycle as tt, _resume_dynamic_tag as u, forUntil as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, getRegisteredWithScope as vt, _attr_input_checked_default as w, _child_setup as wt, _attr_input_checkedValue as x, ready as xt, _attr_details_or_dialog_open_script as y, init as yt, controllableScripts as z, _return as zt };
|