@wssto2/vue-core 0.4.12 → 0.4.14
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/{Activity-DdnEG7EW.js → Activity-BdSvn0GP.js} +3 -3
- package/dist/{Changes-CBM8york.js → Changes-BQO--N9F.js} +3 -3
- package/dist/{DeadLetters-DBUALYXL.js → DeadLetters-OmeiADEi.js} +3 -3
- package/dist/{General-Cvb-tLsE.js → General-CBwFLiKQ.js} +3 -3
- package/dist/{NewRolePage-Dm7urTx0.js → NewRolePage-CblUW2gA.js} +3 -3
- package/dist/{ProfilePage-B1-66cXB.js → ProfilePage-BOoDDbmB.js} +3 -3
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CDZjkiU5.js → RoleEditor.vue_vue_type_script_setup_true_lang-BCE5yrwy.js} +1 -1
- package/dist/{RolePage-CQc_wV3b.js → RolePage-xDsFL_eC.js} +4 -4
- package/dist/{RolesPage-CG7InZ_u.js → RolesPage-C39wsF6X.js} +2 -2
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-ROl9_pdO.js → SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js} +102 -102
- package/dist/{Sessions-CIVLL9X4.js → Sessions-m_i4aTfw.js} +3 -3
- package/dist/{SettingsPage-BNdeH-_0.js → SettingsPage-ktKvQQnE.js} +3 -3
- package/dist/{SignIn-B8FbIWMH.js → SignIn-CkoEixY4.js} +3 -3
- package/dist/{SignInPage-DIo9fK1d.js → SignInPage-DVcpFz3G.js} +1 -1
- package/dist/{SignIns-nH3zghoi.js → SignIns-BnVAtncZ.js} +3 -3
- package/dist/{UserRecord-DVm0mIrA.js → UserRecord-Cg69_mbU.js} +7 -7
- package/dist/{UsersList-C3cNr0MI.js → UsersList-BFmBDGs7.js} +3 -3
- package/dist/access/index.js +1 -1
- package/dist/app/application.d.ts +7 -0
- package/dist/app/index.js +143 -142
- package/dist/{describeError-Ctga6GcS.js → describeError-CvGmajU0.js} +20 -13
- package/dist/{fieldMessages-C3Rpbktw.js → fieldMessages-D_dpSe19.js} +1 -1
- package/dist/i18n/describeError.d.ts +11 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +7 -6
- package/dist/identity/index.js +1 -1
- package/dist/{index-Cz4LtYKa.js → index-B416VXmR.js} +2 -2
- package/dist/{index-BesWsiIg.js → index-KcCoCfr-.js} +5 -5
- package/dist/{index-CM_Uh_xF.js → index-RNF5-9uf.js} +12 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/page/SectionNavigator.vue.d.ts +5 -4
- package/dist/page/index.js +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/resource/resource.d.ts +1 -1
- package/dist/{routeResource-DstM0hvf.js → routeResource-BwEFXzIX.js} +36 -32
- package/dist/state/index.js +1 -1
- package/dist/state/useLoad.d.ts +7 -0
- package/dist/{status-cZWwrYGN.js → status-OZUHZpWl.js} +1 -1
- package/dist/useLoad-DuEsLECT.js +43 -0
- package/package.json +1 -1
- package/dist/useLoad-CYRVx6HW.js +0 -39
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as g, ref as m, watch as p, openBlock as c, createElementBlock as v, createVNode as i, unref as e, withCtx as w, createBlock as x, createCommentVNode as y, createElementVNode as V, toDisplayString as $ } from "vue";
|
|
2
2
|
import { useI18n as N } from "vue-i18n";
|
|
3
|
-
import { P as S, i as b } from "./index-
|
|
3
|
+
import { P as S, i as b } from "./index-RNF5-9uf.js";
|
|
4
4
|
import { u as k } from "./platform-q3cjODLx.js";
|
|
5
|
-
import { b as I } from "./routeResource-
|
|
5
|
+
import { b as I } from "./routeResource-BwEFXzIX.js";
|
|
6
6
|
import { _ as R } from "./AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js";
|
|
7
|
-
import { u as C } from "./useLoad-
|
|
7
|
+
import { u as C } from "./useLoad-DuEsLECT.js";
|
|
8
8
|
import { _ as E } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
|
|
9
9
|
import { _ as B } from "./SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js";
|
|
10
10
|
import { _ as P } from "./SignInTable.vue_vue_type_script_setup_true_lang-CIv34nRn.js";
|
|
@@ -2,23 +2,23 @@ import { defineComponent as R, openBlock as q, createBlock as P, unref as e, wit
|
|
|
2
2
|
import { useI18n as A } from "vue-i18n";
|
|
3
3
|
import { a as F } from "./neighbors-DVN_cADL.js";
|
|
4
4
|
import { _ as H } from "./Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js";
|
|
5
|
-
import { u as J } from "./describeError-
|
|
6
|
-
import { i as w, P as Q, p as W, f as X, M as Y, g as Z, d as ee } from "./index-
|
|
5
|
+
import { u as J } from "./describeError-CvGmajU0.js";
|
|
6
|
+
import { i as w, P as Q, p as W, f as X, M as Y, g as Z, d as ee } from "./index-RNF5-9uf.js";
|
|
7
7
|
import { _ as se } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
|
|
8
8
|
import { t as k } from "./toast-CqSDTWRX.js";
|
|
9
|
-
import { _ as ae } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as ae } from "./SectionNavigator.vue_vue_type_script_setup_true_lang-D5Cnb4_O.js";
|
|
10
10
|
import { u as E } from "./platform-q3cjODLx.js";
|
|
11
|
-
import { a as te } from "./routeResource-
|
|
11
|
+
import { a as te } from "./routeResource-BwEFXzIX.js";
|
|
12
12
|
import { a as oe } from "./ResourcePage.vue_vue_type_script_setup_true_lang-Da0M-hen.js";
|
|
13
13
|
import { A as re } from "./access-DmAceEo5.js";
|
|
14
14
|
import { _ as ne } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
15
|
-
import { u as ie } from "./useLoad-
|
|
15
|
+
import { u as ie } from "./useLoad-DuEsLECT.js";
|
|
16
16
|
import { _ as V } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
17
17
|
import { _ as T } from "./FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js";
|
|
18
18
|
import { e as B } from "./control-7EP4tjYy.js";
|
|
19
19
|
import { u as z, _ as K } from "./useCommand-BkONMn3X.js";
|
|
20
|
-
import { u as U } from "./fieldMessages-
|
|
21
|
-
import { u as ce, s as le } from "./status-
|
|
20
|
+
import { u as U } from "./fieldMessages-D_dpSe19.js";
|
|
21
|
+
import { u as ce, s as le } from "./status-OZUHZpWl.js";
|
|
22
22
|
import { _ as M } from "./TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js";
|
|
23
23
|
const ue = /* @__PURE__ */ R({
|
|
24
24
|
__name: "DeactivateDialog",
|
|
@@ -6,8 +6,8 @@ import { _ as I } from "./Avatar.vue_vue_type_script_setup_true_lang-CFIheaSr.js
|
|
|
6
6
|
import { u as F } from "./format-B8mJm946.js";
|
|
7
7
|
import { u as L } from "./platform-q3cjODLx.js";
|
|
8
8
|
import { _ as G } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
9
|
-
import { i as K, f as E, M as W } from "./index-
|
|
10
|
-
import { U as j, u as H, s as J } from "./status-
|
|
9
|
+
import { i as K, f as E, M as W } from "./index-RNF5-9uf.js";
|
|
10
|
+
import { U as j, u as H, s as J } from "./status-OZUHZpWl.js";
|
|
11
11
|
import { u as O } from "./environment-Dva-SG8D.js";
|
|
12
12
|
import { u as Q } from "./languages-BShG9LpE.js";
|
|
13
13
|
import { _ as X } from "./FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js";
|
|
@@ -15,7 +15,7 @@ import { _ as Y } from "./SelectField.vue_vue_type_script_setup_true_lang-BJoAkB
|
|
|
15
15
|
import { _ as d } from "./TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js";
|
|
16
16
|
import { u as Z, _ as ee } from "./useCommand-BkONMn3X.js";
|
|
17
17
|
import { t as se } from "./toast-CqSDTWRX.js";
|
|
18
|
-
import { u as te } from "./fieldMessages-
|
|
18
|
+
import { u as te } from "./fieldMessages-D_dpSe19.js";
|
|
19
19
|
const oe = /* @__PURE__ */ U({
|
|
20
20
|
__name: "NewUserDialog",
|
|
21
21
|
emits: ["created"],
|
package/dist/access/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as a, i as c, j as o, c as r, b as n, k as i, l as u, p as l, m as p, n as t, u as d, f as m } from "../index-
|
|
1
|
+
import { _ as a, i as c, j as o, c as r, b as n, k as i, l as u, p as l, m as p, n as t, u as d, f as m } from "../index-KcCoCfr-.js";
|
|
2
2
|
export {
|
|
3
3
|
a as BindingRow,
|
|
4
4
|
c as PersonAccess,
|
|
@@ -7,6 +7,7 @@ import { type IconSet } from "../icon";
|
|
|
7
7
|
import { type Platform, type SessionSnapshot } from "../platform";
|
|
8
8
|
import type { NavigationCatalogue } from "../router/navigation";
|
|
9
9
|
import { type ApplicationEnvironment } from "./environment";
|
|
10
|
+
import { type AppErrorDescriber } from "../i18n/describeError";
|
|
10
11
|
import type { Feature, ShellSlot } from "./feature";
|
|
11
12
|
/** A shell that says which slots it renders, so a contribution to a slot it lacks fails at startup instead of vanishing. */
|
|
12
13
|
export interface ShellDefinition {
|
|
@@ -93,6 +94,12 @@ export interface ApplicationOptions {
|
|
|
93
94
|
noAccess?: Component;
|
|
94
95
|
/** Identifies a session for session effects: they restart when it changes. Default: the user's id. */
|
|
95
96
|
sessionKey?: (session: SessionSnapshot) => string;
|
|
97
|
+
/**
|
|
98
|
+
* The application's own sentence for an error, asked before the library's own (`useDescribeError`, the default
|
|
99
|
+
* failure text of `useLoad` and `useResource`): for error types the library does not know, such as an older HTTP
|
|
100
|
+
* client's. Return `undefined` to leave an error to the library.
|
|
101
|
+
*/
|
|
102
|
+
describeError?: AppErrorDescriber;
|
|
96
103
|
/** Called with every error the application catches (component errors, unhandled rejections, failed effects and loads). Default: `console.error`. */
|
|
97
104
|
onError?: (report: ApplicationErrorReport) => void;
|
|
98
105
|
}
|
package/dist/app/index.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Z = (e,
|
|
4
|
-
import { effectScope as W, watch as B, defineComponent as
|
|
1
|
+
var xe = Object.defineProperty;
|
|
2
|
+
var Se = (e, n, r) => n in e ? xe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
|
|
3
|
+
var Z = (e, n, r) => Se(e, typeof n != "symbol" ? n + "" : n, r);
|
|
4
|
+
import { effectScope as W, watch as B, defineComponent as de, openBlock as Re, createElementBlock as Me, createVNode as ee, unref as C, withCtx as te, createTextVNode as Ae, toDisplayString as je, shallowRef as Le, computed as Ne, h as se, createApp as Ke } from "vue";
|
|
5
5
|
import { useI18n as Oe, createI18n as Ce } from "vue-i18n";
|
|
6
|
-
import { createRouter as
|
|
7
|
-
import { i as
|
|
8
|
-
import { c as
|
|
9
|
-
import { coreMessages as oe, createMessageRuntime as
|
|
10
|
-
import { i as
|
|
11
|
-
import { i as
|
|
12
|
-
import { i as
|
|
13
|
-
import { i as
|
|
14
|
-
import { c as
|
|
15
|
-
import { c as
|
|
16
|
-
import { i as
|
|
17
|
-
import { b as
|
|
18
|
-
import { c as
|
|
19
|
-
import { S as
|
|
6
|
+
import { createRouter as _e, isNavigationFailure as Ie } from "vue-router";
|
|
7
|
+
import { i as Fe } from "../leaveGuard-Cc8yeLxM.js";
|
|
8
|
+
import { c as Te, i as qe, f as Pe } from "../format-B8mJm946.js";
|
|
9
|
+
import { coreMessages as oe, createMessageRuntime as We } from "../i18n/index.js";
|
|
10
|
+
import { i as Be, a as De } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
11
|
+
import { i as He, b as Ve } from "../bottomDock-BZEiOPYZ.js";
|
|
12
|
+
import { i as Ge, p as Je } from "../chrome-nUcmVu8G.js";
|
|
13
|
+
import { i as ze, g as Qe } from "../platform-q3cjODLx.js";
|
|
14
|
+
import { c as Ue, A as Xe, r as re } from "../access-DmAceEo5.js";
|
|
15
|
+
import { c as Ye, _ as Ze } from "../NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js";
|
|
16
|
+
import { i as et } from "../guards-Dve61KjR.js";
|
|
17
|
+
import { b as tt, c as st, n as ae } from "../navigation-Cm3iChlR.js";
|
|
18
|
+
import { c as ot, s as ne } from "../contributions-DsfmDoRD.js";
|
|
19
|
+
import { S as Pt } from "../contributions-DsfmDoRD.js";
|
|
20
20
|
import { a as ie } from "../environment-Dva-SG8D.js";
|
|
21
|
-
import { u as
|
|
22
|
-
import {
|
|
23
|
-
import { _ as rt } from "../
|
|
21
|
+
import { u as Bt } from "../environment-Dva-SG8D.js";
|
|
22
|
+
import { b as ce } from "../describeError-CvGmajU0.js";
|
|
23
|
+
import { _ as rt } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
24
|
+
import { _ as at } from "../EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js";
|
|
24
25
|
import { i as nt } from "../feature-DdUAfyi4.js";
|
|
25
|
-
import { d as
|
|
26
|
-
import { k as
|
|
27
|
-
function
|
|
28
|
-
const { platform:
|
|
26
|
+
import { d as Ht, p as Vt } from "../feature-DdUAfyi4.js";
|
|
27
|
+
import { k as Jt } from "../keepAlive-CDvMQlcJ.js";
|
|
28
|
+
function it(e) {
|
|
29
|
+
const { platform: n } = e, r = W();
|
|
29
30
|
let i = null, w = null, v = !1;
|
|
30
|
-
function
|
|
31
|
+
function E(l, m) {
|
|
31
32
|
const h = new AbortController(), u = { controller: h, stops: [] };
|
|
32
|
-
for (const
|
|
33
|
+
for (const k of l)
|
|
33
34
|
try {
|
|
34
|
-
const $ = m(
|
|
35
|
-
typeof $ == "function" && u.stops.push({ owned:
|
|
35
|
+
const $ = m(k, h.signal);
|
|
36
|
+
typeof $ == "function" && u.stops.push({ owned: k, stop: $ });
|
|
36
37
|
} catch ($) {
|
|
37
|
-
e.onError($,
|
|
38
|
+
e.onError($, k);
|
|
38
39
|
}
|
|
39
40
|
return u;
|
|
40
41
|
}
|
|
@@ -53,20 +54,20 @@ function at(e) {
|
|
|
53
54
|
return {
|
|
54
55
|
start() {
|
|
55
56
|
if (v || i) return;
|
|
56
|
-
i =
|
|
57
|
+
i = E(
|
|
57
58
|
j("app"),
|
|
58
|
-
(m, h) => m.effect.start({ signal: h, platform:
|
|
59
|
+
(m, h) => m.effect.start({ signal: h, platform: n, report: (u) => e.onError(u, m) })
|
|
59
60
|
);
|
|
60
61
|
const l = j("session");
|
|
61
62
|
r.run(
|
|
62
63
|
() => B(
|
|
63
|
-
() => M(
|
|
64
|
+
() => M(n.session.state.value),
|
|
64
65
|
(m) => {
|
|
65
66
|
R(w), w = null;
|
|
66
|
-
const h =
|
|
67
|
-
m === null || h.status !== "authenticated" || (w =
|
|
67
|
+
const h = n.session.state.value;
|
|
68
|
+
m === null || h.status !== "authenticated" || (w = E(
|
|
68
69
|
l,
|
|
69
|
-
(u,
|
|
70
|
+
(u, k) => u.effect.start({ signal: k, platform: n, user: h.user, report: ($) => e.onError($, u) })
|
|
70
71
|
));
|
|
71
72
|
},
|
|
72
73
|
{ immediate: !0, flush: "sync" }
|
|
@@ -78,28 +79,28 @@ function at(e) {
|
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
|
-
const
|
|
82
|
+
const ct = { class: "mx-auto flex min-h-screen max-w-content items-center justify-center p-screen-padding" }, lt = /* @__PURE__ */ de({
|
|
82
83
|
__name: "StartupFailure",
|
|
83
84
|
props: {
|
|
84
85
|
kind: {}
|
|
85
86
|
},
|
|
86
87
|
emits: ["retry"],
|
|
87
88
|
setup(e) {
|
|
88
|
-
const { t:
|
|
89
|
-
return (r, i) => (
|
|
90
|
-
ee(
|
|
91
|
-
title:
|
|
92
|
-
description:
|
|
89
|
+
const { t: n } = Oe();
|
|
90
|
+
return (r, i) => (Re(), Me("div", ct, [
|
|
91
|
+
ee(C(at), {
|
|
92
|
+
title: C(n)("core.startup.title"),
|
|
93
|
+
description: C(n)(e.kind === "startup" ? "core.startup.other" : `core.startup.${e.kind}`),
|
|
93
94
|
icon: "errorWarningLine"
|
|
94
95
|
}, {
|
|
95
96
|
actions: te(() => [
|
|
96
|
-
ee(
|
|
97
|
+
ee(C(rt), {
|
|
97
98
|
prominence: "primary",
|
|
98
99
|
icon: "refreshLine",
|
|
99
100
|
onClick: i[0] || (i[0] = (w) => r.$emit("retry"))
|
|
100
101
|
}, {
|
|
101
102
|
default: te(() => [
|
|
102
|
-
|
|
103
|
+
Ae(je(C(n)("core.actions.retry")), 1)
|
|
103
104
|
]),
|
|
104
105
|
_: 1
|
|
105
106
|
})
|
|
@@ -109,7 +110,7 @@ const it = { class: "mx-auto flex min-h-screen max-w-content items-center justif
|
|
|
109
110
|
]));
|
|
110
111
|
}
|
|
111
112
|
});
|
|
112
|
-
class
|
|
113
|
+
class le extends Error {
|
|
113
114
|
constructor(r) {
|
|
114
115
|
super(`The application composition is invalid:
|
|
115
116
|
${r.map((i) => ` - [${i.owner}] ${i.message}`).join(`
|
|
@@ -118,17 +119,17 @@ ${r.map((i) => ` - [${i.owner}] ${i.message}`).join(`
|
|
|
118
119
|
this.name = "ApplicationError", this.issues = r;
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
|
-
const
|
|
122
|
-
function* D(e,
|
|
122
|
+
const ue = "application", g = (e) => `feature "${e.id}"`;
|
|
123
|
+
function* D(e, n = "") {
|
|
123
124
|
for (const r of e) {
|
|
124
|
-
const i = r.path.startsWith("/") ? r.path : `${
|
|
125
|
+
const i = r.path.startsWith("/") ? r.path : `${n.replace(/\/$/, "")}/${r.path}`;
|
|
125
126
|
yield { record: r, path: i }, r.children && (yield* D(r.children, i));
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
const
|
|
129
|
+
function ut(e) {
|
|
130
|
+
const n = [], r = (o, s) => n.push({ owner: o, message: s }), i = [];
|
|
130
131
|
e.features.forEach((o, s) => {
|
|
131
|
-
nt(o) ? i.push(o) : r(
|
|
132
|
+
nt(o) ? i.push(o) : r(ue, `features[${s}] was not created with defineFeature().`);
|
|
132
133
|
});
|
|
133
134
|
const w = /* @__PURE__ */ new Map();
|
|
134
135
|
for (const o of i)
|
|
@@ -136,11 +137,11 @@ function lt(e) {
|
|
|
136
137
|
for (const o of i)
|
|
137
138
|
for (const s of o.requires)
|
|
138
139
|
w.has(s) || r(g(o), `requires the feature "${s}", which is not in the features list.`);
|
|
139
|
-
const v = [],
|
|
140
|
-
if (
|
|
140
|
+
const v = [], E = /* @__PURE__ */ new Set(), R = (o) => {
|
|
141
|
+
if (E.has(o.id)) return;
|
|
141
142
|
const s = v.indexOf(o.id);
|
|
142
143
|
if (s !== -1) {
|
|
143
|
-
r(g(o), `requirements form a cycle: ${[...v.slice(s), o.id].join(" -> ")}.`),
|
|
144
|
+
r(g(o), `requirements form a cycle: ${[...v.slice(s), o.id].join(" -> ")}.`), E.add(o.id);
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
147
|
v.push(o.id);
|
|
@@ -148,7 +149,7 @@ function lt(e) {
|
|
|
148
149
|
const d = w.get(c);
|
|
149
150
|
d && R(d);
|
|
150
151
|
}
|
|
151
|
-
v.pop(),
|
|
152
|
+
v.pop(), E.add(o.id);
|
|
152
153
|
};
|
|
153
154
|
i.forEach(R);
|
|
154
155
|
const j = new Set(e.platform.config.capabilities);
|
|
@@ -175,7 +176,7 @@ function lt(e) {
|
|
|
175
176
|
const d = h.get(s);
|
|
176
177
|
d ? r(g(o), `provides the context "${c}", which feature "${d.id}" provides too.`) : h.set(s, o);
|
|
177
178
|
}
|
|
178
|
-
const u = /* @__PURE__ */ new Map(),
|
|
179
|
+
const u = /* @__PURE__ */ new Map(), k = (o, s) => {
|
|
179
180
|
for (const c of s) {
|
|
180
181
|
const d = u.get(c.namespace);
|
|
181
182
|
d ? r(o, `declares the message namespace "${c.namespace}", which ${d} declares too.`) : u.set(c.namespace, o);
|
|
@@ -183,8 +184,8 @@ function lt(e) {
|
|
|
183
184
|
e.supportedLocales.includes(L) || r(o, `the namespace "${c.namespace}" has a loader for "${L}", which is not a supported locale (${e.supportedLocales.join(", ")}).`);
|
|
184
185
|
}
|
|
185
186
|
};
|
|
186
|
-
for (const o of i)
|
|
187
|
-
|
|
187
|
+
for (const o of i) k(g(o), o.messages);
|
|
188
|
+
k(ue, e.messages);
|
|
188
189
|
const $ = (o) => u.has(o);
|
|
189
190
|
for (const o of i)
|
|
190
191
|
for (const { record: s } of D(o.routes))
|
|
@@ -206,150 +207,150 @@ function lt(e) {
|
|
|
206
207
|
const d = s.scope;
|
|
207
208
|
d !== "app" && d !== "session" && r(g(o), `the effect "${s.id}" has the scope "${d}"; use "app" or "session".`);
|
|
208
209
|
}
|
|
209
|
-
return { features: i, issues:
|
|
210
|
+
return { features: i, issues: n };
|
|
210
211
|
}
|
|
211
|
-
const
|
|
212
|
+
const ft = (e, n, r) => Ce({
|
|
212
213
|
legacy: !1,
|
|
213
214
|
locale: e,
|
|
214
|
-
fallbackLocale:
|
|
215
|
+
fallbackLocale: n,
|
|
215
216
|
pluralRules: r?.pluralRules && { ...r.pluralRules },
|
|
216
217
|
...r?.missingWarn === !1 && { missingWarn: !1, fallbackWarn: !1 },
|
|
217
218
|
messages: {}
|
|
218
|
-
}),
|
|
219
|
-
function
|
|
219
|
+
}), dt = (e) => typeof e == "object" && e !== null && "component" in e && "slots" in e;
|
|
220
|
+
function pe(e, n) {
|
|
220
221
|
return e.map((r) => ({
|
|
221
222
|
...r,
|
|
222
|
-
meta: { ...r.meta, feature:
|
|
223
|
-
...r.children && { children:
|
|
223
|
+
meta: { ...r.meta, feature: n },
|
|
224
|
+
...r.children && { children: pe(r.children, n) }
|
|
224
225
|
}));
|
|
225
226
|
}
|
|
226
|
-
const
|
|
227
|
-
function
|
|
228
|
-
const { platform:
|
|
227
|
+
const fe = (e) => [...new Set(e)];
|
|
228
|
+
function Ft(e) {
|
|
229
|
+
const { platform: n } = e, r = e.locale?.supported ?? Object.keys(oe), i = e.locale?.fallback ?? "en", w = e.shell === void 0 ? void 0 : dt(e.shell) ? e.shell : { component: e.shell, slots: void 0, progress: void 0 }, v = [];
|
|
229
230
|
r.includes(i) || v.push({ owner: "application", message: `the fallback locale "${i}" is not among the supported locales (${r.join(", ")}).` });
|
|
230
231
|
for (const t of Object.keys(e.locale?.flags ?? {}))
|
|
231
232
|
r.includes(t) || v.push({ owner: "application", message: `locale.flags names the locale "${t}", which is not among the supported locales (${r.join(", ")}).` });
|
|
232
|
-
const
|
|
233
|
-
r.includes(
|
|
234
|
-
const R = [
|
|
233
|
+
const E = e.locale?.initial ?? (r.includes(n.config.locale) ? n.config.locale : i);
|
|
234
|
+
r.includes(E) || v.push({ owner: "application", message: `the initial locale "${E}" is not among the supported locales (${r.join(", ")}).` });
|
|
235
|
+
const R = [Qe, Pe, Je, Ve, De, ae, ne, re, ie, ce], j = ut({
|
|
235
236
|
features: e.features,
|
|
236
|
-
platform:
|
|
237
|
+
platform: n,
|
|
237
238
|
messages: e.messages ?? [],
|
|
238
239
|
reservedContexts: R,
|
|
239
240
|
supportedLocales: r,
|
|
240
241
|
shellSlots: w?.slots
|
|
241
|
-
}), M = [...v, ...j.issues], l = j.features, m =
|
|
242
|
-
l.flatMap((t) => t.navigation.map((
|
|
242
|
+
}), M = [...v, ...j.issues], l = j.features, m = tt(
|
|
243
|
+
l.flatMap((t) => t.navigation.map((a) => ({ feature: t.id, binding: a }))),
|
|
243
244
|
e.navigation
|
|
244
245
|
);
|
|
245
246
|
for (const t of m.issues) M.push({ owner: "navigation", message: t });
|
|
246
|
-
if (M.length > 0) throw new
|
|
247
|
-
const h =
|
|
248
|
-
for (const [t,
|
|
249
|
-
for (const [t,
|
|
250
|
-
const
|
|
247
|
+
if (M.length > 0) throw new le(M);
|
|
248
|
+
const h = ft(E, i, e.i18n), u = h.global;
|
|
249
|
+
for (const [t, a] of Object.entries(oe)) u.mergeLocaleMessage(t, a);
|
|
250
|
+
for (const [t, a] of Object.entries(e.i18n?.messages ?? {})) u.mergeLocaleMessage(t, a);
|
|
251
|
+
const k = Te({ locale: () => u.locale.value, formatters: e.formatting }), $ = [...l.flatMap((t) => t.messages), ...e.messages ?? []], x = (t) => (e.onError ?? pt)({ ...t, route: s.currentRoute.value.matched.length > 0 ? s.currentRoute.value.fullPath : null }), A = We({
|
|
251
252
|
target: u,
|
|
252
253
|
namespaces: $,
|
|
253
254
|
fallback: i,
|
|
254
255
|
supported: r,
|
|
255
256
|
onFailure: (t) => x({ source: "messages", error: t.error, detail: `${t.namespace} (${t.locale})`, feature: o.get(t.namespace) })
|
|
256
|
-
}), o = new Map(l.flatMap((t) => t.messages.map((
|
|
257
|
-
history: e.router?.history ??
|
|
258
|
-
routes: l.flatMap((t) =>
|
|
259
|
-
scrollBehavior: e.router?.scrollBehavior ?? ((t,
|
|
257
|
+
}), o = new Map(l.flatMap((t) => t.messages.map((a) => [a.namespace, t.id]))), s = _e({
|
|
258
|
+
history: e.router?.history ?? Ye(),
|
|
259
|
+
routes: l.flatMap((t) => pe(t.routes, t.id)),
|
|
260
|
+
scrollBehavior: e.router?.scrollBehavior ?? ((t, a) => t.name === a.name ? !1 : { top: 0 })
|
|
260
261
|
}), c = e.router?.login ?? { name: "login" }, d = e.router?.home ?? { path: "/" }, L = [], H = (t) => {
|
|
261
262
|
try {
|
|
262
263
|
return s.resolve(t).matched.length > 0 ? null : "matches no route";
|
|
263
|
-
} catch (
|
|
264
|
-
const f =
|
|
264
|
+
} catch (a) {
|
|
265
|
+
const f = a instanceof Error ? a.message : String(a);
|
|
265
266
|
return f.startsWith("No match for") ? "matches no route" : `cannot be resolved (${f})`;
|
|
266
267
|
}
|
|
267
268
|
};
|
|
268
|
-
if (l.some((t) => t.routes.some((
|
|
269
|
+
if (l.some((t) => t.routes.some((a) => a.meta?.public !== !0))) {
|
|
269
270
|
const t = H(c) ?? (s.resolve(c).meta.public === !0 ? null : "is not public (meta.public: true)");
|
|
270
271
|
t && L.push({ owner: "application", message: `the login route ${JSON.stringify(c)} ${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.` });
|
|
271
272
|
}
|
|
272
|
-
for (const { feature: t, binding:
|
|
273
|
-
const f = H(
|
|
274
|
-
f && L.push({ owner: `feature "${t}"`, message: `the destination "${
|
|
273
|
+
for (const { feature: t, binding: a } of m.destinations.values()) {
|
|
274
|
+
const f = H(a.to);
|
|
275
|
+
f && L.push({ owner: `feature "${t}"`, message: `the destination "${a.destination}" is bound to ${JSON.stringify(a.to)}, which ${f}.` });
|
|
275
276
|
}
|
|
276
|
-
if (L.length > 0) throw new
|
|
277
|
-
const N =
|
|
277
|
+
if (L.length > 0) throw new le(L);
|
|
278
|
+
const N = Le({ status: "idle" }), I = {
|
|
278
279
|
state: N,
|
|
279
|
-
locale:
|
|
280
|
+
locale: Ne(() => u.locale.value),
|
|
280
281
|
locales: r,
|
|
281
282
|
localeFlags: e.locale?.flags ?? {},
|
|
282
283
|
setLocale: async (t) => {
|
|
283
|
-
const
|
|
284
|
-
if (f && u.locale.value !==
|
|
285
|
-
const b = (
|
|
284
|
+
const a = u.locale.value, f = await A.setLocale(t);
|
|
285
|
+
if (f && u.locale.value !== a) {
|
|
286
|
+
const b = (O) => x({ source: "locale", error: O, detail: t });
|
|
286
287
|
try {
|
|
287
288
|
Promise.resolve(e.locale?.onChange?.(t)).catch(b);
|
|
288
|
-
} catch (
|
|
289
|
-
b(
|
|
289
|
+
} catch (O) {
|
|
290
|
+
b(O);
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
return f;
|
|
293
294
|
},
|
|
294
295
|
retry: () => P()
|
|
295
296
|
}, F = {
|
|
296
|
-
contributions: l.flatMap((t) => t.contributions.map((
|
|
297
|
-
effects: l.flatMap((t) => t.effects.map((
|
|
298
|
-
}, V =
|
|
297
|
+
contributions: l.flatMap((t) => t.contributions.map((a) => ({ feature: t.id, contribution: a }))),
|
|
298
|
+
effects: l.flatMap((t) => t.effects.map((a) => ({ feature: t.id, effect: a })))
|
|
299
|
+
}, V = it({
|
|
299
300
|
effects: F.effects,
|
|
300
|
-
platform:
|
|
301
|
+
platform: n,
|
|
301
302
|
sessionKey: e.sessionKey,
|
|
302
|
-
onError: (t,
|
|
303
|
-
}),
|
|
304
|
-
async function
|
|
305
|
-
const
|
|
306
|
-
await A.load(
|
|
303
|
+
onError: (t, a) => x({ source: "effect", error: t, feature: a.feature, detail: a.effect.id })
|
|
304
|
+
}), me = new Map(l.map((t) => [t.id, t.messages.map((a) => a.namespace)])), G = (t) => fe(F.contributions.filter(({ contribution: a }) => a.scope === t).flatMap(({ contribution: a }) => a.messages ?? [])), he = G("always"), ge = G("authenticated");
|
|
305
|
+
async function we(t) {
|
|
306
|
+
const a = t.matched.flatMap((b) => [...me.get(b.meta.feature ?? "") ?? [], ...b.meta.messages ?? []]), f = n.session.state.value.status === "authenticated";
|
|
307
|
+
await A.load(fe([...a, ...he, ...f ? ge : []]));
|
|
307
308
|
}
|
|
308
309
|
let T = null;
|
|
309
310
|
function q(t) {
|
|
310
|
-
const
|
|
311
|
+
const a = t.meta.titleKey, f = T?.documentTitle.value ?? (a && u.te(a) ? u.t(a) : null), b = (e.router?.documentTitle ?? mt)(f, n.config.appName);
|
|
311
312
|
b !== "" && (document.title = b);
|
|
312
313
|
}
|
|
313
|
-
const
|
|
314
|
+
const ve = st({ session: n.session, router: s, i18n: u, destinations: m.destinations }), ye = ot(F.contributions, n.session), $e = Ue({ router: s, access: n.access, noAccess: e.noAccess ?? Ze }), be = de({
|
|
314
315
|
name: "ApplicationRoot",
|
|
315
316
|
setup() {
|
|
316
317
|
return () => {
|
|
317
318
|
const t = N.value;
|
|
318
|
-
return t.status === "failed" ? se(
|
|
319
|
+
return t.status === "failed" ? se(lt, { kind: t.kind, onRetry: () => void P() }) : t.status !== "ready" ? null : se(w?.component ?? Xe);
|
|
319
320
|
};
|
|
320
321
|
}
|
|
321
|
-
}), p =
|
|
322
|
-
|
|
323
|
-
for (const t of l) for (const { key:
|
|
322
|
+
}), p = Ke(be);
|
|
323
|
+
ze(p, n), p.use(h), qe(p, k), T = Ge(p), He(p), Fe(p), e.icons && Be(p, ...Array.isArray(e.icons) ? e.icons : [e.icons]), p.provide(ie, I), e.describeError && p.provide(ce, e.describeError), p.provide(ae, ve), p.provide(ne, ye), p.provide(re, $e);
|
|
324
|
+
for (const t of l) for (const { key: a, value: f } of t.contexts) p.provide(a, f);
|
|
324
325
|
let S = !1, J = !1, z = !1, Q = !1;
|
|
325
|
-
const
|
|
326
|
-
function
|
|
326
|
+
const K = [];
|
|
327
|
+
function Ee() {
|
|
327
328
|
const t = p.config.errorHandler;
|
|
328
329
|
p.config.errorHandler = (y, ke, Y) => {
|
|
329
330
|
x({ source: "vue", error: y, detail: Y }), t?.(y, ke, Y);
|
|
330
331
|
};
|
|
331
|
-
const
|
|
332
|
+
const a = (y) => x({ source: "unhandledrejection", error: y.reason }), f = (y) => {
|
|
332
333
|
y.error && x({ source: "window", error: y.error });
|
|
333
334
|
};
|
|
334
|
-
window.addEventListener("unhandledrejection",
|
|
335
|
-
window.removeEventListener("unhandledrejection",
|
|
335
|
+
window.addEventListener("unhandledrejection", a), window.addEventListener("error", f), K.push(() => {
|
|
336
|
+
window.removeEventListener("unhandledrejection", a), window.removeEventListener("error", f);
|
|
336
337
|
});
|
|
337
338
|
const b = l.some((y) => y.holdsExpiredSession);
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
n.session.holdExpired(b), K.push(() => n.session.holdExpired(!1)), K.push(
|
|
340
|
+
et({
|
|
340
341
|
router: s,
|
|
341
|
-
session:
|
|
342
|
+
session: n.session,
|
|
342
343
|
login: c,
|
|
343
344
|
home: d,
|
|
344
345
|
holdExpired: b,
|
|
345
|
-
prepare:
|
|
346
|
+
prepare: we,
|
|
346
347
|
afterNavigation: q,
|
|
347
348
|
progress: e.router?.progress ?? w?.progress,
|
|
348
349
|
onError: (y) => x({ source: "router", error: y })
|
|
349
350
|
})
|
|
350
351
|
);
|
|
351
|
-
const
|
|
352
|
-
|
|
352
|
+
const O = W();
|
|
353
|
+
O.run(() => B(() => T?.documentTitle.value, () => q(s.currentRoute.value))), K.push(() => O.stop());
|
|
353
354
|
const X = W();
|
|
354
355
|
X.run(
|
|
355
356
|
() => B(
|
|
@@ -359,23 +360,23 @@ function _t(e) {
|
|
|
359
360
|
},
|
|
360
361
|
{ immediate: !0 }
|
|
361
362
|
)
|
|
362
|
-
),
|
|
363
|
+
), K.push(() => X.stop());
|
|
363
364
|
}
|
|
364
|
-
const _ = (t,
|
|
365
|
-
N.value = { status: "failed", kind: t, error:
|
|
365
|
+
const _ = (t, a) => {
|
|
366
|
+
N.value = { status: "failed", kind: t, error: a };
|
|
366
367
|
};
|
|
367
368
|
async function U() {
|
|
368
369
|
N.value = { status: "starting" };
|
|
369
|
-
const t = await
|
|
370
|
+
const t = await n.session.restore();
|
|
370
371
|
if (S) return;
|
|
371
372
|
if (t.status === "failed") return _("session", t.error);
|
|
372
|
-
const
|
|
373
|
+
const a = await A.loadEssential();
|
|
373
374
|
if (!S) {
|
|
374
|
-
if (
|
|
375
|
+
if (a.length > 0) return _("messages", a[0].error);
|
|
375
376
|
try {
|
|
376
377
|
const f = await s.replace(s.options.history.location);
|
|
377
378
|
if (S) return;
|
|
378
|
-
if (
|
|
379
|
+
if (Ie(f)) return _("startup", f);
|
|
379
380
|
} catch (f) {
|
|
380
381
|
S || _("startup", f);
|
|
381
382
|
return;
|
|
@@ -396,31 +397,31 @@ function _t(e) {
|
|
|
396
397
|
async mount(t) {
|
|
397
398
|
if (S) throw new Error("This application was disposed; create a new one with createApplication().");
|
|
398
399
|
if (J) throw new Error("This application is already mounted.");
|
|
399
|
-
J = !0,
|
|
400
|
+
J = !0, Ee(), await U(), !S && (p.mount(t), z = !0);
|
|
400
401
|
},
|
|
401
402
|
retry: P,
|
|
402
403
|
dispose() {
|
|
403
404
|
if (!S) {
|
|
404
405
|
S = !0, V.dispose(), A.dispose(), z && p.unmount();
|
|
405
|
-
for (const t of
|
|
406
|
+
for (const t of K.reverse()) t();
|
|
406
407
|
s.options.history.destroy();
|
|
407
408
|
}
|
|
408
409
|
}
|
|
409
410
|
};
|
|
410
411
|
}
|
|
411
|
-
function
|
|
412
|
+
function pt(e) {
|
|
412
413
|
console.error(`[vue-core] ${e.source}${e.feature ? ` (${e.feature})` : ""}${e.detail ? `: ${e.detail}` : ""}`, e.error);
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
-
return [e,
|
|
415
|
+
function mt(e, n) {
|
|
416
|
+
return [e, n].filter((r) => !!r).join(" · ");
|
|
416
417
|
}
|
|
417
418
|
export {
|
|
418
|
-
|
|
419
|
-
|
|
419
|
+
le as ApplicationError,
|
|
420
|
+
Pt as ShellOutlet,
|
|
420
421
|
ie as applicationKey,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
Ft as createApplication,
|
|
423
|
+
Ht as defineFeature,
|
|
424
|
+
Jt as keepSessionAlive,
|
|
425
|
+
Vt as provideContext,
|
|
426
|
+
Bt as useApplication
|
|
426
427
|
};
|