marko 6.3.47 → 6.3.48
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 +19 -16
- package/dist/common/accessor.d.ts +0 -3
- package/dist/common/accessor.debug.d.ts +0 -3
- 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-BheMBjYT.js → dom-CA_HiiES.js} +6 -0
- package/dist/debug/{dom-DyBeisho.mjs → dom-DBMLPLeE.mjs} +1 -1
- package/dist/debug/dom.js +20 -24
- package/dist/debug/dom.mjs +20 -24
- package/dist/dom/catch.feat.js +1 -1
- 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 +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-DprILxYO.js → dom-BfydlrCq.js} +16 -11
- package/dist/{dom-BbknkVDz.mjs → dom-UwNQ-AXt.mjs} +1 -1
- package/dist/dom.js +20 -20
- package/dist/dom.mjs +14 -14
- package/package.json +2 -2
- package/dist/common/constants/load-signal-value.d.ts +0 -5
- package/dist/common/constants/load-signal-value.debug.d.ts +0 -5
package/cheatsheet.md
CHANGED
|
@@ -4,20 +4,20 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
|
|
|
4
4
|
|
|
5
5
|
## Golden rules
|
|
6
6
|
|
|
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
|
|
8
|
-
2. A top-level `>` hugging its operand in an attribute value
|
|
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
|
+
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`); parenthesize a bare `>` comparison (`hidden=(a > b)`) and a TS type argument (`<let/s=(new Set<string>())>`, else it parses as `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. A tag variable is whatever the tag returns, not the attribute
|
|
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 passed to it. `<let/draft=input.text>` re-runs on every `input.text` change but returns state it controls, so `draft` keeps its edits; only a controllable `<let>` (`valueChange=`, or `<let/draft:=input.text>`) takes the new value. Pick by intent: recomputes → `<const>`, seeds then diverges → `<let>`. A `<let>` that is never assigned 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
|
|
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`. Uncommitted edits (debounce, commit on blur) never sync through a `<script>`; that is rule 4's derive-by-effect trap. Pair a controllable `<let/value:=input.value>` with `<let/pending=null>`, show `<const/draft=pending ?? value>`, collect with `valueChange(v) { pending = v }`, and commit by assigning `value = pending; pending = null`. Prefer that to calling `input.valueChange(...)`, which throws unless every caller controls the tag.
|
|
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, helpers and type aliases need `static`: `static const LIMIT = 10`, `static function fmt(n) {…}`, `static type Row = {…}`.
|
|
20
|
+
10. Module-level values, helpers and type aliases need `static`: `static const LIMIT = 10`, `static function fmt(n) {…}`, `static type Row = {…}`. Prefer it to `<const>` for anything that never changes: `<const/LIMIT=10>` runs per instance, `static` hoists it to a module constant. `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
|
|
|
@@ -58,13 +58,14 @@ Marko 6 = HTML superset, not JSX and not Marko 4/5 syntax. `.marko` files are co
|
|
|
58
58
|
## Control flow
|
|
59
59
|
|
|
60
60
|
```marko
|
|
61
|
-
<if=(count > 10)> A </if> // parenthesize comparisons; a
|
|
61
|
+
<if=(count > 10)> A </if> // parenthesize comparisons; a hugging `>` ends the tag (rule 2)
|
|
62
62
|
<else if=other> B </else>
|
|
63
63
|
<else> C </else>
|
|
64
64
|
|
|
65
65
|
<for|item, index| of=list by="id"> ${item.name} </for> // by keys the loop (no key= attr!)
|
|
66
|
-
<for|city| of=cities by=(city) => city> ${city} </for> // primitives: by takes a function
|
|
67
|
-
<for|i| from=0 until=5> ${i} </for> // 0..4
|
|
66
|
+
<for|city| of=cities by=(city) => city> ${city} </for> // primitives: by takes a function, evaluated before the loop
|
|
67
|
+
<for|i| from=0 until=5> ${i} </for> // 0..4 (to= is inclusive, step= optional)
|
|
68
|
+
<for|key, value| in=obj> ${key}=${value} </for> // object entries
|
|
68
69
|
|
|
69
70
|
<show=open> stays mounted, keeps state (form drafts) when hidden </show>
|
|
70
71
|
```
|
|
@@ -125,17 +126,20 @@ Don't fetch while rendering: start data loads early, pass the promise through th
|
|
|
125
126
|
</div>
|
|
126
127
|
```
|
|
127
128
|
|
|
128
|
-
- Repeated attr tags (many `<@tab ...>`) arrive as the singular prop `input.tab
|
|
129
|
+
- Repeated attr tags (many `<@tab ...>`) arrive as the singular prop `input.tab`: the first tab's attrs, made iterable, not an array: `input.tab[i]` and `input.tab.length` are undefined. To index or count, spread first: `<const/tabs=[...input.tab ?? []]>` then `tabs[active]`/`tabs.length`. Looping directly is fine: `<for|tab| of=input.tab>`.
|
|
130
|
+
- Text: `0` renders; `false`/`null`/`undefined`/`""`/`NaN` render nothing. `$!{html}` inserts raw HTML.
|
|
129
131
|
- Conditional attrs: `false`/`null` attrs are omitted from HTML. `aria-selected` etc. want strings: `aria-selected=(i === active && "true")`.
|
|
130
|
-
- `class=` / `style=` accept strings, objects, arrays: `class=["btn", { active }]`, `style={ color }` (single braces). `style=` keys are kebab-case CSS names (`{ "background-color": c }`)
|
|
132
|
+
- `class=` / `style=` accept strings, objects, arrays: `class=["btn", { active }]`, `style={ color }` (single braces). `style=` keys are kebab-case CSS names (`{ "background-color": c }`); camelCase keys are written verbatim. `...input` spreads attrs onto a tag; `content=` passes body content as an attr.
|
|
133
|
+
- `<define/Panel|input|>` declares a local tag inline; `<${Toolbar.Undo}/>` renders a dynamic tag (falsy name → content only).
|
|
134
|
+
- `<select value:=picked>`: every `<option>` needs `value=`; `multiple` binds an array.
|
|
131
135
|
- `<id/x>` mints a collision-free id for label/input wiring (`<label for=x>`/`<input id=x>`); don't hardcode ids in reusable tags; `<id/x=input.id>` reuses a caller's.
|
|
132
136
|
- Head tags render where written: a `<title>`/`<meta>`/`<link>` inside a nested component stays in the body, giving a second title or an inert canonical. `<head>` is already written by the time descendants render, so page meta has to be known before it: under @marko/run declare it in the route's `+meta.*` file and read `$global.meta` from the layout that owns `<head>`, otherwise pass it down or set it on `$global` at the render call.
|
|
133
137
|
|
|
134
138
|
## Sharing data (`$global`)
|
|
135
139
|
|
|
136
|
-
- Read request-scoped `$global` from any template, no threading: `${$global.messages.title}`. Otherwise
|
|
140
|
+
- Read request-scoped `$global` from any template, no threading: `${$global.messages.title}`. Otherwise pass data down through `input`.
|
|
137
141
|
- Populate at the render call: `template.render({ $global: { messages } })`. Under @marko/run a middleware's `return next({ messages })` merges into `$global.data`.
|
|
138
|
-
- `$global` is not serialized to the client by default. Mark any key the browser itself evaluates, e.g. an event handler, a `<script>`, markup the browser (re)creates, or a `<const>` that recomputes from state: `$global.serializedGlobals = { messages: true }` at the render call (under @marko/run, `context.serializedGlobals.data = true`; it ships `params`/`url` already). What the server already rendered needs no opt-in.
|
|
142
|
+
- `$global` is not serialized to the client by default. Mark any key the browser itself evaluates, e.g. an event handler, a `<script>`, markup the browser (re)creates, or a `<const>` that recomputes from state: `$global.serializedGlobals = { messages: true }` at the render call (under @marko/run, `context.serializedGlobals.data = true`; it ships `params`/`url` already). What the server already rendered needs no opt-in; a debug build logs an unserialized key read in the browser.
|
|
139
143
|
|
|
140
144
|
## Client-side effects
|
|
141
145
|
|
|
@@ -166,7 +170,7 @@ Imperative libs (charts, maps) needing mount/update/destroy: use `<lifecycle>`,
|
|
|
166
170
|
|
|
167
171
|
## Lazy loading
|
|
168
172
|
|
|
169
|
-
Defer a tag's JS into its own bundle until a trigger fires: `
|
|
173
|
+
Defer a tag's JS into its own bundle until a trigger fires: `visible#sel`, `idle`, `media(...)`, `on-click#sel` (combine with `|`), or `render` alone. Server HTML renders immediately; in the browser `<try>` shows a `@placeholder` while loading. Don't hand-roll an `IntersectionObserver`.
|
|
170
174
|
|
|
171
175
|
```marko
|
|
172
176
|
import PriceChart from "<price-chart>" with { load: "visible#chart" }
|
|
@@ -196,7 +200,7 @@ Each left-hand habit is an error or silently wrong.
|
|
|
196
200
|
| Wrong (React/Vue/Marko5 habit) | Right |
|
|
197
201
|
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
198
202
|
| `disabled=n>=8` (hugging `>` in a value) | `disabled=n >= 8` or `disabled=(n >= 8)`; a hugging `>` silently closes the tag |
|
|
199
|
-
| `<let/s=new Set<string>()>` (type argument in a value) | `<let/s=(new Set<string>())>`;
|
|
203
|
+
| `<let/s=new Set<string>()>` (type argument in a value) | `<let/s=(new Set<string>())>`; else it parses as `new Set() < string` |
|
|
200
204
|
| `{expr}` in markup, `className`, `key=`, `style={{...}}` | `${expr}`, `class`, `by=` on `<for>`, `style={...}` |
|
|
201
205
|
| `onClick={() => ...}` / `@click` / `on-click("name")` | `onClick() { ... }` |
|
|
202
206
|
| `const [x, setX] = useState()` / `state` / `class {}` block | `<let/x=0>` then `x = 1` |
|
|
@@ -213,18 +217,17 @@ Each left-hand habit is an error or silently wrong.
|
|
|
213
217
|
| `el.focus()` on a ref | `el().focus()` inside `<script>`/handler |
|
|
214
218
|
| `input.tab[0]` / `input.tab.length` | `[...input.tab ?? []]` first (attr tags are iterables, not arrays) |
|
|
215
219
|
| bare text on its own line at template root | wrap in an element (`<p>...`), or prefix the line with `--` and a space |
|
|
216
|
-
| `by=item` using the loop variable | `by="propName"` or `by=(item) => key`; `by=` is evaluated outside the loop |
|
|
217
220
|
| `onInput(e) { q = e.target.value }` to sync an input | `value:=q`; the change handler owns the value |
|
|
218
221
|
| `<script>` syncing a draft field back from `value` | `<const/draft=pending ?? value>`; a `<let>` holds only the uncommitted edit |
|
|
219
222
|
| fetching inside the component that renders the data | start the promise early (route handler / top of template), pass it down to `<await>` |
|
|
220
223
|
| `style={ backgroundColor: c }` (camelCase keys) | `style={ "background-color": c }` (kebab-case) |
|
|
221
224
|
| `this.querySelector` / `this.getRootNode()` in `<script>` | element ref getter: `<div/el>` then `el()` (there is no `this`) |
|
|
222
|
-
| `<div/my-el>` / `<input/card-input>` (hyphen in tag var) | valid JS identifier: `<div/myEl>` (the error won't name the hyphen) |
|
|
223
225
|
| hand-rolled radios `checked=x checkedChange(v){…}` | `checkedValue:=picked` on each radio (shared var, distinct `value=`) |
|
|
224
226
|
| hand-rolled `IntersectionObserver` to defer a widget's JS | `import W from "<w>" with { load: "visible#sel" }` |
|
|
225
227
|
| imperative lib wired through `<script>` mount + cleanup | `<lifecycle onMount/onUpdate/onDestroy>` (keeps `this` across all three) |
|
|
226
228
|
| `createContext`/provider to share data | `input` (prop drilling) or request-scoped `$global` |
|
|
227
229
|
| `<title>`/`<meta>` in a nested component | put page meta in the layout that owns `<head>`; head tags never hoist |
|
|
230
|
+
| `<option selected=...>` in a controlled `<select>` | `value=` on every option and `value:=picked` on the select |
|
|
228
231
|
| `$global.x` in client-reactive code, not allow-listed | `$global.serializedGlobals = { x: true }` first; otherwise the read is `undefined` |
|
|
229
232
|
| hand-namespaced global classes (`.my-card-title`) | `<style/styles>` + `class=styles.card` (scoped CSS modules) |
|
|
230
233
|
| `tsc --noEmit` to type check templates | `mtc`; `tsc` skips `.marko` files and exits 0 |
|
|
@@ -2,7 +2,6 @@ import * as AccessorPrefix from "./constants/accessor-prefix";
|
|
|
2
2
|
import * as AccessorProp from "./constants/accessor-prop";
|
|
3
3
|
import * as ClosureSignalProp from "./constants/closure-signal-prop";
|
|
4
4
|
import * as KeyedScopesProp from "./constants/keyed-scopes-prop";
|
|
5
|
-
import * as LoadSignalValue from "./constants/load-signal-value";
|
|
6
5
|
import * as PendingRenderProp from "./constants/pending-render-prop";
|
|
7
6
|
import * as RendererProp from "./constants/renderer-prop";
|
|
8
7
|
type AccessorPrefix = AccessorPrefix.Value;
|
|
@@ -17,5 +16,3 @@ type ClosureSignalProp = ClosureSignalProp.Value;
|
|
|
17
16
|
export { ClosureSignalProp };
|
|
18
17
|
type KeyedScopesProp = KeyedScopesProp.Value;
|
|
19
18
|
export { KeyedScopesProp };
|
|
20
|
-
type LoadSignalValue = LoadSignalValue.Value;
|
|
21
|
-
export { LoadSignalValue };
|
|
@@ -2,7 +2,6 @@ import * as AccessorPrefix from "./constants/accessor-prefix.debug";
|
|
|
2
2
|
import * as AccessorProp from "./constants/accessor-prop.debug";
|
|
3
3
|
import * as ClosureSignalProp from "./constants/closure-signal-prop.debug";
|
|
4
4
|
import * as KeyedScopesProp from "./constants/keyed-scopes-prop.debug";
|
|
5
|
-
import * as LoadSignalValue from "./constants/load-signal-value.debug";
|
|
6
5
|
import * as PendingRenderProp from "./constants/pending-render-prop.debug";
|
|
7
6
|
import * as RendererProp from "./constants/renderer-prop.debug";
|
|
8
7
|
type AccessorPrefix = AccessorPrefix.Value;
|
|
@@ -17,5 +16,3 @@ type ClosureSignalProp = ClosureSignalProp.Value;
|
|
|
17
16
|
export { ClosureSignalProp };
|
|
18
17
|
type KeyedScopesProp = KeyedScopesProp.Value;
|
|
19
18
|
export { KeyedScopesProp };
|
|
20
|
-
type LoadSignalValue = LoadSignalValue.Value;
|
|
21
|
-
export { LoadSignalValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { An as
|
|
1
|
+
import { An as ParentBranch, Cn as Scope, Mn as PendingRenders, Sn as Pending, Tn as ClosestBranch, g as renderCatch, jn as PendingEffects, nn as installCatch, rn as placeholderShown, tn as caughtError } from "../dom-DBMLPLeE.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-CA_HiiES.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-DBMLPLeE.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-CA_HiiES.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-DBMLPLeE.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-CA_HiiES.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-DBMLPLeE.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-CA_HiiES.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-DBMLPLeE.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-DBMLPLeE.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-CA_HiiES.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 {
|
|
1
|
+
import { Fn as TagVariable, Pn as StartNode, Zt as DYNAMIC_TAG_VAR_REGISTER_ID, gt as _resume, kt as _el_read, m as installDynamicTagVar } from "../dom-DBMLPLeE.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-CA_HiiES.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 { Ct as registeredValues, Kt as destroyBranch,
|
|
1
|
+
import { Ct as registeredValues, Kt as destroyBranch, Nn as PlaceholderBranch, Qt as PLACEHOLDER_DISMISS_REGISTER_ID } from "../dom-DBMLPLeE.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
registeredValues[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
|
|
4
4
|
if (tryBranch["#PlaceholderBranch"]) {
|
|
@@ -2873,6 +2873,12 @@ Object.defineProperty(exports, "queueEffect", {
|
|
|
2873
2873
|
return queueEffect;
|
|
2874
2874
|
}
|
|
2875
2875
|
});
|
|
2876
|
+
Object.defineProperty(exports, "queueRender", {
|
|
2877
|
+
enumerable: true,
|
|
2878
|
+
get: function() {
|
|
2879
|
+
return queueRender;
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2876
2882
|
Object.defineProperty(exports, "ready", {
|
|
2877
2883
|
enumerable: true,
|
|
2878
2884
|
get: function() {
|
|
@@ -2092,4 +2092,4 @@ function byFirstArg(name) {
|
|
|
2092
2092
|
return name;
|
|
2093
2093
|
}
|
|
2094
2094
|
//#endregion
|
|
2095
|
-
export { _attrs_script as $, $signal as $t, _attr_input_value_script as A,
|
|
2095
|
+
export { _attrs_script as $, $signal as $t, _attr_input_value_script as A, ParentBranch as An, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, Scope as Cn, registeredValues as Ct, _attr_input_value_attribute_default as D, Gen$1 as Dn, _closure_get as Dt, _attr_input_value as E, EndNode as En, _closure as Et, _controllable_open as F, TagVariable as Fn, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, PendingRenders as Mn, _global_read as Mt, _attr_select_value_script as N, PlaceholderBranch as Nn, _hoist as Nt, _attr_input_value_default as O, Global as On, _const as Ot, _controllable_input as P, StartNode as Pn, _hoist_resume as Pt, _attrs_partial_content as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, Pending as Sn, readyFailed as St, _attr_input_checked_script as T, ClosestBranch as Tn, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, DYNAMIC_TAG_VAR_REGISTER_ID as Zt, _attr_details_or_dialog_open as _, _call as _n, _var_resume as _t, _for_in as a, queueAsyncRender as an, _text_content as at, _attr_input_checked as b, Params as bn, initEmbedded as bt, _for_until as c, run as cn, toInsertNode as ct, _show as d, forIn as dn, _content_resume as dt, $signalReset as en, _html as et, _try as f, forOf as fn, createAndSetupBranch as ft, renderCatch as g, _hoist_read_error as gn, _resume as gt, patchDynamicTag as h, _assert_hoist as hn, _el as ht, _dynamic_tag_content as i, prepareEffects as in, _text as it, _attr_select_value as j, PendingEffects as jn, _for_selector as jt, _attr_input_value_dynamic_default as k, Load as kn, _el_read as kt, _if as l, runEffects as ln, _content as lt, installDynamicTagVar as m, forUntil as mn, setupBranch as mt, _await_promise as n, installCatch as nn, _style_rule_item as nt, _for_of as o, queueEffect as on, _to_text as ot, addAwaitCounter as p, forTo as pn, createBranch as pt, _attr_style_item as q, insertBranchBefore as qt, _dynamic_tag as r, placeholderShown as rn, _style_shell as rt, _for_to as s, queueRender as sn, insertChildNodes as st, _await_content as t, caughtError as tn, _lifecycle as tt, _resume_dynamic_tag as u, runId as un, _content_closures as ut, _attr_details_or_dialog_open_default as v, Clone as vn, getRegisteredWithScope as vt, _attr_input_checked_default as w, AwaitCounter as wn, withLazy as wt, _attr_input_checkedValue as x, Setup as xn, ready as xt, _attr_details_or_dialog_open_script as y, Owner as yn, init as yt, controllableScripts as z, _or 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-CA_HiiES.js");
|
|
4
4
|
//#region src/common/attr-tag.ts
|
|
5
5
|
const empty = [];
|
|
6
6
|
const rest = Symbol("Attribute Tag");
|
|
@@ -22,10 +22,6 @@ function* attrTagIterator() {
|
|
|
22
22
|
yield* this[rest];
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region src/common/constants/load-signal-value.debug.ts
|
|
26
|
-
const Value = "value";
|
|
27
|
-
const Signal = "signal";
|
|
28
|
-
//#endregion
|
|
29
25
|
//#region src/common/compat-meta.ts
|
|
30
26
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
31
27
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -213,9 +209,10 @@ const _load_template = /*@__PURE__*/ require_control_flow.withLazy((id, load) =>
|
|
|
213
209
|
const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((nodeAccessor, childScopeAccessor, load) => {
|
|
214
210
|
let pending;
|
|
215
211
|
let renderer;
|
|
212
|
+
const insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
216
213
|
return (owner) => {
|
|
217
214
|
const child = owner[childScopeAccessor];
|
|
218
|
-
if (renderer)
|
|
215
|
+
if (renderer) require_control_flow.queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
219
216
|
else {
|
|
220
217
|
const awaitCounter = require_control_flow.addAwaitCounter(owner);
|
|
221
218
|
child[require_control_flow.Load] ||= /* @__PURE__ */ new Map();
|
|
@@ -227,27 +224,26 @@ const _load_setup = /*@__PURE__*/ require_control_flow.withLazy((nodeAccessor, c
|
|
|
227
224
|
};
|
|
228
225
|
});
|
|
229
226
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
230
|
-
const parent = marker.parentNode, values = branch[require_control_flow.Load],
|
|
227
|
+
const parent = marker.parentNode, values = branch[require_control_flow.Load], clone = () => {
|
|
228
|
+
require_control_flow.syncGen(branch);
|
|
229
|
+
renderer[require_control_flow.Clone](branch, parent.namespaceURI);
|
|
230
|
+
branch[require_control_flow.Load] = 0;
|
|
231
|
+
}, insert = () => {
|
|
231
232
|
require_control_flow.insertBranchBefore(branch, parent, marker);
|
|
232
233
|
marker.remove();
|
|
233
234
|
awaitCounter?.c();
|
|
234
235
|
};
|
|
235
236
|
let remaining;
|
|
236
|
-
require_control_flow.syncGen(branch);
|
|
237
|
-
renderer[require_control_flow.Clone](branch, parent.namespaceURI);
|
|
238
|
-
branch[require_control_flow.Load] = 0;
|
|
239
237
|
if (remaining = values?.size) {
|
|
240
238
|
const fail = loadFailed(branch, awaitCounter);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
insert();
|
|
248
|
-
});
|
|
249
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
239
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.queueAsyncRender(branch, (branch) => {
|
|
240
|
+
clone();
|
|
241
|
+
renderer["setup"]?.(branch);
|
|
242
|
+
values.forEach(([value, apply]) => apply(branch, value));
|
|
243
|
+
insert();
|
|
244
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
250
245
|
} else {
|
|
246
|
+
clone();
|
|
251
247
|
require_control_flow.setupBranch(renderer, branch);
|
|
252
248
|
insert();
|
|
253
249
|
}
|
|
@@ -261,13 +257,13 @@ function loadFailed(scope, awaitCounter) {
|
|
|
261
257
|
}
|
|
262
258
|
const _load_signal = /*@__PURE__*/ require_control_flow.withLazy((load) => {
|
|
263
259
|
let pending;
|
|
264
|
-
|
|
265
|
-
return (scope, value) => {
|
|
260
|
+
const apply = (scope, value) => {
|
|
266
261
|
pending ||= load();
|
|
267
|
-
if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === require_control_flow.runId) (scope[require_control_flow.Load] ||= /* @__PURE__ */ new Map()).set(pending,
|
|
268
|
-
else if (
|
|
269
|
-
else pending.then((mod) => require_control_flow.queueAsyncRender(scope,
|
|
262
|
+
if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === require_control_flow.runId) (scope[require_control_flow.Load] ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]);
|
|
263
|
+
else if (apply._) apply._(scope, value);
|
|
264
|
+
else pending.then((mod) => require_control_flow.queueAsyncRender(scope, apply._ = mod._, value), () => 0);
|
|
270
265
|
};
|
|
266
|
+
return apply;
|
|
271
267
|
});
|
|
272
268
|
function _load_visible_trigger(selector, options) {
|
|
273
269
|
let pending;
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as _attrs_script, $t as $signal, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default,
|
|
1
|
+
import { $ as _attrs_script, $t as $signal, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, En as EndNode, Et as _closure, F as _controllable_open, Fn as TagVariable, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, On as Global, Ot as _const, P as _controllable_input, Pn as StartNode, Pt as _hoist_resume, Q as _attrs_partial_content, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, _ as _attr_details_or_dialog_open, _n as _call, _t as _var_resume, a as _for_in, an as queueAsyncRender, at as _text_content, b as _attr_input_checked, bn as Params, bt as initEmbedded, c as _for_until, cn as run, ct as toInsertNode, d as _show, dn as forIn, dt as _content_resume, en as $signalReset, et as _html, f as _try, fn as forOf, ft as createAndSetupBranch, g as renderCatch, gn as _hoist_read_error, gt as _resume, h as patchDynamicTag, hn as _assert_hoist, ht as _el, i as _dynamic_tag_content, in as prepareEffects, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kn as Load, kt as _el_read, l as _if, ln as runEffects, lt as _content, mn as forUntil, mt as setupBranch, n as _await_promise, nt as _style_rule_item, o as _for_of, on as queueEffect, ot as _to_text, p as addAwaitCounter, pn as forTo, pt as createBranch, q as _attr_style_item, qt as insertBranchBefore, r as _dynamic_tag, rt as _style_shell, s as _for_to, sn as queueRender, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as runId, ut as _content_closures, v as _attr_details_or_dialog_open_default, vn as Clone, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xn as Setup, xt as ready, y as _attr_details_or_dialog_open_script, yn as Owner, yt as init, zt as _or } from "./dom-DBMLPLeE.mjs";
|
|
2
2
|
//#region src/common/attr-tag.ts
|
|
3
3
|
const empty = [];
|
|
4
4
|
const rest = Symbol("Attribute Tag");
|
|
@@ -20,10 +20,6 @@ function* attrTagIterator() {
|
|
|
20
20
|
yield* this[rest];
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region src/common/constants/load-signal-value.debug.ts
|
|
24
|
-
const Value = "value";
|
|
25
|
-
const Signal = "signal";
|
|
26
|
-
//#endregion
|
|
27
23
|
//#region src/common/compat-meta.ts
|
|
28
24
|
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
29
25
|
const RENDER_BODY_ID = "$compat_renderBody";
|
|
@@ -211,9 +207,10 @@ const _load_template = /*@__PURE__*/ withLazy((id, load) => {
|
|
|
211
207
|
const _load_setup = /*@__PURE__*/ withLazy((nodeAccessor, childScopeAccessor, load) => {
|
|
212
208
|
let pending;
|
|
213
209
|
let renderer;
|
|
210
|
+
const insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
214
211
|
return (owner) => {
|
|
215
212
|
const child = owner[childScopeAccessor];
|
|
216
|
-
if (renderer)
|
|
213
|
+
if (renderer) queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
217
214
|
else {
|
|
218
215
|
const awaitCounter = addAwaitCounter(owner);
|
|
219
216
|
child[Load] ||= /* @__PURE__ */ new Map();
|
|
@@ -225,27 +222,26 @@ const _load_setup = /*@__PURE__*/ withLazy((nodeAccessor, childScopeAccessor, lo
|
|
|
225
222
|
};
|
|
226
223
|
});
|
|
227
224
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
228
|
-
const parent = marker.parentNode, values = branch[Load],
|
|
225
|
+
const parent = marker.parentNode, values = branch[Load], clone = () => {
|
|
226
|
+
syncGen(branch);
|
|
227
|
+
renderer[Clone](branch, parent.namespaceURI);
|
|
228
|
+
branch[Load] = 0;
|
|
229
|
+
}, insert = () => {
|
|
229
230
|
insertBranchBefore(branch, parent, marker);
|
|
230
231
|
marker.remove();
|
|
231
232
|
awaitCounter?.c();
|
|
232
233
|
};
|
|
233
234
|
let remaining;
|
|
234
|
-
syncGen(branch);
|
|
235
|
-
renderer[Clone](branch, parent.namespaceURI);
|
|
236
|
-
branch[Load] = 0;
|
|
237
235
|
if (remaining = values?.size) {
|
|
238
236
|
const fail = loadFailed(branch, awaitCounter);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
insert();
|
|
246
|
-
});
|
|
247
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
237
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
238
|
+
clone();
|
|
239
|
+
renderer["setup"]?.(branch);
|
|
240
|
+
values.forEach(([value, apply]) => apply(branch, value));
|
|
241
|
+
insert();
|
|
242
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
248
243
|
} else {
|
|
244
|
+
clone();
|
|
249
245
|
setupBranch(renderer, branch);
|
|
250
246
|
insert();
|
|
251
247
|
}
|
|
@@ -259,13 +255,13 @@ function loadFailed(scope, awaitCounter) {
|
|
|
259
255
|
}
|
|
260
256
|
const _load_signal = /*@__PURE__*/ withLazy((load) => {
|
|
261
257
|
let pending;
|
|
262
|
-
|
|
263
|
-
return (scope, value) => {
|
|
258
|
+
const apply = (scope, value) => {
|
|
264
259
|
pending ||= load();
|
|
265
|
-
if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === runId) (scope[Load] ||= /* @__PURE__ */ new Map()).set(pending,
|
|
266
|
-
else if (
|
|
267
|
-
else pending.then((mod) => queueAsyncRender(scope,
|
|
260
|
+
if (scope["#Load"] || !("#Load" in scope) && scope["#Gen"] === runId) (scope[Load] ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]);
|
|
261
|
+
else if (apply._) apply._(scope, value);
|
|
262
|
+
else pending.then((mod) => queueAsyncRender(scope, apply._ = mod._, value), () => 0);
|
|
268
263
|
};
|
|
264
|
+
return apply;
|
|
269
265
|
});
|
|
270
266
|
function _load_visible_trigger(selector, options) {
|
|
271
267
|
let pending;
|
package/dist/dom/catch.feat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let require_control_flow = require("../dom-
|
|
1
|
+
let require_control_flow = require("../dom-BfydlrCq.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;
|
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 caughtError, en as installCatch, g as renderCatch, tn as placeholderShown } from "../dom-
|
|
7
|
+
import { $t as caughtError, en as installCatch, g as renderCatch, tn as placeholderShown } from "../dom-UwNQ-AXt.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-BfydlrCq.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-UwNQ-AXt.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-UwNQ-AXt.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-UwNQ-AXt.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-UwNQ-AXt.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-BfydlrCq.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-UwNQ-AXt.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-
|
|
1
|
+
let require_control_flow = require("../dom-BfydlrCq.js"), elementGetter = (branch) => () => branch.S;
|
|
2
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-
|
|
2
|
+
import { gt as _resume, m as installDynamicTagVar } from "../dom-UwNQ-AXt.mjs";
|
|
3
3
|
installDynamicTagVar((branch) => branch.T(elementGetter(branch))), _resume("_e", elementGetter);
|
|
4
4
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as registeredValues, Kt as destroyBranch } from "../dom-
|
|
1
|
+
import { Ct as registeredValues, Kt as destroyBranch } from "../dom-UwNQ-AXt.mjs";
|
|
2
2
|
//#region src/dom/placeholder.feat.ts
|
|
3
3
|
registeredValues._f = (tryBranch) => {
|
|
4
4
|
tryBranch.P &&= (destroyBranch(tryBranch.P), 0);
|
|
@@ -1440,7 +1440,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1440
1440
|
}), Object.defineProperty(exports, "an", {
|
|
1441
1441
|
enumerable: !0,
|
|
1442
1442
|
get: function() {
|
|
1443
|
-
return
|
|
1443
|
+
return queueRender;
|
|
1444
1444
|
}
|
|
1445
1445
|
}), Object.defineProperty(exports, "at", {
|
|
1446
1446
|
enumerable: !0,
|
|
@@ -1465,7 +1465,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1465
1465
|
}), Object.defineProperty(exports, "cn", {
|
|
1466
1466
|
enumerable: !0,
|
|
1467
1467
|
get: function() {
|
|
1468
|
-
return
|
|
1468
|
+
return runId;
|
|
1469
1469
|
}
|
|
1470
1470
|
}), Object.defineProperty(exports, "ct", {
|
|
1471
1471
|
enumerable: !0,
|
|
@@ -1480,7 +1480,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1480
1480
|
}), Object.defineProperty(exports, "dn", {
|
|
1481
1481
|
enumerable: !0,
|
|
1482
1482
|
get: function() {
|
|
1483
|
-
return
|
|
1483
|
+
return forTo;
|
|
1484
1484
|
}
|
|
1485
1485
|
}), Object.defineProperty(exports, "dt", {
|
|
1486
1486
|
enumerable: !0,
|
|
@@ -1505,7 +1505,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1505
1505
|
}), Object.defineProperty(exports, "fn", {
|
|
1506
1506
|
enumerable: !0,
|
|
1507
1507
|
get: function() {
|
|
1508
|
-
return
|
|
1508
|
+
return forUntil;
|
|
1509
1509
|
}
|
|
1510
1510
|
}), Object.defineProperty(exports, "ft", {
|
|
1511
1511
|
enumerable: !0,
|
|
@@ -1517,6 +1517,11 @@ Object.defineProperty(exports, "$", {
|
|
|
1517
1517
|
get: function() {
|
|
1518
1518
|
return renderCatch;
|
|
1519
1519
|
}
|
|
1520
|
+
}), Object.defineProperty(exports, "gn", {
|
|
1521
|
+
enumerable: !0,
|
|
1522
|
+
get: function() {
|
|
1523
|
+
return decodeAccessor;
|
|
1524
|
+
}
|
|
1520
1525
|
}), Object.defineProperty(exports, "gt", {
|
|
1521
1526
|
enumerable: !0,
|
|
1522
1527
|
get: function() {
|
|
@@ -1530,7 +1535,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1530
1535
|
}), Object.defineProperty(exports, "hn", {
|
|
1531
1536
|
enumerable: !0,
|
|
1532
1537
|
get: function() {
|
|
1533
|
-
return
|
|
1538
|
+
return _call;
|
|
1534
1539
|
}
|
|
1535
1540
|
}), Object.defineProperty(exports, "ht", {
|
|
1536
1541
|
enumerable: !0,
|
|
@@ -1580,7 +1585,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1580
1585
|
}), Object.defineProperty(exports, "ln", {
|
|
1581
1586
|
enumerable: !0,
|
|
1582
1587
|
get: function() {
|
|
1583
|
-
return
|
|
1588
|
+
return forIn;
|
|
1584
1589
|
}
|
|
1585
1590
|
}), Object.defineProperty(exports, "lt", {
|
|
1586
1591
|
enumerable: !0,
|
|
@@ -1595,7 +1600,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1595
1600
|
}), Object.defineProperty(exports, "mn", {
|
|
1596
1601
|
enumerable: !0,
|
|
1597
1602
|
get: function() {
|
|
1598
|
-
return
|
|
1603
|
+
return _hoist_read_error;
|
|
1599
1604
|
}
|
|
1600
1605
|
}), Object.defineProperty(exports, "mt", {
|
|
1601
1606
|
enumerable: !0,
|
|
@@ -1625,7 +1630,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1625
1630
|
}), Object.defineProperty(exports, "on", {
|
|
1626
1631
|
enumerable: !0,
|
|
1627
1632
|
get: function() {
|
|
1628
|
-
return
|
|
1633
|
+
return run;
|
|
1629
1634
|
}
|
|
1630
1635
|
}), Object.defineProperty(exports, "ot", {
|
|
1631
1636
|
enumerable: !0,
|
|
@@ -1640,7 +1645,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1640
1645
|
}), Object.defineProperty(exports, "pn", {
|
|
1641
1646
|
enumerable: !0,
|
|
1642
1647
|
get: function() {
|
|
1643
|
-
return
|
|
1648
|
+
return _assert_hoist;
|
|
1644
1649
|
}
|
|
1645
1650
|
}), Object.defineProperty(exports, "pt", {
|
|
1646
1651
|
enumerable: !0,
|
|
@@ -1680,7 +1685,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1680
1685
|
}), Object.defineProperty(exports, "sn", {
|
|
1681
1686
|
enumerable: !0,
|
|
1682
1687
|
get: function() {
|
|
1683
|
-
return
|
|
1688
|
+
return runEffects;
|
|
1684
1689
|
}
|
|
1685
1690
|
}), Object.defineProperty(exports, "st", {
|
|
1686
1691
|
enumerable: !0,
|
|
@@ -1710,7 +1715,7 @@ Object.defineProperty(exports, "$", {
|
|
|
1710
1715
|
}), Object.defineProperty(exports, "un", {
|
|
1711
1716
|
enumerable: !0,
|
|
1712
1717
|
get: function() {
|
|
1713
|
-
return
|
|
1718
|
+
return forOf;
|
|
1714
1719
|
}
|
|
1715
1720
|
}), Object.defineProperty(exports, "ut", {
|
|
1716
1721
|
enumerable: !0,
|
|
@@ -1153,4 +1153,4 @@ function byFirstArg(name) {
|
|
|
1153
1153
|
return name;
|
|
1154
1154
|
}
|
|
1155
1155
|
//#endregion
|
|
1156
|
-
export { _attrs_script as $, caughtError as $t, _attr_input_value_script as A, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, registeredValues as Ct, _attr_input_value_attribute_default as D, _closure_get as Dt, _attr_input_value as E, _closure as Et, _controllable_open as F, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, _global_read as Mt, _attr_select_value_script as N, _hoist as Nt, _attr_input_value_default as O, _const as Ot, _controllable_input as P, _hoist_resume as Pt, _attrs_partial_content as Q, $signalReset as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, readyFailed as St, _attr_input_checked_script as T, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, $signal as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a,
|
|
1156
|
+
export { _attrs_script as $, caughtError as $t, _attr_input_value_script as A, _for_closure as At, _attr as B, _return as Bt, _attr_input_checkedValue_script as C, registeredValues as Ct, _attr_input_value_attribute_default as D, _closure_get as Dt, _attr_input_value as E, _closure as Et, _controllable_open as F, _id as Ft, _attr_nonce as G, _assert_init as Gt, _attr_class_item as H, _script as Ht, _controllable_select as I, _if_closure as It, _attr_style_items as J, removeAndDestroyBranch as Jt, _attr_style as K, destroyBranch as Kt, _controllable_textarea as L, _let as Lt, _attr_select_value_default as M, _global_read as Mt, _attr_select_value_script as N, _hoist as Nt, _attr_input_value_default as O, _const as Ot, _controllable_input as P, _hoist_resume as Pt, _attrs_partial_content as Q, $signalReset as Qt, controllableRenders as R, _let_change as Rt, _attr_input_checkedValue_default as S, readyFailed as St, _attr_input_checked_script as T, _child_setup as Tt, _attr_class_items as U, _var as Ut, _attr_class as V, _return_change as Vt, _attr_content as W, _var_change as Wt, _attrs_content as X, _on as Xt, _attrs as Y, syncGen as Yt, _attrs_partial as Z, $signal as Zt, _attr_details_or_dialog_open as _, _var_resume as _t, _for_in as a, queueRender as an, _text_content as at, _attr_input_checked as b, initEmbedded as bt, _for_until as c, runId as cn, toInsertNode as ct, _show as d, forTo as dn, _content_resume as dt, installCatch as en, _html as et, _try as f, forUntil as fn, createAndSetupBranch as ft, renderCatch as g, decodeAccessor as gn, _resume as gt, patchDynamicTag as h, _call as hn, _el as ht, _dynamic_tag_content as i, queueEffect as in, _text as it, _attr_select_value as j, _for_selector as jt, _attr_input_value_dynamic_default as k, _el_read 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, prepareEffects 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, insertBranchBefore as qt, _dynamic_tag as r, queueAsyncRender as rn, _style_shell as rt, _for_to as s, runEffects as sn, insertChildNodes as st, _await_content as t, placeholderShown 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, getRegisteredWithScope as vt, _attr_input_checked_default as w, withLazy as wt, _attr_input_checkedValue as x, ready as xt, _attr_details_or_dialog_open_script as y, init as yt, controllableScripts as z, _or as zt };
|
package/dist/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
1
|
+
let require_control_flow = require("./dom-BfydlrCq.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
|
|
2
2
|
require_control_flow.yt($global.runtimeId);
|
|
3
3
|
let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
|
|
4
4
|
return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
|
|
@@ -38,7 +38,7 @@ let require_control_flow = require("./dom-DprILxYO.js"), empty = [], rest = Symb
|
|
|
38
38
|
branch.S = startNode, branch.K = endNode;
|
|
39
39
|
},
|
|
40
40
|
runComponentEffects() {
|
|
41
|
-
this.effects && require_control_flow.
|
|
41
|
+
this.effects && require_control_flow.sn(this.effects);
|
|
42
42
|
},
|
|
43
43
|
runComponentDestroy() {
|
|
44
44
|
this.scope && require_control_flow.Kt(this.scope);
|
|
@@ -76,11 +76,11 @@ let require_control_flow = require("./dom-DprILxYO.js"), empty = [], rest = Symb
|
|
|
76
76
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
77
77
|
return lazyTemplate;
|
|
78
78
|
}), _load_setup = /*@__PURE__*/ require_control_flow.wt((nodeAccessor, childScopeAccessor, load) => {
|
|
79
|
-
nodeAccessor = require_control_flow.
|
|
80
|
-
let pending, renderer;
|
|
79
|
+
nodeAccessor = require_control_flow.gn(nodeAccessor), childScopeAccessor = require_control_flow.gn(childScopeAccessor);
|
|
80
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
81
|
return (owner) => {
|
|
82
82
|
let child = owner[childScopeAccessor];
|
|
83
|
-
if (renderer)
|
|
83
|
+
if (renderer) require_control_flow.an(child, insertCached, -1, owner[nodeAccessor]);
|
|
84
84
|
else {
|
|
85
85
|
let awaitCounter = require_control_flow.p(owner);
|
|
86
86
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
@@ -89,10 +89,10 @@ let require_control_flow = require("./dom-DprILxYO.js"), empty = [], rest = Symb
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
}), _load_signal = /*@__PURE__*/ require_control_flow.wt((load) => {
|
|
92
|
-
let pending,
|
|
93
|
-
|
|
94
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.sn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => require_control_flow.rn(scope, signal = mod._, value), () => 0);
|
|
92
|
+
let pending, apply = (scope, value) => {
|
|
93
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.cn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => require_control_flow.rn(scope, apply._ = mod._, value), () => 0);
|
|
95
94
|
};
|
|
95
|
+
return apply;
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
98
98
|
//#region src/common/attr-tag.ts
|
|
@@ -136,7 +136,7 @@ function mount(input = {}, reference, position) {
|
|
|
136
136
|
curValue = newValue;
|
|
137
137
|
}, this.c?.(branch), args?.(branch, input);
|
|
138
138
|
});
|
|
139
|
-
return require_control_flow.st(parentNode, nextSibling, branch.S, branch.K), require_control_flow.
|
|
139
|
+
return require_control_flow.st(parentNode, nextSibling, branch.S, branch.K), require_control_flow.sn(effects), {
|
|
140
140
|
get value() {
|
|
141
141
|
return curValue;
|
|
142
142
|
},
|
|
@@ -144,7 +144,7 @@ function mount(input = {}, reference, position) {
|
|
|
144
144
|
require_control_flow.Wt(branch, newValue);
|
|
145
145
|
},
|
|
146
146
|
update(newInput = {}) {
|
|
147
|
-
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.
|
|
147
|
+
args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.sn(require_control_flow.nn(() => {
|
|
148
148
|
args(branch, newInput);
|
|
149
149
|
})));
|
|
150
150
|
},
|
|
@@ -156,17 +156,17 @@ function mount(input = {}, reference, position) {
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/dom/load.ts
|
|
158
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
|
-
let parent = marker.parentNode, values = branch.X,
|
|
159
|
+
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
+
require_control_flow.Yt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
161
|
+
}, insert = () => {
|
|
160
162
|
require_control_flow.qt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
163
|
}, remaining;
|
|
162
|
-
if (
|
|
164
|
+
if (remaining = values?.size) {
|
|
163
165
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
169
|
-
} else require_control_flow.mt(renderer, branch), insert();
|
|
166
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && require_control_flow.rn(branch, (branch) => {
|
|
167
|
+
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
168
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
169
|
+
} else clone(), require_control_flow.mt(renderer, branch), insert();
|
|
170
170
|
}
|
|
171
171
|
function loadFailed(scope, awaitCounter) {
|
|
172
172
|
return (error) => {
|
|
@@ -196,9 +196,9 @@ function _load_race_trigger(...triggers) {
|
|
|
196
196
|
function getSelectorOrResolve(selector, resolve) {
|
|
197
197
|
return document.querySelector(selector) || resolve();
|
|
198
198
|
}
|
|
199
|
-
exports.$signal = require_control_flow.Zt, exports.$signalReset = require_control_flow.Qt, exports._assert_hoist = require_control_flow.
|
|
199
|
+
exports.$signal = require_control_flow.Zt, exports.$signalReset = require_control_flow.Qt, exports._assert_hoist = require_control_flow.pn, exports._assert_init = require_control_flow.Gt, exports._attr = require_control_flow.B, exports._attr_class = require_control_flow.V, exports._attr_class_item = require_control_flow.H, exports._attr_class_items = require_control_flow.U, exports._attr_content = require_control_flow.W, exports._attr_details_open = require_control_flow._, exports._attr_dialog_open = require_control_flow._, exports._attr_details_open_default = require_control_flow.v, exports._attr_dialog_open_default = require_control_flow.v, exports._attr_details_open_script = require_control_flow.y, exports._attr_dialog_open_script = require_control_flow.y, exports._attr_input_checked = require_control_flow.b, exports._attr_input_checkedValue = require_control_flow.x, exports._attr_input_checkedValue_default = require_control_flow.S, exports._attr_input_checkedValue_script = require_control_flow.C, exports._attr_input_checked_default = require_control_flow.w, exports._attr_input_checked_script = require_control_flow.T, exports._attr_input_value = require_control_flow.E, exports._attr_textarea_value = require_control_flow.E, exports._attr_input_value_attribute_default = require_control_flow.D, exports._attr_input_value_default = require_control_flow.O, exports._attr_textarea_value_default = require_control_flow.O, exports._attr_input_value_dynamic_default = require_control_flow.k, exports._attr_input_value_script = require_control_flow.A, exports._attr_textarea_value_script = require_control_flow.A, exports._attr_nonce = require_control_flow.G, exports._attr_select_value = require_control_flow.j, exports._attr_select_value_default = require_control_flow.M, exports._attr_select_value_script = require_control_flow.N, exports._attr_style = require_control_flow.K, exports._attr_style_item = require_control_flow.q, exports._attr_style_items = require_control_flow.J, exports._attrs = require_control_flow.Y, exports._attrs_content = require_control_flow.X, exports._attrs_partial = require_control_flow.Z, exports._attrs_partial_content = require_control_flow.Q, exports._attrs_script = require_control_flow.$, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.hn, exports._child_setup = require_control_flow.Tt, exports._closure = require_control_flow.Et, exports._closure_get = require_control_flow.Dt, exports._const = require_control_flow.Ot, exports._content = require_control_flow.lt, exports._content_closures = require_control_flow.ut, exports._content_resume = require_control_flow.dt, exports._controllable_input = require_control_flow.P, exports._controllable_open = require_control_flow.F, exports._controllable_select = require_control_flow.I, exports._controllable_textarea = require_control_flow.L, Object.defineProperty(exports, "_dynamic_tag", {
|
|
200
200
|
enumerable: !0,
|
|
201
201
|
get: function() {
|
|
202
202
|
return require_control_flow.r;
|
|
203
203
|
}
|
|
204
|
-
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.ht, exports._el_read = require_control_flow.kt, exports._for_closure = require_control_flow.At, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.jt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._global_read = require_control_flow.Mt, exports._hoist = require_control_flow.Nt, exports._hoist_read_error = require_control_flow.
|
|
204
|
+
}), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.ht, exports._el_read = require_control_flow.kt, exports._for_closure = require_control_flow.At, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.jt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._global_read = require_control_flow.Mt, exports._hoist = require_control_flow.Nt, exports._hoist_read_error = require_control_flow.mn, exports._hoist_resume = require_control_flow.Pt, exports._html = require_control_flow.et, exports._id = require_control_flow.Ft, exports._if = require_control_flow.l, exports._if_closure = require_control_flow.It, exports._let = require_control_flow.Lt, exports._let_change = require_control_flow.Rt, exports._lifecycle = require_control_flow.tt, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.Xt, exports._or = require_control_flow.zt, exports._resume = require_control_flow.gt, exports._resume_dynamic_tag = require_control_flow.u, exports._return = require_control_flow.Bt, exports._return_change = require_control_flow.Vt, exports._script = require_control_flow.Ht, exports._show = require_control_flow.d, exports._style_rule_item = require_control_flow.nt, exports._style_shell = require_control_flow.rt, exports._template = _template, exports._text = require_control_flow.it, exports._text_content = require_control_flow.at, exports._to_text = require_control_flow.ot, exports._try = require_control_flow.f, exports._var = require_control_flow.Ut, exports._var_change = require_control_flow.Wt, exports._var_resume = require_control_flow._t, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.ln, exports.forOf = require_control_flow.un, exports.forTo = require_control_flow.dn, exports.forUntil = require_control_flow.fn, exports.init = require_control_flow.yt, exports.initEmbedded = require_control_flow.bt, exports.ready = require_control_flow.xt, exports.readyFailed = require_control_flow.St, exports.run = require_control_flow.on;
|
package/dist/dom.mjs
CHANGED
|
@@ -77,10 +77,10 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
77
77
|
return lazyTemplate;
|
|
78
78
|
}), _load_setup = /*@__PURE__*/ withLazy((nodeAccessor, childScopeAccessor, load) => {
|
|
79
79
|
nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
|
|
80
|
-
let pending, renderer;
|
|
80
|
+
let pending, renderer, insertCached = (child, marker) => insertLoaded(renderer, child, marker);
|
|
81
81
|
return (owner) => {
|
|
82
82
|
let child = owner[childScopeAccessor];
|
|
83
|
-
if (renderer)
|
|
83
|
+
if (renderer) queueRender(child, insertCached, -1, owner[nodeAccessor]);
|
|
84
84
|
else {
|
|
85
85
|
let awaitCounter = addAwaitCounter(owner);
|
|
86
86
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
@@ -89,12 +89,12 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
}), _load_signal = /*@__PURE__*/ withLazy((load) => {
|
|
92
|
-
let pending,
|
|
93
|
-
|
|
94
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
|
|
92
|
+
let pending, apply = (scope, value) => {
|
|
93
|
+
pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, [value, apply]) : apply._ ? apply._(scope, value) : pending.then((mod) => queueAsyncRender(scope, apply._ = mod._, value), () => 0);
|
|
95
94
|
};
|
|
95
|
+
return apply;
|
|
96
96
|
});
|
|
97
|
-
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as
|
|
97
|
+
import { $ as _attrs_script, A as _attr_input_value_script, At as _for_closure, B as _attr, Bt as _return, C as _attr_input_checkedValue_script, D as _attr_input_value_attribute_default, Dt as _closure_get, E as _attr_input_value, Et as _closure, F as _controllable_open, Ft as _id, G as _attr_nonce, Gt as _assert_init, H as _attr_class_item, Ht as _script, I as _controllable_select, It as _if_closure, J as _attr_style_items, Jt as removeAndDestroyBranch, K as _attr_style, Kt as destroyBranch, L as _controllable_textarea, Lt as _let, M as _attr_select_value_default, Mt as _global_read, N as _attr_select_value_script, Nt as _hoist, O as _attr_input_value_default, Ot as _const, P as _controllable_input, Pt as _hoist_resume, Q as _attrs_partial_content, Qt as $signalReset, Rt as _let_change, S as _attr_input_checkedValue_default, St as readyFailed, T as _attr_input_checked_script, Tt as _child_setup, U as _attr_class_items, Ut as _var, V as _attr_class, Vt as _return_change, W as _attr_content, Wt as _var_change, X as _attrs_content, Xt as _on, Y as _attrs, Yt as syncGen, Z as _attrs_partial, Zt as $signal, _ as _attr_details_or_dialog_open, _t as _var_resume, a as _for_in, an as queueRender, 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 decodeAccessor, gt as _resume, h as patchDynamicTag, hn as _call, ht as _el, i as _dynamic_tag_content, in as queueEffect, it as _text, j as _attr_select_value, jt as _for_selector, k as _attr_input_value_dynamic_default, kt as _el_read, l as _if, ln as forIn, lt as _content, mn as _hoist_read_error, mt as setupBranch, n as _await_promise, nn as prepareEffects, 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 insertBranchBefore, r as _dynamic_tag, rn as queueAsyncRender, 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, vt as getRegisteredWithScope, w as _attr_input_checked_default, wt as withLazy, x as _attr_input_checkedValue, xt as ready, y as _attr_details_or_dialog_open_script, yt as init, zt as _or } from "./dom-UwNQ-AXt.mjs";
|
|
98
98
|
//#region src/common/attr-tag.ts
|
|
99
99
|
function attrTag(attrs) {
|
|
100
100
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -156,17 +156,17 @@ function mount(input = {}, reference, position) {
|
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/dom/load.ts
|
|
158
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
|
-
let parent = marker.parentNode, values = branch.X,
|
|
159
|
+
let parent = marker.parentNode, values = branch.X, clone = () => {
|
|
160
|
+
syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0;
|
|
161
|
+
}, insert = () => {
|
|
160
162
|
insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
163
|
}, remaining;
|
|
162
|
-
if (
|
|
164
|
+
if (remaining = values?.size) {
|
|
163
165
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
169
|
-
} else setupBranch(renderer, branch), insert();
|
|
166
|
+
values.forEach(([, apply], promise) => promise.then((mod) => (apply._ = mod._) && !--remaining && queueAsyncRender(branch, (branch) => {
|
|
167
|
+
clone(), renderer.c?.(branch), values.forEach(([value, apply]) => apply(branch, value)), insert();
|
|
168
|
+
}), (error) => remaining > 0 && (remaining = 0, fail(error))));
|
|
169
|
+
} else clone(), setupBranch(renderer, branch), insert();
|
|
170
170
|
}
|
|
171
171
|
function loadFailed(scope, awaitCounter) {
|
|
172
172
|
return (error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.48",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@marko/runtime-tags": "npm:marko@6.3.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.3.48",
|
|
61
61
|
"marko": "5.39.38"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|