haori 0.58.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +3 -3
- package/dist/haori.es.js +44 -32
- package/dist/haori.iife.js +3 -3
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -10370,11 +10370,13 @@ ${W}
|
|
|
10370
10370
|
* 表示先は失敗した応答の振り分けと同じ(フォーム、無ければ対象要素、
|
|
10371
10371
|
* それも無ければ `document.body`)です。
|
|
10372
10372
|
*
|
|
10373
|
+
* @param display 表示するか。`-error-no-message` で止めた場合は false で、
|
|
10374
|
+
* 前回の表示を消すだけにする
|
|
10373
10375
|
* @returns 表示の完了 Promise
|
|
10374
10376
|
*/
|
|
10375
|
-
async showDownloadFailure() {
|
|
10376
|
-
const
|
|
10377
|
-
await
|
|
10377
|
+
async showDownloadFailure(e) {
|
|
10378
|
+
const t = this.options.formFragment ?? (this.options.targetFragment ? k.getFormFragment(this.options.targetFragment) || this.options.targetFragment : null), r = t ? t.getTarget() : document.body, i = fe();
|
|
10379
|
+
await i.clearMessages(r), e && await i.addErrorMessage(r, Je);
|
|
10378
10380
|
}
|
|
10379
10381
|
/**
|
|
10380
10382
|
* 保存するファイル名を決めます。
|
|
@@ -10498,12 +10500,14 @@ ${W}
|
|
|
10498
10500
|
const A = await this.saveResponseAsFile(e, t);
|
|
10499
10501
|
if (A === "cancelled")
|
|
10500
10502
|
return await this.injectFetchState("success", e.status, null), !1;
|
|
10501
|
-
if (A === "failed")
|
|
10502
|
-
|
|
10503
|
+
if (A === "failed") {
|
|
10504
|
+
const E = this.selectErrorActions(null);
|
|
10505
|
+
return await this.showDownloadFailure(E?.noMessage !== !0), await this.injectFetchState(
|
|
10503
10506
|
"error",
|
|
10504
10507
|
e.status,
|
|
10505
10508
|
Je
|
|
10506
|
-
), !1;
|
|
10509
|
+
), await this.runErrorActions(null), !1;
|
|
10510
|
+
}
|
|
10507
10511
|
}
|
|
10508
10512
|
const n = [];
|
|
10509
10513
|
n.push(this.bindResult(e)), n.push(this.adjust()), n.push(this.addRow()), n.push(this.removeRow()), n.push(this.movePrevRow()), n.push(this.moveNextRow()), await Promise.all(n), await this.injectFetchState("success", e.status, null), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
|
|
@@ -11060,7 +11064,7 @@ ${W}
|
|
|
11060
11064
|
n.push(
|
|
11061
11065
|
$.setBindingData(
|
|
11062
11066
|
o.getTarget(),
|
|
11063
|
-
this.reconcileUserEditsForBind(o, u),
|
|
11067
|
+
this.reconcileUserEditsForBind(o, u, [d]),
|
|
11064
11068
|
{
|
|
11065
11069
|
// マネージド fetch の bind かつ、bind 先が実行中のバインドワークを
|
|
11066
11070
|
// 持つ(= 自分自身を await している)ときだけ reentrant(即時実行)に
|
|
@@ -11118,7 +11122,11 @@ ${W}
|
|
|
11118
11122
|
n.push(
|
|
11119
11123
|
$.setBindingData(
|
|
11120
11124
|
o.getTarget(),
|
|
11121
|
-
this.reconcileUserEditsForBind(
|
|
11125
|
+
this.reconcileUserEditsForBind(
|
|
11126
|
+
o,
|
|
11127
|
+
d,
|
|
11128
|
+
Object.keys(u)
|
|
11129
|
+
),
|
|
11122
11130
|
{
|
|
11123
11131
|
// いずれも上の bindArg 分岐と同じ扱い。
|
|
11124
11132
|
reentrant: this.reentrantBind && o.isExecutingBindingWork(),
|
|
@@ -11165,31 +11173,34 @@ ${W}
|
|
|
11165
11173
|
*
|
|
11166
11174
|
* @param fragment バインド先のフラグメント
|
|
11167
11175
|
* @param data バインドする応答データ
|
|
11176
|
+
* @param responseKeys 応答が持つキー。`-bind-merge` で既存データへ混ぜる前の
|
|
11177
|
+
* キーで、`-bind-arg` では指定したキーだけ
|
|
11168
11178
|
* @return ユーザー編集分を上書きしたデータ
|
|
11169
11179
|
*/
|
|
11170
|
-
reconcileUserEditsForBind(e, t) {
|
|
11171
|
-
const
|
|
11172
|
-
if (
|
|
11180
|
+
reconcileUserEditsForBind(e, t, r) {
|
|
11181
|
+
const i = this.requestUserEditSequence;
|
|
11182
|
+
if (i === null)
|
|
11173
11183
|
return t;
|
|
11174
|
-
const
|
|
11175
|
-
if (!
|
|
11184
|
+
const n = this.eventType === "poll";
|
|
11185
|
+
if (!n && !this.twoWayCommitBind && $.clearUserEditMarks(e, i), !(e.getTarget() instanceof HTMLFormElement))
|
|
11176
11186
|
return this.reconcileAncestorArgFormEdits(
|
|
11177
11187
|
e,
|
|
11178
11188
|
t,
|
|
11179
|
-
|
|
11189
|
+
r,
|
|
11190
|
+
n ? 0 : i
|
|
11180
11191
|
);
|
|
11181
|
-
const
|
|
11192
|
+
const s = k.getValuesEditedAfter(
|
|
11182
11193
|
e,
|
|
11183
|
-
|
|
11194
|
+
n ? 0 : i
|
|
11184
11195
|
);
|
|
11185
|
-
if (Object.keys(
|
|
11196
|
+
if (Object.keys(s).length === 0)
|
|
11186
11197
|
return t;
|
|
11187
|
-
const
|
|
11188
|
-
if (
|
|
11189
|
-
const
|
|
11190
|
-
return { ...t, [
|
|
11198
|
+
const a = e.getAttribute(`${l.prefix}form-arg`);
|
|
11199
|
+
if (a) {
|
|
11200
|
+
const o = String(a), c = t[o], u = c && typeof c == "object" && !Array.isArray(c) ? c : {};
|
|
11201
|
+
return { ...t, [o]: pe(u, s) };
|
|
11191
11202
|
}
|
|
11192
|
-
return pe(t,
|
|
11203
|
+
return pe(t, s);
|
|
11193
11204
|
}
|
|
11194
11205
|
/**
|
|
11195
11206
|
* 編集可能な行へのバインドについて、送信後の編集を要素データへ上書きし直します。
|
|
@@ -11229,21 +11240,22 @@ ${W}
|
|
|
11229
11240
|
*
|
|
11230
11241
|
* @param fragment バインド先のフラグメント
|
|
11231
11242
|
* @param data バインドする応答データ
|
|
11243
|
+
* @param responseKeys 応答が持つキー(既存データへ混ぜる前)
|
|
11232
11244
|
* @param baseline この通し番号より後の編集を保護する
|
|
11233
11245
|
* @return ユーザー編集分を上書きしたデータ
|
|
11234
11246
|
*/
|
|
11235
|
-
reconcileAncestorArgFormEdits(e, t, r) {
|
|
11236
|
-
let
|
|
11237
|
-
for (const { form:
|
|
11238
|
-
if (!
|
|
11247
|
+
reconcileAncestorArgFormEdits(e, t, r, i) {
|
|
11248
|
+
let n = t;
|
|
11249
|
+
for (const { form: s, key: a } of k.collectArgForms(e)) {
|
|
11250
|
+
if (!r.includes(a))
|
|
11239
11251
|
continue;
|
|
11240
|
-
const
|
|
11241
|
-
if (Object.keys(
|
|
11252
|
+
const o = k.getValuesEditedAfter(s, i);
|
|
11253
|
+
if (Object.keys(o).length === 0)
|
|
11242
11254
|
continue;
|
|
11243
|
-
const
|
|
11244
|
-
|
|
11255
|
+
const c = n[a], u = c && typeof c == "object" && !Array.isArray(c) ? c : {};
|
|
11256
|
+
n = { ...n, [a]: pe(u, o) };
|
|
11245
11257
|
}
|
|
11246
|
-
return
|
|
11258
|
+
return n;
|
|
11247
11259
|
}
|
|
11248
11260
|
/**
|
|
11249
11261
|
* bind-append 指定があるキーについて、既存配列と結合したデータを返します。
|
|
@@ -15634,7 +15646,7 @@ v.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
15634
15646
|
"state"
|
|
15635
15647
|
]), v.DEFAULT_INTERVAL_MS = 5e3, v.MIN_INTERVAL_MS = 100, v.registrations = /* @__PURE__ */ new Map(), v.visibilityListener = null;
|
|
15636
15648
|
let Ee = v;
|
|
15637
|
-
const zt = "0.
|
|
15649
|
+
const zt = "0.59.1";
|
|
15638
15650
|
function Gt(b) {
|
|
15639
15651
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => b()) : Promise.resolve().then(b);
|
|
15640
15652
|
}
|