@alfakit/vue 0.1.12 → 0.1.13
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 +6 -0
- package/dist/AlfakitRoot.vue.d.ts.map +1 -1
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js +47 -40
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/eject-manifest.json +2 -2
- package/dist/lib/discovery.d.ts.map +1 -1
- package/dist/lib/discovery.js +15 -14
- package/dist/lib/discovery.js.map +1 -1
- package/dist/lib/hydration.d.ts +15 -0
- package/dist/lib/hydration.d.ts.map +1 -1
- package/dist/lib/hydration.js +22 -8
- package/dist/lib/hydration.js.map +1 -1
- package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +34 -30
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/runtime.d.ts +1 -3
- package/dist/standalone/runtime.d.ts.map +1 -1
- package/dist/standalone/runtime.js +26 -34
- package/dist/standalone/runtime.js.map +1 -1
- package/dist/standalone/toaster-claims.d.ts +4 -0
- package/dist/standalone/toaster-claims.d.ts.map +1 -0
- package/dist/standalone/toaster-claims.js +14 -0
- package/dist/standalone/toaster-claims.js.map +1 -0
- package/dist/starter-kit/widgets/WidgetShell.vue.d.ts +2 -2
- package/dist/starter-kit/widgets/WidgetShell.vue.d.ts.map +1 -1
- package/dist/starter-kit/widgets/WidgetShell.vue_vue_type_script_setup_true_lang.js +50 -18
- package/dist/starter-kit/widgets/WidgetShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/package.json +2 -2
- package/src/AlfakitRoot.vue +16 -1
- package/src/lib/discovery.ts +6 -0
- package/src/lib/hydration.ts +38 -2
- package/src/standalone/AlfakitComponent.vue +4 -0
- package/src/standalone/runtime.ts +2 -14
- package/src/standalone/toaster-claims.ts +16 -0
- package/src/starter-kit/widgets/WidgetShell.vue +77 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @alfakit/vue
|
|
2
2
|
|
|
3
|
+
## 0.1.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Server rendering: AlfaKit components keep the same generated ids on the server and in the browser (no hydration mismatches on tabs, collapsible sections, filters and the rich editor). Starter kit header components bring a toaster to the app's own pages.
|
|
8
|
+
|
|
3
9
|
## 0.1.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitRoot.vue.d.ts","sourceRoot":"","sources":["../src/AlfakitRoot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitRoot.vue.d.ts","sourceRoot":"","sources":["../src/AlfakitRoot.vue"],"names":[],"mappings":"AA+IA;;;;GAIG;AACH,yGAAyG;AACzG,KAAK,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAoK1C,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAkChD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
import { useAlfakit as e } from "./context.js";
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./components/
|
|
4
|
-
import r from "./components/
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./components/
|
|
7
|
-
import o from "./components/
|
|
8
|
-
import s from "./components/
|
|
9
|
-
import c from "./components/
|
|
10
|
-
import l from "./components/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
import { startIdScope as t } from "./lib/hydration.js";
|
|
3
|
+
import n from "./components/actions/ActionModals.js";
|
|
4
|
+
import r from "./components/ui/TooltipProvider.js";
|
|
5
|
+
import { claimToaster as i } from "./standalone/toaster-claims.js";
|
|
6
|
+
import a from "./components/notifications/FlashToasts.js";
|
|
7
|
+
import o from "./components/notifications/RealtimeNotifications.js";
|
|
8
|
+
import s from "./components/panel/ImpersonationBanner.js";
|
|
9
|
+
import c from "./components/panel/PwaManager.js";
|
|
10
|
+
import l from "./components/ui/Toaster.js";
|
|
11
|
+
import u from "./components/dev-tools/DevToolsSlot.js";
|
|
12
|
+
import d from "./components/panel/SchemaContractGuard.js";
|
|
13
|
+
import { PANEL_TOAST_OFFSET as f, applyDocumentLocale as p, applyPanelTheme as m, overlayPlacementDirection as h, resolveToastPosition as g } from "@alfakit/core";
|
|
14
|
+
import { usePage as _ } from "@inertiajs/vue3";
|
|
15
|
+
import { computed as v, createBlock as y, createCommentVNode as b, createVNode as x, defineComponent as S, onMounted as C, onUnmounted as w, openBlock as T, renderSlot as E, resolveDynamicComponent as D, unref as O, watch as k, withCtx as A } from "vue";
|
|
16
|
+
import { ConfigProvider as j } from "reka-ui";
|
|
15
17
|
//#region src/AlfakitRoot.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
-
var
|
|
18
|
+
var M = /*@__PURE__*/ S({
|
|
17
19
|
__name: "AlfakitRoot",
|
|
18
20
|
props: { toasterId: {} },
|
|
19
|
-
setup(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
setup(S) {
|
|
22
|
+
t();
|
|
23
|
+
let M = _(), { translator: N, registry: P } = e(), F = P.resolve("panel:impersonation-banner") ?? s, I = v(() => M.props.alfakit), L = v(() => I.value?.localization), R = v(() => L.value?.direction ?? "ltr");
|
|
24
|
+
k(() => [I.value?.translations, L.value?.tag], ([e, t]) => {
|
|
25
|
+
I.value && (N.setTranslations(e ?? {}), N.setLocale(t ?? "en"));
|
|
23
26
|
}, {
|
|
24
27
|
immediate: !0,
|
|
25
28
|
flush: "sync"
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
}, { immediate: !0 }),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
}), k(L, (e) => {
|
|
30
|
+
I.value?.starterKit !== !0 && p(e);
|
|
31
|
+
}, { immediate: !0 }), k(I, (e) => m(e), { immediate: !0 });
|
|
32
|
+
let z = null;
|
|
33
|
+
return C(() => {
|
|
34
|
+
z = i();
|
|
35
|
+
}), w(() => z?.()), (e, t) => (T(), y(O(j), { dir: R.value }, {
|
|
36
|
+
default: A(() => [x(r, { "delay-duration": 0 }, {
|
|
37
|
+
default: A(() => [
|
|
38
|
+
x(d, { panel: I.value }, {
|
|
39
|
+
default: A(() => [E(e.$slots, "default")]),
|
|
33
40
|
_: 3
|
|
34
41
|
}, 8, ["panel"]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
x(n),
|
|
43
|
+
x(a),
|
|
44
|
+
x(o),
|
|
45
|
+
x(c),
|
|
46
|
+
x(u),
|
|
47
|
+
I.value?.impersonation ? (T(), y(D(O(F)), {
|
|
41
48
|
key: 0,
|
|
42
|
-
impersonation:
|
|
43
|
-
}, null, 8, ["impersonation"])) :
|
|
44
|
-
|
|
45
|
-
id:
|
|
46
|
-
position:
|
|
47
|
-
offset:
|
|
48
|
-
"mobile-offset":
|
|
49
|
-
dir:
|
|
49
|
+
impersonation: I.value.impersonation
|
|
50
|
+
}, null, 8, ["impersonation"])) : b("", !0),
|
|
51
|
+
x(l, {
|
|
52
|
+
id: S.toasterId,
|
|
53
|
+
position: O(g)(I.value?.toastPosition, O(h)(R.value, I.value?.starterKit)),
|
|
54
|
+
offset: O(f),
|
|
55
|
+
"mobile-offset": O(f),
|
|
56
|
+
dir: R.value,
|
|
50
57
|
"rich-colors": "",
|
|
51
58
|
"close-button": ""
|
|
52
59
|
}, null, 8, [
|
|
@@ -64,6 +71,6 @@ var O = /*@__PURE__*/ b({
|
|
|
64
71
|
}
|
|
65
72
|
});
|
|
66
73
|
//#endregion
|
|
67
|
-
export {
|
|
74
|
+
export { M as default };
|
|
68
75
|
|
|
69
76
|
//# sourceMappingURL=AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitRoot.vue_vue_type_script_setup_true_lang.js","names":["ImpersonationBanner","_openBlock","_createBlock","_unref","_withCtx","_createVNode","TooltipProvider","SchemaContractGuard","_renderSlot","ActionModals","FlashToasts","RealtimeNotifications","PwaManager","DevToolsSlot","_resolveDynamicComponent","_createCommentVNode","Toaster","ActionModals_default","TooltipProvider_default","FlashToasts_default","RealtimeNotifications_default","ImpersonationBanner_default","PwaManager_default","Toaster_default","DevToolsSlot_default","SchemaContractGuard_default","AlfakitRoot_vue_vue_type_script_setup_true_lang_default","page","usePage","useAlfakit","impersonationBanner","registry","panel","computed","localization","direction","watch","translations","tag","translator","applyDocumentLocale","value","applyPanelTheme","openBlock","createBlock","unref","ConfigProvider","withCtx","createVNode","renderSlot","_ctx","resolveDynamicComponent","createCommentVNode","__props","resolveToastPosition","overlayPlacementDirection","PANEL_TOAST_OFFSET"],"sources":["../src/AlfakitRoot.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitRoot.vue_vue_type_script_setup_true_lang.js","names":["ImpersonationBanner","_openBlock","_createBlock","_unref","_withCtx","_createVNode","TooltipProvider","SchemaContractGuard","_renderSlot","ActionModals","FlashToasts","RealtimeNotifications","PwaManager","DevToolsSlot","_resolveDynamicComponent","_createCommentVNode","Toaster","ActionModals_default","TooltipProvider_default","FlashToasts_default","RealtimeNotifications_default","ImpersonationBanner_default","PwaManager_default","Toaster_default","DevToolsSlot_default","SchemaContractGuard_default","AlfakitRoot_vue_vue_type_script_setup_true_lang_default","page","usePage","useAlfakit","impersonationBanner","registry","panel","computed","localization","direction","watch","translations","tag","translator","applyDocumentLocale","value","applyPanelTheme","releaseToaster","onMounted","claimToaster","onUnmounted","openBlock","createBlock","unref","ConfigProvider","withCtx","createVNode","renderSlot","_ctx","resolveDynamicComponent","createCommentVNode","__props","resolveToastPosition","overlayPlacementDirection","PANEL_TOAST_OFFSET"],"sources":["../src/AlfakitRoot.vue"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAkCA,EAAa;EAEb,IAAM2B,IAAOC,EAA0B,GACjC,EAAE,eAAY,gBAAaC,EAAW,GAGtCC,IAAsBC,EAAS,QAAQ,4BAA4B,KAAK/B,GAExEgC,IAAQC,QAAeN,EAAK,MAAM,OAAkD,GACpFO,IAAeD,QAAeD,EAAM,OAAO,YAAY,GACvDG,IAAYF,QAAeC,EAAa,OAAO,aAAa,KAAK;EAyBvE,AApBAE,QACQ,CAACJ,EAAM,OAAO,cAAcE,EAAa,OAAO,GAAG,IACxD,CAACG,GAAcC,OAAS;GACvB,AAAKN,EAAM,UAEXO,EAAW,gBAAgBF,KAAgB,CAAC,CAAC,GAC7CE,EAAW,UAAUD,KAAO,IAAI;EAClC,GACA;GAAE,WAAW;GAAM,OAAO;EAAO,CACnC,GAIAF,EACEF,IACC,MAAU;GACT,AAAIF,EAAM,OAAO,eAAe,MAAMQ,EAAoBC,CAAK;EACjE,GACA,EAAE,WAAW,GAAK,CACpB,GACAL,EAAMJ,IAAQ,MAAUU,EAAgBD,CAAK,GAAG,EAAE,WAAW,GAAK,CAAC;EAInE,IAAIE,IAAsC;SAE1CC,QAAgB;GACd,IAAiBC,EAAa;EAChC,CAAC,GAEDC,QAAkBH,IAAiB,CAAC,cAIlC1C,EAAA,GAAAC,EAgCiBC,EAAA+C,CAAA,GAAA,EAhCA,KAAKf,EAAA,MAAS,GAAA;GAC7B,SAAA/B,QA8BkB,CA9BlBC,EA8BkBC,GAAA,EA9BA,kBAAgB,EAAC,GAAA;IACjC,SAAAF,QAEsB;KAFtBC,EAEsBE,GAAA,EAFA,OAAOyB,EAAA,MAAK,GAAA;MAChC,SAAA5B,QAAQ,CAARI,EAAQ8C,EAAA,QAAA,SAAA,CAAA,CAAA;;;KAEVjD,EAAgBI,CAAA;KAChBJ,EAAeK,CAAA;KACfL,EAAyBM,CAAA;KAEzBN,EAAcO,CAAA;KAEdP,EAAgBQ,CAAA;KAGRmB,EAAA,OAAO,iBAFf/B,EAAA,GAAAC,EAIEY,EAHKX,EAAA2B,CAAA,CAAmB,GAAA;;MAEvB,eAAeE,EAAA,MAAM;;KAExB3B,EAaEW,GAAA;MAZC,IAAIyC,EAAA;MACJ,UAAqBtD,EAAAuD,CAAA,CAAoB,CAAc1B,EAAA,OAAO,eAA2B7B,EAAAwD,CAAA,CAAyB,CAACxB,EAAA,OAAWH,EAAA,OAAO,UAAU,CAAA;MAM/I,QAAQ7B,EAAAyD,CAAA;MACR,iBAAezD,EAAAyD,CAAA;MACf,KAAKzB,EAAA;MACN,eAAA;MACA,gBAAA"}
|
package/dist/eject-manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@alfakit/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"adapter": "vue",
|
|
5
|
-
"generatedAt": "2026-10-
|
|
5
|
+
"generatedAt": "2026-10-26T13:11:45.431Z",
|
|
6
6
|
"components": {
|
|
7
7
|
"TextInput": {
|
|
8
8
|
"file": "src/components/fields/TextInputField.vue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/lib/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/lib/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAG9C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG,YAAY,CAkBtF;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACxC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACpC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,OAAO,GAAE,gBAAqB,GAC7B,oBAAoB,CAItB"}
|
package/dist/lib/discovery.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { startIdScope as e } from "./hydration.js";
|
|
2
|
+
import { ComponentDiscovery as t } from "@alfakit/core";
|
|
3
|
+
import { defineAsyncComponent as n, defineComponent as r, h as i } from "vue";
|
|
3
4
|
//#region src/lib/discovery.ts
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
loader: () =>
|
|
5
|
+
function a(t) {
|
|
6
|
+
let a = n({
|
|
7
|
+
loader: () => t.load(),
|
|
7
8
|
suspensible: !1
|
|
8
9
|
});
|
|
9
|
-
return
|
|
10
|
-
name: `Discovered(${
|
|
10
|
+
return r({
|
|
11
|
+
name: `Discovered(${t.key})`,
|
|
11
12
|
inheritAttrs: !1,
|
|
12
|
-
setup(
|
|
13
|
-
let
|
|
14
|
-
return () =>
|
|
13
|
+
setup(n, { attrs: r, slots: o }) {
|
|
14
|
+
let s = t.current ?? a;
|
|
15
|
+
return s !== a && e(), () => i(s, r, o);
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
let r = new e
|
|
19
|
+
function o(e, n = {}) {
|
|
20
|
+
let r = new t(e ?? {}, n);
|
|
20
21
|
return {
|
|
21
22
|
discovery: r,
|
|
22
|
-
...r.map(
|
|
23
|
+
...r.map(a)
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
//#endregion
|
|
26
|
-
export {
|
|
27
|
+
export { o as discoverComponents, a as discoveredComponent };
|
|
27
28
|
|
|
28
29
|
//# sourceMappingURL=discovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","names":["discoveredComponent","Async","defineAsyncComponent","entry","defineComponent","Loaded","h","attrs","slots","discoverComponents","discovery","ComponentDiscovery","modules","options"],"sources":["../../src/lib/discovery.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.js","names":["discoveredComponent","Async","defineAsyncComponent","entry","defineComponent","Loaded","startIdScope","h","attrs","slots","discoverComponents","discovery","ComponentDiscovery","modules","options"],"sources":["../../src/lib/discovery.ts"],"mappings":";;;;AAcA,SAAgBA,EAAoB,GAAoD;CACtF,IAAMC,IAAQC,EAAqB;EAAE,cAAcC,EAAM,KAAK;EAAG,aAAa;CAAM,CAAC;CAErF,OAAOC,EAAgB;EACrB,MAAM,cAAcD,EAAM,IAAI;EAC9B,cAAc;EACd,MAAM,GAAG,EAAE,UAAO,YAAS;GAEzB,IAAME,IAASF,EAAM,WAAWF;GAOhC,OAFII,MAAWJ,KAAOK,EAAa,SAEtBC,EAAEF,GAAQG,GAAOC,CAAK;EACrC;CACF,CAAC;AACH;AAYA,SAAgBC,EACd,GACA,IAA4B,CAAC,GACP;CACtB,IAAMC,IAAY,IAAIC,EAAiCC,KAAW,CAAC,GAAGC,CAAO;CAE7E,OAAO;EAAE;EAAW,GAAGH,EAAU,IAAIX,CAAmB;CAAE;AAC5D"}
|
package/dist/lib/hydration.d.ts
CHANGED
|
@@ -4,6 +4,21 @@ import { type Ref } from 'vue';
|
|
|
4
4
|
* the server render and hydration), then `true` for every component in that app, so
|
|
5
5
|
* content rendered later draws at once (reactive). Lazily loaded parts (named icons, heavy
|
|
6
6
|
* fields) render their server markup until then, whatever has loaded already.
|
|
7
|
+
*
|
|
8
|
+
* A component that hydrates server markup after the app mounted (inside an async
|
|
9
|
+
* component whose code arrived later, such as a lazily split built-in) waits for its own
|
|
10
|
+
* mount: its server markup is the fallback too (W-V3-28).
|
|
7
11
|
*/
|
|
8
12
|
export declare function useAppMounted(): Ref<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Start a new `useId()` scope at the current component, as Vue does at an async component
|
|
15
|
+
* (its internal `markAsyncBoundary()`): ids below it are numbered from zero under a prefix
|
|
16
|
+
* that counts scopes, not the ids generated before it. So
|
|
17
|
+
* - AlfaKit's ids don't follow the host layout's (a starter kit's sidebar renders a sheet on
|
|
18
|
+
* phones in the browser but the desktop sidebar on the server), and
|
|
19
|
+
* - a lazily split component renders the same ids whether its code was loaded before
|
|
20
|
+
* rendering (the server after its first request) or arrives during hydration (an async
|
|
21
|
+
* component, which starts a scope itself).
|
|
22
|
+
*/
|
|
23
|
+
export declare function startIdScope(): void;
|
|
9
24
|
//# sourceMappingURL=hydration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../src/lib/hydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AASnF
|
|
1
|
+
{"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../src/lib/hydration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AASnF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,OAAO,CAAC,CAgC5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAOnC"}
|
package/dist/lib/hydration.js
CHANGED
|
@@ -2,16 +2,30 @@ import { getCurrentInstance as e, onMounted as t, ref as n } from "vue";
|
|
|
2
2
|
//#region src/lib/hydration.ts
|
|
3
3
|
var r = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
function i() {
|
|
5
|
-
let i = e()?.appContext;
|
|
6
|
-
if (!i) return n(!0);
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let
|
|
5
|
+
let i = e(), a = i?.appContext;
|
|
6
|
+
if (!i || !a) return n(!0);
|
|
7
|
+
let o = r.get(a);
|
|
8
|
+
o || (o = n(!1), r.set(a, o));
|
|
9
|
+
let s = o;
|
|
10
|
+
if (i.vnode.el && s.value) {
|
|
11
|
+
let e = n(!1);
|
|
12
|
+
return t(() => {
|
|
13
|
+
e.value = !0;
|
|
14
|
+
}), e;
|
|
15
|
+
}
|
|
10
16
|
return t(() => {
|
|
11
|
-
|
|
12
|
-
}),
|
|
17
|
+
s.value = !0;
|
|
18
|
+
}), s;
|
|
19
|
+
}
|
|
20
|
+
function a() {
|
|
21
|
+
let t = e(), n = t?.ids;
|
|
22
|
+
t && Array.isArray(n) && n.length === 3 && (t.ids = [
|
|
23
|
+
`${n[0]}${n[2]++}-`,
|
|
24
|
+
0,
|
|
25
|
+
0
|
|
26
|
+
]);
|
|
13
27
|
}
|
|
14
28
|
//#endregion
|
|
15
|
-
export { i as useAppMounted };
|
|
29
|
+
export { a as startIdScope, i as useAppMounted };
|
|
16
30
|
|
|
17
31
|
//# sourceMappingURL=hydration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.js","names":["mountedApps","useAppMounted","
|
|
1
|
+
{"version":3,"file":"hydration.js","names":["mountedApps","useAppMounted","instance","getCurrentInstance","context","ref","mounted","flag","own","onMounted","startIdScope","ids"],"sources":["../../src/lib/hydration.ts"],"mappings":";;AAOA,IAAMA,oBAAc,IAAI,QAAkC;AAY1D,SAAgBC,IAA8B;CAC5C,IAAMC,IAAWC,EAAmB,GAC9BC,IAAUF,GAAU;CAG1B,IAAI,CAACA,KAAY,CAACE,GAAS,OAAOC,EAAI,EAAI;CAE1C,IAAIC,IAAUN,EAAY,IAAII,CAAO;CAErC,AAAKE,MACH,IAAUD,EAAI,EAAK,GACnBL,EAAY,IAAII,GAASE,CAAO;CAGlC,IAAMC,IAAOD;CAGb,IAAIJ,EAAS,MAAM,MAAMK,EAAK,OAAO;EACnC,IAAMC,IAAMH,EAAI,EAAK;EAMrB,OAJAI,QAAgB;GACd,EAAI,QAAQ;EACd,CAAC,GAEMD;CACT;CAMA,OAJAC,QAAgB;EACd,EAAK,QAAQ;CACf,CAAC,GAEMF;AACT;AAYA,SAAgBG,IAAqB;CACnC,IAAMR,IAAWC,EAAmB,GAC9BQ,IAAMT,GAAU;CAEtB,AAAKA,KAAa,MAAM,QAAQS,CAAG,KAAKA,EAAI,WAAW,MAEvD,EAAS,MAAM;EAAC,GAAGA,EAAI,KAAK,EAAI,EAAE,GAAG;EAAI;EAAG;CAAC;AAC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.vue.d.ts","sourceRoot":"","sources":["../../src/standalone/AlfakitComponent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.vue.d.ts","sourceRoot":"","sources":["../../src/standalone/AlfakitComponent.vue"],"names":[],"mappings":"AAgOA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAA;AAGtB,OAAO,EAA4D,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAKnG,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AAanB;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,SAAS,EAAE,yBAAyB,CAAA;IACpC,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACzC,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAChC,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,OAAO,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,YAAY,EAAE,CAAC;QAAC,IAAI,EAAE,yBAAyB,CAAA;KAAE,KAAK,OAAO,CAAA;CAC1F,CAAC;AAoRF,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ALFAKIT_KEY as e, provideStandalone as t, useOptionalAlfakit as n } from "../context.js";
|
|
2
2
|
import { providePageActionContext as r } from "../components/actions/action-context.js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as ee } from "../lib/utils.js";
|
|
4
|
+
import { startIdScope as i } from "../lib/hydration.js";
|
|
4
5
|
import a from "../components/actions/ActionList.js";
|
|
5
|
-
import
|
|
6
|
+
import te from "../pages/ContentBlockRenderer.js";
|
|
6
7
|
import o from "../components/actions/ActionModals.js";
|
|
7
8
|
import s from "../components/ui/TooltipProvider.js";
|
|
8
|
-
import { claimToaster as c,
|
|
9
|
+
import { claimToaster as c, hasToaster as l } from "./toaster-claims.js";
|
|
10
|
+
import { createStandaloneContext as u, createStandaloneRegistry as d, ensureStandaloneRuntime as f } from "./runtime.js";
|
|
9
11
|
import p from "./AlfakitToaster.js";
|
|
10
|
-
import { StandaloneComponentState as
|
|
11
|
-
import { usePage as
|
|
12
|
-
import { Fragment as
|
|
12
|
+
import { StandaloneComponentState as m, findStandalonePropName as ne, registerStandaloneProp as re, standalonePanelSchema as h } from "@alfakit/core";
|
|
13
|
+
import { usePage as g } from "@inertiajs/vue3";
|
|
14
|
+
import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createVNode as C, defineComponent as w, normalizeClass as T, onMounted as ie, onScopeDispose as ae, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, unref as N, watch as P, withCtx as F } from "vue";
|
|
13
15
|
import { ConfigProvider as I } from "reka-ui";
|
|
14
16
|
//#region src/standalone/AlfakitComponent.vue?vue&type=script&setup=true&lang.ts
|
|
15
17
|
var L = ["data-alfakit-component", "dir"], R = {
|
|
@@ -22,7 +24,7 @@ var L = ["data-alfakit-component", "dir"], R = {
|
|
|
22
24
|
}, V = {
|
|
23
25
|
key: 1,
|
|
24
26
|
class: "text-muted-foreground mt-1 text-sm"
|
|
25
|
-
}, H = /*@__PURE__*/
|
|
27
|
+
}, H = /*@__PURE__*/ w({
|
|
26
28
|
__name: "AlfakitComponent",
|
|
27
29
|
props: {
|
|
28
30
|
component: {},
|
|
@@ -35,30 +37,32 @@ var L = ["data-alfakit-component", "dir"], R = {
|
|
|
35
37
|
Array
|
|
36
38
|
] }
|
|
37
39
|
},
|
|
38
|
-
setup(
|
|
39
|
-
let H =
|
|
40
|
+
setup(w) {
|
|
41
|
+
let H = w;
|
|
42
|
+
i();
|
|
43
|
+
let U = n(), W = g(), G = O(0), K = new m(H.component, () => G.value++), q = (e, t) => K.poll(e, t), J = (e) => K.refresh(e), Y = U ? {
|
|
40
44
|
...U,
|
|
41
|
-
actions:
|
|
45
|
+
actions: u({
|
|
42
46
|
action: H.component.endpoints.action,
|
|
43
47
|
modal: H.component.endpoints.modal
|
|
44
48
|
}, H.components, q).actions,
|
|
45
|
-
registry:
|
|
49
|
+
registry: d(H.components, U.registry),
|
|
46
50
|
poll: q,
|
|
47
51
|
refresh: J
|
|
48
52
|
} : {
|
|
49
|
-
...
|
|
53
|
+
...u({
|
|
50
54
|
action: H.component.endpoints.action,
|
|
51
55
|
modal: H.component.endpoints.modal
|
|
52
56
|
}, H.components, q),
|
|
53
57
|
refresh: J
|
|
54
58
|
};
|
|
55
|
-
|
|
56
|
-
let
|
|
59
|
+
D(e, Y);
|
|
60
|
+
let oe = v(() => h(H.component)), X = v(() => (G.value, K.setComponent(H.component), K.page)), Z = v(() => H.component.localization?.direction ?? "ltr"), Q = v(() => ({
|
|
57
61
|
token: H.component.token,
|
|
58
62
|
component: "page"
|
|
59
63
|
}));
|
|
60
64
|
t({
|
|
61
|
-
panel:
|
|
65
|
+
panel: oe,
|
|
62
66
|
page: X
|
|
63
67
|
}), r(Q.value), P(() => H.component, (e) => {
|
|
64
68
|
Y.actions.setEndpoints({
|
|
@@ -70,49 +74,49 @@ var L = ["data-alfakit-component", "dir"], R = {
|
|
|
70
74
|
flush: "sync"
|
|
71
75
|
});
|
|
72
76
|
let $ = O(!1);
|
|
73
|
-
return typeof window < "u" && P(() => ne(W.props, H.component), (e, t, n) => n(re(e ?? null)), { immediate: !0 }),
|
|
74
|
-
if (
|
|
77
|
+
return typeof window < "u" && P(() => ne(W.props, H.component), (e, t, n) => n(re(e ?? null)), { immediate: !0 }), ie(() => {
|
|
78
|
+
if (f(), P(() => H.component.token, () => void K.loadLazy(H.component), { immediate: !0 }), U) return;
|
|
75
79
|
let e = null, t = !1;
|
|
76
80
|
queueMicrotask(() => {
|
|
77
|
-
t ||
|
|
78
|
-
}),
|
|
81
|
+
t || l() || (e = c(), $.value = !0);
|
|
82
|
+
}), ae(() => {
|
|
79
83
|
t = !0, e?.();
|
|
80
84
|
});
|
|
81
|
-
}), (e, t) => (
|
|
85
|
+
}), (e, t) => (E(), y(j(N(U) ? "div" : N(I)), {
|
|
82
86
|
dir: N(U) ? void 0 : Z.value,
|
|
83
|
-
class:
|
|
87
|
+
class: T(N(U) ? "contents" : void 0)
|
|
84
88
|
}, {
|
|
85
|
-
default: F(() => [
|
|
89
|
+
default: F(() => [C(s, { "delay-duration": 0 }, {
|
|
86
90
|
default: F(() => [
|
|
87
|
-
|
|
91
|
+
S("div", {
|
|
88
92
|
"data-slot": "standalone",
|
|
89
93
|
"data-alfakit-component": H.component.class,
|
|
90
94
|
dir: Z.value,
|
|
91
|
-
class:
|
|
95
|
+
class: T(N(ee)("flex flex-col gap-6", H.class))
|
|
92
96
|
}, [
|
|
93
|
-
X.value.heading || X.value.headerActions?.length ? (
|
|
97
|
+
X.value.heading || X.value.headerActions?.length ? (E(), x("header", R, [S("div", z, [X.value.heading ? (E(), x("h2", B, M(X.value.heading), 1)) : b("", !0), X.value.subheading ? (E(), x("p", V, M(X.value.subheading), 1)) : b("", !0)]), X.value.headerActions && X.value.headerActions.length > 0 ? (E(), y(a, {
|
|
94
98
|
key: 0,
|
|
95
99
|
actions: X.value.headerActions,
|
|
96
100
|
context: Q.value,
|
|
97
101
|
align: "end",
|
|
98
102
|
class: "max-w-full min-w-0"
|
|
99
|
-
}, null, 8, ["actions", "context"])) :
|
|
103
|
+
}, null, 8, ["actions", "context"])) : b("", !0)])) : b("", !0),
|
|
100
104
|
A(e.$slots, "header"),
|
|
101
105
|
A(e.$slots, "default", {
|
|
102
106
|
blocks: X.value.content,
|
|
103
107
|
page: H.component
|
|
104
|
-
}, () => [(
|
|
108
|
+
}, () => [(E(!0), x(_, null, k(X.value.content, (e) => (E(), y(te, {
|
|
105
109
|
key: e.key,
|
|
106
110
|
block: e
|
|
107
111
|
}, null, 8, ["block"]))), 128))]),
|
|
108
112
|
A(e.$slots, "footer")
|
|
109
113
|
], 10, L),
|
|
110
|
-
|
|
111
|
-
$.value ? (
|
|
114
|
+
C(o),
|
|
115
|
+
$.value ? (E(), y(p, {
|
|
112
116
|
key: 0,
|
|
113
117
|
claimed: "",
|
|
114
118
|
dir: Z.value
|
|
115
|
-
}, null, 8, ["dir"])) :
|
|
119
|
+
}, null, 8, ["dir"])) : b("", !0)
|
|
116
120
|
]),
|
|
117
121
|
_: 3
|
|
118
122
|
})]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_withCtx","_createVNode","TooltipProvider","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode","ActionList","_renderSlot","_Fragment","_renderList","ContentBlockRenderer","ActionModals","AlfakitToaster","ActionList_default","ContentBlockRenderer_default","ActionModals_default","TooltipProvider_default","AlfakitToaster_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","props","__props","parent","useOptionalAlfakit","inertiaPage","usePage","version","ref","state","StandaloneComponentState","poll","target","interval","refresh","targets","context","createStandaloneContext","createStandaloneRegistry","ALFAKIT_KEY","panel","computed","standalonePanelSchema","page","direction","actionContext","provideStandalone","providePageActionContext","watch","component","ownsToaster","findStandalonePropName","onCleanup","registerStandaloneProp","name","onMounted","ensureStandaloneRuntime","release","cancelled","hasToaster","claimToaster","onScopeDispose","openBlock","createBlock","resolveDynamicComponent","unref","ConfigProvider","normalizeClass","withCtx","createVNode","createElementVNode","cn","createElementBlock","toDisplayString","createCommentVNode","renderSlot","_ctx","Fragment","renderList","block"],"sources":["../../src/standalone/AlfakitComponent.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_normalizeClass","_withCtx","_createVNode","TooltipProvider","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode","ActionList","_renderSlot","_Fragment","_renderList","ContentBlockRenderer","ActionModals","AlfakitToaster","ActionList_default","ContentBlockRenderer_default","ActionModals_default","TooltipProvider_default","AlfakitToaster_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","props","__props","parent","useOptionalAlfakit","inertiaPage","usePage","version","ref","state","StandaloneComponentState","poll","target","interval","refresh","targets","context","createStandaloneContext","createStandaloneRegistry","ALFAKIT_KEY","panel","computed","standalonePanelSchema","page","direction","actionContext","provideStandalone","providePageActionContext","watch","component","ownsToaster","findStandalonePropName","onCleanup","registerStandaloneProp","name","onMounted","ensureStandaloneRuntime","release","cancelled","hasToaster","claimToaster","onScopeDispose","openBlock","createBlock","resolveDynamicComponent","unref","ConfigProvider","normalizeClass","withCtx","createVNode","createElementVNode","cn","createElementBlock","toDisplayString","createCommentVNode","renderSlot","_ctx","Fragment","renderList","block"],"sources":["../../src/standalone/AlfakitComponent.vue"],"mappings":"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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useOptionalAlfakit as e } from "../context.js";
|
|
2
2
|
import { setToasterId as t } from "../components/notifications/flash-toasts.js";
|
|
3
|
-
import { claimToaster as n
|
|
3
|
+
import { claimToaster as n } from "./toaster-claims.js";
|
|
4
|
+
import { createStandaloneContext as r, ensureFlashToasts as i } from "./runtime.js";
|
|
4
5
|
import a from "../components/ui/Toaster.js";
|
|
5
6
|
import { STARTER_KIT_TOASTER_ID as o, resolveToastPosition as s } from "@alfakit/core";
|
|
6
7
|
import { createBlock as c, createCommentVNode as l, defineComponent as u, onMounted as d, onUnmounted as f, openBlock as p, unref as m } from "vue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitToaster.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Toaster","_unref","_createCommentVNode","Toaster_default","AlfakitToaster_vue_vue_type_script_setup_true_lang_default","props","__props","context","useOptionalAlfakit","createStandaloneContext","release","onMounted","claimToaster","setToasterId","STARTER_KIT_TOASTER_ID","ensureFlashToasts","onUnmounted","openBlock","createBlock","unref","resolveToastPosition","createCommentVNode"],"sources":["../../src/standalone/AlfakitToaster.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitToaster.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Toaster","_unref","_createCommentVNode","Toaster_default","AlfakitToaster_vue_vue_type_script_setup_true_lang_default","props","__props","context","useOptionalAlfakit","createStandaloneContext","release","onMounted","claimToaster","setToasterId","STARTER_KIT_TOASTER_ID","ensureFlashToasts","onUnmounted","openBlock","createBlock","unref","resolveToastPosition","createCommentVNode"],"sources":["../../src/standalone/AlfakitToaster.vue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAgBA,IAAMO,IAAQC,GAiBRC,IACJC,EAAmB,KAAKC,EAAwB;GAAE,QAAQ;GAAI,OAAO;EAAG,GAAG,KAAA,GAAW,KAAA,CAAS,GAE7FC,IAA+B;SAEnCC,QAAgB;GAOd,AANKN,EAAM,YAAS,IAAUO,EAAa,IAIvCP,EAAM,WAASQ,EAAaC,CAAsB,GAEtDC,EAAkBR,EAAQ,QAAQ;EACpC,CAAC,GAEDS,QAAkB;GAGhB,AAFAN,IAAU,GAENL,EAAM,WAASQ,EAAa,KAAA,CAAS;EAC3C,CAAC,aAKSR,EAAM,WADdP,EAAA,GAAAC,EAOEC,GAAA;;GALC,IAAIC,EAAAa,CAAA;GACJ,UAAUb,EAAAmB,CAAA,CAAoB,CAACf,EAAM,UAAUA,EAAM,GAAG;GACxD,KAAKA,EAAM;GACZ,eAAA;GACA,gBAAA"}
|
|
@@ -15,9 +15,7 @@ export declare function createStandaloneContext(endpoints: {
|
|
|
15
15
|
action: string;
|
|
16
16
|
modal: string;
|
|
17
17
|
}, overrides: Record<string, AnyComponent> | undefined, poll: AlfakitContextValue['poll']): AlfakitContextValue;
|
|
18
|
-
|
|
19
|
-
export declare function claimToaster(): () => void;
|
|
20
|
-
export declare function hasToaster(): boolean;
|
|
18
|
+
export { claimToaster, hasToaster } from './toaster-claims';
|
|
21
19
|
/**
|
|
22
20
|
* Show the notifications the server flashed (`Notification::make()->send()`), from the
|
|
23
21
|
* `flash` Inertia event after each visit and from the initial page (whose event fired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/standalone/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAYnE,2EAA2E;AAC3E,wBAAgB,uBAAuB,IAAI,IAAI,CAO9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACxC,IAAI,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,GACrC,iBAAiB,CAAC,YAAY,CAAC,CAoBjC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,EACnD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAChC,mBAAmB,CAsBrB;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/standalone/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAYnE,2EAA2E;AAC3E,wBAAgB,uBAAuB,IAAI,IAAI,CAO9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACxC,IAAI,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,GACrC,iBAAiB,CAAC,YAAY,CAAC,CAoBjC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,EACnD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAChC,mBAAmB,CAsBrB;AAKD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQ3D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,IAAI,CAkBjF;AAED,gFAAgF;AAChF,wBAAgB,YAAY,IAAI,OAAO,CAUtC"}
|
|
@@ -1,60 +1,52 @@
|
|
|
1
1
|
import { showToast as e } from "../components/notifications/flash-toasts.js";
|
|
2
2
|
import { createDefaultRegistry as t } from "../registry.js";
|
|
3
3
|
import { getStandaloneDefaults as n } from "./configure.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { claimToaster as r, hasToaster as i } from "./toaster-claims.js";
|
|
5
|
+
import { ActionRunner as a, ComponentRegistry as o, FlashNotificationTracker as s, Translator as c, installPrefetchInvalidation as l, reloadOnExpiredPage as u, resolveRequestErrorNotification as d } from "@alfakit/core";
|
|
6
|
+
import { router as f } from "@inertiajs/vue3";
|
|
6
7
|
//#region src/standalone/runtime.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
var p = typeof window > "u", m = p ? null : new c(), h = !1;
|
|
9
|
+
function g() {
|
|
10
|
+
p || h || (h = !0, u(), l());
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function _(e, r) {
|
|
12
13
|
if (!r) return t().registerMany(n().components ?? {}).registerMany(e ?? {});
|
|
13
14
|
if (!e || Object.keys(e).length === 0) return r;
|
|
14
|
-
let
|
|
15
|
+
let i = new o();
|
|
15
16
|
for (let e of r.types()) {
|
|
16
17
|
let t = r.resolve(e);
|
|
17
|
-
t &&
|
|
18
|
+
t && i.register(e, t);
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
+
return i.registerMany(e);
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
22
|
+
function v(t, n, r) {
|
|
23
|
+
let i = m ?? new c();
|
|
23
24
|
return {
|
|
24
|
-
registry:
|
|
25
|
+
registry: _(n),
|
|
25
26
|
pages: {},
|
|
26
|
-
translator:
|
|
27
|
-
actions: new
|
|
27
|
+
translator: i,
|
|
28
|
+
actions: new a({
|
|
28
29
|
endpoints: { ...t },
|
|
29
30
|
onError: (t) => {
|
|
30
|
-
let n =
|
|
31
|
+
let n = d(t, null, (e, t, n) => i.t(e, t, n));
|
|
31
32
|
n && e(n);
|
|
32
33
|
}
|
|
33
34
|
}),
|
|
34
|
-
poll:
|
|
35
|
+
poll: r
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function y() {
|
|
44
|
-
return _ > 0;
|
|
45
|
-
}
|
|
46
|
-
var b = new a(), x = null, S = !1;
|
|
47
|
-
function C(t) {
|
|
48
|
-
if (x = t, d || S) return;
|
|
49
|
-
S = !0;
|
|
38
|
+
var y = new s(), b = null, x = !1;
|
|
39
|
+
function S(t) {
|
|
40
|
+
if (b = t, p || x) return;
|
|
41
|
+
x = !0;
|
|
50
42
|
let n = (t) => {
|
|
51
43
|
let n = t?.alfakitNotifications;
|
|
52
|
-
for (let t of
|
|
44
|
+
for (let t of y.fresh(n)) e(t, b?.resolve(t.view ?? ""));
|
|
53
45
|
};
|
|
54
|
-
n(
|
|
46
|
+
n(C()), f.on("flash", (e) => n(e.detail.flash));
|
|
55
47
|
}
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
48
|
+
function C() {
|
|
49
|
+
if (!p) try {
|
|
58
50
|
let e = document.querySelector("[data-page]")?.dataset.page;
|
|
59
51
|
return e ? JSON.parse(e).flash : void 0;
|
|
60
52
|
} catch {
|
|
@@ -62,6 +54,6 @@ function w() {
|
|
|
62
54
|
}
|
|
63
55
|
}
|
|
64
56
|
//#endregion
|
|
65
|
-
export {
|
|
57
|
+
export { r as claimToaster, v as createStandaloneContext, _ as createStandaloneRegistry, S as ensureFlashToasts, g as ensureStandaloneRuntime, i as hasToaster, C as initialFlash };
|
|
66
58
|
|
|
67
59
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":["isServer","browserTranslator","Translator","browserReady","ensureStandaloneRuntime","reloadOnExpiredPage","installPrefetchInvalidation","createStandaloneRegistry","base","createDefaultRegistry","getStandaloneDefaults","overrides","registry","ComponentRegistry","type","component","createStandaloneContext","translator","ActionRunner","endpoints","notification","resolveRequestErrorNotification","error","key","replacements","fallback","showToast","
|
|
1
|
+
{"version":3,"file":"runtime.js","names":["isServer","browserTranslator","Translator","browserReady","ensureStandaloneRuntime","reloadOnExpiredPage","installPrefetchInvalidation","createStandaloneRegistry","base","createDefaultRegistry","getStandaloneDefaults","overrides","registry","ComponentRegistry","type","component","createStandaloneContext","translator","ActionRunner","endpoints","notification","resolveRequestErrorNotification","error","key","replacements","fallback","showToast","flashTracker","FlashNotificationTracker","flashRegistry","flashListening","ensureFlashToasts","show","flashed","flash","initialFlash","router","event","page","claimToaster","hasToaster"],"sources":["../../src/standalone/runtime.ts"],"mappings":";;;;;;;AAgBA,IAAMA,IAAW,OAAO,SAAW,KAI7BC,IAAoBD,IAAW,OAAO,IAAIE,EAAW,GAEvDC,IAAe;AAGnB,SAAgBC,IAAgC;CAC9C,AAAIJ,KAAYG,MAEhB,IAAe,IACfE,EAAoB,GAEpBC,EAA4B;AAC9B;AAMA,SAAgBC,EACd,GACA,GACiC;CACjC,IAAI,CAACC,GACH,OAAOC,EAAsB,CAAC,CAC3B,aAAaC,EAAsB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CACtD,aAAaC,KAAa,CAAC,CAAC;CAGjC,IAAI,CAACA,KAAa,OAAO,KAAKA,CAAS,CAAC,CAAC,WAAW,GAClD,OAAOH;CAGT,IAAMI,IAAW,IAAIC,EAAgC;CAErD,KAAK,IAAMC,KAAQN,EAAK,MAAM,GAAG;EAC/B,IAAMO,IAAYP,EAAK,QAAQM,CAAI;EAEnC,AAAIC,KAAWH,EAAS,SAASE,GAAMC,CAAS;CAClD;CAEA,OAAOH,EAAS,aAAaD,CAAS;AACxC;AAMA,SAAgBK,EACd,GACA,GACA,GACqB;CACrB,IAAMC,IAAahB,KAAqB,IAAIC,EAAW;CAEvD,OAAO;EACL,UAAUK,EAAyBI,CAAS;EAC5C,OAAO,CAAC;EACR;EACA,SAAS,IAAIO,EAAa;GACxB,WAAW,EAAE,GAAGC,EAAU;GAE1B,UAAU,MAAU;IAClB,IAAMC,IAAeC,EACnBC,GACA,OACC,GAAK,GAAc,MAAaL,EAAW,EAAEM,GAAKC,GAAcC,CAAQ,CAC3E;IAEA,AAAIL,KAAcM,EAAUN,CAAY;GAC1C;EACF,CAAC;EACD;CACF;AACF;AASA,IAAMO,IAAe,IAAIC,EAAyB,GAC9CC,IAAwD,MACxDC,IAAiB;AAQrB,SAAgBC,EAAkB,GAAiD;CAGjF,IAFA,IAAgBnB,GAEZZ,KAAY8B,GAAgB;CAEhC,IAAiB;CAEjB,IAAME,KAAQ,MAAmB;EAC/B,IAAMC,IAAWC,GACb;EAEJ,KAAK,IAAMd,KAAgBO,EAAa,MAAMM,CAAO,GACnD,EAAUb,GAAcS,GAAe,QAAQT,EAAa,QAAQ,EAAE,CAAC;CAE3E;CAGA,AADAY,EAAKG,EAAa,CAAC,GACnBC,EAAO,GAAG,UAAU,MAAUJ,EAAKK,EAAM,OAAO,KAAK,CAAC;AACxD;AAGA,SAAgBF,IAAwB;CACtC,IAAI,IAEJ,IAAI;EACF,IAAMG,IAAO,SAAS,cAA2B,aAAa,CAAC,EAAE,QAAQ;EAEzE,OAAOA,IAAQ,KAAK,MAAMA,CAAI,CAAC,CAAyB,QAAQ,KAAA;CAClE,QAAQ;EACN;CACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster-claims.d.ts","sourceRoot":"","sources":["../../src/standalone/toaster-claims.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,wBAAgB,YAAY,IAAI,MAAM,IAAI,CAMzC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/standalone/toaster-claims.ts
|
|
2
|
+
var e = 0;
|
|
3
|
+
function t() {
|
|
4
|
+
return e++, () => {
|
|
5
|
+
e--;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function n() {
|
|
9
|
+
return e > 0;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as claimToaster, n as hasToaster };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=toaster-claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster-claims.js","names":["toasters","claimToaster","hasToaster"],"sources":["../../src/standalone/toaster-claims.ts"],"mappings":";AAEA,IAAIA,IAAW;AAGf,SAAgBC,IAA2B;CAGzC,OAFA,WAEa;EACX;CACF;AACF;AAEA,SAAgBC,IAAsB;CACpC,OAAOF,IAAW;AACpB"}
|
|
@@ -6,9 +6,9 @@ import { type PanelSchema } from '@alfakit/core';
|
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
panel: PanelSchema;
|
|
8
8
|
};
|
|
9
|
-
declare var
|
|
9
|
+
declare var __VLS_8: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_8) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetShell.vue.d.ts","sourceRoot":"","sources":["../../../src/starter-kit/widgets/WidgetShell.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WidgetShell.vue.d.ts","sourceRoot":"","sources":["../../../src/starter-kit/widgets/WidgetShell.vue"],"names":[],"mappings":"AAkHA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,eAAe,CAAA;AAYtB;;;GAGG;AACH,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAmI1C,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAyB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,33 +1,65 @@
|
|
|
1
1
|
import { provideAlfakit as e, provideStandalone as t } from "../../context.js";
|
|
2
|
-
import n from "../../components/
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
2
|
+
import { setToasterId as n } from "../../components/notifications/flash-toasts.js";
|
|
3
|
+
import r from "../../components/ui/TooltipProvider.js";
|
|
4
|
+
import { claimToaster as i, hasToaster as a } from "../../standalone/toaster-claims.js";
|
|
5
|
+
import { ensureFlashToasts as o } from "../../standalone/runtime.js";
|
|
6
|
+
import s from "../../components/ui/Toaster.js";
|
|
7
|
+
import { widgetsAlfakitContext as c } from "./use-widgets.js";
|
|
8
|
+
import { STARTER_KIT_TOASTER_ID as l, isAlfakitPage as u, overlayPlacementDirection as d, resolveToastPosition as f, starterKitWidgetsPage as p } from "@alfakit/core";
|
|
9
|
+
import { usePage as m } from "@inertiajs/vue3";
|
|
10
|
+
import { Fragment as h, Teleport as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createVNode as x, defineComponent as S, onMounted as C, onUnmounted as w, openBlock as T, ref as E, renderSlot as D, toRef as O, unref as k, watch as A, withCtx as j } from "vue";
|
|
11
|
+
import { ConfigProvider as M } from "reka-ui";
|
|
7
12
|
//#region src/starter-kit/widgets/WidgetShell.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
13
|
+
var N = /*@__PURE__*/ S({
|
|
9
14
|
__name: "WidgetShell",
|
|
10
15
|
props: { panel: {} },
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
panel:
|
|
15
|
-
page:
|
|
16
|
-
}),
|
|
17
|
-
|
|
16
|
+
setup(S) {
|
|
17
|
+
let N = S, P = c(), F = _(() => p());
|
|
18
|
+
e(P), t({
|
|
19
|
+
panel: O(N, "panel"),
|
|
20
|
+
page: F
|
|
21
|
+
}), A(() => [N.panel.translations, N.panel.localization?.tag], ([e, t]) => {
|
|
22
|
+
P.translator.setTranslations(e ?? {}), P.translator.setLocale(t ?? "en");
|
|
18
23
|
}, {
|
|
19
24
|
immediate: !0,
|
|
20
25
|
flush: "sync"
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
});
|
|
27
|
+
let I = m(), L = _(() => u(I.props)), R = E(!1), z = _(() => d(N.panel.localization?.direction ?? "ltr", !0)), B = null, V = 0;
|
|
28
|
+
function H() {
|
|
29
|
+
V++, B && (B(), n(void 0)), B = null, R.value = !1;
|
|
30
|
+
}
|
|
31
|
+
function U() {
|
|
32
|
+
if (H(), L.value) return;
|
|
33
|
+
let e = V;
|
|
34
|
+
queueMicrotask(() => {
|
|
35
|
+
e !== V || a() || (B = i(), R.value = !0, n(l), o(P.registry));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return C(() => {
|
|
39
|
+
U(), A(L, U);
|
|
40
|
+
}), w(H), (e, t) => (T(), b(h, null, [x(k(M), { dir: N.panel.localization?.direction ?? "ltr" }, {
|
|
41
|
+
default: j(() => [x(r, { "delay-duration": 0 }, {
|
|
42
|
+
default: j(() => [D(e.$slots, "default")]),
|
|
24
43
|
_: 3
|
|
25
44
|
})]),
|
|
26
45
|
_: 3
|
|
27
|
-
}, 8, ["dir"]))
|
|
46
|
+
}, 8, ["dir"]), R.value ? (T(), v(g, {
|
|
47
|
+
key: 0,
|
|
48
|
+
to: "body"
|
|
49
|
+
}, [x(s, {
|
|
50
|
+
id: k(l),
|
|
51
|
+
position: k(f)(N.panel.toastPosition, z.value),
|
|
52
|
+
dir: z.value,
|
|
53
|
+
"rich-colors": "",
|
|
54
|
+
"close-button": ""
|
|
55
|
+
}, null, 8, [
|
|
56
|
+
"id",
|
|
57
|
+
"position",
|
|
58
|
+
"dir"
|
|
59
|
+
])])) : y("", !0)], 64));
|
|
28
60
|
}
|
|
29
61
|
});
|
|
30
62
|
//#endregion
|
|
31
|
-
export {
|
|
63
|
+
export { N as default };
|
|
32
64
|
|
|
33
65
|
//# sourceMappingURL=WidgetShell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetShell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","
|
|
1
|
+
{"version":3,"file":"WidgetShell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createVNode","_unref","_withCtx","TooltipProvider","_renderSlot","_createBlock","_Teleport","Toaster","_createCommentVNode","TooltipProvider_default","Toaster_default","WidgetShell_vue_vue_type_script_setup_true_lang_default","props","__props","context","widgetsAlfakitContext","page","computed","starterKitWidgetsPage","provideAlfakit","provideStandalone","toRef","watch","translations","tag","inertiaPage","usePage","alfakitPage","isAlfakitPage","ownsToaster","ref","placement","overlayPlacementDirection","releaseToaster","check","releaseHostToaster","setToasterId","claimHostToaster","current","hasToaster","claimToaster","STARTER_KIT_TOASTER_ID","ensureFlashToasts","onMounted","onUnmounted","openBlock","createElementBlock","Fragment","createVNode","unref","ConfigProvider","withCtx","renderSlot","_ctx","createBlock","Teleport","resolveToastPosition","createCommentVNode"],"sources":["../../../src/starter-kit/widgets/WidgetShell.vue"],"mappings":";;;;;;;;;;;;;;;;EAwBA,IAAMe,IAAQC,GAERC,IAAUC,EAAsB,GAChCC,IAAOC,QAAeC,EAAsB,CAAC;EAKnD,AAHAC,EAAeL,CAAO,GACtBM,EAAkB;GAAE,OAAOC,EAAMT,GAAO,OAAO;GAAG;EAAK,CAAC,GAExDU,QACQ,CAACV,EAAM,MAAM,cAAcA,EAAM,MAAM,cAAc,GAAG,IAC7D,CAACW,GAAcC,OAAS;GAEvB,AADAV,EAAQ,WAAW,gBAAgBS,KAAgB,CAAC,CAAC,GACrDT,EAAQ,WAAW,UAAUU,KAAO,IAAI;EAC1C,GACA;GAAE,WAAW;GAAM,OAAO;EAAO,CACnC;EAQA,IAAMC,IAAcC,EAAQ,GACtBC,IAAcV,QAAeW,EAAcH,EAAY,KAAK,CAAC,GAC7DI,IAAcC,EAAI,EAAK,GACvBC,IAAYd,QAChBe,EAA0BpB,EAAM,MAAM,cAAc,aAAa,OAAO,EAAI,CAC9E,GACIqB,IAAsC,MACtCC,IAAQ;EAEZ,SAASC,IAA2B;GASlC,AARA,KAEIF,MACFA,EAAe,GACfG,EAAa,KAAA,CAAS,IAGxB,IAAiB,MACjB,EAAY,QAAQ;EACtB;EAEA,SAASC,IAAyB;GAGhC,IAFAF,EAAmB,GAEfR,EAAY,OAAO;GAEvB,IAAMW,IAAUJ;GAEhB,qBAAqB;IACnB,AAAII,MAAYJ,KAASK,EAAW,MAEpC,IAAiBC,EAAa,GAC9B,EAAY,QAAQ,IAEpBJ,EAAaK,CAAsB,GACnCC,EAAkB5B,EAAQ,QAAQ;GACpC,CAAC;EACH;SAEA6B,QAAgB;GAEd,AADAN,EAAiB,GACjBf,EAAMK,GAAaU,CAAgB;EACrC,CAAC,GAEDO,EAAYT,CAAkB,cAI5BnC,EAAAA,GAAAA,EAAAA,GAAAA,MAAAA,CAAAA,EAIiBC,EAAAiD,CAAA,GAAA,EAJA,KAAKtC,EAAM,MAAM,cAAc,aAAS,MAAA,GAAA;GACvD,SAAAV,QAEkB,CAFlBF,EAEkBG,GAAA,EAFA,kBAAgB,EAAC,GAAA;IACjC,SAAAD,QAAQ,CAARE,EAAQiD,EAAA,QAAA,SAAA,CAAA,CAAA;;;;EAKI,GAAA,GAAA,CAAA,KAAA,CAAA,GAAAxB,EAAA,SAAhBhC,EAAA,GAAAQ,EAQWC,GAAA;;GARkB,IAAG;EAC9BN,GAAAA,CAAAA,EAMEO,GAAA;GALC,IAAIN,EAAAwC,CAAA;GACJ,UAAUxC,EAAAuD,CAAA,CAAoB,CAAC5C,EAAM,MAAM,eAAemB,EAAA,KAAS;GACnE,KAAKA,EAAA;GACN,eAAA;GACA,gBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfakit/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Vue 3 + shadcn-vue renderer for Alfakit, the Laravel admin panel builder by Alfa Six.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alfa Six (https://alfasixbh.com)",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"reka-ui": "^2.11.0",
|
|
97
97
|
"tailwind-merge": "^3.7.0",
|
|
98
98
|
"vue-sonner": "^2.0.9",
|
|
99
|
-
"@alfakit/core": "0.1.
|
|
99
|
+
"@alfakit/core": "0.1.13"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@inertiajs/vue3": "^3.0.0",
|
package/src/AlfakitRoot.vue
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@alfakit/core'
|
|
10
10
|
import { usePage } from '@inertiajs/vue3'
|
|
11
11
|
import { ConfigProvider } from 'reka-ui'
|
|
12
|
-
import { computed, watch } from 'vue'
|
|
12
|
+
import { computed, onMounted, onUnmounted, watch } from 'vue'
|
|
13
13
|
import ActionModals from './components/actions/ActionModals.vue'
|
|
14
14
|
import DevToolsSlot from './components/dev-tools/DevToolsSlot.vue'
|
|
15
15
|
import FlashToasts from './components/notifications/FlashToasts.vue'
|
|
@@ -20,6 +20,8 @@ import SchemaContractGuard from './components/panel/SchemaContractGuard.vue'
|
|
|
20
20
|
import Toaster from './components/ui/Toaster.vue'
|
|
21
21
|
import TooltipProvider from './components/ui/TooltipProvider.vue'
|
|
22
22
|
import { useAlfakit } from './context'
|
|
23
|
+
import { startIdScope } from './lib/hydration'
|
|
24
|
+
import { claimToaster } from './standalone/toaster-claims'
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Persistent layout rendered inside Inertia's page tree, so modals and toasts can read page
|
|
@@ -29,6 +31,9 @@ import { useAlfakit } from './context'
|
|
|
29
31
|
/** Starter kit mode: Alfakit's toaster gets an id so the host's id-less one never doubles its toasts. */
|
|
30
32
|
defineProps<{ toasterId?: string }>()
|
|
31
33
|
|
|
34
|
+
// Reka's ids inside AlfaKit don't depend on the host layout's (W-V2-13).
|
|
35
|
+
startIdScope()
|
|
36
|
+
|
|
32
37
|
const page = usePage<AlfakitPageProps>()
|
|
33
38
|
const { translator, registry } = useAlfakit()
|
|
34
39
|
|
|
@@ -63,6 +68,16 @@ watch(
|
|
|
63
68
|
{ immediate: true },
|
|
64
69
|
)
|
|
65
70
|
watch(panel, (value) => applyPanelTheme(value), { immediate: true })
|
|
71
|
+
|
|
72
|
+
// This root renders the toaster: starter kit header components and standalone components
|
|
73
|
+
// on the same page don't mount a second one.
|
|
74
|
+
let releaseToaster: (() => void) | null = null
|
|
75
|
+
|
|
76
|
+
onMounted(() => {
|
|
77
|
+
releaseToaster = claimToaster()
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
onUnmounted(() => releaseToaster?.())
|
|
66
81
|
</script>
|
|
67
82
|
|
|
68
83
|
<template>
|
package/src/lib/discovery.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from '@alfakit/core'
|
|
7
7
|
import { defineAsyncComponent, defineComponent, h } from 'vue'
|
|
8
8
|
import type { AnyComponent } from '../context'
|
|
9
|
+
import { startIdScope } from './hydration'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* A discovered component: rendered straight away once its code has loaded (the pages that
|
|
@@ -21,6 +22,11 @@ export function discoveredComponent(entry: DiscoveredEntry<AnyComponent>): AnyCo
|
|
|
21
22
|
// Chosen once per mount, so loading never remounts a field.
|
|
22
23
|
const Loaded = entry.current ?? Async
|
|
23
24
|
|
|
25
|
+
// The async component starts an id scope; a loaded one starts the same, so the server
|
|
26
|
+
// (which keeps loaded code between requests) and a hydrating browser that still loads
|
|
27
|
+
// it number Reka's ids alike (W-V2-13, W-V3-28).
|
|
28
|
+
if (Loaded !== Async) startIdScope()
|
|
29
|
+
|
|
24
30
|
return () => h(Loaded, attrs, slots)
|
|
25
31
|
},
|
|
26
32
|
})
|
package/src/lib/hydration.ts
CHANGED
|
@@ -12,12 +12,17 @@ const mountedApps = new WeakMap<AppContext, Ref<boolean>>()
|
|
|
12
12
|
* the server render and hydration), then `true` for every component in that app, so
|
|
13
13
|
* content rendered later draws at once (reactive). Lazily loaded parts (named icons, heavy
|
|
14
14
|
* fields) render their server markup until then, whatever has loaded already.
|
|
15
|
+
*
|
|
16
|
+
* A component that hydrates server markup after the app mounted (inside an async
|
|
17
|
+
* component whose code arrived later, such as a lazily split built-in) waits for its own
|
|
18
|
+
* mount: its server markup is the fallback too (W-V3-28).
|
|
15
19
|
*/
|
|
16
20
|
export function useAppMounted(): Ref<boolean> {
|
|
17
|
-
const
|
|
21
|
+
const instance = getCurrentInstance()
|
|
22
|
+
const context = instance?.appContext
|
|
18
23
|
|
|
19
24
|
// Outside a component there is no hydration to wait for.
|
|
20
|
-
if (!context) return ref(true)
|
|
25
|
+
if (!instance || !context) return ref(true)
|
|
21
26
|
|
|
22
27
|
let mounted = mountedApps.get(context)
|
|
23
28
|
|
|
@@ -27,9 +32,40 @@ export function useAppMounted(): Ref<boolean> {
|
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
const flag = mounted
|
|
35
|
+
|
|
36
|
+
// Hydration hands each component its server element before setup runs.
|
|
37
|
+
if (instance.vnode.el && flag.value) {
|
|
38
|
+
const own = ref(false)
|
|
39
|
+
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
own.value = true
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
return own
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
onMounted(() => {
|
|
31
48
|
flag.value = true
|
|
32
49
|
})
|
|
33
50
|
|
|
34
51
|
return flag
|
|
35
52
|
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Start a new `useId()` scope at the current component, as Vue does at an async component
|
|
56
|
+
* (its internal `markAsyncBoundary()`): ids below it are numbered from zero under a prefix
|
|
57
|
+
* that counts scopes, not the ids generated before it. So
|
|
58
|
+
* - AlfaKit's ids don't follow the host layout's (a starter kit's sidebar renders a sheet on
|
|
59
|
+
* phones in the browser but the desktop sidebar on the server), and
|
|
60
|
+
* - a lazily split component renders the same ids whether its code was loaded before
|
|
61
|
+
* rendering (the server after its first request) or arrives during hydration (an async
|
|
62
|
+
* component, which starts a scope itself).
|
|
63
|
+
*/
|
|
64
|
+
export function startIdScope(): void {
|
|
65
|
+
const instance = getCurrentInstance() as { ids?: [string, number, number] } | null
|
|
66
|
+
const ids = instance?.ids
|
|
67
|
+
|
|
68
|
+
if (!instance || !Array.isArray(ids) || ids.length !== 3) return
|
|
69
|
+
|
|
70
|
+
instance.ids = [`${ids[0]}${ids[2]++}-`, 0, 0]
|
|
71
|
+
}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type AlfakitContextValue,
|
|
22
22
|
type AnyComponent,
|
|
23
23
|
} from '../context'
|
|
24
|
+
import { startIdScope } from '../lib/hydration'
|
|
24
25
|
import { cn } from '../lib/utils'
|
|
25
26
|
import ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'
|
|
26
27
|
import AlfakitToaster from './AlfakitToaster.vue'
|
|
@@ -59,6 +60,9 @@ defineSlots<{
|
|
|
59
60
|
default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown
|
|
60
61
|
}>()
|
|
61
62
|
|
|
63
|
+
// Reka's ids inside the component don't depend on the host page's (W-V2-13).
|
|
64
|
+
startIdScope()
|
|
65
|
+
|
|
62
66
|
const parent = useOptionalAlfakit()
|
|
63
67
|
const inertiaPage = usePage()
|
|
64
68
|
|
|
@@ -95,20 +95,8 @@ export function createStandaloneContext(
|
|
|
95
95
|
|
|
96
96
|
// ---------------------------------------------------------------- Toaster ownership
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/** An `<AlfakitToaster>` (or the component that took the role) is mounted; returns a release. */
|
|
101
|
-
export function claimToaster(): () => void {
|
|
102
|
-
toasters++
|
|
103
|
-
|
|
104
|
-
return () => {
|
|
105
|
-
toasters--
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export function hasToaster(): boolean {
|
|
110
|
-
return toasters > 0
|
|
111
|
-
}
|
|
98
|
+
// In a module of its own: the starter kit header components check it without loading this one.
|
|
99
|
+
export { claimToaster, hasToaster } from './toaster-claims'
|
|
112
100
|
|
|
113
101
|
// ---------------------------------------------------------------- Flashed notifications
|
|
114
102
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Who renders AlfaKit's toaster on the page: `<AlfakitToaster>`, `AlfakitRoot`, the first
|
|
2
|
+
// standalone component or the starter kit header components on the host's own pages.
|
|
3
|
+
let toasters = 0
|
|
4
|
+
|
|
5
|
+
/** An `<AlfakitToaster>` (or the component that took the role) is mounted; returns a release. */
|
|
6
|
+
export function claimToaster(): () => void {
|
|
7
|
+
toasters++
|
|
8
|
+
|
|
9
|
+
return () => {
|
|
10
|
+
toasters--
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function hasToaster(): boolean {
|
|
15
|
+
return toasters > 0
|
|
16
|
+
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
isAlfakitPage,
|
|
4
|
+
overlayPlacementDirection,
|
|
5
|
+
resolveToastPosition,
|
|
6
|
+
STARTER_KIT_TOASTER_ID,
|
|
7
|
+
starterKitWidgetsPage,
|
|
8
|
+
type PanelSchema,
|
|
9
|
+
} from '@alfakit/core'
|
|
10
|
+
import { usePage } from '@inertiajs/vue3'
|
|
3
11
|
import { ConfigProvider } from 'reka-ui'
|
|
4
|
-
import { computed, toRef, watch } from 'vue'
|
|
12
|
+
import { computed, onMounted, onUnmounted, ref, toRef, watch } from 'vue'
|
|
13
|
+
import { setToasterId } from '../../components/notifications/flash-toasts'
|
|
14
|
+
import Toaster from '../../components/ui/Toaster.vue'
|
|
5
15
|
import TooltipProvider from '../../components/ui/TooltipProvider.vue'
|
|
6
16
|
import { provideAlfakit, provideStandalone } from '../../context'
|
|
17
|
+
import { ensureFlashToasts } from '../../standalone/runtime'
|
|
18
|
+
import { claimToaster, hasToaster } from '../../standalone/toaster-claims'
|
|
7
19
|
import { widgetsAlfakitContext } from './use-widgets'
|
|
8
20
|
|
|
9
21
|
/**
|
|
@@ -26,6 +38,58 @@ watch(
|
|
|
26
38
|
},
|
|
27
39
|
{ immediate: true, flush: 'sync' },
|
|
28
40
|
)
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* On the host's own pages no AlfaKit toaster is mounted, so the first loaded header
|
|
44
|
+
* component renders one: the push toggle's and the PWA's messages show there too (W-S1-03).
|
|
45
|
+
* AlfaKit pages (`AlfakitRoot`) and standalone components claim it themselves; the check
|
|
46
|
+
* runs after every component mounted, and again after each visit.
|
|
47
|
+
*/
|
|
48
|
+
const inertiaPage = usePage()
|
|
49
|
+
const alfakitPage = computed(() => isAlfakitPage(inertiaPage.props))
|
|
50
|
+
const ownsToaster = ref(false)
|
|
51
|
+
const placement = computed(() =>
|
|
52
|
+
overlayPlacementDirection(props.panel.localization?.direction ?? 'ltr', true),
|
|
53
|
+
)
|
|
54
|
+
let releaseToaster: (() => void) | null = null
|
|
55
|
+
let check = 0
|
|
56
|
+
|
|
57
|
+
function releaseHostToaster(): void {
|
|
58
|
+
check++
|
|
59
|
+
|
|
60
|
+
if (releaseToaster) {
|
|
61
|
+
releaseToaster()
|
|
62
|
+
setToasterId(undefined)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
releaseToaster = null
|
|
66
|
+
ownsToaster.value = false
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function claimHostToaster(): void {
|
|
70
|
+
releaseHostToaster()
|
|
71
|
+
|
|
72
|
+
if (alfakitPage.value) return
|
|
73
|
+
|
|
74
|
+
const current = check
|
|
75
|
+
|
|
76
|
+
queueMicrotask(() => {
|
|
77
|
+
if (current !== check || hasToaster()) return
|
|
78
|
+
|
|
79
|
+
releaseToaster = claimToaster()
|
|
80
|
+
ownsToaster.value = true
|
|
81
|
+
// As `<AlfakitToaster>`: Alfakit's toasts and flashed notifications go to this one.
|
|
82
|
+
setToasterId(STARTER_KIT_TOASTER_ID)
|
|
83
|
+
ensureFlashToasts(context.registry)
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
claimHostToaster()
|
|
89
|
+
watch(alfakitPage, claimHostToaster)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
onUnmounted(releaseHostToaster)
|
|
29
93
|
</script>
|
|
30
94
|
|
|
31
95
|
<template>
|
|
@@ -34,4 +98,15 @@ watch(
|
|
|
34
98
|
<slot />
|
|
35
99
|
</TooltipProvider>
|
|
36
100
|
</ConfigProvider>
|
|
101
|
+
<!-- In the body, not in the header (a header with a backdrop filter would hold its fixed
|
|
102
|
+
position), placed in the document's direction as on AlfaKit pages. -->
|
|
103
|
+
<Teleport v-if="ownsToaster" to="body">
|
|
104
|
+
<Toaster
|
|
105
|
+
:id="STARTER_KIT_TOASTER_ID"
|
|
106
|
+
:position="resolveToastPosition(props.panel.toastPosition, placement)"
|
|
107
|
+
:dir="placement"
|
|
108
|
+
rich-colors
|
|
109
|
+
close-button
|
|
110
|
+
/>
|
|
111
|
+
</Teleport>
|
|
37
112
|
</template>
|