marko 6.3.44 → 6.3.46
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 +7 -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-ky42a_qY.mjs → dom-CIt3_Sdm.mjs} +7 -1
- package/dist/debug/{dom-DBuLwSOh.js → dom-WyMgkHne.js} +12 -0
- package/dist/debug/dom.js +2 -1
- package/dist/debug/dom.mjs +2 -2
- package/dist/debug/html.js +16 -14
- package/dist/debug/html.mjs +16 -14
- 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 +1 -1
- package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +3 -3
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/dom/resume.d.ts +1 -0
- package/dist/{dom-BSAs0ur8.mjs → dom-DN6BTUmH.mjs} +2 -1
- package/dist/{dom-DHJCbngT.js → dom-R3sALHJt.js} +53 -47
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +24 -24
- package/dist/dom.mjs +2 -2
- package/dist/html.js +6 -6
- package/dist/html.mjs +6 -6
- package/dist/translator/index.js +238 -525
- package/dist/translator/interop/index.d.ts +8 -0
- package/dist/translator/util/entry-builder.d.ts +17 -3
- package/dist/translator/util/known-tag.d.ts +1 -5
- package/dist/translator/util/references.d.ts +10 -1
- package/dist/translator/util/sections.d.ts +3 -1
- package/dist/translator/util/serialize-reasons.d.ts +3 -1
- package/dist/translator/util/set-tag-sections-downstream.d.ts +2 -2
- package/dist/translator/util/signals.d.ts +4 -1
- package/dist/translator/util/tag-name-type.d.ts +2 -0
- package/dist/translator/visitors/import-declaration.d.ts +4 -0
- package/dist/translator/visitors/program/index.d.ts +1 -0
- package/package.json +4 -4
package/dist/dom.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
let require_control_flow = require("./dom-
|
|
1
|
+
let require_control_flow = require("./dom-R3sALHJt.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;
|
|
5
5
|
}, compat = {
|
|
6
6
|
patchDynamicTag: require_control_flow.h,
|
|
7
|
-
queueEffect: require_control_flow.
|
|
7
|
+
queueEffect: require_control_flow.in,
|
|
8
8
|
init(warp10Noop) {
|
|
9
9
|
require_control_flow.gt("$C_s", (scope) => {
|
|
10
10
|
if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
|
|
@@ -38,10 +38,10 @@ let require_control_flow = require("./dom-DHJCbngT.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.on(this.effects);
|
|
42
42
|
},
|
|
43
43
|
runComponentDestroy() {
|
|
44
|
-
this.scope && require_control_flow.
|
|
44
|
+
this.scope && require_control_flow.Kt(this.scope);
|
|
45
45
|
},
|
|
46
46
|
resolveRegistered(value, $global) {
|
|
47
47
|
return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow.vt(value[0], getRenderScopes($global)?.[value[1]]) : value;
|
|
@@ -60,23 +60,23 @@ let require_control_flow = require("./dom-DHJCbngT.js"), empty = [], rest = Symb
|
|
|
60
60
|
let input = args[0], normalizedInput = args[0] = {};
|
|
61
61
|
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
62
62
|
}
|
|
63
|
-
if (component.effects = require_control_flow.
|
|
63
|
+
if (component.effects = require_control_flow.nn(() => {
|
|
64
64
|
branch ||= (created = 1, component.scope = require_control_flow.ft(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
65
65
|
}), created) return require_control_flow.ct(branch.S, branch.K);
|
|
66
66
|
}
|
|
67
67
|
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
68
68
|
let renderer = require_control_flow.lt(id, template, walks, setup, inputSignal)();
|
|
69
69
|
return renderer.mount = mount, renderer._ = renderer, require_control_flow.gt(id, renderer);
|
|
70
|
-
}, _load_template = /*@__PURE__*/ require_control_flow.
|
|
70
|
+
}, _load_template = /*@__PURE__*/ require_control_flow.wt((id, load) => {
|
|
71
71
|
let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
|
|
72
72
|
let awaitCounter = require_control_flow.p(branch);
|
|
73
73
|
branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
|
|
74
|
-
Object.assign(lazyTemplate, renderer), require_control_flow.
|
|
74
|
+
Object.assign(lazyTemplate, renderer), require_control_flow.rn(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
|
|
75
75
|
}, loadFailed(branch, awaitCounter));
|
|
76
76
|
}, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
|
|
77
77
|
return lazyTemplate;
|
|
78
|
-
}), _load_setup = /*@__PURE__*/ require_control_flow.
|
|
79
|
-
nodeAccessor = require_control_flow.
|
|
78
|
+
}), _load_setup = /*@__PURE__*/ require_control_flow.wt((nodeAccessor, childScopeAccessor, load) => {
|
|
79
|
+
nodeAccessor = require_control_flow.hn(nodeAccessor), childScopeAccessor = require_control_flow.hn(childScopeAccessor);
|
|
80
80
|
let pending, renderer;
|
|
81
81
|
return (owner) => {
|
|
82
82
|
let child = owner[childScopeAccessor];
|
|
@@ -84,14 +84,14 @@ let require_control_flow = require("./dom-DHJCbngT.js"), empty = [], rest = Symb
|
|
|
84
84
|
else {
|
|
85
85
|
let awaitCounter = require_control_flow.p(owner);
|
|
86
86
|
child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
|
|
87
|
-
renderer = require_control_flow.lt("", ...mod._)(), require_control_flow.
|
|
87
|
+
renderer = require_control_flow.lt("", ...mod._)(), require_control_flow.rn(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
|
|
88
88
|
}, loadFailed(child, awaitCounter));
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
}), _load_signal = /*@__PURE__*/ require_control_flow.
|
|
91
|
+
}), _load_signal = /*@__PURE__*/ require_control_flow.wt((load) => {
|
|
92
92
|
let pending, signal;
|
|
93
93
|
return (scope, value) => {
|
|
94
|
-
pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.
|
|
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);
|
|
95
95
|
};
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
@@ -131,25 +131,25 @@ function mount(input = {}, reference, position) {
|
|
|
131
131
|
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
|
-
let curValue, args = this.d, effects = require_control_flow.
|
|
134
|
+
let curValue, args = this.d, effects = require_control_flow.nn(() => {
|
|
135
135
|
branch = require_control_flow.pt($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
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.on(effects), {
|
|
140
140
|
get value() {
|
|
141
141
|
return curValue;
|
|
142
142
|
},
|
|
143
143
|
set value(newValue) {
|
|
144
|
-
require_control_flow.
|
|
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.on(require_control_flow.nn(() => {
|
|
148
148
|
args(branch, newInput);
|
|
149
149
|
})));
|
|
150
150
|
},
|
|
151
151
|
destroy() {
|
|
152
|
-
require_control_flow.
|
|
152
|
+
require_control_flow.Jt(branch);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
}
|
|
@@ -157,20 +157,20 @@ function mount(input = {}, reference, position) {
|
|
|
157
157
|
//#region src/dom/load.ts
|
|
158
158
|
function insertLoaded(renderer, branch, marker, awaitCounter) {
|
|
159
159
|
let parent = marker.parentNode, values = branch.X, insert = () => {
|
|
160
|
-
require_control_flow.
|
|
160
|
+
require_control_flow.qt(branch, parent, marker), marker.remove(), awaitCounter?.c();
|
|
161
161
|
}, remaining;
|
|
162
|
-
if (require_control_flow.
|
|
162
|
+
if (require_control_flow.Yt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) {
|
|
163
163
|
let fail = loadFailed(branch, awaitCounter);
|
|
164
164
|
for (let [promise, entry] of values) promise.then((signal) => {
|
|
165
|
-
entry.b = signal, --remaining || require_control_flow.
|
|
166
|
-
require_control_flow.
|
|
165
|
+
entry.b = signal, --remaining || require_control_flow.rn(branch, (branch) => {
|
|
166
|
+
require_control_flow.Yt(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
|
|
167
167
|
});
|
|
168
168
|
}, (error) => remaining > 0 && (remaining = 0, fail(error)));
|
|
169
169
|
} else require_control_flow.mt(renderer, branch), insert();
|
|
170
170
|
}
|
|
171
171
|
function loadFailed(scope, awaitCounter) {
|
|
172
172
|
return (error) => {
|
|
173
|
-
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.
|
|
173
|
+
awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.rn(scope, require_control_flow.g, error);
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
function _load_visible_trigger(selector, options) {
|
|
@@ -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.
|
|
199
|
+
exports.$signal = require_control_flow.Zt, exports.$signalReset = require_control_flow.Qt, exports._assert_hoist = require_control_flow.fn, 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.mn, 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.
|
|
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.pn, 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.cn, exports.forOf = require_control_flow.ln, exports.forTo = require_control_flow.un, exports.forUntil = require_control_flow.dn, 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.an;
|
package/dist/dom.mjs
CHANGED
|
@@ -94,7 +94,7 @@ let empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), cl
|
|
|
94
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);
|
|
95
95
|
};
|
|
96
96
|
});
|
|
97
|
-
import { $ as _attrs_script, A as _attr_input_value_script, At 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 run, at as _text_content, b as _attr_input_checked, bt as initEmbedded, c as _for_until, cn as forIn, ct as toInsertNode, d as _show, dn as forUntil, dt as _content_resume, et as _html, f as _try, fn as _assert_hoist, ft as createAndSetupBranch, g as renderCatch, gt as _resume, h as patchDynamicTag, hn as decodeAccessor, 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 forOf, lt as _content, mn as _call, mt as setupBranch, n as _await_promise, nn as prepareEffects, nt as _style_rule_item, o as _for_of, on as runEffects, ot as _to_text, p as addAwaitCounter, pn as _hoist_read_error, 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 runId, st as insertChildNodes, t as _await_content, tt as _lifecycle, u as _resume_dynamic_tag, un as forTo, 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-DN6BTUmH.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;
|
|
@@ -197,4 +197,4 @@ function getSelectorOrResolve(selector, resolve) {
|
|
|
197
197
|
return document.querySelector(selector) || resolve();
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
|
-
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 };
|
|
200
|
+
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, readyFailed, run };
|
package/dist/html.js
CHANGED
|
@@ -4,7 +4,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
4
4
|
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
5
5
|
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
6
6
|
return str;
|
|
7
|
-
}, unsafeXMLReg = /[<&\r]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : c === "<" ? "<" : " ", escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str, unsafeScriptReg = /<(\/?script|!--)/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C$1") : str, unsafeStyleReg = /<(\/style)/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C$1") : str, unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str, K_SCOPE_ID = Symbol("Scope ID"), kTouchedIterator = Symbol.for("marko.touchedIterator"), { hasOwnProperty } = {}, objectProto = Object.prototype, arrayProto = Array.prototype, Generator = (function* () {})().constructor, AsyncGenerator = (async function* () {})().constructor, REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
|
|
7
|
+
}, unsafeXMLReg = /[<&\r]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : c === "<" ? "<" : " ", escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str, unsafeScriptReg = /<(\/?script|!--)/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C$1") : str, unsafeStyleReg = /<(\/style)/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C$1") : str, unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str, K_SCOPE_ID = Symbol("Scope ID"), kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator"), { hasOwnProperty } = {}, objectProto = Object.prototype, arrayProto = Array.prototype, Generator = (/* @__PURE__ */ (function* () {})()).constructor, AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor, REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
|
|
8
8
|
let KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
|
|
9
9
|
for (let name of Object.getOwnPropertyNames(Symbol)) {
|
|
10
10
|
let symbol = Symbol[name];
|
|
@@ -279,7 +279,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
279
279
|
result = shouldResume ? withBranchId(branchId, render) : render(), rendered = _peek_scope_id() !== branchId, beforeBranch !== void 0 && (applyBranchStart(chunk, beforeBranch, rendered), _html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : ""))));
|
|
280
280
|
}
|
|
281
281
|
return rendered ? shouldResume && writeScope(scopeId, { ["D" + accessor]: rendererKey(renderer) }) : _scope_id(), result;
|
|
282
|
-
}, patchDynamicTag = ((originalDynamicTag) => (patch) => {
|
|
282
|
+
}, patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
|
|
283
283
|
_dynamic_tag = (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
|
284
284
|
let patched = patch(tag, scopeId, accessor);
|
|
285
285
|
return patched !== tag && (patched.a = tag), originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, resume);
|
|
@@ -780,7 +780,7 @@ function writeDate(state, val) {
|
|
|
780
780
|
}
|
|
781
781
|
function writeRegExp(state, val) {
|
|
782
782
|
let { source } = val;
|
|
783
|
-
return state.buf.push("/" + (unsafeRegExpSourceDetect.test(source) ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
|
|
783
|
+
return source.includes("<") ? state.buf.push(`RegExp(${quote(source, 0)}${val.flags ? ",\"" + val.flags + "\"" : ""})`) : state.buf.push("/" + (unsafeRegExpSourceDetect.test(source) ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
|
|
784
784
|
}
|
|
785
785
|
function writePromise(state, val, ref) {
|
|
786
786
|
let { boundary, channel } = state;
|
|
@@ -1538,7 +1538,7 @@ function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBran
|
|
|
1538
1538
|
};
|
|
1539
1539
|
}
|
|
1540
1540
|
function tryCatch(content, catchContent) {
|
|
1541
|
-
let chunk = $chunk, { boundary } = chunk, { state } = boundary, catchBoundary = new Boundary(state,
|
|
1541
|
+
let chunk = $chunk, { boundary } = chunk, { state } = boundary, catchBoundary = new Boundary(state, boundary.signal, boundary), body = chunk.fork(catchBoundary, null), bodyEnd = body.render(content);
|
|
1542
1542
|
if (catchBoundary.signal.aborted) {
|
|
1543
1543
|
catchContent(catchBoundary.signal.reason);
|
|
1544
1544
|
return;
|
|
@@ -2211,7 +2211,7 @@ function flush(g, html) {
|
|
|
2211
2211
|
for (; bi < length; bi++) result += assetFlush(g, "block", assets[bi].id);
|
|
2212
2212
|
for (; di < length; di++) {
|
|
2213
2213
|
let { id, triggers } = assets[di], deferHTML = assetFlush(g, "defer", id);
|
|
2214
|
-
triggers ? deferHTML && writeTriggerScript(deferHTML, triggers) : result += deferHTML;
|
|
2214
|
+
triggers ? deferHTML && writeTriggerScript(id, deferHTML, triggers) : result += deferHTML;
|
|
2215
2215
|
}
|
|
2216
2216
|
return g[kBlockIndex] = bi, g[kDeferIndex] = di, result + html;
|
|
2217
2217
|
}
|
|
@@ -2225,7 +2225,7 @@ function addAsset(g, id, triggers) {
|
|
|
2225
2225
|
triggers
|
|
2226
2226
|
}], g[kBlockIndex] = g[kDeferIndex] = 0);
|
|
2227
2227
|
}
|
|
2228
|
-
function writeTriggerScript(html, triggers) {
|
|
2228
|
+
function writeTriggerScript(id, html, triggers) {
|
|
2229
2229
|
let htmlStr = _escape_script(JSON.stringify(html)), exprs = triggers.map((trigger) => {
|
|
2230
2230
|
let options = trigger.options && toObjectExpression(trigger.options);
|
|
2231
2231
|
switch (trigger.type) {
|
package/dist/html.mjs
CHANGED
|
@@ -4,7 +4,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
4
4
|
else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
5
5
|
else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
6
6
|
return str;
|
|
7
|
-
}, unsafeXMLReg = /[<&\r]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : c === "<" ? "<" : " ", escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str, unsafeScriptReg = /<(\/?script|!--)/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C$1") : str, unsafeStyleReg = /<(\/style)/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C$1") : str, unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str, K_SCOPE_ID = Symbol("Scope ID"), kTouchedIterator = Symbol.for("marko.touchedIterator"), { hasOwnProperty } = {}, objectProto = Object.prototype, arrayProto = Array.prototype, Generator = (function* () {})().constructor, AsyncGenerator = (async function* () {})().constructor, REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
|
|
7
|
+
}, unsafeXMLReg = /[<&\r]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : c === "<" ? "<" : " ", escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, replaceUnsafeXML) : str, unsafeScriptReg = /<(\/?script|!--)/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C$1") : str, unsafeStyleReg = /<(\/style)/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C$1") : str, unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str, K_SCOPE_ID = Symbol("Scope ID"), kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator"), { hasOwnProperty } = {}, objectProto = Object.prototype, arrayProto = Array.prototype, Generator = (/* @__PURE__ */ (function* () {})()).constructor, AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor, REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
|
|
8
8
|
let KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
|
|
9
9
|
for (let name of Object.getOwnPropertyNames(Symbol)) {
|
|
10
10
|
let symbol = Symbol[name];
|
|
@@ -279,7 +279,7 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
|
|
|
279
279
|
result = shouldResume ? withBranchId(branchId, render) : render(), rendered = _peek_scope_id() !== branchId, beforeBranch !== void 0 && (applyBranchStart(chunk, beforeBranch, rendered), _html(state.mark("]", scopeId + " " + accessor + (rendered ? " " + branchId : ""))));
|
|
280
280
|
}
|
|
281
281
|
return rendered ? shouldResume && writeScope(scopeId, { ["D" + accessor]: rendererKey(renderer) }) : _scope_id(), result;
|
|
282
|
-
}, patchDynamicTag = ((originalDynamicTag) => (patch) => {
|
|
282
|
+
}, patchDynamicTag = /* @__PURE__ */ ((originalDynamicTag) => (patch) => {
|
|
283
283
|
_dynamic_tag = (scopeId, accessor, tag, input, content, inputIsArgs, resume) => {
|
|
284
284
|
let patched = patch(tag, scopeId, accessor);
|
|
285
285
|
return patched !== tag && (patched.a = tag), originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, resume);
|
|
@@ -779,7 +779,7 @@ function writeDate(state, val) {
|
|
|
779
779
|
}
|
|
780
780
|
function writeRegExp(state, val) {
|
|
781
781
|
let { source } = val;
|
|
782
|
-
return state.buf.push("/" + (unsafeRegExpSourceDetect.test(source) ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
|
|
782
|
+
return source.includes("<") ? state.buf.push(`RegExp(${quote(source, 0)}${val.flags ? ",\"" + val.flags + "\"" : ""})`) : state.buf.push("/" + (unsafeRegExpSourceDetect.test(source) ? source.replace(unsafeRegExpSourceReg, replaceUnsafeRegExpSourceChar) : source) + "/" + val.flags), !0;
|
|
783
783
|
}
|
|
784
784
|
function writePromise(state, val, ref) {
|
|
785
785
|
let { boundary, channel } = state;
|
|
@@ -1537,7 +1537,7 @@ function tryPlaceholder(content, placeholder, branchId, scopeId, placeholderBran
|
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
1539
|
function tryCatch(content, catchContent) {
|
|
1540
|
-
let chunk = $chunk, { boundary } = chunk, { state } = boundary, catchBoundary = new Boundary(state,
|
|
1540
|
+
let chunk = $chunk, { boundary } = chunk, { state } = boundary, catchBoundary = new Boundary(state, boundary.signal, boundary), body = chunk.fork(catchBoundary, null), bodyEnd = body.render(content);
|
|
1541
1541
|
if (catchBoundary.signal.aborted) {
|
|
1542
1542
|
catchContent(catchBoundary.signal.reason);
|
|
1543
1543
|
return;
|
|
@@ -2210,7 +2210,7 @@ function flush(g, html) {
|
|
|
2210
2210
|
for (; bi < length; bi++) result += assetFlush(g, "block", assets[bi].id);
|
|
2211
2211
|
for (; di < length; di++) {
|
|
2212
2212
|
let { id, triggers } = assets[di], deferHTML = assetFlush(g, "defer", id);
|
|
2213
|
-
triggers ? deferHTML && writeTriggerScript(deferHTML, triggers) : result += deferHTML;
|
|
2213
|
+
triggers ? deferHTML && writeTriggerScript(id, deferHTML, triggers) : result += deferHTML;
|
|
2214
2214
|
}
|
|
2215
2215
|
return g[kBlockIndex] = bi, g[kDeferIndex] = di, result + html;
|
|
2216
2216
|
}
|
|
@@ -2224,7 +2224,7 @@ function addAsset(g, id, triggers) {
|
|
|
2224
2224
|
triggers
|
|
2225
2225
|
}], g[kBlockIndex] = g[kDeferIndex] = 0);
|
|
2226
2226
|
}
|
|
2227
|
-
function writeTriggerScript(html, triggers) {
|
|
2227
|
+
function writeTriggerScript(id, html, triggers) {
|
|
2228
2228
|
let htmlStr = _escape_script(JSON.stringify(html)), exprs = triggers.map((trigger) => {
|
|
2229
2229
|
let options = trigger.options && toObjectExpression(trigger.options);
|
|
2230
2230
|
switch (trigger.type) {
|