@alfakit/vue 0.1.8 → 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.
Files changed (168) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/app/components.d.ts.map +1 -1
  3. package/dist/app/components.js +1 -0
  4. package/dist/app/components.js.map +1 -1
  5. package/dist/components/actions/ActionModal.js.map +1 -1
  6. package/dist/components/actions/ActionModal.vue.d.ts.map +1 -1
  7. package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js +1 -1
  8. package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/dev-tools/DevToolsInspector.js.map +1 -1
  10. package/dist/components/dev-tools/DevToolsInspector.vue.d.ts.map +1 -1
  11. package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js +1 -1
  12. package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/fields/CheckboxListField.js.map +1 -1
  14. package/dist/components/fields/CheckboxListField.vue.d.ts.map +1 -1
  15. package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js +2 -2
  16. package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/fields/DatePickerField.js.map +1 -1
  18. package/dist/components/fields/DatePickerField.vue.d.ts.map +1 -1
  19. package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js +34 -32
  20. package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/fields/RichEditorSuggestions.js.map +1 -1
  22. package/dist/components/fields/RichEditorSuggestions.vue.d.ts +1 -1
  23. package/dist/components/fields/RichEditorSuggestions.vue.d.ts.map +1 -1
  24. package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js +29 -23
  25. package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/components/fields/RichEditorToolbarGroup.js.map +1 -1
  27. package/dist/components/fields/RichEditorToolbarGroup.vue.d.ts.map +1 -1
  28. package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js +9 -4
  29. package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/file-manager/FileManagerView.js.map +1 -1
  31. package/dist/components/file-manager/FileManagerView.vue.d.ts.map +1 -1
  32. package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js +5 -1
  33. package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/dist/components/form/FormBlock.js.map +1 -1
  35. package/dist/components/form/FormBlock.vue.d.ts.map +1 -1
  36. package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js +79 -78
  37. package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/layout/CalloutComponent.js.map +1 -1
  39. package/dist/components/layout/CalloutComponent.vue.d.ts.map +1 -1
  40. package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js +43 -39
  41. package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/components/layout/EmptyStateComponent.js.map +1 -1
  43. package/dist/components/layout/EmptyStateComponent.vue.d.ts.map +1 -1
  44. package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js +29 -26
  45. package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/layout/MixedContent.js.map +1 -1
  47. package/dist/components/layout/MixedContent.vue.d.ts +5 -3
  48. package/dist/components/layout/MixedContent.vue.d.ts.map +1 -1
  49. package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js +5 -4
  50. package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/components/layout/SectionComponent.js.map +1 -1
  52. package/dist/components/layout/SectionComponent.vue.d.ts.map +1 -1
  53. package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js +12 -8
  54. package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/components/notifications/NotificationsMenu.js.map +1 -1
  56. package/dist/components/notifications/NotificationsMenu.vue.d.ts.map +1 -1
  57. package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js +133 -104
  58. package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/panel/BottomNav.js.map +1 -1
  60. package/dist/components/panel/BottomNav.vue_vue_type_script_setup_true_lang.js +2 -2
  61. package/dist/components/panel/BottomNav.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/components/panel/KeyboardShortcuts.js.map +1 -1
  63. package/dist/components/panel/KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js +1 -1
  64. package/dist/components/panel/KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  65. package/dist/components/panel/NavGroup.js.map +1 -1
  66. package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js +3 -3
  67. package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/panel/NavItem.js.map +1 -1
  69. package/dist/components/panel/NavItem.vue.d.ts.map +1 -1
  70. package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js +1 -1
  71. package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/panel/NavSubItem.js.map +1 -1
  73. package/dist/components/panel/NavSubItem.vue.d.ts.map +1 -1
  74. package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js +1 -1
  75. package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/panel/ShortcutsOverlay.js.map +1 -1
  77. package/dist/components/panel/ShortcutsOverlay.vue.d.ts.map +1 -1
  78. package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js +20 -19
  79. package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/table/ColumnManager.js.map +1 -1
  81. package/dist/components/table/ColumnManager.vue.d.ts.map +1 -1
  82. package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js +6 -6
  83. package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/table/Spreadsheet.js.map +1 -1
  85. package/dist/components/table/Spreadsheet.vue.d.ts.map +1 -1
  86. package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js +37 -33
  87. package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/translation-manager/TranslationManagerView.js.map +1 -1
  89. package/dist/components/translation-manager/TranslationManagerView.vue.d.ts.map +1 -1
  90. package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
  91. package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/components/ui/SidebarMenuButton.js.map +1 -1
  93. package/dist/components/ui/SidebarMenuButton.vue.d.ts.map +1 -1
  94. package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js +12 -12
  95. package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  96. package/dist/components/ui/TooltipTrigger.js.map +1 -1
  97. package/dist/components/ui/TooltipTrigger.vue.d.ts +2 -2
  98. package/dist/components/ui/TooltipTrigger.vue.d.ts.map +1 -1
  99. package/dist/components/ui/TooltipTrigger.vue_vue_type_script_setup_true_lang.js +10 -7
  100. package/dist/components/ui/TooltipTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  101. package/dist/components/widgets/StatCard.js.map +1 -1
  102. package/dist/components/widgets/StatCard.vue.d.ts.map +1 -1
  103. package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js +30 -30
  104. package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/eject-manifest.json +2 -2
  106. package/dist/layouts/TopNavLayout.js.map +1 -1
  107. package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js +2 -2
  108. package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/layouts/TopNavMenu.js.map +1 -1
  110. package/dist/layouts/TopNavMenu.vue_vue_type_script_setup_true_lang.js +1 -1
  111. package/dist/layouts/TopNavMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/pages/AlfakitPage.js.map +1 -1
  113. package/dist/pages/AlfakitPage.vue.d.ts.map +1 -1
  114. package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js +16 -19
  115. package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  116. package/dist/standalone/AlfakitComponent.js.map +1 -1
  117. package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
  118. package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +29 -24
  119. package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/standalone/runtime.d.ts.map +1 -1
  121. package/dist/standalone/runtime.js +25 -25
  122. package/dist/standalone/runtime.js.map +1 -1
  123. package/dist/standalone.css +12 -7
  124. package/dist/starter-kit/AlfakitStarterKitRoot.js.map +1 -1
  125. package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts.map +1 -1
  126. package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js +25 -21
  127. package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/starter-kit/navigation.d.ts +6 -1
  129. package/dist/starter-kit/navigation.d.ts.map +1 -1
  130. package/dist/starter-kit/navigation.js +11 -10
  131. package/dist/starter-kit/navigation.js.map +1 -1
  132. package/dist/styles.css +2 -1
  133. package/dist/themes.css +4 -0
  134. package/package.json +2 -2
  135. package/src/app/components.ts +3 -0
  136. package/src/components/actions/ActionModal.vue +2 -0
  137. package/src/components/dev-tools/DevToolsInspector.vue +1 -1
  138. package/src/components/fields/CheckboxListField.vue +2 -2
  139. package/src/components/fields/DatePickerField.vue +1 -0
  140. package/src/components/fields/RichEditorSuggestions.vue +13 -6
  141. package/src/components/fields/RichEditorToolbarGroup.vue +16 -1
  142. package/src/components/file-manager/FileManagerView.vue +3 -1
  143. package/src/components/form/FormBlock.vue +15 -2
  144. package/src/components/layout/CalloutComponent.vue +15 -2
  145. package/src/components/layout/EmptyStateComponent.vue +10 -1
  146. package/src/components/layout/MixedContent.vue +12 -4
  147. package/src/components/layout/SectionComponent.vue +20 -4
  148. package/src/components/notifications/NotificationsMenu.vue +45 -1
  149. package/src/components/panel/BottomNav.vue +2 -2
  150. package/src/components/panel/KeyboardShortcuts.vue +1 -1
  151. package/src/components/panel/NavGroup.vue +3 -3
  152. package/src/components/panel/NavItem.vue +5 -1
  153. package/src/components/panel/NavSubItem.vue +5 -1
  154. package/src/components/panel/ShortcutsOverlay.vue +27 -22
  155. package/src/components/table/ColumnManager.vue +6 -4
  156. package/src/components/table/Spreadsheet.vue +9 -4
  157. package/src/components/translation-manager/TranslationManagerView.vue +1 -1
  158. package/src/components/ui/SidebarMenuButton.vue +6 -0
  159. package/src/components/ui/TooltipTrigger.vue +4 -1
  160. package/src/components/widgets/StatCard.vue +6 -3
  161. package/src/layouts/TopNavLayout.vue +2 -2
  162. package/src/layouts/TopNavMenu.vue +1 -1
  163. package/src/pages/AlfakitPage.vue +13 -3
  164. package/src/standalone/AlfakitComponent.vue +16 -5
  165. package/src/standalone/runtime.ts +3 -0
  166. package/src/starter-kit/AlfakitStarterKitRoot.vue +7 -0
  167. package/src/starter-kit/navigation.ts +12 -1
  168. package/src/styles.css +2 -1
@@ -6,10 +6,10 @@ import ee from "../pages/ContentBlockRenderer.js";
6
6
  import o from "../components/actions/ActionModals.js";
7
7
  import s from "../components/ui/TooltipProvider.js";
8
8
  import { claimToaster as c, createStandaloneContext as l, createStandaloneRegistry as u, ensureStandaloneRuntime as d, hasToaster as f } from "./runtime.js";
9
- import te from "./AlfakitToaster.js";
10
- import { StandaloneComponentState as ne, findStandalonePropName as p, registerStandaloneProp as m, standalonePanelSchema as h } from "@alfakit/core";
11
- import { usePage as g } from "@inertiajs/vue3";
12
- import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createVNode as C, defineComponent as w, normalizeClass as T, onMounted as re, onScopeDispose as ie, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, unref as N, watch as P, withCtx as F } from "vue";
9
+ import p from "./AlfakitToaster.js";
10
+ import { StandaloneComponentState as te, findStandalonePropName as ne, registerStandaloneProp as re, standalonePanelSchema as m } from "@alfakit/core";
11
+ import { usePage as h } from "@inertiajs/vue3";
12
+ import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createVNode as S, defineComponent as C, normalizeClass as w, onMounted as T, onScopeDispose as E, openBlock as D, provide as ie, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, unref as N, watch as P, withCtx as F } from "vue";
13
13
  import { ConfigProvider as I } from "reka-ui";
14
14
  //#region src/standalone/AlfakitComponent.vue?vue&type=script&setup=true&lang.ts
15
15
  var L = ["data-alfakit-component", "dir"], R = {
@@ -22,7 +22,7 @@ var L = ["data-alfakit-component", "dir"], R = {
22
22
  }, V = {
23
23
  key: 1,
24
24
  class: "text-muted-foreground mt-1 text-sm"
25
- }, H = /*@__PURE__*/ w({
25
+ }, H = /*@__PURE__*/ C({
26
26
  __name: "AlfakitComponent",
27
27
  props: {
28
28
  component: {},
@@ -35,9 +35,13 @@ var L = ["data-alfakit-component", "dir"], R = {
35
35
  Array
36
36
  ] }
37
37
  },
38
- setup(w) {
39
- let H = w, U = n(), W = g(), G = O(0), K = new ne(H.component, () => G.value++), q = (e, t) => K.poll(e, t), J = (e) => K.refresh(e), Y = U ? {
38
+ setup(C) {
39
+ let H = C, U = n(), W = h(), G = O(0), K = new te(H.component, () => G.value++), q = (e, t) => K.poll(e, t), J = (e) => K.refresh(e), Y = U ? {
40
40
  ...U,
41
+ actions: l({
42
+ action: H.component.endpoints.action,
43
+ modal: H.component.endpoints.modal
44
+ }, H.components, q).actions,
41
45
  registry: u(H.components, U.registry),
42
46
  poll: q,
43
47
  refresh: J
@@ -48,8 +52,8 @@ var L = ["data-alfakit-component", "dir"], R = {
48
52
  }, H.components, q),
49
53
  refresh: J
50
54
  };
51
- D(e, Y);
52
- let ae = v(() => h(H.component)), X = v(() => (G.value, K.setComponent(H.component), K.page)), Z = v(() => H.component.localization?.direction ?? "ltr"), Q = v(() => ({
55
+ ie(e, Y);
56
+ let ae = _(() => m(H.component)), X = _(() => (G.value, K.setComponent(H.component), K.page)), Z = _(() => H.component.localization?.direction ?? "ltr"), Q = _(() => ({
53
57
  token: H.component.token,
54
58
  component: "page"
55
59
  }));
@@ -66,48 +70,49 @@ var L = ["data-alfakit-component", "dir"], R = {
66
70
  flush: "sync"
67
71
  });
68
72
  let $ = O(!1);
69
- return re(() => {
70
- if (d(), P(() => p(W.props, H.component), (e, t, n) => n(m(e ?? null)), { immediate: !0 }), P(() => H.component.token, () => void K.loadLazy(H.component), { immediate: !0 }), U) return;
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;
71
75
  let e = null, t = !1;
72
76
  queueMicrotask(() => {
73
77
  t || f() || (e = c(), $.value = !0);
74
- }), ie(() => {
78
+ }), E(() => {
75
79
  t = !0, e?.();
76
80
  });
77
- }), (e, t) => (E(), y(j(N(U) ? "div" : N(I)), {
81
+ }), (e, t) => (D(), v(j(N(U) ? "div" : N(I)), {
78
82
  dir: N(U) ? void 0 : Z.value,
79
- class: T(N(U) ? "contents" : void 0)
83
+ class: w(N(U) ? "contents" : void 0)
80
84
  }, {
81
- default: F(() => [C(s, { "delay-duration": 0 }, {
85
+ default: F(() => [S(s, { "delay-duration": 0 }, {
82
86
  default: F(() => [
83
- S("div", {
87
+ x("div", {
84
88
  "data-slot": "standalone",
85
89
  "data-alfakit-component": H.component.class,
86
90
  dir: Z.value,
87
- class: T(N(i)("flex flex-col gap-6", H.class))
91
+ class: w(N(i)("flex flex-col gap-6", H.class))
88
92
  }, [
89
- X.value.heading || X.value.headerActions?.length ? (E(), x("header", R, [S("div", z, [X.value.heading ? (E(), x("h2", B, M(X.value.heading), 1)) : b("", !0), X.value.subheading ? (E(), x("p", V, M(X.value.subheading), 1)) : b("", !0)]), X.value.headerActions && X.value.headerActions.length > 0 ? (E(), y(a, {
93
+ X.value.heading || X.value.headerActions?.length ? (D(), b("header", R, [x("div", z, [X.value.heading ? (D(), b("h2", B, M(X.value.heading), 1)) : y("", !0), X.value.subheading ? (D(), b("p", V, M(X.value.subheading), 1)) : y("", !0)]), X.value.headerActions && X.value.headerActions.length > 0 ? (D(), v(a, {
90
94
  key: 0,
91
95
  actions: X.value.headerActions,
92
96
  context: Q.value,
93
97
  align: "end",
94
98
  class: "max-w-full shrink-0"
95
- }, null, 8, ["actions", "context"])) : b("", !0)])) : b("", !0),
99
+ }, null, 8, ["actions", "context"])) : y("", !0)])) : y("", !0),
96
100
  A(e.$slots, "header"),
97
101
  A(e.$slots, "default", {
98
102
  blocks: X.value.content,
99
103
  page: H.component
100
- }, () => [(E(!0), x(_, null, k(X.value.content, (e) => (E(), y(ee, {
104
+ }, () => [(D(!0), b(g, null, k(X.value.content, (e) => (D(), v(ee, {
101
105
  key: e.key,
102
106
  block: e
103
107
  }, null, 8, ["block"]))), 128))]),
104
108
  A(e.$slots, "footer")
105
109
  ], 10, L),
106
- C(o),
107
- $.value ? (E(), y(te, {
110
+ S(o),
111
+ $.value ? (D(), v(p, {
108
112
  key: 0,
109
- claimed: ""
110
- })) : b("", !0)
113
+ claimed: "",
114
+ dir: Z.value
115
+ }, null, 8, ["dir"])) : y("", !0)
111
116
  ]),
112
117
  _: 3
113
118
  })]),
@@ -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","createStandaloneRegistry","createStandaloneContext","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\nconst context: AlfakitContextValue = parent\n ? {\n ...parent,\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 />\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,GAEtDC,IAA+Bb,IACjC;GACE,GAAGA;GACH,UAAUc,EAAyBhB,EAAM,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,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,EAA6CiB,IAAA;;MAAV,SAAA"}
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":";;;;;;;;;;;;;;;;;;;;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AAM,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, reloadOnExpiredPage as s, resolveRequestErrorNotification as c } from "@alfakit/core";
5
- import { router as l } from "@inertiajs/vue3";
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 u = typeof window > "u", d = u ? null : new o(), f = !1;
8
- function p() {
9
- u || f || (f = !0, s());
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 m(e, r) {
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 h(t, n, i) {
22
- let a = d ?? new o();
21
+ function g(t, n, i) {
22
+ let a = f ?? new o();
23
23
  return {
24
- registry: m(n),
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 = c(t, null, (e, t, n) => a.t(e, t, 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 g = 0;
38
- function _() {
39
- return g++, () => {
40
- g--;
37
+ var _ = 0;
38
+ function v() {
39
+ return _++, () => {
40
+ _--;
41
41
  };
42
42
  }
43
- function v() {
44
- return g > 0;
43
+ function y() {
44
+ return _ > 0;
45
45
  }
46
- var y = new a(), b = null, x = !1;
47
- function S(t) {
48
- if (b = t, u || x) return;
49
- x = !0;
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 y.fresh(n)) e(t, b?.resolve(t.view ?? ""));
52
+ for (let t of b.fresh(n)) e(t, x?.resolve(t.view ?? ""));
53
53
  };
54
- n(C()), l.on("flash", (e) => n(e.detail.flash));
54
+ n(w()), u.on("flash", (e) => n(e.detail.flash));
55
55
  }
56
- function C() {
57
- if (!u) try {
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 { _ as claimToaster, h as createStandaloneContext, m as createStandaloneRegistry, S as ensureFlashToasts, p as ensureStandaloneRuntime, v as hasToaster, C as initialFlash };
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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IAFA,IAAgBtB,GAEZX,KAAYgC,GAAgB;CAEhC,IAAiB;CAEjB,IAAME,KAAQ,MAAmB;EAC/B,IAAMC,IAAWC,GACb;EAEJ,KAAK,IAAMjB,KAAgBU,EAAa,MAAMM,CAAO,GACnD,EAAUhB,GAAcY,GAAe,QAAQZ,EAAa,QAAQ,EAAE,CAAC;CAE3E;CAGA,AADAe,EAAKG,EAAa,CAAC,GACnBC,EAAO,GAAG,UAAU,MAAUJ,EAAKK,EAAM,OAAO,KAAK,CAAC;AACxD;AAGA,SAAgBF,IAAwB;CACtC,IAAI,IAEJ,IAAI;EACF,IAAMG,IAAO,SAAS,cAA2B,aAAa,CAAC,EAAE,QAAQ;EAEzE,OAAOA,IAAQ,KAAK,MAAMA,CAAI,CAAC,CAAyB,QAAQ,KAAA;CAClE,QAAQ;EACN;CACF;AACF"}
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,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CAAC,CAAyB,QAAQ,KAAA;CAClE,QAAQ;EACN;CACF;AACF"}
@@ -54,19 +54,23 @@
54
54
  --color-gray: var(--muted-foreground);
55
55
  }
56
56
 
57
+ /* The same status tokens as the panel's styles.css (WCAG AA under their foregrounds). */
57
58
  :root {
58
- --success: var(--alfakit-success, oklch(0.627 0.194 149.214));
59
- --success-foreground: oklch(0.985 0 0);
60
- --warning: var(--alfakit-warning, oklch(0.769 0.188 70.08));
61
- --warning-foreground: oklch(0.145 0 0);
62
- --info: var(--alfakit-info, oklch(0.623 0.214 259.815));
63
- --info-foreground: oklch(0.985 0 0);
59
+ --success: var(--alfakit-success, oklch(0.48 0.14 150.5));
60
+ --success-foreground: var(--alfakit-success-foreground, oklch(0.985 0 0));
61
+ --warning: var(--alfakit-warning, oklch(0.52 0.15 48));
62
+ --warning-foreground: var(--alfakit-warning-foreground, oklch(0.985 0 0));
63
+ --info: var(--alfakit-info, oklch(0.51 0.24 263.5));
64
+ --info-foreground: var(--alfakit-info-foreground, oklch(0.985 0 0));
64
65
  }
65
66
 
66
67
  .dark {
67
68
  --success: var(--alfakit-success, oklch(0.723 0.219 149.579));
69
+ --success-foreground: var(--alfakit-success-foreground, oklch(0.145 0 0));
68
70
  --warning: var(--alfakit-warning, oklch(0.828 0.189 84.429));
71
+ --warning-foreground: var(--alfakit-warning-foreground, oklch(0.145 0 0));
69
72
  --info: var(--alfakit-info, oklch(0.707 0.165 254.624));
73
+ --info-foreground: var(--alfakit-info-foreground, oklch(0.145 0 0));
70
74
  }
71
75
 
72
76
  /*
@@ -130,7 +134,8 @@
130
134
  @apply border px-2 py-1;
131
135
  }
132
136
  .alfakit-prose :where(.alfakit-mention) {
133
- @apply bg-primary/10 text-primary rounded px-1 font-medium;
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;
134
139
  }
135
140
  .alfakit-prose :where(.alfakit-merge-tag) {
136
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 { 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 </AlfakitRoot>\n </div>\n</template>\n"],"mappings":""}
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":"AAoFA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEzE;;;;GAIG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAkEvD,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;AAqB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"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"}
@@ -1,40 +1,44 @@
1
1
  import { provideAlfakit as e } from "../context.js";
2
2
  import { setToasterId as t, showToast as n } from "../components/notifications/flash-toasts.js";
3
- import r from "../AlfakitRoot.js";
4
- import { starterKitContext as i } from "./runtime.js";
5
- import { STARTER_KIT_TOASTER_ID as a, installStarterKitRuntime as o, syncStarterKitPage as s } from "@alfakit/core";
6
- import { usePage as c } from "@inertiajs/vue3";
7
- import { createElementBlock as l, createVNode as u, defineComponent as d, onMounted as f, onUnmounted as p, openBlock as m, renderSlot as h, unref as g, watch as _, withCtx as v } from "vue";
3
+ import r from "../components/panel/DebugPanelSlot.js";
4
+ import i from "../AlfakitRoot.js";
5
+ import { starterKitContext as a } from "./runtime.js";
6
+ import { STARTER_KIT_TOASTER_ID as o, installStarterKitRuntime as s, syncStarterKitPage as c } from "@alfakit/core";
7
+ import { usePage as l } from "@inertiajs/vue3";
8
+ import { createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, onMounted as m, onUnmounted as h, openBlock as g, renderSlot as _, unref as v, watch as y, withCtx as b } from "vue";
8
9
  //#region src/starter-kit/AlfakitStarterKitRoot.vue?vue&type=script&setup=true&lang.ts
9
- var y = ["dir", "lang"], b = /*@__PURE__*/ d({
10
+ var x = ["dir", "lang"], S = {
11
+ "data-slot": "starter-kit-debug-panel",
12
+ class: "fixed right-16 bottom-16 z-40"
13
+ }, C = /*@__PURE__*/ p({
10
14
  __name: "AlfakitStarterKitRoot",
11
15
  props: { options: {} },
12
- setup(d) {
13
- let b = i(d.options ?? {}), x = c();
14
- return e(b), _(() => x.props.alfakit?.endpoints, (e) => {
15
- e && b.actions.setEndpoints({
16
+ setup(p) {
17
+ let C = a(p.options ?? {}), w = l();
18
+ return e(C), y(() => w.props.alfakit?.endpoints, (e) => {
19
+ e && C.actions.setEndpoints({
16
20
  action: e.action ?? "",
17
21
  modal: e.modal ?? ""
18
22
  });
19
23
  }, {
20
24
  immediate: !0,
21
25
  flush: "sync"
22
- }), f(() => {
23
- o((e) => n(e), (e, t, n) => b.translator.t(e, t, n)), t(a), _(() => x.props, (e) => s(e), { immediate: !0 });
24
- }), p(() => {
25
- s(null), t(void 0);
26
- }), (e, t) => (m(), l("div", {
26
+ }), m(() => {
27
+ s((e) => n(e), (e, t, n) => C.translator.t(e, t, n)), t(o), y(() => w.props, (e) => c(e), { immediate: !0 });
28
+ }), h(() => {
29
+ c(null), t(void 0);
30
+ }), (e, t) => (g(), u("div", {
27
31
  "data-slot": "starter-kit-root",
28
- dir: g(x).props.alfakit?.localization?.direction ?? "ltr",
29
- lang: g(x).props.alfakit?.localization?.tag,
32
+ dir: v(w).props.alfakit?.localization?.direction ?? "ltr",
33
+ lang: v(w).props.alfakit?.localization?.tag,
30
34
  class: "contents"
31
- }, [u(r, { "toaster-id": g(a) }, {
32
- default: v(() => [h(e.$slots, "default")]),
35
+ }, [f(i, { "toaster-id": v(o) }, {
36
+ default: b(() => [_(e.$slots, "default"), d("div", S, [f(r)])]),
33
37
  _: 3
34
- }, 8, ["toaster-id"])], 8, y));
38
+ }, 8, ["toaster-id"])], 8, x));
35
39
  }
36
40
  });
37
41
  //#endregion
38
- export { b as default };
42
+ export { C as default };
39
43
 
40
44
  //# sourceMappingURL=AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js","names":["props","_openBlock","_createElementBlock","_unref","_createVNode","AlfakitRoot","_withCtx","_renderSlot","AlfakitRoot_default","_hoisted_1","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"],"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 { 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 </AlfakitRoot>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EAoBA,IAAMW,IAAUC,EAAkBZ,EAAM,WAAW,CAAC,CAAC,GAC/Cc,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,cAMCzB,EAAA,GAAAC,EASM,OAAA;GARJ,aAAU;GACT,KAAKC,EAAAW,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc,aAAS;GAChD,MAAMX,EAAAW,CAAA,CAAI,CAAC,MAAM,SAAS,cAAc;GACzC,OAAM;EAENV,GAAAA,CAAAA,EAEcC,GAAA,EAFA,cAAYF,EAAAwB,CAAA,EAAsB,GAAA;GAC9C,SAAArB,QAAQ,CAARC,EAAQ8B,EAAA,QAAA,SAAA,CAAA,CAAA"}
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,EAGL,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAChC,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;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAQrF"}
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 n } from "@inertiajs/vue3";
3
- import { computed as r } from "vue";
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 i(i) {
6
- let a = n();
7
- return r(() => {
8
- let n = e(a.props, i);
5
+ function a(a) {
6
+ let o = r();
7
+ return i(() => {
8
+ let r = e(o.props, a);
9
9
  return {
10
- navigation: n,
11
- groups: t(n?.groups)
10
+ navigation: r,
11
+ groups: t(r?.groups),
12
+ userMenuItems: n(r?.userMenu)
12
13
  };
13
14
  });
14
15
  }
15
16
  //#endregion
16
- export { i as useAlfakitNavigation };
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 { navigation, groups: toStarterKitNavGroups(navigation?.groups) }\n })\n}\n"],"mappings":";;;;AA6BA,SAAgBA,EAAqB,GAAkD;CACrF,IAAMC,IAAOC,EAAQ;CAErB,OAAOC,QAAe;EACpB,IAAMC,IAAaC,EAAqBJ,EAAK,OAAOK,CAAO;EAE3D,OAAO;GAAE;GAAY,QAAQC,EAAsBH,GAAY,MAAM;EAAE;CACzE,CAAC;AACH"}
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
- @apply bg-primary/10 text-primary rounded px-1 font-medium;
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.8",
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.8"
99
+ "@alfakit/core": "0.1.10"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "@inertiajs/vue3": "^3.0.0",
@@ -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()
@@ -426,6 +426,8 @@ const hasBody = computed(() =>
426
426
  cn(
427
427
  schema.stickyHeader &&
428
428
  'bg-background sticky -top-6 z-10 -mx-6 -mt-6 rounded-t-lg border-b px-6 pt-6 pb-4',
429
+ // Room for the close button (X): a long heading would run under it.
430
+ schema.closeButton !== false && (schema.stickyHeader ? 'pe-12' : 'pe-6'),
429
431
  )
430
432
  "
431
433
  >