haori 0.17.0 → 0.17.2
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/haori.cjs.js +12 -12
- package/dist/haori.es.js +330 -303
- package/dist/haori.iife.js +12 -12
- package/dist/index.d.ts +29 -10
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -202,28 +202,28 @@ function wt(p, t, e = {}) {
|
|
|
202
202
|
a.add(h);
|
|
203
203
|
for (let h = Math.max(0, i - n); h <= Math.min(r - 1, i + n); h += 1)
|
|
204
204
|
a.add(h);
|
|
205
|
-
const o = Array.from(a).sort((h, g) => h - g),
|
|
205
|
+
const o = Array.from(a).sort((h, g) => h - g), u = [];
|
|
206
206
|
let d = null;
|
|
207
207
|
for (const h of o) {
|
|
208
208
|
if (d !== null && h - d > 1)
|
|
209
209
|
if (h - d === 2) {
|
|
210
210
|
const g = d + 1;
|
|
211
|
-
|
|
211
|
+
u.push({
|
|
212
212
|
page: g,
|
|
213
213
|
label: g + 1,
|
|
214
214
|
active: g === i,
|
|
215
215
|
ellipsis: !1
|
|
216
216
|
});
|
|
217
217
|
} else
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
u.push({ page: null, label: "…", active: !1, ellipsis: !0 });
|
|
219
|
+
u.push({
|
|
220
220
|
page: h,
|
|
221
221
|
label: h + 1,
|
|
222
222
|
active: h === i,
|
|
223
223
|
ellipsis: !1
|
|
224
224
|
}), d = h;
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return u;
|
|
227
227
|
}
|
|
228
228
|
const Ct = /^(\d{4})-(\d{1,2})$/, kt = 1200;
|
|
229
229
|
function tt(p, t) {
|
|
@@ -273,14 +273,14 @@ function Rt(p, t) {
|
|
|
273
273
|
if (i <= 0)
|
|
274
274
|
return e;
|
|
275
275
|
const n = Math.max(0, tt(r.number, 0)), s = Math.max(0, tt(r.size, 0)), a = n * s, o = Math.min(a + 1, i);
|
|
276
|
-
let
|
|
276
|
+
let u;
|
|
277
277
|
if (t !== void 0 && Number.isFinite(t))
|
|
278
|
-
|
|
278
|
+
u = Math.max(0, Math.trunc(t));
|
|
279
279
|
else {
|
|
280
280
|
const h = tt(r.numberOfElements, NaN);
|
|
281
|
-
|
|
281
|
+
u = Number.isFinite(h) ? h : Math.min(s, i - a);
|
|
282
282
|
}
|
|
283
|
-
const d = Math.min(a +
|
|
283
|
+
const d = Math.min(a + u, i);
|
|
284
284
|
return { start: o, end: Math.max(d, o), total: i, empty: !1 };
|
|
285
285
|
}
|
|
286
286
|
function Nt(p, t, e) {
|
|
@@ -401,11 +401,11 @@ const $t = Object.freeze({
|
|
|
401
401
|
if (this.containsDangerousPatterns(t)) {
|
|
402
402
|
const o = this.detectDisallowedKeywords(t);
|
|
403
403
|
if (o.length > 0) {
|
|
404
|
-
const
|
|
404
|
+
const u = o.some((d) => d === "function" || d === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
|
|
405
405
|
m.warn(
|
|
406
406
|
"[Haori]",
|
|
407
407
|
t,
|
|
408
|
-
"Expression uses disallowed keyword(s): " + o.join(", ") + "." +
|
|
408
|
+
"Expression uses disallowed keyword(s): " + o.join(", ") + "." + u
|
|
409
409
|
);
|
|
410
410
|
} else
|
|
411
411
|
m.warn(
|
|
@@ -440,16 +440,16 @@ const $t = Object.freeze({
|
|
|
440
440
|
);
|
|
441
441
|
const s = n ? { ...e, [this.BUILTIN_NAMESPACE]: this.BUILTIN_HELPERS } : { ...e }, a = this.canAttemptMissingIdentifierRecovery(t);
|
|
442
442
|
for (let o = 0; o <= this.MAX_IDENTIFIER_RECOVERY_COUNT; o += 1) {
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
443
|
+
const u = this.prepareEvaluator(t, s);
|
|
444
|
+
if (u.compileFailed || u.evaluator === null)
|
|
445
445
|
return { value: null, unresolvedReference: !1 };
|
|
446
446
|
try {
|
|
447
447
|
const d = [], h = this.wrapBoundValues(s);
|
|
448
|
-
return
|
|
448
|
+
return u.bindKeys.forEach((g) => {
|
|
449
449
|
d.push(h[g]);
|
|
450
450
|
}), {
|
|
451
451
|
value: this.withBlockedPropertyAccess(
|
|
452
|
-
() =>
|
|
452
|
+
() => u.evaluator(...d)
|
|
453
453
|
),
|
|
454
454
|
unresolvedReference: !1
|
|
455
455
|
};
|
|
@@ -588,11 +588,11 @@ return (${t});`;
|
|
|
588
588
|
const r = [];
|
|
589
589
|
let i = null;
|
|
590
590
|
for (let n = 0; n < e.length; n++) {
|
|
591
|
-
const s = e[n], a = e[n + 1] || null, o = r[r.length - 1] || null,
|
|
591
|
+
const s = e[n], a = e[n + 1] || null, o = r[r.length - 1] || null, u = e[n - 2] || null, d = e[n - 3] || null;
|
|
592
592
|
if (this.startsObjectKey(
|
|
593
593
|
o,
|
|
594
594
|
i,
|
|
595
|
-
|
|
595
|
+
u,
|
|
596
596
|
d
|
|
597
597
|
) && (s.value === "[" || s.type === "identifier" && this.FORBIDDEN_PROPERTY_NAMES.has(s.value) || s.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
|
|
598
598
|
this.decodeStringLiteral(s.value)
|
|
@@ -870,8 +870,8 @@ return (${t});`;
|
|
|
870
870
|
get: (s, a, o) => {
|
|
871
871
|
if (typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a))
|
|
872
872
|
return;
|
|
873
|
-
const
|
|
874
|
-
return typeof a == "symbol" ?
|
|
873
|
+
const u = Reflect.get(s, a, o);
|
|
874
|
+
return typeof a == "symbol" ? u : this.wrapBoundValue(u, e);
|
|
875
875
|
},
|
|
876
876
|
has: (s, a) => typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a) ? !1 : Reflect.has(s, a),
|
|
877
877
|
getOwnPropertyDescriptor: (s, a) => {
|
|
@@ -879,12 +879,12 @@ return (${t});`;
|
|
|
879
879
|
return Reflect.getOwnPropertyDescriptor(s, a);
|
|
880
880
|
},
|
|
881
881
|
apply: (s, a, o) => {
|
|
882
|
-
const
|
|
882
|
+
const u = Reflect.apply(
|
|
883
883
|
s,
|
|
884
884
|
a,
|
|
885
885
|
o
|
|
886
886
|
);
|
|
887
|
-
return this.isIteratorLike(
|
|
887
|
+
return this.isIteratorLike(u) ? u : this.wrapBoundValue(u, e);
|
|
888
888
|
},
|
|
889
889
|
construct: (s, a, o) => this.wrapBoundValue(
|
|
890
890
|
Reflect.construct(
|
|
@@ -1084,7 +1084,7 @@ B.MAX_IDENTIFIER_RECOVERY_COUNT = 8, B.BUILTIN_NAMESPACE = "haori", B.BUILTIN_HE
|
|
|
1084
1084
|
"with",
|
|
1085
1085
|
"yield"
|
|
1086
1086
|
]), B.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
|
|
1087
|
-
let
|
|
1087
|
+
let z = B;
|
|
1088
1088
|
class dt {
|
|
1089
1089
|
constructor() {
|
|
1090
1090
|
this.MAX_BUDGET = 8, this.queue = [], this.processing = !1;
|
|
@@ -1216,7 +1216,7 @@ const pt = class pt {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
1218
1218
|
pt.ASYNC_QUEUE = new dt();
|
|
1219
|
-
let
|
|
1219
|
+
let P = pt;
|
|
1220
1220
|
const N = class N {
|
|
1221
1221
|
/**
|
|
1222
1222
|
* 集計状態を初期化します。
|
|
@@ -1460,7 +1460,7 @@ const Y = class Y {
|
|
|
1460
1460
|
let e;
|
|
1461
1461
|
switch (t.nodeType) {
|
|
1462
1462
|
case Node.ELEMENT_NODE:
|
|
1463
|
-
e = new
|
|
1463
|
+
e = new M(t);
|
|
1464
1464
|
break;
|
|
1465
1465
|
case Node.TEXT_NODE:
|
|
1466
1466
|
e = new U(t);
|
|
@@ -1491,7 +1491,7 @@ const Y = class Y {
|
|
|
1491
1491
|
return Promise.resolve();
|
|
1492
1492
|
if (this.parent) {
|
|
1493
1493
|
const t = this.parent, e = t.skipMutationNodes;
|
|
1494
|
-
return
|
|
1494
|
+
return P.enqueue(() => {
|
|
1495
1495
|
t.skipMutationNodes = !0, this.target.parentNode === t.getTarget() && t.getTarget().removeChild(this.target), this.mounted = !1;
|
|
1496
1496
|
}).finally(() => {
|
|
1497
1497
|
t.skipMutationNodes = e;
|
|
@@ -1499,7 +1499,7 @@ const Y = class Y {
|
|
|
1499
1499
|
} else {
|
|
1500
1500
|
const t = this.target.parentNode;
|
|
1501
1501
|
if (t)
|
|
1502
|
-
return
|
|
1502
|
+
return P.enqueue(() => {
|
|
1503
1503
|
this.target.parentNode === t && t.removeChild(this.target), this.mounted = !1;
|
|
1504
1504
|
});
|
|
1505
1505
|
this.mounted = !1;
|
|
@@ -1516,7 +1516,7 @@ const Y = class Y {
|
|
|
1516
1516
|
return Promise.resolve();
|
|
1517
1517
|
if (this.parent) {
|
|
1518
1518
|
const t = this.parent, e = t.skipMutationNodes;
|
|
1519
|
-
return
|
|
1519
|
+
return P.enqueue(() => {
|
|
1520
1520
|
t.skipMutationNodes = !0, this.target.parentNode !== t.getTarget() && t.getTarget().appendChild(this.target), this.mounted = !0;
|
|
1521
1521
|
}).finally(() => {
|
|
1522
1522
|
t.skipMutationNodes = e;
|
|
@@ -1576,7 +1576,7 @@ const Y = class Y {
|
|
|
1576
1576
|
};
|
|
1577
1577
|
Y.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
1578
1578
|
let T = Y;
|
|
1579
|
-
const
|
|
1579
|
+
const W = class W extends T {
|
|
1580
1580
|
/**
|
|
1581
1581
|
* エレメントフラグメントのコンストラクタ。
|
|
1582
1582
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -1599,7 +1599,7 @@ const z = class z extends T {
|
|
|
1599
1599
|
"month",
|
|
1600
1600
|
"time",
|
|
1601
1601
|
"week"
|
|
1602
|
-
], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.
|
|
1602
|
+
], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.initialBindAttribute = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.value = null, this.skipMutationAttributes = !1, this.skipChangeValue = !1, this.selfWrittenBind = /* @__PURE__ */ new Map(), this.syncValue(), this.initialBindAttribute = t.getAttribute(`${l.prefix}bind`), t.getAttributeNames().forEach((e) => {
|
|
1603
1603
|
const r = t.getAttribute(e);
|
|
1604
1604
|
if (r !== null && !this.attributeMap.has(e)) {
|
|
1605
1605
|
const i = new rt(e, r);
|
|
@@ -1625,7 +1625,7 @@ const z = class z extends T {
|
|
|
1625
1625
|
*/
|
|
1626
1626
|
getChildElementFragments() {
|
|
1627
1627
|
return this.children.filter(
|
|
1628
|
-
(t) => t instanceof
|
|
1628
|
+
(t) => t instanceof W
|
|
1629
1629
|
);
|
|
1630
1630
|
}
|
|
1631
1631
|
/**
|
|
@@ -1657,7 +1657,7 @@ const z = class z extends T {
|
|
|
1657
1657
|
* @returns クローンされたフラグメント
|
|
1658
1658
|
*/
|
|
1659
1659
|
clone() {
|
|
1660
|
-
const t = new
|
|
1660
|
+
const t = new W(
|
|
1661
1661
|
this.target.cloneNode(!1)
|
|
1662
1662
|
);
|
|
1663
1663
|
return this.attributeMap.forEach((e, r) => {
|
|
@@ -1672,7 +1672,7 @@ const z = class z extends T {
|
|
|
1672
1672
|
*/
|
|
1673
1673
|
normalizeClonedVisibilityState() {
|
|
1674
1674
|
(this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${l.prefix}if-false`)) && (this.visible = !0, this.display = null, this.displayPriority = null, this.getTarget().style.removeProperty("display"), this.getTarget().removeAttribute(`${l.prefix}if-false`)), this.children.forEach((t) => {
|
|
1675
|
-
t instanceof
|
|
1675
|
+
t instanceof W && t.normalizeClonedVisibilityState();
|
|
1676
1676
|
});
|
|
1677
1677
|
}
|
|
1678
1678
|
/**
|
|
@@ -1723,6 +1723,25 @@ const z = class z extends T {
|
|
|
1723
1723
|
getRawBindingData() {
|
|
1724
1724
|
return this.bindingData;
|
|
1725
1725
|
}
|
|
1726
|
+
/**
|
|
1727
|
+
* `data-bind` 属性への自己書き込みを記録します(DOM へ実際に書き込んだ時に呼ぶ)。
|
|
1728
|
+
*
|
|
1729
|
+
* @param value 書き込んだ属性値
|
|
1730
|
+
*/
|
|
1731
|
+
recordSelfWrittenBind(t) {
|
|
1732
|
+
this.selfWrittenBind.size > 64 && this.selfWrittenBind.clear(), this.selfWrittenBind.set(t, (this.selfWrittenBind.get(t) ?? 0) + 1);
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* 指定値が Haori 自身の `data-bind` 書き込みのエコーかどうかを判定し、該当すれば
|
|
1736
|
+
* 記録を 1 つ消費します。
|
|
1737
|
+
*
|
|
1738
|
+
* @param value MutationObserver が観測した属性値
|
|
1739
|
+
* @returns 自己書き込みのエコーであれば true(再取り込みをスキップしてよい)
|
|
1740
|
+
*/
|
|
1741
|
+
consumeSelfWrittenBind(t) {
|
|
1742
|
+
const e = this.selfWrittenBind.get(t);
|
|
1743
|
+
return e === void 0 ? !1 : (e <= 1 ? this.selfWrittenBind.delete(t) : this.selfWrittenBind.set(t, e - 1), !0);
|
|
1744
|
+
}
|
|
1726
1745
|
/**
|
|
1727
1746
|
* 生の派生バインドデータを取得します。
|
|
1728
1747
|
*
|
|
@@ -1744,25 +1763,24 @@ const z = class z extends T {
|
|
|
1744
1763
|
* (FIFO)で直列実行します。並行呼出による適用順の逆転(古いデータが後から
|
|
1745
1764
|
* 適用されて新しい値を上書きする現象)を防ぎます。
|
|
1746
1765
|
*
|
|
1747
|
-
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1766
|
+
* 純粋な FIFO(並行呼出を決して即時インライン実行しない)です。以前は実行中
|
|
1767
|
+
* フラグでの「再入即時実行」を行っていましたが、await をまたいで届く**独立した
|
|
1768
|
+
* 並行呼出**まで再入扱いしてインライン実行し、`skipMutationAttributes` 中の
|
|
1769
|
+
* `data-bind` 書き込みが破棄されて古い値が後勝ちする競合の原因になっていました。
|
|
1770
|
+
* 真の再入(data-url-param 等)は呼出側がキューを介さず実行するため、ここでは
|
|
1771
|
+
* 一律にチェーンへ積みます。
|
|
1750
1772
|
*
|
|
1751
1773
|
* @param work 直列化したいバインドデータ更新処理
|
|
1752
1774
|
* @returns work の完了 Promise
|
|
1753
1775
|
*/
|
|
1754
1776
|
enqueueBindingWork(t) {
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
const e = () => (this.processingBindingWork = !0, Promise.resolve().then(t).finally(() => {
|
|
1758
|
-
this.processingBindingWork = !1;
|
|
1759
|
-
})), r = this.bindingWorkChain.then(e, e);
|
|
1760
|
-
return this.bindingWorkChain = r.then(
|
|
1777
|
+
const e = this.bindingWorkChain.then(t, t);
|
|
1778
|
+
return this.bindingWorkChain = e.then(
|
|
1761
1779
|
() => {
|
|
1762
1780
|
},
|
|
1763
1781
|
() => {
|
|
1764
1782
|
}
|
|
1765
|
-
),
|
|
1783
|
+
), e;
|
|
1766
1784
|
}
|
|
1767
1785
|
/**
|
|
1768
1786
|
* 生成時点の data-bind 属性の生値を取得します。
|
|
@@ -1795,7 +1813,7 @@ const z = class z extends T {
|
|
|
1795
1813
|
*/
|
|
1796
1814
|
clearBindingDataCache() {
|
|
1797
1815
|
this.bindingDataCache = null, this.descendantBindingDataCache = null, this.children.forEach((t) => {
|
|
1798
|
-
t instanceof
|
|
1816
|
+
t instanceof W && t.clearBindingDataCache();
|
|
1799
1817
|
});
|
|
1800
1818
|
}
|
|
1801
1819
|
/**
|
|
@@ -1947,14 +1965,14 @@ const z = class z extends T {
|
|
|
1947
1965
|
if (r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio")) {
|
|
1948
1966
|
const i = this.getAttribute("value"), n = r.type === "checkbox" && i === "true";
|
|
1949
1967
|
let s;
|
|
1950
|
-
return n ? s = t === !0 || t === "true" : i === "false" ? s = t === !1 : Array.isArray(t) ? s = t.map(String).includes(String(i)) : s = i === String(t), n ? this.value = s : s ? Array.isArray(t) ? this.value = String(i) : this.value = t : this.value = null, r.checked === s ? Promise.resolve() : (this.skipChangeValue = !0,
|
|
1968
|
+
return n ? s = t === !0 || t === "true" : i === "false" ? s = t === !1 : Array.isArray(t) ? s = t.map(String).includes(String(i)) : s = i === String(t), n ? this.value = s : s ? Array.isArray(t) ? this.value = String(i) : this.value = t : this.value = null, r.checked === s ? Promise.resolve() : (this.skipChangeValue = !0, P.enqueue(() => {
|
|
1951
1969
|
r.checked = s, e && r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1952
1970
|
}).finally(() => {
|
|
1953
1971
|
this.skipChangeValue = !1;
|
|
1954
1972
|
}));
|
|
1955
1973
|
} else if (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement) {
|
|
1956
1974
|
const i = Array.isArray(t) ? t.join(",") : t;
|
|
1957
|
-
return this.value = this.normalizeValueForElement(r, i), this.skipChangeValue = !0,
|
|
1975
|
+
return this.value = this.normalizeValueForElement(r, i), this.skipChangeValue = !0, P.enqueue(() => {
|
|
1958
1976
|
r.value = i === null ? "" : String(i), e && ((r instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(r.type) || r instanceof HTMLTextAreaElement) && r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
1959
1977
|
}).finally(() => {
|
|
1960
1978
|
this.skipChangeValue = !1;
|
|
@@ -2062,7 +2080,7 @@ const z = class z extends T {
|
|
|
2062
2080
|
return Promise.resolve();
|
|
2063
2081
|
this.attributeMap.delete(t), this.skipMutationAttributes = !0;
|
|
2064
2082
|
const r = this.getTarget();
|
|
2065
|
-
return
|
|
2083
|
+
return P.enqueue(() => {
|
|
2066
2084
|
r.removeAttribute(t), e !== t && r.removeAttribute(e);
|
|
2067
2085
|
}).finally(() => {
|
|
2068
2086
|
this.skipMutationAttributes = !1;
|
|
@@ -2086,7 +2104,7 @@ const z = class z extends T {
|
|
|
2086
2104
|
if (n) {
|
|
2087
2105
|
const ot = this.attributeMap.get(t);
|
|
2088
2106
|
if (ot && (ot.isEvaluate || ot.isForceEvaluation()) && !s.isEvaluate && !s.isForceEvaluation())
|
|
2089
|
-
return this.skipMutationAttributes = !0,
|
|
2107
|
+
return this.skipMutationAttributes = !0, P.enqueue(() => {
|
|
2090
2108
|
}).finally(() => {
|
|
2091
2109
|
this.skipMutationAttributes = !1;
|
|
2092
2110
|
});
|
|
@@ -2097,9 +2115,9 @@ const z = class z extends T {
|
|
|
2097
2115
|
element: a,
|
|
2098
2116
|
rawName: t,
|
|
2099
2117
|
template: r
|
|
2100
|
-
}),
|
|
2101
|
-
return !F && !I && !$ && !mt && !bt ? (A && !b && S !== null && (this.value = this.normalizeValueForElement(a, S)), Promise.resolve()) : (this.skipMutationAttributes = !0,
|
|
2102
|
-
F && a.setAttribute(t, r), S === null ? a.removeAttribute(e) : (I && a.setAttribute(e, S), A && !b && (this.value = this.normalizeValueForElement(a, S), $ && (a.value = S))), mt && (a.checked = _), bt && (a.selected = _);
|
|
2118
|
+
}), u = s.isEvaluate || s.isRawEvaluate, d = t === e && W.BOOLEAN_ATTRIBUTES.has(e.toLowerCase()), h = s.isSingleExpression(), g = K.joinEvaluateResults(o.results), E = o.results.length === 1 ? o.results[0] : g, w = !s.isForceEvaluation() && (e !== t || d || h ? o.hasUnresolvedReference || E === null || E === void 0 || E === !1 : u && g === ""), k = s.isForceEvaluation() ? r : h ? E : g, A = i && s.isEvaluate && e === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), v = a.getRootNode(), b = A && a === v.activeElement, S = w || k === null || k === !1 ? null : String(k), F = t !== e && a.getAttribute(t) !== r, I = S === null ? a.hasAttribute(e) : a.getAttribute(e) !== S, $ = A && !b && S !== null && a.value !== S, V = e === "checked" && a instanceof HTMLInputElement && (a.type === "checkbox" || a.type === "radio"), C = e === "selected" && a instanceof HTMLOptionElement, Q = v.activeElement, gt = Q !== null && (V && a === Q || C && a.closest("select") === Q), _ = S !== null, mt = V && !gt && a.checked !== _, bt = C && !gt && a.selected !== _;
|
|
2119
|
+
return !F && !I && !$ && !mt && !bt ? (A && !b && S !== null && (this.value = this.normalizeValueForElement(a, S)), Promise.resolve()) : (this.skipMutationAttributes = !0, P.enqueue(() => {
|
|
2120
|
+
F && a.setAttribute(t, r), S === null ? a.removeAttribute(e) : (I && (a.setAttribute(e, S), e === `${l.prefix}bind` && this.recordSelfWrittenBind(S)), A && !b && (this.value = this.normalizeValueForElement(a, S), $ && (a.value = S))), mt && (a.checked = _), bt && (a.selected = _);
|
|
2103
2121
|
}).finally(() => {
|
|
2104
2122
|
this.skipMutationAttributes = !1;
|
|
2105
2123
|
}));
|
|
@@ -2115,7 +2133,7 @@ const z = class z extends T {
|
|
|
2115
2133
|
return Promise.resolve();
|
|
2116
2134
|
this.attributeMap.delete(t), this.skipMutationAttributes = !0;
|
|
2117
2135
|
const e = this.getTarget();
|
|
2118
|
-
return
|
|
2136
|
+
return P.enqueue(() => {
|
|
2119
2137
|
e.removeAttribute(t);
|
|
2120
2138
|
}).finally(() => {
|
|
2121
2139
|
this.skipMutationAttributes = !1;
|
|
@@ -2228,8 +2246,8 @@ const z = class z extends T {
|
|
|
2228
2246
|
const s = t.getParent() === this;
|
|
2229
2247
|
let a = -1, o = -1;
|
|
2230
2248
|
s && (a = this.children.indexOf(t), e !== null && (o = this.children.indexOf(e)));
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2249
|
+
const u = t.getParent();
|
|
2250
|
+
u !== null && u.removeChild(t);
|
|
2233
2251
|
let d = r === void 0 ? e?.getTarget() || null : r;
|
|
2234
2252
|
if (e === null)
|
|
2235
2253
|
this.children.push(t);
|
|
@@ -2250,7 +2268,7 @@ const z = class z extends T {
|
|
|
2250
2268
|
}
|
|
2251
2269
|
t.setParent(this), t.setMounted(this.mounted);
|
|
2252
2270
|
const h = this.skipMutationNodes;
|
|
2253
|
-
return this.skipMutationNodes = !0,
|
|
2271
|
+
return this.skipMutationNodes = !0, P.enqueue(() => {
|
|
2254
2272
|
this.target.insertBefore(t.getTarget(), d);
|
|
2255
2273
|
}).finally(() => {
|
|
2256
2274
|
this.skipMutationNodes = h;
|
|
@@ -2359,7 +2377,7 @@ const z = class z extends T {
|
|
|
2359
2377
|
return e === null ? null : e.closestByAttribute(t);
|
|
2360
2378
|
}
|
|
2361
2379
|
};
|
|
2362
|
-
|
|
2380
|
+
W.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
2363
2381
|
"allowfullscreen",
|
|
2364
2382
|
"async",
|
|
2365
2383
|
"autofocus",
|
|
@@ -2384,7 +2402,7 @@ z.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
2384
2402
|
"reversed",
|
|
2385
2403
|
"selected"
|
|
2386
2404
|
]);
|
|
2387
|
-
let
|
|
2405
|
+
let M = W;
|
|
2388
2406
|
class U extends T {
|
|
2389
2407
|
/**
|
|
2390
2408
|
* テキストフラグメントのコンストラクタ。
|
|
@@ -2437,7 +2455,7 @@ class U extends T {
|
|
|
2437
2455
|
evaluate() {
|
|
2438
2456
|
return this.contents.isRawEvaluate && this.parent === null ? Promise.reject(
|
|
2439
2457
|
new Error("Parent fragment is required for raw evaluation")
|
|
2440
|
-
) :
|
|
2458
|
+
) : P.enqueue(() => {
|
|
2441
2459
|
this.skipMutation = !0;
|
|
2442
2460
|
let t = this.text;
|
|
2443
2461
|
this.contents.isRawEvaluate ? t = this.contents.evaluate(
|
|
@@ -2497,7 +2515,7 @@ class ft extends T {
|
|
|
2497
2515
|
* @return 更新のPromise
|
|
2498
2516
|
*/
|
|
2499
2517
|
setContent(t) {
|
|
2500
|
-
return this.skipMutation || this.text === t ? Promise.resolve() : (this.text = t,
|
|
2518
|
+
return this.skipMutation || this.text === t ? Promise.resolve() : (this.text = t, P.enqueue(() => {
|
|
2501
2519
|
this.skipMutation = !0, this.target.textContent = this.text;
|
|
2502
2520
|
}).finally(() => {
|
|
2503
2521
|
this.skipMutation = !1;
|
|
@@ -2606,25 +2624,25 @@ const nt = class nt {
|
|
|
2606
2624
|
evaluateWithProfile(t, e, r, i) {
|
|
2607
2625
|
const n = [], s = [];
|
|
2608
2626
|
let a = 0, o = !1;
|
|
2609
|
-
return this.contents.forEach((
|
|
2627
|
+
return this.contents.forEach((u) => {
|
|
2610
2628
|
try {
|
|
2611
|
-
if (r(
|
|
2629
|
+
if (r(u)) {
|
|
2612
2630
|
const d = et.measure(
|
|
2613
|
-
() =>
|
|
2631
|
+
() => z.evaluateDetailed(u.text, t)
|
|
2614
2632
|
), h = d.value;
|
|
2615
2633
|
a += d.durationMs, s.push({
|
|
2616
|
-
expression:
|
|
2634
|
+
expression: u.text,
|
|
2617
2635
|
durationMs: d.durationMs
|
|
2618
2636
|
}), o = o || h.unresolvedReference, n.push(h.value);
|
|
2619
2637
|
} else
|
|
2620
|
-
n.push(
|
|
2638
|
+
n.push(u.text);
|
|
2621
2639
|
} catch (d) {
|
|
2622
2640
|
m.error(
|
|
2623
2641
|
"[Haori]",
|
|
2624
|
-
`Error evaluating ${i} expression: ${
|
|
2642
|
+
`Error evaluating ${i} expression: ${u.text}`,
|
|
2625
2643
|
d
|
|
2626
2644
|
), s.push({
|
|
2627
|
-
expression:
|
|
2645
|
+
expression: u.text,
|
|
2628
2646
|
durationMs: 0
|
|
2629
2647
|
}), n.push("");
|
|
2630
2648
|
}
|
|
@@ -2731,7 +2749,7 @@ class Z {
|
|
|
2731
2749
|
* @return すべてのレンダリングが完了したら解決される Promise
|
|
2732
2750
|
*/
|
|
2733
2751
|
static waitForRenders() {
|
|
2734
|
-
return
|
|
2752
|
+
return P.waitForIdle();
|
|
2735
2753
|
}
|
|
2736
2754
|
/**
|
|
2737
2755
|
* 通知ダイアログを表示します。
|
|
@@ -2740,7 +2758,7 @@ class Z {
|
|
|
2740
2758
|
* @returns 通知が閉じられると解決されるPromise
|
|
2741
2759
|
*/
|
|
2742
2760
|
static dialog(t) {
|
|
2743
|
-
return
|
|
2761
|
+
return P.enqueue(() => {
|
|
2744
2762
|
window.alert(t);
|
|
2745
2763
|
}, !0);
|
|
2746
2764
|
}
|
|
@@ -2768,7 +2786,7 @@ class Z {
|
|
|
2768
2786
|
* @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
|
|
2769
2787
|
*/
|
|
2770
2788
|
static confirm(t) {
|
|
2771
|
-
return
|
|
2789
|
+
return P.enqueue(() => window.confirm(t), !0);
|
|
2772
2790
|
}
|
|
2773
2791
|
/**
|
|
2774
2792
|
* ダイアログを開きます。
|
|
@@ -2776,7 +2794,7 @@ class Z {
|
|
|
2776
2794
|
* @param element 開くダイアログのHTML要素
|
|
2777
2795
|
*/
|
|
2778
2796
|
static openDialog(t) {
|
|
2779
|
-
return
|
|
2797
|
+
return P.enqueue(() => {
|
|
2780
2798
|
t instanceof HTMLDialogElement ? t.showModal() : m.error("[Haori]", "Element is not a dialog: ", t);
|
|
2781
2799
|
}, !0);
|
|
2782
2800
|
}
|
|
@@ -2786,7 +2804,7 @@ class Z {
|
|
|
2786
2804
|
* @param element 閉じるダイアログのHTML要素
|
|
2787
2805
|
*/
|
|
2788
2806
|
static closeDialog(t) {
|
|
2789
|
-
return
|
|
2807
|
+
return P.enqueue(() => {
|
|
2790
2808
|
t instanceof HTMLDialogElement ? t.close() : m.error("[Haori]", "Element is not a dialog: ", t);
|
|
2791
2809
|
}, !0);
|
|
2792
2810
|
}
|
|
@@ -2807,7 +2825,7 @@ class Z {
|
|
|
2807
2825
|
* @param level メッセージのレベル(省略可能)
|
|
2808
2826
|
*/
|
|
2809
2827
|
static addMessage(t, e, r) {
|
|
2810
|
-
return
|
|
2828
|
+
return P.enqueue(() => {
|
|
2811
2829
|
const i = t instanceof HTMLFormElement ? t : t.parentElement ?? t;
|
|
2812
2830
|
i.setAttribute("data-message", e), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
|
|
2813
2831
|
}, !0);
|
|
@@ -2818,7 +2836,7 @@ class Z {
|
|
|
2818
2836
|
* @param parent メッセージをクリアする親要素
|
|
2819
2837
|
*/
|
|
2820
2838
|
static clearMessages(t) {
|
|
2821
|
-
return
|
|
2839
|
+
return P.enqueue(() => {
|
|
2822
2840
|
t.removeAttribute("data-message"), t.removeAttribute("data-message-level"), t.querySelectorAll("[data-message]").forEach((e) => {
|
|
2823
2841
|
e.removeAttribute("data-message"), e.removeAttribute("data-message-level");
|
|
2824
2842
|
});
|
|
@@ -3058,11 +3076,11 @@ class y {
|
|
|
3058
3076
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
3059
3077
|
*/
|
|
3060
3078
|
static setPartValues(t, e, r = null, i = !1, n = !0) {
|
|
3061
|
-
const s = [], a = t.getAttribute("name"), o = t.getAttribute(`${l.prefix}form-object`),
|
|
3079
|
+
const s = [], a = t.getAttribute("name"), o = t.getAttribute(`${l.prefix}form-object`), u = t.getAttribute(`${l.prefix}form-list`), d = t.getAttribute(`${l.prefix}form-detach`);
|
|
3062
3080
|
if (a) {
|
|
3063
3081
|
if (!d || i) {
|
|
3064
3082
|
const h = e[String(a)];
|
|
3065
|
-
|
|
3083
|
+
u && Array.isArray(h) && r !== null ? s.push(
|
|
3066
3084
|
y.applyFragmentValue(t, h[r] ?? null, n)
|
|
3067
3085
|
) : typeof h > "u" || (Array.isArray(h) && y.isGroupedCheckable(t) || typeof h == "string" || typeof h == "number" || typeof h == "boolean" || h === null ? s.push(
|
|
3068
3086
|
y.applyFragmentValue(
|
|
@@ -3087,8 +3105,8 @@ class y {
|
|
|
3087
3105
|
n
|
|
3088
3106
|
)
|
|
3089
3107
|
);
|
|
3090
|
-
} else if (
|
|
3091
|
-
const h = e[String(
|
|
3108
|
+
} else if (u) {
|
|
3109
|
+
const h = e[String(u)];
|
|
3092
3110
|
if (Array.isArray(h)) {
|
|
3093
3111
|
const g = t.getChildElementFragments();
|
|
3094
3112
|
for (let E = 0; E < g.length; E++) {
|
|
@@ -3123,7 +3141,7 @@ class y {
|
|
|
3123
3141
|
y.clearValues(t), await Promise.all([
|
|
3124
3142
|
y.clearMessages(t),
|
|
3125
3143
|
y.clearEachClones(t)
|
|
3126
|
-
]), await
|
|
3144
|
+
]), await P.enqueue(() => {
|
|
3127
3145
|
const r = t.getTarget();
|
|
3128
3146
|
if (r instanceof HTMLFormElement)
|
|
3129
3147
|
r.reset();
|
|
@@ -3139,7 +3157,7 @@ class y {
|
|
|
3139
3157
|
const e = y.collectBindingTargetForms(t);
|
|
3140
3158
|
for (const r of e) {
|
|
3141
3159
|
const i = y.getInitialBindingData(r);
|
|
3142
|
-
i && await
|
|
3160
|
+
i && await x.setBindingData(r.getTarget(), i);
|
|
3143
3161
|
}
|
|
3144
3162
|
y.syncValuesFromDom(t);
|
|
3145
3163
|
for (const r of e) {
|
|
@@ -3147,9 +3165,9 @@ class y {
|
|
|
3147
3165
|
if (r.getRawBindingData() === null && i === null)
|
|
3148
3166
|
continue;
|
|
3149
3167
|
const n = y.getValues(r), s = r.getAttribute(`${l.prefix}form-arg`), a = { ...i || {} };
|
|
3150
|
-
s ? a[String(s)] = n : Object.assign(a, n), await
|
|
3168
|
+
s ? a[String(s)] = n : Object.assign(a, n), await x.setBindingData(r.getTarget(), a);
|
|
3151
3169
|
}
|
|
3152
|
-
await
|
|
3170
|
+
await x.evaluateAll(t);
|
|
3153
3171
|
}
|
|
3154
3172
|
/**
|
|
3155
3173
|
* data-bind 属性で宣言された初期バインドデータを取得します。
|
|
@@ -3159,7 +3177,7 @@ class y {
|
|
|
3159
3177
|
*/
|
|
3160
3178
|
static getInitialBindingData(t) {
|
|
3161
3179
|
const e = t.getInitialBindAttribute();
|
|
3162
|
-
return e === null ? null :
|
|
3180
|
+
return e === null ? null : x.parseDataBind(e);
|
|
3163
3181
|
}
|
|
3164
3182
|
/**
|
|
3165
3183
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -3187,7 +3205,7 @@ class y {
|
|
|
3187
3205
|
const i = [];
|
|
3188
3206
|
for (const n of r) {
|
|
3189
3207
|
const s = T.get(n);
|
|
3190
|
-
s instanceof
|
|
3208
|
+
s instanceof M && i.push(s);
|
|
3191
3209
|
}
|
|
3192
3210
|
return i;
|
|
3193
3211
|
}
|
|
@@ -3259,10 +3277,10 @@ class y {
|
|
|
3259
3277
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
3260
3278
|
*/
|
|
3261
3279
|
static addMessage(t, e, r, i) {
|
|
3262
|
-
const n = [], s = Et(), a = s.addMessage, o = (d) => typeof a == "function" ? a.call(s, d, r, i) : s.addErrorMessage(d, r),
|
|
3263
|
-
return
|
|
3280
|
+
const n = [], s = Et(), a = s.addMessage, o = (d) => typeof a == "function" ? a.call(s, d, r, i) : s.addErrorMessage(d, r), u = y.findFragmentsByKey(t, e);
|
|
3281
|
+
return u.forEach((d) => {
|
|
3264
3282
|
n.push(o(d.getTarget()));
|
|
3265
|
-
}),
|
|
3283
|
+
}), u.length === 0 && n.push(o(t.getTarget())), Promise.all(n).then(() => {
|
|
3266
3284
|
});
|
|
3267
3285
|
}
|
|
3268
3286
|
/**
|
|
@@ -3295,7 +3313,7 @@ class y {
|
|
|
3295
3313
|
if (s !== -1 && a !== -1 && s < a) {
|
|
3296
3314
|
const o = i.substring(0, s);
|
|
3297
3315
|
if (n === o) {
|
|
3298
|
-
const
|
|
3316
|
+
const u = i.substring(s + 1, a), d = Number(u);
|
|
3299
3317
|
if (isNaN(d))
|
|
3300
3318
|
m.error("Haori", `Invalid index: ${i}`);
|
|
3301
3319
|
else {
|
|
@@ -3413,9 +3431,9 @@ class R {
|
|
|
3413
3431
|
*/
|
|
3414
3432
|
static bindChange(t, e, r, i = "other") {
|
|
3415
3433
|
const n = [], s = new Set(Object.keys(e || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...s, ...a]);
|
|
3416
|
-
for (const
|
|
3417
|
-
const d = e?.[
|
|
3418
|
-
d !== h && n.push(
|
|
3434
|
+
for (const u of o) {
|
|
3435
|
+
const d = e?.[u], h = r[u];
|
|
3436
|
+
d !== h && n.push(u);
|
|
3419
3437
|
}
|
|
3420
3438
|
R.dispatch(t, "bindchange", {
|
|
3421
3439
|
previous: e || {},
|
|
@@ -3561,7 +3579,7 @@ const Ht = {
|
|
|
3561
3579
|
function Lt(p, t) {
|
|
3562
3580
|
return p.replace(/\{\{([\s\S]+?)\}\}/g, (e, r) => {
|
|
3563
3581
|
try {
|
|
3564
|
-
const i =
|
|
3582
|
+
const i = z.evaluate(String(r).trim(), t);
|
|
3565
3583
|
return i == null ? "" : String(i);
|
|
3566
3584
|
} catch {
|
|
3567
3585
|
return "";
|
|
@@ -3574,7 +3592,7 @@ function Ut(p, t) {
|
|
|
3574
3592
|
return null;
|
|
3575
3593
|
if (!e.includes("{{"))
|
|
3576
3594
|
return e;
|
|
3577
|
-
const r = T.get(p), i = r instanceof
|
|
3595
|
+
const r = T.get(p), i = r instanceof M ? r.getBindingData() : {}, n = Lt(e, i);
|
|
3578
3596
|
return n === "" ? null : n;
|
|
3579
3597
|
}
|
|
3580
3598
|
function Mt(p) {
|
|
@@ -3611,10 +3629,10 @@ function ut() {
|
|
|
3611
3629
|
) ? t : Z;
|
|
3612
3630
|
}
|
|
3613
3631
|
const qt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
3614
|
-
function
|
|
3632
|
+
function Wt(p) {
|
|
3615
3633
|
return qt.has(p.toUpperCase());
|
|
3616
3634
|
}
|
|
3617
|
-
function
|
|
3635
|
+
function zt(p, t) {
|
|
3618
3636
|
for (const [e, r] of Object.entries(t))
|
|
3619
3637
|
r !== void 0 && (r === null ? p.append(e, "") : Array.isArray(r) ? r.forEach((i) => {
|
|
3620
3638
|
p.append(e, String(i));
|
|
@@ -3622,7 +3640,7 @@ function Wt(p, t) {
|
|
|
3622
3640
|
}
|
|
3623
3641
|
function Kt(p, t) {
|
|
3624
3642
|
const e = new URL(p, window.location.href), r = new URLSearchParams(e.search);
|
|
3625
|
-
return
|
|
3643
|
+
return zt(r, t), e.search = r.toString(), e.toString();
|
|
3626
3644
|
}
|
|
3627
3645
|
function Gt(p) {
|
|
3628
3646
|
return p == null ? null : typeof p == "string" ? p : p instanceof URLSearchParams ? p.toString() : p instanceof FormData ? Array.from(p.entries()).map(([t, e]) => e instanceof File ? [
|
|
@@ -3681,7 +3699,7 @@ const f = class f {
|
|
|
3681
3699
|
return { value: t.replace(
|
|
3682
3700
|
f.DATA_PLACEHOLDER_REGEX,
|
|
3683
3701
|
(n, s, a) => {
|
|
3684
|
-
const o =
|
|
3702
|
+
const o = z.evaluateDetailed(
|
|
3685
3703
|
s ?? a ?? "",
|
|
3686
3704
|
e
|
|
3687
3705
|
);
|
|
@@ -3761,11 +3779,11 @@ const f = class f {
|
|
|
3761
3779
|
return { value: t.replace(
|
|
3762
3780
|
f.DATA_PLACEHOLDER_REGEX,
|
|
3763
3781
|
(n, s, a, o) => {
|
|
3764
|
-
const
|
|
3782
|
+
const u = z.evaluateDetailed(
|
|
3765
3783
|
s ?? a ?? "",
|
|
3766
3784
|
e
|
|
3767
3785
|
);
|
|
3768
|
-
return r = r ||
|
|
3786
|
+
return r = r || u.unresolvedReference, f.isJsonStringContext(t, o) ? f.stringifyJsonTemplateStringContent(u.value) : f.stringifyJsonTemplateValue(u.value);
|
|
3769
3787
|
}
|
|
3770
3788
|
), hasUnresolvedReference: r };
|
|
3771
3789
|
}
|
|
@@ -3798,17 +3816,17 @@ const f = class f {
|
|
|
3798
3816
|
const a = r.trim();
|
|
3799
3817
|
if (f.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
3800
3818
|
return {
|
|
3801
|
-
value:
|
|
3819
|
+
value: x.parseDataBind(n),
|
|
3802
3820
|
hasUnresolvedReference: s
|
|
3803
3821
|
};
|
|
3804
3822
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
3805
|
-
const
|
|
3823
|
+
const u = f.resolveDataJsonStringDetailed(
|
|
3806
3824
|
r,
|
|
3807
3825
|
t.getBindingData()
|
|
3808
3826
|
);
|
|
3809
3827
|
return {
|
|
3810
|
-
value:
|
|
3811
|
-
hasUnresolvedReference: s ||
|
|
3828
|
+
value: x.parseDataBind(u.value),
|
|
3829
|
+
hasUnresolvedReference: s || u.hasUnresolvedReference
|
|
3812
3830
|
};
|
|
3813
3831
|
}
|
|
3814
3832
|
const o = f.resolveDataParamStringDetailed(
|
|
@@ -3816,7 +3834,7 @@ const f = class f {
|
|
|
3816
3834
|
t.getBindingData()
|
|
3817
3835
|
);
|
|
3818
3836
|
return {
|
|
3819
|
-
value:
|
|
3837
|
+
value: x.parseDataBind(o.value),
|
|
3820
3838
|
hasUnresolvedReference: s || o.hasUnresolvedReference
|
|
3821
3839
|
};
|
|
3822
3840
|
}
|
|
@@ -3909,7 +3927,7 @@ ${v}
|
|
|
3909
3927
|
A
|
|
3910
3928
|
);
|
|
3911
3929
|
try {
|
|
3912
|
-
s.headers =
|
|
3930
|
+
s.headers = x.parseDataBind(v);
|
|
3913
3931
|
} catch (b) {
|
|
3914
3932
|
m.error("Haori", `Invalid fetch headers: ${b}`);
|
|
3915
3933
|
}
|
|
@@ -3925,7 +3943,7 @@ ${v}
|
|
|
3925
3943
|
A
|
|
3926
3944
|
);
|
|
3927
3945
|
try {
|
|
3928
|
-
s.headers =
|
|
3946
|
+
s.headers = x.parseDataBind(v);
|
|
3929
3947
|
} catch (b) {
|
|
3930
3948
|
m.error("Haori", `Invalid fetch headers: ${b}`);
|
|
3931
3949
|
}
|
|
@@ -3987,7 +4005,7 @@ ${v}
|
|
|
3987
4005
|
);
|
|
3988
4006
|
}
|
|
3989
4007
|
}
|
|
3990
|
-
const o = f.attrName(e, "bind-arg"),
|
|
4008
|
+
const o = f.attrName(e, "bind-arg"), u = f.attrName(
|
|
3991
4009
|
null,
|
|
3992
4010
|
"arg",
|
|
3993
4011
|
!0
|
|
@@ -3996,8 +4014,8 @@ ${v}
|
|
|
3996
4014
|
"bind-arg",
|
|
3997
4015
|
!0
|
|
3998
4016
|
);
|
|
3999
|
-
e ? t.hasAttribute(o) && (r.bindArg = t.getRawAttribute(o)) : t.hasAttribute(
|
|
4000
|
-
|
|
4017
|
+
e ? t.hasAttribute(o) && (r.bindArg = t.getRawAttribute(o)) : t.hasAttribute(u) ? r.bindArg = t.getRawAttribute(
|
|
4018
|
+
u
|
|
4001
4019
|
) : t.hasAttribute(d) && (r.bindArg = t.getRawAttribute(d));
|
|
4002
4020
|
const h = e ? f.attrName(e, "bind-params") : f.attrName(null, "bind-params", !0);
|
|
4003
4021
|
if (t.hasAttribute(h)) {
|
|
@@ -4299,14 +4317,14 @@ ${b}
|
|
|
4299
4317
|
}
|
|
4300
4318
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && a) {
|
|
4301
4319
|
const d = this.options.formFragment, h = d.getTarget(), g = /* @__PURE__ */ new Set();
|
|
4302
|
-
t && t.appliedDisabledAttribute && this.options.targetFragment && g.add(this.options.targetFragment)
|
|
4320
|
+
t && t.appliedDisabledAttribute && this.options.targetFragment && g.add(this.options.targetFragment);
|
|
4303
4321
|
const E = d.getBindingData();
|
|
4304
|
-
Object.assign(E, i), await
|
|
4322
|
+
Object.assign(E, i), await x.setBindingData(h, E, g);
|
|
4305
4323
|
}
|
|
4306
|
-
const o = a ? i : {},
|
|
4324
|
+
const o = a ? i : {}, u = new Response(JSON.stringify(o), {
|
|
4307
4325
|
headers: { "Content-Type": "application/json" }
|
|
4308
4326
|
});
|
|
4309
|
-
return this.handleFetchResult(
|
|
4327
|
+
return this.handleFetchResult(u);
|
|
4310
4328
|
} finally {
|
|
4311
4329
|
this.releaseExecutionLock(t);
|
|
4312
4330
|
}
|
|
@@ -4374,7 +4392,7 @@ ${b}
|
|
|
4374
4392
|
s.push(new f(a, null).run());
|
|
4375
4393
|
}), this.options.clickFragments && this.options.clickFragments.length > 0)
|
|
4376
4394
|
for (const a of this.options.clickFragments) {
|
|
4377
|
-
await
|
|
4395
|
+
await x.evaluateAll(a);
|
|
4378
4396
|
const o = a.getTarget();
|
|
4379
4397
|
typeof o.click == "function" ? o.click() : o.dispatchEvent(
|
|
4380
4398
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -4404,12 +4422,12 @@ ${b}
|
|
|
4404
4422
|
try {
|
|
4405
4423
|
const s = t ? this.options.historyUrl : window.location.pathname, a = new URL(s, window.location.href);
|
|
4406
4424
|
if (a.origin !== window.location.origin) {
|
|
4407
|
-
const
|
|
4408
|
-
m.error("Haori",
|
|
4425
|
+
const u = "history.pushState: cross-origin URL is not allowed: " + a.toString();
|
|
4426
|
+
m.error("Haori", u);
|
|
4409
4427
|
return;
|
|
4410
4428
|
}
|
|
4411
|
-
const o = (
|
|
4412
|
-
for (const [d, h] of Object.entries(
|
|
4429
|
+
const o = (u) => {
|
|
4430
|
+
for (const [d, h] of Object.entries(u))
|
|
4413
4431
|
h != null && (Array.isArray(h) ? h.forEach((g) => a.searchParams.append(d, String(g))) : typeof h == "object" ? a.searchParams.set(d, JSON.stringify(h)) : a.searchParams.set(d, String(h)));
|
|
4414
4432
|
};
|
|
4415
4433
|
i && o(e), n && o(r), history.pushState(
|
|
@@ -4444,13 +4462,13 @@ ${b}
|
|
|
4444
4462
|
for (const o of s.messages)
|
|
4445
4463
|
typeof o == "string" && a.push({ message: o });
|
|
4446
4464
|
if (s.errors && typeof s.errors == "object")
|
|
4447
|
-
for (const [o,
|
|
4448
|
-
Array.isArray(
|
|
4449
|
-
`) }) : typeof
|
|
4465
|
+
for (const [o, u] of Object.entries(s.errors))
|
|
4466
|
+
Array.isArray(u) ? a.push({ key: o, message: u.join(`
|
|
4467
|
+
`) }) : typeof u == "string" ? a.push({ key: o, message: u }) : u != null && a.push({ key: o, message: String(u) });
|
|
4450
4468
|
if (a.length === 0)
|
|
4451
|
-
for (const [o,
|
|
4452
|
-
o === "message" || o === "messages" || o === "errors" || (Array.isArray(
|
|
4453
|
-
`) }) : typeof
|
|
4469
|
+
for (const [o, u] of Object.entries(s))
|
|
4470
|
+
o === "message" || o === "messages" || o === "errors" || (Array.isArray(u) ? a.push({ key: o, message: u.join(`
|
|
4471
|
+
`) }) : typeof u == "string" && a.push({ key: o, message: u }));
|
|
4454
4472
|
}
|
|
4455
4473
|
if (a.length === 0)
|
|
4456
4474
|
return await r(`${t.status} ${t.statusText}`), i(), !1;
|
|
@@ -4525,7 +4543,7 @@ ${b}
|
|
|
4525
4543
|
return !this.options.bindFragments || this.options.bindFragments.length === 0 ? Promise.resolve() : (t.headers.get("Content-Type")?.includes("application/json") ? t.json() : t.text()).then((r) => {
|
|
4526
4544
|
if (this.options.bindTransform)
|
|
4527
4545
|
try {
|
|
4528
|
-
r =
|
|
4546
|
+
r = z.evaluate(this.options.bindTransform, {
|
|
4529
4547
|
response: r
|
|
4530
4548
|
});
|
|
4531
4549
|
} catch (n) {
|
|
@@ -4542,15 +4560,15 @@ ${b}
|
|
|
4542
4560
|
this.options.bindFragments.forEach((n) => {
|
|
4543
4561
|
const s = { ...n.getRawBindingData() ?? {} }, a = this.options.bindArg;
|
|
4544
4562
|
if (r && typeof r == "object" && !Array.isArray(r)) {
|
|
4545
|
-
const o = s[a],
|
|
4563
|
+
const o = s[a], u = o && typeof o == "object" && !Array.isArray(o) ? o : {};
|
|
4546
4564
|
s[a] = this.mergeAppendBindingData(
|
|
4547
4565
|
n,
|
|
4548
4566
|
r,
|
|
4549
|
-
|
|
4567
|
+
u
|
|
4550
4568
|
);
|
|
4551
4569
|
} else
|
|
4552
4570
|
s[a] = r;
|
|
4553
|
-
i.push(
|
|
4571
|
+
i.push(x.setBindingData(n.getTarget(), s));
|
|
4554
4572
|
});
|
|
4555
4573
|
else {
|
|
4556
4574
|
if (typeof r == "string")
|
|
@@ -4562,7 +4580,7 @@ ${b}
|
|
|
4562
4580
|
n,
|
|
4563
4581
|
r
|
|
4564
4582
|
), a = this.options.bindMerge ? { ...n.getRawBindingData() ?? {}, ...s } : s;
|
|
4565
|
-
i.push(
|
|
4583
|
+
i.push(x.setBindingData(n.getTarget(), a));
|
|
4566
4584
|
});
|
|
4567
4585
|
}
|
|
4568
4586
|
return Promise.all(i).then(() => {
|
|
@@ -4597,7 +4615,7 @@ ${b}
|
|
|
4597
4615
|
...i.getBindingData(),
|
|
4598
4616
|
...e
|
|
4599
4617
|
};
|
|
4600
|
-
return
|
|
4618
|
+
return x.setBindingData(i.getTarget(), n);
|
|
4601
4619
|
});
|
|
4602
4620
|
return Promise.all(r).then(() => {
|
|
4603
4621
|
});
|
|
@@ -4666,8 +4684,8 @@ ${b}
|
|
|
4666
4684
|
let i = this.options.fetchUrl;
|
|
4667
4685
|
const n = { ...this.options.fetchOptions || {} }, s = new Headers(
|
|
4668
4686
|
n.headers || void 0
|
|
4669
|
-
), a = (n.method || "GET").toUpperCase(), o = l.runtime === "demo" && !
|
|
4670
|
-
if (n.method =
|
|
4687
|
+
), a = (n.method || "GET").toUpperCase(), o = l.runtime === "demo" && !Wt(a), u = o ? "GET" : a;
|
|
4688
|
+
if (n.method = u, u === "GET" || u === "HEAD" || u === "OPTIONS")
|
|
4671
4689
|
Object.keys(e).length > 0 && (i = Kt(i, e));
|
|
4672
4690
|
else if (Object.keys(e).length > 0) {
|
|
4673
4691
|
const h = s.get("Content-Type") || "";
|
|
@@ -4693,7 +4711,7 @@ ${b}
|
|
|
4693
4711
|
payload: e,
|
|
4694
4712
|
hasUnresolvedReference: !1,
|
|
4695
4713
|
requestedMethod: a,
|
|
4696
|
-
effectiveMethod:
|
|
4714
|
+
effectiveMethod: u,
|
|
4697
4715
|
queryString: d,
|
|
4698
4716
|
transportMode: o ? "query-get" : "http",
|
|
4699
4717
|
signature: Yt(i, n)
|
|
@@ -4796,7 +4814,7 @@ ${b}
|
|
|
4796
4814
|
const e = [], r = t.clone();
|
|
4797
4815
|
return e.push(
|
|
4798
4816
|
t.getParent().insertAfter(r, t)
|
|
4799
|
-
), e.push(
|
|
4817
|
+
), e.push(x.evaluateAll(r)), e.push(y.reset(r)), Promise.all(e).then(() => {
|
|
4800
4818
|
});
|
|
4801
4819
|
}
|
|
4802
4820
|
/**
|
|
@@ -4902,7 +4920,7 @@ class Jt {
|
|
|
4902
4920
|
}
|
|
4903
4921
|
}
|
|
4904
4922
|
}
|
|
4905
|
-
const
|
|
4923
|
+
const c = class c {
|
|
4906
4924
|
/**
|
|
4907
4925
|
* 遅延属性かどうか(完全名で判定)を判定します。
|
|
4908
4926
|
*
|
|
@@ -4910,7 +4928,7 @@ const u = class u {
|
|
|
4910
4928
|
* @returns 遅延属性かどうか
|
|
4911
4929
|
*/
|
|
4912
4930
|
static isDeferredAttributeName(t) {
|
|
4913
|
-
return
|
|
4931
|
+
return c.DEFERRED_ATTRIBUTE_SUFFIXES.some(
|
|
4914
4932
|
(e) => t === `${l.prefix}${e}`
|
|
4915
4933
|
);
|
|
4916
4934
|
}
|
|
@@ -4921,7 +4939,7 @@ const u = class u {
|
|
|
4921
4939
|
* @returns 除外対象かどうか
|
|
4922
4940
|
*/
|
|
4923
4941
|
static isEvaluateAllExcludedAttributeName(t) {
|
|
4924
|
-
return
|
|
4942
|
+
return c.EVALUATE_ALL_EXCLUDED_ATTRIBUTE_SUFFIXES.some(
|
|
4925
4943
|
(e) => t === `${l.prefix}${e}`
|
|
4926
4944
|
);
|
|
4927
4945
|
}
|
|
@@ -4933,7 +4951,7 @@ const u = class u {
|
|
|
4933
4951
|
* @returns 再評価する場合は true
|
|
4934
4952
|
*/
|
|
4935
4953
|
static shouldReevaluateAttribute(t, e) {
|
|
4936
|
-
return e !== null && !
|
|
4954
|
+
return e !== null && !c.isEvaluateAllExcludedAttributeName(t) && c.ATTRIBUTE_PLACEHOLDER_REGEX.test(e);
|
|
4937
4955
|
}
|
|
4938
4956
|
/**
|
|
4939
4957
|
* data-attr-* 形式の属性名から実際に更新する属性名を取得します。
|
|
@@ -4942,7 +4960,7 @@ const u = class u {
|
|
|
4942
4960
|
* @returns 実際の属性名。data-attr-* でない場合は null
|
|
4943
4961
|
*/
|
|
4944
4962
|
static getAliasedAttributeName(t) {
|
|
4945
|
-
const e = `${l.prefix}${
|
|
4963
|
+
const e = `${l.prefix}${c.ATTRIBUTE_ALIAS_SUFFIX}`;
|
|
4946
4964
|
return !t.startsWith(e) || t.length <= e.length ? null : t.slice(e.length);
|
|
4947
4965
|
}
|
|
4948
4966
|
/**
|
|
@@ -4954,8 +4972,8 @@ const u = class u {
|
|
|
4954
4972
|
*/
|
|
4955
4973
|
static isAliasedAttributeReflection(t, e) {
|
|
4956
4974
|
const r = T.get(t);
|
|
4957
|
-
return r instanceof
|
|
4958
|
-
`${l.prefix}${
|
|
4975
|
+
return r instanceof M ? r.hasAttribute(
|
|
4976
|
+
`${l.prefix}${c.ATTRIBUTE_ALIAS_SUFFIX}${e}`
|
|
4959
4977
|
) : !1;
|
|
4960
4978
|
}
|
|
4961
4979
|
/**
|
|
@@ -4969,8 +4987,8 @@ const u = class u {
|
|
|
4969
4987
|
let e = Promise.resolve();
|
|
4970
4988
|
for (const r of t.getAttributeNames()) {
|
|
4971
4989
|
const i = t.getRawAttribute(r);
|
|
4972
|
-
|
|
4973
|
-
() =>
|
|
4990
|
+
c.shouldReevaluateAttribute(r, i) && (e = e.then(
|
|
4991
|
+
() => c.setAttribute(t.getTarget(), r, i)
|
|
4974
4992
|
));
|
|
4975
4993
|
}
|
|
4976
4994
|
return e.then(() => {
|
|
@@ -4985,7 +5003,7 @@ const u = class u {
|
|
|
4985
5003
|
static reevaluateChildren(t) {
|
|
4986
5004
|
const e = [];
|
|
4987
5005
|
return t.getChildren().forEach((r) => {
|
|
4988
|
-
r instanceof
|
|
5006
|
+
r instanceof M ? e.push(c.evaluateAll(r)) : r instanceof U && e.push(c.evaluateText(r));
|
|
4989
5007
|
}), Promise.all(e).then(() => {
|
|
4990
5008
|
});
|
|
4991
5009
|
}
|
|
@@ -4996,7 +5014,7 @@ const u = class u {
|
|
|
4996
5014
|
* @returns 再評価状態
|
|
4997
5015
|
*/
|
|
4998
5016
|
static getReactiveFetchState(t) {
|
|
4999
|
-
const e =
|
|
5017
|
+
const e = c.REACTIVE_FETCH_STATES.get(t);
|
|
5000
5018
|
if (e)
|
|
5001
5019
|
return e;
|
|
5002
5020
|
const r = {
|
|
@@ -5004,7 +5022,7 @@ const u = class u {
|
|
|
5004
5022
|
running: !1,
|
|
5005
5023
|
rerunRequested: !1
|
|
5006
5024
|
};
|
|
5007
|
-
return
|
|
5025
|
+
return c.REACTIVE_FETCH_STATES.set(t, r), r;
|
|
5008
5026
|
}
|
|
5009
5027
|
/**
|
|
5010
5028
|
* data-import の再評価状態を取得します。
|
|
@@ -5013,7 +5031,7 @@ const u = class u {
|
|
|
5013
5031
|
* @returns 再評価状態
|
|
5014
5032
|
*/
|
|
5015
5033
|
static getReactiveImportState(t) {
|
|
5016
|
-
const e =
|
|
5034
|
+
const e = c.REACTIVE_IMPORT_STATES.get(t);
|
|
5017
5035
|
if (e)
|
|
5018
5036
|
return e;
|
|
5019
5037
|
const r = {
|
|
@@ -5021,7 +5039,7 @@ const u = class u {
|
|
|
5021
5039
|
running: !1,
|
|
5022
5040
|
rerunRequested: !1
|
|
5023
5041
|
};
|
|
5024
|
-
return
|
|
5042
|
+
return c.REACTIVE_IMPORT_STATES.set(t, r), r;
|
|
5025
5043
|
}
|
|
5026
5044
|
/**
|
|
5027
5045
|
* bind 更新時に data-fetch / data-import を専用ルートで再評価します。
|
|
@@ -5034,9 +5052,9 @@ const u = class u {
|
|
|
5034
5052
|
if (e.has(t))
|
|
5035
5053
|
return Promise.resolve();
|
|
5036
5054
|
const r = [];
|
|
5037
|
-
return t.hasAttribute(`${l.prefix}fetch`) && r.push(
|
|
5038
|
-
i instanceof
|
|
5039
|
-
|
|
5055
|
+
return t.hasAttribute(`${l.prefix}fetch`) && r.push(c.executeManagedFetch(t)), t.hasAttribute(`${l.prefix}import`) && r.push(c.executeManagedImport(t)), t.getChildren().forEach((i) => {
|
|
5056
|
+
i instanceof M && r.push(
|
|
5057
|
+
c.reevaluateReactiveSpecialAttributes(i, e)
|
|
5040
5058
|
);
|
|
5041
5059
|
}), Promise.all(r).then(() => {
|
|
5042
5060
|
});
|
|
@@ -5048,11 +5066,11 @@ const u = class u {
|
|
|
5048
5066
|
* @returns 実行完了の Promise
|
|
5049
5067
|
*/
|
|
5050
5068
|
static executeManagedFetch(t) {
|
|
5051
|
-
const e = t.getTarget(), r =
|
|
5069
|
+
const e = t.getTarget(), r = c.getReactiveFetchState(e), i = j.resolveAutoFetchSignature(t);
|
|
5052
5070
|
return r.running ? ((i.hasUnresolvedReference || i.signature !== r.lastSignature) && (r.rerunRequested = !0), Promise.resolve()) : i.hasUnresolvedReference || i.signature === null ? (r.lastSignature = null, Promise.resolve()) : r.lastSignature === i.signature ? Promise.resolve() : (r.lastSignature = i.signature, r.running = !0, new j(t, null).runWithResult().then(() => {
|
|
5053
5071
|
}).finally(() => {
|
|
5054
5072
|
if (r.running = !1, r.rerunRequested)
|
|
5055
|
-
return r.rerunRequested = !1,
|
|
5073
|
+
return r.rerunRequested = !1, c.executeManagedFetch(t);
|
|
5056
5074
|
}));
|
|
5057
5075
|
}
|
|
5058
5076
|
/**
|
|
@@ -5062,7 +5080,7 @@ const u = class u {
|
|
|
5062
5080
|
* @returns 実行完了の Promise
|
|
5063
5081
|
*/
|
|
5064
5082
|
static executeManagedImport(t) {
|
|
5065
|
-
const e = t.getTarget(), r =
|
|
5083
|
+
const e = t.getTarget(), r = c.getReactiveImportState(e), i = t.getAttributeEvaluation(
|
|
5066
5084
|
`${l.prefix}import`
|
|
5067
5085
|
), n = i && !i.hasUnresolvedReference && typeof i.value == "string" && i.value !== "" ? i.value : null;
|
|
5068
5086
|
if (r.running)
|
|
@@ -5075,15 +5093,15 @@ const u = class u {
|
|
|
5075
5093
|
const s = performance.now();
|
|
5076
5094
|
return e.setAttribute(`${l.prefix}importing`, ""), R.importStart(e, n), Jt.load(n).then((a) => {
|
|
5077
5095
|
const o = new TextEncoder().encode(a).length;
|
|
5078
|
-
return
|
|
5096
|
+
return P.enqueue(() => {
|
|
5079
5097
|
e.innerHTML = a;
|
|
5080
5098
|
}).then(() => {
|
|
5081
5099
|
if (e.removeAttribute(`${l.prefix}importing`), R.importEnd(e, n, o, s), !document.body.hasAttribute("data-haori-ready")) {
|
|
5082
|
-
const
|
|
5100
|
+
const u = [];
|
|
5083
5101
|
return e.childNodes.forEach((d) => {
|
|
5084
5102
|
const h = T.get(d);
|
|
5085
|
-
h instanceof
|
|
5086
|
-
}), Promise.all(
|
|
5103
|
+
h instanceof M ? u.push(c.scan(h.getTarget())) : h instanceof U && u.push(c.evaluateText(h));
|
|
5104
|
+
}), Promise.all(u).then(() => {
|
|
5087
5105
|
});
|
|
5088
5106
|
}
|
|
5089
5107
|
});
|
|
@@ -5091,7 +5109,7 @@ const u = class u {
|
|
|
5091
5109
|
e.removeAttribute(`${l.prefix}importing`), R.importError(e, n, a), m.error("[Haori]", "Failed to import HTML:", n, a);
|
|
5092
5110
|
}).finally(() => {
|
|
5093
5111
|
if (r.running = !1, r.rerunRequested)
|
|
5094
|
-
return r.rerunRequested = !1,
|
|
5112
|
+
return r.rerunRequested = !1, c.executeManagedImport(t);
|
|
5095
5113
|
});
|
|
5096
5114
|
}
|
|
5097
5115
|
/**
|
|
@@ -5102,7 +5120,7 @@ const u = class u {
|
|
|
5102
5120
|
*/
|
|
5103
5121
|
static scan(t) {
|
|
5104
5122
|
const e = T.get(t);
|
|
5105
|
-
return e ?
|
|
5123
|
+
return e ? c.initializeElementFragment(e, !1) : Promise.resolve();
|
|
5106
5124
|
}
|
|
5107
5125
|
/**
|
|
5108
5126
|
* 新規 each 行を局所初期化します。
|
|
@@ -5112,8 +5130,8 @@ const u = class u {
|
|
|
5112
5130
|
* @returns 初期化完了の Promise
|
|
5113
5131
|
*/
|
|
5114
5132
|
static initializeFreshEachRow(t) {
|
|
5115
|
-
return
|
|
5116
|
-
|
|
5133
|
+
return c.initializeElementFragment(t, !0).then(() => {
|
|
5134
|
+
c.needsScheduledEvaluateAll(t) && c.scheduleEvaluateAll(t);
|
|
5117
5135
|
});
|
|
5118
5136
|
}
|
|
5119
5137
|
/**
|
|
@@ -5124,16 +5142,16 @@ const u = class u {
|
|
|
5124
5142
|
* @returns 初期化完了の Promise
|
|
5125
5143
|
*/
|
|
5126
5144
|
static initializeElementFragment(t, e) {
|
|
5127
|
-
return
|
|
5128
|
-
if (
|
|
5129
|
-
|
|
5145
|
+
return c.syncMountedState(t), e && t.isFreshInitializationSkippable() ? Promise.resolve() : c.initializeElementAttributes(t).then(() => {
|
|
5146
|
+
if (c.shouldSkipChildInitialization(t, e)) {
|
|
5147
|
+
c.refreshDerivedSubtreeSignature(t);
|
|
5130
5148
|
return;
|
|
5131
5149
|
}
|
|
5132
5150
|
const r = [];
|
|
5133
5151
|
return t.getChildren().forEach((i) => {
|
|
5134
|
-
i instanceof
|
|
5152
|
+
i instanceof M ? r.push(c.initializeElementFragment(i, e)) : i instanceof U && r.push(c.evaluateText(i));
|
|
5135
5153
|
}), Promise.all(r).then(() => {
|
|
5136
|
-
|
|
5154
|
+
c.refreshDerivedSubtreeSignature(t);
|
|
5137
5155
|
});
|
|
5138
5156
|
});
|
|
5139
5157
|
}
|
|
@@ -5163,10 +5181,10 @@ const u = class u {
|
|
|
5163
5181
|
static initializeElementAttributes(t) {
|
|
5164
5182
|
let e = Promise.resolve();
|
|
5165
5183
|
const r = /* @__PURE__ */ new Set();
|
|
5166
|
-
for (const i of
|
|
5184
|
+
for (const i of c.PRIORITY_ATTRIBUTE_SUFFIXES) {
|
|
5167
5185
|
const n = l.prefix + i;
|
|
5168
5186
|
t.hasAttribute(n) && (e = e.then(
|
|
5169
|
-
() =>
|
|
5187
|
+
() => c.setAttribute(
|
|
5170
5188
|
t.getTarget(),
|
|
5171
5189
|
n,
|
|
5172
5190
|
t.getRawAttribute(n)
|
|
@@ -5174,17 +5192,17 @@ const u = class u {
|
|
|
5174
5192
|
), r.add(n));
|
|
5175
5193
|
}
|
|
5176
5194
|
for (const i of t.getAttributeNames()) {
|
|
5177
|
-
if (r.has(i) ||
|
|
5195
|
+
if (r.has(i) || c.isDeferredAttributeName(i))
|
|
5178
5196
|
continue;
|
|
5179
5197
|
const n = t.getRawAttribute(i);
|
|
5180
5198
|
n !== null && (e = e.then(
|
|
5181
|
-
() =>
|
|
5199
|
+
() => c.setAttribute(t.getTarget(), i, n)
|
|
5182
5200
|
));
|
|
5183
5201
|
}
|
|
5184
|
-
for (const i of
|
|
5202
|
+
for (const i of c.DEFERRED_ATTRIBUTE_SUFFIXES) {
|
|
5185
5203
|
const n = l.prefix + i;
|
|
5186
5204
|
t.hasAttribute(n) && (e = e.then(
|
|
5187
|
-
() =>
|
|
5205
|
+
() => c.setAttribute(
|
|
5188
5206
|
t.getTarget(),
|
|
5189
5207
|
n,
|
|
5190
5208
|
t.getRawAttribute(n)
|
|
@@ -5203,7 +5221,7 @@ const u = class u {
|
|
|
5203
5221
|
*/
|
|
5204
5222
|
static shouldSkipChildInitialization(t, e) {
|
|
5205
5223
|
const r = t.getAttribute(`${l.prefix}if`);
|
|
5206
|
-
return t.hasAttribute(`${l.prefix}if`) &&
|
|
5224
|
+
return t.hasAttribute(`${l.prefix}if`) && c.isHiddenIfCondition(r) ? !0 : e && t.hasAttribute(`${l.prefix}each`);
|
|
5207
5225
|
}
|
|
5208
5226
|
/**
|
|
5209
5227
|
* エレメントに属性を設定します。
|
|
@@ -5215,7 +5233,7 @@ const u = class u {
|
|
|
5215
5233
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
5216
5234
|
*/
|
|
5217
5235
|
static setAttribute(t, e, r, i = !1) {
|
|
5218
|
-
const n = T.get(t), s =
|
|
5236
|
+
const n = T.get(t), s = c.getAliasedAttributeName(e);
|
|
5219
5237
|
if (s !== null)
|
|
5220
5238
|
return r === null ? n.removeAliasedAttribute(e, s) : n.setAliasedAttribute(
|
|
5221
5239
|
e,
|
|
@@ -5224,18 +5242,24 @@ const u = class u {
|
|
|
5224
5242
|
i
|
|
5225
5243
|
);
|
|
5226
5244
|
const a = [];
|
|
5227
|
-
let o = null,
|
|
5245
|
+
let o = null, u = null;
|
|
5228
5246
|
switch (e) {
|
|
5229
5247
|
case `${l.prefix}bind`: {
|
|
5230
|
-
r === null
|
|
5248
|
+
if (r === null)
|
|
5249
|
+
n.clearBindingDataCache(), n.setBindingData({});
|
|
5250
|
+
else {
|
|
5251
|
+
if (i && n instanceof M && n.consumeSelfWrittenBind(r))
|
|
5252
|
+
break;
|
|
5253
|
+
n.setBindingData(c.parseDataBind(r));
|
|
5254
|
+
}
|
|
5231
5255
|
break;
|
|
5232
5256
|
}
|
|
5233
5257
|
case `${l.prefix}derive`:
|
|
5234
|
-
|
|
5258
|
+
u = c.createDeriveInputSignature(
|
|
5235
5259
|
n,
|
|
5236
5260
|
r,
|
|
5237
5261
|
n.getRawAttribute(`${l.prefix}derive-name`)
|
|
5238
|
-
), o =
|
|
5262
|
+
), o = c.evaluateDerive(
|
|
5239
5263
|
n,
|
|
5240
5264
|
r,
|
|
5241
5265
|
n.getRawAttribute(`${l.prefix}derive-name`)
|
|
@@ -5243,11 +5267,11 @@ const u = class u {
|
|
|
5243
5267
|
}));
|
|
5244
5268
|
break;
|
|
5245
5269
|
case `${l.prefix}derive-name`:
|
|
5246
|
-
|
|
5270
|
+
u = c.createDeriveInputSignature(
|
|
5247
5271
|
n,
|
|
5248
5272
|
n.getRawAttribute(`${l.prefix}derive`),
|
|
5249
5273
|
r
|
|
5250
|
-
), o =
|
|
5274
|
+
), o = c.evaluateDerive(
|
|
5251
5275
|
n,
|
|
5252
5276
|
n.getRawAttribute(`${l.prefix}derive`),
|
|
5253
5277
|
r
|
|
@@ -5255,33 +5279,33 @@ const u = class u {
|
|
|
5255
5279
|
}));
|
|
5256
5280
|
break;
|
|
5257
5281
|
case `${l.prefix}if`:
|
|
5258
|
-
a.push(
|
|
5282
|
+
a.push(c.evaluateIf(n));
|
|
5259
5283
|
break;
|
|
5260
5284
|
case `${l.prefix}each`:
|
|
5261
|
-
a.push(
|
|
5285
|
+
a.push(c.evaluateEach(n));
|
|
5262
5286
|
break;
|
|
5263
5287
|
case `${l.prefix}fetch`:
|
|
5264
|
-
a.push(
|
|
5288
|
+
a.push(c.executeManagedFetch(n));
|
|
5265
5289
|
break;
|
|
5266
5290
|
case `${l.prefix}import`:
|
|
5267
|
-
typeof r == "string" && a.push(
|
|
5291
|
+
typeof r == "string" && a.push(c.executeManagedImport(n));
|
|
5268
5292
|
break;
|
|
5269
5293
|
case `${l.prefix}url-param`: {
|
|
5270
5294
|
const d = n.getAttribute(`${l.prefix}url-arg`), h = Xt.readParams();
|
|
5271
5295
|
if (d === null)
|
|
5272
|
-
a.push(
|
|
5296
|
+
a.push(c.setBindingData(t, h, /* @__PURE__ */ new Set(), !0));
|
|
5273
5297
|
else {
|
|
5274
5298
|
const g = n.getRawBindingData() || {};
|
|
5275
|
-
g[String(d)] = h, a.push(
|
|
5299
|
+
g[String(d)] = h, a.push(c.setBindingData(t, g, /* @__PURE__ */ new Set(), !0));
|
|
5276
5300
|
}
|
|
5277
5301
|
break;
|
|
5278
5302
|
}
|
|
5279
5303
|
}
|
|
5280
5304
|
return r === null ? a.push(n.removeAttribute(e)) : a.push(n.setAttribute(e, r, i)), Promise.all(a).then(() => {
|
|
5281
5305
|
if (o !== null)
|
|
5282
|
-
return n.setDeriveInputSignature(
|
|
5306
|
+
return n.setDeriveInputSignature(u), o.then((d) => {
|
|
5283
5307
|
if (d)
|
|
5284
|
-
return
|
|
5308
|
+
return c.reevaluateChildren(n);
|
|
5285
5309
|
});
|
|
5286
5310
|
}).then(() => {
|
|
5287
5311
|
});
|
|
@@ -5294,22 +5318,25 @@ const u = class u {
|
|
|
5294
5318
|
* @param value 属性値
|
|
5295
5319
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
5296
5320
|
*/
|
|
5297
|
-
static setBindingData(t, e, r = /* @__PURE__ */ new Set()) {
|
|
5298
|
-
const
|
|
5299
|
-
|
|
5300
|
-
|
|
5321
|
+
static setBindingData(t, e, r = /* @__PURE__ */ new Set(), i = !1) {
|
|
5322
|
+
const n = T.get(t), s = n.getRawBindingData();
|
|
5323
|
+
n.setBindingData(e), R.bindChange(t, s, e, "manual");
|
|
5324
|
+
const a = () => {
|
|
5325
|
+
const o = n.getRawBindingData() ?? e;
|
|
5326
|
+
let u = n.setAttribute(
|
|
5301
5327
|
`${l.prefix}bind`,
|
|
5302
|
-
JSON.stringify(
|
|
5328
|
+
JSON.stringify(o)
|
|
5303
5329
|
);
|
|
5304
5330
|
if (t.tagName === "FORM") {
|
|
5305
|
-
const
|
|
5306
|
-
|
|
5331
|
+
const d = n.getAttribute(`${l.prefix}form-arg`), h = d && o[String(d)] && typeof o[String(d)] == "object" && !Array.isArray(o[String(d)]) ? o[String(d)] : d ? {} : o;
|
|
5332
|
+
u = u.then(() => y.syncValues(n, h));
|
|
5307
5333
|
}
|
|
5308
|
-
return
|
|
5309
|
-
() =>
|
|
5310
|
-
),
|
|
5334
|
+
return u = u.then(() => c.evaluateAll(n, r)), u = u.then(
|
|
5335
|
+
() => c.reevaluateReactiveSpecialAttributes(n, r)
|
|
5336
|
+
), u.then(() => {
|
|
5311
5337
|
});
|
|
5312
|
-
}
|
|
5338
|
+
};
|
|
5339
|
+
return i ? a() : n.enqueueBindingWork(a);
|
|
5313
5340
|
}
|
|
5314
5341
|
/**
|
|
5315
5342
|
* 指定要素のバインディングデータを取得します。`setBindingData` の対となる
|
|
@@ -5330,7 +5357,7 @@ const u = class u {
|
|
|
5330
5357
|
*/
|
|
5331
5358
|
static getBindingData(t, e = {}) {
|
|
5332
5359
|
const r = T.get(t);
|
|
5333
|
-
return r instanceof
|
|
5360
|
+
return r instanceof M ? e.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
5334
5361
|
}
|
|
5335
5362
|
/**
|
|
5336
5363
|
* 指定要素の式評価で見えるバインディングスコープをダンプします(デバッグ用)。
|
|
@@ -5351,14 +5378,14 @@ const u = class u {
|
|
|
5351
5378
|
const e = T.get(t);
|
|
5352
5379
|
if (!e)
|
|
5353
5380
|
return { resolved: {}, sources: {} };
|
|
5354
|
-
const r = e.getBindingData(), i = {}, n = (
|
|
5355
|
-
const d =
|
|
5381
|
+
const r = e.getBindingData(), i = {}, n = (u) => {
|
|
5382
|
+
const d = u.getTarget();
|
|
5356
5383
|
return d.id ? `#${d.id}` : d.tagName.toLowerCase();
|
|
5357
|
-
}, s = (
|
|
5358
|
-
if (
|
|
5359
|
-
for (const E of Object.keys(
|
|
5384
|
+
}, s = (u, d, h, g) => {
|
|
5385
|
+
if (u)
|
|
5386
|
+
for (const E of Object.keys(u))
|
|
5360
5387
|
E in i || (i[E] = {
|
|
5361
|
-
value:
|
|
5388
|
+
value: u[E],
|
|
5362
5389
|
source: n(d),
|
|
5363
5390
|
kind: h,
|
|
5364
5391
|
depth: g
|
|
@@ -5400,7 +5427,7 @@ const u = class u {
|
|
|
5400
5427
|
if (r.isSkipMutationNodes())
|
|
5401
5428
|
return;
|
|
5402
5429
|
const i = T.get(e.nextSibling), n = T.get(e);
|
|
5403
|
-
n && (r.insertBefore(n, i), n instanceof
|
|
5430
|
+
n && (r.insertBefore(n, i), n instanceof M ? c.scan(n.getTarget()) : n instanceof U && c.evaluateText(n));
|
|
5404
5431
|
}
|
|
5405
5432
|
/**
|
|
5406
5433
|
* ノードを親要素から削除します。
|
|
@@ -5440,11 +5467,11 @@ const u = class u {
|
|
|
5440
5467
|
return Promise.resolve();
|
|
5441
5468
|
const i = [];
|
|
5442
5469
|
i.push(r.setValue(e));
|
|
5443
|
-
const n =
|
|
5470
|
+
const n = c.getFormFragment(r);
|
|
5444
5471
|
if (n) {
|
|
5445
5472
|
const s = y.getValues(n), a = n.getAttribute(`${l.prefix}form-arg`);
|
|
5446
5473
|
let o;
|
|
5447
|
-
a ? (o = n.getRawBindingData(), o || (o = {}), o[String(a)] = s) : o = s, i.push(
|
|
5474
|
+
a ? (o = n.getRawBindingData(), o || (o = {}), o[String(a)] = s) : o = s, i.push(c.setBindingData(n.getTarget(), o));
|
|
5448
5475
|
}
|
|
5449
5476
|
return Promise.all(i).then(() => {
|
|
5450
5477
|
});
|
|
@@ -5459,7 +5486,7 @@ const u = class u {
|
|
|
5459
5486
|
if (t.getTarget() instanceof HTMLFormElement)
|
|
5460
5487
|
return t;
|
|
5461
5488
|
const e = t.getParent();
|
|
5462
|
-
return e ?
|
|
5489
|
+
return e ? c.getFormFragment(e) : null;
|
|
5463
5490
|
}
|
|
5464
5491
|
/**
|
|
5465
5492
|
* フラグメントとその子要素を評価します。
|
|
@@ -5470,21 +5497,21 @@ const u = class u {
|
|
|
5470
5497
|
static evaluateAll(t, e = /* @__PURE__ */ new Set()) {
|
|
5471
5498
|
if (e.has(t))
|
|
5472
5499
|
return Promise.resolve();
|
|
5473
|
-
let r =
|
|
5500
|
+
let r = c.reevaluateInterpolatedAttributes(t);
|
|
5474
5501
|
const i = t.hasAttribute(`${l.prefix}derive`), n = t.hasAttribute(`${l.prefix}if`), s = t.hasAttribute(`${l.prefix}each`), a = t.getRawAttribute(`${l.prefix}derive`), o = t.getRawAttribute(`${l.prefix}derive-name`);
|
|
5475
|
-
let
|
|
5502
|
+
let u = !1, d = !1, h = null;
|
|
5476
5503
|
if (!i && t.getDeriveSubtreeSignature() !== null && t.setDeriveSubtreeSignature(null), !i && t.getDeriveInputSignature() !== null && t.setDeriveInputSignature(null), i) {
|
|
5477
|
-
const g =
|
|
5504
|
+
const g = c.createDeriveInputSignature(
|
|
5478
5505
|
t,
|
|
5479
5506
|
a,
|
|
5480
5507
|
o
|
|
5481
5508
|
);
|
|
5482
5509
|
g === null ? (t.getDeriveInputSignature() !== null && t.setDeriveInputSignature(null), r = r.then(
|
|
5483
|
-
() =>
|
|
5510
|
+
() => c.evaluateDerive(t, a, o).then(
|
|
5484
5511
|
() => {
|
|
5485
5512
|
}
|
|
5486
5513
|
)
|
|
5487
|
-
)) : t.getDeriveInputSignature() !== g && (r = r.then(() =>
|
|
5514
|
+
)) : t.getDeriveInputSignature() !== g && (r = r.then(() => c.evaluateDerive(
|
|
5488
5515
|
t,
|
|
5489
5516
|
a,
|
|
5490
5517
|
o
|
|
@@ -5492,29 +5519,29 @@ const u = class u {
|
|
|
5492
5519
|
t.setDeriveInputSignature(g);
|
|
5493
5520
|
})));
|
|
5494
5521
|
}
|
|
5495
|
-
return n && (r = r.then(() =>
|
|
5522
|
+
return n && (r = r.then(() => c.evaluateIf(t))), s ? (t.getDeriveSubtreeSignature() !== null && t.setDeriveSubtreeSignature(null), r.then(() => c.evaluateEach(t))) : n ? (t.getDeriveSubtreeSignature() !== null && t.setDeriveSubtreeSignature(null), r.then(() => {
|
|
5496
5523
|
})) : (i && (r = r.then(() => {
|
|
5497
|
-
if (!
|
|
5498
|
-
t.setDeriveSubtreeSignature(null),
|
|
5524
|
+
if (!c.canSkipStableDerivedSubtree(t)) {
|
|
5525
|
+
t.setDeriveSubtreeSignature(null), c.logDerivedSubtreeProfileSnapshot(t, "skip-ineligible");
|
|
5499
5526
|
return;
|
|
5500
5527
|
}
|
|
5501
|
-
h =
|
|
5528
|
+
h = c.createDescendantBindingSignature(
|
|
5502
5529
|
t,
|
|
5503
5530
|
"evaluateAll"
|
|
5504
|
-
), d = !0,
|
|
5531
|
+
), d = !0, u = t.getDeriveSubtreeSignature() !== null && t.getDeriveSubtreeSignature() === h, c.logDerivedSubtreeProfileSnapshot(
|
|
5505
5532
|
t,
|
|
5506
|
-
|
|
5533
|
+
u ? "skip-hit" : "skip-miss"
|
|
5507
5534
|
);
|
|
5508
5535
|
})), r.then(() => {
|
|
5509
|
-
if (
|
|
5536
|
+
if (u)
|
|
5510
5537
|
return;
|
|
5511
5538
|
const g = [];
|
|
5512
5539
|
return t.getChildren().forEach((E) => {
|
|
5513
|
-
if (E instanceof
|
|
5514
|
-
if (
|
|
5540
|
+
if (E instanceof M) {
|
|
5541
|
+
if (c.canSkipUnchangedNestedEach(E))
|
|
5515
5542
|
return;
|
|
5516
|
-
g.push(
|
|
5517
|
-
} else E instanceof U && g.push(
|
|
5543
|
+
g.push(c.evaluateAll(E, e));
|
|
5544
|
+
} else E instanceof U && g.push(c.evaluateText(E));
|
|
5518
5545
|
}), Promise.all(g).then(() => {
|
|
5519
5546
|
});
|
|
5520
5547
|
}).then(() => {
|
|
@@ -5537,7 +5564,7 @@ const u = class u {
|
|
|
5537
5564
|
const i = t.getRawDerivedBindingData(), n = typeof r == "string" ? r.trim() : "";
|
|
5538
5565
|
if (!e || n === "")
|
|
5539
5566
|
return i === null ? Promise.resolve(!1) : (t.setDerivedBindingData(null), Promise.resolve(!0));
|
|
5540
|
-
const s =
|
|
5567
|
+
const s = z.evaluateDetailed(
|
|
5541
5568
|
e,
|
|
5542
5569
|
t.getBindingData()
|
|
5543
5570
|
);
|
|
@@ -5546,7 +5573,7 @@ const u = class u {
|
|
|
5546
5573
|
const a = {
|
|
5547
5574
|
[n]: s.value
|
|
5548
5575
|
};
|
|
5549
|
-
return
|
|
5576
|
+
return c.createBindingSignature(i) === c.createBindingSignature(a) ? Promise.resolve(!1) : (t.setDerivedBindingData(a), Promise.resolve(!0));
|
|
5550
5577
|
}
|
|
5551
5578
|
/**
|
|
5552
5579
|
* テキストフラグメントを評価します。
|
|
@@ -5584,11 +5611,11 @@ const u = class u {
|
|
|
5584
5611
|
const e = t.getRawAttribute(`${l.prefix}if`);
|
|
5585
5612
|
if (typeof e != "string" || e.indexOf("{{") >= 0)
|
|
5586
5613
|
return;
|
|
5587
|
-
const { sources: r } =
|
|
5614
|
+
const { sources: r } = c.dumpScope(t.getTarget()), i = /* @__PURE__ */ new Set(), n = e.match(/[A-Za-z_$][\w$]*/g) ?? [];
|
|
5588
5615
|
let s = 0;
|
|
5589
5616
|
n.forEach((o) => {
|
|
5590
|
-
const
|
|
5591
|
-
s =
|
|
5617
|
+
const u = e.indexOf(o, s);
|
|
5618
|
+
s = u + o.length, !(u > 0 && e[u - 1] === ".") && i.add(o);
|
|
5592
5619
|
});
|
|
5593
5620
|
const a = {};
|
|
5594
5621
|
i.forEach((o) => {
|
|
@@ -5611,8 +5638,8 @@ const u = class u {
|
|
|
5611
5638
|
*/
|
|
5612
5639
|
static evaluateIf(t) {
|
|
5613
5640
|
const e = [], r = t.getAttribute(`${l.prefix}if`);
|
|
5614
|
-
if (
|
|
5615
|
-
H.isEnabled() &&
|
|
5641
|
+
if (c.isHiddenIfCondition(r))
|
|
5642
|
+
H.isEnabled() && c.logFalsyIfDiagnostics(t), e.push(
|
|
5616
5643
|
t.hide().then(() => {
|
|
5617
5644
|
R.hide(t.getTarget());
|
|
5618
5645
|
})
|
|
@@ -5620,12 +5647,12 @@ const u = class u {
|
|
|
5620
5647
|
else {
|
|
5621
5648
|
const i = t.isVisible(), n = [];
|
|
5622
5649
|
t.getChildren().forEach((s) => {
|
|
5623
|
-
s instanceof
|
|
5624
|
-
s.isMounted() ?
|
|
5625
|
-
) : s instanceof U && n.push(
|
|
5650
|
+
s instanceof M ? n.push(
|
|
5651
|
+
s.isMounted() ? c.evaluateAll(s) : c.scan(s.getTarget())
|
|
5652
|
+
) : s instanceof U && n.push(c.evaluateText(s));
|
|
5626
5653
|
}), e.push(
|
|
5627
5654
|
t.show().then(() => {
|
|
5628
|
-
R.show(t.getTarget()), i ||
|
|
5655
|
+
R.show(t.getTarget()), i || c.triggerLoadOnShow(t);
|
|
5629
5656
|
})
|
|
5630
5657
|
), e.push(Promise.all(n).then(() => {
|
|
5631
5658
|
}));
|
|
@@ -5655,8 +5682,8 @@ const u = class u {
|
|
|
5655
5682
|
* @return 再入制御状態
|
|
5656
5683
|
*/
|
|
5657
5684
|
static getEachUpdateState(t) {
|
|
5658
|
-
let e =
|
|
5659
|
-
return e || (e = { running: !1, rerunRequested: !1, settled: null },
|
|
5685
|
+
let e = c.EACH_UPDATE_STATES.get(t);
|
|
5686
|
+
return e || (e = { running: !1, rerunRequested: !1, settled: null }, c.EACH_UPDATE_STATES.set(t, e)), e;
|
|
5660
5687
|
}
|
|
5661
5688
|
/**
|
|
5662
5689
|
* each要素を評価します。
|
|
@@ -5674,8 +5701,8 @@ const u = class u {
|
|
|
5674
5701
|
static evaluateEach(t) {
|
|
5675
5702
|
if (!t.isVisible() || !t.isMounted())
|
|
5676
5703
|
return Promise.resolve();
|
|
5677
|
-
const e =
|
|
5678
|
-
return e.running ? (e.rerunRequested = !0, e.settled ?? Promise.resolve()) :
|
|
5704
|
+
const e = c.getEachUpdateState(t);
|
|
5705
|
+
return e.running ? (e.rerunRequested = !0, e.settled ?? Promise.resolve()) : c.runEachUpdateLoop(t, e);
|
|
5679
5706
|
}
|
|
5680
5707
|
/**
|
|
5681
5708
|
* data-each の差分更新を、再評価要求が無くなるまで直列に繰り返し実行します。
|
|
@@ -5691,7 +5718,7 @@ const u = class u {
|
|
|
5691
5718
|
const r = (async () => {
|
|
5692
5719
|
try {
|
|
5693
5720
|
do
|
|
5694
|
-
e.rerunRequested = !1, await
|
|
5721
|
+
e.rerunRequested = !1, await c.performEachUpdate(t);
|
|
5695
5722
|
while (e.rerunRequested);
|
|
5696
5723
|
t.getTarget().setAttribute(`${l.prefix}each-done`, "");
|
|
5697
5724
|
} finally {
|
|
@@ -5707,35 +5734,35 @@ const u = class u {
|
|
|
5707
5734
|
* @return 差分更新完了の Promise
|
|
5708
5735
|
*/
|
|
5709
5736
|
static performEachUpdate(t) {
|
|
5710
|
-
const e =
|
|
5737
|
+
const e = c.resolveEachItems(t);
|
|
5711
5738
|
if (e === null)
|
|
5712
5739
|
return Promise.reject(new Error("Invalid each attribute."));
|
|
5713
5740
|
let r = t.getTemplate();
|
|
5714
|
-
const i = t.getAttribute(`${l.prefix}each-key`), n =
|
|
5741
|
+
const i = t.getAttribute(`${l.prefix}each-key`), n = c.createBindingSignature({
|
|
5715
5742
|
key: i ? String(i) : null,
|
|
5716
5743
|
items: e
|
|
5717
5744
|
});
|
|
5718
5745
|
if (r === null) {
|
|
5719
5746
|
let s = !1;
|
|
5720
5747
|
if (t.getChildren().forEach((a) => {
|
|
5721
|
-
if (!s && a instanceof
|
|
5748
|
+
if (!s && a instanceof M) {
|
|
5722
5749
|
if (a.hasAttribute(`${l.prefix}each-before`) || a.hasAttribute(`${l.prefix}each-after`))
|
|
5723
5750
|
return;
|
|
5724
|
-
r = a.clone(),
|
|
5751
|
+
r = a.clone(), c.markFreshInitializationSkippable(r), t.setTemplate(r), s = !0, t.removeChild(a);
|
|
5725
5752
|
const o = a.getTarget();
|
|
5726
5753
|
o.parentNode && o.parentNode.removeChild(o), a.setMounted(!1);
|
|
5727
5754
|
}
|
|
5728
5755
|
}), !s) {
|
|
5729
5756
|
const a = t.getTarget();
|
|
5730
5757
|
Array.from(a.children).filter(
|
|
5731
|
-
(
|
|
5732
|
-
).forEach((
|
|
5758
|
+
(u) => !u.hasAttribute(`${l.prefix}each-before`) && !u.hasAttribute(`${l.prefix}each-after`)
|
|
5759
|
+
).forEach((u) => {
|
|
5733
5760
|
if (!s) {
|
|
5734
|
-
const h = T.get(
|
|
5735
|
-
h instanceof
|
|
5761
|
+
const h = T.get(u);
|
|
5762
|
+
h instanceof M && (r = h.clone(), c.markFreshInitializationSkippable(r), t.setTemplate(r), s = !0);
|
|
5736
5763
|
}
|
|
5737
|
-
const d = T.get(
|
|
5738
|
-
d instanceof
|
|
5764
|
+
const d = T.get(u);
|
|
5765
|
+
d instanceof M && t.getChildren().includes(d) && (t.removeChild(d), d.setMounted(!1)), u.parentNode && u.parentNode.removeChild(u);
|
|
5739
5766
|
});
|
|
5740
5767
|
}
|
|
5741
5768
|
return this.updateDiff(t, e).then(() => {
|
|
@@ -5767,12 +5794,12 @@ const u = class u {
|
|
|
5767
5794
|
if (!t.hasAttribute(`${l.prefix}each`) || t.getEachInputSignature() === null)
|
|
5768
5795
|
return !1;
|
|
5769
5796
|
const e = t.getParent();
|
|
5770
|
-
if (e?.closestByAttribute(`${l.prefix}derive`) || e?.closestByAttribute(`${l.prefix}derive-name`) || e?.closestByAttribute(`${l.prefix}if`) || e?.closestByAttribute(`${l.prefix}fetch`) || e?.closestByAttribute(`${l.prefix}import`) ||
|
|
5797
|
+
if (e?.closestByAttribute(`${l.prefix}derive`) || e?.closestByAttribute(`${l.prefix}derive-name`) || e?.closestByAttribute(`${l.prefix}if`) || e?.closestByAttribute(`${l.prefix}fetch`) || e?.closestByAttribute(`${l.prefix}import`) || c.hasNonEachDynamicElementState(t))
|
|
5771
5798
|
return !1;
|
|
5772
|
-
const r =
|
|
5799
|
+
const r = c.resolveEachItems(t);
|
|
5773
5800
|
if (r === null)
|
|
5774
5801
|
return !1;
|
|
5775
|
-
const i = t.getAttribute(`${l.prefix}each-key`), n =
|
|
5802
|
+
const i = t.getAttribute(`${l.prefix}each-key`), n = c.createBindingSignature({
|
|
5776
5803
|
key: i ? String(i) : null,
|
|
5777
5804
|
items: r
|
|
5778
5805
|
});
|
|
@@ -5786,7 +5813,7 @@ const u = class u {
|
|
|
5786
5813
|
* @returns 省略可能なら true
|
|
5787
5814
|
*/
|
|
5788
5815
|
static canSkipStableDerivedSubtree(t) {
|
|
5789
|
-
return !t.hasAttribute(`${l.prefix}derive`) || t.hasAttribute(`${l.prefix}if`) || t.hasAttribute(`${l.prefix}each`) || t.hasAttribute(`${l.prefix}fetch`) || t.hasAttribute(`${l.prefix}import`) ? !1 : !
|
|
5816
|
+
return !t.hasAttribute(`${l.prefix}derive`) || t.hasAttribute(`${l.prefix}if`) || t.hasAttribute(`${l.prefix}each`) || t.hasAttribute(`${l.prefix}fetch`) || t.hasAttribute(`${l.prefix}import`) ? !1 : !c.hasDisallowedDerivedSubtreeDescendant(t);
|
|
5790
5817
|
}
|
|
5791
5818
|
/**
|
|
5792
5819
|
* data-derive subtree skip の初期 PoC で扱わない子孫要素を含むかを返します。
|
|
@@ -5795,7 +5822,7 @@ const u = class u {
|
|
|
5795
5822
|
* @returns 含むなら true
|
|
5796
5823
|
*/
|
|
5797
5824
|
static hasDisallowedDerivedSubtreeDescendant(t) {
|
|
5798
|
-
return t.getChildren().some((e) => e instanceof
|
|
5825
|
+
return t.getChildren().some((e) => e instanceof M ? e.hasAttribute(`${l.prefix}derive`) || e.hasAttribute(`${l.prefix}derive-name`) || e.hasAttribute(`${l.prefix}fetch`) || e.hasAttribute(`${l.prefix}import`) ? !0 : c.hasDisallowedDerivedSubtreeDescendant(e) : !1);
|
|
5799
5826
|
}
|
|
5800
5827
|
/**
|
|
5801
5828
|
* data-derive host が子孫要素へ公開している binding の署名を返します。
|
|
@@ -5804,7 +5831,7 @@ const u = class u {
|
|
|
5804
5831
|
* @returns binding 署名
|
|
5805
5832
|
*/
|
|
5806
5833
|
static createDescendantBindingSignature(t, e) {
|
|
5807
|
-
return
|
|
5834
|
+
return c.recordDerivedSubtreeSignatureComputation(t, e), c.createBindingSignature(t.getDescendantBindingData());
|
|
5808
5835
|
}
|
|
5809
5836
|
/**
|
|
5810
5837
|
* data-derive 実行前の入力署名を返します。
|
|
@@ -5816,7 +5843,7 @@ const u = class u {
|
|
|
5816
5843
|
*/
|
|
5817
5844
|
static createDeriveInputSignature(t, e, r) {
|
|
5818
5845
|
const i = typeof r == "string" ? r.trim() : "";
|
|
5819
|
-
return !e || i === "" ? null :
|
|
5846
|
+
return !e || i === "" ? null : c.createBindingSignature({
|
|
5820
5847
|
expression: e,
|
|
5821
5848
|
name: i,
|
|
5822
5849
|
scope: t.getBindingData()
|
|
@@ -5828,13 +5855,13 @@ const u = class u {
|
|
|
5828
5855
|
* @param fragment 対象フラグメント
|
|
5829
5856
|
*/
|
|
5830
5857
|
static refreshDerivedSubtreeSignature(t) {
|
|
5831
|
-
if (!
|
|
5832
|
-
t.setDeriveSubtreeSignature(null),
|
|
5858
|
+
if (!c.canSkipStableDerivedSubtree(t)) {
|
|
5859
|
+
t.setDeriveSubtreeSignature(null), c.logDerivedSubtreeProfileSnapshot(t, "skip-ineligible");
|
|
5833
5860
|
return;
|
|
5834
5861
|
}
|
|
5835
5862
|
t.setDeriveSubtreeSignature(
|
|
5836
|
-
|
|
5837
|
-
),
|
|
5863
|
+
c.createDescendantBindingSignature(t, "refresh")
|
|
5864
|
+
), c.logDerivedSubtreeProfileSnapshot(t, "refresh");
|
|
5838
5865
|
}
|
|
5839
5866
|
/**
|
|
5840
5867
|
* data-derive subtree skip のプロファイルを取得または初期化します。
|
|
@@ -5845,11 +5872,11 @@ const u = class u {
|
|
|
5845
5872
|
static getOrCreateDerivedSubtreeProfile(t) {
|
|
5846
5873
|
if (!H.isEnabled() || !t.hasAttribute(`${l.prefix}derive`))
|
|
5847
5874
|
return null;
|
|
5848
|
-
const e =
|
|
5875
|
+
const e = c.DERIVE_SUBTREE_PROFILES.get(t);
|
|
5849
5876
|
if (e)
|
|
5850
5877
|
return e;
|
|
5851
5878
|
const r = {
|
|
5852
|
-
hostId:
|
|
5879
|
+
hostId: c.createDerivedSubtreeHostId(t),
|
|
5853
5880
|
signatureComputeTotal: 0,
|
|
5854
5881
|
signatureComputeFromEvaluateAll: 0,
|
|
5855
5882
|
signatureComputeFromRefresh: 0,
|
|
@@ -5857,7 +5884,7 @@ const u = class u {
|
|
|
5857
5884
|
skipMissCount: 0,
|
|
5858
5885
|
skipIneligibleCount: 0
|
|
5859
5886
|
};
|
|
5860
|
-
return
|
|
5887
|
+
return c.DERIVE_SUBTREE_PROFILES.set(t, r), r;
|
|
5861
5888
|
}
|
|
5862
5889
|
/**
|
|
5863
5890
|
* data-derive subtree host の識別子を作成します。
|
|
@@ -5881,7 +5908,7 @@ const u = class u {
|
|
|
5881
5908
|
typeof s == "string" && s.trim() !== "" && (n += `[${l.prefix}derive-name="${s.trim()}"]`);
|
|
5882
5909
|
const a = r.getParent();
|
|
5883
5910
|
if (a) {
|
|
5884
|
-
const o = a.getChildren().filter((
|
|
5911
|
+
const o = a.getChildren().filter((u) => u instanceof M).findIndex((u) => u === r);
|
|
5885
5912
|
n += `:nth-child(${o + 1})`;
|
|
5886
5913
|
}
|
|
5887
5914
|
e.unshift(n), r = a;
|
|
@@ -5895,7 +5922,7 @@ const u = class u {
|
|
|
5895
5922
|
* @param source 計算元
|
|
5896
5923
|
*/
|
|
5897
5924
|
static recordDerivedSubtreeSignatureComputation(t, e) {
|
|
5898
|
-
const r =
|
|
5925
|
+
const r = c.getOrCreateDerivedSubtreeProfile(t);
|
|
5899
5926
|
if (r !== null) {
|
|
5900
5927
|
if (r.signatureComputeTotal += 1, e === "refresh") {
|
|
5901
5928
|
r.signatureComputeFromRefresh += 1;
|
|
@@ -5911,7 +5938,7 @@ const u = class u {
|
|
|
5911
5938
|
* @param reason ログ理由
|
|
5912
5939
|
*/
|
|
5913
5940
|
static logDerivedSubtreeProfileSnapshot(t, e) {
|
|
5914
|
-
const r =
|
|
5941
|
+
const r = c.getOrCreateDerivedSubtreeProfile(t);
|
|
5915
5942
|
r !== null && (e === "skip-hit" ? r.skipHitCount += 1 : e === "skip-miss" ? r.skipMissCount += 1 : e === "skip-ineligible" && (r.skipIneligibleCount += 1), m.info("[Haori][derive-profile]", {
|
|
5916
5943
|
reason: e,
|
|
5917
5944
|
hostId: r.hostId,
|
|
@@ -5954,7 +5981,7 @@ const u = class u {
|
|
|
5954
5981
|
* @returns subtree 全体を省略可能なら true
|
|
5955
5982
|
*/
|
|
5956
5983
|
static markFreshInitializationSkippable(t) {
|
|
5957
|
-
const e = t.getAttributeNames().some((n) =>
|
|
5984
|
+
const e = t.getAttributeNames().some((n) => c.isFreshInitializationDynamicAttribute(t, n)), r = t.getChildren().some((n) => n instanceof M ? !c.markFreshInitializationSkippable(n) : n instanceof U ? n.hasDynamicContent() : !1), i = !e && !r;
|
|
5958
5985
|
return t.setFreshInitializationSkippable(i), i;
|
|
5959
5986
|
}
|
|
5960
5987
|
/**
|
|
@@ -5984,19 +6011,19 @@ const u = class u {
|
|
|
5984
6011
|
i && (i = String(i));
|
|
5985
6012
|
const n = t.getAttribute(`${l.prefix}each-key`), s = t.getAttribute(`${l.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
|
|
5986
6013
|
e.forEach((b, S) => {
|
|
5987
|
-
const F =
|
|
6014
|
+
const F = c.createListKey(
|
|
5988
6015
|
b,
|
|
5989
6016
|
n ? String(n) : null,
|
|
5990
6017
|
S
|
|
5991
6018
|
);
|
|
5992
6019
|
o.push(F), a.set(F, { item: b, itemIndex: S });
|
|
5993
6020
|
});
|
|
5994
|
-
const
|
|
5995
|
-
let h = t.getChildren().filter((b) => b instanceof
|
|
6021
|
+
const u = new Set(o), d = [];
|
|
6022
|
+
let h = t.getChildren().filter((b) => b instanceof M).filter(
|
|
5996
6023
|
(b) => !b.hasAttribute(`${l.prefix}each-before`) && !b.hasAttribute(`${l.prefix}each-after`)
|
|
5997
6024
|
);
|
|
5998
6025
|
const g = h.map((b) => b.getListKey());
|
|
5999
|
-
h = h.filter((b) =>
|
|
6026
|
+
h = h.filter((b) => u.has(String(b.getListKey())) ? !0 : (d.push(b.remove()), !1));
|
|
6000
6027
|
const E = h.map((b) => b.getListKey()), w = /* @__PURE__ */ new Map();
|
|
6001
6028
|
h.forEach((b) => {
|
|
6002
6029
|
const S = b.getListKey();
|
|
@@ -6012,7 +6039,7 @@ const u = class u {
|
|
|
6012
6039
|
const V = w.get(b);
|
|
6013
6040
|
if (V)
|
|
6014
6041
|
$ = V, v = v.then(
|
|
6015
|
-
() =>
|
|
6042
|
+
() => c.updateRowFragment(
|
|
6016
6043
|
$,
|
|
6017
6044
|
F,
|
|
6018
6045
|
i,
|
|
@@ -6021,14 +6048,14 @@ const u = class u {
|
|
|
6021
6048
|
b
|
|
6022
6049
|
).then((C) => {
|
|
6023
6050
|
if (C)
|
|
6024
|
-
return
|
|
6051
|
+
return c.evaluateAll($);
|
|
6025
6052
|
})
|
|
6026
6053
|
);
|
|
6027
6054
|
else {
|
|
6028
6055
|
$ = r.clone();
|
|
6029
6056
|
const C = A + S;
|
|
6030
6057
|
v = v.then(
|
|
6031
|
-
() =>
|
|
6058
|
+
() => c.updateRowFragment(
|
|
6032
6059
|
$,
|
|
6033
6060
|
F,
|
|
6034
6061
|
i,
|
|
@@ -6039,7 +6066,7 @@ const u = class u {
|
|
|
6039
6066
|
const Q = k[C] ?? null;
|
|
6040
6067
|
return t.insertBefore($, Q).then(() => {
|
|
6041
6068
|
k.splice(C, 0, $);
|
|
6042
|
-
}).then(() =>
|
|
6069
|
+
}).then(() => c.initializeFreshEachRow($));
|
|
6043
6070
|
})
|
|
6044
6071
|
);
|
|
6045
6072
|
}
|
|
@@ -6051,7 +6078,7 @@ const u = class u {
|
|
|
6051
6078
|
), F = new Set(S), I = b.filter((C) => !F.has(C)), V = g.filter(
|
|
6052
6079
|
(C) => C !== null
|
|
6053
6080
|
).filter(
|
|
6054
|
-
(C) => !
|
|
6081
|
+
(C) => !u.has(C)
|
|
6055
6082
|
);
|
|
6056
6083
|
R.eachUpdate(
|
|
6057
6084
|
t.getTarget(),
|
|
@@ -6107,11 +6134,11 @@ const u = class u {
|
|
|
6107
6134
|
"[Haori]",
|
|
6108
6135
|
`Primitive value requires '${l.prefix}each-arg' attribute: ${e}`
|
|
6109
6136
|
), Promise.resolve(!1);
|
|
6110
|
-
const o = a,
|
|
6137
|
+
const o = a, u = c.createBindingSignature({
|
|
6111
6138
|
listKey: s,
|
|
6112
6139
|
bindingData: o
|
|
6113
6140
|
});
|
|
6114
|
-
return t.getListKey() === s && t.getRenderSignature() ===
|
|
6141
|
+
return t.getListKey() === s && t.getRenderSignature() === u ? Promise.resolve(!1) : (t.setListKey(s), t.setRenderSignature(u), t.setBindingData(o), t.setAttribute(`${l.prefix}row`, s).then(() => !0));
|
|
6115
6142
|
}
|
|
6116
6143
|
/**
|
|
6117
6144
|
* 新規挿入行に遅延再評価が必要かどうかを判定します。
|
|
@@ -6125,7 +6152,7 @@ const u = class u {
|
|
|
6125
6152
|
const r = e.pop();
|
|
6126
6153
|
if (r.getChildElementFragments().forEach((i) => {
|
|
6127
6154
|
e.push(i);
|
|
6128
|
-
}), r !== t && !r.isMounted() &&
|
|
6155
|
+
}), r !== t && !r.isMounted() && c.hasMountSensitiveAttribute(r))
|
|
6129
6156
|
return !0;
|
|
6130
6157
|
}
|
|
6131
6158
|
return !1;
|
|
@@ -6168,7 +6195,7 @@ const u = class u {
|
|
|
6168
6195
|
if (e.has(t))
|
|
6169
6196
|
return `[Circular:${e.get(t)}]`;
|
|
6170
6197
|
const i = `array-${r.value}`;
|
|
6171
|
-
return r.value += 1, e.set(t, i), `[${t.map((n) =>
|
|
6198
|
+
return r.value += 1, e.set(t, i), `[${t.map((n) => c.createBindingSignature(n, e, r)).join(",")}]`;
|
|
6172
6199
|
}
|
|
6173
6200
|
if (typeof t == "object") {
|
|
6174
6201
|
if (e.has(t))
|
|
@@ -6177,7 +6204,7 @@ const u = class u {
|
|
|
6177
6204
|
r.value += 1, e.set(t, i);
|
|
6178
6205
|
const n = t;
|
|
6179
6206
|
return `{${Object.keys(n).sort().map(
|
|
6180
|
-
(s) => `${JSON.stringify(s)}:${
|
|
6207
|
+
(s) => `${JSON.stringify(s)}:${c.createBindingSignature(
|
|
6181
6208
|
n[s],
|
|
6182
6209
|
e,
|
|
6183
6210
|
r
|
|
@@ -6193,18 +6220,18 @@ const u = class u {
|
|
|
6193
6220
|
*/
|
|
6194
6221
|
static scheduleEvaluateAll(t) {
|
|
6195
6222
|
setTimeout(() => {
|
|
6196
|
-
|
|
6223
|
+
c.evaluateAll(t);
|
|
6197
6224
|
}, 100);
|
|
6198
6225
|
}
|
|
6199
6226
|
};
|
|
6200
|
-
|
|
6227
|
+
c.ATTRIBUTE_ALIAS_SUFFIX = "attr-", c.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
6201
6228
|
"bind",
|
|
6202
6229
|
"url-param",
|
|
6203
6230
|
"derive-name",
|
|
6204
6231
|
"derive",
|
|
6205
6232
|
"if",
|
|
6206
6233
|
"each"
|
|
6207
|
-
],
|
|
6234
|
+
], c.DEFERRED_ATTRIBUTE_SUFFIXES = ["fetch"], c.EVALUATE_ALL_EXCLUDED_ATTRIBUTE_SUFFIXES = [
|
|
6208
6235
|
"bind",
|
|
6209
6236
|
"derive",
|
|
6210
6237
|
"derive-name",
|
|
@@ -6213,8 +6240,8 @@ u.ATTRIBUTE_ALIAS_SUFFIX = "attr-", u.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
6213
6240
|
"fetch",
|
|
6214
6241
|
"import",
|
|
6215
6242
|
"url-param"
|
|
6216
|
-
],
|
|
6217
|
-
let
|
|
6243
|
+
], c.ATTRIBUTE_PLACEHOLDER_REGEX = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/, c.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), c.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), c.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), c.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap();
|
|
6244
|
+
let x = c;
|
|
6218
6245
|
const J = class J {
|
|
6219
6246
|
/**
|
|
6220
6247
|
* コンストラクタ。
|
|
@@ -6303,7 +6330,7 @@ const J = class J {
|
|
|
6303
6330
|
if (i.getAttribute(this.onAttributeName) !== t)
|
|
6304
6331
|
return;
|
|
6305
6332
|
const n = T.get(i);
|
|
6306
|
-
n instanceof
|
|
6333
|
+
n instanceof M && new j(n, "on", e).run().catch((s) => {
|
|
6307
6334
|
m.error("[Haori]", "Procedure execution error:", s);
|
|
6308
6335
|
});
|
|
6309
6336
|
});
|
|
@@ -6351,7 +6378,7 @@ const J = class J {
|
|
|
6351
6378
|
const i = T.get(r);
|
|
6352
6379
|
if (!i)
|
|
6353
6380
|
return;
|
|
6354
|
-
(e === "change" || e === "input") && i instanceof
|
|
6381
|
+
(e === "change" || e === "input") && i instanceof M && i.syncValue();
|
|
6355
6382
|
const n = () => {
|
|
6356
6383
|
new j(i, e, t).run().catch((s) => {
|
|
6357
6384
|
m.error("[Haori]", "Procedure execution error:", s);
|
|
@@ -6449,9 +6476,9 @@ const D = class D {
|
|
|
6449
6476
|
}
|
|
6450
6477
|
e && (e.observer.disconnect(), D.registrations.delete(t));
|
|
6451
6478
|
const o = new IntersectionObserver(
|
|
6452
|
-
(
|
|
6479
|
+
(u) => {
|
|
6453
6480
|
const d = D.registrations.get(t);
|
|
6454
|
-
d &&
|
|
6481
|
+
d && u.forEach((h) => {
|
|
6455
6482
|
!h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new j(d.fragment, "intersect").runWithResult().then((g) => {
|
|
6456
6483
|
g && d.once && (d.observer.disconnect(), D.registrations.delete(t));
|
|
6457
6484
|
}).catch((g) => {
|
|
@@ -6559,10 +6586,10 @@ const O = class O {
|
|
|
6559
6586
|
return;
|
|
6560
6587
|
O._initialized = !0, O.disconnectMutationObservers();
|
|
6561
6588
|
const t = await Promise.allSettled([
|
|
6562
|
-
|
|
6563
|
-
|
|
6589
|
+
x.scan(document.head),
|
|
6590
|
+
x.scan(document.body)
|
|
6564
6591
|
]), [e, r] = t;
|
|
6565
|
-
e.status !== "fulfilled" && m.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && m.error("[Haori]", "Failed to build body fragment:", r.reason), await
|
|
6592
|
+
e.status !== "fulfilled" && m.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && m.error("[Haori]", "Failed to build body fragment:", r.reason), await P.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ht().start(), X.syncTree(document.body);
|
|
6566
6593
|
}
|
|
6567
6594
|
/**
|
|
6568
6595
|
* 指定された要素を監視します。
|
|
@@ -6576,12 +6603,12 @@ const O = class O {
|
|
|
6576
6603
|
switch (i.type) {
|
|
6577
6604
|
case "attributes": {
|
|
6578
6605
|
const n = i.target;
|
|
6579
|
-
if (i.attributeName && n.hasAttribute("data-haori-click-lock") && (i.attributeName === "disabled" || i.attributeName === "data-haori-click-lock") || i.attributeName &&
|
|
6606
|
+
if (i.attributeName && n.hasAttribute("data-haori-click-lock") && (i.attributeName === "disabled" || i.attributeName === "data-haori-click-lock") || i.attributeName && x.isAliasedAttributeReflection(
|
|
6580
6607
|
n,
|
|
6581
6608
|
i.attributeName
|
|
6582
6609
|
))
|
|
6583
6610
|
break;
|
|
6584
|
-
|
|
6611
|
+
x.setAttribute(
|
|
6585
6612
|
n,
|
|
6586
6613
|
i.attributeName,
|
|
6587
6614
|
n.getAttribute(i.attributeName),
|
|
@@ -6591,14 +6618,14 @@ const O = class O {
|
|
|
6591
6618
|
}
|
|
6592
6619
|
case "childList": {
|
|
6593
6620
|
Array.from(i.removedNodes).forEach((n) => {
|
|
6594
|
-
X.cleanupTree(n),
|
|
6621
|
+
X.cleanupTree(n), x.removeNode(n);
|
|
6595
6622
|
}), Array.from(i.addedNodes).forEach((n) => {
|
|
6596
|
-
n.parentElement instanceof Element && (
|
|
6623
|
+
n.parentElement instanceof Element && (x.addNode(n.parentElement, n), X.syncTree(n));
|
|
6597
6624
|
});
|
|
6598
6625
|
break;
|
|
6599
6626
|
}
|
|
6600
6627
|
case "characterData": {
|
|
6601
|
-
i.target instanceof Text || i.target instanceof Comment ?
|
|
6628
|
+
i.target instanceof Text || i.target instanceof Comment ? x.changeText(i.target, i.target.textContent) : m.warn(
|
|
6602
6629
|
"[Haori]",
|
|
6603
6630
|
"Unsupported character data type:",
|
|
6604
6631
|
i.target
|
|
@@ -6624,15 +6651,15 @@ const O = class O {
|
|
|
6624
6651
|
O._initialized = !1, O._mutationObservers = [];
|
|
6625
6652
|
let it = O;
|
|
6626
6653
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", it.init) : it.init();
|
|
6627
|
-
const Qt = () => Z.waitForRenders(), Zt = "0.17.
|
|
6654
|
+
const Qt = () => Z.waitForRenders(), Zt = "0.17.2";
|
|
6628
6655
|
export {
|
|
6629
|
-
|
|
6656
|
+
x as Core,
|
|
6630
6657
|
l as Env,
|
|
6631
6658
|
y as Form,
|
|
6632
6659
|
T as Fragment,
|
|
6633
6660
|
Z as Haori,
|
|
6634
6661
|
m as Log,
|
|
6635
|
-
|
|
6662
|
+
P as Queue,
|
|
6636
6663
|
Z as default,
|
|
6637
6664
|
Zt as version,
|
|
6638
6665
|
Qt as waitForRenders
|