@btst/stack 2.5.6 → 2.6.1

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 (216) hide show
  1. package/README.md +23 -0
  2. package/dist/client/components/index.d.cts +9 -9
  3. package/dist/client/components/index.d.mts +9 -9
  4. package/dist/client/components/index.d.ts +9 -9
  5. package/dist/components/auto-form/index.cjs +8 -0
  6. package/dist/components/auto-form/index.d.cts +26 -0
  7. package/dist/components/auto-form/index.d.mts +26 -0
  8. package/dist/components/auto-form/index.d.ts +26 -0
  9. package/dist/components/auto-form/index.mjs +1 -0
  10. package/dist/components/empty/index.cjs +12 -0
  11. package/dist/components/empty/index.d.cts +15 -0
  12. package/dist/components/empty/index.d.mts +15 -0
  13. package/dist/components/empty/index.d.ts +15 -0
  14. package/dist/components/empty/index.mjs +1 -0
  15. package/dist/components/form-builder/index.cjs +16 -0
  16. package/dist/components/form-builder/index.d.cts +385 -0
  17. package/dist/components/form-builder/index.d.mts +385 -0
  18. package/dist/components/form-builder/index.d.ts +385 -0
  19. package/dist/components/form-builder/index.mjs +4 -0
  20. package/dist/components/markdown/index.cjs +9 -0
  21. package/dist/components/markdown/index.d.cts +30 -0
  22. package/dist/components/markdown/index.d.mts +30 -0
  23. package/dist/components/markdown/index.d.ts +30 -0
  24. package/dist/components/markdown/index.mjs +2 -0
  25. package/dist/components/markdown/style.css +394 -0
  26. package/dist/components/minimal-tiptap/style.css +548 -0
  27. package/dist/components/multi-select/index.cjs +7 -0
  28. package/dist/components/multi-select/index.d.cts +78 -0
  29. package/dist/components/multi-select/index.d.mts +78 -0
  30. package/dist/components/multi-select/index.d.ts +78 -0
  31. package/dist/components/multi-select/index.mjs +1 -0
  32. package/dist/components/search-select/index.cjs +7 -0
  33. package/dist/components/search-select/index.d.cts +15 -0
  34. package/dist/components/search-select/index.d.mts +15 -0
  35. package/dist/components/search-select/index.d.ts +15 -0
  36. package/dist/components/search-select/index.mjs +1 -0
  37. package/dist/components/stepped-auto-form/index.cjs +7 -0
  38. package/dist/components/stepped-auto-form/index.d.cts +37 -0
  39. package/dist/components/stepped-auto-form/index.d.mts +37 -0
  40. package/dist/components/stepped-auto-form/index.d.ts +37 -0
  41. package/dist/components/stepped-auto-form/index.mjs +1 -0
  42. package/dist/components/ui-builder/style.css +552 -0
  43. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
  44. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1 -1
  45. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +2 -2
  46. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1 -1
  47. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +3 -3
  48. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +1 -1
  49. package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +1 -1
  50. package/dist/packages/stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +1 -1
  51. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.cjs +44 -35
  52. package/dist/packages/stack/src/plugins/ai-chat/client/plugin.mjs +44 -35
  53. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.cjs +23 -0
  54. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.mjs +21 -0
  55. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.cjs +11 -12
  56. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.mjs +11 -12
  57. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.cjs +2 -2
  58. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.mjs +2 -2
  59. package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.cjs +1 -1
  60. package/dist/packages/stack/src/plugins/blog/client/components/shared/default-error.mjs +1 -1
  61. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.cjs +0 -3
  62. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.mjs +1 -1
  63. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.cjs +0 -3
  64. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.mjs +1 -1
  65. package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.cjs +22 -0
  66. package/dist/packages/stack/src/plugins/blog/client/hooks/use-debounce.mjs +23 -2
  67. package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +12 -6
  68. package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +12 -6
  69. package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.cjs +1 -1
  70. package/dist/packages/stack/src/plugins/cms/client/components/shared/default-error.mjs +1 -1
  71. package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +38 -26
  72. package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +38 -26
  73. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.cjs +1 -1
  74. package/dist/packages/stack/src/plugins/form-builder/client/components/shared/default-error.mjs +1 -1
  75. package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +32 -20
  76. package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +32 -20
  77. package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.cjs +1 -1
  78. package/dist/packages/stack/src/plugins/kanban/client/components/shared/default-error.mjs +1 -1
  79. package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +6 -3
  80. package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +6 -3
  81. package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.cjs +1 -1
  82. package/dist/packages/stack/src/plugins/ui-builder/client/components/page-renderer.mjs +1 -1
  83. package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.cjs +1 -1
  84. package/dist/packages/stack/src/plugins/ui-builder/client/components/shared/default-error.mjs +1 -1
  85. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +24 -15
  86. package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +24 -15
  87. package/dist/packages/ui/src/components/auto-form/index.cjs +12 -2
  88. package/dist/packages/ui/src/components/auto-form/index.mjs +9 -2
  89. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +2 -2
  90. package/dist/packages/ui/src/components/empty.cjs +28 -0
  91. package/dist/packages/ui/src/components/empty.mjs +27 -1
  92. package/dist/packages/ui/src/components/form-builder/components/index.mjs +2 -2
  93. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +1 -1
  94. package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
  95. package/dist/packages/ui/src/components/form.mjs +1 -1
  96. package/dist/packages/ui/src/components/kanban.mjs +1 -1
  97. package/dist/packages/ui/src/components/multi-select.mjs +2 -2
  98. package/dist/packages/ui/src/components/search-select.cjs +13 -3
  99. package/dist/packages/ui/src/components/search-select.mjs +14 -4
  100. package/dist/packages/ui/src/components/ui-builder/internal/config-panel.cjs +1 -1
  101. package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +1 -1
  102. package/dist/plugins/ai-chat/client/index.d.cts +17 -4
  103. package/dist/plugins/ai-chat/client/index.d.mts +17 -4
  104. package/dist/plugins/ai-chat/client/index.d.ts +17 -4
  105. package/dist/plugins/blog/api/index.d.cts +2 -2
  106. package/dist/plugins/blog/api/index.d.mts +2 -2
  107. package/dist/plugins/blog/api/index.d.ts +2 -2
  108. package/dist/plugins/blog/client/hooks/index.cjs +3 -0
  109. package/dist/plugins/blog/client/hooks/index.d.cts +7 -226
  110. package/dist/plugins/blog/client/hooks/index.d.mts +7 -226
  111. package/dist/plugins/blog/client/hooks/index.d.ts +7 -226
  112. package/dist/plugins/blog/client/hooks/index.mjs +1 -0
  113. package/dist/plugins/blog/client/index.d.cts +46 -22
  114. package/dist/plugins/blog/client/index.d.mts +46 -22
  115. package/dist/plugins/blog/client/index.d.ts +46 -22
  116. package/dist/plugins/blog/query-keys.d.cts +2 -2
  117. package/dist/plugins/blog/query-keys.d.mts +2 -2
  118. package/dist/plugins/blog/query-keys.d.ts +2 -2
  119. package/dist/plugins/cms/client/index.d.cts +36 -15
  120. package/dist/plugins/cms/client/index.d.mts +36 -15
  121. package/dist/plugins/cms/client/index.d.ts +36 -15
  122. package/dist/plugins/form-builder/client/components/index.d.cts +2 -2
  123. package/dist/plugins/form-builder/client/components/index.d.mts +2 -2
  124. package/dist/plugins/form-builder/client/components/index.d.ts +2 -2
  125. package/dist/plugins/form-builder/client/index.d.cts +33 -15
  126. package/dist/plugins/form-builder/client/index.d.mts +33 -15
  127. package/dist/plugins/form-builder/client/index.d.ts +33 -15
  128. package/dist/plugins/kanban/api/index.d.cts +1 -1
  129. package/dist/plugins/kanban/api/index.d.mts +1 -1
  130. package/dist/plugins/kanban/api/index.d.ts +1 -1
  131. package/dist/plugins/kanban/client/components/index.d.cts +5 -5
  132. package/dist/plugins/kanban/client/components/index.d.mts +5 -5
  133. package/dist/plugins/kanban/client/components/index.d.ts +5 -5
  134. package/dist/plugins/kanban/client/index.d.cts +25 -10
  135. package/dist/plugins/kanban/client/index.d.mts +25 -10
  136. package/dist/plugins/kanban/client/index.d.ts +25 -10
  137. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  138. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  139. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  140. package/dist/plugins/route-docs/client/index.d.cts +4 -4
  141. package/dist/plugins/route-docs/client/index.d.mts +4 -4
  142. package/dist/plugins/route-docs/client/index.d.ts +4 -4
  143. package/dist/plugins/ui-builder/client/components/index.d.cts +3 -3
  144. package/dist/plugins/ui-builder/client/components/index.d.mts +3 -3
  145. package/dist/plugins/ui-builder/client/components/index.d.ts +3 -3
  146. package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
  147. package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
  148. package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
  149. package/dist/plugins/ui-builder/client/index.d.cts +32 -18
  150. package/dist/plugins/ui-builder/client/index.d.mts +32 -18
  151. package/dist/plugins/ui-builder/client/index.d.ts +32 -18
  152. package/dist/plugins/ui-builder/index.d.cts +3 -3
  153. package/dist/plugins/ui-builder/index.d.mts +3 -3
  154. package/dist/plugins/ui-builder/index.d.ts +3 -3
  155. package/dist/shared/{stack.B2DwzF3r.d.ts → stack.ASwEoINr.d.ts} +1 -1
  156. package/dist/shared/{stack.C5ZSOJGJ.d.cts → stack.B1srlBud.d.mts} +1 -1
  157. package/dist/shared/stack.B8vT-Yt4.d.mts +228 -0
  158. package/dist/shared/stack.BAT540yW.d.ts +228 -0
  159. package/dist/shared/{stack.D0QupDcQ.d.ts → stack.BK9Z2dcL.d.ts} +1 -1
  160. package/dist/shared/stack.BwA7trxA.d.cts +228 -0
  161. package/dist/shared/{stack.Cl7ok_cY.d.cts → stack.CFECM0ew.d.cts} +1 -1
  162. package/dist/shared/stack.CZMWR72v.d.cts +10 -0
  163. package/dist/shared/stack.CZMWR72v.d.mts +10 -0
  164. package/dist/shared/stack.CZMWR72v.d.ts +10 -0
  165. package/dist/shared/{stack.VMmQdbsJ.d.mts → stack.DVtk5CNw.d.mts} +1 -1
  166. package/dist/shared/{stack.B8_74ror.d.ts → stack.DXnclTG7.d.ts} +4 -4
  167. package/dist/shared/{stack.C21-LFX8.d.cts → stack.DaZM10cp.d.cts} +4 -4
  168. package/dist/shared/{stack.Dq4qVr1F.d.mts → stack.DmpPDPxA.d.cts} +1 -1
  169. package/dist/shared/{stack.CL4mKxe7.d.mts → stack.cfCkioTe.d.mts} +4 -4
  170. package/dist/shared/stack.fdi94T4S.d.cts +291 -0
  171. package/dist/shared/stack.fdi94T4S.d.mts +291 -0
  172. package/dist/shared/stack.fdi94T4S.d.ts +291 -0
  173. package/package.json +115 -4
  174. package/src/__tests__/page-component-overrides.test.tsx +147 -0
  175. package/src/components/auto-form/index.ts +12 -0
  176. package/src/components/empty/index.ts +8 -0
  177. package/src/components/form-builder/index.ts +23 -0
  178. package/src/components/kanban/index.ts +9 -0
  179. package/src/components/markdown/index.ts +5 -0
  180. package/src/components/markdown/style.css +3 -0
  181. package/src/components/minimal-tiptap/index.ts +5 -0
  182. package/src/components/minimal-tiptap/style.css +1 -0
  183. package/src/components/multi-select/index.ts +5 -0
  184. package/src/components/search-select/index.ts +1 -0
  185. package/src/components/stepped-auto-form/index.ts +5 -0
  186. package/src/components/ui-builder/index.ts +50 -0
  187. package/src/components/ui-builder/style.css +5 -0
  188. package/src/plugins/ai-chat/client/components/shared/default-error.tsx +1 -1
  189. package/src/plugins/ai-chat/client/plugin.tsx +60 -32
  190. package/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.tsx +29 -0
  191. package/src/plugins/blog/client/components/forms/markdown-editor.tsx +24 -21
  192. package/src/plugins/blog/client/components/forms/post-forms.tsx +2 -2
  193. package/src/plugins/blog/client/components/shared/default-error.tsx +2 -1
  194. package/src/plugins/blog/client/components/shared/posts-list.tsx +1 -1
  195. package/src/plugins/blog/client/components/shared/search-input.tsx +0 -2
  196. package/src/plugins/blog/client/components/shared/search-modal.tsx +0 -2
  197. package/src/plugins/blog/client/hooks/index.tsx +1 -0
  198. package/src/plugins/blog/client/plugin.tsx +41 -6
  199. package/src/plugins/cms/client/components/shared/default-error.tsx +3 -2
  200. package/src/plugins/cms/client/plugin.tsx +65 -32
  201. package/src/plugins/form-builder/client/components/shared/default-error.tsx +3 -2
  202. package/src/plugins/form-builder/client/plugin.tsx +56 -23
  203. package/src/plugins/kanban/client/components/shared/default-error.tsx +3 -2
  204. package/src/plugins/kanban/client/plugin.tsx +23 -3
  205. package/src/plugins/ui-builder/client/components/page-renderer.tsx +5 -3
  206. package/src/plugins/ui-builder/client/components/shared/default-error.tsx +3 -2
  207. package/src/plugins/ui-builder/client/plugin.tsx +41 -15
  208. package/dist/shared/stack.8nldKomx.d.cts +0 -114
  209. package/dist/shared/stack.8nldKomx.d.mts +0 -114
  210. package/dist/shared/stack.8nldKomx.d.ts +0 -114
  211. package/dist/shared/{stack.CxNeGV2z.d.mts → stack.B8D4r97Z.d.mts} +6 -6
  212. package/dist/shared/{stack.BWp0hcm9.d.cts → stack.BQmuNl5p.d.cts} +3 -3
  213. package/dist/shared/{stack.BWp0hcm9.d.mts → stack.BQmuNl5p.d.mts} +3 -3
  214. package/dist/shared/{stack.BWp0hcm9.d.ts → stack.BQmuNl5p.d.ts} +3 -3
  215. package/dist/shared/{stack.BFcg0tDz.d.ts → stack.DgKOwl20.d.ts} +6 -6
  216. package/dist/shared/{stack.DSxTDZBQ.d.cts → stack.uWSqCWAb.d.cts} +6 -6
@@ -69,8 +69,36 @@ function EmptyTitle({ className, ...props }) {
69
69
  }
70
70
  );
71
71
  }
72
+ function EmptyDescription({ className, ...props }) {
73
+ return /* @__PURE__ */ jsxRuntime.jsx(
74
+ "div",
75
+ {
76
+ "data-slot": "empty-description",
77
+ className: utils.cn(
78
+ "text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
79
+ className
80
+ ),
81
+ ...props
82
+ }
83
+ );
84
+ }
85
+ function EmptyContent({ className, ...props }) {
86
+ return /* @__PURE__ */ jsxRuntime.jsx(
87
+ "div",
88
+ {
89
+ "data-slot": "empty-content",
90
+ className: utils.cn(
91
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
92
+ className
93
+ ),
94
+ ...props
95
+ }
96
+ );
97
+ }
72
98
 
73
99
  exports.Empty = Empty;
100
+ exports.EmptyContent = EmptyContent;
101
+ exports.EmptyDescription = EmptyDescription;
74
102
  exports.EmptyHeader = EmptyHeader;
75
103
  exports.EmptyMedia = EmptyMedia;
76
104
  exports.EmptyTitle = EmptyTitle;
@@ -67,5 +67,31 @@ function EmptyTitle({ className, ...props }) {
67
67
  }
68
68
  );
69
69
  }
70
+ function EmptyDescription({ className, ...props }) {
71
+ return /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ "data-slot": "empty-description",
75
+ className: cn(
76
+ "text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
77
+ className
78
+ ),
79
+ ...props
80
+ }
81
+ );
82
+ }
83
+ function EmptyContent({ className, ...props }) {
84
+ return /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ "data-slot": "empty-content",
88
+ className: cn(
89
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
90
+ className
91
+ ),
92
+ ...props
93
+ }
94
+ );
95
+ }
70
96
 
71
- export { Empty, EmptyHeader, EmptyMedia, EmptyTitle };
97
+ export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
@@ -1,7 +1,7 @@
1
- import { FolderOpen, List, Lock, Globe, Phone, Calendar, AlignLeft, ToggleLeft, Circle, ChevronDown, CheckSquare, Hash, Type, Mail } from 'lucide-react';
1
+ import { FolderOpen, List, Mail, Lock, Globe, Phone, Calendar, AlignLeft, ToggleLeft, Circle, ChevronDown, CheckSquare, Hash, Type } from 'lucide-react';
2
2
  import { z } from 'zod';
3
3
  import { defineComponent } from '../types.mjs';
4
- import { baseMetaSchema, objectValidationSchema, arrayValidationSchema, baseMetaSchemaWithPlaceholder, DEFAULT_VALUE_SCHEMAS, stringValidationSchema, dateValidationSchema, booleanValidationSchema, enumOptionsSchema, numberValidationSchema } from '../validation-schemas.mjs';
4
+ import { baseMetaSchemaWithPlaceholder, stringValidationSchema, DEFAULT_VALUE_SCHEMAS, numberValidationSchema, baseMetaSchema, booleanValidationSchema, enumOptionsSchema, dateValidationSchema, objectValidationSchema, arrayValidationSchema } from '../validation-schemas.mjs';
5
5
 
6
6
  function toNumber(value) {
7
7
  if (value == null || value === "") return void 0;
@@ -110,7 +110,7 @@ function EditFieldDialog({
110
110
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Which step this field belongs to" })
111
111
  ] }),
112
112
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t pt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
113
- index,
113
+ index.default,
114
114
  {
115
115
  formSchema: component.propertiesSchema,
116
116
  values: localProps,
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useId, useState, useCallback, useMemo } from 'react';
4
- import { useSensors, useSensor, KeyboardSensor, TouchSensor, PointerSensor, DndContext, closestCenter, DragOverlay } from '../../../../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs';
5
- import { sortableKeyboardCoordinates, arrayMove } from '../../../../../node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs';
4
+ import { useSensors, useSensor, DndContext, closestCenter, DragOverlay, KeyboardSensor, TouchSensor, PointerSensor } from '../../../../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs';
5
+ import { arrayMove, sortableKeyboardCoordinates } from '../../../../../node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs';
6
6
  import { cn } from '../../lib/utils.mjs';
7
7
  import { Tabs, TabsList, TabsTrigger, TabsContent } from '../tabs.mjs';
8
8
  import { Palette, PaletteDragOverlay } from './palette.mjs';
@@ -2,7 +2,7 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
- import { useFormContext, useFormState, FormProvider, Controller } from 'react-hook-form';
5
+ import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
6
6
  import { cn } from '../lib/utils.mjs';
7
7
  import { Label } from './label.mjs';
8
8
 
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { useSensors, useSensor, closestCenter, pointerWithin, rectIntersection, getFirstCollision, DndContext, MeasuringStrategy, DragOverlay, defaultDropAnimationSideEffects, KeyboardSensor, TouchSensor, MouseSensor, KeyboardCode, closestCorners } from '../../../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs';
3
+ import { useSensors, useSensor, KeyboardSensor, TouchSensor, MouseSensor, closestCenter, pointerWithin, rectIntersection, getFirstCollision, DndContext, MeasuringStrategy, DragOverlay, defaultDropAnimationSideEffects, KeyboardCode, closestCorners } from '../../../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs';
4
4
  import { verticalListSortingStrategy, arrayMove, SortableContext, horizontalListSortingStrategy, useSortable, defaultAnimateLayoutChanges } from '../../../../node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs';
5
5
  import { CSS } from '../../../../node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs';
6
6
  import { Slot } from '@radix-ui/react-slot';
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { Command as Command$1, useCommandState } from 'cmdk';
3
+ import { useCommandState, Command as Command$1 } from 'cmdk';
4
4
  import { X } from 'lucide-react';
5
5
  import * as React from 'react';
6
- import { useMemo, useEffect, useCallback, forwardRef } from 'react';
6
+ import { forwardRef, useMemo, useEffect, useCallback } from 'react';
7
7
  import { Badge } from './badge.mjs';
8
8
  import { CommandItem, Command, CommandList, CommandGroup } from './command.mjs';
9
9
  import { cn } from '../lib/utils.mjs';
@@ -3,6 +3,7 @@
3
3
 
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
+ const index = require('../../../../node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.cjs');
6
7
  const LucideIcons = require('lucide-react');
7
8
  const utils = require('../lib/utils.cjs');
8
9
  const button = require('./button.cjs');
@@ -41,11 +42,20 @@ function SearchSelect({
41
42
  }
42
43
  ) }),
43
44
  /* @__PURE__ */ jsxRuntime.jsx(
44
- popover.PopoverContent,
45
+ index.Content,
45
46
  {
46
- className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
47
47
  align: "start",
48
- usePortal: false,
48
+ sideOffset: 4,
49
+ className: utils.cn(
50
+ "border-input bg-popover text-popover-foreground pointer-events-auto",
51
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
52
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
53
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
54
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
55
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
56
+ "z-50 w-full min-w-[var(--radix-popper-anchor-width)] origin-(--radix-popover-content-transform-origin)",
57
+ "rounded-md border p-0 shadow-md outline-hidden"
58
+ ),
49
59
  children: /* @__PURE__ */ jsxRuntime.jsxs(command.Command, { children: [
50
60
  /* @__PURE__ */ jsxRuntime.jsx(command.CommandInput, { placeholder: "Search options..." }),
51
61
  /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { children: [
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useId, useState } from 'react';
4
+ import { Content as Content2 } from '../../../../node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.mjs';
4
5
  import { ChevronDownIcon, CheckIcon } from 'lucide-react';
5
6
  import { cn } from '../lib/utils.mjs';
6
7
  import { Button } from './button.mjs';
7
8
  import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from './command.mjs';
8
- import { Popover, PopoverTrigger, PopoverContent } from './popover.mjs';
9
+ import { Popover, PopoverTrigger } from './popover.mjs';
9
10
 
10
11
  function SearchSelect({
11
12
  options,
@@ -39,11 +40,20 @@ function SearchSelect({
39
40
  }
40
41
  ) }),
41
42
  /* @__PURE__ */ jsx(
42
- PopoverContent,
43
+ Content2,
43
44
  {
44
- className: "border-input w-full min-w-[var(--radix-popper-anchor-width)] p-0 z-[9999]",
45
45
  align: "start",
46
- usePortal: false,
46
+ sideOffset: 4,
47
+ className: cn(
48
+ "border-input bg-popover text-popover-foreground pointer-events-auto",
49
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
50
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
51
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
52
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
53
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
54
+ "z-50 w-full min-w-[var(--radix-popper-anchor-width)] origin-(--radix-popover-content-transform-origin)",
55
+ "rounded-md border p-0 shadow-md outline-hidden"
56
+ ),
47
57
  children: /* @__PURE__ */ jsxs(Command, { children: [
48
58
  /* @__PURE__ */ jsx(CommandInput, { placeholder: "Search options..." }),
49
59
  /* @__PURE__ */ jsxs(CommandList, { children: [
@@ -88,7 +88,7 @@ const PageLayerForm = ({
88
88
  removeLayer(selectedLayer.id);
89
89
  }, [selectedLayer, removeLayer]);
90
90
  return /* @__PURE__ */ jsxRuntime.jsxs(
91
- index,
91
+ index.default,
92
92
  {
93
93
  formSchema,
94
94
  onValuesChange: handleSetValues,
@@ -221,7 +221,7 @@ const ComponentPropsAutoForm = ({
221
221
  return null;
222
222
  }
223
223
  return /* @__PURE__ */ jsxRuntime.jsxs(
224
- index,
224
+ index.default,
225
225
  {
226
226
  formSchema: autoFormSchema,
227
227
  values: formValues,
@@ -1,6 +1,6 @@
1
1
  import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
- import * as react from 'react';
3
2
  import * as _btst_yar from '@btst/yar';
3
+ import { ComponentType } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { S as SerializedConversation, a as SerializedMessage } from '../../../shared/stack.Be1QIHEn.cjs';
6
6
  import { A as AiChatMode } from '../../../shared/stack.BV9hnvu4.cjs';
@@ -76,6 +76,19 @@ interface AiChatClientConfig {
76
76
  hooks?: AiChatClientHooks;
77
77
  /** Optional headers for SSR (e.g., forwarding cookies) */
78
78
  headers?: Headers;
79
+ /**
80
+ * Optional page component overrides.
81
+ * Replace any plugin page with a custom React component.
82
+ * The built-in component is used as the fallback when not provided.
83
+ */
84
+ pageComponents?: {
85
+ /** Replaces the chat home page */
86
+ chat?: ComponentType;
87
+ /** Replaces the conversation page (authenticated mode only) */
88
+ chatConversation?: ComponentType<{
89
+ conversationId: string;
90
+ }>;
91
+ };
79
92
  }
80
93
  /**
81
94
  * Hooks for AI Chat client plugin
@@ -124,9 +137,9 @@ interface AiChatClientHooks {
124
137
  declare const aiChatClientPlugin: (config: AiChatClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
125
138
  chat: {
126
139
  (inputCtx_0?: _btst_yar.InputContext<"/chat", _btst_yar.RouteOptions> | undefined): {
127
- PageComponent?: react.ComponentType<unknown> | undefined;
128
- LoadingComponent?: react.ComponentType<unknown> | undefined;
129
- ErrorComponent?: react.ComponentType<unknown> | undefined;
140
+ PageComponent?: ComponentType<{}> | undefined;
141
+ LoadingComponent?: ComponentType<{}> | undefined;
142
+ ErrorComponent?: ComponentType<{}> | undefined;
130
143
  loader?: (() => Promise<void>) | undefined;
131
144
  meta?: (() => ({
132
145
  title: string;
@@ -1,6 +1,6 @@
1
1
  import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
- import * as react from 'react';
3
2
  import * as _btst_yar from '@btst/yar';
3
+ import { ComponentType } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { S as SerializedConversation, a as SerializedMessage } from '../../../shared/stack.Be1QIHEn.mjs';
6
6
  import { A as AiChatMode } from '../../../shared/stack.BV9hnvu4.mjs';
@@ -76,6 +76,19 @@ interface AiChatClientConfig {
76
76
  hooks?: AiChatClientHooks;
77
77
  /** Optional headers for SSR (e.g., forwarding cookies) */
78
78
  headers?: Headers;
79
+ /**
80
+ * Optional page component overrides.
81
+ * Replace any plugin page with a custom React component.
82
+ * The built-in component is used as the fallback when not provided.
83
+ */
84
+ pageComponents?: {
85
+ /** Replaces the chat home page */
86
+ chat?: ComponentType;
87
+ /** Replaces the conversation page (authenticated mode only) */
88
+ chatConversation?: ComponentType<{
89
+ conversationId: string;
90
+ }>;
91
+ };
79
92
  }
80
93
  /**
81
94
  * Hooks for AI Chat client plugin
@@ -124,9 +137,9 @@ interface AiChatClientHooks {
124
137
  declare const aiChatClientPlugin: (config: AiChatClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
125
138
  chat: {
126
139
  (inputCtx_0?: _btst_yar.InputContext<"/chat", _btst_yar.RouteOptions> | undefined): {
127
- PageComponent?: react.ComponentType<unknown> | undefined;
128
- LoadingComponent?: react.ComponentType<unknown> | undefined;
129
- ErrorComponent?: react.ComponentType<unknown> | undefined;
140
+ PageComponent?: ComponentType<{}> | undefined;
141
+ LoadingComponent?: ComponentType<{}> | undefined;
142
+ ErrorComponent?: ComponentType<{}> | undefined;
130
143
  loader?: (() => Promise<void>) | undefined;
131
144
  meta?: (() => ({
132
145
  title: string;
@@ -1,6 +1,6 @@
1
1
  import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
- import * as react from 'react';
3
2
  import * as _btst_yar from '@btst/yar';
3
+ import { ComponentType } from 'react';
4
4
  import { QueryClient } from '@tanstack/react-query';
5
5
  import { S as SerializedConversation, a as SerializedMessage } from '../../../shared/stack.Be1QIHEn.js';
6
6
  import { A as AiChatMode } from '../../../shared/stack.BV9hnvu4.js';
@@ -76,6 +76,19 @@ interface AiChatClientConfig {
76
76
  hooks?: AiChatClientHooks;
77
77
  /** Optional headers for SSR (e.g., forwarding cookies) */
78
78
  headers?: Headers;
79
+ /**
80
+ * Optional page component overrides.
81
+ * Replace any plugin page with a custom React component.
82
+ * The built-in component is used as the fallback when not provided.
83
+ */
84
+ pageComponents?: {
85
+ /** Replaces the chat home page */
86
+ chat?: ComponentType;
87
+ /** Replaces the conversation page (authenticated mode only) */
88
+ chatConversation?: ComponentType<{
89
+ conversationId: string;
90
+ }>;
91
+ };
79
92
  }
80
93
  /**
81
94
  * Hooks for AI Chat client plugin
@@ -124,9 +137,9 @@ interface AiChatClientHooks {
124
137
  declare const aiChatClientPlugin: (config: AiChatClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
125
138
  chat: {
126
139
  (inputCtx_0?: _btst_yar.InputContext<"/chat", _btst_yar.RouteOptions> | undefined): {
127
- PageComponent?: react.ComponentType<unknown> | undefined;
128
- LoadingComponent?: react.ComponentType<unknown> | undefined;
129
- ErrorComponent?: react.ComponentType<unknown> | undefined;
140
+ PageComponent?: ComponentType<{}> | undefined;
141
+ LoadingComponent?: ComponentType<{}> | undefined;
142
+ ErrorComponent?: ComponentType<{}> | undefined;
130
143
  loader?: (() => Promise<void>) | undefined;
131
144
  meta?: (() => ({
132
145
  title: string;
@@ -1,5 +1,5 @@
1
- export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.C21-LFX8.cjs';
2
- import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.cjs';
1
+ export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.DaZM10cp.cjs';
2
+ import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BQmuNl5p.cjs';
3
3
  import '@tanstack/react-query';
4
4
  import '@btst/stack/plugins/client';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
- export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.CL4mKxe7.mjs';
2
- import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.mjs';
1
+ export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.cfCkioTe.mjs';
2
+ import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BQmuNl5p.mjs';
3
3
  import '@tanstack/react-query';
4
4
  import '@btst/stack/plugins/client';
5
5
  import '@btst/stack/plugins/api';
@@ -1,5 +1,5 @@
1
- export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.B8_74ror.js';
2
- import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BWp0hcm9.js';
1
+ export { B as BLOG_QUERY_KEYS, h as BlogApiContext, k as BlogApiRouter, i as BlogBackendHooks, e as BlogRouteKey, N as NextPreviousPostsQuerySchema, P as PostListParams, f as PostListQuerySchema, c as PostListResult, j as blogBackendPlugin, d as createBlogQueryKeys, g as getAllPosts, b as getAllTags, a as getPostBySlug } from '../../../shared/stack.DXnclTG7.js';
2
+ import { P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../../shared/stack.BQmuNl5p.js';
3
3
  import '@tanstack/react-query';
4
4
  import '@btst/stack/plugins/client';
5
5
  import '@btst/stack/plugins/api';
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const blogHooks = require('../../../../packages/stack/src/plugins/blog/client/hooks/blog-hooks.cjs');
4
+ const useDebounce = require('../../../../packages/stack/src/plugins/blog/client/hooks/use-debounce.cjs');
4
5
 
5
6
 
6
7
 
@@ -16,3 +17,5 @@ exports.useSuspensePosts = blogHooks.useSuspensePosts;
16
17
  exports.useSuspenseTags = blogHooks.useSuspenseTags;
17
18
  exports.useTags = blogHooks.useTags;
18
19
  exports.useUpdatePost = blogHooks.useUpdatePost;
20
+ exports.useDebounce = useDebounce.useDebounce;
21
+ exports.useThrottle = useDebounce.useThrottle;
@@ -1,228 +1,9 @@
1
- import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.BWp0hcm9.cjs';
3
- import { z } from 'zod';
1
+ export { P as PostCreateInput, e as PostUpdateInput, o as UseNextPreviousPostsOptions, p as UseNextPreviousPostsResult, d as UsePostResult, b as UsePostSearchOptions, c as UsePostSearchResult, U as UsePostsOptions, a as UsePostsResult, r as UseRecentPostsOptions, s as UseRecentPostsResult, k as useCreatePost, m as useDeletePost, q as useNextPreviousPosts, g as usePost, n as usePostSearch, u as usePosts, t as useRecentPosts, h as useSuspensePost, f as useSuspensePosts, j as useSuspenseTags, i as useTags, l as useUpdatePost } from '../../../../shared/stack.BwA7trxA.cjs';
2
+ import '@tanstack/react-query';
3
+ import '../../../../shared/stack.BQmuNl5p.cjs';
4
+ import 'zod';
4
5
 
5
- /**
6
- * Options for the usePosts hook
7
- */
8
- interface UsePostsOptions {
9
- /** Filter posts by tag name */
10
- tag?: string;
11
- /** Filter posts by tag slug */
12
- tagSlug?: string;
13
- /** Number of posts to fetch per page (default: 10) */
14
- limit?: number;
15
- /** Whether to enable the query (default: true) */
16
- enabled?: boolean;
17
- /** Search query to filter posts by title, content, or excerpt */
18
- query?: string;
19
- /** Filter by published status */
20
- published?: boolean;
21
- /** Filter by specific post slug */
22
- slug?: string;
23
- }
24
- /**
25
- * Result from the usePosts hook
26
- */
27
- interface UsePostsResult {
28
- /** Array of fetched posts */
29
- posts: SerializedPost[];
30
- /** Whether the initial load is in progress */
31
- isLoading: boolean;
32
- /** Error if the query failed */
33
- error: Error | null;
34
- /** Function to load the next page of posts */
35
- loadMore: () => void;
36
- /** Whether there are more posts to load */
37
- hasMore: boolean;
38
- /** Whether the next page is being loaded */
39
- isLoadingMore: boolean;
40
- /** Function to refetch the posts */
41
- refetch: () => void;
42
- }
43
- /**
44
- * Options for the usePostSearch hook
45
- */
46
- interface UsePostSearchOptions {
47
- /** Search query string to filter posts */
48
- query: string;
49
- /** Whether to enable the search query (default: true) */
50
- enabled?: boolean;
51
- /** Debounce delay in milliseconds (default: 300) */
52
- debounceMs?: number;
53
- /** Number of results to return (default: 10) */
54
- limit?: number;
55
- /** Filter by published status (default: true) */
56
- published?: boolean;
57
- }
58
- /**
59
- * Result from the usePostSearch hook
60
- */
61
- interface UsePostSearchResult {
62
- /** Array of posts matching the search query */
63
- posts: SerializedPost[];
64
- /** Alias for posts (React Query compatibility) */
65
- data: SerializedPost[];
66
- /** Whether the search is in progress */
67
- isLoading: boolean;
68
- /** Error if the search failed */
69
- error: Error | null;
70
- /** Function to refetch the search results */
71
- refetch: () => void;
72
- /** Whether a search is currently in progress (includes debounce time) */
73
- isSearching: boolean;
74
- /** The debounced search query being used */
75
- searchQuery: string;
76
- }
77
- /**
78
- * Result from the usePost hook
79
- */
80
- interface UsePostResult {
81
- /** The fetched post, or null if not found */
82
- post: SerializedPost | null;
83
- /** Whether the post is being loaded */
84
- isLoading: boolean;
85
- /** Error if the query failed */
86
- error: Error | null;
87
- /** Function to refetch the post */
88
- refetch: () => void;
89
- }
90
- /** Input type for creating a new post */
91
- type PostCreateInput = z.infer<typeof createPostSchema>;
92
- /** Input type for updating an existing post */
93
- type PostUpdateInput = z.infer<typeof updatePostSchema>;
94
- /**
95
- * Hook for fetching paginated posts with load more functionality
96
- */
97
- declare function usePosts(options?: UsePostsOptions): UsePostsResult;
98
- /** Suspense variant of usePosts */
99
- declare function useSuspensePosts(options?: UsePostsOptions): {
100
- posts: SerializedPost[];
101
- loadMore: () => Promise<unknown>;
102
- hasMore: boolean;
103
- isLoadingMore: boolean;
104
- refetch: () => Promise<unknown>;
105
- };
106
- /**
107
- * Hook for fetching a single post by slug
108
- */
109
- declare function usePost(slug?: string): UsePostResult;
110
- /** Suspense variant of usePost */
111
- declare function useSuspensePost(slug: string): {
112
- post: SerializedPost | null;
113
- refetch: () => Promise<unknown>;
114
- };
115
- /**
116
- * Hook for fetching all unique tags across posts
117
- */
118
- declare function useTags(): {
119
- tags: SerializedTag[];
120
- isLoading: boolean;
121
- error: Error | null;
122
- refetch: () => void;
123
- };
124
- /** Suspense variant of useTags */
125
- declare function useSuspenseTags(): {
126
- tags: SerializedTag[];
127
- refetch: () => Promise<unknown>;
128
- };
129
- /** Create a new post */
130
- declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- tags: ({
132
- name: string;
133
- } | {
134
- id: string;
135
- name: string;
136
- slug: string;
137
- })[];
138
- published: boolean;
139
- title: string;
140
- content: string;
141
- excerpt: string;
142
- slug?: string | undefined;
143
- publishedAt?: Date | undefined;
144
- createdAt?: Date | undefined;
145
- updatedAt?: Date | undefined;
146
- image?: string | undefined;
147
- }, unknown>;
148
- /** Update an existing post by id */
149
- declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
150
- id: string;
151
- data: PostUpdateInput;
152
- }, unknown>;
153
- /** Delete a post by id */
154
- declare function useDeletePost(): _tanstack_react_query.UseMutationResult<{
155
- success: boolean;
156
- }, Error, {
157
- id: string;
158
- }, unknown>;
159
- /**
160
- * Hook for searching posts by a free-text query. Uses `usePosts` under the hood.
161
- * Debounces the query and preserves last successful results to avoid flicker.
162
- */
163
- declare function usePostSearch({ query, enabled, debounceMs, limit, published, }: UsePostSearchOptions): UsePostSearchResult;
164
- /**
165
- * Options for the useNextPreviousPosts hook
166
- */
167
- interface UseNextPreviousPostsOptions {
168
- /** Whether to enable the query (default: true) */
169
- enabled?: boolean;
170
- }
171
- /**
172
- * Result from the useNextPreviousPosts hook
173
- */
174
- interface UseNextPreviousPostsResult {
175
- /** The previous post (older), or null if none exists */
176
- previousPost: SerializedPost | null;
177
- /** The next post (newer), or null if none exists */
178
- nextPost: SerializedPost | null;
179
- /** Whether the query is loading */
180
- isLoading: boolean;
181
- /** Error if the query failed */
182
- error: Error | null;
183
- /** Function to refetch the posts */
184
- refetch: () => void;
185
- }
186
- /**
187
- * Hook for fetching previous and next posts relative to a given date
188
- * Uses useInView to only fetch when the component is in view
189
- */
190
- declare function useNextPreviousPosts(createdAt: string | Date, options?: UseNextPreviousPostsOptions): UseNextPreviousPostsResult & {
191
- ref: (node: Element | null) => void;
192
- inView: boolean;
193
- };
194
- /**
195
- * Options for the useRecentPosts hook
196
- */
197
- interface UseRecentPostsOptions {
198
- /** Maximum number of recent posts to fetch (default: 5) */
199
- limit?: number;
200
- /** Slug of a post to exclude from results */
201
- excludeSlug?: string;
202
- /** Whether to enable the query (default: true) */
203
- enabled?: boolean;
204
- }
205
- /**
206
- * Result from the useRecentPosts hook
207
- */
208
- interface UseRecentPostsResult {
209
- /** Array of recent posts */
210
- recentPosts: SerializedPost[];
211
- /** Whether the query is loading */
212
- isLoading: boolean;
213
- /** Error if the query failed */
214
- error: Error | null;
215
- /** Function to refetch the posts */
216
- refetch: () => void;
217
- }
218
- /**
219
- * Hook for fetching recent posts
220
- * Uses useInView to only fetch when the component is in view
221
- */
222
- declare function useRecentPosts(options?: UseRecentPostsOptions): UseRecentPostsResult & {
223
- ref: (node: Element | null) => void;
224
- inView: boolean;
225
- };
6
+ declare function useDebounce<T>(value: T, delay?: number): T;
7
+ declare function useThrottle<T>(value: T, wait?: number): T;
226
8
 
227
- export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
228
- export type { PostCreateInput, PostUpdateInput, UseNextPreviousPostsOptions, UseNextPreviousPostsResult, UsePostResult, UsePostSearchOptions, UsePostSearchResult, UsePostsOptions, UsePostsResult, UseRecentPostsOptions, UseRecentPostsResult };
9
+ export { useDebounce, useThrottle };