marko 6.5.0 → 6.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debug/dom/catch.feat.js +1 -1
- package/dist/debug/dom/catch.feat.mjs +1 -1
- package/dist/debug/dom/compat.feat.js +1 -1
- package/dist/debug/dom/compat.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-script.feat.js +1 -1
- package/dist/debug/dom/dynamic-tag-script.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/lazy.feat.js +1 -1
- package/dist/debug/dom/lazy.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-D3A8gh_D.mjs → dom-4AzxJQHb.mjs} +12 -12
- package/dist/debug/{dom-BiJ_UKJV.js → dom-Uu_OCdvg.js} +12 -12
- package/dist/debug/dom.js +1 -1
- package/dist/debug/dom.mjs +1 -1
- package/dist/dom/catch.feat.js +1 -1
- package/dist/dom/catch.feat.mjs +1 -1
- package/dist/dom/compat.feat.js +1 -1
- package/dist/dom/compat.feat.mjs +1 -1
- package/dist/dom/control-flow.d.ts +7 -7
- 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-script.feat.js +1 -1
- package/dist/dom/dynamic-tag-script.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/lazy.feat.js +1 -1
- package/dist/dom/lazy.feat.mjs +1 -1
- package/dist/dom/placeholder.feat.js +1 -1
- package/dist/dom/placeholder.feat.mjs +1 -1
- package/dist/{dom-B3piR0q1.js → dom-BdJeggv5.js} +9 -9
- package/dist/{dom-CPk_8CMB.mjs → dom-DJrZXgdr.mjs} +9 -9
- package/dist/dom.js +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/translator/core/if.d.ts +1 -1
- package/dist/translator/core/show.d.ts +2 -3
- package/dist/translator/index.js +2630 -2687
- package/dist/translator/util/assert.d.ts +0 -10
- package/dist/translator/util/branch-tag.d.ts +1 -1
- package/dist/translator/util/get-root.d.ts +3 -1
- package/dist/translator/util/nested-attribute-tags.d.ts +4 -5
- package/dist/translator/util/optional.d.ts +0 -1
- package/dist/translator/util/params-tree.d.ts +1 -1
- package/dist/translator/util/sections.d.ts +4 -1
- package/dist/translator/util/state.d.ts +2 -2
- package/dist/translator/util/to-property-name.d.ts +0 -2
- package/dist/translator/util/visitors.d.ts +2 -2
- package/dist/translator/util/writer.d.ts +2 -2
- package/package.json +3 -3
|
@@ -79,9 +79,9 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
79
79
|
let referenceNode = scope[nodeAccessor], oldScopes = toArray(scope[scopesAccessor]), newScopes = [];
|
|
80
80
|
scope[keyedScopesAccessor] = null;
|
|
81
81
|
let oldLen = oldScopes.length, parentNode = referenceNode.nodeType > 1 ? referenceNode.parentNode || oldScopes[0]?.S.parentNode : referenceNode, oldScopesByKey, hasPotentialMoves, start = 0;
|
|
82
|
-
forEach(value, (key,
|
|
82
|
+
forEach(value, (key, a, b) => {
|
|
83
83
|
let i = newScopes.length, oldScope = oldScopes[i], branch = oldLen && (oldScopesByKey || key !== (oldScope?.M ?? i) ? (oldScopesByKey ||= oldScopes.reduce((map, scope, j) => j < i ? map : (scope.I = j, map.set(scope.M ?? j, scope)), /* @__PURE__ */ new Map())).get(key) : oldScope && (start++, oldScope));
|
|
84
|
-
branch ? (hasPotentialMoves = 1, oldScopesByKey?.delete(key), branch.M = key) : ((branch = createBranch(scope.$, renderer, scope, parentNode)).M = key, setupBranch(renderer, branch)), newScopes.push(branch), params?.(branch,
|
|
84
|
+
branch ? (hasPotentialMoves = 1, oldScopesByKey?.delete(key), branch.M = key) : ((branch = createBranch(scope.$, renderer, scope, parentNode)).M = key, setupBranch(renderer, branch)), newScopes.push(branch), params?.(branch, a, b);
|
|
85
85
|
}), scope[scopesAccessor] = newScopes;
|
|
86
86
|
let newLen = newScopes.length, hasSiblings = referenceNode !== parentNode, afterReference = null, oldEnd = oldLen - 1, newEnd = newLen - 1;
|
|
87
87
|
if (hasSiblings && (oldLen ? (afterReference = oldScopes[oldEnd].K.nextSibling, newLen || parentNode.insertBefore(referenceNode, afterReference)) : newLen && (afterReference = referenceNode.nextSibling, referenceNode.remove())), !hasPotentialMoves) {
|
|
@@ -96,14 +96,14 @@ let unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}), _for_of = /*@__PURE__*/ loop(([all, by], cb) => {
|
|
99
|
-
by ||= bySecondArg, typeof by == "string" ? forOf(all, (item, i) => cb(item[by],
|
|
99
|
+
by ||= bySecondArg, typeof by == "string" ? forOf(all, (item, i) => cb(item[by], item, i)) : forOf(all, (item, i) => cb(by(item, i), item, i));
|
|
100
100
|
}, reorderKeyed), _for_in = /*@__PURE__*/ loop(([obj, by], cb) => {
|
|
101
|
-
by ||= byFirstArg, forIn(obj, (key, value) => cb(by(key, value),
|
|
101
|
+
by ||= byFirstArg, forIn(obj, (key, value) => cb(by(key, value), key, value));
|
|
102
102
|
}, reorderKeyed), _for_to = /*@__PURE__*/ loop(([to, from, step, by], cb) => {
|
|
103
|
-
by ||= byFirstArg, forTo(to, from, step, (v) => cb(by(v),
|
|
103
|
+
by ||= byFirstArg, forTo(to, from, step, (v) => cb(by(v), v));
|
|
104
104
|
}, reorderKeyed), _for_until = /*@__PURE__*/ loop(([until, from, step, by], cb) => {
|
|
105
|
-
by ||= byFirstArg, forUntil(until, from, step, (v) => cb(by(v),
|
|
106
|
-
}, reorderKeyed), _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i,
|
|
105
|
+
by ||= byFirstArg, forUntil(until, from, step, (v) => cb(by(v), v));
|
|
106
|
+
}, reorderKeyed), _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, item, i))), _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, v))), _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, v)));
|
|
107
107
|
// src/common/helpers.ts
|
|
108
108
|
function _call(fn, v) {
|
|
109
109
|
return fn(v), v;
|
|
@@ -1026,7 +1026,7 @@ function _await_promise(nodeAccessor, params) {
|
|
|
1026
1026
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1027
1027
|
let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor, tryAccessor = "Q" + nodeAccessor, resolveAwait = (scope, referenceNode, value) => {
|
|
1028
1028
|
let awaitBranch = scope[branchAccessor];
|
|
1029
|
-
return awaitBranch.V && (awaitBranch.Y = awaitBranch.Y?.forEach(syncGen), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch,
|
|
1029
|
+
return awaitBranch.V && (awaitBranch.Y = awaitBranch.Y?.forEach(syncGen), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch, value), awaitBranch;
|
|
1030
1030
|
}, awaitPromise = (scope, promise) => {
|
|
1031
1031
|
isPromise(scope[promiseAccessor]) || (scope[promiseAccessor] = 0);
|
|
1032
1032
|
let awaitBranch = scope[branchAccessor], tryBranch = scope[tryAccessor] || isPromise(promise) && findTryWithPlaceholder(scope) || awaitBranch;
|
|
@@ -1137,7 +1137,7 @@ function renderCatch(scope, error) {
|
|
|
1137
1137
|
placeholderBranch && (tryWithCatch.O && (tryWithCatch.O.i = 0), owner["A" + tryWithCatch.C] = placeholderBranch, destroyBranch(tryWithCatch));
|
|
1138
1138
|
let catchContent = tryWithCatch.E();
|
|
1139
1139
|
setBranch(owner, tryWithCatch.C, catchContent, createBranch), queueRender(owner["A" + tryWithCatch.C], (branch) => {
|
|
1140
|
-
setupBranch(catchContent, branch), catchContent.d?.(branch,
|
|
1140
|
+
setupBranch(catchContent, branch), catchContent.d?.(branch, error);
|
|
1141
1141
|
}, -1);
|
|
1142
1142
|
} else throw error;
|
|
1143
1143
|
}
|
package/dist/dom.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let require_control_flow = require("./dom-
|
|
2
|
+
let require_control_flow = require("./dom-BdJeggv5.js"), empty = [], rest = Symbol(), _template = (id, template, walks, setup, inputSignal) => {
|
|
3
3
|
let renderer = require_control_flow.dt(id, template, walks, setup, inputSignal)();
|
|
4
4
|
return renderer.mount = mount, renderer._ = renderer, require_control_flow.yt[id] = renderer;
|
|
5
5
|
}, noop = (_) => 0;
|
package/dist/dom.mjs
CHANGED
|
@@ -2,7 +2,7 @@ let empty = [], rest = Symbol(), _template = (id, template, walks, setup, inputS
|
|
|
2
2
|
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
3
3
|
return renderer.mount = mount, renderer._ = renderer, _resumed[id] = renderer;
|
|
4
4
|
}, noop = (_) => 0;
|
|
5
|
-
import { $ as _attrs, $t as $signalReset, A as _attr_input_value_attribute_default, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jt as insertBranchBefore, K as _attr_class_items, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, Qt as $signal, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, Zt as _on, _n as _assert_hoist, _t as _dynamic_tag_var_resume, a as _for_in, an as queueAsyncRender, at as _lifecycle, b as _attr_details_or_dialog_open, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as runId, dt as _content, en as onAbort, et as _attrs_content, f as _if, fn as forIn, ft as _content_closures, gn as _assert_class_toggles, gt as setupBranch, hn as forUntil, ht as createBranch, i as _dynamic_tag_content, in as prepareEffects, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as run, lt as _text_content, m as _try, mn as forTo, mt as _return_setup, n as _await_promise, nt as _attrs_partial_content, o as _for_of, ot as _style_rule_item, p as _show, pn as forOf, pt as _content_closures_resume, q as _attr_class_names, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueRender, st as _style_shell, t as _await_content, tt as _attrs_partial, u as _for_until, un as runEffects, ut as _to_text, v as renderCatch, vn as _hoist_read_error, vt as _el, w as _attr_input_checkedValue, wt as ready, x as _attr_details_or_dialog_open_default, y as startAwait, yn as _call, yt as _resumed, z as _controllable_select, zt as _let_change } from "./dom-
|
|
5
|
+
import { $ as _attrs, $t as $signalReset, A as _attr_input_value_attribute_default, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jt as insertBranchBefore, K as _attr_class_items, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, Qt as $signal, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, Zt as _on, _n as _assert_hoist, _t as _dynamic_tag_var_resume, a as _for_in, an as queueAsyncRender, at as _lifecycle, b as _attr_details_or_dialog_open, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as runId, dt as _content, en as onAbort, et as _attrs_content, f as _if, fn as forIn, ft as _content_closures, gn as _assert_class_toggles, gt as setupBranch, hn as forUntil, ht as createBranch, i as _dynamic_tag_content, in as prepareEffects, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as run, lt as _text_content, m as _try, mn as forTo, mt as _return_setup, n as _await_promise, nt as _attrs_partial_content, o as _for_of, ot as _style_rule_item, p as _show, pn as forOf, pt as _content_closures_resume, q as _attr_class_names, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueRender, st as _style_shell, t as _await_content, tt as _attrs_partial, u as _for_until, un as runEffects, ut as _to_text, v as renderCatch, vn as _hoist_read_error, vt as _el, w as _attr_input_checkedValue, wt as ready, x as _attr_details_or_dialog_open_default, y as startAwait, yn as _call, yt as _resumed, z as _controllable_select, zt as _let_change } from "./dom-DJrZXgdr.mjs";
|
|
6
6
|
// src/common/attr-tag.ts
|
|
7
7
|
function attrTag(attrs) {
|
|
8
8
|
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import { type Tag } from "@marko/compiler/babel-utils";
|
|
3
3
|
export declare const IfTag: Tag;
|
|
4
|
-
export declare function flattenTextOnlyConditional(rootTag: t.NodePath<t.MarkoTag>):
|
|
4
|
+
export declare function flattenTextOnlyConditional(rootTag: t.NodePath<t.MarkoTag>): true | undefined;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type Tag } from "@marko/compiler/babel-utils";
|
|
2
2
|
import type { Binding } from "../util/bindings";
|
|
3
|
-
import { type Section } from "../util/sections";
|
|
4
3
|
declare const kStartBinding: unique symbol;
|
|
5
4
|
declare const kStaticDisplay: unique symbol;
|
|
6
|
-
declare const
|
|
5
|
+
declare const kSingleNode: unique symbol;
|
|
7
6
|
declare module "@marko/compiler/dist/types" {
|
|
8
7
|
interface MarkoTagExtra {
|
|
9
8
|
[kStartBinding]?: Binding;
|
|
10
9
|
[kStaticDisplay]?: boolean;
|
|
11
|
-
[
|
|
10
|
+
[kSingleNode]?: boolean;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
declare const _default: Tag;
|