@alfakit/vue 0.1.2 → 0.1.7

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 (281) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/AlfakitRoot.js.map +1 -1
  3. package/dist/AlfakitRoot.vue.d.ts.map +1 -1
  4. package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js +3 -1
  5. package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/actions/ActionGroupMenu.js.map +1 -1
  7. package/dist/components/actions/ActionGroupMenu.vue.d.ts.map +1 -1
  8. package/dist/components/actions/ActionGroupMenu.vue_vue_type_script_setup_true_lang.js +69 -65
  9. package/dist/components/actions/ActionGroupMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/components/actions/ActionModal.js.map +1 -1
  11. package/dist/components/actions/ActionModal.vue.d.ts.map +1 -1
  12. package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js +17 -15
  13. package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/ai/AiCopilot.js.map +1 -1
  15. package/dist/components/ai/AiCopilot.vue.d.ts +2 -0
  16. package/dist/components/ai/AiCopilot.vue.d.ts.map +1 -1
  17. package/dist/components/ai/AiCopilot.vue_vue_type_script_setup_true_lang.js +7 -2
  18. package/dist/components/ai/AiCopilot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/cms/CmsPage.vue_vue_type_script_setup_true_lang.js +19 -19
  20. package/dist/components/cms/CmsPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/cms/LivePreview.js.map +1 -1
  22. package/dist/components/cms/LivePreview.vue.d.ts.map +1 -1
  23. package/dist/components/cms/LivePreview.vue_vue_type_script_setup_true_lang.js +83 -83
  24. package/dist/components/cms/LivePreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/fields/BuilderField.js.map +1 -1
  26. package/dist/components/fields/BuilderField.vue.d.ts.map +1 -1
  27. package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js +162 -157
  28. package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/components/fields/ImageEditorDialog.js.map +1 -1
  30. package/dist/components/fields/ImageEditorDialog.vue.d.ts.map +1 -1
  31. package/dist/components/fields/ImageEditorDialog.vue_vue_type_script_setup_true_lang.js +46 -46
  32. package/dist/components/fields/ImageEditorDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/fields/KeyValueField.js.map +1 -1
  34. package/dist/components/fields/KeyValueField.vue.d.ts.map +1 -1
  35. package/dist/components/fields/KeyValueField.vue_vue_type_script_setup_true_lang.js +66 -66
  36. package/dist/components/fields/KeyValueField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/components/fields/ModalTablePicker.js.map +1 -1
  38. package/dist/components/fields/ModalTablePicker.vue.d.ts.map +1 -1
  39. package/dist/components/fields/ModalTablePicker.vue_vue_type_script_setup_true_lang.js +113 -113
  40. package/dist/components/fields/ModalTablePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/components/fields/RepeaterField.js.map +1 -1
  42. package/dist/components/fields/RepeaterField.vue.d.ts.map +1 -1
  43. package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js +12 -12
  44. package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/fields/RichEditorInput.js.map +1 -1
  46. package/dist/components/fields/RichEditorInput.vue.d.ts.map +1 -1
  47. package/dist/components/fields/RichEditorInput.vue_vue_type_script_setup_true_lang.js +166 -165
  48. package/dist/components/fields/RichEditorInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/fields/SliderField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/components/fields/item-actions.d.ts +2 -2
  51. package/dist/components/fields/item-actions.d.ts.map +1 -1
  52. package/dist/components/fields/item-actions.js +31 -31
  53. package/dist/components/fields/item-actions.js.map +1 -1
  54. package/dist/components/form/FormBlock.js.map +1 -1
  55. package/dist/components/form/FormBlock.vue.d.ts.map +1 -1
  56. package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js +1 -1
  57. package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/form/form-context.js +25 -25
  59. package/dist/components/form/form-context.js.map +1 -1
  60. package/dist/components/kanban/KanbanBoard.js.map +1 -1
  61. package/dist/components/kanban/KanbanBoard.vue.d.ts.map +1 -1
  62. package/dist/components/kanban/KanbanBoard.vue_vue_type_script_setup_true_lang.js +5 -2
  63. package/dist/components/kanban/KanbanBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  64. package/dist/components/kanban/KanbanColumnHeader.js.map +1 -1
  65. package/dist/components/kanban/KanbanColumnHeader.vue.d.ts.map +1 -1
  66. package/dist/components/kanban/KanbanColumnHeader.vue_vue_type_script_setup_true_lang.js +64 -64
  67. package/dist/components/kanban/KanbanColumnHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/layout/SectionComponent.js.map +1 -1
  69. package/dist/components/layout/SectionComponent.vue.d.ts.map +1 -1
  70. package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js +23 -23
  71. package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/panel/DebugPanel.vue_vue_type_script_setup_true_lang.js +8 -8
  73. package/dist/components/panel/DebugPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/components/panel/GlobalSearchPalette.js.map +1 -1
  75. package/dist/components/panel/GlobalSearchPalette.vue.d.ts.map +1 -1
  76. package/dist/components/panel/GlobalSearchPalette.vue_vue_type_script_setup_true_lang.js +102 -96
  77. package/dist/components/panel/GlobalSearchPalette.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js +10 -10
  79. package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/panel/NavGroupFlyout.vue_vue_type_script_setup_true_lang.js +9 -9
  81. package/dist/components/panel/NavGroupFlyout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js +16 -16
  83. package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  84. package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js +10 -10
  85. package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  86. package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js +35 -35
  87. package/dist/components/panel/TenantMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/components/panel/Topbar.vue_vue_type_script_setup_true_lang.js +11 -11
  89. package/dist/components/panel/Topbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/realtime/use-live-updates.d.ts.map +1 -1
  91. package/dist/components/realtime/use-live-updates.js +24 -23
  92. package/dist/components/realtime/use-live-updates.js.map +1 -1
  93. package/dist/components/table/BooleanCell.vue_vue_type_script_setup_true_lang.js +2 -1
  94. package/dist/components/table/BooleanCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  95. package/dist/components/table/ColumnHeader.js.map +1 -1
  96. package/dist/components/table/ColumnHeader.vue.d.ts.map +1 -1
  97. package/dist/components/table/ColumnHeader.vue_vue_type_script_setup_true_lang.js +55 -49
  98. package/dist/components/table/ColumnHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  99. package/dist/components/table/ColumnManager.js.map +1 -1
  100. package/dist/components/table/ColumnManager.vue.d.ts.map +1 -1
  101. package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js +5 -4
  102. package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
  103. package/dist/components/table/ContentLayoutSort.js.map +1 -1
  104. package/dist/components/table/ContentLayoutSort.vue.d.ts.map +1 -1
  105. package/dist/components/table/ContentLayoutSort.vue_vue_type_script_setup_true_lang.js +5 -5
  106. package/dist/components/table/ContentLayoutSort.vue_vue_type_script_setup_true_lang.js.map +1 -1
  107. package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js +2 -1
  108. package/dist/components/table/SelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/components/table/SelectComboboxCell.vue_vue_type_script_setup_true_lang.js +2 -1
  110. package/dist/components/table/SelectComboboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  111. package/dist/components/table/TableCellContent.js.map +1 -1
  112. package/dist/components/table/TableCellContent.vue.d.ts.map +1 -1
  113. package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js +4 -3
  114. package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/table/TablePagination.js.map +1 -1
  116. package/dist/components/table/TablePagination.vue.d.ts.map +1 -1
  117. package/dist/components/table/TablePagination.vue_vue_type_script_setup_true_lang.js +87 -87
  118. package/dist/components/table/TablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js +2 -1
  120. package/dist/components/table/TextInputCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  121. package/dist/components/table/cell-update.d.ts +6 -0
  122. package/dist/components/table/cell-update.d.ts.map +1 -1
  123. package/dist/components/table/cell-update.js.map +1 -1
  124. package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
  125. package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  126. package/dist/components/ui/CommandAutoHighlight.js +7 -0
  127. package/dist/components/ui/CommandAutoHighlight.js.map +1 -0
  128. package/dist/components/ui/CommandAutoHighlight.vue.d.ts +21 -0
  129. package/dist/components/ui/CommandAutoHighlight.vue.d.ts.map +1 -0
  130. package/dist/components/ui/CommandAutoHighlight.vue_vue_type_script_setup_true_lang.js +18 -0
  131. package/dist/components/ui/CommandAutoHighlight.vue_vue_type_script_setup_true_lang.js.map +1 -0
  132. package/dist/components/ui/DialogContent.js.map +1 -1
  133. package/dist/components/ui/DialogContent.vue.d.ts.map +1 -1
  134. package/dist/components/ui/DialogContent.vue_vue_type_script_setup_true_lang.js +13 -12
  135. package/dist/components/ui/DialogContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  136. package/dist/components/ui/PopoverContent.js.map +1 -1
  137. package/dist/components/ui/PopoverContent.vue.d.ts.map +1 -1
  138. package/dist/components/ui/PopoverContent.vue_vue_type_script_setup_true_lang.js +9 -8
  139. package/dist/components/ui/PopoverContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/components/ui/SheetContent.js.map +1 -1
  141. package/dist/components/ui/SheetContent.vue.d.ts.map +1 -1
  142. package/dist/components/ui/SheetContent.vue_vue_type_script_setup_true_lang.js +13 -12
  143. package/dist/components/ui/SheetContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  144. package/dist/components/ui/TooltipContent.js.map +1 -1
  145. package/dist/components/ui/TooltipContent.vue.d.ts.map +1 -1
  146. package/dist/components/ui/TooltipContent.vue_vue_type_script_setup_true_lang.js +9 -8
  147. package/dist/components/ui/TooltipContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  148. package/dist/context.d.ts +7 -0
  149. package/dist/context.d.ts.map +1 -1
  150. package/dist/context.js +29 -26
  151. package/dist/context.js.map +1 -1
  152. package/dist/create-alfakit.d.ts.map +1 -1
  153. package/dist/create-alfakit.js +33 -31
  154. package/dist/create-alfakit.js.map +1 -1
  155. package/dist/eject-manifest.json +11 -2
  156. package/dist/index.d.ts +1 -0
  157. package/dist/index.d.ts.map +1 -1
  158. package/dist/index.js +219 -217
  159. package/dist/layouts/AppLayout.vue_vue_type_script_setup_true_lang.js +8 -8
  160. package/dist/layouts/AppLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/layouts/AuthLayout.vue_vue_type_script_setup_true_lang.js +9 -9
  162. package/dist/layouts/FullscreenLayout.vue_vue_type_script_setup_true_lang.js +8 -8
  163. package/dist/layouts/FullscreenLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  164. package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js +15 -15
  165. package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/layouts/lazy-layouts.d.ts +10 -0
  167. package/dist/layouts/lazy-layouts.d.ts.map +1 -0
  168. package/dist/layouts/lazy-layouts.js +8 -0
  169. package/dist/layouts/lazy-layouts.js.map +1 -0
  170. package/dist/layouts/panel-layouts.d.ts +8 -0
  171. package/dist/layouts/panel-layouts.d.ts.map +1 -0
  172. package/dist/layouts/panel-layouts.js +15 -0
  173. package/dist/layouts/panel-layouts.js.map +1 -0
  174. package/dist/lib/lazy.d.ts.map +1 -1
  175. package/dist/lib/lazy.js +2 -2
  176. package/dist/lib/lazy.js.map +1 -1
  177. package/dist/pages/PageShell.js.map +1 -1
  178. package/dist/pages/PageShell.vue.d.ts.map +1 -1
  179. package/dist/pages/PageShell.vue_vue_type_script_setup_true_lang.js +39 -42
  180. package/dist/pages/PageShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/standalone/AlfakitComponent.js.map +1 -1
  182. package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
  183. package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +56 -52
  184. package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  185. package/dist/standalone.css +7 -0
  186. package/dist/starter-kit/AlfakitStarterKitRoot.js.map +1 -1
  187. package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts +2 -2
  188. package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts.map +1 -1
  189. package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js +17 -12
  190. package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/starter-kit/dashboard-widgets.d.ts +54 -0
  192. package/dist/starter-kit/dashboard-widgets.d.ts.map +1 -0
  193. package/dist/starter-kit/dashboard-widgets.js +54 -0
  194. package/dist/starter-kit/dashboard-widgets.js.map +1 -0
  195. package/dist/starter-kit/index.d.ts +2 -1
  196. package/dist/starter-kit/index.d.ts.map +1 -1
  197. package/dist/starter-kit/index.js +5 -4
  198. package/dist/starter-kit/runtime.d.ts +6 -0
  199. package/dist/starter-kit/runtime.d.ts.map +1 -1
  200. package/dist/starter-kit/runtime.js +19 -15
  201. package/dist/starter-kit/runtime.js.map +1 -1
  202. package/dist/starter-kit/starter-kit.d.ts.map +1 -1
  203. package/dist/starter-kit/starter-kit.js +8 -8
  204. package/dist/starter-kit/starter-kit.js.map +1 -1
  205. package/dist/starter-kit/widgets/CopilotTrigger.js +7 -0
  206. package/dist/starter-kit/widgets/CopilotTrigger.js.map +1 -0
  207. package/dist/starter-kit/widgets/CopilotTrigger.vue.d.ts +12 -0
  208. package/dist/starter-kit/widgets/CopilotTrigger.vue.d.ts.map +1 -0
  209. package/dist/starter-kit/widgets/CopilotTrigger.vue_vue_type_script_setup_true_lang.js +23 -0
  210. package/dist/starter-kit/widgets/CopilotTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
  211. package/dist/starter-kit/widgets/LoadedCopilot.js +7 -0
  212. package/dist/starter-kit/widgets/LoadedCopilot.js.map +1 -0
  213. package/dist/starter-kit/widgets/LoadedCopilot.vue.d.ts +8 -0
  214. package/dist/starter-kit/widgets/LoadedCopilot.vue.d.ts.map +1 -0
  215. package/dist/starter-kit/widgets/LoadedCopilot.vue_vue_type_script_setup_true_lang.js +31 -0
  216. package/dist/starter-kit/widgets/LoadedCopilot.vue_vue_type_script_setup_true_lang.js.map +1 -0
  217. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.js +7 -0
  218. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.js.map +1 -0
  219. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue.d.ts +8 -0
  220. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue.d.ts.map +1 -0
  221. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue_vue_type_script_setup_true_lang.js +34 -0
  222. package/dist/starter-kit/widgets/StarterKitImpersonationBanner.vue_vue_type_script_setup_true_lang.js.map +1 -0
  223. package/dist/starter-kit/widgets/index.d.ts +40 -9
  224. package/dist/starter-kit/widgets/index.d.ts.map +1 -1
  225. package/dist/starter-kit/widgets/index.js +21 -18
  226. package/dist/starter-kit/widgets/index.js.map +1 -1
  227. package/dist/starter-kit/widgets/loaded.d.ts +10 -0
  228. package/dist/starter-kit/widgets/loaded.d.ts.map +1 -0
  229. package/dist/starter-kit/widgets/loaded.js +5 -0
  230. package/dist/styles.css +9 -2
  231. package/dist/themes.css +6 -1
  232. package/package.json +2 -2
  233. package/src/AlfakitRoot.vue +9 -1
  234. package/src/components/actions/ActionGroupMenu.vue +13 -1
  235. package/src/components/actions/ActionModal.vue +9 -0
  236. package/src/components/ai/AiCopilot.vue +7 -1
  237. package/src/components/cms/LivePreview.vue +8 -2
  238. package/src/components/fields/BuilderField.vue +15 -2
  239. package/src/components/fields/ImageEditorDialog.vue +7 -3
  240. package/src/components/fields/KeyValueField.vue +3 -2
  241. package/src/components/fields/ModalTablePicker.vue +7 -2
  242. package/src/components/fields/RepeaterField.vue +2 -3
  243. package/src/components/fields/RichEditorInput.vue +3 -0
  244. package/src/components/fields/item-actions.ts +31 -10
  245. package/src/components/form/FormBlock.vue +2 -1
  246. package/src/components/form/form-context.ts +2 -2
  247. package/src/components/kanban/KanbanBoard.vue +15 -3
  248. package/src/components/kanban/KanbanColumnHeader.vue +6 -4
  249. package/src/components/layout/SectionComponent.vue +10 -4
  250. package/src/components/panel/GlobalSearchPalette.vue +2 -0
  251. package/src/components/realtime/use-live-updates.ts +3 -1
  252. package/src/components/table/ColumnHeader.vue +23 -12
  253. package/src/components/table/ColumnManager.vue +12 -8
  254. package/src/components/table/ContentLayoutSort.vue +7 -1
  255. package/src/components/table/TableCellContent.vue +4 -2
  256. package/src/components/table/TablePagination.vue +12 -7
  257. package/src/components/table/cell-update.ts +6 -0
  258. package/src/components/ui/CommandAutoHighlight.vue +27 -0
  259. package/src/components/ui/DialogContent.vue +5 -1
  260. package/src/components/ui/PopoverContent.vue +5 -1
  261. package/src/components/ui/SheetContent.vue +5 -1
  262. package/src/components/ui/TooltipContent.vue +5 -1
  263. package/src/context.ts +10 -0
  264. package/src/create-alfakit.ts +5 -0
  265. package/src/index.ts +2 -0
  266. package/src/layouts/lazy-layouts.ts +14 -0
  267. package/src/layouts/panel-layouts.ts +17 -0
  268. package/src/lib/lazy.ts +11 -1
  269. package/src/pages/PageShell.vue +5 -6
  270. package/src/standalone/AlfakitComponent.vue +17 -6
  271. package/src/starter-kit/AlfakitStarterKitRoot.vue +12 -3
  272. package/src/starter-kit/dashboard-widgets.ts +93 -0
  273. package/src/starter-kit/index.ts +7 -1
  274. package/src/starter-kit/runtime.ts +17 -1
  275. package/src/starter-kit/starter-kit.ts +2 -1
  276. package/src/starter-kit/widgets/CopilotTrigger.vue +58 -0
  277. package/src/starter-kit/widgets/LoadedCopilot.vue +29 -0
  278. package/src/starter-kit/widgets/StarterKitImpersonationBanner.vue +57 -0
  279. package/src/starter-kit/widgets/index.ts +56 -11
  280. package/src/starter-kit/widgets/loaded.ts +9 -0
  281. package/src/styles.css +9 -2
@@ -1 +1 @@
1
- {"version":3,"file":"PageShell.vue_vue_type_script_setup_true_lang.js","names":["AuthLayout","BlankLayout","FullscreenLayout","AppLayout","ConflictBanner","_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","_createVNode","KeyboardShortcuts","Slot","PageHeader","_createCommentVNode","SubNavigationLayout","Slot_default","KeyboardShortcuts_default","AppLayout_default","AuthLayout_default","BlankLayout_default","FullscreenLayout_default","SubNavigationLayout_default","ConflictBanner_default","PageHeader_default","PageShell_vue_vue_type_script_setup_true_lang_default","props","__props","registry","useRegistry","Auth","computed","Blank","Fullscreen","App","Conflicts","undoBodyAttributes","watch","applyBodyAttributes","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","withCtx","renderSlot","_ctx","createVNode","createCommentVNode"],"sources":["../../src/pages/PageShell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageSchema } from '@alfakit/core'\nimport { applyBodyAttributes } from '@alfakit/core'\nimport { computed, onBeforeUnmount, watch } from 'vue'\nimport KeyboardShortcuts from '../components/panel/KeyboardShortcuts.vue'\nimport Slot from '../components/panel/Slot.vue'\nimport { useRegistry } from '../context'\nimport AppLayout from '../layouts/AppLayout.vue'\nimport AuthLayout from '../layouts/AuthLayout.vue'\nimport BlankLayout from '../layouts/BlankLayout.vue'\nimport FullscreenLayout from '../layouts/FullscreenLayout.vue'\nimport SubNavigationLayout from '../components/panel/SubNavigationLayout.vue'\nimport ConflictBanner from '../components/realtime/ConflictBanner.vue'\nimport PageHeader from './PageHeader.vue'\n\nconst props = defineProps<{ page: PageSchema }>()\nconst registry = useRegistry()\n\n// Each layout can be replaced: createAlfakit({ components: { 'layout:app': MyLayout } }).\nconst Auth = computed(() => registry.resolve('layout:auth') ?? AuthLayout)\nconst Blank = computed(() => registry.resolve('layout:blank') ?? BlankLayout)\nconst Fullscreen = computed(() => registry.resolve('layout:fullscreen') ?? FullscreenLayout)\nconst App = computed(() => registry.resolve('layout:app') ?? AppLayout)\n// Edit pages: somebody else saved the record (`detectConflicts()`, `Panel::realtime()`).\nconst Conflicts = computed(() => registry.resolve('page:conflict-banner') ?? ConflictBanner)\n\n// The page's `$extraBodyAttributes` on `<body>` while it is open.\nlet undoBodyAttributes = () => {}\nwatch(\n () => JSON.stringify(props.page.extraBodyAttributes ?? null),\n () => {\n undoBodyAttributes()\n undoBodyAttributes = applyBodyAttributes(props.page.extraBodyAttributes)\n },\n { immediate: true },\n)\nonBeforeUnmount(() => undoBodyAttributes())\n</script>\n\n<template>\n <component\n :is=\"Auth\"\n v-if=\"props.page.layout === 'auth'\"\n :heading=\"props.page.heading ?? props.page.title\"\n :subheading=\"props.page.subheading\"\n :page=\"props.page\"\n >\n <slot />\n </component>\n <component :is=\"Blank\" v-else-if=\"props.page.layout === 'blank'\" :page=\"props.page\">\n <slot />\n </component>\n <component :is=\"Fullscreen\" v-else-if=\"props.page.layout === 'fullscreen'\" :page=\"props.page\">\n <slot />\n </component>\n <component\n :is=\"App\"\n v-else\n :breadcrumbs=\"props.page.breadcrumbs\"\n :max-content-width=\"props.page.maxContentWidth\"\n :page=\"props.page\"\n >\n <!-- `?` overlay, `/`, `g d` and panel command shortcuts (`keyboardShortcuts()`). -->\n <KeyboardShortcuts />\n <Slot name=\"page.start\" />\n <PageHeader :page=\"props.page\" />\n <component :is=\"Conflicts\" v-if=\"props.page.conflicts\" :page=\"props.page\" />\n <SubNavigationLayout v-if=\"props.page.subNavigation\" :navigation=\"props.page.subNavigation\">\n <slot />\n </SubNavigationLayout>\n <slot v-else />\n <Slot name=\"page.end\" />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAeA,IAAM0B,IAAQC,GACRC,IAAWC,EAAY,GAGvBC,IAAOC,QAAeH,EAAS,QAAQ,aAAa,KAAK5B,CAAU,GACnEgC,IAAQD,QAAeH,EAAS,QAAQ,cAAc,KAAK3B,CAAW,GACtEgC,IAAaF,QAAeH,EAAS,QAAQ,mBAAmB,KAAK1B,CAAgB,GACrFgC,IAAMH,QAAeH,EAAS,QAAQ,YAAY,KAAKzB,CAAS,GAEhEgC,IAAYJ,QAAeH,EAAS,QAAQ,sBAAsB,KAAKxB,CAAc,GAGvFgC,UAA2B,CAAC;SAChCC,QACQ,KAAK,UAAUX,EAAM,KAAK,uBAA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AAM;;IACzCA,EAAM,KAAK,iBAAtCrB,EAAA,GAAAC,EAEsBS,GAAA;;KAFgC,YAAYW,EAAM,KAAK;;KAC3E,SAAAlB,QAAQ,CAARC,EAAQoC,EAAA,QAAA,SAAA,CAAA,CAAA;;IAEVpC,GAAAA,GAAAA,CAAAA,YAAAA,CAAAA,KAAAA,EAAeoC,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA;IACfnC,EAAwBE,GAAA,EAAlB,MAAK,WAAU,CAAA"}
1
+ {"version":3,"file":"PageShell.vue_vue_type_script_setup_true_lang.js","names":["BlankLayout","ConflictBanner","_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot","_createVNode","KeyboardShortcuts","Slot","PageHeader","_createCommentVNode","SubNavigationLayout","Slot_default","KeyboardShortcuts_default","BlankLayout_default","SubNavigationLayout_default","ConflictBanner_default","PageHeader_default","PageShell_vue_vue_type_script_setup_true_lang_default","props","__props","registry","useRegistry","Auth","computed","Blank","Fullscreen","App","Conflicts","undoBodyAttributes","watch","applyBodyAttributes","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","withCtx","renderSlot","_ctx","createVNode","createCommentVNode"],"sources":["../../src/pages/PageShell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageSchema } from '@alfakit/core'\nimport { applyBodyAttributes } from '@alfakit/core'\nimport { computed, onBeforeUnmount, watch } from 'vue'\nimport KeyboardShortcuts from '../components/panel/KeyboardShortcuts.vue'\nimport Slot from '../components/panel/Slot.vue'\nimport { useRegistry } from '../context'\nimport BlankLayout from '../layouts/BlankLayout.vue'\nimport SubNavigationLayout from '../components/panel/SubNavigationLayout.vue'\nimport ConflictBanner from '../components/realtime/ConflictBanner.vue'\nimport PageHeader from './PageHeader.vue'\n\nconst props = defineProps<{ page: PageSchema }>()\nconst registry = useRegistry()\n\n// Each layout can be replaced: createAlfakit({ components: { 'layout:app': MyLayout } }).\n// `createAlfakit()` registers the panel's layouts (`panelLayouts`), the starter kit its content\n// layout; importing the panel layouts here would put the sidebar in every starter kit page.\nconst Auth = computed(() => registry.resolve('layout:auth') ?? BlankLayout)\nconst Blank = computed(() => registry.resolve('layout:blank') ?? BlankLayout)\nconst Fullscreen = computed(() => registry.resolve('layout:fullscreen') ?? BlankLayout)\nconst App = computed(() => registry.resolve('layout:app') ?? BlankLayout)\n// Edit pages: somebody else saved the record (`detectConflicts()`, `Panel::realtime()`).\nconst Conflicts = computed(() => registry.resolve('page:conflict-banner') ?? ConflictBanner)\n\n// The page's `$extraBodyAttributes` on `<body>` while it is open.\nlet undoBodyAttributes = () => {}\nwatch(\n () => JSON.stringify(props.page.extraBodyAttributes ?? null),\n () => {\n undoBodyAttributes()\n undoBodyAttributes = applyBodyAttributes(props.page.extraBodyAttributes)\n },\n { immediate: true },\n)\nonBeforeUnmount(() => undoBodyAttributes())\n</script>\n\n<template>\n <component\n :is=\"Auth\"\n v-if=\"props.page.layout === 'auth'\"\n :heading=\"props.page.heading ?? props.page.title\"\n :subheading=\"props.page.subheading\"\n :page=\"props.page\"\n >\n <slot />\n </component>\n <component :is=\"Blank\" v-else-if=\"props.page.layout === 'blank'\" :page=\"props.page\">\n <slot />\n </component>\n <component :is=\"Fullscreen\" v-else-if=\"props.page.layout === 'fullscreen'\" :page=\"props.page\">\n <slot />\n </component>\n <component\n :is=\"App\"\n v-else\n :breadcrumbs=\"props.page.breadcrumbs\"\n :max-content-width=\"props.page.maxContentWidth\"\n :page=\"props.page\"\n >\n <!-- `?` overlay, `/`, `g d` and panel command shortcuts (`keyboardShortcuts()`). -->\n <KeyboardShortcuts />\n <Slot name=\"page.start\" />\n <PageHeader :page=\"props.page\" />\n <component :is=\"Conflicts\" v-if=\"props.page.conflicts\" :page=\"props.page\" />\n <SubNavigationLayout v-if=\"props.page.subNavigation\" :navigation=\"props.page.subNavigation\">\n <slot />\n </SubNavigationLayout>\n <slot v-else />\n <Slot name=\"page.end\" />\n </component>\n</template>\n"],"mappings":";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A,CAAAA,MAAAA,EAAA,GAAAC,EAiBYC,EAhBLwB,EAAA,KAAG,GAAA;;GAEP,aAAaR,EAAM,KAAK;GACxB,qBAAmBA,EAAM,KAAK;GAC9B,MAAMA,EAAM;;GAGb,SAAAf,QAAqB;IAArBE,EAAqBC,CAAA;IACrBD,EAA0BE,GAAA,EAApB,MAAK,aAAY,CAAA;IACvBF,EAAiCG,GAAA,EAApB,MAAMU,EAAM,KAAA,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;IACQA,EAAM,KAAK,aAA5ClB,EAAA,GAAAC,EAA4EC,EAA5DyB,EAAA,KAAS,GAAA;;KAA+B,MAAMT,EAAM;;IACzCA,EAAM,KAAK,iBAAtClB,EAAA,GAAAC,EAEsBS,GAAA;;KAFgC,YAAYQ,EAAM,KAAK;;KAC3E,SAAAf,QAAQ,CAARC,EAAQiC,EAAA,QAAA,SAAA,CAAA,CAAA;;IAEVjC,GAAAA,GAAAA,CAAAA,YAAAA,CAAAA,KAAAA,EAAeiC,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA;IACfhC,EAAwBE,GAAA,EAAlB,MAAK,WAAU,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)\n\nconst context: AlfakitContextValue = parent\n ? { ...parent, registry: createStandaloneRegistry(props.components, parent.registry), poll }\n : createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\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 watch(\n () => props.component.token,\n () => void state.loadLazy(),\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":""}
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\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":""}
@@ -1 +1 @@
1
- {"version":3,"file":"AlfakitComponent.vue.d.ts","sourceRoot":"","sources":["../../src/standalone/AlfakitComponent.vue"],"names":[],"mappings":"AAsMA,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,E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AAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,28 +1,28 @@
1
1
  import { ALFAKIT_KEY as e, provideStandalone as t, useOptionalAlfakit as n } from "../context.js";
2
- import { providePageActionContext as ee } from "../components/actions/action-context.js";
3
- import { cn as r } from "../lib/utils.js";
4
- import i from "../components/actions/ActionList.js";
5
- import a from "../pages/ContentBlockRenderer.js";
2
+ import { providePageActionContext as r } from "../components/actions/action-context.js";
3
+ import { cn as i } from "../lib/utils.js";
4
+ import a from "../components/actions/ActionList.js";
5
+ 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 p from "./AlfakitToaster.js";
10
- import { StandaloneComponentState as te, findStandalonePropName as m, registerStandaloneProp as h, standalonePanelSchema as g } from "@alfakit/core";
11
- import { usePage as _ } from "@inertiajs/vue3";
12
- import { Fragment as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createVNode as w, defineComponent as T, normalizeClass as E, onMounted as ne, onScopeDispose as re, openBlock as D, provide as O, ref as k, renderList as A, renderSlot as j, resolveDynamicComponent as M, toDisplayString as N, unref as P, watch as F, withCtx as I } from "vue";
13
- import { ConfigProvider as L } from "reka-ui";
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";
13
+ import { ConfigProvider as I } from "reka-ui";
14
14
  //#region src/standalone/AlfakitComponent.vue?vue&type=script&setup=true&lang.ts
15
- var R = ["data-alfakit-component", "dir"], z = {
15
+ var L = ["data-alfakit-component", "dir"], R = {
16
16
  key: 0,
17
17
  "data-slot": "page-header",
18
18
  class: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"
19
- }, B = { class: "min-w-0" }, V = {
19
+ }, z = { class: "min-w-0" }, B = {
20
20
  key: 0,
21
21
  class: "text-xl font-semibold tracking-tight"
22
- }, H = {
22
+ }, V = {
23
23
  key: 1,
24
24
  class: "text-muted-foreground mt-1 text-sm"
25
- }, U = /*@__PURE__*/ T({
25
+ }, H = /*@__PURE__*/ w({
26
26
  __name: "AlfakitComponent",
27
27
  props: {
28
28
  component: {},
@@ -35,75 +35,79 @@ var R = ["data-alfakit-component", "dir"], z = {
35
35
  Array
36
36
  ] }
37
37
  },
38
- setup(T) {
39
- let U = T, W = n(), G = _(), K = k(0), q = new te(U.component, () => K.value++), J = (e, t) => q.poll(e, t), Y = W ? {
40
- ...W,
41
- registry: u(U.components, W.registry),
42
- poll: J
43
- } : l({
44
- action: U.component.endpoints.action,
45
- modal: U.component.endpoints.modal
46
- }, U.components, J);
47
- O(e, Y);
48
- let ie = y(() => g(U.component)), X = y(() => (K.value, q.setComponent(U.component), q.page)), Z = y(() => U.component.localization?.direction ?? "ltr"), Q = y(() => ({
49
- token: U.component.token,
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 ? {
40
+ ...U,
41
+ registry: u(H.components, U.registry),
42
+ poll: q,
43
+ refresh: J
44
+ } : {
45
+ ...l({
46
+ action: H.component.endpoints.action,
47
+ modal: H.component.endpoints.modal
48
+ }, H.components, q),
49
+ refresh: J
50
+ };
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(() => ({
53
+ token: H.component.token,
50
54
  component: "page"
51
55
  }));
52
56
  t({
53
- panel: ie,
57
+ panel: ae,
54
58
  page: X
55
- }), ee(Q.value), F(() => U.component, (e) => {
59
+ }), r(Q.value), P(() => H.component, (e) => {
56
60
  Y.actions.setEndpoints({
57
61
  action: e.endpoints.action,
58
62
  modal: e.endpoints.modal
59
- }), (!W || !G.props.alfakit) && (Y.translator.setTranslations(e.translations ?? {}), Y.translator.setLocale(e.localization?.tag ?? "en"));
63
+ }), (!U || !W.props.alfakit) && (Y.translator.setTranslations(e.translations ?? {}), Y.translator.setLocale(e.localization?.tag ?? "en"));
60
64
  }, {
61
65
  immediate: !0,
62
66
  flush: "sync"
63
67
  });
64
- let $ = k(!1);
65
- return ne(() => {
66
- if (d(), F(() => m(G.props, U.component), (e, t, n) => n(h(e ?? null)), { immediate: !0 }), F(() => U.component.token, () => void q.loadLazy(), { immediate: !0 }), W) return;
68
+ 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;
67
71
  let e = null, t = !1;
68
72
  queueMicrotask(() => {
69
73
  t || f() || (e = c(), $.value = !0);
70
- }), re(() => {
74
+ }), ie(() => {
71
75
  t = !0, e?.();
72
76
  });
73
- }), (e, t) => (D(), b(M(P(W) ? "div" : P(L)), {
74
- dir: P(W) ? void 0 : Z.value,
75
- class: E(P(W) ? "contents" : void 0)
77
+ }), (e, t) => (E(), y(j(N(U) ? "div" : N(I)), {
78
+ dir: N(U) ? void 0 : Z.value,
79
+ class: T(N(U) ? "contents" : void 0)
76
80
  }, {
77
- default: I(() => [w(s, { "delay-duration": 0 }, {
78
- default: I(() => [
79
- C("div", {
81
+ default: F(() => [C(s, { "delay-duration": 0 }, {
82
+ default: F(() => [
83
+ S("div", {
80
84
  "data-slot": "standalone",
81
- "data-alfakit-component": U.component.class,
85
+ "data-alfakit-component": H.component.class,
82
86
  dir: Z.value,
83
- class: E(P(r)("flex flex-col gap-6", U.class))
87
+ class: T(N(i)("flex flex-col gap-6", H.class))
84
88
  }, [
85
- X.value.heading || X.value.headerActions?.length ? (D(), S("header", z, [C("div", B, [X.value.heading ? (D(), S("h2", V, N(X.value.heading), 1)) : x("", !0), X.value.subheading ? (D(), S("p", H, N(X.value.subheading), 1)) : x("", !0)]), X.value.headerActions && X.value.headerActions.length > 0 ? (D(), b(i, {
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, {
86
90
  key: 0,
87
91
  actions: X.value.headerActions,
88
92
  context: Q.value,
89
93
  align: "end",
90
94
  class: "max-w-full shrink-0"
91
- }, null, 8, ["actions", "context"])) : x("", !0)])) : x("", !0),
92
- j(e.$slots, "header"),
93
- j(e.$slots, "default", {
95
+ }, null, 8, ["actions", "context"])) : b("", !0)])) : b("", !0),
96
+ A(e.$slots, "header"),
97
+ A(e.$slots, "default", {
94
98
  blocks: X.value.content,
95
- page: U.component
96
- }, () => [(D(!0), S(v, null, A(X.value.content, (e) => (D(), b(a, {
99
+ page: H.component
100
+ }, () => [(E(!0), x(_, null, k(X.value.content, (e) => (E(), y(ee, {
97
101
  key: e.key,
98
102
  block: e
99
103
  }, null, 8, ["block"]))), 128))]),
100
- j(e.$slots, "footer")
101
- ], 10, R),
102
- w(o),
103
- $.value ? (D(), b(p, {
104
+ A(e.$slots, "footer")
105
+ ], 10, L),
106
+ C(o),
107
+ $.value ? (E(), y(te, {
104
108
  key: 0,
105
109
  claimed: ""
106
- })) : x("", !0)
110
+ })) : b("", !0)
107
111
  ]),
108
112
  _: 3
109
113
  })]),
@@ -112,6 +116,6 @@ var R = ["data-alfakit-component", "dir"], z = {
112
116
  }
113
117
  });
114
118
  //#endregion
115
- export { U as default };
119
+ export { H as default };
116
120
 
117
121
  //# sourceMappingURL=AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map
@@ -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","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)\n\nconst context: AlfakitContextValue = parent\n ? { ...parent, registry: createStandaloneRegistry(props.components, parent.registry), poll }\n : createStandaloneContext(\n { action: props.component.endpoints.action, modal: props.component.endpoints.modal },\n props.components,\n poll,\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 watch(\n () => props.component.token,\n () => void state.loadLazy(),\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,GAEvBC,IAA+BX,IACjC;GAAE,GAAGA;GAAQ,UAAUY,EAAyBd,EAAM,YAAYE,EAAO,QAAQ;GAAG;EAAK,IACzFa,EACE;GAAE,QAAQf,EAAM,UAAU,UAAU;GAAQ,OAAOA,EAAM,UAAU,UAAU;EAAM,GACnFA,EAAM,YACNU,CACF;EAEJ,EAAQM,GAAaH,CAAO;EAE5B,IAAMI,KAAQC,QAAeC,EAAsBnB,EAAM,SAAS,CAAC,GAC7DoB,IAAOF,SACXZ,EAAa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BzD,EAAA,GAAAC,EAA6CiB,GAAA;;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","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,YAAYE,EAAO,QAAQ;GACpE;GACA;EACF,IACA;GACE,GAAGe,EACD;IAAE,QAAQjB,EAAM,UAAU,UAAU;IAAQ,OAAOA,EAAM,UAAU,UAAU;GAAM,GACnFA,EAAM,YACNU,CACF;GACA;EACF;EAEJ,EAAQQ,GAAaH,CAAO;EAE5B,IAAMI,KAA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MAE/E3E,EAAsBwE,EAAA,QAAA,QAAA;;KAExB/E,EAAgBW,CAAA;KACM0C,EAAA,SAAtB3D,EAAA,GAAAC,EAA6CiB,IAAA;;MAAV,SAAA"}
@@ -17,6 +17,13 @@
17
17
 
18
18
  @custom-variant dark (&:is(.dark *));
19
19
 
20
+ /*
21
+ * Class lists that live in @alfakit/core (stacked-on-mobile tables, filter and column manager
22
+ * widths in `table.ts`, …): scan core's build too. Relative to this file in
23
+ * node_modules/@alfakit/<renderer>/dist, next to node_modules/@alfakit/core.
24
+ */
25
+ @source '../../core/dist';
26
+
20
27
  /*
21
28
  * Grid classes are composed at runtime from schema breakpoints (`columns`, `columnSpan`),
22
29
  * so force Tailwind to generate every variant the renderers can produce.
@@ -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 <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n </AlfakitRoot>\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 { 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":""}
@@ -7,9 +7,9 @@ import { type StarterKitPageOptions } from './runtime';
7
7
  type __VLS_Props = {
8
8
  options?: StarterKitPageOptions;
9
9
  };
10
- declare var __VLS_5: {};
10
+ declare var __VLS_4: {};
11
11
  type __VLS_Slots = {} & {
12
- default?: (props: typeof __VLS_5) => any;
12
+ default?: (props: typeof __VLS_4) => any;
13
13
  };
14
14
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -1 +1 @@
1
- {"version":3,"file":"AlfakitStarterKitRoot.vue.d.ts","sourceRoot":"","sources":["../../src/starter-kit/AlfakitStarterKitRoot.vue"],"names":[],"mappings":"AA2EA,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEzE;;;;GAIG;AACH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC;AA4DvD,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":"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"}
@@ -4,32 +4,37 @@ import r from "../AlfakitRoot.js";
4
4
  import { starterKitContext as i } from "./runtime.js";
5
5
  import { STARTER_KIT_TOASTER_ID as a, installStarterKitRuntime as o, syncStarterKitPage as s } from "@alfakit/core";
6
6
  import { usePage as c } from "@inertiajs/vue3";
7
- import { createBlock as l, defineComponent as u, onMounted as d, onUnmounted as f, openBlock as p, renderSlot as m, unref as h, watch as g, withCtx as _ } from "vue";
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";
8
8
  //#region src/starter-kit/AlfakitStarterKitRoot.vue?vue&type=script&setup=true&lang.ts
9
- var v = /*@__PURE__*/ u({
9
+ var y = ["dir", "lang"], b = /*@__PURE__*/ d({
10
10
  __name: "AlfakitStarterKitRoot",
11
11
  props: { options: {} },
12
- setup(u) {
13
- let v = i(u.options ?? {}), y = c();
14
- return e(v), g(() => y.props.alfakit?.endpoints, (e) => {
15
- e && v.actions.setEndpoints({
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
16
  action: e.action ?? "",
17
17
  modal: e.modal ?? ""
18
18
  });
19
19
  }, {
20
20
  immediate: !0,
21
21
  flush: "sync"
22
- }), d(() => {
23
- o((e) => n(e), (e, t, n) => v.translator.t(e, t, n)), t(a), g(() => y.props, (e) => s(e), { immediate: !0 });
24
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
25
  s(null), t(void 0);
26
- }), (e, t) => (p(), l(r, { "toaster-id": h(a) }, {
27
- default: _(() => [m(e.$slots, "default")]),
26
+ }), (e, t) => (m(), l("div", {
27
+ "data-slot": "starter-kit-root",
28
+ dir: g(x).props.alfakit?.localization?.direction ?? "ltr",
29
+ lang: g(x).props.alfakit?.localization?.tag,
30
+ class: "contents"
31
+ }, [u(r, { "toaster-id": g(a) }, {
32
+ default: v(() => [h(e.$slots, "default")]),
28
33
  _: 3
29
- }, 8, ["toaster-id"]));
34
+ }, 8, ["toaster-id"])], 8, y));
30
35
  }
31
36
  });
32
37
  //#endregion
33
- export { v as default };
38
+ export { b as default };
34
39
 
35
40
  //# 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","_createBlock","AlfakitRoot","_unref","_withCtx","_renderSlot","AlfakitRoot_default","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","createBlock","unref","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 <AlfakitRoot :toaster-id=\"STARTER_KIT_TOASTER_ID\">\n <slot />\n </AlfakitRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;EAoBA,IAAMS,IAAUC,EAAkBV,EAAM,WAAW,CAAC,CAAC,GAC/CY,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,cAICvB,EAAA,GAAAC,EAEcC,GAAA,EAFA,cAAYC,EAAAqB,CAAA,EAAsB,GAAA;GAC9C,SAAApB,QAAQ,CAARC,EAAQ4B,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","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"}
@@ -0,0 +1,54 @@
1
+ import { type PropType } from 'vue';
2
+ import type { AnyComponent } from '../context';
3
+ /**
4
+ * The dashboard widgets of a `starterKit()` panel on the host's own dashboard. Reads the
5
+ * `alfakitWidgets` prop (shared on the panel's `starterKitDashboard()` pages only, the
6
+ * starter kit's `/dashboard` by default) and renders the widgets with the host's theme, as
7
+ * `<AlfakitComponent>` renders standalone widgets: lazy widgets, polling and table widget
8
+ * actions go through the panel's endpoints. Its code loads once mounted; the server render
9
+ * and hydration show placeholders. Renders its default slot (the kit's placeholder boxes)
10
+ * when there are no widgets to show: other pages, guests, users who may not open the panel.
11
+ *
12
+ * ```vue
13
+ * <script setup lang="ts">
14
+ * import { AlfakitWidgets } from '@alfakit/vue'
15
+ * </script>
16
+ *
17
+ * <template>
18
+ * <AlfakitWidgets>
19
+ * <MyEmptyState />
20
+ * </AlfakitWidgets>
21
+ * </template>
22
+ * ```
23
+ */
24
+ export declare const AlfakitWidgets: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
25
+ /** The `starterKit()` panel whose widgets to show (the first one by default). */
26
+ panel: {
27
+ type: PropType<string | undefined>;
28
+ default: undefined;
29
+ };
30
+ /** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */
31
+ components: {
32
+ type: PropType<Record<string, AnyComponent> | undefined>;
33
+ default: undefined;
34
+ };
35
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
36
+ [key: string]: any;
37
+ }> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
+ [key: string]: any;
39
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
+ /** The `starterKit()` panel whose widgets to show (the first one by default). */
41
+ panel: {
42
+ type: PropType<string | undefined>;
43
+ default: undefined;
44
+ };
45
+ /** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */
46
+ components: {
47
+ type: PropType<Record<string, AnyComponent> | undefined>;
48
+ default: undefined;
49
+ };
50
+ }>> & Readonly<{}>, {
51
+ components: Record<string, AnyComponent> | undefined;
52
+ panel: string | undefined;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
+ //# sourceMappingURL=dashboard-widgets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-widgets.d.ts","sourceRoot":"","sources":["../../src/starter-kit/dashboard-widgets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAqC9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc;IAIvB,iFAAiF;;cACxD,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACrD,gGAAgG;;cAE9E,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;;;;;;;;IAJpE,iFAAiF;;cACxD,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC;;;IACrD,gGAAgG;;cAE9E,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;;;;;;4EAmBtE,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { lazyComponent as e } from "../lib/lazy.js";
2
+ import { standaloneWidgetCount as t, starterKitDashboardWidgets as n } from "@alfakit/core";
3
+ import { usePage as r } from "@inertiajs/vue3";
4
+ import { computed as i, defineComponent as a, h as o } from "vue";
5
+ //#region src/starter-kit/dashboard-widgets.ts
6
+ var s = a({
7
+ name: "AlfakitWidgetsPlaceholder",
8
+ props: {
9
+ component: {
10
+ type: Object,
11
+ required: !0
12
+ },
13
+ components: {
14
+ type: Object,
15
+ default: void 0
16
+ }
17
+ },
18
+ setup(e) {
19
+ return () => o("div", {
20
+ "data-slot": "starter-kit-widgets-placeholder",
21
+ "aria-busy": "true",
22
+ class: "grid auto-rows-min gap-4 md:grid-cols-2"
23
+ }, Array.from({ length: Math.max(t(e.component), 1) }, (e, t) => o("div", {
24
+ key: t,
25
+ "aria-hidden": "true",
26
+ class: "bg-muted h-28 animate-pulse rounded-xl"
27
+ })));
28
+ }
29
+ }), c = e("AlfakitLoadedWidgets", () => import("../standalone/AlfakitComponent.js").then((e) => e.default), s), l = a({
30
+ name: "AlfakitWidgets",
31
+ inheritAttrs: !1,
32
+ props: {
33
+ panel: {
34
+ type: String,
35
+ default: void 0
36
+ },
37
+ components: {
38
+ type: Object,
39
+ default: void 0
40
+ }
41
+ },
42
+ setup(e, { attrs: t, slots: a }) {
43
+ let s = r(), l = i(() => n(s.props, e.panel));
44
+ return () => l.value ? o("div", { "data-slot": "starter-kit-widgets" }, [o(c, {
45
+ component: l.value,
46
+ components: e.components,
47
+ class: t.class
48
+ })]) : a.default?.();
49
+ }
50
+ });
51
+ //#endregion
52
+ export { l as AlfakitWidgets };
53
+
54
+ //# sourceMappingURL=dashboard-widgets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-widgets.js","names":["WidgetsPlaceholder","defineComponent","h","standaloneWidgetCount","props","index","LoadedWidgets","lazyComponent","module","AlfakitWidgets","page","usePage","component","computed","starterKitDashboardWidgets","attrs","slots"],"sources":["../../src/starter-kit/dashboard-widgets.ts"],"sourcesContent":["import {\n standaloneWidgetCount,\n starterKitDashboardWidgets,\n type StandaloneComponentSchema,\n} from '@alfakit/core'\nimport { usePage } from '@inertiajs/vue3'\nimport { computed, defineComponent, h, type PropType } from 'vue'\nimport type { AnyComponent } from '../context'\nimport { lazyComponent } from '../lib/lazy'\n\n/** Widget-sized boxes until the widgets' code has loaded (also during SSR). */\nconst WidgetsPlaceholder = defineComponent({\n name: 'AlfakitWidgetsPlaceholder',\n props: {\n component: { type: Object as PropType<StandaloneComponentSchema>, required: true },\n // Declared so it does not fall through as an attribute.\n components: { type: Object as PropType<Record<string, AnyComponent>>, default: undefined },\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n 'data-slot': 'starter-kit-widgets-placeholder',\n 'aria-busy': 'true',\n class: 'grid auto-rows-min gap-4 md:grid-cols-2',\n },\n Array.from({ length: Math.max(standaloneWidgetCount(props.component), 1) }, (_, index) =>\n h('div', {\n key: index,\n 'aria-hidden': 'true',\n class: 'bg-muted h-28 animate-pulse rounded-xl',\n }),\n ),\n )\n },\n})\n\nconst LoadedWidgets = lazyComponent(\n 'AlfakitLoadedWidgets',\n () => import('../standalone/AlfakitComponent.vue').then((module) => module.default),\n WidgetsPlaceholder,\n)\n\n/**\n * The dashboard widgets of a `starterKit()` panel on the host's own dashboard. Reads the\n * `alfakitWidgets` prop (shared on the panel's `starterKitDashboard()` pages only, the\n * starter kit's `/dashboard` by default) and renders the widgets with the host's theme, as\n * `<AlfakitComponent>` renders standalone widgets: lazy widgets, polling and table widget\n * actions go through the panel's endpoints. Its code loads once mounted; the server render\n * and hydration show placeholders. Renders its default slot (the kit's placeholder boxes)\n * when there are no widgets to show: other pages, guests, users who may not open the panel.\n *\n * ```vue\n * <script setup lang=\"ts\">\n * import { AlfakitWidgets } from '@alfakit/vue'\n * </script>\n *\n * <template>\n * <AlfakitWidgets>\n * <MyEmptyState />\n * </AlfakitWidgets>\n * </template>\n * ```\n */\nexport const AlfakitWidgets = defineComponent({\n name: 'AlfakitWidgets',\n inheritAttrs: false,\n props: {\n /** The `starterKit()` panel whose widgets to show (the first one by default). */\n panel: { type: String as PropType<string | undefined>, default: undefined },\n /** Frontend components of custom widgets (`{ RevenueWidget }`), as for `<AlfakitComponent>`. */\n components: {\n type: Object as PropType<Record<string, AnyComponent> | undefined>,\n default: undefined,\n },\n },\n setup(props, { attrs, slots }) {\n const page = usePage()\n const component = computed(() => starterKitDashboardWidgets(page.props, props.panel))\n\n return () =>\n component.value\n ? h('div', { 'data-slot': 'starter-kit-widgets' }, [\n h(LoadedWidgets, {\n component: component.value,\n components: props.components,\n class: attrs.class,\n }),\n ])\n : slots.default?.()\n },\n})\n"],"mappings":";;;;;AAWA,IAAMA,IAAqBC,EAAgB;CACzC,MAAM;CACN,OAAO;EACL,WAAW;GAAE,MAAM;GAA+C,UAAU;EAAK;EAEjF,YAAY;GAAE,MAAM;GAAkD,SAAS,KAAA;EAAU;CAC3F;CACA,MAAM,GAAO;EACX,aACEC,EACE,OACA;GACE,aAAa;GACb,aAAa;GACb,OAAO;EACT,GACA,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIC,EAAsBC,EAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,MAC9EF,EAAE,OAAO;GACP,KAAKG;GACL,eAAe;GACf,OAAO;EACT,CAAC,CACH,CACF;CACJ;AACF,CAAC,GAEKC,IAAgBC,EACpB,8BACM,OAAO,oCAAqC,CAAC,MAAM,MAAWC,EAAO,OAAO,GAClFR,CACF,GAuBaS,IAAiBR,EAAgB;CAC5C,MAAM;CACN,cAAc;CACd,OAAO;EAEL,OAAO;GAAE,MAAM;GAAwC,SAAS,KAAA;EAAU;EAE1E,YAAY;GACV,MAAM;GACN,SAAS,KAAA;EACX;CACF;CACA,MAAM,GAAO,EAAE,UAAO,YAAS;EAC7B,IAAMS,IAAOC,EAAQ,GACfC,IAAYC,QAAeC,EAA2BJ,EAAK,OAAON,EAAM,KAAK,CAAC;EAEpF,aACEQ,EAAU,QACNV,EAAE,OAAO,EAAE,aAAa,sBAAsB,GAAG,CAC/CA,EAAEI,GAAe;GACf,WAAWM,EAAU;GACrB,YAAYR,EAAM;GAClB,OAAOW,EAAM;EACf,CAAC,CACH,CAAC,IACDC,EAAM,UAAU;CACxB;AACF,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { default as AlfakitStarterKitRoot } from './AlfakitStarterKitRoot.vue';
2
+ export { AlfakitWidgets } from './dashboard-widgets';
2
3
  export { useAlfakitNavigation, type AlfakitNavigation } from './navigation';
3
4
  export { createStarterKitPage, type StarterKitPageOptions } from './starter-kit';
4
5
  export { default as StarterKitContentLayout } from './StarterKitContentLayout.vue';
5
- export { AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher } from './widgets';
6
+ export { AlfakitCopilot, AlfakitNotifications, AlfakitSearch, AlfakitTenantSwitcher, } from './widgets';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starter-kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/starter-kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAClF,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,qBAAqB,GACtB,MAAM,WAAW,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import e from "./StarterKitContentLayout.js";
2
2
  import t from "./AlfakitStarterKitRoot.js";
3
- import { useAlfakitNavigation as n } from "./navigation.js";
4
- import { createStarterKitPage as r } from "./starter-kit.js";
5
- import { AlfakitNotifications as i, AlfakitSearch as a, AlfakitTenantSwitcher as o } from "./widgets/index.js";
6
- export { i as AlfakitNotifications, a as AlfakitSearch, t as AlfakitStarterKitRoot, o as AlfakitTenantSwitcher, e as StarterKitContentLayout, r as createStarterKitPage, n as useAlfakitNavigation };
3
+ import { AlfakitWidgets as n } from "./dashboard-widgets.js";
4
+ import { useAlfakitNavigation as r } from "./navigation.js";
5
+ import { createStarterKitPage as i } from "./starter-kit.js";
6
+ import { AlfakitCopilot as a, AlfakitNotifications as o, AlfakitSearch as s, AlfakitTenantSwitcher as c } from "./widgets/index.js";
7
+ export { a as AlfakitCopilot, o as AlfakitNotifications, s as AlfakitSearch, t as AlfakitStarterKitRoot, c as AlfakitTenantSwitcher, n as AlfakitWidgets, e as StarterKitContentLayout, i as createStarterKitPage, r as useAlfakitNavigation };