@septkit/ui 0.0.79 → 0.0.81
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/dialecte/create-document-store.js +4 -4
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/dialecte-gIPrRzni.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/dialecte-oAXwOG-Q.js} +69 -69
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/helpers-DVShv41E.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js} +1 -1
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers.js +3 -0
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/project-key-Ch34EtFa.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/project-key-2ccZ-0gu.js} +83 -83
- package/dist/external/.pnpm/{@dialecte_core@0.8.1 → @dialecte_core@0.9.0}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/running-operations-vnijBvn7.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/running-operations-DCKvzlU7.js} +2 -2
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/same-json-value-C6kUaoyt.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/same-json-value-_AChwM_n.js} +47 -47
- package/dist/external/.pnpm/{@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/utils-USNkj4sT.js → @dialecte_core@0.9.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js} +64 -138
- package/dist/external/.pnpm/{@dialecte_core@0.8.1 → @dialecte_core@0.9.0}/node_modules/@dialecte/core/dist/utils.js +1 -1
- package/dist/external/.pnpm/{@dialecte_scl@0.13.2_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/hooks-DpI8_nD9.js → @dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/declaration.constants-DSLNk1wh.js} +7 -7
- package/dist/external/.pnpm/@dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/v2019C1/index.js +3 -0
- package/dist/index.d.ts +25 -4
- package/dist/index.js +13 -13
- package/dist/merge/check-files/identity-warning.js +2 -2
- package/dist/merge/confirm/outcome.js +4 -4
- package/dist/merge/match/match.js +4 -4
- package/dist/merge/session/merge.service.js +2 -2
- package/dist/merge/wording.js +4 -4
- package/dist/selector-input/index.js +3 -0
- package/dist/selector-input/selector-input.js +90 -0
- package/dist/selector-input/selector-input.vue_vue_type_script_setup_true_lang.js +180 -0
- package/dist/selector-input/selector-input2.js +5 -0
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/helpers.js +0 -3
- package/dist/external/.pnpm/@dialecte_core@0.8.1/node_modules/@dialecte/core/dist/index.js +0 -5
- package/dist/external/.pnpm/@dialecte_scl@0.13.2_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
- package/dist/xpath-input/index.js +0 -3
- package/dist/xpath-input/xpath-input.js +0 -28
- package/dist/xpath-input/xpath-input.vue_vue_type_script_setup_true_lang.js +0 -101
- package/dist/xpath-input/xpath-input2.js +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { G as e, V as t, W as n, f as r, j as i, k as a, z as o } from "./utils-
|
|
1
|
+
import { G as e, V as t, W as n, f as r, j as i, k as a, z as o } from "./utils-Cv4oHia0.js";
|
|
2
2
|
import { n as s, t as c } from "./rolldown-runtime-CYdcPHCu.js";
|
|
3
|
-
import {
|
|
4
|
-
import { l as C } from "./helpers-
|
|
5
|
-
//#region node_modules/.pnpm/@dialecte+core@0.
|
|
3
|
+
import { A as l, B as u, K as d, L as f, M as p, P as m, V as h, a as g, c as _, f as v, m as y, o as b, p as x, s as S } from "./project-key-2ccZ-0gu.js";
|
|
4
|
+
import { l as C } from "./helpers-D8p0KiJu.js";
|
|
5
|
+
//#region node_modules/.pnpm/@dialecte+core@0.9.0/node_modules/@dialecte/core/dist/same-json-value-_AChwM_n.js
|
|
6
6
|
function w(e) {
|
|
7
7
|
let { documents: t, writeId: n, isRunning: r } = e, i = t.find((e) => e.writeId === n);
|
|
8
8
|
return i ? i.status === "importing" ? r?.({ writeId: n }) === !1 ? "not-applied" : "running" : "applied" : "not-applied";
|
|
@@ -22,7 +22,7 @@ var E = 1024, D = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u, O = [
|
|
|
22
22
|
], k = ".xml";
|
|
23
23
|
function A(e) {
|
|
24
24
|
let { path: t } = e, n = R({ path: t });
|
|
25
|
-
n !== void 0 &&
|
|
25
|
+
n !== void 0 && u({
|
|
26
26
|
path: t,
|
|
27
27
|
reason: n
|
|
28
28
|
});
|
|
@@ -38,10 +38,10 @@ function j(e) {
|
|
|
38
38
|
}
|
|
39
39
|
function M(e) {
|
|
40
40
|
let { path: t, extensions: n } = e, { fileName: r } = A({ path: t }), i = r.lastIndexOf(".");
|
|
41
|
-
return (i < 1 || i === r.length - 1) &&
|
|
41
|
+
return (i < 1 || i === r.length - 1) && u({
|
|
42
42
|
path: t,
|
|
43
43
|
reason: "its file name has no extension after a name"
|
|
44
|
-
}), n && !n.some((e) => r.toLowerCase().endsWith(e)) &&
|
|
44
|
+
}), n && !n.some((e) => r.toLowerCase().endsWith(e)) && u({
|
|
45
45
|
path: t,
|
|
46
46
|
reason: `its extension is not one the document's config reads (${n.join(", ")})`
|
|
47
47
|
}), {
|
|
@@ -53,10 +53,10 @@ function N(e) {
|
|
|
53
53
|
let { name: t, extension: n, path: r } = e.document;
|
|
54
54
|
if (r === void 0) return;
|
|
55
55
|
let { fileName: i } = A({ path: r });
|
|
56
|
-
(typeof t != "string" || typeof n != "string") &&
|
|
56
|
+
(typeof t != "string" || typeof n != "string") && u({
|
|
57
57
|
path: r,
|
|
58
58
|
reason: "a path names a file of a name and an extension that are strings"
|
|
59
|
-
}), (t === "" || i !== `${t}${n}`) &&
|
|
59
|
+
}), (t === "" || i !== `${t}${n}`) && u({
|
|
60
60
|
path: r,
|
|
61
61
|
reason: `it does not end with the document's file name ${JSON.stringify(`${t}${n}`)}`
|
|
62
62
|
});
|
|
@@ -68,7 +68,7 @@ function P(e) {
|
|
|
68
68
|
};
|
|
69
69
|
if (n.path !== void 0) {
|
|
70
70
|
let { fileName: e } = A({ path: n.path }), { extension: i } = t;
|
|
71
|
-
e.endsWith(i) && e.length !== i.length ||
|
|
71
|
+
e.endsWith(i) && e.length !== i.length || u({
|
|
72
72
|
path: n.path,
|
|
73
73
|
reason: `it does not end with the document's extension ${JSON.stringify(i)}`
|
|
74
74
|
}), r.name = n.name ?? e.slice(0, e.length - i.length);
|
|
@@ -88,7 +88,7 @@ function F(e) {
|
|
|
88
88
|
documents: n,
|
|
89
89
|
documentId: r
|
|
90
90
|
});
|
|
91
|
-
a !== void 0 &&
|
|
91
|
+
a !== void 0 && h({
|
|
92
92
|
documentId: r,
|
|
93
93
|
path: i,
|
|
94
94
|
takenBy: a
|
|
@@ -110,7 +110,7 @@ function R(e) {
|
|
|
110
110
|
if (typeof t != "string") return "it is not a string";
|
|
111
111
|
if (t.includes("\\")) return "it holds a backslash, a folder separator on Windows";
|
|
112
112
|
if (D.test(t)) return "it holds an invisible format, separator or control character (Unicode Cc, Cf, Zl or Zp)";
|
|
113
|
-
if (!t.isWellFormed()) return `it is ${
|
|
113
|
+
if (!t.isWellFormed()) return `it is ${d}`;
|
|
114
114
|
if (t.normalize("NFC") !== t) return "it is not in Unicode NFC";
|
|
115
115
|
let n = t.split("/");
|
|
116
116
|
if (n.some((e) => e === "")) return "it holds an empty folder or file name";
|
|
@@ -138,7 +138,7 @@ function z(e) {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
function B(e) {
|
|
141
|
-
return
|
|
141
|
+
return f({ value: e.records }).map((e) => z({ record: e }));
|
|
142
142
|
}
|
|
143
143
|
function V(e) {
|
|
144
144
|
let { record: t, patch: n } = e, { recordId: r, attributes: i, children: a, removeAttributes: o, ...s } = n, c = { ...t };
|
|
@@ -163,12 +163,12 @@ function H(e) {
|
|
|
163
163
|
}
|
|
164
164
|
function U(e) {
|
|
165
165
|
let { onProgress: t, parts: n } = e, r = n.reduce((e, t) => e + t, 0), i = 0, a = {};
|
|
166
|
-
for (let e of n) i += e,
|
|
166
|
+
for (let e of n) i += e, p({
|
|
167
167
|
listener: function(e) {
|
|
168
168
|
return t?.(e, r);
|
|
169
169
|
},
|
|
170
170
|
value: i,
|
|
171
|
-
of:
|
|
171
|
+
of: l.commitProgress,
|
|
172
172
|
call: a
|
|
173
173
|
});
|
|
174
174
|
}
|
|
@@ -1025,7 +1025,7 @@ var te = {
|
|
|
1025
1025
|
xmlns: !0
|
|
1026
1026
|
};
|
|
1027
1027
|
function ne(e) {
|
|
1028
|
-
let { dialecteConfig: t, useCustomRecordsIds: n, session: r, hooks: i, importSession: a, perf: o =
|
|
1028
|
+
let { dialecteConfig: t, useCustomRecordsIds: n, session: r, hooks: i, importSession: a, perf: o = y } = e, s = {
|
|
1029
1029
|
defaultNamespace: null,
|
|
1030
1030
|
stack: [],
|
|
1031
1031
|
recordsBatch: [],
|
|
@@ -1119,9 +1119,9 @@ function q(e) {
|
|
|
1119
1119
|
t && n.stack.length > 0 && (n.stack[n.stack.length - 1].value += t);
|
|
1120
1120
|
}
|
|
1121
1121
|
function ae(e) {
|
|
1122
|
-
let { record: t } = e, n =
|
|
1122
|
+
let { record: t } = e, n = S({ record: t });
|
|
1123
1123
|
if (!n) return;
|
|
1124
|
-
let r =
|
|
1124
|
+
let r = b({
|
|
1125
1125
|
place: n,
|
|
1126
1126
|
element: `<${t.tagName}>`
|
|
1127
1127
|
});
|
|
@@ -1141,7 +1141,7 @@ function J(e) {
|
|
|
1141
1141
|
});
|
|
1142
1142
|
}
|
|
1143
1143
|
function oe(e) {
|
|
1144
|
-
let { state: t, hooks: n, importSession: r, sessionTags: i, session: a, dialecteConfig: o, perf: s =
|
|
1144
|
+
let { state: t, hooks: n, importSession: r, sessionTags: i, session: a, dialecteConfig: o, perf: s = y } = e, c = t.stack.pop();
|
|
1145
1145
|
if (!c) return;
|
|
1146
1146
|
let l = s.time("import::standardize", () => C({
|
|
1147
1147
|
dialecteConfig: o,
|
|
@@ -1210,7 +1210,7 @@ function fe(e) {
|
|
|
1210
1210
|
function pe(e) {
|
|
1211
1211
|
let { attributes: t, useCustomRecordsIds: n, tagName: r } = e, a = t[i];
|
|
1212
1212
|
if (!n || !a || !a.value) return crypto.randomUUID();
|
|
1213
|
-
let o =
|
|
1213
|
+
let o = _({ text: a.value });
|
|
1214
1214
|
return o && J({
|
|
1215
1215
|
character: o,
|
|
1216
1216
|
where: `The attribute ${i} of <${r}>`
|
|
@@ -1221,7 +1221,7 @@ function me(e) {
|
|
|
1221
1221
|
return n ? Object.values(t).filter((e) => e.name !== i) : Object.values(t);
|
|
1222
1222
|
}
|
|
1223
1223
|
async function Y(e, t = {}) {
|
|
1224
|
-
let { documentId: n, configKey: i, store: a, config: o, useCustomRecordsIds: s = !1, chunkOptions: c, hooks: l, perf: u =
|
|
1224
|
+
let { documentId: n, configKey: i, store: a, config: o, useCustomRecordsIds: s = !1, chunkOptions: c, hooks: l, perf: u = y } = e, { file: d } = e;
|
|
1225
1225
|
if (r(j({ extensions: o.io.supportedFileExtensions }).some((e) => d.name.toLowerCase().endsWith(e)), {
|
|
1226
1226
|
key: "ASSERTION_FAILED",
|
|
1227
1227
|
detail: `Unsupported file type: ${d.name}`
|
|
@@ -1235,28 +1235,28 @@ async function Y(e, t = {}) {
|
|
|
1235
1235
|
let e = f(await d.text());
|
|
1236
1236
|
d = new File([e], d.name, { type: d.type });
|
|
1237
1237
|
}
|
|
1238
|
-
let p = c?.chunkSize ?? 32768,
|
|
1238
|
+
let p = c?.chunkSize ?? 32768, m = c?.batchSize ?? 2e3, h = new G(), g = l?.createImportSession?.({
|
|
1239
1239
|
documentId: n,
|
|
1240
1240
|
configKey: i
|
|
1241
|
-
}),
|
|
1241
|
+
}), _ = ne({
|
|
1242
1242
|
dialecteConfig: o,
|
|
1243
1243
|
useCustomRecordsIds: s,
|
|
1244
|
-
session:
|
|
1244
|
+
session: h,
|
|
1245
1245
|
hooks: l,
|
|
1246
|
-
importSession:
|
|
1246
|
+
importSession: g,
|
|
1247
1247
|
perf: u
|
|
1248
|
-
}),
|
|
1248
|
+
}), v = await he({
|
|
1249
1249
|
file: d,
|
|
1250
|
-
sax:
|
|
1251
|
-
session:
|
|
1250
|
+
sax: _,
|
|
1251
|
+
session: h,
|
|
1252
1252
|
store: a,
|
|
1253
1253
|
documentId: n,
|
|
1254
1254
|
chunkSize: p,
|
|
1255
|
-
batchSize:
|
|
1255
|
+
batchSize: m,
|
|
1256
1256
|
perf: u,
|
|
1257
1257
|
control: t
|
|
1258
1258
|
}), { recordDelta: b, diagnostics: x } = await ge({
|
|
1259
|
-
importSession:
|
|
1259
|
+
importSession: g,
|
|
1260
1260
|
store: a,
|
|
1261
1261
|
documentId: n,
|
|
1262
1262
|
file: d,
|
|
@@ -1265,7 +1265,7 @@ async function Y(e, t = {}) {
|
|
|
1265
1265
|
});
|
|
1266
1266
|
return {
|
|
1267
1267
|
documentId: n,
|
|
1268
|
-
recordCount:
|
|
1268
|
+
recordCount: v + b,
|
|
1269
1269
|
diagnostics: x
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
@@ -1357,7 +1357,7 @@ async function ge(e) {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
function _e(t) {
|
|
1359
1359
|
try {
|
|
1360
|
-
|
|
1360
|
+
m({ value: t.diagnostics });
|
|
1361
1361
|
} catch (t) {
|
|
1362
1362
|
n("STORE_VALUE_NOT_JSON", {
|
|
1363
1363
|
detail: `A diagnostic of the import session: ${e(t)?.detail ?? String(t)}`,
|
|
@@ -1367,8 +1367,8 @@ function _e(t) {
|
|
|
1367
1367
|
}
|
|
1368
1368
|
function ve(e) {
|
|
1369
1369
|
let { creates: t = [], updates: n = [] } = e;
|
|
1370
|
-
for (let e of t)
|
|
1371
|
-
for (let e of n)
|
|
1370
|
+
for (let e of t) g({ record: e });
|
|
1371
|
+
for (let e of n) g({ record: {
|
|
1372
1372
|
...e,
|
|
1373
1373
|
id: e.recordId
|
|
1374
1374
|
} });
|
|
@@ -1385,28 +1385,28 @@ function ye(e, t) {
|
|
|
1385
1385
|
return n.set(e), n.set(t, e.length), n;
|
|
1386
1386
|
}
|
|
1387
1387
|
async function Z(e) {
|
|
1388
|
-
let { sax: t, session: n, store: r, documentId: i, file: a, threshold: o, perf: s, control: c, progress:
|
|
1388
|
+
let { sax: t, session: n, store: r, documentId: i, file: a, threshold: o, perf: s, control: c, progress: u } = e;
|
|
1389
1389
|
if (t.getSize() < o) return 0;
|
|
1390
1390
|
X({
|
|
1391
1391
|
signal: c.signal,
|
|
1392
1392
|
file: a
|
|
1393
1393
|
}), s.start("import::insert");
|
|
1394
|
-
let
|
|
1394
|
+
let d;
|
|
1395
1395
|
try {
|
|
1396
1396
|
let e = n.resolveChildrenForBatch(t.drainBatch());
|
|
1397
|
-
await r.bulkWrite(i, { creates: e }),
|
|
1397
|
+
await r.bulkWrite(i, { creates: e }), d = e.length;
|
|
1398
1398
|
} finally {
|
|
1399
1399
|
s.stop("import::insert");
|
|
1400
1400
|
}
|
|
1401
|
-
return
|
|
1401
|
+
return p({
|
|
1402
1402
|
listener: c.onProgress,
|
|
1403
|
-
value:
|
|
1404
|
-
of:
|
|
1403
|
+
value: u,
|
|
1404
|
+
of: l.importProgress,
|
|
1405
1405
|
call: c
|
|
1406
|
-
}),
|
|
1406
|
+
}), d;
|
|
1407
1407
|
}
|
|
1408
1408
|
async function be(n, r = {}) {
|
|
1409
|
-
let { runtime: i, file: a, options: o, writeId: s } = n, c = n.perf ??
|
|
1409
|
+
let { runtime: i, file: a, options: o, writeId: s } = n, c = n.perf ?? x({
|
|
1410
1410
|
enabled: i.perf ?? !1,
|
|
1411
1411
|
timeline: !1
|
|
1412
1412
|
});
|
|
@@ -1414,13 +1414,13 @@ async function be(n, r = {}) {
|
|
|
1414
1414
|
signal: r.signal,
|
|
1415
1415
|
file: a
|
|
1416
1416
|
});
|
|
1417
|
-
let { configKey: l, config: u } =
|
|
1417
|
+
let { configKey: l, config: u } = v({
|
|
1418
1418
|
configs: i.configs,
|
|
1419
1419
|
defaultConfigKey: i.defaultConfigKey,
|
|
1420
1420
|
configKey: o?.configKey
|
|
1421
1421
|
}), d = {
|
|
1422
1422
|
id: crypto.randomUUID(),
|
|
1423
|
-
...
|
|
1423
|
+
...Q({
|
|
1424
1424
|
file: a,
|
|
1425
1425
|
path: o?.path,
|
|
1426
1426
|
config: u
|
|
@@ -1435,7 +1435,7 @@ async function be(n, r = {}) {
|
|
|
1435
1435
|
c.start("import");
|
|
1436
1436
|
let f;
|
|
1437
1437
|
try {
|
|
1438
|
-
f = await
|
|
1438
|
+
f = await xe({
|
|
1439
1439
|
...n,
|
|
1440
1440
|
control: r,
|
|
1441
1441
|
registered: d,
|
|
@@ -1455,7 +1455,7 @@ async function be(n, r = {}) {
|
|
|
1455
1455
|
...i.perf && { perf: c.snapshot() }
|
|
1456
1456
|
};
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function Q(e) {
|
|
1459
1459
|
let { file: t, path: n, config: r } = e, i = j({ extensions: r.io.supportedFileExtensions });
|
|
1460
1460
|
return n === void 0 ? {
|
|
1461
1461
|
name: t.name.replace(/\.[^.]+$/, "") || "untitled",
|
|
@@ -1465,7 +1465,7 @@ function xe(e) {
|
|
|
1465
1465
|
extensions: i
|
|
1466
1466
|
});
|
|
1467
1467
|
}
|
|
1468
|
-
async function
|
|
1468
|
+
async function xe(e) {
|
|
1469
1469
|
let { store: t, runtime: r, file: i, options: a, control: o, registered: s, config: c, perf: l } = e;
|
|
1470
1470
|
l.start("import::register");
|
|
1471
1471
|
try {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/@dialecte+core@0.
|
|
2
|
-
var e = "https://dialecte.github.io/core", t =
|
|
1
|
+
//#region node_modules/.pnpm/@dialecte+core@0.9.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js
|
|
2
|
+
var e = "https://dialecte.github.io/core", t = /* @__PURE__ */ new Set([
|
|
3
|
+
"throwDialecteError",
|
|
4
|
+
"createDialecteError",
|
|
5
|
+
"invariant",
|
|
6
|
+
"reportFailure"
|
|
7
|
+
]), n = {
|
|
3
8
|
UNKNOWN: {
|
|
4
9
|
code: "D0001",
|
|
5
10
|
message: "An unknown error occurred",
|
|
@@ -13,7 +18,7 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
13
18
|
code: "D0002",
|
|
14
19
|
message: "Assertion failed",
|
|
15
20
|
explanation: {
|
|
16
|
-
when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export,
|
|
21
|
+
when: "An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, a store running on a dependency older than the one it supports).",
|
|
17
22
|
fix: "Read `detail`: it names the condition. Give `invariant` a key of its own when the failure is one a caller should handle.",
|
|
18
23
|
docs: `${e}/guide/development/state-and-errors#error-catalog`
|
|
19
24
|
}
|
|
@@ -22,8 +27,8 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
22
27
|
code: "D1001",
|
|
23
28
|
message: "Failed to open database",
|
|
24
29
|
explanation: {
|
|
25
|
-
when: "The
|
|
26
|
-
fix: "Check the browser supports the store
|
|
30
|
+
when: "The store could not open the project's data, or could not reach what serves it (its database, a worker, a server): it failed to start, was blocked, or went unanswered; the failure is the `cause` when there is one.",
|
|
31
|
+
fix: "Check the browser supports what the store needs and that no other tab holds the project; reload, or open the project with another storage. The store's own docs name what it needs.",
|
|
27
32
|
docs: `${e}/api/project#store-errors`
|
|
28
33
|
}
|
|
29
34
|
},
|
|
@@ -112,38 +117,11 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
112
117
|
code: "D1011",
|
|
113
118
|
message: "Failed to read from database",
|
|
114
119
|
explanation: {
|
|
115
|
-
when: "The
|
|
120
|
+
when: "The store's database failed under a read; the failure is the `cause`.",
|
|
116
121
|
fix: "Read `cause`; reopen the project. A lasting failure means the file is damaged: import its documents again.",
|
|
117
122
|
docs: `${e}/api/project#store-errors`
|
|
118
123
|
}
|
|
119
124
|
},
|
|
120
|
-
STORE_PROTOCOL_MISMATCH: {
|
|
121
|
-
code: "D1012",
|
|
122
|
-
message: "Another version of the library holds the shared store connection",
|
|
123
|
-
explanation: {
|
|
124
|
-
when: "Another version of the library already holds the shared store connection (another tab runs an older or newer build).",
|
|
125
|
-
fix: "Close the other tabs of the app, or reload them all on the same version.",
|
|
126
|
-
docs: `${e}/api/project#store-errors`
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
STORE_REALM_ID_TAKEN: {
|
|
130
|
-
code: "D1013",
|
|
131
|
-
message: "A view with this id is already connected to the shared store",
|
|
132
|
-
explanation: {
|
|
133
|
-
when: "A view joined the shared store with an id another connected view already uses.",
|
|
134
|
-
fix: "Give each view its own id; reload the page that reused one.",
|
|
135
|
-
docs: `${e}/api/project#store-errors`
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
STORE_REALM_UNKNOWN: {
|
|
139
|
-
code: "D1014",
|
|
140
|
-
message: "The shared store does not know this view",
|
|
141
|
-
explanation: {
|
|
142
|
-
when: "A view spoke to the shared store without having joined it, or after it left.",
|
|
143
|
-
fix: "Join (open the project) before reading or writing; reload a view that was disconnected.",
|
|
144
|
-
docs: `${e}/api/project#store-errors`
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
125
|
STORE_VALUE_NOT_JSON: {
|
|
148
126
|
code: "D1015",
|
|
149
127
|
message: "A value handed to the store is not JSON",
|
|
@@ -157,8 +135,8 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
157
135
|
code: "D1016",
|
|
158
136
|
message: "This browser gives the page no storage for a project",
|
|
159
137
|
explanation: {
|
|
160
|
-
when: "The browser gives the page
|
|
161
|
-
fix: "Open the app in a normal (not private) window of a browser that supports the
|
|
138
|
+
when: "The browser gives the page none of the storage the store needs (a private window, an API the browser lacks), so it cannot create, open or destroy the project; nothing is changed.",
|
|
139
|
+
fix: "Open the app in a normal (not private) window of a browser that supports what the project's store needs, or open the project with another storage.",
|
|
162
140
|
docs: `${e}/api/project#store-errors`
|
|
163
141
|
}
|
|
164
142
|
},
|
|
@@ -166,27 +144,27 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
166
144
|
code: "D1017",
|
|
167
145
|
message: "Not enough storage left for the project",
|
|
168
146
|
explanation: {
|
|
169
|
-
when: "The origin has too little storage left
|
|
147
|
+
when: "The origin has too little storage left for what the call needs (a new project's files, an import's room ahead of it), or the store's storage refused a write for want of space; nothing of the call applied. A store that checks the room it needs answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`); the in-memory store has no limit.",
|
|
170
148
|
fix: "Free storage for the origin (delete projects no longer needed) or import a smaller file, then try again; `meta.needed` and `meta.available` give the sizes when known.",
|
|
171
149
|
docs: `${e}/api/project#store-errors`
|
|
172
150
|
}
|
|
173
151
|
},
|
|
174
|
-
|
|
152
|
+
STORE_CONNECTION_LOST: {
|
|
175
153
|
code: "D1018",
|
|
176
|
-
message: "The
|
|
154
|
+
message: "The store lost its connection",
|
|
177
155
|
explanation: {
|
|
178
|
-
when: "A call to a project
|
|
179
|
-
fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (
|
|
180
|
-
docs: `${e}/api/project#
|
|
156
|
+
when: "A call to a store whose project is served elsewhere (a worker, another realm, a server) lost its connection to what serves it: that went away or gave no answer within its budget, sent nothing for too long while the call waited (the call may still finish), or dropped this view. `meta.reason` is the store's own word for why, listed in its docs; a write's refusal carries `meta.writeId`.",
|
|
157
|
+
fix: "A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (what serves the store may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. The store's docs say what each `meta.reason` asks of the app.",
|
|
158
|
+
docs: `${e}/api/project#a-lost-connection`
|
|
181
159
|
}
|
|
182
160
|
},
|
|
183
|
-
|
|
184
|
-
code: "
|
|
185
|
-
message: "
|
|
161
|
+
STORE_KIND_TAKEN: {
|
|
162
|
+
code: "D1021",
|
|
163
|
+
message: "This storage type is registered already by another kind",
|
|
186
164
|
explanation: {
|
|
187
|
-
when: "`
|
|
188
|
-
fix: "
|
|
189
|
-
docs: `${e}/
|
|
165
|
+
when: "`registerStorageKind({ type, kind })` named a type a kind of another `id` holds already: the first registration in the realm is kept, nothing replaced (the same `id` again does nothing: a module evaluated twice, or another copy of the package). `meta`: `type`, `registered` (the id kept), `asked` (the id refused).",
|
|
166
|
+
fix: "Register each storage type once, from one package: import the entry that registers it from a single copy, or give the other kind a type of its own.",
|
|
167
|
+
docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
|
|
190
168
|
}
|
|
191
169
|
},
|
|
192
170
|
ELEMENT_NOT_FOUND: {
|
|
@@ -477,47 +455,20 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
477
455
|
docs: `${e}/api/project#blobs`
|
|
478
456
|
}
|
|
479
457
|
},
|
|
480
|
-
PROJECT_LAYOUT_OUTDATED: {
|
|
481
|
-
code: "D7005",
|
|
482
|
-
message: "Project stored by another version of the library",
|
|
483
|
-
explanation: {
|
|
484
|
-
when: "The project file was stored by another version of the library (another layout); nothing was written to it.",
|
|
485
|
-
fix: "Delete the project and import its files again with this version.",
|
|
486
|
-
docs: `${e}/api/project#store-errors`
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
PROJECT_ENGINE_UNAVAILABLE: {
|
|
490
|
-
code: "D7006",
|
|
491
|
-
message: "No view can start the project engine",
|
|
492
|
-
explanation: {
|
|
493
|
-
when: "The project's engine could not be started or reached: its worker failed to load or never answered its open within the open budget; through the origin's hub, no open view offers an engine for the project's dialecte, or the engine never said it opened; a destroy still running past the open budget, or one asked by a page suspended before the hub granted it.",
|
|
494
|
-
fix: "Keep one tab of the app open and reload; check the dialecte's `engineUrl` points at its worker and that it loads (the console names a script that fails); a destroy refused so is asked again once the project is closed elsewhere.",
|
|
495
|
-
docs: `${e}/api/project#store-errors`
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
PROJECT_ENGINE_BUSY: {
|
|
499
|
-
code: "D7007",
|
|
500
|
-
message: "The project is still held by another engine",
|
|
501
|
-
explanation: {
|
|
502
|
-
when: "Another engine still holds the project (another tab or a worker that did not stop).",
|
|
503
|
-
fix: "Close the other tabs of the app, then open the project again.",
|
|
504
|
-
docs: `${e}/api/project#store-errors`
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
458
|
PROJECT_DIALECTE_MISMATCH: {
|
|
508
459
|
code: "D7008",
|
|
509
|
-
message: "The project's
|
|
460
|
+
message: "The project's data is of another dialecte",
|
|
510
461
|
explanation: {
|
|
511
|
-
when: "A project
|
|
512
|
-
fix: "Open the project with the dialecte it was created with;
|
|
462
|
+
when: "A project stored by another dialecte was opened (nothing of it written), or what serves the store (a worker, a server) was asked for a project of a dialecte it does not serve. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `realmDialecteId` (the one asked), and `projectDialecteId` (the project's), or the dialectes served, as the store's docs name them.",
|
|
463
|
+
fix: "Open the project with the dialecte it was created with; serve every dialecte the app opens projects of, as the store's docs say.",
|
|
513
464
|
docs: `${e}/api/project#store-errors`
|
|
514
465
|
}
|
|
515
466
|
},
|
|
516
467
|
PROJECT_DIALECTE_VERSION_MISMATCH: {
|
|
517
468
|
code: "D7009",
|
|
518
|
-
message: "The project
|
|
469
|
+
message: "The project's store runs another version of the dialecte",
|
|
519
470
|
explanation: {
|
|
520
|
-
when: "
|
|
471
|
+
when: "What serves the project's store (a worker, a server) runs another version of the dialecte than this view: another tab's, or one this page runs already for the project (a page runs one version of each dialecte).",
|
|
521
472
|
fix: "Reload every tab of the app so they run the same version.",
|
|
522
473
|
docs: `${e}/api/project#store-errors`
|
|
523
474
|
}
|
|
@@ -526,7 +477,7 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
526
477
|
code: "D7010",
|
|
527
478
|
message: "The project could not be deleted",
|
|
528
479
|
explanation: {
|
|
529
|
-
when: "Destroying a project left its
|
|
480
|
+
when: "Destroying a project left its data in place: another tab, window or connection still holds it.",
|
|
530
481
|
fix: "Close the other tabs or windows of the app that have the project open, then destroy it again.",
|
|
531
482
|
docs: `${e}/api/project#lifecycle`
|
|
532
483
|
}
|
|
@@ -540,20 +491,11 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
540
491
|
docs: `${e}/api/project#lifecycle`
|
|
541
492
|
}
|
|
542
493
|
},
|
|
543
|
-
PROJECT_DATABASE_LOST: {
|
|
544
|
-
code: "D7012",
|
|
545
|
-
message: "The project's database is gone",
|
|
546
|
-
explanation: {
|
|
547
|
-
when: "The project's files hold data but none of them is its database any more: the database file's header was damaged (by the disk, another program, or site data changed outside the app). Nothing is opened or changed: no empty database is made in its place. `meta.project` names the project.",
|
|
548
|
-
fix: "The project's data cannot be read back. Offer the user a reset, never automatically: `destroy()` on the same Project instance whose `open` was refused (keep it: `const project = new Project(params)`, then `await project.open(name)`) removes what the refused store holds, without opening it; `open(name)` then makes it again, empty, and its documents can be imported again.",
|
|
549
|
-
docs: `${e}/api/project#lifecycle`
|
|
550
|
-
}
|
|
551
|
-
},
|
|
552
494
|
PROJECT_DESTROYED_WHILE_AWAY: {
|
|
553
495
|
code: "D7013",
|
|
554
496
|
message: "The project was deleted while this view was away",
|
|
555
497
|
explanation: {
|
|
556
|
-
when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, its
|
|
498
|
+
when: "A view's connection to a project came back - the page back from a freeze or the back/forward cache, what serves its store started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",
|
|
557
499
|
fix: "Tell the user the project was deleted elsewhere; close it in this view (`project.close()`), then open it again by its name for what is there now, or choose another.",
|
|
558
500
|
docs: `${e}/api/project#lifecycle`
|
|
559
501
|
}
|
|
@@ -562,27 +504,18 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
562
504
|
code: "D7014",
|
|
563
505
|
message: "The project's name cannot name its files",
|
|
564
506
|
explanation: {
|
|
565
|
-
when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a
|
|
507
|
+
when: "A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a store may name its files after both, which no file can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",
|
|
566
508
|
fix: "Give the project a name of its own (and the dialecte an id) other than an empty one, `.` or `..`.",
|
|
567
509
|
docs: `${e}/api/project#lifecycle`
|
|
568
510
|
}
|
|
569
511
|
},
|
|
570
|
-
|
|
571
|
-
code: "
|
|
572
|
-
message: "
|
|
573
|
-
explanation: {
|
|
574
|
-
when: "A project was opened on `storage: { type: 'sqlite' }` but made by no dialecte's project factory: its engine (the dialecte's id, its version and its engine worker's URL) is known to no one, so nothing can start it. Nothing was opened.",
|
|
575
|
-
fix: "Make the project with the dialecte's project factory (`createProjectFactory({ dialecte, engineUrl })`, as a dialecte package exports it), or open it on another storage.",
|
|
576
|
-
docs: `${e}/api/project#sqlite-storage`
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
PROJECT_SQLITE_NOT_IMPORTED: {
|
|
580
|
-
code: "D7016",
|
|
581
|
-
message: "SQLite storage needs `import '@dialecte/core/sqlite'`",
|
|
512
|
+
PROJECT_STORAGE_NOT_REGISTERED: {
|
|
513
|
+
code: "D7018",
|
|
514
|
+
message: "The project's storage type is not registered",
|
|
582
515
|
explanation: {
|
|
583
|
-
when: "A project was opened (or destroyed by name)
|
|
584
|
-
fix: "
|
|
585
|
-
docs: `${e}/
|
|
516
|
+
when: "A project was opened (or destroyed by name), or a test asked for a test store, on a `storage.type` no kind is registered for in this realm: core serves `local`, `inMemory` and `custom` itself, every other type comes from the entry that registers it (`registerStorageKind`). Nothing was opened. `meta`: `project`, `type`.",
|
|
517
|
+
fix: "Import the entry that registers the type once in the app's entry (for tests, in the test runner's setup file), before the first project opens on it; or open the project on another storage. Imported already? A kind is shared by every copy of @dialecte/core of the same storage version in the realm: one registered by a copy of another version (a package bringing its own core) is not seen - align the core versions.",
|
|
518
|
+
docs: `${e}/guide/development/implementing-a-store#register-a-storage-kind`
|
|
586
519
|
}
|
|
587
520
|
},
|
|
588
521
|
DOCUMENT_PATH_INVALID: {
|
|
@@ -603,53 +536,46 @@ var e = "https://dialecte.github.io/core", t = {
|
|
|
603
536
|
docs: `${e}/api/project#a-document-s-path`
|
|
604
537
|
}
|
|
605
538
|
}
|
|
606
|
-
};
|
|
607
|
-
function
|
|
608
|
-
throw
|
|
539
|
+
}, r = new Set(Object.values(n).map((e) => e.code));
|
|
540
|
+
function i(e, t) {
|
|
541
|
+
throw a(e, t);
|
|
609
542
|
}
|
|
610
|
-
function
|
|
543
|
+
function a(e, t) {
|
|
611
544
|
let r = typeof e == "string" ? {
|
|
612
545
|
key: e,
|
|
613
|
-
...
|
|
546
|
+
...n[e]
|
|
614
547
|
} : e, i = {
|
|
615
548
|
code: r.code,
|
|
616
549
|
key: r.key,
|
|
617
|
-
message:
|
|
618
|
-
detail:
|
|
550
|
+
message: t.message ?? r.message,
|
|
551
|
+
detail: t.detail,
|
|
619
552
|
method: l((/* @__PURE__ */ Error()).stack),
|
|
620
|
-
ref:
|
|
621
|
-
meta:
|
|
622
|
-
cause:
|
|
623
|
-
}, a = Error(
|
|
553
|
+
ref: t.ref,
|
|
554
|
+
meta: t.meta,
|
|
555
|
+
cause: t.cause
|
|
556
|
+
}, a = Error(t.detail);
|
|
624
557
|
return a.cause = i, a;
|
|
625
558
|
}
|
|
626
|
-
function
|
|
627
|
-
let
|
|
559
|
+
function o(e) {
|
|
560
|
+
let t = {}, a = /* @__PURE__ */ new Map();
|
|
628
561
|
for (let [o, s] of Object.entries(e)) {
|
|
629
|
-
Object.hasOwn(
|
|
630
|
-
let e =
|
|
631
|
-
e &&
|
|
562
|
+
Object.hasOwn(n, o) && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" is a key of the core catalogue` }), r.has(s.code) && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", a code of the core catalogue` });
|
|
563
|
+
let e = a.get(s.code);
|
|
564
|
+
e && i("ASSERTION_FAILED", { detail: `defineErrors: "${o}" uses "${s.code}", the code of "${e}"` }), a.set(s.code, o), t[o] = {
|
|
632
565
|
key: o,
|
|
633
566
|
...s
|
|
634
567
|
};
|
|
635
568
|
}
|
|
636
|
-
return
|
|
569
|
+
return t;
|
|
637
570
|
}
|
|
638
|
-
|
|
639
|
-
function o(e) {
|
|
571
|
+
function s(e) {
|
|
640
572
|
if (!(e instanceof Error)) return;
|
|
641
573
|
let t = e.cause;
|
|
642
574
|
if (!(!t || t instanceof Error) && typeof t.key == "string" && typeof t.code == "string") return t;
|
|
643
575
|
}
|
|
644
|
-
function
|
|
645
|
-
return Object.hasOwn(
|
|
576
|
+
function c(e, t) {
|
|
577
|
+
return Object.hasOwn(n, e.key) ? !0 : t.catalogues.some((t) => Object.hasOwn(t, e.key) && t[e.key]?.code === e.code);
|
|
646
578
|
}
|
|
647
|
-
var c = /* @__PURE__ */ new Set([
|
|
648
|
-
"throwDialecteError",
|
|
649
|
-
"createDialecteError",
|
|
650
|
-
"invariant",
|
|
651
|
-
"reportFailure"
|
|
652
|
-
]);
|
|
653
579
|
function l(e) {
|
|
654
580
|
if (!e) return "unknown";
|
|
655
581
|
let t = e.split("\n").slice(1).map((e) => e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find((e) => !u(e?.[1])), n = t?.[1]?.replace(/^Object\./, ""), r = t?.[2];
|
|
@@ -658,7 +584,7 @@ function l(e) {
|
|
|
658
584
|
return i ? `${i[1].replace(/\.[^/.]+$/, "")}::${n}` : n;
|
|
659
585
|
}
|
|
660
586
|
function u(e) {
|
|
661
|
-
return e ?
|
|
587
|
+
return e ? t.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
|
|
662
588
|
}
|
|
663
589
|
var d = /[ \t\r\n]+/g;
|
|
664
590
|
function f(e) {
|
|
@@ -851,9 +777,9 @@ function L(e) {
|
|
|
851
777
|
var R = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE\uFFFF]/;
|
|
852
778
|
function z(e, t) {
|
|
853
779
|
if (e) return;
|
|
854
|
-
let { detail:
|
|
855
|
-
|
|
856
|
-
detail:
|
|
780
|
+
let { detail: n, key: r = "ASSERTION_FAILED", ref: a, meta: o } = t;
|
|
781
|
+
i(r, {
|
|
782
|
+
detail: n,
|
|
857
783
|
ref: a,
|
|
858
784
|
meta: o
|
|
859
785
|
});
|
|
@@ -959,4 +885,4 @@ function Y(e) {
|
|
|
959
885
|
});
|
|
960
886
|
}
|
|
961
887
|
//#endregion
|
|
962
|
-
export { S as A, f as B, C as D, x as E, b as F,
|
|
888
|
+
export { S as A, f as B, C as D, x as E, b as F, s as G, o as H, n as K, g as M, _ as N, w as O, y as R, P as S, T, c as U, a as V, i as W, L as _, K as a, N as b, W as c, H as d, z as f, I as g, R as h, v as j, E as k, B as l, U as o, e as q, G as s, V as u, O as w, F as y, m as z };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, b as t, f as n, g as r } from "./utils-
|
|
1
|
+
import { _ as e, b as t, f as n, g as r } from "./utils-Cv4oHia0.js";
|
|
2
2
|
export { r as enumeratedValues, t as getAttributeRules, n as invariant, e as valuePatterns };
|