@chelone/vue 0.7.0 → 0.10.0

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 (229) hide show
  1. package/dist/admin/admin.vue_vue_type_script_setup_true_lang.js +5 -4
  2. package/dist/admin/auth-gate.js +1 -3
  3. package/dist/admin/resource-view.d.ts +8 -0
  4. package/dist/admin/resource-view.js +19 -0
  5. package/dist/auth/permissions-hooks.js +1 -3
  6. package/dist/choices/choices-context.d.ts +1 -2
  7. package/dist/choices/use-choices.d.ts +3 -3
  8. package/dist/choices/use-choices.js +13 -10
  9. package/dist/choices/use-reference-input.js +4 -4
  10. package/dist/components/admin/auth/auth-error.vue_vue_type_script_setup_true_lang.js +4 -3
  11. package/dist/components/admin/auth/auth-layout.vue_vue_type_script_setup_true_lang.js +1 -1
  12. package/dist/components/admin/auth/can-access.vue.d.ts +2 -2
  13. package/dist/components/admin/auth/login-form.vue_vue_type_script_setup_true_lang.js +3 -2
  14. package/dist/components/admin/auth/login-with-email.vue_vue_type_script_setup_true_lang.js +1 -0
  15. package/dist/components/admin/buttons/bulk-update-button.vue.d.ts +19 -6
  16. package/dist/components/admin/buttons/bulk-update-button.vue_vue_type_script_setup_true_lang.js +1 -1
  17. package/dist/components/admin/buttons/clone-button.vue.d.ts +19 -16
  18. package/dist/components/admin/buttons/clone-button.vue_vue_type_script_setup_true_lang.js +4 -5
  19. package/dist/components/admin/buttons/delete-button.vue.d.ts +19 -10
  20. package/dist/components/admin/buttons/delete-button.vue_vue_type_script_setup_true_lang.js +6 -7
  21. package/dist/components/admin/buttons/dual-approval-button.vue_vue_type_script_setup_true_lang.js +14 -2
  22. package/dist/components/admin/buttons/edit-button.vue.d.ts +19 -16
  23. package/dist/components/admin/buttons/edit-button.vue_vue_type_script_setup_true_lang.js +4 -5
  24. package/dist/components/admin/buttons/export-button.vue_vue_type_script_setup_true_lang.js +2 -2
  25. package/dist/components/admin/buttons/fields-selector.vue_vue_type_script_setup_true_lang.js +1 -2
  26. package/dist/components/admin/buttons/filter-button.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/dist/components/admin/buttons/record-button-props.d.ts +12 -0
  28. package/dist/components/admin/buttons/show-button.vue.d.ts +19 -16
  29. package/dist/components/admin/buttons/show-button.vue_vue_type_script_setup_true_lang.js +4 -5
  30. package/dist/components/admin/buttons/status-transition-button.vue_vue_type_script_setup_true_lang.js +3 -7
  31. package/dist/components/admin/buttons/update-button.vue.d.ts +28 -24
  32. package/dist/components/admin/buttons/update-button.vue_vue_type_script_setup_true_lang.js +3 -4
  33. package/dist/components/admin/common/application-updated-notification.vue_vue_type_script_setup_true_lang.js +1 -1
  34. package/dist/components/admin/common/i18n-key-editor.vue_vue_type_script_setup_true_lang.js +1 -2
  35. package/dist/components/admin/csv-import/csv-import.vue_vue_type_script_setup_true_lang.js +2 -5
  36. package/dist/components/admin/feedback/error.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/dist/components/admin/feedback/linear-progress.vue_vue_type_script_setup_true_lang.js +1 -0
  38. package/dist/components/admin/feedback/loading.vue_vue_type_script_setup_true_lang.js +7 -6
  39. package/dist/components/admin/feedback/placeholder.vue_vue_type_script_setup_true_lang.js +4 -1
  40. package/dist/components/admin/fields/api-key-field.vue.d.ts +3 -3
  41. package/dist/components/admin/fields/api-key-field.vue_vue_type_script_setup_true_lang.js +6 -7
  42. package/dist/components/admin/fields/array-field.vue.d.ts +3 -3
  43. package/dist/components/admin/fields/badge-field.vue.d.ts +3 -3
  44. package/dist/components/admin/fields/boolean-field.vue.d.ts +3 -3
  45. package/dist/components/admin/fields/chip-field.vue.d.ts +3 -3
  46. package/dist/components/admin/fields/color-field.vue.d.ts +3 -3
  47. package/dist/components/admin/fields/cron-field.vue.d.ts +3 -3
  48. package/dist/components/admin/fields/currency-field.vue.d.ts +3 -3
  49. package/dist/components/admin/fields/date-field.vue.d.ts +3 -3
  50. package/dist/components/admin/fields/diff-viewer.vue.d.ts +3 -3
  51. package/dist/components/admin/fields/duration-field.vue.d.ts +3 -3
  52. package/dist/components/admin/fields/email-field.vue.d.ts +3 -3
  53. package/dist/components/admin/fields/field-props.d.ts +2 -2
  54. package/dist/components/admin/fields/file-field.vue.d.ts +3 -3
  55. package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
  56. package/dist/components/admin/fields/image-field.vue.d.ts +3 -3
  57. package/dist/components/admin/fields/json-field.vue.d.ts +3 -3
  58. package/dist/components/admin/fields/number-field.vue.d.ts +3 -3
  59. package/dist/components/admin/fields/phone-field.vue.d.ts +3 -3
  60. package/dist/components/admin/fields/phone-field.vue_vue_type_script_setup_true_lang.js +3 -1
  61. package/dist/components/admin/fields/rating-field.vue.d.ts +3 -3
  62. package/dist/components/admin/fields/rating-field.vue_vue_type_script_setup_true_lang.js +5 -5
  63. package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
  64. package/dist/components/admin/fields/reference-array-field.vue.d.ts +20 -10
  65. package/dist/components/admin/fields/reference-field.vue.d.ts +22 -35
  66. package/dist/components/admin/fields/reference-many-count.vue.d.ts +20 -5
  67. package/dist/components/admin/fields/reference-many-field.vue.d.ts +20 -12
  68. package/dist/components/admin/fields/reference-one-field.vue.d.ts +22 -12
  69. package/dist/components/admin/fields/select-field.vue.d.ts +3 -3
  70. package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +3 -3
  71. package/dist/components/admin/fields/text-array-field.vue.d.ts +3 -3
  72. package/dist/components/admin/fields/text-field.vue.d.ts +3 -3
  73. package/dist/components/admin/fields/url-field.vue.d.ts +3 -3
  74. package/dist/components/admin/fields/usage-meter-field.vue.d.ts +3 -3
  75. package/dist/components/admin/fields/usage-meter-field.vue_vue_type_script_setup_true_lang.js +6 -6
  76. package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +3 -3
  77. package/dist/components/admin/fields/webhook-endpoint-field.vue_vue_type_script_setup_true_lang.js +1 -1
  78. package/dist/components/admin/fields/wrapper-field.vue.d.ts +21 -11
  79. package/dist/components/admin/inputs/api-key-input.vue.d.ts +20 -5
  80. package/dist/components/admin/inputs/api-key-input.vue_vue_type_script_setup_true_lang.js +3 -4
  81. package/dist/components/admin/inputs/array-input-row.vue_vue_type_script_setup_true_lang.js +1 -1
  82. package/dist/components/admin/inputs/checkbox-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
  83. package/dist/components/admin/inputs/date-input-format.d.ts +4 -1
  84. package/dist/components/admin/inputs/date-input-format.js +10 -1
  85. package/dist/components/admin/inputs/date-input.vue_vue_type_script_setup_true_lang.js +3 -2
  86. package/dist/components/admin/inputs/date-time-input.vue_vue_type_script_setup_true_lang.js +3 -2
  87. package/dist/components/admin/inputs/duration-input.vue_vue_type_script_setup_true_lang.js +1 -1
  88. package/dist/components/admin/inputs/image-input-thumbnail.vue_vue_type_script_setup_true_lang.js +6 -5
  89. package/dist/components/admin/inputs/image-input.vue.d.ts +1 -0
  90. package/dist/components/admin/inputs/image-input.vue_vue_type_script_setup_true_lang.js +4 -1
  91. package/dist/components/admin/inputs/in-place-editor-form.vue.d.ts +3 -3
  92. package/dist/components/admin/inputs/in-place-editor-form.vue_vue_type_script_setup_true_lang.js +1 -1
  93. package/dist/components/admin/inputs/in-place-editor.vue.d.ts +3 -3
  94. package/dist/components/admin/inputs/number-input.vue.d.ts +6 -0
  95. package/dist/components/admin/inputs/number-input.vue_vue_type_script_setup_true_lang.js +9 -0
  96. package/dist/components/admin/inputs/password-input.vue_vue_type_script_setup_true_lang.js +34 -30
  97. package/dist/components/admin/inputs/phone-input.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/components/admin/inputs/radio-button-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
  99. package/dist/components/admin/inputs/rating-input.vue_vue_type_script_setup_true_lang.js +24 -12
  100. package/dist/components/admin/inputs/reference-input.vue.d.ts +1 -1
  101. package/dist/components/admin/inputs/reference-input.vue_vue_type_script_setup_true_lang.js +2 -1
  102. package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +6 -4
  103. package/dist/components/admin/inputs/resettable-text-input.vue_vue_type_script_setup_true_lang.js +44 -39
  104. package/dist/components/admin/inputs/subscription-plan-picker.vue_vue_type_script_setup_true_lang.js +2 -2
  105. package/dist/components/admin/inputs/text-input.vue.d.ts +13 -2
  106. package/dist/components/admin/inputs/text-input.vue_vue_type_script_setup_true_lang.js +9 -4
  107. package/dist/components/admin/inputs/time-input.vue_vue_type_script_setup_true_lang.js +3 -2
  108. package/dist/components/admin/inputs/use-choice-input.d.ts +2 -2
  109. package/dist/components/admin/layout/app-sidebar.vue.d.ts +12 -1
  110. package/dist/components/admin/layout/app-sidebar.vue_vue_type_script_setup_true_lang.js +15 -11
  111. package/dist/components/admin/layout/command-menu-content.vue_vue_type_script_setup_true_lang.js +1 -1
  112. package/dist/components/admin/layout/command-menu.vue.d.ts +1 -1
  113. package/dist/components/admin/layout/command-menu.vue_vue_type_script_setup_true_lang.js +9 -63
  114. package/dist/components/admin/layout/data-provider-devtools-entry.vue.d.ts +1 -1
  115. package/dist/components/admin/layout/data-provider-devtools-entry.vue_vue_type_script_setup_true_lang.js +3 -3
  116. package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js +62 -28
  117. package/dist/components/admin/layout/icons.d.ts +2 -0
  118. package/dist/components/admin/layout/icons.js +3 -1
  119. package/dist/components/admin/layout/layout.vue_vue_type_script_setup_true_lang.js +1 -1
  120. package/dist/components/admin/layout/menu-item-link.vue.d.ts +5 -0
  121. package/dist/components/admin/layout/menu-item-link.vue_vue_type_script_setup_true_lang.js +27 -8
  122. package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js +1 -2
  123. package/dist/components/admin/layout/resource-menu-item-group.vue.d.ts +8 -1
  124. package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js +8 -7
  125. package/dist/components/admin/layout/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -1
  126. package/dist/components/admin/layout/title-portal-id.d.ts +1 -1
  127. package/dist/components/admin/layout/title-portal-id.js +1 -9
  128. package/dist/components/admin/layout/top-toolbar.vue_vue_type_script_setup_true_lang.js +4 -1
  129. package/dist/components/admin/list/approval-queue-row.vue.d.ts +2 -2
  130. package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js +2 -2
  131. package/dist/components/admin/list/approval-queue.vue.d.ts +3 -3
  132. package/dist/components/admin/list/calendar-agenda-view.vue.d.ts +23 -15
  133. package/dist/components/admin/list/calendar-event.vue.d.ts +21 -8
  134. package/dist/components/admin/list/calendar-list.vue.d.ts +29 -56
  135. package/dist/components/admin/list/calendar-list.vue_vue_type_script_setup_true_lang.js +12 -8
  136. package/dist/components/admin/list/calendar-month-view.vue.d.ts +26 -20
  137. package/dist/components/admin/list/calendar-month-view.vue_vue_type_script_setup_true_lang.js +2 -6
  138. package/dist/components/admin/list/calendar-week-view.vue.d.ts +24 -17
  139. package/dist/components/admin/list/data-table-col.vue_vue_type_script_setup_true_lang.js +8 -5
  140. package/dist/components/admin/list/data-table-context.d.ts +9 -6
  141. package/dist/components/admin/list/data-table-context.js +9 -1
  142. package/dist/components/admin/list/data-table-row.vue.d.ts +19 -15
  143. package/dist/components/admin/list/data-table-row.vue_vue_type_script_setup_true_lang.js +5 -9
  144. package/dist/components/admin/list/data-table.vue.d.ts +35 -23
  145. package/dist/components/admin/list/data-table.vue_vue_type_script_setup_true_lang.js +4 -7
  146. package/dist/components/admin/list/list-pagination.vue_vue_type_script_setup_true_lang.js +2 -2
  147. package/dist/components/admin/list/pivot-grid.vue.d.ts +3 -3
  148. package/dist/components/admin/list/record-timeline.vue.d.ts +3 -3
  149. package/dist/components/admin/list/record-timeline.vue_vue_type_script_setup_true_lang.js +1 -1
  150. package/dist/components/admin/list/simple-list-item.vue.d.ts +21 -19
  151. package/dist/components/admin/list/simple-list-item.vue_vue_type_script_setup_true_lang.js +3 -7
  152. package/dist/components/admin/list/simple-list.vue.d.ts +28 -20
  153. package/dist/components/admin/list/single-field-list-record.vue.d.ts +19 -9
  154. package/dist/components/admin/list/single-field-list.vue.d.ts +21 -11
  155. package/dist/components/admin/list/tree-list-context.d.ts +11 -6
  156. package/dist/components/admin/list/tree-list-node.vue.d.ts +19 -4
  157. package/dist/components/admin/list/tree-list.vue.d.ts +28 -37
  158. package/dist/components/admin/realtime/comments-thread.vue_vue_type_script_setup_true_lang.js +56 -44
  159. package/dist/components/admin/realtime/menu-live.vue.d.ts +3 -1
  160. package/dist/components/admin/realtime/menu-live.vue_vue_type_script_setup_true_lang.js +42 -12
  161. package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
  162. package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
  163. package/dist/components/admin/supabase/use-password-recovery.js +11 -1
  164. package/dist/components/admin/view/create.vue_vue_type_script_setup_true_lang.js +1 -1
  165. package/dist/components/admin/view/edit.vue_vue_type_script_setup_true_lang.js +1 -1
  166. package/dist/components/admin/view/show.vue_vue_type_script_setup_true_lang.js +1 -1
  167. package/dist/components/admin/widgets/job-monitor-row.vue.d.ts +24 -11
  168. package/dist/components/admin/widgets/job-monitor.vue.d.ts +3 -3
  169. package/dist/components/admin/widgets/job-monitor.vue_vue_type_script_setup_true_lang.js +2 -2
  170. package/dist/components/block-editor/block-doc-field.vue.d.ts +3 -3
  171. package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js +3 -4
  172. package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js +2 -3
  173. package/dist/components/charts/bar-chart.vue.d.ts +6 -2
  174. package/dist/components/charts/bar-chart.vue_vue_type_script_setup_true_lang.js +6 -4
  175. package/dist/components/charts/series-chart.d.ts +1 -1
  176. package/dist/components/charts/series-chart.js +9 -3
  177. package/dist/components/index.js +2 -2
  178. package/dist/components/inspector/configurable.vue.d.ts +0 -21
  179. package/dist/components/inspector/configurable.vue_vue_type_script_setup_true_lang.js +2 -2
  180. package/dist/components/inspector/inspector.vue_vue_type_script_setup_true_lang.js +6 -8
  181. package/dist/components/kanban/kanban-board.vue.d.ts +3 -3
  182. package/dist/components/kanban/kanban-board.vue_vue_type_script_setup_true_lang.js +7 -2
  183. package/dist/components/maps/bbox-field.vue_vue_type_script_setup_true_lang.js +4 -4
  184. package/dist/components/maps/geo-json-field.vue_vue_type_script_setup_true_lang.js +4 -4
  185. package/dist/components/maps/geo-json-layers.vue_vue_type_script_setup_true_lang.js +3 -3
  186. package/dist/components/maps/geo-json-view.vue_vue_type_script_setup_true_lang.js +3 -2
  187. package/dist/components/maps/lat-lng-field.vue_vue_type_script_setup_true_lang.js +4 -3
  188. package/dist/components/maps/lat-lng-input.vue_vue_type_script_setup_true_lang.js +5 -7
  189. package/dist/components/maps/map-canvas.vue_vue_type_script_setup_true_lang.js +3 -3
  190. package/dist/components/maps/use-map.js +1 -3
  191. package/dist/components/maps-draw/shape-input.vue_vue_type_script_setup_true_lang.js +5 -5
  192. package/dist/components/maps-draw/simplify-input.vue_vue_type_script_setup_true_lang.js +2 -2
  193. package/dist/components/maps-osm/geocoding-input.vue_vue_type_script_setup_true_lang.js +2 -1
  194. package/dist/components/maps-osm/map-with-search.vue_vue_type_script_setup_true_lang.js +2 -2
  195. package/dist/components/mdx-editor/mdx-editor-theme.css +47 -0
  196. package/dist/components/mdx-editor/mdx-field.vue.d.ts +21 -11
  197. package/dist/components/mdx-editor/mdx-input.vue_vue_type_script_setup_true_lang.js +4 -1
  198. package/dist/components/monaco/internal/use-json-schema.js +1 -2
  199. package/dist/components/monaco/internal/use-monaco-markers.d.ts +0 -6
  200. package/dist/components/monaco/internal/use-monaco-markers.js +4 -2
  201. package/dist/components/monaco/monaco-json-field-lazy.vue.d.ts +2 -2
  202. package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js +3 -2
  203. package/dist/components/monaco/monaco-json-field.vue.d.ts +3 -3
  204. package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js +4 -4
  205. package/dist/components/rich-text-input/rich-text-field.vue.d.ts +3 -3
  206. package/dist/components/ui/avatar.js +1 -1
  207. package/dist/components/ui/badge.js +4 -4
  208. package/dist/components/ui/button-variants.js +1 -1
  209. package/dist/components/ui/chart/chart-container.vue_vue_type_script_setup_true_lang.js +1 -1
  210. package/dist/components/ui/checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  211. package/dist/components/ui/command/command-dialog.vue_vue_type_script_setup_true_lang.js +1 -1
  212. package/dist/components/ui/sidebar/sidebar-menu-button.vue_vue_type_script_setup_true_lang.js +1 -1
  213. package/dist/components/ui/sidebar/sidebar-parts.js +2 -2
  214. package/dist/components/ui/sidebar/sidebar.vue_vue_type_script_setup_true_lang.js +2 -2
  215. package/dist/controllers/use-controller-for-id.d.ts +2 -2
  216. package/dist/controllers/use-prev-next-controller.d.ts +2 -2
  217. package/dist/controllers/use-reference-many-field-controller.d.ts +4 -4
  218. package/dist/controllers/use-reference-one-field-controller.d.ts +4 -4
  219. package/dist/create-resource-components.d.ts +225 -117
  220. package/dist/data/undoable.js +2 -2
  221. package/dist/form/use-form.d.ts +5 -3
  222. package/dist/form/use-form.js +1 -1
  223. package/dist/form/use-input.d.ts +0 -2
  224. package/dist/form/use-input.js +1 -2
  225. package/dist/index.js +2 -2
  226. package/dist/resource-context.d.ts +5 -1
  227. package/dist/resource-context.js +4 -0
  228. package/dist/router/use-get-path-for-record.d.ts +3 -3
  229. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  import { type VNode } from "vue";
2
- import type { LooseRecord, PivotAggregator, SourceProp } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord, PivotAggregator, SourceProp } from "@chelone/core";
3
3
  /** Props for {@link PivotGrid}. */
4
- export interface PivotGridProps<TRecord extends LooseRecord = LooseRecord> {
4
+ export interface PivotGridProps<TRecord extends ResourceRecord = LooseRecord> {
5
5
  /** The field whose values become the rows; a dotted path reads a nested value. */
6
6
  rowSource: SourceProp<TRecord>;
7
7
  /** The field whose values become the columns. */
@@ -16,7 +16,7 @@ export interface PivotGridProps<TRecord extends LooseRecord = LooseRecord> {
16
16
  }
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
19
- declare const __VLS_export: <TRecord extends LooseRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
19
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
20
  props: import("vue").PublicProps & __VLS_PrettifyLocal<PivotGridProps<TRecord>> & (typeof globalThis extends {
21
21
  __VLS_PROPS_FALLBACK: infer P;
22
22
  } ? P : {});
@@ -1,8 +1,8 @@
1
1
  import { type VNode } from "vue";
2
- import type { LooseRecord, SourceProp } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
3
3
  import type { Component } from "vue";
4
4
  /** Props for {@link RecordTimeline}. */
5
- export interface RecordTimelineProps<TRecord extends LooseRecord = LooseRecord> {
5
+ export interface RecordTimelineProps<TRecord extends ResourceRecord = LooseRecord> {
6
6
  /** The field printed as the entry's text; a dotted path reads a nested value. */
7
7
  messageSource: SourceProp<TRecord>;
8
8
  /** The field holding the entry's date. An invalid or missing date leaves the time out. */
@@ -17,7 +17,7 @@ export interface RecordTimelineProps<TRecord extends LooseRecord = LooseRecord>
17
17
  }
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
20
- declare const __VLS_export: <TRecord extends LooseRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
21
21
  props: import("vue").PublicProps & __VLS_PrettifyLocal<RecordTimelineProps<TRecord>> & (typeof globalThis extends {
22
22
  __VLS_PROPS_FALLBACK: infer P;
23
23
  } ? P : {});
@@ -50,9 +50,9 @@ var record_timeline_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
50
50
  * </ReferenceManyField>
51
51
  */
52
52
  const props = __props;
53
- const list = useListContext();
54
53
  const translate = useTranslate();
55
54
  const locale = useLocale();
55
+ const list = useListContext();
56
56
  const timeline = computed(() => {
57
57
  const now = /* @__PURE__ */ new Date();
58
58
  return toTimelineEntries(list.data ?? [], {
@@ -1,13 +1,7 @@
1
- /**
2
- * `<SimpleListItem>` — one `<li>` of a `<SimpleList>`: the row content, linked
3
- * to the record's edit or show page. The Vue analog of `@chelone/react`'s
4
- * `list/simple-list-item.tsx`. Provides the record to its content (so slotted
5
- * fields resolve it via `RecordContext`) and renders nothing without one.
6
- */
7
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, ResourceRecord } from "@chelone/core";
8
2
  /** Props for {@link SimpleListItem}. */
9
- export interface SimpleListItemProps {
10
- record?: LooseRecord;
3
+ export interface SimpleListItemProps<TRecord extends ResourceRecord = LooseRecord> {
4
+ record?: TRecord;
11
5
  /** Override the ambient `<Resource>`. Without one the row is not linked. */
12
6
  resource?: string;
13
7
  /**
@@ -20,15 +14,23 @@ export interface SimpleListItemProps {
20
14
  }
21
15
  declare const _default: typeof __VLS_export;
22
16
  export default _default;
23
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SimpleListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SimpleListItemProps> & Readonly<{}>, {
24
- linkType: false | "edit" | "show";
25
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
26
- default?: (props: {}) => any;
27
- } & {
28
- default?: (props: {}) => any;
29
- }>;
30
- type __VLS_WithSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
17
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
18
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SimpleListItemProps<TRecord>> & (typeof globalThis extends {
19
+ __VLS_PROPS_FALLBACK: infer P;
20
+ } ? P : {});
21
+ expose: (exposed: {}) => void;
22
+ attrs: any;
23
+ slots: {
24
+ default?: (props: {}) => any;
25
+ } & {
26
+ default?: (props: {}) => any;
33
27
  };
28
+ emit: {};
29
+ }>) => import("vue").VNode & {
30
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
34
31
  };
32
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
33
+ [K in keyof T]: T[K];
34
+ } : {
35
+ [K in keyof T as K]: T[K];
36
+ }) & {};
@@ -1,9 +1,9 @@
1
1
  import { useResourceDefinition } from "../../../admin/resource-registry.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
- import { RecordContextKey } from "../../../record/record-context.js";
3
+ import { provideRecordContext } from "../../../record/record-context.js";
4
4
  import { useResourceContext } from "../../../resource-context.js";
5
5
  import { useCreatePath } from "../../../router/nav-composables.js";
6
- import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, provide, ref, renderSlot, unref, watch, withCtx } from "vue";
6
+ import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, toRef, unref, withCtx } from "vue";
7
7
  import { RouterLink } from "vue-router";
8
8
  // src/components/admin/list/simple-list-item.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = ["data-row-index"];
@@ -27,11 +27,7 @@ var simple_list_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
27
27
  * fields resolve it via `RecordContext`) and renders nothing without one.
28
28
  */
29
29
  const props = __props;
30
- const recordRef = ref(props.record);
31
- watch(() => props.record, (next) => {
32
- recordRef.value = next;
33
- });
34
- provide(RecordContextKey, recordRef);
30
+ provideRecordContext(toRef(props, "record"));
35
31
  const resource = useResourceContext(props);
36
32
  const createPath = useCreatePath();
37
33
  const definition = useResourceDefinition(() => ({ resource }));
@@ -1,5 +1,5 @@
1
1
  import type { VNode } from "vue";
2
- import type { Identifier, LooseRecord } from "@chelone/core";
2
+ import type { Identifier, LooseRecord, ResourceRecord } from "@chelone/core";
3
3
  /** Props for {@link SimpleList}. */
4
4
  export interface SimpleListProps {
5
5
  /** Where each row links to; see `SimpleListItem`. */
@@ -7,28 +7,36 @@ export interface SimpleListProps {
7
7
  class?: string;
8
8
  }
9
9
  /** What each row slot of a `<SimpleList>` is given. */
10
- export interface SimpleListSlotProps {
11
- record: LooseRecord;
10
+ export interface SimpleListSlotProps<TRecord extends ResourceRecord = LooseRecord> {
11
+ record: TRecord;
12
12
  id: Identifier;
13
13
  }
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
16
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SimpleListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SimpleListProps> & Readonly<{}>, {
17
- linkType: false | "edit" | "show";
18
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
19
- "primary-text"?(props: SimpleListSlotProps): VNode[];
20
- "secondary-text"?(props: SimpleListSlotProps): VNode[];
21
- "tertiary-text"?(props: SimpleListSlotProps): VNode[];
22
- "left-avatar"?(props: SimpleListSlotProps): VNode[];
23
- "left-icon"?(props: SimpleListSlotProps): VNode[];
24
- "right-icon"?(props: SimpleListSlotProps): VNode[];
25
- /** Rendered while the list is pending, in place of `SimpleListLoading`. */
26
- loading?(): VNode[];
27
- /** Rendered with no records, in place of `ListNoResults`. */
28
- empty?(): VNode[];
29
- }>;
30
- type __VLS_WithSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
16
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
17
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SimpleListProps> & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {
23
+ "primary-text"?(props: SimpleListSlotProps<TRecord>): VNode[];
24
+ "secondary-text"?(props: SimpleListSlotProps<TRecord>): VNode[];
25
+ "tertiary-text"?(props: SimpleListSlotProps<TRecord>): VNode[];
26
+ "left-avatar"?(props: SimpleListSlotProps<TRecord>): VNode[];
27
+ "left-icon"?(props: SimpleListSlotProps<TRecord>): VNode[];
28
+ "right-icon"?(props: SimpleListSlotProps<TRecord>): VNode[];
29
+ /** Rendered while the list is pending, in place of `SimpleListLoading`. */
30
+ loading?(): VNode[];
31
+ /** Rendered with no records, in place of `ListNoResults`. */
32
+ empty?(): VNode[];
33
33
  };
34
+ emit: {};
35
+ }>) => import("vue").VNode & {
36
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
34
37
  };
38
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
39
+ [K in keyof T]: T[K];
40
+ } : {
41
+ [K in keyof T as K]: T[K];
42
+ }) & {};
@@ -1,15 +1,25 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, ResourceRecord } from "@chelone/core";
2
2
  /** Props for {@link SingleFieldListRecord}. */
3
- export interface SingleFieldListRecordProps {
4
- record: LooseRecord;
3
+ export interface SingleFieldListRecordProps<TRecord extends ResourceRecord = LooseRecord> {
4
+ record: TRecord;
5
5
  }
6
6
  declare const _default: typeof __VLS_export;
7
7
  export default _default;
8
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SingleFieldListRecordProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SingleFieldListRecordProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
9
- default?: (props: {}) => any;
10
- }>;
11
- type __VLS_WithSlots<T, S> = T & {
12
- new (): {
13
- $slots: S;
8
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
9
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SingleFieldListRecordProps<TRecord>> & (typeof globalThis extends {
10
+ __VLS_PROPS_FALLBACK: infer P;
11
+ } ? P : {});
12
+ expose: (exposed: {}) => void;
13
+ attrs: any;
14
+ slots: {
15
+ default?: (props: {}) => any;
14
16
  };
17
+ emit: {};
18
+ }>) => import("vue").VNode & {
19
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
15
20
  };
21
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
22
+ [K in keyof T]: T[K];
23
+ } : {
24
+ [K in keyof T as K]: T[K];
25
+ }) & {};
@@ -1,23 +1,33 @@
1
1
  import type { VNode } from "vue";
2
- import type { LooseRecord } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord } from "@chelone/core";
3
3
  /** Props for {@link SingleFieldList}. */
4
4
  export interface SingleFieldListProps {
5
5
  class?: string;
6
6
  }
7
7
  /** What the `item` slot of a `<SingleFieldList>` is given. */
8
- export interface SingleFieldListItemSlotProps {
9
- record: LooseRecord;
8
+ export interface SingleFieldListItemSlotProps<TRecord extends ResourceRecord = LooseRecord> {
9
+ record: TRecord;
10
10
  index: number;
11
11
  }
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
14
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SingleFieldListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SingleFieldListProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
15
- default?(): VNode[];
16
- /** Renders each record; wins over the default slot. */
17
- item?(props: SingleFieldListItemSlotProps): VNode[];
18
- }>;
19
- type __VLS_WithSlots<T, S> = T & {
20
- new (): {
21
- $slots: S;
14
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
15
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SingleFieldListProps> & (typeof globalThis extends {
16
+ __VLS_PROPS_FALLBACK: infer P;
17
+ } ? P : {});
18
+ expose: (exposed: {}) => void;
19
+ attrs: any;
20
+ slots: {
21
+ default?(): VNode[];
22
+ /** Renders each record; wins over the default slot. */
23
+ item?(props: SingleFieldListItemSlotProps<TRecord>): VNode[];
22
24
  };
25
+ emit: {};
26
+ }>) => import("vue").VNode & {
27
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
23
28
  };
29
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
30
+ [K in keyof T]: T[K];
31
+ } : {
32
+ [K in keyof T as K]: T[K];
33
+ }) & {};
@@ -2,20 +2,25 @@
2
2
  * What `<TreeList>` hands every `<TreeListNode>` below it. The tree owns the
3
3
  * expanded map, the focus stop and the select/navigate rule, so a node renders
4
4
  * from one record and its depth.
5
+ *
6
+ * The record parameters are erased to `ResourceRecord`: an injection key names
7
+ * one type, and `<TreeList>` and its nodes are generic over their record. Every
8
+ * record the tree holds satisfies `ResourceRecord`, which is all the context
9
+ * reads (`id` for the link and the expanded map).
5
10
  */
6
- import type { Identifier, LooseRecord } from "@chelone/core";
11
+ import type { Identifier, ResourceRecord } from "@chelone/core";
7
12
  import type { Component, InjectionKey } from "vue";
8
13
  export interface TreeListContext {
9
14
  isExpanded(id: Identifier): boolean;
10
15
  toggle(id: Identifier): void;
11
16
  /** Runs the `select` listener, or navigates when there is none. */
12
- select(record: LooseRecord): void;
17
+ select(record: ResourceRecord): void;
13
18
  /** Where a row links to; `undefined` when it does not link. */
14
- hrefFor(record: LooseRecord): string | undefined;
19
+ hrefFor(record: ResourceRecord): string | undefined;
15
20
  /** Whether a row can be activated at all. */
16
- isSelectable(record: LooseRecord): boolean;
17
- titleFor(record: LooseRecord): string;
18
- iconFor(record: LooseRecord): Component | undefined;
21
+ isSelectable(record: ResourceRecord): boolean;
22
+ titleFor(record: ResourceRecord): string;
23
+ iconFor(record: ResourceRecord): Component | undefined;
19
24
  /** The one treeitem in the tab order. */
20
25
  isTabStop(id: Identifier): boolean;
21
26
  setFocused(id: Identifier): void;
@@ -1,10 +1,25 @@
1
- import type { LooseRecord, RecordTreeNode } from "@chelone/core";
1
+ import type { LooseRecord, RecordTreeNode, ResourceRecord } from "@chelone/core";
2
2
  /** Props for {@link TreeListNode}. */
3
- export interface TreeListNodeProps {
4
- node: RecordTreeNode<LooseRecord>;
3
+ export interface TreeListNodeProps<TRecord extends ResourceRecord = LooseRecord> {
4
+ node: RecordTreeNode<TRecord>;
5
5
  /** Depth from 1 at the roots; becomes `aria-level`. */
6
6
  level: number;
7
7
  }
8
8
  declare const _default: typeof __VLS_export;
9
9
  export default _default;
10
- declare const __VLS_export: import("vue").DefineComponent<TreeListNodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TreeListNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
11
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<TreeListNodeProps<TRecord>> & (typeof globalThis extends {
12
+ __VLS_PROPS_FALLBACK: infer P;
13
+ } ? P : {});
14
+ expose: (exposed: {}) => void;
15
+ attrs: any;
16
+ slots: {};
17
+ emit: {};
18
+ }>) => import("vue").VNode & {
19
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
+ };
21
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
22
+ [K in keyof T]: T[K];
23
+ } : {
24
+ [K in keyof T as K]: T[K];
25
+ }) & {};
@@ -1,25 +1,8 @@
1
- /**
2
- * `<TreeList>` — the records of the ambient `<List>` as a collapsible tree,
3
- * nested by a parent field. The Vue analog of `@chelone/react`'s
4
- * `list/tree-list.tsx`. A record whose parent is missing from the list (it may
5
- * be on another page) is a root, and a parent cycle still lists every record.
6
- *
7
- * Emits `select` with the record when a row is activated. With no `select`
8
- * listener attached, the row navigates to the record's edit or show page
9
- * instead (React's `onSelect` fallback). The `loading` and `empty` slots
10
- * replace `SimpleListLoading` and `ListNoResults`.
11
- *
12
- * @example
13
- * <List>
14
- * <TreeList parent-source="parent_id" title-source="name" />
15
- * </List>
16
- */
17
- import { type LooseRecord } from "@chelone/core";
18
1
  import { type VNode } from "vue";
19
- import type { SourceProp } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
20
3
  import type { Component } from "vue";
21
4
  /** Props for {@link TreeList}. */
22
- export interface TreeListProps {
5
+ export interface TreeListProps<TRecord extends ResourceRecord = LooseRecord> {
23
6
  /** The field holding the parent's id; a dot or bracket path reads a nested value. */
24
7
  parentSource: SourceProp;
25
8
  /** The string field shown as the row title; the record representation otherwise. */
@@ -37,25 +20,33 @@ export interface TreeListProps {
37
20
  linkType?: "edit" | "show" | false;
38
21
  class?: string;
39
22
  }
23
+ /** What `<TreeList>` emits. */
24
+ export interface TreeListEmits<TRecord extends ResourceRecord = LooseRecord> {
25
+ /** A row was activated. A `select` listener replaces the row's navigation. */
26
+ select: [record: TRecord];
27
+ }
40
28
  declare const _default: typeof __VLS_export;
41
29
  export default _default;
42
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TreeListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
- select: (record: LooseRecord) => any;
44
- }, string, import("vue").PublicProps, Readonly<TreeListProps> & Readonly<{
45
- onSelect?: ((record: LooseRecord) => any) | undefined;
46
- }>, {
47
- linkType: false | "edit" | "show";
48
- titleSource: string;
49
- iconSource: string;
50
- iconMap: Record<string, Component>;
51
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
52
- /** Rendered while the list is pending, in place of `SimpleListLoading`. */
53
- loading?(): VNode[];
54
- /** Rendered with no records, in place of `ListNoResults`. */
55
- empty?(): VNode[];
56
- }>;
57
- type __VLS_WithSlots<T, S> = T & {
58
- new (): {
59
- $slots: S;
30
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
31
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<TreeListProps<TRecord> & {
32
+ onSelect?: ((record: TRecord) => any) | undefined;
33
+ }> & (typeof globalThis extends {
34
+ __VLS_PROPS_FALLBACK: infer P;
35
+ } ? P : {});
36
+ expose: (exposed: {}) => void;
37
+ attrs: any;
38
+ slots: {
39
+ /** Rendered while the list is pending, in place of `SimpleListLoading`. */
40
+ loading?(): VNode[];
41
+ /** Rendered with no records, in place of `ListNoResults`. */
42
+ empty?(): VNode[];
60
43
  };
44
+ emit: (evt: "select", record: TRecord) => void;
45
+ }>) => import("vue").VNode & {
46
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
61
47
  };
48
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
49
+ [K in keyof T]: T[K];
50
+ } : {
51
+ [K in keyof T as K]: T[K];
52
+ }) & {};
@@ -2,10 +2,11 @@ import { useOptionalIdentity } from "../../../auth/auth-hooks.js";
2
2
  import { useCheloneContext, useCheloneNotifications } from "../../../context.js";
3
3
  import { useGetList } from "../../../data/queries.js";
4
4
  import { useTranslate } from "../../../i18n/use-translate.js";
5
+ import { cn } from "../../../lib/utils.js";
5
6
  import { RecordContextKey } from "../../../record/record-context.js";
6
7
  import { Badge } from "../../ui/badge.js";
7
8
  import button_default from "../../ui/button.js";
8
- import { Card, CardContent } from "../../ui/card.js";
9
+ import { Card } from "../../ui/card.js";
9
10
  import textarea_default from "../../ui/textarea.js";
10
11
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, watch, watchEffect, withCtx } from "vue";
11
12
  import { createMutationOptions, isRealtimeDataProvider, subscribeLiveResource, updateMutationOptions } from "@chelone/core";
@@ -13,21 +14,30 @@ import { useMutation } from "@tanstack/vue-query";
13
14
  // src/components/admin/realtime/comments-thread.vue?vue&type=script&setup=true&lang.ts
14
15
  var _hoisted_1 = {
15
16
  key: 0,
16
- "data-slot": "comments-error"
17
+ "data-slot": "comments-error",
18
+ class: "text-sm text-destructive"
17
19
  };
18
20
  var _hoisted_2 = {
19
21
  key: 1,
20
- "data-slot": "comments-empty"
22
+ "data-slot": "comments-empty",
23
+ class: "rounded-xl border bg-card p-4 text-sm text-muted-foreground shadow"
21
24
  };
22
- var _hoisted_3 = ["datetime"];
23
- var _hoisted_4 = {
25
+ var _hoisted_3 = { class: "flex items-baseline gap-2 text-sm" };
26
+ var _hoisted_4 = { class: "font-medium" };
27
+ var _hoisted_5 = ["datetime"];
28
+ var _hoisted_6 = { class: "whitespace-pre-wrap text-sm" };
29
+ var _hoisted_7 = {
24
30
  key: 2,
25
- "data-slot": "comments-total"
31
+ "data-slot": "comments-total",
32
+ class: "text-xs text-muted-foreground"
33
+ };
34
+ var _hoisted_8 = {
35
+ "data-slot": "comments-form",
36
+ class: "space-y-2"
26
37
  };
27
- var _hoisted_5 = { "data-slot": "comments-form" };
28
38
  /** A row is a comment when it has a string `body`; any other row is skipped. */
29
39
  function isCommentRecord(record) {
30
- return typeof record.body === "string";
40
+ return "body" in record && typeof record.body === "string";
31
41
  }
32
42
  var comments_thread_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
33
43
  __name: "comments-thread",
@@ -134,9 +144,9 @@ var comments_thread_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
134
144
  messageArgs: { smart_count: 1 }
135
145
  });
136
146
  }
137
- function timeOf(comment) {
138
- if (!comment.createdAt) return void 0;
139
- const date = new Date(comment.createdAt);
147
+ function timeOf(iso) {
148
+ if (!iso) return void 0;
149
+ const date = new Date(iso);
140
150
  if (Number.isNaN(date.getTime())) return void 0;
141
151
  return {
142
152
  iso: date.toISOString(),
@@ -147,53 +157,55 @@ var comments_thread_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
147
157
  return recordId.value !== void 0 ? (openBlock(), createElementBlock("section", {
148
158
  key: 0,
149
159
  "data-slot": "comments-thread",
150
- class: normalizeClass(props.class)
160
+ class: normalizeClass(unref(cn)("space-y-3", props.class))
151
161
  }, [
152
- unref(isError) ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(unref(translate)("chelone.comments.load_failed", { _: "Could not load the comments" })), 1)) : unref(isSuccess) && items.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(unref(translate)("chelone.comments.empty", { _: "No comments yet" })), 1)) : createCommentVNode("", true),
162
+ unref(isError) ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(unref(translate)("chelone.comments.load_failed", { _: "Could not load the comments" })), 1)) : unref(isSuccess) && items.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(unref(translate)("chelone.comments.empty", { _: "No comments yet. Be the first." })), 1)) : createCommentVNode("", true),
153
163
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (comment) => {
154
164
  return openBlock(), createBlock(unref(Card), {
155
165
  key: comment.id,
156
166
  "data-slot": "comment",
157
- "data-comment-id": comment.id
167
+ "data-comment-id": comment.id,
168
+ class: normalizeClass(unref(cn)("flex flex-col items-start gap-2 p-4", comment.resolvedAt && "opacity-60"))
158
169
  }, {
159
- default: withCtx(() => [createVNode(unref(CardContent), null, {
160
- default: withCtx(() => [
161
- createElementVNode("div", null, [createElementVNode("strong", null, toDisplayString(authorOf(comment)), 1), timeOf(comment) ? (openBlock(), createElementBlock("time", {
162
- key: 0,
163
- datetime: timeOf(comment)?.iso
164
- }, toDisplayString(timeOf(comment)?.label), 9, _hoisted_3)) : createCommentVNode("", true)]),
165
- createElementVNode("p", null, toDisplayString(comment.body), 1),
166
- comment.resolvedAt ? (openBlock(), createBlock(unref(Badge), {
167
- key: 0,
168
- variant: "secondary"
169
- }, {
170
- default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("chelone.comments.resolved", { _: "Resolved" })), 1)]),
171
- _: 1
172
- })) : props.resolvable ? (openBlock(), createBlock(button_default, {
173
- key: 1,
174
- variant: "outline",
175
- size: "sm",
176
- disabled: unref(update).isPending.value,
177
- onClick: ($event) => resolve(comment)
178
- }, {
179
- default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("chelone.comments.mark_resolved", { _: "Mark resolved" })), 1)]),
180
- _: 1
181
- }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
182
- ]),
183
- _: 2
184
- }, 1024)]),
170
+ default: withCtx(() => [
171
+ createElementVNode("div", _hoisted_3, [createElementVNode("strong", _hoisted_4, toDisplayString(authorOf(comment)), 1), timeOf(comment.createdAt) ? (openBlock(), createElementBlock("time", {
172
+ key: 0,
173
+ datetime: timeOf(comment.createdAt)?.iso,
174
+ class: "text-xs text-muted-foreground"
175
+ }, toDisplayString(timeOf(comment.createdAt)?.label), 9, _hoisted_5)) : createCommentVNode("", true)]),
176
+ createElementVNode("p", _hoisted_6, toDisplayString(comment.body), 1),
177
+ comment.resolvedAt ? (openBlock(), createBlock(unref(Badge), {
178
+ key: 0,
179
+ variant: "secondary"
180
+ }, {
181
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("chelone.comments.resolved", {
182
+ _: "Resolved {time}",
183
+ time: timeOf(comment.resolvedAt)?.label ?? ""
184
+ })), 1)]),
185
+ _: 2
186
+ }, 1024)) : props.resolvable ? (openBlock(), createBlock(button_default, {
187
+ key: 1,
188
+ variant: "outline",
189
+ size: "sm",
190
+ disabled: unref(update).isPending.value,
191
+ onClick: ($event) => resolve(comment)
192
+ }, {
193
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("chelone.comments.mark_resolved", { _: "Mark resolved" })), 1)]),
194
+ _: 1
195
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
196
+ ]),
185
197
  _: 2
186
- }, 1032, ["data-comment-id"]);
198
+ }, 1032, ["data-comment-id", "class"]);
187
199
  }), 128)),
188
- total.value > items.value.length ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(unref(translate)("chelone.comments.showing", {
200
+ total.value > items.value.length ? (openBlock(), createElementBlock("p", _hoisted_7, toDisplayString(unref(translate)("chelone.comments.showing", {
189
201
  shown: items.value.length,
190
202
  total: total.value,
191
203
  _: "Showing the first {shown} of {total} comments"
192
204
  })), 1)) : createCommentVNode("", true),
193
- createElementVNode("div", _hoisted_5, [createVNode(textarea_default, {
205
+ createElementVNode("div", _hoisted_8, [createVNode(textarea_default, {
194
206
  modelValue: draft.value,
195
207
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draft.value = $event),
196
- placeholder: unref(translate)("chelone.comments.placeholder", { _: "Write a comment" }),
208
+ placeholder: unref(translate)("chelone.comments.placeholder", { _: "Write a comment…" }),
197
209
  onKeydown
198
210
  }, null, 8, ["modelValue", "placeholder"]), createVNode(button_default, {
199
211
  disabled: !canPost.value,
@@ -22,7 +22,9 @@ export interface MenuLiveProps {
22
22
  /**
23
23
  * A menu link with a badge counting the resource's new records. The count
24
24
  * lives in the store, so it survives a remount; it clears while the link's
25
- * route is active. Divergence from the React twin: the render props are slots.
25
+ * route is active. Inside a `<SidebarProvider>` it is a sidebar menu button,
26
+ * with the label as a `title` while the desktop rail is collapsed; elsewhere it is
27
+ * a plain link. Divergence from the React twin: the render props are slots.
26
28
  * Declared as a render component so the file can also hold {@link MenuLive}.
27
29
  */
28
30
  export declare const MenuLiveItemLink: import("vue").DefineComponent<import("vue").ExtractPropTypes<{