@alfakit/vue 0.1.9 → 0.1.10
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/app/components.d.ts.map +1 -1
- package/dist/app/components.js +1 -0
- package/dist/app/components.js.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.js.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue.d.ts.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/CheckboxListField.js.map +1 -1
- package/dist/components/fields/CheckboxListField.vue.d.ts.map +1 -1
- package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/DatePickerField.js.map +1 -1
- package/dist/components/fields/DatePickerField.vue.d.ts.map +1 -1
- package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js +34 -32
- package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.js.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue.d.ts +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue.d.ts.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js +29 -23
- package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.js.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.vue.d.ts.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.vue.d.ts.map +1 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/CalloutComponent.js.map +1 -1
- package/dist/components/layout/CalloutComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js +43 -39
- package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/EmptyStateComponent.js.map +1 -1
- package/dist/components/layout/EmptyStateComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js +29 -26
- package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/MixedContent.js.map +1 -1
- package/dist/components/layout/MixedContent.vue.d.ts +5 -3
- package/dist/components/layout/MixedContent.vue.d.ts.map +1 -1
- package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/SectionComponent.js.map +1 -1
- package/dist/components/layout/SectionComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue.d.ts.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js +133 -104
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.js.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue.d.ts.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js +20 -19
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/ColumnManager.js.map +1 -1
- package/dist/components/table/ColumnManager.vue.d.ts.map +1 -1
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/Spreadsheet.js.map +1 -1
- package/dist/components/table/Spreadsheet.vue.d.ts.map +1 -1
- package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js +37 -33
- package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.js.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue.d.ts.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/SidebarMenuButton.js.map +1 -1
- package/dist/components/ui/SidebarMenuButton.vue.d.ts.map +1 -1
- package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/widgets/StatCard.js.map +1 -1
- package/dist/components/widgets/StatCard.vue.d.ts.map +1 -1
- package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/eject-manifest.json +2 -2
- package/dist/pages/AlfakitPage.js.map +1 -1
- package/dist/pages/AlfakitPage.vue.d.ts.map +1 -1
- package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js +16 -19
- package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitComponent.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 +2 -2
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/runtime.d.ts.map +1 -1
- package/dist/standalone/runtime.js +25 -25
- package/dist/standalone/runtime.js.map +1 -1
- package/dist/standalone.css +2 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.js.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/starter-kit/navigation.d.ts +6 -1
- package/dist/starter-kit/navigation.d.ts.map +1 -1
- package/dist/starter-kit/navigation.js +11 -10
- package/dist/starter-kit/navigation.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/themes.css +4 -0
- package/package.json +2 -2
- package/src/app/components.ts +3 -0
- package/src/components/dev-tools/DevToolsInspector.vue +1 -1
- package/src/components/fields/CheckboxListField.vue +2 -2
- package/src/components/fields/DatePickerField.vue +1 -0
- package/src/components/fields/RichEditorSuggestions.vue +13 -6
- package/src/components/fields/RichEditorToolbarGroup.vue +16 -1
- package/src/components/file-manager/FileManagerView.vue +3 -1
- package/src/components/layout/CalloutComponent.vue +15 -2
- package/src/components/layout/EmptyStateComponent.vue +10 -1
- package/src/components/layout/MixedContent.vue +12 -4
- package/src/components/layout/SectionComponent.vue +20 -4
- package/src/components/notifications/NotificationsMenu.vue +45 -1
- package/src/components/panel/ShortcutsOverlay.vue +27 -22
- package/src/components/table/ColumnManager.vue +6 -4
- package/src/components/table/Spreadsheet.vue +9 -4
- package/src/components/translation-manager/TranslationManagerView.vue +1 -1
- package/src/components/ui/SidebarMenuButton.vue +6 -0
- package/src/components/widgets/StatCard.vue +6 -3
- package/src/pages/AlfakitPage.vue +13 -3
- package/src/standalone/AlfakitComponent.vue +8 -4
- package/src/standalone/runtime.ts +3 -0
- package/src/starter-kit/AlfakitStarterKitRoot.vue +3 -2
- package/src/starter-kit/navigation.ts +12 -1
- package/src/styles.css +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitPage.js","names":["_sfc_main","AlfakitPage_vue_vue_type_script_setup_true_lang_default","AlfakitPage_default"],"sources":["../../src/pages/AlfakitPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {
|
|
1
|
+
{"version":3,"file":"AlfakitPage.js","names":["_sfc_main","AlfakitPage_vue_vue_type_script_setup_true_lang_default","AlfakitPage_default"],"sources":["../../src/pages/AlfakitPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n customPageProps,\n openDefaultAction,\n resolveLazyComponents,\n type DefaultActionOpener,\n} from '@alfakit/core'\nimport { Head } from '@inertiajs/vue3'\nimport { computed, onMounted, watch } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport { useActionRunner, useAlfakit, useAlfakitProps, usePanel, useT } from '../context'\nimport PageContent from './PageContent.vue'\nimport PageShell from './PageShell.vue'\n\n/**\n * `Alfakit/Page`: renders any schema-driven page. Custom pages (`Page::$component`) are\n * resolved from the `pages` map passed to `createAlfakit()`.\n */\nconst props = useAlfakitProps()\nconst panel = usePanel()\nconst t = useT()\nconst { pages } = useAlfakit()\n// Lazy widgets and relation managers arrive in a deferred prop after the first response.\nconst page = computed(() =>\n props.value.page ? resolveLazyComponents(props.value.page, props.value.alfakitLazy) : undefined,\n)\n// Starter kit mode: the host's `title` callback adds the application name.\nconst title = computed(() =>\n page.value\n ? panel.value.starterKit\n ? page.value.title\n : `${page.value.title} - ${panel.value.brandName}`\n : panel.value.brandName,\n)\nconst custom = computed(() => (page.value?.view ? pages[page.value.view.component] : undefined))\n// A custom component brings its own `PageShell` (as in panel mode, where it is the Inertia\n// page itself) and takes the live props, so `reloadProps()` reaches it.\nconst customProps = computed(() =>\n customPageProps(page.value?.view?.props, props.value as Record<string, unknown>),\n)\n\n// The page's default action (`$defaultAction`, `?tableAction=`) opens once the page has\n// hydrated, and once per page: re-renders after the action ran don't open it again.\nconst runner = useActionRunner()\nconst opener: DefaultActionOpener = { opened: null }\nconst openDefault = () =>\n openDefaultAction(page.value, opener, (action, context) => runner.trigger(action, context))\n\nonMounted(() => {\n openDefault()\n watch(page, openDefault)\n})\n\nprovidePageActionContext({\n get token() {\n return page.value?.token ?? ''\n },\n component: 'page',\n})\n</script>\n\n<template>\n <template v-if=\"page\">\n <Head :title=\"title\" />\n <div v-if=\"page.view && !custom\" class=\"text-destructive p-6\">\n {{\n t(\n 'page_not_registered',\n { component: page.view.component },\n `Page component ${page.view.component} is not registered in createAlfakit({ pages }).`,\n )\n }}\n </div>\n <component :is=\"custom\" v-else-if=\"page.view && custom\" v-bind=\"customProps\" :page=\"page\" />\n <PageShell v-else :page=\"page\">\n <PageContent :page=\"page\" />\n </PageShell>\n </template>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitPage.vue.d.ts","sourceRoot":"","sources":["../../src/pages/AlfakitPage.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AlfakitPage.vue.d.ts","sourceRoot":"","sources":["../../src/pages/AlfakitPage.vue"],"names":[],"mappings":";AAsOA,wBAKG"}
|
|
@@ -2,37 +2,34 @@ import { useActionRunner as e, useAlfakit as t, useAlfakitProps as n, usePanel a
|
|
|
2
2
|
import { providePageActionContext as a } from "../components/actions/action-context.js";
|
|
3
3
|
import o from "./PageShell.js";
|
|
4
4
|
import s from "./PageContent.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Head as
|
|
7
|
-
import { Fragment as
|
|
5
|
+
import { customPageProps as c, openDefaultAction as l, resolveLazyComponents as u } from "@alfakit/core";
|
|
6
|
+
import { Head as d } from "@inertiajs/vue3";
|
|
7
|
+
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createVNode as _, defineComponent as v, mergeProps as y, onMounted as b, openBlock as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, watch as T, withCtx as E } from "vue";
|
|
8
8
|
//#region src/pages/AlfakitPage.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var D = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-destructive p-6"
|
|
12
|
-
},
|
|
12
|
+
}, O = /*@__PURE__*/ v({
|
|
13
13
|
__name: "AlfakitPage",
|
|
14
|
-
setup(
|
|
15
|
-
let
|
|
16
|
-
return
|
|
17
|
-
|
|
14
|
+
setup(v) {
|
|
15
|
+
let O = n(), k = r(), A = i(), { pages: j } = t(), M = p(() => O.value.page ? u(O.value.page, O.value.alfakitLazy) : void 0), N = p(() => M.value ? k.value.starterKit ? M.value.title : `${M.value.title} - ${k.value.brandName}` : k.value.brandName), P = p(() => M.value?.view ? j[M.value.view.component] : void 0), F = p(() => c(M.value?.view?.props, O.value)), I = e(), L = { opened: null }, R = () => l(M.value, L, (e, t) => I.trigger(e, t));
|
|
16
|
+
return b(() => {
|
|
17
|
+
R(), T(M, R);
|
|
18
18
|
}), a({
|
|
19
19
|
get token() {
|
|
20
|
-
return
|
|
20
|
+
return M.value?.token ?? "";
|
|
21
21
|
},
|
|
22
22
|
component: "page"
|
|
23
|
-
}), (e, t) =>
|
|
24
|
-
key:
|
|
25
|
-
page:
|
|
23
|
+
}), (e, t) => M.value ? (x(), g(f, { key: 0 }, [_(w(d), { title: N.value }, null, 8, ["title"]), M.value.view && !P.value ? (x(), g("div", D, C(w(A)("page_not_registered", { component: M.value.view.component }, `Page component ${M.value.view.component} is not registered in createAlfakit({ pages }).`)), 1)) : M.value.view && P.value ? (x(), m(S(P.value), y({ key: 1 }, F.value, { page: M.value }), null, 16, ["page"])) : (x(), m(o, {
|
|
24
|
+
key: 2,
|
|
25
|
+
page: M.value
|
|
26
26
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
key: 1,
|
|
29
|
-
page: j.value
|
|
30
|
-
}, null, 8, ["page"]))]),
|
|
27
|
+
default: E(() => [_(s, { page: M.value }, null, 8, ["page"])]),
|
|
31
28
|
_: 1
|
|
32
|
-
}, 8, ["page"]))], 64)) :
|
|
29
|
+
}, 8, ["page"]))], 64)) : h("", !0);
|
|
33
30
|
}
|
|
34
31
|
});
|
|
35
32
|
//#endregion
|
|
36
|
-
export {
|
|
33
|
+
export { O as default };
|
|
37
34
|
|
|
38
35
|
//# sourceMappingURL=AlfakitPage.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitPage.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createVNode","_unref","_toDisplayString","_createBlock","
|
|
1
|
+
{"version":3,"file":"AlfakitPage.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_Fragment","_createVNode","_unref","_toDisplayString","_createBlock","_resolveDynamicComponent","_mergeProps","PageShell","_withCtx","PageContent","_createCommentVNode","PageShell_default","PageContent_default","_hoisted_1","AlfakitPage_vue_vue_type_script_setup_true_lang_default","props","useAlfakitProps","panel","usePanel","t","useT","useAlfakit","page","computed","resolveLazyComponents","title","custom","pages","customProps","customPageProps","runner","useActionRunner","opener","openDefault","openDefaultAction","action","context","onMounted","watch","providePageActionContext","openBlock","createElementBlock","Fragment","createVNode","unref","Head","toDisplayString","createBlock","resolveDynamicComponent","mergeProps","withCtx","createCommentVNode"],"sources":["../../src/pages/AlfakitPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n customPageProps,\n openDefaultAction,\n resolveLazyComponents,\n type DefaultActionOpener,\n} from '@alfakit/core'\nimport { Head } from '@inertiajs/vue3'\nimport { computed, onMounted, watch } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport { useActionRunner, useAlfakit, useAlfakitProps, usePanel, useT } from '../context'\nimport PageContent from './PageContent.vue'\nimport PageShell from './PageShell.vue'\n\n/**\n * `Alfakit/Page`: renders any schema-driven page. Custom pages (`Page::$component`) are\n * resolved from the `pages` map passed to `createAlfakit()`.\n */\nconst props = useAlfakitProps()\nconst panel = usePanel()\nconst t = useT()\nconst { pages } = useAlfakit()\n// Lazy widgets and relation managers arrive in a deferred prop after the first response.\nconst page = computed(() =>\n props.value.page ? resolveLazyComponents(props.value.page, props.value.alfakitLazy) : undefined,\n)\n// Starter kit mode: the host's `title` callback adds the application name.\nconst title = computed(() =>\n page.value\n ? panel.value.starterKit\n ? page.value.title\n : `${page.value.title} - ${panel.value.brandName}`\n : panel.value.brandName,\n)\nconst custom = computed(() => (page.value?.view ? pages[page.value.view.component] : undefined))\n// A custom component brings its own `PageShell` (as in panel mode, where it is the Inertia\n// page itself) and takes the live props, so `reloadProps()` reaches it.\nconst customProps = computed(() =>\n customPageProps(page.value?.view?.props, props.value as Record<string, unknown>),\n)\n\n// The page's default action (`$defaultAction`, `?tableAction=`) opens once the page has\n// hydrated, and once per page: re-renders after the action ran don't open it again.\nconst runner = useActionRunner()\nconst opener: DefaultActionOpener = { opened: null }\nconst openDefault = () =>\n openDefaultAction(page.value, opener, (action, context) => runner.trigger(action, context))\n\nonMounted(() => {\n openDefault()\n watch(page, openDefault)\n})\n\nprovidePageActionContext({\n get token() {\n return page.value?.token ?? ''\n },\n component: 'page',\n})\n</script>\n\n<template>\n <template v-if=\"page\">\n <Head :title=\"title\" />\n <div v-if=\"page.view && !custom\" class=\"text-destructive p-6\">\n {{\n t(\n 'page_not_registered',\n { component: page.view.component },\n `Page component ${page.view.component} is not registered in createAlfakit({ pages }).`,\n )\n }}\n </div>\n <component :is=\"custom\" v-else-if=\"page.view && custom\" v-bind=\"customProps\" :page=\"page\" />\n <PageShell v-else :page=\"page\">\n <PageContent :page=\"page\" />\n </PageShell>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAkBA,IAAMiB,IAAQC,EAAgB,GACxBC,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EAA5EqB,EAAA,KAAM,GAAtBpB,EAA4F,EAAA,KAAA,EAAA,GAA5BsB,EAAA,OAAW,EAAG,MAAMN,EAAA,MAAI,CAAA,GAAA,MAAA,IAAA,CAAA,MAAA,CAAA,MACxFxB,EAAA,GAAAM,EAEYG,GAAA;;GAFO,MAAMe,EAAA;;GACvB,SAAAd,QAA4B,CAA5BP,EAA4BQ,GAAA,EAAd,MAAMa,EAAA,MAAI,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitComponent.js","names":["_sfc_main","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","AlfakitComponent_default"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\n// Inside a panel page: the panel's registry and translator, but this component's own action\n// runner, so its actions post to its own endpoints with its own token (not the panel's: 403).\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n actions: createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ).actions,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\
|
|
1
|
+
{"version":3,"file":"AlfakitComponent.js","names":["_sfc_main","AlfakitComponent_vue_vue_type_script_setup_true_lang_default","AlfakitComponent_default"],"sources":["../../src/standalone/AlfakitComponent.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\n// Inside a panel page: the panel's registry and translator, but this component's own action\n// runner, so its actions post to its own endpoints with its own token (not the panel's: 403).\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n actions: createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ).actions,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\n// Partial reloads (sorting, paging, inline edits) request this component's own prop.\n// Registered in setup (browser only), before the children's `onMounted`: a `deferLoading()`\n// table's first reload must already ask for this prop, not the panel `page` prop.\nif (typeof window !== 'undefined') {\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n}\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // The watcher runs before the new payload renders: hand it over, or the response would\n // count as stale and lazy widgets (a calendar after its action) keep their old schema.\n watch(\n () => props.component.token,\n () => void state.loadLazy(props.component),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed :dir=\"direction\" />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":""}
|
|
@@ -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":"AA4NA,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;AAYnB;;;;;;;;;;;;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;AA+QF,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"}
|
|
@@ -70,8 +70,8 @@ var L = ["data-alfakit-component", "dir"], R = {
|
|
|
70
70
|
flush: "sync"
|
|
71
71
|
});
|
|
72
72
|
let $ = O(!1);
|
|
73
|
-
return T(() => {
|
|
74
|
-
if (d(), P(() =>
|
|
73
|
+
return typeof window < "u" && P(() => ne(W.props, H.component), (e, t, n) => n(re(e ?? null)), { immediate: !0 }), T(() => {
|
|
74
|
+
if (d(), P(() => H.component.token, () => void K.loadLazy(H.component), { immediate: !0 }), U) return;
|
|
75
75
|
let e = null, t = !1;
|
|
76
76
|
queueMicrotask(() => {
|
|
77
77
|
t || f() || (e = c(), $.value = !0);
|
|
@@ -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","onMounted","ensureStandaloneRuntime","findStandalonePropName","onCleanup","registerStandaloneProp","name","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"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\n// Inside a panel page: the panel's registry and translator, but this component's own action\n// runner, so its actions post to its own endpoints with its own token (not the panel's: 403).\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n actions: createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ).actions,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // Partial reloads (sorting, paging, inline edits) request this component's own prop.\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n\n // The watcher runs before the new payload renders: hand it over, or the response would\n // count as stale and lazy widgets (a calendar after its action) keep their old schema.\n watch(\n () => props.component.token,\n () => void state.loadLazy(props.component),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed :dir=\"direction\" />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CA,IAAM8B,IAAQC,GAcRC,IAASC,EAAmB,GAC5BC,IAAcC,EAAQ,GAGtBC,IAAUC,EAAI,CAAC,GACfC,IAAQ,IAAIC,GAAyBT,EAAM,iBAAiB,EAAQ,OAAO,GAC3EU,KAAQ,GAAgB,MAC5BF,EAAM,KAAKG,GAAQC,CAAQ,GACvBC,KAAW,MAAsBL,EAAM,QAAQM,CAAO,GAItDC,IAA+Bb,IACjC;GACE,GAAGA;GACH,SAASc,EACP;IAAE,QAAQhB,EAAM,UAAU,UAAU;IAAQ,OAAOA,EAAM,UAAU,UAAU;GAAM,GACnFA,EAAM,YACNU,CACF,CAAC,CAAC;GACF,UAAUO,EAAyBjB,EAAM,YAAYE,EAAO,QAAQ;GACpE;GACA;EACF,IACA;GACE,GAAGc,EACD;IAAE,QAAQhB,EAAM,UAAU,UAAU;IAAQ,OAAOA,EAAM,UAAU,UAAU;GAAM,GACnFA,EAAM,YACNU,CACF;GACA;EACF;EAEJ,GAAQQ,GAAaH,CAAO;EAE5B,IAAMI,KAAQC,QAAeC,EAAsBrB,EAAM,SAAS,CAAC,GAC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B/E,EAAgBW,CAAA;KACM0C,EAAA,SAAtB3D,EAAA,GAAAC,EAA8DiB,GAAA;;MAA3B,SAAA;MAAS,KAAKmC,EAAA"}
|
|
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"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n StandaloneComponentState,\n findStandalonePropName,\n registerStandaloneProp,\n standalonePanelSchema,\n type ContentBlock,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { ConfigProvider } from 'reka-ui'\nimport { computed, onMounted, onScopeDispose, provide, ref, watch, type HTMLAttributes } from 'vue'\nimport { providePageActionContext } from '../components/actions/action-context'\nimport ActionList from '../components/actions/ActionList.vue'\nimport ActionModals from '../components/actions/ActionModals.vue'\nimport TooltipProvider from '../components/ui/TooltipProvider.vue'\nimport {\n ALFAKIT_KEY,\n provideStandalone,\n useOptionalAlfakit,\n type AlfakitContextValue,\n type AnyComponent,\n} from '../context'\nimport { cn } from '../lib/utils'\nimport ContentBlockRenderer from '../pages/ContentBlockRenderer.vue'\nimport AlfakitToaster from './AlfakitToaster.vue'\nimport {\n claimToaster,\n createStandaloneContext,\n createStandaloneRegistry,\n ensureStandaloneRuntime,\n hasToaster,\n} from './runtime'\n\n/**\n * Renders an Alfakit component outside a panel: a form, table, infolist, widgets or any mix\n * (`AlfaSix\\Alfakit\\Standalone\\*`) in any Inertia page of the application. Needs no\n * `createAlfakit()` and no panel layout: it provides its own translator, registry, action\n * runner and modals, and inherits the application's shadcn tokens.\n *\n * ```vue\n * <AlfakitComponent :component=\"orders\" class=\"max-w-4xl\" />\n * ```\n *\n * Slots: `header` (above the content blocks), `footer` (below), and the default slot to\n * render the blocks yourself: `<template #default=\"{ blocks }\">…<ContentBlockRenderer :block=\"…\" />`.\n */\nconst props = defineProps<{\n /** The payload: `ContactForm::make()` passed as an Inertia prop. */\n component: StandaloneComponentSchema\n /** Renderer overrides for this instance (`{ TextInput: MyInput }`), on top of `configureAlfakit()`. */\n components?: Record<string, AnyComponent>\n class?: HTMLAttributes['class']\n}>()\n\ndefineSlots<{\n header?: () => unknown\n footer?: () => unknown\n default?: (props: { blocks: ContentBlock[]; page: StandaloneComponentSchema }) => unknown\n}>()\n\nconst parent = useOptionalAlfakit()\nconst inertiaPage = usePage()\n\n// Lazy and polled schemas of this component, merged into the page it renders.\nconst version = ref(0)\nconst state = new StandaloneComponentState(props.component, () => version.value++)\nconst poll = (target: string, interval: string | number | null | undefined) =>\n state.poll(target, interval)\nconst refresh = (targets: string[]) => state.refresh(targets)\n\n// Inside a panel page: the panel's registry and translator, but this component's own action\n// runner, so its actions post to its own endpoints with its own token (not the panel's: 403).\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\n actions: createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ).actions,\n registry: createStandaloneRegistry(props.components, parent.registry),\n poll,\n refresh,\n }\n : {\n ...createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\n ),\n refresh,\n }\n\nprovide(ALFAKIT_KEY, context)\n\nconst panel = computed(() => standalonePanelSchema(props.component))\nconst page = computed(() => {\n void version.value\n state.setComponent(props.component)\n\n return state.page\n})\nconst direction = computed(() => props.component.localization?.direction ?? 'ltr')\nconst actionContext = computed(() => ({ token: props.component.token, component: 'page' }))\n\nprovideStandalone({ panel, page })\nprovidePageActionContext(actionContext.value)\n\n// Endpoints and strings follow the latest payload (they change per locale or path).\nwatch(\n () => props.component,\n (component) => {\n context.actions.setEndpoints({\n action: component.endpoints.action,\n modal: component.endpoints.modal,\n })\n\n // Inside `createAlfakit()` the panel feeds the shared translator; on a page without the\n // `alfakit` prop (the rest of the app) the component's own translations apply.\n if (!parent || !(inertiaPage.props as Record<string, unknown>).alfakit) {\n context.translator.setTranslations(component.translations ?? {})\n context.translator.setLocale(component.localization?.tag ?? 'en')\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\n// Toasts: use the layout's <AlfakitToaster /> when there is one, else the first component\n// on the page renders one (checked after every component mounted).\nconst ownsToaster = ref(false)\n\n// Partial reloads (sorting, paging, inline edits) request this component's own prop.\n// Registered in setup (browser only), before the children's `onMounted`: a `deferLoading()`\n// table's first reload must already ask for this prop, not the panel `page` prop.\nif (typeof window !== 'undefined') {\n watch(\n () => findStandalonePropName(inertiaPage.props as Record<string, unknown>, props.component),\n (name, _old, onCleanup) => onCleanup(registerStandaloneProp(name ?? null)),\n { immediate: true },\n )\n}\n\nonMounted(() => {\n ensureStandaloneRuntime()\n\n // The watcher runs before the new payload renders: hand it over, or the response would\n // count as stale and lazy widgets (a calendar after its action) keep their old schema.\n watch(\n () => props.component.token,\n () => void state.loadLazy(props.component),\n { immediate: true },\n )\n\n if (parent) return\n\n let release: (() => void) | null = null\n let cancelled = false\n\n queueMicrotask(() => {\n if (cancelled || hasToaster()) return\n\n release = claimToaster()\n ownsToaster.value = true\n })\n\n onScopeDispose(() => {\n cancelled = true\n release?.()\n })\n})\n</script>\n\n<template>\n <component\n :is=\"parent ? 'div' : ConfigProvider\"\n :dir=\"parent ? undefined : direction\"\n :class=\"parent ? 'contents' : undefined\"\n >\n <TooltipProvider :delay-duration=\"0\">\n <div\n data-slot=\"standalone\"\n :data-alfakit-component=\"props.component.class\"\n :dir=\"direction\"\n :class=\"cn('flex flex-col gap-6', props.class)\"\n >\n <header\n v-if=\"page.heading || page.headerActions?.length\"\n data-slot=\"page-header\"\n class=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div class=\"min-w-0\">\n <h2 v-if=\"page.heading\" class=\"text-xl font-semibold tracking-tight\">\n {{ page.heading }}\n </h2>\n <p v-if=\"page.subheading\" class=\"text-muted-foreground mt-1 text-sm\">\n {{ page.subheading }}\n </p>\n </div>\n <ActionList\n v-if=\"page.headerActions && page.headerActions.length > 0\"\n :actions=\"page.headerActions\"\n :context=\"actionContext\"\n align=\"end\"\n class=\"max-w-full shrink-0\"\n />\n </header>\n <slot name=\"header\" />\n <slot :blocks=\"page.content\" :page=\"props.component\">\n <ContentBlockRenderer v-for=\"block in page.content\" :key=\"block.key\" :block=\"block\" />\n </slot>\n <slot name=\"footer\" />\n </div>\n <ActionModals />\n <AlfakitToaster v-if=\"ownsToaster\" claimed :dir=\"direction\" />\n </TooltipProvider>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CA,IAAM8B,IAAQC,GAcRC,IAASC,EAAmB,GAC5BC,IAAcC,EAAQ,GAGtBC,IAAUC,EAAI,CAAC,GACfC,IAAQ,IAAIC,GAAyBT,EAAM,iBAAiB,EAAQ,OAAO,GAC3EU,KAAQ,GAAgB,MAC5BF,EAAM,KAAKG,GAAQC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B,EAAA,IAAA,EAAA,CAAA,CAAA,GAId/B,EAAA,MAAK,iBAAiBA,EAAA,MAAK,cAAc,SAAM,KADvDpD,EAAA,GAAAC,EAMEW,GAAA;;OAJC,SAASwC,EAAA,MAAK;OACd,SAASE,EAAA;OACV,OAAM;OACN,OAAM;;MAGVzC,EAAsBwE,EAAA,QAAA,QAAA;MACtBxE,EAEOwE,EAAA,QAAA,WAAA;OAFA,QAAQjC,EAAA,MAAK;OAAU,MAAMtB,EAAM;MAA1C,SAEO,EADL9B,EAAA,EAAA,GAAAS,EAAsFK,GAAA,MAAAC,EAAhDqC,EAAA,MAAK,UAAd,OAA7BpD,EAAA,GAAAC,EAAsFe,IAAA;OAAjC,KAAKwE,EAAM;OAAa;;MAE/E3E,EAAsBwE,EAAA,QAAA,QAAA;;KAExB/E,EAAgBW,CAAA;KACM0C,EAAA,SAAtB3D,EAAA,GAAAC,EAA8DiB,GAAA;;MAA3B,SAAA;MAAS,KAAKmC,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/standalone/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,
|
|
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;AAMD,iGAAiG;AACjG,wBAAgB,YAAY,IAAI,MAAM,IAAI,CAMzC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAQD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,IAAI,CAkBjF;AAED,gFAAgF;AAChF,wBAAgB,YAAY,IAAI,OAAO,CAUtC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
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 { ActionRunner as r, ComponentRegistry as i, FlashNotificationTracker as a, Translator as o,
|
|
5
|
-
import { router as
|
|
4
|
+
import { ActionRunner as r, ComponentRegistry as i, FlashNotificationTracker as a, Translator as o, installPrefetchInvalidation as s, reloadOnExpiredPage as c, resolveRequestErrorNotification as l } from "@alfakit/core";
|
|
5
|
+
import { router as u } from "@inertiajs/vue3";
|
|
6
6
|
//#region src/standalone/runtime.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
|
|
7
|
+
var d = typeof window > "u", f = d ? null : new o(), p = !1;
|
|
8
|
+
function m() {
|
|
9
|
+
d || p || (p = !0, c(), s());
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function h(e, r) {
|
|
12
12
|
if (!r) return t().registerMany(n().components ?? {}).registerMany(e ?? {});
|
|
13
13
|
if (!e || Object.keys(e).length === 0) return r;
|
|
14
14
|
let a = new i();
|
|
@@ -18,43 +18,43 @@ function m(e, r) {
|
|
|
18
18
|
}
|
|
19
19
|
return a.registerMany(e);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let a =
|
|
21
|
+
function g(t, n, i) {
|
|
22
|
+
let a = f ?? new o();
|
|
23
23
|
return {
|
|
24
|
-
registry:
|
|
24
|
+
registry: h(n),
|
|
25
25
|
pages: {},
|
|
26
26
|
translator: a,
|
|
27
27
|
actions: new r({
|
|
28
28
|
endpoints: { ...t },
|
|
29
29
|
onError: (t) => {
|
|
30
|
-
let n =
|
|
30
|
+
let n = l(t, null, (e, t, n) => a.t(e, t, n));
|
|
31
31
|
n && e(n);
|
|
32
32
|
}
|
|
33
33
|
}),
|
|
34
34
|
poll: i
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
-
|
|
37
|
+
var _ = 0;
|
|
38
|
+
function v() {
|
|
39
|
+
return _++, () => {
|
|
40
|
+
_--;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function y() {
|
|
44
|
+
return _ > 0;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
if (
|
|
49
|
-
|
|
46
|
+
var b = new a(), x = null, S = !1;
|
|
47
|
+
function C(t) {
|
|
48
|
+
if (x = t, d || S) return;
|
|
49
|
+
S = !0;
|
|
50
50
|
let n = (t) => {
|
|
51
51
|
let n = t?.alfakitNotifications;
|
|
52
|
-
for (let t of
|
|
52
|
+
for (let t of b.fresh(n)) e(t, x?.resolve(t.view ?? ""));
|
|
53
53
|
};
|
|
54
|
-
n(
|
|
54
|
+
n(w()), u.on("flash", (e) => n(e.detail.flash));
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
56
|
+
function w() {
|
|
57
|
+
if (!d) try {
|
|
58
58
|
let e = document.querySelector("[data-page]")?.dataset.page;
|
|
59
59
|
return e ? JSON.parse(e).flash : void 0;
|
|
60
60
|
} catch {
|
|
@@ -62,6 +62,6 @@ function C() {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
export {
|
|
65
|
+
export { v as claimToaster, g as createStandaloneContext, h as createStandaloneRegistry, C as ensureFlashToasts, m as ensureStandaloneRuntime, y as hasToaster, w as initialFlash };
|
|
66
66
|
|
|
67
67
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":["isServer","browserTranslator","Translator","browserReady","ensureStandaloneRuntime","reloadOnExpiredPage","createStandaloneRegistry","base","createDefaultRegistry","getStandaloneDefaults","overrides","registry","ComponentRegistry","type","component","createStandaloneContext","translator","ActionRunner","endpoints","notification","resolveRequestErrorNotification","error","key","replacements","fallback","showToast","toasters","claimToaster","hasToaster","flashTracker","FlashNotificationTracker","flashRegistry","flashListening","ensureFlashToasts","show","flashed","flash","initialFlash","router","event","page"],"sources":["../../src/standalone/runtime.ts"],"sourcesContent":["import {\n ActionRunner,\n ComponentRegistry,\n FlashNotificationTracker,\n Translator,\n reloadOnExpiredPage,\n resolveRequestErrorNotification,\n type NotificationSchema,\n} from '@alfakit/core'\nimport { router } from '@inertiajs/vue3'\nimport { showToast } from '../components/notifications/flash-toasts'\nimport type { AlfakitContextValue, AnyComponent } from '../context'\nimport { createDefaultRegistry } from '../registry'\nimport { getStandaloneDefaults } from './configure'\n\nconst isServer = typeof window === 'undefined'\n\n// Translations are the same for every component of a page, so the browser shares one\n// translator; a server render gets its own so concurrent requests never share a locale.\nconst browserTranslator = isServer ? null : new Translator()\n\nlet browserReady = false\n\n/** Browser-wide listeners every panel app installs; once per page load. */\nexport function ensureStandaloneRuntime(): void {\n if (isServer || browserReady) return\n\n browserReady = true\n reloadOnExpiredPage()\n}\n\n/**\n * The registry of a standalone component: the built-in renderers, the `configureAlfakit()`\n * defaults (or the surrounding panel's registry), then the component's own overrides.\n */\nexport function createStandaloneRegistry(\n overrides?: Record<string, AnyComponent>,\n base?: ComponentRegistry<AnyComponent>,\n): ComponentRegistry<AnyComponent> {\n if (!base) {\n return createDefaultRegistry()\n .registerMany(getStandaloneDefaults().components ?? {})\n .registerMany(overrides ?? {})\n }\n\n if (!overrides || Object.keys(overrides).length === 0) {\n return base\n }\n\n const registry = new ComponentRegistry<AnyComponent>()\n\n for (const type of base.types()) {\n const component = base.resolve(type)\n\n if (component) registry.register(type, component)\n }\n\n return registry.registerMany(overrides)\n}\n\n/**\n * The context value of one `<AlfakitComponent>` rendered outside `createAlfakit()`: its\n * own registry and action runner (so its modals are its own), the shared translator.\n */\nexport function createStandaloneContext(\n endpoints: { action: string; modal: string },\n overrides: Record<string, AnyComponent> | undefined,\n poll: AlfakitContextValue['poll'],\n): AlfakitContextValue {\n const translator = browserTranslator ?? new Translator()\n\n return {\n registry: createStandaloneRegistry(overrides),\n pages: {},\n translator,\n actions: new ActionRunner({\n endpoints: { ...endpoints },\n // Outside a panel there is no `errorNotifications` config: a generic toast.\n onError: (error) => {\n const notification = resolveRequestErrorNotification(\n error,\n null,\n (key, replacements, fallback) => translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n },\n }),\n poll,\n }\n}\n\n// ---------------------------------------------------------------- Toaster ownership\n\nlet toasters = 0\n\n/** An `<AlfakitToaster>` (or the component that took the role) is mounted; returns a release. */\nexport function claimToaster(): () => void {\n toasters++\n\n return () => {\n toasters--\n }\n}\n\nexport function hasToaster(): boolean {\n return toasters > 0\n}\n\n// ---------------------------------------------------------------- Flashed notifications\n\nconst flashTracker = new FlashNotificationTracker()\nlet flashRegistry: ComponentRegistry<AnyComponent> | null = null\nlet flashListening = false\n\n/**\n * Show the notifications the server flashed (`Notification::make()->send()`), from the\n * `flash` Inertia event after each visit and from the initial page (whose event fired\n * before the app mounted). One listener per page load, so it survives layouts that remount\n * between visits; the registry of the last mounted toaster renders custom toast views.\n */\nexport function ensureFlashToasts(registry: ComponentRegistry<AnyComponent>): void {\n flashRegistry = registry\n\n if (isServer || flashListening) return\n\n flashListening = true\n\n const show = (flash: unknown) => {\n const flashed = (flash as { alfakitNotifications?: NotificationSchema[] } | undefined)\n ?.alfakitNotifications\n\n for (const notification of flashTracker.fresh(flashed)) {\n showToast(notification, flashRegistry?.resolve(notification.view ?? ''))\n }\n }\n\n show(initialFlash())\n router.on('flash', (event) => show(event.detail.flash))\n}\n\n/** The initial page's flash data (fired as an event before the app mounted). */\nexport function initialFlash(): unknown {\n if (isServer) return undefined\n\n try {\n const page = document.querySelector<HTMLElement>('[data-page]')?.dataset.page\n\n return page ? (JSON.parse(page) as { flash?: unknown }).flash : undefined\n } catch {\n return undefined\n }\n}\n"],"mappings":";;;;;;
|
|
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","toasters","claimToaster","hasToaster","flashTracker","FlashNotificationTracker","flashRegistry","flashListening","ensureFlashToasts","show","flashed","flash","initialFlash","router","event","page"],"sources":["../../src/standalone/runtime.ts"],"sourcesContent":["import {\n ActionRunner,\n ComponentRegistry,\n FlashNotificationTracker,\n Translator,\n installPrefetchInvalidation,\n reloadOnExpiredPage,\n resolveRequestErrorNotification,\n type NotificationSchema,\n} from '@alfakit/core'\nimport { router } from '@inertiajs/vue3'\nimport { showToast } from '../components/notifications/flash-toasts'\nimport type { AlfakitContextValue, AnyComponent } from '../context'\nimport { createDefaultRegistry } from '../registry'\nimport { getStandaloneDefaults } from './configure'\n\nconst isServer = typeof window === 'undefined'\n\n// Translations are the same for every component of a page, so the browser shares one\n// translator; a server render gets its own so concurrent requests never share a locale.\nconst browserTranslator = isServer ? null : new Translator()\n\nlet browserReady = false\n\n/** Browser-wide listeners every panel app installs; once per page load. */\nexport function ensureStandaloneRuntime(): void {\n if (isServer || browserReady) return\n\n browserReady = true\n reloadOnExpiredPage()\n // Pages restored by Back after a change are reloaded; shared with a surrounding panel.\n installPrefetchInvalidation()\n}\n\n/**\n * The registry of a standalone component: the built-in renderers, the `configureAlfakit()`\n * defaults (or the surrounding panel's registry), then the component's own overrides.\n */\nexport function createStandaloneRegistry(\n overrides?: Record<string, AnyComponent>,\n base?: ComponentRegistry<AnyComponent>,\n): ComponentRegistry<AnyComponent> {\n if (!base) {\n return createDefaultRegistry()\n .registerMany(getStandaloneDefaults().components ?? {})\n .registerMany(overrides ?? {})\n }\n\n if (!overrides || Object.keys(overrides).length === 0) {\n return base\n }\n\n const registry = new ComponentRegistry<AnyComponent>()\n\n for (const type of base.types()) {\n const component = base.resolve(type)\n\n if (component) registry.register(type, component)\n }\n\n return registry.registerMany(overrides)\n}\n\n/**\n * The context value of one `<AlfakitComponent>` rendered outside `createAlfakit()`: its\n * own registry and action runner (so its modals are its own), the shared translator.\n */\nexport function createStandaloneContext(\n endpoints: { action: string; modal: string },\n overrides: Record<string, AnyComponent> | undefined,\n poll: AlfakitContextValue['poll'],\n): AlfakitContextValue {\n const translator = browserTranslator ?? new Translator()\n\n return {\n registry: createStandaloneRegistry(overrides),\n pages: {},\n translator,\n actions: new ActionRunner({\n endpoints: { ...endpoints },\n // Outside a panel there is no `errorNotifications` config: a generic toast.\n onError: (error) => {\n const notification = resolveRequestErrorNotification(\n error,\n null,\n (key, replacements, fallback) => translator.t(key, replacements, fallback),\n )\n\n if (notification) showToast(notification)\n },\n }),\n poll,\n }\n}\n\n// ---------------------------------------------------------------- Toaster ownership\n\nlet toasters = 0\n\n/** An `<AlfakitToaster>` (or the component that took the role) is mounted; returns a release. */\nexport function claimToaster(): () => void {\n toasters++\n\n return () => {\n toasters--\n }\n}\n\nexport function hasToaster(): boolean {\n return toasters > 0\n}\n\n// ---------------------------------------------------------------- Flashed notifications\n\nconst flashTracker = new FlashNotificationTracker()\nlet flashRegistry: ComponentRegistry<AnyComponent> | null = null\nlet flashListening = false\n\n/**\n * Show the notifications the server flashed (`Notification::make()->send()`), from the\n * `flash` Inertia event after each visit and from the initial page (whose event fired\n * before the app mounted). One listener per page load, so it survives layouts that remount\n * between visits; the registry of the last mounted toaster renders custom toast views.\n */\nexport function ensureFlashToasts(registry: ComponentRegistry<AnyComponent>): void {\n flashRegistry = registry\n\n if (isServer || flashListening) return\n\n flashListening = true\n\n const show = (flash: unknown) => {\n const flashed = (flash as { alfakitNotifications?: NotificationSchema[] } | undefined)\n ?.alfakitNotifications\n\n for (const notification of flashTracker.fresh(flashed)) {\n showToast(notification, flashRegistry?.resolve(notification.view ?? ''))\n }\n }\n\n show(initialFlash())\n router.on('flash', (event) => show(event.detail.flash))\n}\n\n/** The initial page's flash data (fired as an event before the app mounted). */\nexport function initialFlash(): unknown {\n if (isServer) return undefined\n\n try {\n const page = document.querySelector<HTMLElement>('[data-page]')?.dataset.page\n\n return page ? (JSON.parse(page) as { flash?: unknown }).flash : undefined\n } catch {\n return undefined\n }\n}\n"],"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,KA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@ -134,7 +134,8 @@
|
|
|
134
134
|
@apply border px-2 py-1;
|
|
135
135
|
}
|
|
136
136
|
.alfakit-prose :where(.alfakit-mention) {
|
|
137
|
-
|
|
137
|
+
/* Full-contrast text on the tint (WCAG AA); the ring marks it as a mention. */
|
|
138
|
+
@apply bg-primary/10 text-foreground ring-primary/30 rounded px-1 font-medium ring-1;
|
|
138
139
|
}
|
|
139
140
|
.alfakit-prose :where(.alfakit-merge-tag) {
|
|
140
141
|
@apply bg-muted text-muted-foreground rounded px-1 font-mono text-xs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.js","names":["_sfc_main","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","AlfakitStarterKitRoot_default"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport DebugPanelSlot from '../components/panel/DebugPanelSlot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n <!-- The debug panel's button lives in AlfaKit's top bar, which a starter kit doesn't\n render: float it in the corner (nothing without `alfakitDebug`). -->\n <div data-slot=\"starter-kit-debug-panel\" class=\"fixed
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.js","names":["_sfc_main","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","AlfakitStarterKitRoot_default"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport DebugPanelSlot from '../components/panel/DebugPanelSlot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n <!-- The debug panel's button lives in AlfaKit's top bar, which a starter kit doesn't\n render: float it in the corner (nothing without `alfakitDebug`). The corner is the\n document's right: the kit's sidebar stays on the left in a right-to-left panel language. -->\n <div data-slot=\"starter-kit-debug-panel\" class=\"fixed right-16 bottom-16 z-40\">\n <DebugPanelSlot />\n </div>\n </AlfakitRoot>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.vue.d.ts","sourceRoot":"","sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.vue.d.ts","sourceRoot":"","sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"names":[],"mappings":"AA4FA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEzE;;;;GAIG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAgFvD,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;AAsB/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"}
|
|
@@ -9,7 +9,7 @@ import { createElementBlock as u, createElementVNode as d, createVNode as f, def
|
|
|
9
9
|
//#region src/starter-kit/AlfakitStarterKitRoot.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var x = ["dir", "lang"], S = {
|
|
11
11
|
"data-slot": "starter-kit-debug-panel",
|
|
12
|
-
class: "fixed
|
|
12
|
+
class: "fixed right-16 bottom-16 z-40"
|
|
13
13
|
}, C = /*@__PURE__*/ p({
|
|
14
14
|
__name: "AlfakitStarterKitRoot",
|
|
15
15
|
props: { options: {} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js","names":["props","_openBlock","_createElementBlock","_unref","_createVNode","AlfakitRoot","_withCtx","_renderSlot","_createElementVNode","DebugPanelSlot","DebugPanelSlot_default","AlfakitRoot_default","_hoisted_1","_hoisted_2","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","context","starterKitContext","__props","page","usePage","provideAlfakit","watch","endpoints","onMounted","installStarterKitRuntime","showToast","notification","key","replacements","fallback","setToasterId","STARTER_KIT_TOASTER_ID","syncStarterKitPage","value","onUnmounted","openBlock","createElementBlock","unref","createVNode","withCtx","renderSlot","_ctx","createElementVNode"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport DebugPanelSlot from '../components/panel/DebugPanelSlot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n <!-- The debug panel's button lives in AlfaKit's top bar, which a starter kit doesn't\n render: float it in the corner (nothing without `alfakitDebug`). -->\n <div data-slot=\"starter-kit-debug-panel\" class=\"fixed
|
|
1
|
+
{"version":3,"file":"AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js","names":["props","_openBlock","_createElementBlock","_unref","_createVNode","AlfakitRoot","_withCtx","_renderSlot","_createElementVNode","DebugPanelSlot","DebugPanelSlot_default","AlfakitRoot_default","_hoisted_1","_hoisted_2","AlfakitStarterKitRoot_vue_vue_type_script_setup_true_lang_default","context","starterKitContext","__props","page","usePage","provideAlfakit","watch","endpoints","onMounted","installStarterKitRuntime","showToast","notification","key","replacements","fallback","setToasterId","STARTER_KIT_TOASTER_ID","syncStarterKitPage","value","onUnmounted","openBlock","createElementBlock","unref","createVNode","withCtx","renderSlot","_ctx","createElementVNode"],"sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n STARTER_KIT_TOASTER_ID,\n installStarterKitRuntime,\n syncStarterKitPage,\n type AlfakitPageProps,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { onMounted, onUnmounted, watch } from 'vue'\nimport AlfakitRoot from '../AlfakitRoot.vue'\nimport DebugPanelSlot from '../components/panel/DebugPanelSlot.vue'\nimport { setToasterId, showToast } from '../components/notifications/flash-toasts'\nimport { provideAlfakit } from '../context'\nimport { starterKitContext, type StarterKitPageOptions } from './runtime'\n\n/**\n * The Inertia layout around every Alfakit page in starter kit mode, inside the host layout:\n * Alfakit's context, modals, toasts and the reading direction. It stays mounted while the\n * user moves between Alfakit pages.\n */\nconst props = defineProps<{ options?: StarterKitPageOptions }>()\nconst context = starterKitContext(props.options ?? {})\nconst page = usePage<AlfakitPageProps>()\n\nprovideAlfakit(context)\n\n// Endpoints follow the open page (synchronously, before children run actions).\nwatch(\n () => page.props.alfakit?.endpoints,\n (endpoints) => {\n if (endpoints) {\n context.actions.setEndpoints({ action: endpoints.action ?? '', modal: endpoints.modal ?? '' })\n }\n },\n { immediate: true, flush: 'sync' },\n)\n\nonMounted(() => {\n installStarterKitRuntime(\n (notification) => showToast(notification),\n (key, replacements, fallback) => context.translator.t(key, replacements, fallback),\n )\n setToasterId(STARTER_KIT_TOASTER_ID)\n\n watch(\n () => page.props,\n (value) => syncStarterKitPage(value as AlfakitPageProps),\n { immediate: true },\n )\n})\n\nonUnmounted(() => {\n // A host page is open: its errors and toasts are the host's again.\n syncStarterKitPage(null)\n setToasterId(undefined)\n})\n</script>\n\n<template>\n <!-- The reading direction and language of Alfakit's content only: the host layout around it\n (sidebar, header) and the app's own pages keep the document's. -->\n <div\n data-slot=\"starter-kit-root\"\n :dir=\"page.props.alfakit?.localization?.direction ?? 'ltr'\"\n :lang=\"page.props.alfakit?.localization?.tag\"\n class=\"contents\"\n >\n <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n <!-- The debug panel's button lives in AlfaKit's top bar, which a starter kit doesn't\n render: float it in the corner (nothing without `alfakitDebug`). The corner is the\n document's right: the kit's sidebar stays on the left in a right-to-left panel language. -->\n <div data-slot=\"starter-kit-debug-panel\" class=\"fixed right-16 bottom-16 z-40\">\n <DebugPanelSlot />\n </div>\n </AlfakitRoot>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAqBA,IAAMe,IAAUC,EAAkBhB,EAAM,WAAW,CAAC,CAAC,GAC/CkB,IAAOC,EAA0B;SAEvCC,EAAeL,CAAO,GAGtBM,QACQH,EAAK,MAAM,SAAS,YACzB,MAAc;GACb,AAAII,KACFP,EAAQ,QAAQ,aAAa;IAAE,QAAQO,EAAU,UAAU;IAAI,OAAOA,EAAU,SAAS;GAAG,CAAC;EAEjG,GACA;GAAE,WAAW;GAAM,OAAO;EAAO,CACnC,GAEAC,QAAgB;GAOd,AANAC,GACG,MAAiBC,EAAUC,CAAY,IACvC,GAAK,GAAc,MAAaX,EAAQ,WAAW,EAAEY,GAAKC,GAAcC,CAAQ,CACnF,GACAC,EAAaC,CAAsB,GAEnCV,QACQH,EAAK,QACV,MAAUc,EAAmBC,CAAyB,GACvD,EAAE,WAAW,GAAK,CACpB;EACF,CAAC,GAEDC,QAAkB;GAGhB,AADAF,EAAmB,IAAI,GACvBF,EAAa,KAAA,CAAS;EACxB,CAAC,cAMC7B,EAAA,GAAAC,EAeM,OAAA;GAdJ,aAAU;GACT,KAAKC,EAAAe,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc,aAAS;GAChD,MAAMf,EAAAe,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc;GACzC,OAAM;EAENd,GAAAA,CAAAA,EAQcC,GAAA,EARA,cAAYF,EAAA4B,CAAA,EAAsB,GAAA;GAC9C,SAAAzB,QAAQ,CAARC,EAAQkC,EAAA,QAAA,SAAA,GAIRjC,EAEM,OAFNK,GAEM,CADJT,EAAkBK,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { type StarterKitNavGroup, type StarterKitNavigationSchema } from '@alfakit/core';
|
|
1
|
+
import { type StarterKitNavGroup, type StarterKitNavigationSchema, type StarterKitUserMenuItem } from '@alfakit/core';
|
|
2
2
|
import { type ComputedRef } from 'vue';
|
|
3
3
|
export interface AlfakitNavigation {
|
|
4
4
|
/** The panel's navigation as the server shared it, or null for guests. */
|
|
5
5
|
navigation: StarterKitNavigationSchema | null;
|
|
6
6
|
/** Its groups as plain items (`title`, `href`, `icon`, `isActive`, `badge`, `children`). */
|
|
7
7
|
groups: StarterKitNavGroup[];
|
|
8
|
+
/**
|
|
9
|
+
* The panel's user menu links (`userMenuItems()`, Billing's entry…) for the kit's user
|
|
10
|
+
* menu: `<AlfakitUserMenuItems />` renders them with the app's dropdown items.
|
|
11
|
+
*/
|
|
12
|
+
userMenuItems: StarterKitUserMenuItem[];
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* The navigation of a `starterKit()` panel (the first one unless `panelId` is given), for the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/starter-kit/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/starter-kit/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,KAAK,CAAA;AAKhD,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,UAAU,EAAE,0BAA0B,GAAG,IAAI,CAAA;IAC7C,4FAA4F;IAC5F,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B;;;OAGG;IACH,aAAa,EAAE,sBAAsB,EAAE,CAAA;CACxC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAYrF"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { starterKitNavigation as e, toStarterKitNavGroups as t } from "@alfakit/core";
|
|
2
|
-
import { usePage as
|
|
3
|
-
import { computed as
|
|
1
|
+
import { starterKitNavigation as e, toStarterKitNavGroups as t, toStarterKitUserMenuItems as n } from "@alfakit/core";
|
|
2
|
+
import { usePage as r } from "@inertiajs/vue3";
|
|
3
|
+
import { computed as i } from "vue";
|
|
4
4
|
//#region src/starter-kit/navigation.ts
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
return
|
|
8
|
-
let
|
|
5
|
+
function a(a) {
|
|
6
|
+
let o = r();
|
|
7
|
+
return i(() => {
|
|
8
|
+
let r = e(o.props, a);
|
|
9
9
|
return {
|
|
10
|
-
navigation:
|
|
11
|
-
groups: t(
|
|
10
|
+
navigation: r,
|
|
11
|
+
groups: t(r?.groups),
|
|
12
|
+
userMenuItems: n(r?.userMenu)
|
|
12
13
|
};
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
//#endregion
|
|
16
|
-
export {
|
|
17
|
+
export { a as useAlfakitNavigation };
|
|
17
18
|
|
|
18
19
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","names":["useAlfakitNavigation","page","usePage","computed","navigation","starterKitNavigation","panelId","toStarterKitNavGroups"],"sources":["../../src/starter-kit/navigation.ts"],"sourcesContent":["import {\n starterKitNavigation,\n toStarterKitNavGroups,\n type StarterKitNavGroup,\n type StarterKitNavigationSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { computed, type ComputedRef } from 'vue'\n\n// Its own module, away from `createStarterKitPage()`: the host's sidebar imports it on every\n// page, and it must not pull the panel runtime into the host's main chunk.\n\nexport interface AlfakitNavigation {\n /** The panel's navigation as the server shared it, or null for guests. */\n navigation: StarterKitNavigationSchema | null\n /** Its groups as plain items (`title`, `href`, `icon`, `isActive`, `badge`, `children`). */\n groups: StarterKitNavGroup[]\n}\n\n/**\n * The navigation of a `starterKit()` panel (the first one unless `panelId` is given), for the\n * host's sidebar. Every Inertia page of the application carries it, so the host's own pages\n * list the panel's resources too.\n *\n * ```ts\n * const navigation = useAlfakitNavigation()\n * // navigation.value.groups\n * ```\n */\nexport function useAlfakitNavigation(panelId?: string): ComputedRef<AlfakitNavigation> {\n const page = usePage()\n\n return computed(() => {\n const navigation = starterKitNavigation(page.props, panelId)\n\n return {
|
|
1
|
+
{"version":3,"file":"navigation.js","names":["useAlfakitNavigation","page","usePage","computed","navigation","starterKitNavigation","panelId","toStarterKitNavGroups","toStarterKitUserMenuItems"],"sources":["../../src/starter-kit/navigation.ts"],"sourcesContent":["import {\n starterKitNavigation,\n toStarterKitNavGroups,\n toStarterKitUserMenuItems,\n type StarterKitNavGroup,\n type StarterKitNavigationSchema,\n type StarterKitUserMenuItem,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { computed, type ComputedRef } from 'vue'\n\n// Its own module, away from `createStarterKitPage()`: the host's sidebar imports it on every\n// page, and it must not pull the panel runtime into the host's main chunk.\n\nexport interface AlfakitNavigation {\n /** The panel's navigation as the server shared it, or null for guests. */\n navigation: StarterKitNavigationSchema | null\n /** Its groups as plain items (`title`, `href`, `icon`, `isActive`, `badge`, `children`). */\n groups: StarterKitNavGroup[]\n /**\n * The panel's user menu links (`userMenuItems()`, Billing's entry…) for the kit's user\n * menu: `<AlfakitUserMenuItems />` renders them with the app's dropdown items.\n */\n userMenuItems: StarterKitUserMenuItem[]\n}\n\n/**\n * The navigation of a `starterKit()` panel (the first one unless `panelId` is given), for the\n * host's sidebar. Every Inertia page of the application carries it, so the host's own pages\n * list the panel's resources too.\n *\n * ```ts\n * const navigation = useAlfakitNavigation()\n * // navigation.value.groups\n * ```\n */\nexport function useAlfakitNavigation(panelId?: string): ComputedRef<AlfakitNavigation> {\n const page = usePage()\n\n return computed(() => {\n const navigation = starterKitNavigation(page.props, panelId)\n\n return {\n navigation,\n groups: toStarterKitNavGroups(navigation?.groups),\n userMenuItems: toStarterKitUserMenuItems(navigation?.userMenu),\n }\n })\n}\n"],"mappings":";;;;AAoCA,SAAgBA,EAAqB,GAAkD;CACrF,IAAMC,IAAOC,EAAQ;CAErB,OAAOC,QAAe;EACpB,IAAMC,IAAaC,EAAqBJ,EAAK,OAAOK,CAAO;EAE3D,OAAO;GACL;GACA,QAAQC,EAAsBH,GAAY,MAAM;GAChD,eAAeI,EAA0BJ,GAAY,QAAQ;EAC/D;CACF,CAAC;AACH"}
|
package/dist/styles.css
CHANGED
|
@@ -289,7 +289,8 @@
|
|
|
289
289
|
}
|
|
290
290
|
/* Rich editor mentions, merge tags and custom blocks (RichEditor extensions) */
|
|
291
291
|
.alfakit-prose :where(.alfakit-mention):not(:where(.alfakit-not-prose *)) {
|
|
292
|
-
|
|
292
|
+
/* Full-contrast text on the tint (WCAG AA); the ring marks it as a mention. */
|
|
293
|
+
@apply bg-primary/10 text-foreground ring-primary/30 rounded px-1 font-medium ring-1;
|
|
293
294
|
}
|
|
294
295
|
.alfakit-prose :where(.alfakit-merge-tag):not(:where(.alfakit-not-prose *)) {
|
|
295
296
|
@apply bg-muted text-muted-foreground rounded px-1 font-mono text-xs;
|
package/dist/themes.css
CHANGED
|
@@ -742,6 +742,10 @@
|
|
|
742
742
|
max-height: none;
|
|
743
743
|
width: 100%;
|
|
744
744
|
max-width: 100%;
|
|
745
|
+
/* The shadcn centring utilities read these variables. Resetting them survives a
|
|
746
|
+
minifier that drops `translate: none` in favour of the utilities' `translate`. */
|
|
747
|
+
--tw-translate-x: 0;
|
|
748
|
+
--tw-translate-y: 0;
|
|
745
749
|
translate: none;
|
|
746
750
|
transform: none;
|
|
747
751
|
border-radius: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfakit/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
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.10"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@inertiajs/vue3": "^3.0.0",
|
package/src/app/components.ts
CHANGED
|
@@ -36,6 +36,9 @@ export function usePageBlock(key: string): ComputedRef<ContentBlock | undefined>
|
|
|
36
36
|
*/
|
|
37
37
|
export const AppPage = defineComponent({
|
|
38
38
|
name: 'AppPage',
|
|
39
|
+
// The page component's undeclared Inertia props fall through to here; AppPage takes no
|
|
40
|
+
// HTML attributes and renders several root nodes.
|
|
41
|
+
inheritAttrs: false,
|
|
39
42
|
setup(_, { slots }) {
|
|
40
43
|
const page = useAppPage()
|
|
41
44
|
const panel = usePanel()
|
|
@@ -81,7 +81,7 @@ const time = (value: number | null) =>
|
|
|
81
81
|
size="icon"
|
|
82
82
|
:aria-label="t('dev_tools.open', {}, 'Open schema inspector')"
|
|
83
83
|
data-slot="dev-tools-toggle"
|
|
84
|
-
class="fixed end-4 bottom-
|
|
84
|
+
class="fixed end-4 bottom-16 z-40 rounded-full shadow-md [[data-slot=starter-kit-root]_&]:end-auto [[data-slot=starter-kit-root]_&]:right-4"
|
|
85
85
|
>
|
|
86
86
|
<BracesIcon />
|
|
87
87
|
</Button>
|