haori 0.52.0 → 0.53.0
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/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +11 -11
- package/dist/haori.es.js +279 -209
- package/dist/haori.iife.js +10 -10
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -29,7 +29,7 @@ const ye = class ye {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
ye.devMode = !1;
|
|
32
|
-
let
|
|
32
|
+
let q = ye;
|
|
33
33
|
const Oe = "embedded";
|
|
34
34
|
function Ze(b) {
|
|
35
35
|
return b === "embedded" || b === "demo";
|
|
@@ -96,15 +96,15 @@ const ee = class ee {
|
|
|
96
96
|
}
|
|
97
97
|
if (e instanceof HTMLScriptElement && e.hasAttribute(`${ee._prefix}dev`)) {
|
|
98
98
|
const r = (e.getAttribute(`${ee._prefix}dev`) ?? "").trim().toLowerCase();
|
|
99
|
-
|
|
99
|
+
q.set(r !== "false" && r !== "off" && r !== "0");
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
const t = window.location.hostname;
|
|
103
103
|
if (t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "::1" || t.endsWith(".local")) {
|
|
104
|
-
|
|
104
|
+
q.set(!0);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
q.set(!1);
|
|
108
108
|
} catch {
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -128,7 +128,7 @@ class m {
|
|
|
128
128
|
* @param args 追加の引数
|
|
129
129
|
*/
|
|
130
130
|
static info(e, ...t) {
|
|
131
|
-
|
|
131
|
+
q.isEnabled() && console.log && console.log(e, ...t);
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* 開発モードでのみコンソールに警告を出力します。
|
|
@@ -137,7 +137,7 @@ class m {
|
|
|
137
137
|
* @param args 追加の引数
|
|
138
138
|
*/
|
|
139
139
|
static warn(e, ...t) {
|
|
140
|
-
|
|
140
|
+
q.isEnabled() && console.warn && console.warn(e, ...t);
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* モードに関係なくコンソールにエラーを出力します。
|
|
@@ -382,7 +382,7 @@ const bt = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, je = "new:
|
|
|
382
382
|
if (t = t[r], t === void 0)
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
|
-
return typeof t != "function" ? (
|
|
385
|
+
return typeof t != "function" ? (q.isEnabled() && !k.warnedMissingGlobals.has(e) && (k.warnedMissingGlobals.add(e), m.warn(
|
|
386
386
|
"[Haori]",
|
|
387
387
|
`${l.prefix}enhance-new could not resolve the global reference (load the library before Haori runs): ${e}`
|
|
388
388
|
)), null) : t;
|
|
@@ -394,7 +394,7 @@ const bt = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, je = "new:
|
|
|
394
394
|
* @returns 戻り値はありません。
|
|
395
395
|
*/
|
|
396
396
|
static warnUnknownName(e) {
|
|
397
|
-
!
|
|
397
|
+
!q.isEnabled() || k.warnedUnknownNames.has(e) || (k.warnedUnknownNames.add(e), m.warn(
|
|
398
398
|
"[Haori]",
|
|
399
399
|
`Enhancer "${e}" is not registered yet; the declaration is kept pending and applied when it is registered (Haori.enhancers.register('${e}', {init(el) {...}})).`
|
|
400
400
|
));
|
|
@@ -974,7 +974,7 @@ const T = class T {
|
|
|
974
974
|
* @returns 戻り値はありません。
|
|
975
975
|
*/
|
|
976
976
|
static reportUnusableBindingKeys(e) {
|
|
977
|
-
if (e.length === 0 || !
|
|
977
|
+
if (e.length === 0 || !q.isEnabled())
|
|
978
978
|
return;
|
|
979
979
|
const t = e.filter(
|
|
980
980
|
(r) => !this.loggedUnusableBindingKeys.has(r)
|
|
@@ -1272,7 +1272,7 @@ let ${e.join(", ")};`;
|
|
|
1272
1272
|
);
|
|
1273
1273
|
return;
|
|
1274
1274
|
}
|
|
1275
|
-
|
|
1275
|
+
q.isEnabled() && (e.forEach((r) => {
|
|
1276
1276
|
this.pendingUnresolvedIdentifiers.add(r);
|
|
1277
1277
|
}), this.scheduleUnresolvedIdentifierReport());
|
|
1278
1278
|
}
|
|
@@ -1329,7 +1329,7 @@ let ${e.join(", ")};`;
|
|
|
1329
1329
|
* @return 戻り値はありません。
|
|
1330
1330
|
*/
|
|
1331
1331
|
static recordRowScopeIdentifiers(e) {
|
|
1332
|
-
if (
|
|
1332
|
+
if (q.isEnabled())
|
|
1333
1333
|
for (const t of e)
|
|
1334
1334
|
typeof t == "string" && t !== "" && this.rowScopeIdentifiers.add(t);
|
|
1335
1335
|
}
|
|
@@ -1499,14 +1499,14 @@ ${t}`;
|
|
|
1499
1499
|
s && (this.BUILTIN_DATA_REFERENCE_PATTERN.test(n) ? a[this.BUILTIN_NAMESPACE] = {
|
|
1500
1500
|
...this.BUILTIN_HELPERS,
|
|
1501
1501
|
[this.BUILTIN_DATA_PROPERTY]: { ...a }
|
|
1502
|
-
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a),
|
|
1502
|
+
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a), q.isEnabled() && this.recordSuppliedIdentifiers(a);
|
|
1503
1503
|
const o = this.canAttemptMissingIdentifierRecovery(e), c = this.extractFreeIdentifiers(e).filter(
|
|
1504
1504
|
(d) => !(d in a) && // 禁止グローバルは buildAssignments が `const` で遮蔽するため対象外
|
|
1505
1505
|
// (二重宣言は構文エラーになる)。
|
|
1506
1506
|
!this.FORBIDDEN_NAMES.includes(d) && // 標準組み込み(`Math` など)は式から参照できる仕様のため遮蔽しない。
|
|
1507
1507
|
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(d)
|
|
1508
1508
|
);
|
|
1509
|
-
if (
|
|
1509
|
+
if (q.isEnabled()) {
|
|
1510
1510
|
const d = this.extractBoundIdentifiers(e);
|
|
1511
1511
|
this.recordScopeMissingIdentifiers(
|
|
1512
1512
|
d.size === 0 ? c : c.filter((p) => !d.has(p)),
|
|
@@ -2526,7 +2526,7 @@ const pe = "data-haori-if-disabled", ze = "input, select, textarea, button, fiel
|
|
|
2526
2526
|
* @returns 集計中なら true
|
|
2527
2527
|
*/
|
|
2528
2528
|
static isCollecting() {
|
|
2529
|
-
return L.collecting &&
|
|
2529
|
+
return L.collecting && q.isEnabled();
|
|
2530
2530
|
}
|
|
2531
2531
|
/**
|
|
2532
2532
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -2661,7 +2661,7 @@ ${u.template}`,
|
|
|
2661
2661
|
* @param expressions 今回評価した式一覧
|
|
2662
2662
|
*/
|
|
2663
2663
|
static record(e, t, r) {
|
|
2664
|
-
if (!
|
|
2664
|
+
if (!q.isEnabled() || !e || t.length === 0 || (L.ensureGlobalAccess(), !L.isCollecting()))
|
|
2665
2665
|
return;
|
|
2666
2666
|
const i = L.getOrCreateElementStore(
|
|
2667
2667
|
e.element
|
|
@@ -2694,7 +2694,7 @@ ${u.template}`,
|
|
|
2694
2694
|
* globalThis から dev-only の取得窓口を参照できるようにします。
|
|
2695
2695
|
*/
|
|
2696
2696
|
static ensureGlobalAccess() {
|
|
2697
|
-
if (!
|
|
2697
|
+
if (!q.isEnabled())
|
|
2698
2698
|
return;
|
|
2699
2699
|
const e = globalThis;
|
|
2700
2700
|
e[L.GLOBAL_KEY] === void 0 && (e[L.GLOBAL_KEY] = {
|
|
@@ -3019,7 +3019,7 @@ const S = class S extends I {
|
|
|
3019
3019
|
super(e), this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.bindingWorkActive = 0, this.lastSupplySequence = 0, this.lastResetSequence = 0, 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.rowLocalTemplate = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.value = null, this.selfWritingAttributes = /* @__PURE__ */ new Map(), this.skipChangeValue = !1, this.valueWriteUnapplied = !1, this.pendingValueWrite = null, this.userEditSequence = 0, this.authoritativeValueSequence = 0, this.lastValueSequence = 0, this.lastValueKind = "nonSupply", this.selfWrittenBind = /* @__PURE__ */ new Map(), this.lastPathApplied = /* @__PURE__ */ new Map(), this.lastChangeSequence = 0, S.dropFollowUpArtifacts(e), this.syncValue(), this.initialBindAttribute = e.getAttribute(`${l.prefix}bind`), e.getAttributeNames().forEach((i) => {
|
|
3020
3020
|
const n = e.getAttribute(i);
|
|
3021
3021
|
if (n !== null && !this.attributeMap.has(i)) {
|
|
3022
|
-
const s = new
|
|
3022
|
+
const s = new Me(i, n);
|
|
3023
3023
|
this.attributeMap.set(i, s);
|
|
3024
3024
|
}
|
|
3025
3025
|
});
|
|
@@ -4042,7 +4042,7 @@ const S = class S extends I {
|
|
|
4042
4042
|
* @return 戻り値はありません。
|
|
4043
4043
|
*/
|
|
4044
4044
|
static warnUnresolvedAttribute(e, t, r, i) {
|
|
4045
|
-
if (!
|
|
4045
|
+
if (!q.isEnabled())
|
|
4046
4046
|
return;
|
|
4047
4047
|
const n = `${e} ${r}`;
|
|
4048
4048
|
S.loggedUnresolvedAttributes.has(n) || (S.loggedUnresolvedAttributes.add(n), m.warn(
|
|
@@ -4213,7 +4213,7 @@ const S = class S extends I {
|
|
|
4213
4213
|
* @returns 戻り値はありません。
|
|
4214
4214
|
*/
|
|
4215
4215
|
static warnValueTypeDeclaration(e, t, r) {
|
|
4216
|
-
if (!
|
|
4216
|
+
if (!q.isEnabled())
|
|
4217
4217
|
return;
|
|
4218
4218
|
const i = e instanceof HTMLInputElement ? `[type=${e.type}]` : "", n = `${e.tagName}${i} ${t} ${r}`;
|
|
4219
4219
|
S.loggedValueTypeDeclarations.has(n) || (S.loggedValueTypeDeclarations.add(n), m.warn(
|
|
@@ -4469,7 +4469,7 @@ const S = class S extends I {
|
|
|
4469
4469
|
);
|
|
4470
4470
|
if (r === null)
|
|
4471
4471
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
4472
|
-
const o = new
|
|
4472
|
+
const o = new Me(e, r);
|
|
4473
4473
|
if (n) {
|
|
4474
4474
|
const ce = this.attributeMap.get(e);
|
|
4475
4475
|
if (ce && (ce.isEvaluate || ce.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
@@ -4486,13 +4486,13 @@ const S = class S extends I {
|
|
|
4486
4486
|
element: c,
|
|
4487
4487
|
rawName: e,
|
|
4488
4488
|
template: r
|
|
4489
|
-
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && S.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E = he.joinEvaluateResults(u.results), A = u.results.length === 1 ? u.results[0] : E, D = t === "value" && S.resolveDeclaredValueType(c) === "boolean",
|
|
4490
|
-
if (
|
|
4489
|
+
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && S.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E = he.joinEvaluateResults(u.results), A = u.results.length === 1 ? u.results[0] : E, D = t === "value" && S.resolveDeclaredValueType(c) === "boolean", M = A === !1 && !D, V = !o.isForceEvaluation() && (t !== e ? u.hasUnresolvedReference || A === null || A === void 0 || M : p ? u.hasUnresolvedReference || A === null || A === void 0 || A === !1 : y ? u.hasUnresolvedReference || A === null || A === void 0 || M : d && E === "");
|
|
4490
|
+
if (V && u.hasUnresolvedReference && S.warnUnresolvedAttribute(
|
|
4491
4491
|
e,
|
|
4492
4492
|
t,
|
|
4493
4493
|
r,
|
|
4494
4494
|
c
|
|
4495
|
-
),
|
|
4495
|
+
), q.isEnabled() && A === !1 && y) {
|
|
4496
4496
|
const ce = o.getSingleExpression(), ue = ce === null ? null : ie.diagnoseStrictComparison(
|
|
4497
4497
|
ce,
|
|
4498
4498
|
this.getBindingData()
|
|
@@ -4504,12 +4504,12 @@ const S = class S extends I {
|
|
|
4504
4504
|
c
|
|
4505
4505
|
);
|
|
4506
4506
|
}
|
|
4507
|
-
const N = o.isForceEvaluation() ? r : y ? A : E, j = i && o.isEvaluate && t === "value" && S.isValuePropertyTarget(c), Y = c.getRootNode(), Q = j && S.isUserEditableValue(c) && (c === Y.activeElement || this.hasPendingUserEdit()), P =
|
|
4507
|
+
const N = o.isForceEvaluation() ? r : y ? A : E, j = i && o.isEvaluate && t === "value" && S.isValuePropertyTarget(c), Y = c.getRootNode(), Q = j && S.isUserEditableValue(c) && (c === Y.activeElement || this.hasPendingUserEdit()), P = V || N === null || N === !1 && !D ? null : String(N), ne = e !== t && c.getAttribute(e) !== r, R = P === null ? c.hasAttribute(t) : c.getAttribute(t) !== P, $ = P === null ? "" : P, G = j && !Q && c.value !== $, Z = t === "checked" && c instanceof HTMLInputElement && (c.type === "checkbox" || c.type === "radio"), oe = t === "selected" && c instanceof HTMLOptionElement, le = Y.activeElement, W = le !== null && (Z && c === le || oe && c.closest("select") === le) || (Z || oe) && this.hasPendingCheckableUserEdit(oe), z = P !== null, _ = Z && o.isEvaluate && !W && c.checked !== z, J = oe && o.isEvaluate && !W && c.selected !== z;
|
|
4508
4508
|
if (!ne && !R && !G && !_ && !J)
|
|
4509
4509
|
return j && !Q && (this.value = this.normalizeValueForElement(
|
|
4510
4510
|
c,
|
|
4511
4511
|
$
|
|
4512
|
-
), this.clearUnappliedValueWrite()), (Z || oe) && !
|
|
4512
|
+
), this.clearUnappliedValueWrite()), (Z || oe) && !W && this.syncCheckableValueFromDom(oe), Promise.resolve();
|
|
4513
4513
|
const be = K.enqueue(() => {
|
|
4514
4514
|
ne && c.setAttribute(e, r), P === null ? c.removeAttribute(t) : R && (c.setAttribute(t, P), t === `${l.prefix}bind` && this.recordSelfWrittenBind(P)), t === "style" && this.captureAndHideDisplay(), j && !Q && (this.value = this.normalizeValueForElement(
|
|
4515
4515
|
c,
|
|
@@ -5078,7 +5078,7 @@ class qe extends I {
|
|
|
5078
5078
|
}));
|
|
5079
5079
|
}
|
|
5080
5080
|
}
|
|
5081
|
-
const
|
|
5081
|
+
const Ce = class Ce {
|
|
5082
5082
|
/**
|
|
5083
5083
|
* コンストラクタ。
|
|
5084
5084
|
*
|
|
@@ -5086,7 +5086,7 @@ const Me = class Me {
|
|
|
5086
5086
|
*/
|
|
5087
5087
|
constructor(e) {
|
|
5088
5088
|
this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
|
|
5089
|
-
const t = [...e.matchAll(
|
|
5089
|
+
const t = [...e.matchAll(Ce.PLACEHOLDER_REGEX)];
|
|
5090
5090
|
let r = 0, i = !1, n = !1;
|
|
5091
5091
|
for (const s of t) {
|
|
5092
5092
|
s.index > r && this.contents.push({
|
|
@@ -5217,8 +5217,8 @@ const Me = class Me {
|
|
|
5217
5217
|
), { results: n, hasUnresolvedReference: o };
|
|
5218
5218
|
}
|
|
5219
5219
|
};
|
|
5220
|
-
|
|
5221
|
-
let he =
|
|
5220
|
+
Ce.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
5221
|
+
let he = Ce;
|
|
5222
5222
|
const re = class re extends he {
|
|
5223
5223
|
/**
|
|
5224
5224
|
* コンストラクタ。
|
|
@@ -5298,7 +5298,7 @@ const re = class re extends he {
|
|
|
5298
5298
|
}
|
|
5299
5299
|
};
|
|
5300
5300
|
re.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], re.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], re.forceEvaluationNames = null, re.forceEvaluationPrefix = null;
|
|
5301
|
-
let
|
|
5301
|
+
let Me = re;
|
|
5302
5302
|
const Se = class Se {
|
|
5303
5303
|
/**
|
|
5304
5304
|
* 実行モードを取得します。
|
|
@@ -6413,7 +6413,7 @@ const f = class f {
|
|
|
6413
6413
|
* @param value 祖先が所有している値
|
|
6414
6414
|
*/
|
|
6415
6415
|
static warnArgOwnerIsNotRecord(e, t, r) {
|
|
6416
|
-
if (!
|
|
6416
|
+
if (!q.isEnabled() || r == null)
|
|
6417
6417
|
return;
|
|
6418
6418
|
const i = e.getTarget(), n = f.warnedArgOwnerNotRecord.get(i);
|
|
6419
6419
|
n?.has(t) || (n ? n.add(t) : f.warnedArgOwnerNotRecord.set(i, /* @__PURE__ */ new Set([t])), m.warn(
|
|
@@ -6627,7 +6627,7 @@ const f = class f {
|
|
|
6627
6627
|
* @returns 戻り値はありません。
|
|
6628
6628
|
*/
|
|
6629
6629
|
static warnUnvalidatedCustomValidity(e, t) {
|
|
6630
|
-
if (!
|
|
6630
|
+
if (!q.isEnabled() || !e)
|
|
6631
6631
|
return;
|
|
6632
6632
|
const r = `${l.prefix}validity`;
|
|
6633
6633
|
(e.hasAttribute(r) || e.getTarget().querySelector(`[${r}]`) !== null) && m.warn(
|
|
@@ -6690,7 +6690,7 @@ const f = class f {
|
|
|
6690
6690
|
* @param reason 退いた理由
|
|
6691
6691
|
*/
|
|
6692
6692
|
static warnPositionalRowFallback(e) {
|
|
6693
|
-
!
|
|
6693
|
+
!q.isEnabled() || f.warnedPositionalRowFallbacks.has(e) || (f.warnedPositionalRowFallbacks.add(e), m.warn(
|
|
6694
6694
|
"[Haori]",
|
|
6695
6695
|
`${l.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
6696
6696
|
));
|
|
@@ -6710,7 +6710,7 @@ const f = class f {
|
|
|
6710
6710
|
* @param container `data-form-list` を持つコンテナのフラグメント
|
|
6711
6711
|
*/
|
|
6712
6712
|
static warnDerivedRowsWithoutKey(e) {
|
|
6713
|
-
if (!
|
|
6713
|
+
if (!q.isEnabled() || e.getRawAttribute(`${l.prefix}each-key`) !== null)
|
|
6714
6714
|
return;
|
|
6715
6715
|
const t = e.getRawAttribute(`${l.prefix}each`);
|
|
6716
6716
|
t === null || f.resolveLeadingPath(t) !== null || f.warnedDerivedRowsWithoutKey.has(t) || (f.warnedDerivedRowsWithoutKey.add(t), m.warn(
|
|
@@ -6867,7 +6867,7 @@ const f = class f {
|
|
|
6867
6867
|
static createRowKeyIndexes(e, t) {
|
|
6868
6868
|
const r = /* @__PURE__ */ new Map();
|
|
6869
6869
|
return e.forEach((i, n) => {
|
|
6870
|
-
const s =
|
|
6870
|
+
const s = C.createListKey(
|
|
6871
6871
|
i,
|
|
6872
6872
|
t,
|
|
6873
6873
|
n
|
|
@@ -7047,7 +7047,7 @@ const f = class f {
|
|
|
7047
7047
|
const n = { ...i };
|
|
7048
7048
|
for (const s of t)
|
|
7049
7049
|
delete n[s];
|
|
7050
|
-
return
|
|
7050
|
+
return C.setBindingData(e.getTarget(), n, {
|
|
7051
7051
|
kind: r?.kind ?? "supply",
|
|
7052
7052
|
sequence: r?.sequence ?? w.nextSequence()
|
|
7053
7053
|
});
|
|
@@ -7364,11 +7364,11 @@ const f = class f {
|
|
|
7364
7364
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
7365
7365
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
7366
7366
|
!f.isGroupedCheckable(e) && !f.isMultipleSelect(e)) {
|
|
7367
|
-
const
|
|
7368
|
-
s.set(
|
|
7367
|
+
const M = String(c), V = s.get(M) ?? 0;
|
|
7368
|
+
s.set(M, V + 1), o.push(
|
|
7369
7369
|
f.applyFragmentValue(
|
|
7370
7370
|
e,
|
|
7371
|
-
D[
|
|
7371
|
+
D[V] ?? null,
|
|
7372
7372
|
i,
|
|
7373
7373
|
a
|
|
7374
7374
|
)
|
|
@@ -7408,12 +7408,12 @@ const f = class f {
|
|
|
7408
7408
|
y,
|
|
7409
7409
|
A == null ? null : String(A)
|
|
7410
7410
|
) : null;
|
|
7411
|
-
for (let
|
|
7412
|
-
const
|
|
7411
|
+
for (let M = 0; M < E.length; M++) {
|
|
7412
|
+
const V = E[M], N = D ? D[M] : y.length > M ? y[M] : null;
|
|
7413
7413
|
o.push(
|
|
7414
7414
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
7415
7415
|
f.setPartValues(
|
|
7416
|
-
|
|
7416
|
+
V,
|
|
7417
7417
|
f.asPlainRecord(N) ?? {},
|
|
7418
7418
|
r,
|
|
7419
7419
|
i,
|
|
@@ -7459,7 +7459,7 @@ const f = class f {
|
|
|
7459
7459
|
const r = f.collectBindingTargetForms(e);
|
|
7460
7460
|
if (r.length > 0 && r.every((n) => n.isSupplyStale(t)))
|
|
7461
7461
|
return;
|
|
7462
|
-
f.markResetSubtree(e, t),
|
|
7462
|
+
f.markResetSubtree(e, t), C.clearUserEditMarks(e, t), f.clearValues(e), await Promise.all([
|
|
7463
7463
|
f.clearMessages(e),
|
|
7464
7464
|
f.clearEachClones(e)
|
|
7465
7465
|
]), await K.enqueue(() => {
|
|
@@ -7473,16 +7473,16 @@ const f = class f {
|
|
|
7473
7473
|
} finally {
|
|
7474
7474
|
f.internalResetDepth -= 1;
|
|
7475
7475
|
}
|
|
7476
|
-
f.clearDeclarativeStateFromDom(e),
|
|
7476
|
+
f.clearDeclarativeStateFromDom(e), C.invalidateDerivedSubtreeSignatures(e), f.restoreEdits(n);
|
|
7477
7477
|
});
|
|
7478
7478
|
const i = r;
|
|
7479
7479
|
for (const n of i) {
|
|
7480
7480
|
const s = f.getInitialBindingData(n);
|
|
7481
|
-
s === null && n.getRawBindingData() === null || await
|
|
7481
|
+
s === null && n.getRawBindingData() === null || await C.setBindingData(n.getTarget(), s ?? {}, {
|
|
7482
7482
|
sequence: t
|
|
7483
7483
|
});
|
|
7484
7484
|
}
|
|
7485
|
-
f.syncValuesFromDom(e), await
|
|
7485
|
+
f.syncValuesFromDom(e), await C.evaluateAll(e);
|
|
7486
7486
|
for (const n of i)
|
|
7487
7487
|
f.getInitialBindingData(n) !== null || n.getRawBindingData() !== null || await f.restoreAncestorArgValues(n, {
|
|
7488
7488
|
sequence: t,
|
|
@@ -7502,7 +7502,7 @@ const f = class f {
|
|
|
7502
7502
|
));
|
|
7503
7503
|
} else
|
|
7504
7504
|
c = f.mergeCollectedValues(c, a), f.deleteAncestorOwnedKeys(n, s, c);
|
|
7505
|
-
await
|
|
7505
|
+
await C.setBindingData(n.getTarget(), c, {
|
|
7506
7506
|
sequence: t
|
|
7507
7507
|
});
|
|
7508
7508
|
}
|
|
@@ -7530,7 +7530,7 @@ const f = class f {
|
|
|
7530
7530
|
*/
|
|
7531
7531
|
static getInitialBindingData(e) {
|
|
7532
7532
|
const t = e.getInitialBindAttribute();
|
|
7533
|
-
return t === null ? null :
|
|
7533
|
+
return t === null ? null : C.parseDataBind(t);
|
|
7534
7534
|
}
|
|
7535
7535
|
/**
|
|
7536
7536
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -8476,7 +8476,7 @@ const F = class F {
|
|
|
8476
8476
|
), Promise.resolve();
|
|
8477
8477
|
F.RESTORED_ELEMENTS.add(r);
|
|
8478
8478
|
const i = F.readRecord(t), n = i ? F.extractFromRecord(t, i) : {}, s = { ...e.getRawBindingData() ?? {}, ...n };
|
|
8479
|
-
return F.seedSignature(r, F.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() :
|
|
8479
|
+
return F.seedSignature(r, F.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() : C.setBindingData(r, s, {
|
|
8480
8480
|
reentrant: !0,
|
|
8481
8481
|
kind: "nonSupply",
|
|
8482
8482
|
sequence: w.nextSequence()
|
|
@@ -8626,16 +8626,16 @@ const kt = [
|
|
|
8626
8626
|
"dialog",
|
|
8627
8627
|
"openDialog",
|
|
8628
8628
|
"toast"
|
|
8629
|
-
],
|
|
8629
|
+
], Mt = "__haoriHistoryState__", Le = "data-haori-click-lock", Xe = "ファイルを保存できませんでした";
|
|
8630
8630
|
function Te() {
|
|
8631
8631
|
const e = globalThis.window?.Haori;
|
|
8632
8632
|
return kt.every(
|
|
8633
8633
|
(r) => typeof e?.[r] == "function"
|
|
8634
8634
|
) ? e : Re;
|
|
8635
8635
|
}
|
|
8636
|
-
const
|
|
8636
|
+
const Ct = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
8637
8637
|
function Be(b) {
|
|
8638
|
-
return
|
|
8638
|
+
return Ct.has(b.toUpperCase());
|
|
8639
8639
|
}
|
|
8640
8640
|
function $t(b, e) {
|
|
8641
8641
|
for (const [t, r] of Object.entries(e))
|
|
@@ -8927,7 +8927,7 @@ const g = class g {
|
|
|
8927
8927
|
const r = e.getRawAttribute(t);
|
|
8928
8928
|
let i;
|
|
8929
8929
|
try {
|
|
8930
|
-
i =
|
|
8930
|
+
i = C.parseDataBind(r);
|
|
8931
8931
|
} catch (n) {
|
|
8932
8932
|
return m.error("Haori", `Invalid fetch headers: ${n}`), null;
|
|
8933
8933
|
}
|
|
@@ -9125,7 +9125,7 @@ const g = class g {
|
|
|
9125
9125
|
const a = r.trim();
|
|
9126
9126
|
if (g.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
9127
9127
|
return {
|
|
9128
|
-
value:
|
|
9128
|
+
value: C.parseDataBind(n),
|
|
9129
9129
|
hasUnresolvedReference: s
|
|
9130
9130
|
};
|
|
9131
9131
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -9134,7 +9134,7 @@ const g = class g {
|
|
|
9134
9134
|
e.getBindingData()
|
|
9135
9135
|
);
|
|
9136
9136
|
return {
|
|
9137
|
-
value:
|
|
9137
|
+
value: C.parseDataBind(c.value),
|
|
9138
9138
|
hasUnresolvedReference: s || c.hasUnresolvedReference
|
|
9139
9139
|
};
|
|
9140
9140
|
}
|
|
@@ -9143,7 +9143,7 @@ const g = class g {
|
|
|
9143
9143
|
e.getBindingData()
|
|
9144
9144
|
);
|
|
9145
9145
|
return {
|
|
9146
|
-
value:
|
|
9146
|
+
value: C.parseDataBind(o.value),
|
|
9147
9147
|
hasUnresolvedReference: s || o.hasUnresolvedReference
|
|
9148
9148
|
};
|
|
9149
9149
|
}
|
|
@@ -9290,13 +9290,13 @@ ${$}
|
|
|
9290
9290
|
);
|
|
9291
9291
|
}
|
|
9292
9292
|
}
|
|
9293
|
-
const A = g.attrName(t, "bind-arg"), D = g.attrName(null, "arg", !0),
|
|
9293
|
+
const A = g.attrName(t, "bind-arg"), D = g.attrName(null, "arg", !0), M = g.attrName(null, "bind-arg", !0);
|
|
9294
9294
|
t ? e.hasAttribute(A) && (r.bindArg = e.getRawAttribute(A)) : e.hasAttribute(D) ? r.bindArg = e.getRawAttribute(
|
|
9295
9295
|
D
|
|
9296
|
-
) : e.hasAttribute(
|
|
9297
|
-
const
|
|
9298
|
-
if (e.hasAttribute(
|
|
9299
|
-
const R = e.getRawAttribute(
|
|
9296
|
+
) : e.hasAttribute(M) && (r.bindArg = e.getRawAttribute(M));
|
|
9297
|
+
const V = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
9298
|
+
if (e.hasAttribute(V)) {
|
|
9299
|
+
const R = e.getRawAttribute(V);
|
|
9300
9300
|
r.bindParams = R.split("&").map(($) => $.trim());
|
|
9301
9301
|
}
|
|
9302
9302
|
const N = t ? g.attrName(t, "bind-append") : g.attrName(null, "bind-append", !0);
|
|
@@ -9315,13 +9315,13 @@ ${$}
|
|
|
9315
9315
|
}
|
|
9316
9316
|
if (t) {
|
|
9317
9317
|
if (e.hasAttribute(g.attrName(t, "adjust"))) {
|
|
9318
|
-
const
|
|
9318
|
+
const W = X.read(
|
|
9319
9319
|
e,
|
|
9320
9320
|
g.attrName(t, "adjust")
|
|
9321
9321
|
);
|
|
9322
|
-
if (
|
|
9322
|
+
if (W) {
|
|
9323
9323
|
const z = X.queryAll(
|
|
9324
|
-
|
|
9324
|
+
W,
|
|
9325
9325
|
g.attrName(t, "adjust")
|
|
9326
9326
|
);
|
|
9327
9327
|
z.length > 0 ? (r.adjustFragments = [], z.forEach((_) => {
|
|
@@ -9329,7 +9329,7 @@ ${$}
|
|
|
9329
9329
|
J && r.adjustFragments.push(J);
|
|
9330
9330
|
})) : m.error(
|
|
9331
9331
|
"Haori",
|
|
9332
|
-
`Adjust element not found: ${
|
|
9332
|
+
`Adjust element not found: ${W} (${g.attrName(t, "adjust")})`
|
|
9333
9333
|
);
|
|
9334
9334
|
}
|
|
9335
9335
|
if (e.hasAttribute(g.attrName(t, "adjust-value"))) {
|
|
@@ -9340,7 +9340,7 @@ ${$}
|
|
|
9340
9340
|
}
|
|
9341
9341
|
}
|
|
9342
9342
|
if (e.hasAttribute(g.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(g.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(g.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(g.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
|
|
9343
|
-
const
|
|
9343
|
+
const W = e.getRawAttribute(
|
|
9344
9344
|
`${l.prefix}${t}-after-run`
|
|
9345
9345
|
);
|
|
9346
9346
|
try {
|
|
@@ -9348,7 +9348,7 @@ ${$}
|
|
|
9348
9348
|
"response",
|
|
9349
9349
|
`
|
|
9350
9350
|
"use strict";
|
|
9351
|
-
${
|
|
9351
|
+
${W}
|
|
9352
9352
|
`
|
|
9353
9353
|
);
|
|
9354
9354
|
} catch (z) {
|
|
@@ -9369,10 +9369,10 @@ ${q}
|
|
|
9369
9369
|
"toast",
|
|
9370
9370
|
g.attrName(t, "toast")
|
|
9371
9371
|
);
|
|
9372
|
-
const
|
|
9372
|
+
const W = e.getRawAttribute(
|
|
9373
9373
|
g.attrName(t, "toast-level")
|
|
9374
|
-
), _ = ["info", "warning", "error", "success"].includes(
|
|
9375
|
-
r.toastLevel = _ ?
|
|
9374
|
+
), _ = ["info", "warning", "error", "success"].includes(W);
|
|
9375
|
+
r.toastLevel = _ ? W : null;
|
|
9376
9376
|
}
|
|
9377
9377
|
const R = g.attrName(t, "redirect"), $ = g.attrName(t, "redirect-replace"), G = e.hasAttribute(R), Z = e.hasAttribute($);
|
|
9378
9378
|
if (G && (r.redirectUrl = g.readLateAttribute(
|
|
@@ -9386,15 +9386,15 @@ ${q}
|
|
|
9386
9386
|
"redirect-replace",
|
|
9387
9387
|
$
|
|
9388
9388
|
)), G || Z) {
|
|
9389
|
-
const
|
|
9389
|
+
const W = g.attrName(
|
|
9390
9390
|
t,
|
|
9391
9391
|
"redirect-return-param"
|
|
9392
9392
|
);
|
|
9393
|
-
e.hasAttribute(
|
|
9393
|
+
e.hasAttribute(W) && (r.redirectReturnParam = g.readLateAttribute(
|
|
9394
9394
|
e,
|
|
9395
9395
|
r,
|
|
9396
9396
|
"redirect-return-param",
|
|
9397
|
-
|
|
9397
|
+
W
|
|
9398
9398
|
));
|
|
9399
9399
|
}
|
|
9400
9400
|
if (e.hasAttribute(g.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(g.attrName(t, "scroll")) && (r.scrollTarget = g.readLateAttribute(
|
|
@@ -9408,20 +9408,20 @@ ${q}
|
|
|
9408
9408
|
"history",
|
|
9409
9409
|
g.attrName(t, "history")
|
|
9410
9410
|
)), e.hasAttribute(g.attrName(t, "history-data")) && (r.historyDataAttrName = g.attrName(t, "history-data")), e.hasAttribute(g.attrName(t, "history-form"))) {
|
|
9411
|
-
const
|
|
9411
|
+
const W = X.read(
|
|
9412
9412
|
e,
|
|
9413
9413
|
g.attrName(t, "history-form")
|
|
9414
9414
|
);
|
|
9415
|
-
if (
|
|
9415
|
+
if (W) {
|
|
9416
9416
|
const z = X.query(
|
|
9417
|
-
|
|
9417
|
+
W,
|
|
9418
9418
|
g.attrName(t, "history-form")
|
|
9419
9419
|
);
|
|
9420
9420
|
z !== null ? r.historyFormFragment = x.getFormFragment(
|
|
9421
9421
|
I.get(z)
|
|
9422
9422
|
) : m.error(
|
|
9423
9423
|
"Haori",
|
|
9424
|
-
`Form element not found: ${
|
|
9424
|
+
`Form element not found: ${W} (${g.attrName(t, "history-form")})`
|
|
9425
9425
|
);
|
|
9426
9426
|
} else
|
|
9427
9427
|
r.historyFormFragment = x.getFormFragment(e);
|
|
@@ -9434,8 +9434,8 @@ ${q}
|
|
|
9434
9434
|
"copy",
|
|
9435
9435
|
"open",
|
|
9436
9436
|
"close"
|
|
9437
|
-
].forEach((
|
|
9438
|
-
const z = g.attrName(t,
|
|
9437
|
+
].forEach((W) => {
|
|
9438
|
+
const z = g.attrName(t, W);
|
|
9439
9439
|
if (!e.hasAttribute(z))
|
|
9440
9440
|
return;
|
|
9441
9441
|
const _ = X.read(e, z), J = [];
|
|
@@ -9444,13 +9444,13 @@ ${q}
|
|
|
9444
9444
|
const ue = I.get(ce);
|
|
9445
9445
|
ue && J.push(ue);
|
|
9446
9446
|
}), J.length === 0 && m.error("Haori", `Element not found: ${_} (${z})`);
|
|
9447
|
-
else if (
|
|
9447
|
+
else if (W === "open" || W === "close") {
|
|
9448
9448
|
const be = e.getTarget().closest("dialog");
|
|
9449
9449
|
be ? J.push(I.get(be)) : m.error("Haori", `Ancestor <dialog> not found (${z})`);
|
|
9450
9450
|
} else
|
|
9451
9451
|
J.push(e);
|
|
9452
9452
|
if (J.length > 0)
|
|
9453
|
-
switch (
|
|
9453
|
+
switch (W) {
|
|
9454
9454
|
case "reset-before":
|
|
9455
9455
|
r.resetBeforeFragments = J;
|
|
9456
9456
|
break;
|
|
@@ -9476,19 +9476,19 @@ ${q}
|
|
|
9476
9476
|
});
|
|
9477
9477
|
const le = g.attrName(t, "copy-source");
|
|
9478
9478
|
if (e.hasAttribute(le)) {
|
|
9479
|
-
const
|
|
9480
|
-
if (
|
|
9481
|
-
const z = X.query(
|
|
9479
|
+
const W = X.read(e, le);
|
|
9480
|
+
if (W) {
|
|
9481
|
+
const z = X.query(W, le);
|
|
9482
9482
|
if (z !== null) {
|
|
9483
9483
|
const _ = I.get(z);
|
|
9484
9484
|
_ ? r.copySourceFragment = _ : m.error(
|
|
9485
9485
|
"Haori",
|
|
9486
|
-
`Element is not managed by Haori: ${
|
|
9486
|
+
`Element is not managed by Haori: ${W} (${le})`
|
|
9487
9487
|
);
|
|
9488
9488
|
} else
|
|
9489
9489
|
m.error(
|
|
9490
9490
|
"Haori",
|
|
9491
|
-
`Element not found: ${
|
|
9491
|
+
`Element not found: ${W} (${le})`
|
|
9492
9492
|
);
|
|
9493
9493
|
} else
|
|
9494
9494
|
r.copySourceFragment = e;
|
|
@@ -9699,11 +9699,11 @@ ${q}
|
|
|
9699
9699
|
s
|
|
9700
9700
|
);
|
|
9701
9701
|
n = A.url;
|
|
9702
|
-
const D = { ...A.options },
|
|
9702
|
+
const D = { ...A.options }, M = A.normalized ? A.requestedMethod : r.requestedMethod, V = A.effectiveMethod, N = r.transportMode === "query-get" || A.normalized, j = A.queryString ?? r.queryString;
|
|
9703
9703
|
if (N && m.info("Haori demo fetch normalization", {
|
|
9704
9704
|
runtime: l.runtime,
|
|
9705
|
-
requestedMethod:
|
|
9706
|
-
effectiveMethod:
|
|
9705
|
+
requestedMethod: M,
|
|
9706
|
+
effectiveMethod: V,
|
|
9707
9707
|
transportMode: "query-get",
|
|
9708
9708
|
url: n,
|
|
9709
9709
|
payload: c ? i : void 0,
|
|
@@ -9711,8 +9711,8 @@ ${q}
|
|
|
9711
9711
|
}), this.options.targetFragment && n) {
|
|
9712
9712
|
const Y = performance.now(), Q = {
|
|
9713
9713
|
runtime: l.runtime,
|
|
9714
|
-
requestedMethod:
|
|
9715
|
-
effectiveMethod:
|
|
9714
|
+
requestedMethod: M,
|
|
9715
|
+
effectiveMethod: V,
|
|
9716
9716
|
transportMode: N ? "query-get" : "http",
|
|
9717
9717
|
...N ? { queryString: j } : {}
|
|
9718
9718
|
};
|
|
@@ -9743,29 +9743,29 @@ ${q}
|
|
|
9743
9743
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && c) {
|
|
9744
9744
|
const p = this.options.formFragment, y = p.getTarget(), E = /* @__PURE__ */ new Set();
|
|
9745
9745
|
e && e.appliedDisabledAttribute && this.options.targetFragment && E.add(this.options.targetFragment);
|
|
9746
|
-
const A = p.getRawBindingData(), D = Ue(i),
|
|
9747
|
-
let
|
|
9748
|
-
if (
|
|
9749
|
-
|
|
9750
|
-
const N = String(
|
|
9751
|
-
|
|
9752
|
-
(j ? j.value :
|
|
9746
|
+
const A = p.getRawBindingData(), D = Ue(i), M = p.getAttribute(`${l.prefix}form-arg`);
|
|
9747
|
+
let V;
|
|
9748
|
+
if (M) {
|
|
9749
|
+
V = { ...A ?? {} };
|
|
9750
|
+
const N = String(M), j = x.resolveAncestorArgOwner(p, N);
|
|
9751
|
+
V[N] = x.mergeCollectedValues(
|
|
9752
|
+
(j ? j.value : V[N]) ?? null,
|
|
9753
9753
|
D
|
|
9754
9754
|
);
|
|
9755
9755
|
} else
|
|
9756
|
-
|
|
9756
|
+
V = x.mergeCollectedValues(
|
|
9757
9757
|
A,
|
|
9758
9758
|
D,
|
|
9759
9759
|
x.ancestorBaseResolver(p)
|
|
9760
9760
|
);
|
|
9761
|
-
await
|
|
9761
|
+
await C.setBindingData(y, V, {
|
|
9762
9762
|
skipFragments: E,
|
|
9763
9763
|
kind: "nonSupply",
|
|
9764
9764
|
sequence: this.operationSequence,
|
|
9765
9765
|
editedPaths: x.collectEditedPaths(
|
|
9766
9766
|
p,
|
|
9767
9767
|
this.operationSequence,
|
|
9768
|
-
|
|
9768
|
+
M ? String(M) : "",
|
|
9769
9769
|
D
|
|
9770
9770
|
)
|
|
9771
9771
|
});
|
|
@@ -9842,7 +9842,7 @@ ${q}
|
|
|
9842
9842
|
t.removeAttribute("disabled");
|
|
9843
9843
|
return;
|
|
9844
9844
|
}
|
|
9845
|
-
|
|
9845
|
+
C.setAttribute(t, r.name, r.value).catch(
|
|
9846
9846
|
(i) => {
|
|
9847
9847
|
m.error(
|
|
9848
9848
|
"Haori",
|
|
@@ -10019,7 +10019,7 @@ ${q}
|
|
|
10019
10019
|
let a = !1;
|
|
10020
10020
|
if (this.options.clickFragments && this.options.clickFragments.length > 0)
|
|
10021
10021
|
for (const E of this.options.clickFragments) {
|
|
10022
|
-
await
|
|
10022
|
+
await C.evaluateAll(E);
|
|
10023
10023
|
const A = E.getTarget();
|
|
10024
10024
|
if (this.options.clickAwait && g.takeClickOutcome(A), typeof A.click == "function" ? A.click() : A.dispatchEvent(
|
|
10025
10025
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -10084,12 +10084,12 @@ ${q}
|
|
|
10084
10084
|
this.options.redirectReturnParam
|
|
10085
10085
|
);
|
|
10086
10086
|
if (A) {
|
|
10087
|
-
const
|
|
10088
|
-
if (
|
|
10089
|
-
const
|
|
10090
|
-
pt.isSafeLocalPath(
|
|
10087
|
+
const M = new URLSearchParams(window.location.search).get(A);
|
|
10088
|
+
if (M !== null) {
|
|
10089
|
+
const V = M.trim();
|
|
10090
|
+
pt.isSafeLocalPath(V) ? E = V : m.warn(
|
|
10091
10091
|
"Haori",
|
|
10092
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
10092
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${M}`
|
|
10093
10093
|
);
|
|
10094
10094
|
}
|
|
10095
10095
|
}
|
|
@@ -10124,7 +10124,7 @@ ${q}
|
|
|
10124
10124
|
if (!i || !n || !n.hasAttribute(i.attributeName))
|
|
10125
10125
|
return r;
|
|
10126
10126
|
const s = n.getAttributeEvaluation(i.attributeName);
|
|
10127
|
-
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (
|
|
10127
|
+
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (q.isEnabled() && m.warn(
|
|
10128
10128
|
"Haori",
|
|
10129
10129
|
`${i.attributeName} の参照が手続きの途中で解決できなくなったため、手続き開始時の値を使います`
|
|
10130
10130
|
), r) : s.value ?? null;
|
|
@@ -10154,10 +10154,10 @@ ${q}
|
|
|
10154
10154
|
p != null && (Array.isArray(p) ? (o.searchParams.delete(d), p.forEach((y) => o.searchParams.append(d, String(y)))) : typeof p == "object" ? o.searchParams.set(d, JSON.stringify(p)) : o.searchParams.set(d, String(p)));
|
|
10155
10155
|
};
|
|
10156
10156
|
n && c(r), s && c(i), history.pushState(
|
|
10157
|
-
{ [
|
|
10157
|
+
{ [Mt]: !0 },
|
|
10158
10158
|
"",
|
|
10159
10159
|
o.toString()
|
|
10160
|
-
),
|
|
10160
|
+
), C.refreshUrlParams();
|
|
10161
10161
|
} catch (a) {
|
|
10162
10162
|
m.error("Haori", `history.pushState failed: ${a}`);
|
|
10163
10163
|
}
|
|
@@ -10339,7 +10339,7 @@ ${q}
|
|
|
10339
10339
|
return s.unresolvedReference ? (e || m.warn(
|
|
10340
10340
|
"Haori",
|
|
10341
10341
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
10342
|
-
), !1) : s.value ? !0 : (!e &&
|
|
10342
|
+
), !1) : s.value ? !0 : (!e && q.isEnabled() && m.warn(
|
|
10343
10343
|
"Haori",
|
|
10344
10344
|
`${i} の条件が偽のため手続きを中断しました: ${t}`
|
|
10345
10345
|
), !1);
|
|
@@ -10432,11 +10432,11 @@ ${q}
|
|
|
10432
10432
|
apply: (y) => {
|
|
10433
10433
|
const E = this.resolveCurrentRowItem(o, y), A = { ...E };
|
|
10434
10434
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
10435
|
-
const D = E[p],
|
|
10435
|
+
const D = E[p], M = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
10436
10436
|
A[p] = this.mergeAppendBindingData(
|
|
10437
10437
|
o,
|
|
10438
10438
|
i,
|
|
10439
|
-
|
|
10439
|
+
M
|
|
10440
10440
|
);
|
|
10441
10441
|
} else
|
|
10442
10442
|
A[p] = i;
|
|
@@ -10456,7 +10456,7 @@ ${q}
|
|
|
10456
10456
|
} else
|
|
10457
10457
|
u[d] = i;
|
|
10458
10458
|
n.push(
|
|
10459
|
-
|
|
10459
|
+
C.setBindingData(
|
|
10460
10460
|
o.getTarget(),
|
|
10461
10461
|
this.reconcileUserEditsForBind(o, u),
|
|
10462
10462
|
{
|
|
@@ -10514,7 +10514,7 @@ ${q}
|
|
|
10514
10514
|
i
|
|
10515
10515
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
10516
10516
|
n.push(
|
|
10517
|
-
|
|
10517
|
+
C.setBindingData(
|
|
10518
10518
|
o.getTarget(),
|
|
10519
10519
|
this.reconcileUserEditsForBind(o, d),
|
|
10520
10520
|
{
|
|
@@ -10570,7 +10570,7 @@ ${q}
|
|
|
10570
10570
|
if (r === null)
|
|
10571
10571
|
return t;
|
|
10572
10572
|
const i = this.eventType === "poll";
|
|
10573
|
-
if (!i && !this.twoWayCommitBind &&
|
|
10573
|
+
if (!i && !this.twoWayCommitBind && C.clearUserEditMarks(e, r), !(e.getTarget() instanceof HTMLFormElement))
|
|
10574
10574
|
return this.reconcileAncestorArgFormEdits(
|
|
10575
10575
|
e,
|
|
10576
10576
|
t,
|
|
@@ -10609,7 +10609,7 @@ ${q}
|
|
|
10609
10609
|
if (r === null)
|
|
10610
10610
|
return t;
|
|
10611
10611
|
const i = this.eventType === "poll";
|
|
10612
|
-
!i && !this.twoWayCommitBind &&
|
|
10612
|
+
!i && !this.twoWayCommitBind && C.clearUserEditMarks(e, r);
|
|
10613
10613
|
const n = x.getValuesEditedAfter(
|
|
10614
10614
|
e,
|
|
10615
10615
|
i ? 0 : r
|
|
@@ -10682,7 +10682,7 @@ ${q}
|
|
|
10682
10682
|
...t
|
|
10683
10683
|
};
|
|
10684
10684
|
n.push(
|
|
10685
|
-
|
|
10685
|
+
C.setBindingData(s.getTarget(), o, {
|
|
10686
10686
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
10687
10687
|
sequence: this.operationSequence
|
|
10688
10688
|
})
|
|
@@ -10744,9 +10744,9 @@ ${q}
|
|
|
10744
10744
|
* @returns コピー元のデータ
|
|
10745
10745
|
*/
|
|
10746
10746
|
resolveCopySourceData() {
|
|
10747
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? Fe(this.options.copySourceFragment) :
|
|
10747
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? Fe(this.options.copySourceFragment) : C.withoutReservedBindingKeys(
|
|
10748
10748
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
10749
|
-
) : this.options.formFragment ? Fe(this.options.formFragment) : this.options.targetFragment ?
|
|
10749
|
+
) : this.options.formFragment ? Fe(this.options.formFragment) : this.options.targetFragment ? C.withoutReservedBindingKeys(
|
|
10750
10750
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
10751
10751
|
) : {};
|
|
10752
10752
|
}
|
|
@@ -11235,7 +11235,7 @@ ${q}
|
|
|
11235
11235
|
}
|
|
11236
11236
|
if (!o)
|
|
11237
11237
|
return;
|
|
11238
|
-
const c =
|
|
11238
|
+
const c = C.setBindingData(
|
|
11239
11239
|
s.owner.getTarget(),
|
|
11240
11240
|
g.withPathValue(s.ownerData, s.path, a),
|
|
11241
11241
|
{
|
|
@@ -11251,7 +11251,7 @@ ${q}
|
|
|
11251
11251
|
sequence: this.operationSequence
|
|
11252
11252
|
}
|
|
11253
11253
|
);
|
|
11254
|
-
if (
|
|
11254
|
+
if (C.isEachUpdateRunning(n)) {
|
|
11255
11255
|
c.catch((u) => {
|
|
11256
11256
|
m.error("Haori", "Failed to write row data.", u);
|
|
11257
11257
|
});
|
|
@@ -11347,7 +11347,7 @@ ${q}
|
|
|
11347
11347
|
if (a && o !== null) {
|
|
11348
11348
|
const c = [];
|
|
11349
11349
|
r.forEach((p, y) => {
|
|
11350
|
-
|
|
11350
|
+
C.createListKey(
|
|
11351
11351
|
p,
|
|
11352
11352
|
String(a),
|
|
11353
11353
|
y
|
|
@@ -11466,14 +11466,14 @@ ${q}
|
|
|
11466
11466
|
if (g.isSameRowItem(i.array[E], y))
|
|
11467
11467
|
return;
|
|
11468
11468
|
const A = p.get(
|
|
11469
|
-
|
|
11469
|
+
C.createListKey(
|
|
11470
11470
|
y,
|
|
11471
11471
|
null,
|
|
11472
11472
|
E
|
|
11473
11473
|
)
|
|
11474
11474
|
);
|
|
11475
|
-
A &&
|
|
11476
|
-
}),
|
|
11475
|
+
A && C.clearUserEditMarks(A);
|
|
11476
|
+
}), C.setBindingData(
|
|
11477
11477
|
i.owner.getTarget(),
|
|
11478
11478
|
g.withPathValue(i.ownerData, i.path, d),
|
|
11479
11479
|
{
|
|
@@ -11516,7 +11516,7 @@ ${q}
|
|
|
11516
11516
|
...s.getRawBindingData() ?? {},
|
|
11517
11517
|
_fetch: n
|
|
11518
11518
|
};
|
|
11519
|
-
return
|
|
11519
|
+
return C.setBindingData(a, o, {
|
|
11520
11520
|
reflectToAttribute: !1,
|
|
11521
11521
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
11522
11522
|
// 解除しない)。
|
|
@@ -12127,30 +12127,30 @@ const h = class h {
|
|
|
12127
12127
|
const A = () => {
|
|
12128
12128
|
i.markBindingWorkStart();
|
|
12129
12129
|
const D = i.getRawBindingData() ?? E;
|
|
12130
|
-
let
|
|
12130
|
+
let M = a ? i.setAttribute(
|
|
12131
12131
|
`${l.prefix}bind`,
|
|
12132
12132
|
JSON.stringify(h.withoutReservedBindingKeys(D))
|
|
12133
12133
|
) : Promise.resolve();
|
|
12134
|
-
return e.tagName === "FORM" && (
|
|
12134
|
+
return e.tagName === "FORM" && (M = M.then(() => {
|
|
12135
12135
|
if (i.wasResetAfter(p))
|
|
12136
12136
|
return;
|
|
12137
|
-
const
|
|
12137
|
+
const V = i.getRawBindingData() ?? E;
|
|
12138
12138
|
return x.syncValues(
|
|
12139
12139
|
i,
|
|
12140
|
-
x.resolveSyncValues(i,
|
|
12140
|
+
x.resolveSyncValues(i, V),
|
|
12141
12141
|
!1,
|
|
12142
12142
|
u
|
|
12143
12143
|
);
|
|
12144
|
-
})),
|
|
12144
|
+
})), M = M.then(
|
|
12145
12145
|
() => x.syncAncestorArgForms(i, p, u, y)
|
|
12146
|
-
),
|
|
12146
|
+
), M = M.then(() => h.evaluateAll(i, n)), M = M.then(
|
|
12147
12147
|
() => w.retryUnappliedValueWrites(e, p)
|
|
12148
|
-
),
|
|
12148
|
+
), M = M.then(
|
|
12149
12149
|
() => h.reevaluateReactiveSpecialAttributes(i, n)
|
|
12150
|
-
),
|
|
12150
|
+
), M.then(
|
|
12151
12151
|
() => i.markBindingWorkEnd(),
|
|
12152
|
-
(
|
|
12153
|
-
throw i.markBindingWorkEnd(),
|
|
12152
|
+
(V) => {
|
|
12153
|
+
throw i.markBindingWorkEnd(), V;
|
|
12154
12154
|
}
|
|
12155
12155
|
);
|
|
12156
12156
|
};
|
|
@@ -12220,14 +12220,14 @@ const h = class h {
|
|
|
12220
12220
|
...Object.keys(d)
|
|
12221
12221
|
]);
|
|
12222
12222
|
for (const A of E) {
|
|
12223
|
-
const D = n === "" ? A : `${n}.${A}`,
|
|
12223
|
+
const D = n === "" ? A : `${n}.${A}`, M = h.mergePathAuthority(
|
|
12224
12224
|
e,
|
|
12225
12225
|
Object.prototype.hasOwnProperty.call(u, A) ? u[A] : h.ABSENT_PATH,
|
|
12226
12226
|
Object.prototype.hasOwnProperty.call(d, A) ? d[A] : h.ABSENT_PATH,
|
|
12227
12227
|
i,
|
|
12228
12228
|
D
|
|
12229
12229
|
);
|
|
12230
|
-
|
|
12230
|
+
M !== h.ABSENT_PATH && (p[A] = M), M !== (Object.prototype.hasOwnProperty.call(d, A) ? d[A] : h.ABSENT_PATH) && (y = !0);
|
|
12231
12231
|
}
|
|
12232
12232
|
return y ? p : d;
|
|
12233
12233
|
}
|
|
@@ -12416,7 +12416,7 @@ const h = class h {
|
|
|
12416
12416
|
*/
|
|
12417
12417
|
static dumpScope(e) {
|
|
12418
12418
|
const t = h.collectScope(e);
|
|
12419
|
-
return
|
|
12419
|
+
return q.isEnabled() && m.info("[Haori]", "scope dump for", e, t), t;
|
|
12420
12420
|
}
|
|
12421
12421
|
/**
|
|
12422
12422
|
* スコープの解決結果と由来を収集します。
|
|
@@ -12794,7 +12794,7 @@ const h = class h {
|
|
|
12794
12794
|
static evaluateIf(e) {
|
|
12795
12795
|
const t = [], r = e.getAttribute(`${l.prefix}if`);
|
|
12796
12796
|
if (h.isHiddenIfCondition(r))
|
|
12797
|
-
|
|
12797
|
+
q.isEnabled() && e.isVisible() && h.logFalsyIfDiagnostics(e), t.push(
|
|
12798
12798
|
e.hide().then(() => {
|
|
12799
12799
|
B.hide(e.getTarget());
|
|
12800
12800
|
})
|
|
@@ -12863,7 +12863,7 @@ const h = class h {
|
|
|
12863
12863
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
12864
12864
|
*/
|
|
12865
12865
|
static evaluateEach(e) {
|
|
12866
|
-
if (
|
|
12866
|
+
if (q.isEnabled() && ie.recordRowScopeIdentifiers([
|
|
12867
12867
|
h.getRowScopeName(e, "each-arg"),
|
|
12868
12868
|
h.getRowScopeName(e, "each-index")
|
|
12869
12869
|
]), e.isMounted() || h.syncMountedState(e), !e.isVisible() || !e.isMounted())
|
|
@@ -13350,7 +13350,7 @@ ${r}
|
|
|
13350
13350
|
* @returns プロファイル
|
|
13351
13351
|
*/
|
|
13352
13352
|
static getOrCreateDerivedSubtreeProfile(e) {
|
|
13353
|
-
if (!
|
|
13353
|
+
if (!q.isEnabled() || !e.hasAttribute(`${l.prefix}derive`))
|
|
13354
13354
|
return null;
|
|
13355
13355
|
const t = h.DERIVE_SUBTREE_PROFILES.get(e);
|
|
13356
13356
|
if (t)
|
|
@@ -13537,18 +13537,18 @@ ${r}
|
|
|
13537
13537
|
const Y = A.get(j);
|
|
13538
13538
|
Y ? Y.push(N) : A.set(j, [N]);
|
|
13539
13539
|
});
|
|
13540
|
-
const D = e.getChildElementFragments().filter((N) => !y.has(N)),
|
|
13540
|
+
const D = e.getChildElementFragments().filter((N) => !y.has(N)), M = D.filter(
|
|
13541
13541
|
(N) => N.hasAttribute(`${l.prefix}each-before`)
|
|
13542
13542
|
).length;
|
|
13543
|
-
let
|
|
13543
|
+
let V = Promise.resolve();
|
|
13544
13544
|
return a.forEach((N, j) => {
|
|
13545
13545
|
const Y = t[j], Q = j;
|
|
13546
13546
|
let P;
|
|
13547
13547
|
const ne = A.get(N)?.shift();
|
|
13548
13548
|
if (ne) {
|
|
13549
13549
|
P = ne;
|
|
13550
|
-
const R =
|
|
13551
|
-
|
|
13550
|
+
const R = M + j;
|
|
13551
|
+
V = V.then(
|
|
13552
13552
|
() => h.updateRowFragment(
|
|
13553
13553
|
P,
|
|
13554
13554
|
Y,
|
|
@@ -13570,7 +13570,7 @@ ${r}
|
|
|
13570
13570
|
if (G !== null && B.rowMove(
|
|
13571
13571
|
P.getTarget(),
|
|
13572
13572
|
N,
|
|
13573
|
-
G -
|
|
13573
|
+
G - M,
|
|
13574
13574
|
j
|
|
13575
13575
|
), !(!$ && h.isRowLocalEachTemplate(e)))
|
|
13576
13576
|
return h.evaluateAll(P).then(
|
|
@@ -13582,8 +13582,8 @@ ${r}
|
|
|
13582
13582
|
);
|
|
13583
13583
|
} else {
|
|
13584
13584
|
P = r.clone();
|
|
13585
|
-
const R =
|
|
13586
|
-
|
|
13585
|
+
const R = M + j;
|
|
13586
|
+
V = V.then(
|
|
13587
13587
|
() => h.updateRowFragment(
|
|
13588
13588
|
P,
|
|
13589
13589
|
Y,
|
|
@@ -13601,7 +13601,7 @@ ${r}
|
|
|
13601
13601
|
})
|
|
13602
13602
|
);
|
|
13603
13603
|
}
|
|
13604
|
-
}), Promise.all(u).then(() =>
|
|
13604
|
+
}), Promise.all(u).then(() => V).then(() => {
|
|
13605
13605
|
const N = a.filter(
|
|
13606
13606
|
(R) => R !== null
|
|
13607
13607
|
), j = E.filter(
|
|
@@ -13666,7 +13666,7 @@ ${r}
|
|
|
13666
13666
|
* @returns 戻り値はありません。
|
|
13667
13667
|
*/
|
|
13668
13668
|
static warnDuplicateEachKey(e) {
|
|
13669
|
-
!
|
|
13669
|
+
!q.isEnabled() || h.WARNED_DUPLICATE_EACH_KEYS.has(e) || (h.WARNED_DUPLICATE_EACH_KEYS.add(e), m.warn(
|
|
13670
13670
|
"[Haori]",
|
|
13671
13671
|
`${l.prefix}each-key="${e}" の値が配列の中で重複しています。行は出現順で対応付けますが、キーによる行の識別はできません。`
|
|
13672
13672
|
));
|
|
@@ -13906,7 +13906,7 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
13906
13906
|
"enhance",
|
|
13907
13907
|
"enhance-new"
|
|
13908
13908
|
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
13909
|
-
let
|
|
13909
|
+
let C = h;
|
|
13910
13910
|
const we = class we {
|
|
13911
13911
|
/**
|
|
13912
13912
|
* コンストラクタ。
|
|
@@ -13928,7 +13928,7 @@ const we = class we {
|
|
|
13928
13928
|
}, this.onPopstate = (t) => {
|
|
13929
13929
|
const r = t.state;
|
|
13930
13930
|
if (!r || r[we.HISTORY_STATE_KEY] !== !0) {
|
|
13931
|
-
|
|
13931
|
+
C.refreshUrlParams();
|
|
13932
13932
|
return;
|
|
13933
13933
|
}
|
|
13934
13934
|
location.reload();
|
|
@@ -14265,7 +14265,7 @@ we.HISTORY_STATE_KEY = "__haoriHistoryState__", we.BUILTIN_EVENT_NAMES = /* @__P
|
|
|
14265
14265
|
"load"
|
|
14266
14266
|
]);
|
|
14267
14267
|
let He = we;
|
|
14268
|
-
const
|
|
14268
|
+
const H = class H {
|
|
14269
14269
|
/**
|
|
14270
14270
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
14271
14271
|
*
|
|
@@ -14278,44 +14278,55 @@ const W = class W {
|
|
|
14278
14278
|
const t = e.ownerDocument?.defaultView?.HTMLElement;
|
|
14279
14279
|
return typeof t < "u" && e instanceof t;
|
|
14280
14280
|
}
|
|
14281
|
+
/**
|
|
14282
|
+
* 部分木の中の `data-intersect-*` を監視へ同期します。
|
|
14283
|
+
*
|
|
14284
|
+
* 自身と配下のすべての要素について `syncElement()` を呼びます。
|
|
14285
|
+
*
|
|
14286
|
+
* @param root 走査の起点
|
|
14287
|
+
* @returns 戻り値はありません。
|
|
14288
|
+
*/
|
|
14281
14289
|
static syncTree(e) {
|
|
14282
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
14283
|
-
|
|
14290
|
+
(e instanceof Element || e instanceof DocumentFragment) && (H.isHtmlElement(e) && H.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
14291
|
+
H.syncElement(t);
|
|
14284
14292
|
}));
|
|
14285
14293
|
}
|
|
14294
|
+
/**
|
|
14295
|
+
* 要素の監視を、現在の `data-intersect-*` の内容へ合わせます。
|
|
14296
|
+
*
|
|
14297
|
+
* 手続きの属性が無くなっていれば監視を解除し、設定(`root` / `rootMargin` /
|
|
14298
|
+
* `threshold` / `once`)が変わっていれば監視を作り直します。設定が変わらない
|
|
14299
|
+
* 場合は監視を保ったまま、抑止が解けていれば覚えている交差を拾い直します
|
|
14300
|
+
* (仕様「抑止の間に来た交差」)。
|
|
14301
|
+
*
|
|
14302
|
+
* @param element 対象の要素
|
|
14303
|
+
* @returns 戻り値はありません。
|
|
14304
|
+
*/
|
|
14286
14305
|
static syncElement(e) {
|
|
14287
|
-
const t =
|
|
14288
|
-
if (!r || !
|
|
14289
|
-
t && (t.observer.disconnect(),
|
|
14306
|
+
const t = H.registrations.get(e), r = I.get(e);
|
|
14307
|
+
if (!r || !H.shouldObserve(r)) {
|
|
14308
|
+
t && (t.observer.disconnect(), H.registrations.delete(e));
|
|
14290
14309
|
return;
|
|
14291
14310
|
}
|
|
14292
14311
|
if (typeof IntersectionObserver > "u")
|
|
14293
14312
|
return;
|
|
14294
|
-
const i =
|
|
14295
|
-
if (t && t.
|
|
14296
|
-
t.
|
|
14297
|
-
s
|
|
14298
|
-
) && t.once === a) {
|
|
14299
|
-
t.fragment = r;
|
|
14313
|
+
const i = H.resolveRoot(r), n = H.resolveRootMargin(r), s = H.resolveThreshold(r), a = r.hasAttribute(`${l.prefix}intersect-once`);
|
|
14314
|
+
if (t && t.root === i && t.rootMargin === n && t.threshold === s && t.once === a) {
|
|
14315
|
+
t.fragment = r, H.runPendingIntersect(e, t);
|
|
14300
14316
|
return;
|
|
14301
14317
|
}
|
|
14302
|
-
t && (t.observer.disconnect(),
|
|
14318
|
+
t && (t.observer.disconnect(), H.registrations.delete(e));
|
|
14303
14319
|
const o = new IntersectionObserver(
|
|
14304
14320
|
(c) => {
|
|
14305
|
-
const u =
|
|
14321
|
+
const u = H.registrations.get(e);
|
|
14306
14322
|
u && c.forEach((d) => {
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
);
|
|
14315
|
-
}).finally(() => {
|
|
14316
|
-
const p = W.registrations.get(e);
|
|
14317
|
-
p && (p.running = !1);
|
|
14318
|
-
}));
|
|
14323
|
+
if (u.intersecting = d.isIntersecting, !!d.isIntersecting) {
|
|
14324
|
+
if (u.running || H.isDisabled(u.fragment)) {
|
|
14325
|
+
u.pending = !0;
|
|
14326
|
+
return;
|
|
14327
|
+
}
|
|
14328
|
+
H.runProcedure(e, u);
|
|
14329
|
+
}
|
|
14319
14330
|
});
|
|
14320
14331
|
},
|
|
14321
14332
|
{
|
|
@@ -14324,34 +14335,96 @@ const W = class W {
|
|
|
14324
14335
|
threshold: s
|
|
14325
14336
|
}
|
|
14326
14337
|
);
|
|
14327
|
-
o.observe(e),
|
|
14338
|
+
o.observe(e), H.registrations.set(e, {
|
|
14328
14339
|
fragment: r,
|
|
14329
14340
|
observer: o,
|
|
14330
14341
|
once: a,
|
|
14331
|
-
|
|
14342
|
+
// 実行中かどうかは引き継ぐ。引き継がないと、作り直した監視が配る現在の
|
|
14343
|
+
// 交差状態で、前の手続きが終わらないうちに次が始まる(仕様「抑止の間に
|
|
14344
|
+
// 来た交差」の「同じ要素の Procedure は多重に実行しません」)。覚えている
|
|
14345
|
+
// 交差は、作り直した監視が改めて通知するため引き継がない。
|
|
14346
|
+
running: t?.running ?? !1,
|
|
14347
|
+
intersecting: !1,
|
|
14348
|
+
pending: !1,
|
|
14349
|
+
root: i,
|
|
14350
|
+
rootMargin: n,
|
|
14351
|
+
threshold: s
|
|
14352
|
+
});
|
|
14353
|
+
}
|
|
14354
|
+
/**
|
|
14355
|
+
* 交差時の Procedure を開始します。
|
|
14356
|
+
*
|
|
14357
|
+
* 覚えていた交差はここで消費します。実行の完了時に、その間へ届いた交差が
|
|
14358
|
+
* 残っていれば拾い直します(仕様「抑止の間に来た交差」)。
|
|
14359
|
+
*
|
|
14360
|
+
* @param element 監視対象の要素
|
|
14361
|
+
* @param registration 対象の登録情報
|
|
14362
|
+
* @returns 戻り値はありません。
|
|
14363
|
+
*/
|
|
14364
|
+
static runProcedure(e, t) {
|
|
14365
|
+
t.pending = !1, t.running = !0;
|
|
14366
|
+
let r = !1;
|
|
14367
|
+
new ae(t.fragment, "intersect").runWithResult().then((i) => {
|
|
14368
|
+
r = i;
|
|
14369
|
+
}).catch((i) => {
|
|
14370
|
+
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
14371
|
+
}).finally(() => {
|
|
14372
|
+
const i = H.registrations.get(e);
|
|
14373
|
+
if (i) {
|
|
14374
|
+
if (i.running = !1, r && i.once) {
|
|
14375
|
+
i.observer.disconnect(), H.registrations.delete(e);
|
|
14376
|
+
return;
|
|
14377
|
+
}
|
|
14378
|
+
H.runPendingIntersect(e, i);
|
|
14379
|
+
}
|
|
14332
14380
|
});
|
|
14333
14381
|
}
|
|
14382
|
+
/**
|
|
14383
|
+
* 覚えている交差があり、対象がまだ交差していれば Procedure を開始します。
|
|
14384
|
+
*
|
|
14385
|
+
* 抑止(実行中・`data-intersect-disabled`)が解けた時点で呼び出します。
|
|
14386
|
+
*
|
|
14387
|
+
* @param element 監視対象の要素
|
|
14388
|
+
* @param registration 対象の登録情報
|
|
14389
|
+
* @returns 戻り値はありません。
|
|
14390
|
+
*/
|
|
14391
|
+
static runPendingIntersect(e, t) {
|
|
14392
|
+
!t.pending || !t.intersecting || t.running || H.isDisabled(t.fragment) || H.runProcedure(e, t);
|
|
14393
|
+
}
|
|
14394
|
+
/**
|
|
14395
|
+
* 部分木の中の監視をすべて解除します。
|
|
14396
|
+
*
|
|
14397
|
+
* DOM から取り除かれたノードに対して呼び、監視を残さないようにします。
|
|
14398
|
+
*
|
|
14399
|
+
* @param root 走査の起点
|
|
14400
|
+
* @returns 戻り値はありません。
|
|
14401
|
+
*/
|
|
14334
14402
|
static cleanupTree(e) {
|
|
14335
|
-
if (
|
|
14336
|
-
const t =
|
|
14337
|
-
t && (t.observer.disconnect(),
|
|
14403
|
+
if (H.isHtmlElement(e)) {
|
|
14404
|
+
const t = H.registrations.get(e);
|
|
14405
|
+
t && (t.observer.disconnect(), H.registrations.delete(e));
|
|
14338
14406
|
}
|
|
14339
14407
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
14340
|
-
const r =
|
|
14341
|
-
r && (r.observer.disconnect(),
|
|
14408
|
+
const r = H.registrations.get(t);
|
|
14409
|
+
r && (r.observer.disconnect(), H.registrations.delete(t));
|
|
14342
14410
|
});
|
|
14343
14411
|
}
|
|
14412
|
+
/**
|
|
14413
|
+
* 登録されているすべての監視を解除します。
|
|
14414
|
+
*
|
|
14415
|
+
* @returns 戻り値はありません。
|
|
14416
|
+
*/
|
|
14344
14417
|
static disconnectAll() {
|
|
14345
|
-
|
|
14418
|
+
H.registrations.forEach((e) => {
|
|
14346
14419
|
e.observer.disconnect();
|
|
14347
|
-
}),
|
|
14420
|
+
}), H.registrations.clear();
|
|
14348
14421
|
}
|
|
14349
14422
|
static shouldObserve(e) {
|
|
14350
14423
|
return e.getAttributeNames().some((t) => {
|
|
14351
14424
|
if (!t.startsWith(`${l.prefix}intersect-`))
|
|
14352
14425
|
return !1;
|
|
14353
14426
|
const r = t.slice(`${l.prefix}intersect-`.length);
|
|
14354
|
-
return !
|
|
14427
|
+
return !H.CONFIG_KEYS.has(r);
|
|
14355
14428
|
});
|
|
14356
14429
|
}
|
|
14357
14430
|
static resolveRoot(e) {
|
|
@@ -14362,7 +14435,7 @@ const W = class W {
|
|
|
14362
14435
|
if (typeof r != "string" || r.trim() === "")
|
|
14363
14436
|
return null;
|
|
14364
14437
|
const i = X.query(r, t, document);
|
|
14365
|
-
return
|
|
14438
|
+
return H.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
14366
14439
|
}
|
|
14367
14440
|
static resolveRootMargin(e) {
|
|
14368
14441
|
const t = `${l.prefix}intersect-root-margin`, r = e.getAttribute(t);
|
|
@@ -14381,18 +14454,15 @@ const W = class W {
|
|
|
14381
14454
|
const i = String(r).trim().toLowerCase();
|
|
14382
14455
|
return i !== "" && i !== "false" && i !== "0";
|
|
14383
14456
|
}
|
|
14384
|
-
static sameThreshold(e, t) {
|
|
14385
|
-
return e.length === 1 && e[0] === t;
|
|
14386
|
-
}
|
|
14387
14457
|
};
|
|
14388
|
-
|
|
14458
|
+
H.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
14389
14459
|
"root",
|
|
14390
14460
|
"root-margin",
|
|
14391
14461
|
"threshold",
|
|
14392
14462
|
"disabled",
|
|
14393
14463
|
"once"
|
|
14394
|
-
]),
|
|
14395
|
-
let Ae =
|
|
14464
|
+
]), H.registrations = /* @__PURE__ */ new Map();
|
|
14465
|
+
let Ae = H;
|
|
14396
14466
|
const v = class v {
|
|
14397
14467
|
/**
|
|
14398
14468
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -14733,7 +14803,7 @@ const v = class v {
|
|
|
14733
14803
|
...i.getRawBindingData() ?? {},
|
|
14734
14804
|
_poll: r
|
|
14735
14805
|
};
|
|
14736
|
-
return
|
|
14806
|
+
return C.setBindingData(n, s, {
|
|
14737
14807
|
reflectToAttribute: !1,
|
|
14738
14808
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
14739
14809
|
// 解除しない)。
|
|
@@ -14920,7 +14990,7 @@ v.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
14920
14990
|
"state"
|
|
14921
14991
|
]), v.DEFAULT_INTERVAL_MS = 5e3, v.MIN_INTERVAL_MS = 100, v.registrations = /* @__PURE__ */ new Map(), v.visibilityListener = null;
|
|
14922
14992
|
let ve = v;
|
|
14923
|
-
const qt = "0.
|
|
14993
|
+
const qt = "0.53.0";
|
|
14924
14994
|
function Wt(b) {
|
|
14925
14995
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => b()) : Promise.resolve().then(b);
|
|
14926
14996
|
}
|
|
@@ -15170,7 +15240,7 @@ const O = class O {
|
|
|
15170
15240
|
};
|
|
15171
15241
|
n[e.varName] = { ...t };
|
|
15172
15242
|
const s = e.fragment.getTarget(), a = i === s ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
15173
|
-
|
|
15243
|
+
C.setBindingData(i, n, {
|
|
15174
15244
|
skipFragments: a,
|
|
15175
15245
|
reflectToAttribute: !1,
|
|
15176
15246
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -15224,8 +15294,8 @@ const U = class U {
|
|
|
15224
15294
|
U._dispatcher = e, e.startDeferred(), U._initialIntakes = [];
|
|
15225
15295
|
try {
|
|
15226
15296
|
const t = await Promise.allSettled([
|
|
15227
|
-
|
|
15228
|
-
|
|
15297
|
+
C.scan(document.head),
|
|
15298
|
+
C.scan(document.body)
|
|
15229
15299
|
]), [r, i] = t;
|
|
15230
15300
|
r.status !== "fulfilled" && m.error(
|
|
15231
15301
|
"[Haori]",
|
|
@@ -15459,9 +15529,9 @@ const U = class U {
|
|
|
15459
15529
|
r.attributeName === "style" && w.reassertHiddenDisplay(i);
|
|
15460
15530
|
break;
|
|
15461
15531
|
}
|
|
15462
|
-
if (r.attributeName &&
|
|
15532
|
+
if (r.attributeName && C.isAliasedAttributeReflection(i, r.attributeName))
|
|
15463
15533
|
break;
|
|
15464
|
-
const n =
|
|
15534
|
+
const n = C.setAttribute(
|
|
15465
15535
|
i,
|
|
15466
15536
|
r.attributeName,
|
|
15467
15537
|
i.getAttribute(r.attributeName),
|
|
@@ -15473,17 +15543,17 @@ const U = class U {
|
|
|
15473
15543
|
}
|
|
15474
15544
|
case "childList": {
|
|
15475
15545
|
Array.from(r.removedNodes).forEach((i) => {
|
|
15476
|
-
U.isStaleExternalRemoval(r, i) || (Ae.cleanupTree(i), ve.cleanupTree(i), me.cleanupTree(i),
|
|
15546
|
+
U.isStaleExternalRemoval(r, i) || (Ae.cleanupTree(i), ve.cleanupTree(i), me.cleanupTree(i), C.removeNode(i));
|
|
15477
15547
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
15478
15548
|
if (!(i.parentElement instanceof Element))
|
|
15479
15549
|
return;
|
|
15480
|
-
const n =
|
|
15550
|
+
const n = C.addNode(i.parentElement, i);
|
|
15481
15551
|
U._initialIntakes?.push(n), Ae.syncTree(i), ve.syncTree(i), me.syncTree(i);
|
|
15482
15552
|
}), r.target instanceof Element && me.syncElement(r.target);
|
|
15483
15553
|
break;
|
|
15484
15554
|
}
|
|
15485
15555
|
case "characterData": {
|
|
15486
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
15556
|
+
r.target instanceof Text || r.target instanceof Comment ? C.changeText(r.target, r.target.textContent) : m.warn(
|
|
15487
15557
|
"[Haori]",
|
|
15488
15558
|
"Unsupported character data type:",
|
|
15489
15559
|
r.target
|
|
@@ -15505,7 +15575,7 @@ te.setMutationCapture((b) => xe.captureMutations(b));
|
|
|
15505
15575
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", xe.init) : xe.init();
|
|
15506
15576
|
const jt = () => Re.waitForRenders(), Kt = Re.enhancers;
|
|
15507
15577
|
export {
|
|
15508
|
-
|
|
15578
|
+
C as Core,
|
|
15509
15579
|
te as Enhance,
|
|
15510
15580
|
l as Env,
|
|
15511
15581
|
x as Form,
|