@wssto2/vue-core 0.8.0 → 0.9.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/CHANGELOG.md +25 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CkomzGrt.js → AccessGate.vue_vue_type_script_setup_true_lang-B8gpkhbw.js} +1 -1
- package/dist/{Activity-Cm1dlM2b.js → Activity-CfG8_Pp3.js} +7 -7
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-9Lt1XggN.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-DC-zSRcl.js} +1 -1
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-GxAsImnO.js → AsyncSection.vue_vue_type_script_setup_true_lang-BTIUz3cG.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-DQq_0P0p.js → Button.vue_vue_type_script_setup_true_lang-Dn-cJcj3.js} +67 -65
- package/dist/{Changes-fN0KMYbW.js → Changes-BT__0XX0.js} +6 -6
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang--onFdKOB.js → CollectionPage.vue_vue_type_script_setup_true_lang-Bcwwr8ng.js} +7 -7
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-CTukf2B2.js → DataTable.vue_vue_type_script_setup_true_lang-CJlllQII.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-DmYp54mq.js → DateField.vue_vue_type_script_setup_true_lang-BuQY5e5x.js} +2 -2
- package/dist/{DeadLetters-BslDh93e.js → DeadLetters-Btv3u3qh.js} +4 -4
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-BTADNpwB.js → FormGroup.vue_vue_type_script_setup_true_lang-Bzm3yJy5.js} +1 -1
- package/dist/{General-DJ53Egpp.js → General-Cum9U4Z3.js} +6 -6
- package/dist/{IncidentRecord-DQTnYQEe.js → IncidentRecord-C4K8hDJ1.js} +10 -10
- package/dist/{IncidentsList-C3yUnwwY.js → IncidentsList-BHfJ1cbg.js} +6 -6
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-4MsnTWyx.js → Modal.vue_vue_type_script_setup_true_lang-BqO9X_-u.js} +1 -1
- package/dist/{NewRolePage-Bw2_jXcQ.js → NewRolePage-BSvYZkH4.js} +4 -4
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-C3nw944P.js → NumberField.vue_vue_type_script_setup_true_lang-CLN2COfp.js} +1 -1
- package/dist/{PageBar.vue_vue_type_script_setup_true_lang-DPpcZxuT.js → PageBar.vue_vue_type_script_setup_true_lang-OE8VgTkY.js} +1 -1
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-07pq4SrY.js → PersonAccess.vue_vue_type_script_setup_true_lang-CBQ1kv8G.js} +7 -7
- package/dist/{ProfilePage-DxALOfzC.js → ProfilePage-Dnn_VUoB.js} +13 -13
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DPm9q1P_.js → RecordHeader.vue_vue_type_script_setup_true_lang-CU7fZpp2.js} +1 -1
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Cm3tx76N.js → ResourcePage.vue_vue_type_script_setup_true_lang-y3gyR5A-.js} +3 -3
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-DuQR8hFf.js → RoleEditor.vue_vue_type_script_setup_true_lang-BcUxVL9y.js} +5 -5
- package/dist/{RolePage-Yv6m6u7o.js → RolePage-BIY9dEME.js} +10 -10
- package/dist/{RolesPage-TibtzxzQ.js → RolesPage-Be35CA_4.js} +5 -5
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-DAnZbfWA.js → SectionList.vue_vue_type_script_setup_true_lang-DzoE_o8v.js} +1 -1
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-ivdGWUeF.js → SectionNavigator.vue_vue_type_script_setup_true_lang-CWPD9zQJ.js} +3 -3
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-iJm8qmjT.js → SelectField.vue_vue_type_script_setup_true_lang-CYiarLAK.js} +1 -1
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-en2w_pAJ.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-CKIq1Ljb.js} +7 -7
- package/dist/{ServiceAccountRecord-B_amE8fL.js → ServiceAccountRecord-QsIfylwj.js} +13 -13
- package/dist/{ServiceAccountsList-CoDKG_15.js → ServiceAccountsList-CVDIhuCh.js} +7 -7
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-BEKTaL0g.js → SessionList.vue_vue_type_script_setup_true_lang-CkN7vR71.js} +3 -3
- package/dist/{Sessions-BrAEXAMA.js → Sessions-Cl2DTM7s.js} +5 -5
- package/dist/{SettingsPage-Cje1X0ix.js → SettingsPage-B2uWw27O.js} +10 -10
- package/dist/{SignIn-CbWgDlFb.js → SignIn-BHYFSMOX.js} +5 -5
- package/dist/{SignInPage-DmHdrZR-.js → SignInPage--OC0hQ8M.js} +3 -3
- package/dist/{SignIns-D5BRb9Sr.js → SignIns-CJ09NqOn.js} +5 -5
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-BwoE08jT.js → TimeField.vue_vue_type_script_setup_true_lang-B140Gjqd.js} +2 -2
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-u53rHMFG.js → Timestamp.vue_vue_type_script_setup_true_lang-CAz2W69d.js} +1 -1
- package/dist/{UserRecord-rIeTkocJ.js → UserRecord-BjXUcHo8.js} +9 -9
- package/dist/{UsersList-CiPeerC7.js → UsersList-D4-eC5tC.js} +9 -9
- package/dist/access/index.js +4 -4
- package/dist/app/application.d.ts +4 -2
- package/dist/app/index.js +2 -2
- package/dist/application-DtY0ef-w.js +420 -0
- package/dist/button/index.js +1 -1
- package/dist/button/shortcut.d.ts +7 -0
- package/dist/client/client.d.ts +33 -0
- package/dist/client/disposition.d.ts +5 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client-Dr2vV3qH.js +193 -0
- package/dist/collection/index.js +5 -5
- package/dist/content/Money.vue.d.ts +31 -0
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.js +75 -40
- package/dist/{contributions-BQ9dZoRw.js → contributions-DGsAIWd8.js} +1 -1
- package/dist/{fieldMessages-DTXpWnBd.js → fieldMessages-6UTV9yWL.js} +1 -1
- package/dist/form/EditorPage.vue.d.ts +6 -0
- package/dist/form/FileField.vue.d.ts +1 -1
- package/dist/form/PhotoField.vue.d.ts +1 -1
- package/dist/form/index.js +108 -108
- package/dist/format/format.d.ts +9 -1
- package/dist/format/index.js +1 -1
- package/dist/format-Dn-BOb-o.js +86 -0
- package/dist/{guards-BFCulig0.js → guards-Cz7TOQD8.js} +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/incidents/index.js +1 -1
- package/dist/{index-B_lzrZot.js → index-BB0_hxmE.js} +16 -16
- package/dist/{index-BQg5X6iK.js → index-C1jSzT1V.js} +7 -7
- package/dist/{index-Cgu6Ntok.js → index-DZQ3gy3e.js} +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/index.js +15 -15
- package/dist/{navigation-BSC9X7FM.js → navigation-CWj6F_cV.js} +1 -1
- package/dist/{neighbors-BKzihEGQ.js → neighbors-CcCaurV5.js} +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/page/index.js +5 -5
- package/dist/platform/index.js +3 -3
- package/dist/{platform-Dr4iY3b8.js → platform-BZUWAXQV.js} +1 -1
- package/dist/pwa/index.d.ts +2 -0
- package/dist/pwa/index.js +51 -0
- package/dist/pwa/install.d.ts +12 -0
- package/dist/pwa/worker.d.ts +13 -0
- package/dist/resource/index.js +1 -1
- package/dist/router/index.js +3 -3
- package/dist/{rowLayout-XlTcD4de.js → rowLayout-BLhJ9-42.js} +2 -2
- package/dist/{sections-BXg4_ZhO.js → sections-CmqFs-U-.js} +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/state/index.js +1 -1
- package/dist/{state-ChVIjayU.js → state-BiYPPKoj.js} +1 -1
- package/dist/{status-BV5Ae4K4.js → status-Bf4nfIe0.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/{useCommand-BIZX1ReM.js → useCommand-C3QTZIIw.js} +1 -1
- package/dist/{useGroupSheet-DxXzdKo3.js → useGroupSheet-LAnO37WV.js} +2 -2
- package/dist/{useRecordDialog-BLVSz7g3.js → useRecordDialog-Da1Sfak1.js} +1 -1
- package/dist/{useTypedEntry-CKuGqWT8.js → useTypedEntry-DIYdA7DK.js} +1 -1
- package/package.json +5 -1
- package/dist/application-D8Nm17zA.js +0 -420
- package/dist/client-CZgikXPG.js +0 -151
- package/dist/format-D8X4zsx6.js +0 -78
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var Le = (e, n, o) => n in e ? Me(e, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[n] = o;
|
|
3
|
+
var ee = (e, n, o) => Le(e, typeof n != "symbol" ? n + "" : n, o);
|
|
4
|
+
import { effectScope as W, watch as B, defineComponent as me, openBlock as je, createElementBlock as Ae, createVNode as te, unref as K, withCtx as se, createTextVNode as Ne, toDisplayString as Ke, shallowRef as Oe, computed as _e, h as oe, createApp as Ce } from "vue";
|
|
5
|
+
import { useI18n as Fe, createI18n as Ie } from "vue-i18n";
|
|
6
|
+
import { createRouter as Te, isNavigationFailure as qe } from "vue-router";
|
|
7
|
+
import { i as De } from "./leaveGuard-Cc8yeLxM.js";
|
|
8
|
+
import { c as Pe, i as We, f as Be } from "./format-Dn-BOb-o.js";
|
|
9
|
+
import { coreMessages as re, createMessageRuntime as He } from "./i18n/index.js";
|
|
10
|
+
import { i as Ve, a as Ge } from "./Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
11
|
+
import { i as Je, b as ze } from "./bottomDock-BZEiOPYZ.js";
|
|
12
|
+
import { i as Qe, p as Ue } from "./chrome-nUcmVu8G.js";
|
|
13
|
+
import { i as Xe, g as Ye } from "./platform-BZUWAXQV.js";
|
|
14
|
+
import { c as Ze, A as et, r as ae } from "./access-DmAceEo5.js";
|
|
15
|
+
import { c as tt, _ as st } from "./NoAccess.vue_vue_type_script_setup_true_lang-BHzZtZ50.js";
|
|
16
|
+
import { i as ot } from "./guards-Cz7TOQD8.js";
|
|
17
|
+
import { b as rt, c as at, n as ne } from "./navigation-CWj6F_cV.js";
|
|
18
|
+
import { c as nt, s as ie } from "./contributions-DGsAIWd8.js";
|
|
19
|
+
import { a as ce } from "./environment-Dva-SG8D.js";
|
|
20
|
+
import { b as le, c as ue } from "./describeError-BqGAUZgX.js";
|
|
21
|
+
import { _ as it } from "./Button.vue_vue_type_script_setup_true_lang-Dn-cJcj3.js";
|
|
22
|
+
import { _ as ct } from "./EmptyState.vue_vue_type_script_setup_true_lang-DbZiO2RF.js";
|
|
23
|
+
import { i as lt } from "./feature-DdUAfyi4.js";
|
|
24
|
+
function ut(e) {
|
|
25
|
+
const { platform: n } = e, o = W();
|
|
26
|
+
let c = null, v = null, y = !1;
|
|
27
|
+
function E(l, m) {
|
|
28
|
+
const h = new AbortController(), f = { controller: h, stops: [] };
|
|
29
|
+
for (const k of l)
|
|
30
|
+
try {
|
|
31
|
+
const b = m(k, h.signal);
|
|
32
|
+
typeof b == "function" && f.stops.push({ owned: k, stop: b });
|
|
33
|
+
} catch (b) {
|
|
34
|
+
e.onError(b, k);
|
|
35
|
+
}
|
|
36
|
+
return f;
|
|
37
|
+
}
|
|
38
|
+
function R(l) {
|
|
39
|
+
if (l) {
|
|
40
|
+
l.controller.abort();
|
|
41
|
+
for (const { owned: m, stop: h } of l.stops.reverse())
|
|
42
|
+
try {
|
|
43
|
+
h();
|
|
44
|
+
} catch (f) {
|
|
45
|
+
e.onError(f, m);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const M = (l) => e.effects.filter((m) => m.effect.scope === l), x = (l) => l.status !== "authenticated" ? null : e.sessionKey ? e.sessionKey(l) : String(l.user.id);
|
|
50
|
+
return {
|
|
51
|
+
start() {
|
|
52
|
+
if (y || c) return;
|
|
53
|
+
c = E(
|
|
54
|
+
M("app"),
|
|
55
|
+
(m, h) => m.effect.start({ signal: h, platform: n, report: (f) => e.onError(f, m) })
|
|
56
|
+
);
|
|
57
|
+
const l = M("session");
|
|
58
|
+
o.run(
|
|
59
|
+
() => B(
|
|
60
|
+
() => x(n.session.state.value),
|
|
61
|
+
(m) => {
|
|
62
|
+
R(v), v = null;
|
|
63
|
+
const h = n.session.state.value;
|
|
64
|
+
m === null || h.status !== "authenticated" || (v = E(
|
|
65
|
+
l,
|
|
66
|
+
(f, k) => f.effect.start({ signal: k, platform: n, user: h.user, report: (b) => e.onError(b, f) })
|
|
67
|
+
));
|
|
68
|
+
},
|
|
69
|
+
{ immediate: !0, flush: "sync" }
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
dispose() {
|
|
74
|
+
y || (y = !0, o.stop(), R(v), R(c), v = c = null);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const ft = { class: "mx-auto flex min-h-screen max-w-content items-center justify-center p-screen-padding" }, dt = /* @__PURE__ */ me({
|
|
79
|
+
__name: "StartupFailure",
|
|
80
|
+
props: {
|
|
81
|
+
kind: {}
|
|
82
|
+
},
|
|
83
|
+
emits: ["retry"],
|
|
84
|
+
setup(e) {
|
|
85
|
+
const { t: n } = Fe();
|
|
86
|
+
return (o, c) => (je(), Ae("div", ft, [
|
|
87
|
+
te(K(ct), {
|
|
88
|
+
title: K(n)("core.startup.title"),
|
|
89
|
+
description: K(n)(e.kind === "startup" ? "core.startup.other" : `core.startup.${e.kind}`),
|
|
90
|
+
icon: "errorWarningLine"
|
|
91
|
+
}, {
|
|
92
|
+
actions: se(() => [
|
|
93
|
+
te(K(it), {
|
|
94
|
+
prominence: "primary",
|
|
95
|
+
icon: "refreshLine",
|
|
96
|
+
onClick: c[0] || (c[0] = (v) => o.$emit("retry"))
|
|
97
|
+
}, {
|
|
98
|
+
default: se(() => [
|
|
99
|
+
Ne(Ke(K(n)("core.actions.retry")), 1)
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
})
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
}, 8, ["title", "description"])
|
|
106
|
+
]));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
class fe extends Error {
|
|
110
|
+
constructor(o) {
|
|
111
|
+
super(`The application composition is invalid:
|
|
112
|
+
${o.map((c) => ` - [${c.owner}] ${c.message}`).join(`
|
|
113
|
+
`)}`);
|
|
114
|
+
ee(this, "issues");
|
|
115
|
+
this.name = "ApplicationError", this.issues = o;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const de = "application", w = (e) => `feature "${e.id}"`;
|
|
119
|
+
function* H(e, n = "") {
|
|
120
|
+
for (const o of e) {
|
|
121
|
+
const c = o.path.startsWith("/") ? o.path : `${n.replace(/\/$/, "")}/${o.path}`;
|
|
122
|
+
yield { record: o, path: c }, o.children && (yield* H(o.children, c));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function pt(e) {
|
|
126
|
+
const n = [], o = (s, r) => n.push({ owner: s, message: r }), c = [];
|
|
127
|
+
e.features.forEach((s, r) => {
|
|
128
|
+
lt(s) ? c.push(s) : o(de, `features[${r}] was not created with defineFeature().`);
|
|
129
|
+
});
|
|
130
|
+
const v = /* @__PURE__ */ new Map();
|
|
131
|
+
for (const s of c)
|
|
132
|
+
v.has(s.id) ? o(w(s), `the feature id "${s.id}" is used twice in the features list.`) : v.set(s.id, s);
|
|
133
|
+
for (const s of c)
|
|
134
|
+
for (const r of s.requires)
|
|
135
|
+
v.has(r) || o(w(s), `requires the feature "${r}", which is not in the features list.`);
|
|
136
|
+
const y = [], E = /* @__PURE__ */ new Set(), R = (s) => {
|
|
137
|
+
if (E.has(s.id)) return;
|
|
138
|
+
const r = y.indexOf(s.id);
|
|
139
|
+
if (r !== -1) {
|
|
140
|
+
o(w(s), `requirements form a cycle: ${[...y.slice(r), s.id].join(" -> ")}.`), E.add(s.id);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
y.push(s.id);
|
|
144
|
+
for (const u of s.requires) {
|
|
145
|
+
const i = v.get(u);
|
|
146
|
+
i && R(i);
|
|
147
|
+
}
|
|
148
|
+
y.pop(), E.add(s.id);
|
|
149
|
+
};
|
|
150
|
+
c.forEach(R);
|
|
151
|
+
const M = new Set(e.platform.config.capabilities);
|
|
152
|
+
for (const s of c)
|
|
153
|
+
for (const r of s.backend)
|
|
154
|
+
M.has(r) || o(w(s), `needs the backend capability "${r}", which the server does not report.`);
|
|
155
|
+
const x = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
156
|
+
for (const s of c) {
|
|
157
|
+
for (const r of s.routes) {
|
|
158
|
+
const u = r.path.length > 1 ? r.path.replace(/\/$/, "") : r.path, i = l.get(u);
|
|
159
|
+
i ? o(w(s), `declares the path "${r.path}", which feature "${i.id}" declares too.`) : l.set(u, s);
|
|
160
|
+
}
|
|
161
|
+
for (const { record: r } of H(s.routes)) {
|
|
162
|
+
if (r.meta && "feature" in r.meta && o(w(s), `the route "${String(r.name ?? r.path)}" sets meta.feature, which the runtime owns.`), typeof r.name != "string") continue;
|
|
163
|
+
const u = x.get(r.name);
|
|
164
|
+
u ? o(w(s), `declares the route name "${r.name}", which feature "${u.id}" declares too.`) : x.set(r.name, s);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const m = new Set(e.reservedContexts), h = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const s of c)
|
|
169
|
+
for (const { key: r } of s.contexts) {
|
|
170
|
+
const u = r.description ?? "a context";
|
|
171
|
+
m.has(r) && o(w(s), `provides the context "${u}", which the runtime provides itself.`);
|
|
172
|
+
const i = h.get(r);
|
|
173
|
+
i ? o(w(s), `provides the context "${u}", which feature "${i.id}" provides too.`) : h.set(r, s);
|
|
174
|
+
}
|
|
175
|
+
const f = /* @__PURE__ */ new Map(), k = (s, r) => {
|
|
176
|
+
for (const u of r) {
|
|
177
|
+
const i = f.get(u.namespace);
|
|
178
|
+
i ? o(s, `declares the message namespace "${u.namespace}", which ${i} declares too.`) : f.set(u.namespace, s);
|
|
179
|
+
for (const L of Object.keys(u.loaders))
|
|
180
|
+
e.supportedLocales.includes(L) || o(s, `the namespace "${u.namespace}" has a loader for "${L}", which is not a supported locale (${e.supportedLocales.join(", ")}).`);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
for (const s of c) k(w(s), s.messages);
|
|
184
|
+
k(de, e.messages);
|
|
185
|
+
const b = (s) => f.has(s);
|
|
186
|
+
for (const s of c)
|
|
187
|
+
for (const { record: r } of H(s.routes))
|
|
188
|
+
for (const u of r.meta?.messages ?? [])
|
|
189
|
+
b(u) || o(w(s), `the route "${String(r.name ?? r.path)}" needs the message namespace "${u}", which nobody declares.`);
|
|
190
|
+
const O = /* @__PURE__ */ new Map();
|
|
191
|
+
for (const s of c)
|
|
192
|
+
for (const r of s.contributions) {
|
|
193
|
+
const u = O.get(r.id);
|
|
194
|
+
u ? o(w(s), `declares the shell contribution "${r.id}", which feature "${u.id}" declares too.`) : O.set(r.id, s), e.shellSlots && !r.optional && !e.shellSlots.includes(r.slot) && o(w(s), `contributes "${r.id}" to the slot "${r.slot}", which the shell does not render (it renders ${e.shellSlots.join(", ") || "none"}). Mark it optional to leave it out instead.`);
|
|
195
|
+
for (const i of r.messages ?? [])
|
|
196
|
+
b(i) || o(w(s), `the contribution "${r.id}" needs the message namespace "${i}", which nobody declares.`);
|
|
197
|
+
}
|
|
198
|
+
const _ = /* @__PURE__ */ new Map();
|
|
199
|
+
for (const s of c)
|
|
200
|
+
for (const r of s.effects) {
|
|
201
|
+
const u = _.get(r.id);
|
|
202
|
+
u ? o(w(s), `declares the effect "${r.id}", which feature "${u.id}" declares too.`) : _.set(r.id, s);
|
|
203
|
+
const i = r.scope;
|
|
204
|
+
i !== "app" && i !== "session" && o(w(s), `the effect "${r.id}" has the scope "${i}"; use "app" or "session".`);
|
|
205
|
+
}
|
|
206
|
+
return { features: c, issues: n };
|
|
207
|
+
}
|
|
208
|
+
const mt = (e, n, o) => Ie({
|
|
209
|
+
legacy: !1,
|
|
210
|
+
locale: e,
|
|
211
|
+
fallbackLocale: n,
|
|
212
|
+
pluralRules: o?.pluralRules && { ...o.pluralRules },
|
|
213
|
+
...o?.missingWarn === !1 && { missingWarn: !1, fallbackWarn: !1 },
|
|
214
|
+
messages: {}
|
|
215
|
+
}), ht = (e) => typeof e == "object" && e !== null && "component" in e && "slots" in e;
|
|
216
|
+
function he(e, n) {
|
|
217
|
+
return e.map((o) => ({
|
|
218
|
+
...o,
|
|
219
|
+
meta: { ...o.meta, feature: n },
|
|
220
|
+
...o.children && { children: he(o.children, n) }
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
const pe = (e) => [...new Set(e)];
|
|
224
|
+
function Dt(e) {
|
|
225
|
+
const { platform: n } = e, o = e.locale?.supported ?? Object.keys(re), c = e.locale?.fallback ?? "en", v = e.shell === void 0 ? void 0 : ht(e.shell) ? e.shell : { component: e.shell, slots: void 0, progress: void 0 }, y = [];
|
|
226
|
+
o.includes(c) || y.push({ owner: "application", message: `the fallback locale "${c}" is not among the supported locales (${o.join(", ")}).` });
|
|
227
|
+
for (const t of Object.keys(e.locale?.flags ?? {}))
|
|
228
|
+
o.includes(t) || y.push({ owner: "application", message: `locale.flags names the locale "${t}", which is not among the supported locales (${o.join(", ")}).` });
|
|
229
|
+
const E = e.locale?.initial ?? (o.includes(n.config.locale) ? n.config.locale : c);
|
|
230
|
+
o.includes(E) || y.push({ owner: "application", message: `the initial locale "${E}" is not among the supported locales (${o.join(", ")}).` });
|
|
231
|
+
const R = [Ye, Be, Ue, ze, Ge, ne, ie, ae, ce, le, ue], M = pt({
|
|
232
|
+
features: e.features,
|
|
233
|
+
platform: n,
|
|
234
|
+
messages: e.messages ?? [],
|
|
235
|
+
reservedContexts: R,
|
|
236
|
+
supportedLocales: o,
|
|
237
|
+
shellSlots: v?.slots
|
|
238
|
+
}), x = [...y, ...M.issues], l = M.features, m = rt(
|
|
239
|
+
l.flatMap((t) => t.navigation.map((a) => ({ feature: t.id, binding: a }))),
|
|
240
|
+
e.navigation
|
|
241
|
+
);
|
|
242
|
+
for (const t of m.issues) x.push({ owner: "navigation", message: t });
|
|
243
|
+
if (x.length > 0) throw new fe(x);
|
|
244
|
+
const h = mt(E, c, e.i18n), f = h.global;
|
|
245
|
+
for (const [t, a] of Object.entries(re)) f.mergeLocaleMessage(t, a);
|
|
246
|
+
for (const [t, a] of Object.entries(e.i18n?.messages ?? {})) f.mergeLocaleMessage(t, a);
|
|
247
|
+
const { currencySymbol: k, ...b } = e.formatting ?? {}, O = Pe({ locale: () => f.locale.value, formatters: b, currencySymbol: k }), _ = [...l.flatMap((t) => t.messages), ...e.messages ?? []], s = (t) => (e.onError ?? gt)({ ...t, route: i.currentRoute.value.matched.length > 0 ? i.currentRoute.value.fullPath : null }), r = He({
|
|
248
|
+
target: f,
|
|
249
|
+
namespaces: _,
|
|
250
|
+
fallback: c,
|
|
251
|
+
supported: o,
|
|
252
|
+
onFailure: (t) => s({ source: "messages", error: t.error, detail: `${t.namespace} (${t.locale})`, feature: u.get(t.namespace) })
|
|
253
|
+
}), u = new Map(l.flatMap((t) => t.messages.map((a) => [a.namespace, t.id]))), i = Te({
|
|
254
|
+
history: e.router?.history ?? tt(),
|
|
255
|
+
routes: l.flatMap((t) => he(t.routes, t.id)),
|
|
256
|
+
scrollBehavior: e.router?.scrollBehavior ?? ((t, a) => t.name === a.name ? !1 : { top: 0 })
|
|
257
|
+
}), L = e.router?.login ?? { name: "login" }, ge = e.router?.home ?? { path: "/" }, C = [], V = (t) => {
|
|
258
|
+
try {
|
|
259
|
+
return i.resolve(t).matched.length > 0 ? null : "matches no route";
|
|
260
|
+
} catch (a) {
|
|
261
|
+
const p = a instanceof Error ? a.message : String(a);
|
|
262
|
+
return p.startsWith("No match for") ? "matches no route" : `cannot be resolved (${p})`;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
if (l.some((t) => t.routes.some((a) => a.meta?.public !== !0))) {
|
|
266
|
+
const t = V(L) ?? (i.resolve(L).meta.public === !0 ? null : "is not public (meta.public: true)");
|
|
267
|
+
t && C.push({ owner: "application", message: `the login route ${JSON.stringify(L)} ${t.replace("matches no route", "does not exist")}, but protected routes are installed: an anonymous visitor would have nowhere to go. Install a feature with the login route or set router.login.` });
|
|
268
|
+
}
|
|
269
|
+
for (const { feature: t, binding: a } of m.destinations.values()) {
|
|
270
|
+
const p = V(a.to);
|
|
271
|
+
p && C.push({ owner: `feature "${t}"`, message: `the destination "${a.destination}" is bound to ${JSON.stringify(a.to)}, which ${p}.` });
|
|
272
|
+
}
|
|
273
|
+
if (C.length > 0) throw new fe(C);
|
|
274
|
+
const j = Oe({ status: "idle" }), F = {
|
|
275
|
+
state: j,
|
|
276
|
+
locale: _e(() => f.locale.value),
|
|
277
|
+
locales: o,
|
|
278
|
+
localeFlags: e.locale?.flags ?? {},
|
|
279
|
+
setLocale: async (t) => {
|
|
280
|
+
const a = f.locale.value, p = await r.setLocale(t);
|
|
281
|
+
if (p && f.locale.value !== a) {
|
|
282
|
+
const g = (N) => s({ source: "locale", error: N, detail: t });
|
|
283
|
+
try {
|
|
284
|
+
Promise.resolve(e.locale?.onChange?.(t)).catch(g);
|
|
285
|
+
} catch (N) {
|
|
286
|
+
g(N);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return p;
|
|
290
|
+
},
|
|
291
|
+
retry: () => P()
|
|
292
|
+
}, T = {
|
|
293
|
+
contributions: l.flatMap((t) => t.contributions.map((a) => ({ feature: t.id, contribution: a }))),
|
|
294
|
+
effects: l.flatMap((t) => t.effects.map((a) => ({ feature: t.id, effect: a })))
|
|
295
|
+
}, G = ut({
|
|
296
|
+
effects: T.effects,
|
|
297
|
+
platform: n,
|
|
298
|
+
sessionKey: e.sessionKey,
|
|
299
|
+
onError: (t, a) => s({ source: "effect", error: t, feature: a.feature, detail: a.effect.id })
|
|
300
|
+
}), we = new Map(l.map((t) => [t.id, t.messages.map((a) => a.namespace)])), J = (t) => pe(T.contributions.filter(({ contribution: a }) => a.scope === t).flatMap(({ contribution: a }) => a.messages ?? [])), ve = J("always"), ye = J("authenticated");
|
|
301
|
+
async function $e(t) {
|
|
302
|
+
const a = t.matched.flatMap((g) => [...we.get(g.meta.feature ?? "") ?? [], ...g.meta.messages ?? []]), p = n.session.state.value.status === "authenticated";
|
|
303
|
+
await r.load(pe([...a, ...ve, ...p ? ye : []]));
|
|
304
|
+
}
|
|
305
|
+
let q = null;
|
|
306
|
+
function D(t) {
|
|
307
|
+
const a = t.meta.titleKey, p = q?.documentTitle.value ?? (a && f.te(a) ? f.t(a) : null), g = (e.router?.documentTitle ?? wt)(p, n.config.appName);
|
|
308
|
+
g !== "" && (document.title = g);
|
|
309
|
+
}
|
|
310
|
+
const be = at({ session: n.session, router: i, i18n: f, destinations: m.destinations }), Ee = nt(T.contributions, n.session), ke = Ze({ router: i, access: n.access, noAccess: e.noAccess ?? st }), Se = me({
|
|
311
|
+
name: "ApplicationRoot",
|
|
312
|
+
setup() {
|
|
313
|
+
return () => {
|
|
314
|
+
const t = j.value;
|
|
315
|
+
return t.status === "failed" ? oe(dt, { kind: t.kind, onRetry: () => void P() }) : t.status !== "ready" ? null : oe(v?.component ?? et);
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
}), d = Ce(Se);
|
|
319
|
+
Xe(d, n), d.use(h), We(d, O), q = Qe(d), Je(d), De(d), e.icons && Ve(d, ...Array.isArray(e.icons) ? e.icons : [e.icons]), d.provide(ce, F), e.describeError && d.provide(le, e.describeError), e.describeFieldError && d.provide(ue, e.describeFieldError), d.provide(ne, be), d.provide(ie, Ee), d.provide(ae, ke);
|
|
320
|
+
for (const t of l) for (const { key: a, value: p } of t.contexts) d.provide(a, p);
|
|
321
|
+
let S = !1, z = !1, Q = !1, U = !1;
|
|
322
|
+
const A = [];
|
|
323
|
+
function Re() {
|
|
324
|
+
const t = d.config.errorHandler;
|
|
325
|
+
d.config.errorHandler = ($, xe, Z) => {
|
|
326
|
+
s({ source: "vue", error: $, detail: Z }), t?.($, xe, Z);
|
|
327
|
+
};
|
|
328
|
+
const a = ($) => s({ source: "unhandledrejection", error: $.reason }), p = ($) => {
|
|
329
|
+
$.error && s({ source: "window", error: $.error });
|
|
330
|
+
};
|
|
331
|
+
window.addEventListener("unhandledrejection", a), window.addEventListener("error", p), A.push(() => {
|
|
332
|
+
window.removeEventListener("unhandledrejection", a), window.removeEventListener("error", p);
|
|
333
|
+
});
|
|
334
|
+
const g = l.some(($) => $.holdsExpiredSession);
|
|
335
|
+
n.session.holdExpired(g), A.push(() => n.session.holdExpired(!1)), A.push(
|
|
336
|
+
ot({
|
|
337
|
+
router: i,
|
|
338
|
+
session: n.session,
|
|
339
|
+
login: L,
|
|
340
|
+
home: ge,
|
|
341
|
+
holdExpired: g,
|
|
342
|
+
prepare: $e,
|
|
343
|
+
afterNavigation: D,
|
|
344
|
+
progress: e.router?.progress ?? v?.progress,
|
|
345
|
+
onError: ($) => s({ source: "router", error: $ })
|
|
346
|
+
})
|
|
347
|
+
);
|
|
348
|
+
const N = W();
|
|
349
|
+
N.run(() => B(() => q?.documentTitle.value, () => D(i.currentRoute.value))), A.push(() => N.stop());
|
|
350
|
+
const Y = W();
|
|
351
|
+
Y.run(
|
|
352
|
+
() => B(
|
|
353
|
+
() => f.locale.value,
|
|
354
|
+
($) => {
|
|
355
|
+
document.documentElement.lang = $, D(i.currentRoute.value);
|
|
356
|
+
},
|
|
357
|
+
{ immediate: !0 }
|
|
358
|
+
)
|
|
359
|
+
), A.push(() => Y.stop());
|
|
360
|
+
}
|
|
361
|
+
const I = (t, a) => {
|
|
362
|
+
j.value = { status: "failed", kind: t, error: a };
|
|
363
|
+
};
|
|
364
|
+
async function X() {
|
|
365
|
+
j.value = { status: "starting" };
|
|
366
|
+
const t = await n.session.restore();
|
|
367
|
+
if (S) return;
|
|
368
|
+
if (t.status === "failed") return I("session", t.error);
|
|
369
|
+
const a = t.status === "authenticated" ? t.user.locale : void 0;
|
|
370
|
+
if (typeof a == "string" && a !== f.locale.value && o.includes(a) && await F.setLocale(a), S) return;
|
|
371
|
+
const p = await r.loadEssential();
|
|
372
|
+
if (!S) {
|
|
373
|
+
if (p.length > 0) return I("messages", p[0].error);
|
|
374
|
+
try {
|
|
375
|
+
const g = await i.replace(i.options.history.location);
|
|
376
|
+
if (S) return;
|
|
377
|
+
if (qe(g)) return I("startup", g);
|
|
378
|
+
} catch (g) {
|
|
379
|
+
S || I("startup", g);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
U || (d.use(i), U = !0), j.value = { status: "ready" }, G.start();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
async function P() {
|
|
386
|
+
S || j.value.status !== "failed" || (await r.retry(), await X());
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
app: d,
|
|
390
|
+
router: i,
|
|
391
|
+
i18n: h,
|
|
392
|
+
state: j,
|
|
393
|
+
locale: F.locale,
|
|
394
|
+
setLocale: F.setLocale,
|
|
395
|
+
async mount(t) {
|
|
396
|
+
if (S) throw new Error("This application was disposed; create a new one with createApplication().");
|
|
397
|
+
if (z) throw new Error("This application is already mounted.");
|
|
398
|
+
z = !0, Re(), await X(), !S && (d.mount(t), Q = !0);
|
|
399
|
+
},
|
|
400
|
+
retry: P,
|
|
401
|
+
dispose() {
|
|
402
|
+
if (!S) {
|
|
403
|
+
S = !0, G.dispose(), r.dispose(), Q && d.unmount();
|
|
404
|
+
for (const t of A.reverse()) t();
|
|
405
|
+
i.options.history.destroy();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function gt(e) {
|
|
411
|
+
console.error(`[vue-core] ${e.source}${e.feature ? ` (${e.feature})` : ""}${e.detail ? `: ${e.detail}` : ""}`, e.error);
|
|
412
|
+
}
|
|
413
|
+
function wt(e, n) {
|
|
414
|
+
return [e, n].filter((o) => !!o).join(" · ");
|
|
415
|
+
}
|
|
416
|
+
export {
|
|
417
|
+
fe as A,
|
|
418
|
+
Dt as c,
|
|
419
|
+
gt as d
|
|
420
|
+
};
|
package/dist/button/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as a, m as o, s as r, u, a as e } from "../Button.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as a, m as o, s as r, u, a as e } from "../Button.vue_vue_type_script_setup_true_lang-Dn-cJcj3.js";
|
|
2
2
|
export {
|
|
3
3
|
a as Button,
|
|
4
4
|
o as matchesShortcut,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ComputedRef, type MaybeRefOrGetter } from "vue";
|
|
2
2
|
/**
|
|
3
3
|
* A keyboard shortcut: the key (case-insensitive, as `KeyboardEvent.key`) and exactly the modifiers listed.
|
|
4
|
+
* A symbol key (`/`, `?`, one character that is no letter, digit or space) matches whatever the Shift state is
|
|
5
|
+
* unless `shiftKey` is set, because on many layouts the symbol itself needs Shift (Shift+7 is `/` on a Croatian keyboard).
|
|
4
6
|
* With a `label` it is listed by `useShortcutRegistry()` (a help dialog) for as long as its owner is mounted.
|
|
5
7
|
*/
|
|
6
8
|
export interface KeyboardShortcut {
|
|
@@ -9,6 +11,11 @@ export interface KeyboardShortcut {
|
|
|
9
11
|
shiftKey?: boolean;
|
|
10
12
|
altKey?: boolean;
|
|
11
13
|
metaKey?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The platform's command modifier: Ctrl or ⌘ alone (one of the two, with `shiftKey`/`altKey` as set), on every platform,
|
|
16
|
+
* so a Mac keyboard on a Windows browser still works; listed as ⌘ on Apple platforms and Ctrl elsewhere. Replaces `ctrlKey` and `metaKey`.
|
|
17
|
+
*/
|
|
18
|
+
mod?: boolean;
|
|
12
19
|
/** What it does, in the app's language ("Search the list"); a function is read when the list is read, so it follows the locale. An empty text is not listed. */
|
|
13
20
|
label?: string | (() => string);
|
|
14
21
|
/** The heading it is listed under; any name the app has a heading for. The library's own use `"list"` and `"record"`. */
|
package/dist/client/client.d.ts
CHANGED
|
@@ -11,6 +11,25 @@ export interface RequestOptions {
|
|
|
11
11
|
/** False for calls that establish or end the session (sign-in, `/auth/me`), where a 401 is an answer, not an expiry. Default true. */
|
|
12
12
|
handleUnauthorized?: boolean;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Options of `download` and `stream`: those of the JSON calls plus the `Accept` header (default: any type) and, for
|
|
16
|
+
* `POST`, a body encoded like the body of `post`. A body without `method: "POST"` does not compile.
|
|
17
|
+
*/
|
|
18
|
+
export type RawRequestOptions = RequestOptions & {
|
|
19
|
+
accept?: string;
|
|
20
|
+
} & ({
|
|
21
|
+
method?: "GET";
|
|
22
|
+
body?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
method: "POST";
|
|
25
|
+
body?: unknown;
|
|
26
|
+
});
|
|
27
|
+
/** A file the server answered: the bytes, the name its `Content-Disposition` proposes (RFC 6266; null when it proposes none) and the exchange's request id. */
|
|
28
|
+
export interface DownloadResult {
|
|
29
|
+
blob: Blob;
|
|
30
|
+
filename: string | null;
|
|
31
|
+
requestId: string | null;
|
|
32
|
+
}
|
|
14
33
|
/** What `onUnauthorized` decides: send the request once more (the session was renewed) or let the 401 fail. */
|
|
15
34
|
export type UnauthorizedDecision = "retry" | "fail";
|
|
16
35
|
export interface UnauthorizedContext {
|
|
@@ -52,6 +71,20 @@ export interface HttpClient {
|
|
|
52
71
|
put<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
53
72
|
patch<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
54
73
|
delete<TData = unknown, TMeta = unknown>(path: string, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
74
|
+
/**
|
|
75
|
+
* Fetches a file. Base URL, credentials, `headers()`, `X-Request-ID`, abort and the single 401 renew-and-retry are those of
|
|
76
|
+
* `get`; `Accept` accepts any type unless `options.accept` says otherwise. A non-2xx answer throws the same `ApiError` a JSON call
|
|
77
|
+
* would (its `code`, `fields` and `params` come from the JSON error body), so the caller words a failed download like any failure.
|
|
78
|
+
* The whole body is read before this resolves.
|
|
79
|
+
*/
|
|
80
|
+
download(path: string, options?: RawRequestOptions): Promise<DownloadResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Opens a long-lived answer (server-sent events, a streamed file) and resolves with the raw `Response` as soon as its headers
|
|
83
|
+
* are in, body unread: read `response.body`, and pass `options.signal` to end it. Headers, credentials, request id and the 401
|
|
84
|
+
* retry are those of `download`; a non-2xx answer throws an `ApiError`. Once it has resolved, a read that fails or is cancelled
|
|
85
|
+
* rejects with the platform's own error, not an `ApiError`.
|
|
86
|
+
*/
|
|
87
|
+
stream(path: string, options?: RawRequestOptions): Promise<Response>;
|
|
55
88
|
/**
|
|
56
89
|
* The `X-Request-ID`s of the last requests this client got an answer to or failed to reach (the server's id, else the one sent),
|
|
57
90
|
* oldest first, at most `RECENT_REQUEST_IDS`: what a bug report quotes so the server's log can be found. A cancelled request leaves none.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file name of a `Content-Disposition` header (RFC 6266): `filename*=` (RFC 8187, UTF-8 or ISO-8859-1) wins over
|
|
3
|
+
* `filename=`, quotes and backslash escapes are handled, a directory part is dropped. Null when the header has no usable name.
|
|
4
|
+
*/
|
|
5
|
+
export declare function filenameFromDisposition(header: string | null): string | null;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createHttpClient, RECENT_REQUEST_IDS } from "./client";
|
|
2
|
-
export type { HttpClient, RouteResult, HttpClientOptions, RequestOptions, UnauthorizedContext, UnauthorizedDecision } from "./client";
|
|
2
|
+
export type { HttpClient, RouteResult, HttpClientOptions, RequestOptions, RawRequestOptions, DownloadResult, UnauthorizedContext, UnauthorizedDecision } from "./client";
|
|
3
3
|
export type { QueryValue } from "./encode";
|
|
4
4
|
export { REQUEST_ID_HEADER } from "./envelope";
|
|
5
5
|
export type { ApiResult } from "./envelope";
|
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as p, a as o, c as u, f as E } from "../client-
|
|
1
|
+
import { R as p, a as o, c as u, f as E } from "../client-Dr2vV3qH.js";
|
|
2
2
|
import { A as n, a as f, i as l } from "../error-Bb_dr_Ay.js";
|
|
3
3
|
function s(e, i, r = {}) {
|
|
4
4
|
return { method: e, path: i, permission: r.permission, public: r.public === !0, raw: !1 };
|