@btst/stack 1.1.4 → 1.1.5

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 (38) hide show
  1. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +182 -0
  2. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs +149 -0
  3. package/dist/packages/better-stack/src/plugins/blog/client/components/forms/post-forms.cjs +64 -14
  4. package/dist/packages/better-stack/src/plugins/blog/client/components/forms/post-forms.mjs +66 -16
  5. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/edit-post-page.internal.cjs +5 -1
  6. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/edit-post-page.internal.mjs +5 -1
  7. package/dist/packages/better-stack/src/plugins/blog/client/hooks/blog-hooks.cjs +31 -0
  8. package/dist/packages/better-stack/src/plugins/blog/client/hooks/blog-hooks.mjs +31 -1
  9. package/dist/packages/better-stack/src/plugins/blog/client/localization/blog-forms.cjs +8 -0
  10. package/dist/packages/better-stack/src/plugins/blog/client/localization/blog-forms.mjs +8 -0
  11. package/dist/packages/ui/src/components/alert-dialog.cjs +149 -0
  12. package/dist/packages/ui/src/components/alert-dialog.mjs +137 -0
  13. package/dist/plugins/blog/api/index.d.cts +1 -1
  14. package/dist/plugins/blog/api/index.d.mts +1 -1
  15. package/dist/plugins/blog/api/index.d.ts +1 -1
  16. package/dist/plugins/blog/client/hooks/index.cjs +1 -0
  17. package/dist/plugins/blog/client/hooks/index.d.cts +10 -4
  18. package/dist/plugins/blog/client/hooks/index.d.mts +10 -4
  19. package/dist/plugins/blog/client/hooks/index.d.ts +10 -4
  20. package/dist/plugins/blog/client/hooks/index.mjs +1 -1
  21. package/dist/plugins/blog/client/index.d.cts +172 -178
  22. package/dist/plugins/blog/client/index.d.mts +172 -178
  23. package/dist/plugins/blog/client/index.d.ts +172 -178
  24. package/dist/plugins/blog/query-keys.d.cts +5 -5
  25. package/dist/plugins/blog/query-keys.d.mts +5 -5
  26. package/dist/plugins/blog/query-keys.d.ts +5 -5
  27. package/dist/plugins/client/index.d.cts +3 -2
  28. package/dist/plugins/client/index.d.mts +3 -2
  29. package/dist/plugins/client/index.d.ts +3 -2
  30. package/package.json +1 -1
  31. package/src/plugins/blog/client/components/forms/post-forms.tsx +92 -14
  32. package/src/plugins/blog/client/components/pages/edit-post-page.internal.tsx +6 -0
  33. package/src/plugins/blog/client/hooks/blog-hooks.tsx +38 -0
  34. package/src/plugins/blog/client/localization/blog-forms.ts +10 -0
  35. package/src/plugins/client/index.ts +7 -3
  36. package/dist/shared/{stack.CbuN2zVV.d.cts → stack.CoPoHVfV.d.cts} +2 -2
  37. package/dist/shared/{stack.CbuN2zVV.d.mts → stack.CoPoHVfV.d.mts} +2 -2
  38. package/dist/shared/{stack.CbuN2zVV.d.ts → stack.CoPoHVfV.d.ts} +2 -2
@@ -267,6 +267,36 @@ function useUpdatePost() {
267
267
  }
268
268
  });
269
269
  }
270
+ function useDeletePost() {
271
+ const { refresh, apiBaseURL, apiBasePath } = usePluginOverrides("blog");
272
+ const client = createApiClient({
273
+ baseURL: apiBaseURL,
274
+ basePath: apiBasePath
275
+ });
276
+ const queryClient = useQueryClient();
277
+ const queries = createBlogQueryKeys(client);
278
+ return useMutation({
279
+ mutationKey: [...queries.posts._def, "delete"],
280
+ mutationFn: async ({ id }) => {
281
+ const response = await client(`@delete/posts/:id`, {
282
+ method: "DELETE",
283
+ params: { id }
284
+ });
285
+ return response.data;
286
+ },
287
+ onSuccess: async () => {
288
+ await queryClient.invalidateQueries({
289
+ queryKey: queries.posts._def
290
+ });
291
+ await queryClient.invalidateQueries({
292
+ queryKey: queries.drafts.list._def
293
+ });
294
+ if (refresh) {
295
+ await refresh();
296
+ }
297
+ }
298
+ });
299
+ }
270
300
  function usePostSearch({
271
301
  query,
272
302
  enabled = true,
@@ -365,4 +395,4 @@ function useRecentPosts(options = {}) {
365
395
  };
366
396
  }
367
397
 
368
- export { useCreatePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
398
+ export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
@@ -20,7 +20,15 @@ const BLOG_FORMS = {
20
20
  BLOG_FORMS_CANCEL_BUTTON: "Cancel",
21
21
  BLOG_FORMS_TOAST_CREATE_SUCCESS: "Post created successfully",
22
22
  BLOG_FORMS_TOAST_UPDATE_SUCCESS: "Post updated successfully",
23
+ BLOG_FORMS_TOAST_DELETE_SUCCESS: "Post deleted successfully",
23
24
  BLOG_FORMS_LOADING_POST: "Loading post...",
25
+ // Delete post
26
+ BLOG_FORMS_DELETE_BUTTON: "Delete Post",
27
+ BLOG_FORMS_DELETE_DIALOG_TITLE: "Delete Post",
28
+ BLOG_FORMS_DELETE_DIALOG_DESCRIPTION: "Are you sure you want to delete this post? This action cannot be undone.",
29
+ BLOG_FORMS_DELETE_DIALOG_CANCEL: "Cancel",
30
+ BLOG_FORMS_DELETE_DIALOG_CONFIRM: "Delete",
31
+ BLOG_FORMS_DELETE_PENDING: "Deleting...",
24
32
  // Markdown editor
25
33
  BLOG_FORMS_EDITOR_PLACEHOLDER: "Write something...",
26
34
  // Featured image field
@@ -18,7 +18,15 @@ const BLOG_FORMS = {
18
18
  BLOG_FORMS_CANCEL_BUTTON: "Cancel",
19
19
  BLOG_FORMS_TOAST_CREATE_SUCCESS: "Post created successfully",
20
20
  BLOG_FORMS_TOAST_UPDATE_SUCCESS: "Post updated successfully",
21
+ BLOG_FORMS_TOAST_DELETE_SUCCESS: "Post deleted successfully",
21
22
  BLOG_FORMS_LOADING_POST: "Loading post...",
23
+ // Delete post
24
+ BLOG_FORMS_DELETE_BUTTON: "Delete Post",
25
+ BLOG_FORMS_DELETE_DIALOG_TITLE: "Delete Post",
26
+ BLOG_FORMS_DELETE_DIALOG_DESCRIPTION: "Are you sure you want to delete this post? This action cannot be undone.",
27
+ BLOG_FORMS_DELETE_DIALOG_CANCEL: "Cancel",
28
+ BLOG_FORMS_DELETE_DIALOG_CONFIRM: "Delete",
29
+ BLOG_FORMS_DELETE_PENDING: "Deleting...",
22
30
  // Markdown editor
23
31
  BLOG_FORMS_EDITOR_PLACEHOLDER: "Write something...",
24
32
  // Featured image field
@@ -0,0 +1,149 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const index = require('../../../../node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs');
6
+ const utils = require('../lib/utils.cjs');
7
+ const button = require('./button.cjs');
8
+
9
+ function AlertDialog({
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Root, { "data-slot": "alert-dialog", ...props });
13
+ }
14
+ function AlertDialogTrigger({
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
18
+ }
19
+ function AlertDialogPortal({
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Portal, { "data-slot": "alert-dialog-portal", ...props });
23
+ }
24
+ function AlertDialogOverlay({
25
+ className,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsxRuntime.jsx(
29
+ index.Overlay,
30
+ {
31
+ "data-slot": "alert-dialog-overlay",
32
+ className: utils.cn(
33
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function AlertDialogContent({
41
+ className,
42
+ ...props
43
+ }) {
44
+ return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
45
+ /* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
46
+ /* @__PURE__ */ jsxRuntime.jsx(
47
+ index.Content,
48
+ {
49
+ "data-slot": "alert-dialog-content",
50
+ className: utils.cn(
51
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
52
+ className
53
+ ),
54
+ ...props
55
+ }
56
+ )
57
+ ] });
58
+ }
59
+ function AlertDialogHeader({
60
+ className,
61
+ ...props
62
+ }) {
63
+ return /* @__PURE__ */ jsxRuntime.jsx(
64
+ "div",
65
+ {
66
+ "data-slot": "alert-dialog-header",
67
+ className: utils.cn("flex flex-col gap-2 text-center sm:text-left", className),
68
+ ...props
69
+ }
70
+ );
71
+ }
72
+ function AlertDialogFooter({
73
+ className,
74
+ ...props
75
+ }) {
76
+ return /* @__PURE__ */ jsxRuntime.jsx(
77
+ "div",
78
+ {
79
+ "data-slot": "alert-dialog-footer",
80
+ className: utils.cn(
81
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
82
+ className
83
+ ),
84
+ ...props
85
+ }
86
+ );
87
+ }
88
+ function AlertDialogTitle({
89
+ className,
90
+ ...props
91
+ }) {
92
+ return /* @__PURE__ */ jsxRuntime.jsx(
93
+ index.Title,
94
+ {
95
+ "data-slot": "alert-dialog-title",
96
+ className: utils.cn("text-lg font-semibold", className),
97
+ ...props
98
+ }
99
+ );
100
+ }
101
+ function AlertDialogDescription({
102
+ className,
103
+ ...props
104
+ }) {
105
+ return /* @__PURE__ */ jsxRuntime.jsx(
106
+ index.Description,
107
+ {
108
+ "data-slot": "alert-dialog-description",
109
+ className: utils.cn("text-muted-foreground text-sm", className),
110
+ ...props
111
+ }
112
+ );
113
+ }
114
+ function AlertDialogAction({
115
+ className,
116
+ ...props
117
+ }) {
118
+ return /* @__PURE__ */ jsxRuntime.jsx(
119
+ index.Action,
120
+ {
121
+ className: utils.cn(button.buttonVariants(), className),
122
+ ...props
123
+ }
124
+ );
125
+ }
126
+ function AlertDialogCancel({
127
+ className,
128
+ ...props
129
+ }) {
130
+ return /* @__PURE__ */ jsxRuntime.jsx(
131
+ index.Cancel,
132
+ {
133
+ className: utils.cn(button.buttonVariants({ variant: "outline" }), className),
134
+ ...props
135
+ }
136
+ );
137
+ }
138
+
139
+ exports.AlertDialog = AlertDialog;
140
+ exports.AlertDialogAction = AlertDialogAction;
141
+ exports.AlertDialogCancel = AlertDialogCancel;
142
+ exports.AlertDialogContent = AlertDialogContent;
143
+ exports.AlertDialogDescription = AlertDialogDescription;
144
+ exports.AlertDialogFooter = AlertDialogFooter;
145
+ exports.AlertDialogHeader = AlertDialogHeader;
146
+ exports.AlertDialogOverlay = AlertDialogOverlay;
147
+ exports.AlertDialogPortal = AlertDialogPortal;
148
+ exports.AlertDialogTitle = AlertDialogTitle;
149
+ exports.AlertDialogTrigger = AlertDialogTrigger;
@@ -0,0 +1,137 @@
1
+ "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { Root as Root2, Trigger as Trigger2, Content as Content2, Title as Title2, Description as Description2, Cancel, Action, Portal as Portal2, Overlay as Overlay2 } from '../../../../node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs';
4
+ import { cn } from '../lib/utils.mjs';
5
+ import { buttonVariants } from './button.mjs';
6
+
7
+ function AlertDialog({
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(Root2, { "data-slot": "alert-dialog", ...props });
11
+ }
12
+ function AlertDialogTrigger({
13
+ ...props
14
+ }) {
15
+ return /* @__PURE__ */ jsx(Trigger2, { "data-slot": "alert-dialog-trigger", ...props });
16
+ }
17
+ function AlertDialogPortal({
18
+ ...props
19
+ }) {
20
+ return /* @__PURE__ */ jsx(Portal2, { "data-slot": "alert-dialog-portal", ...props });
21
+ }
22
+ function AlertDialogOverlay({
23
+ className,
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsx(
27
+ Overlay2,
28
+ {
29
+ "data-slot": "alert-dialog-overlay",
30
+ className: cn(
31
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function AlertDialogContent({
39
+ className,
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
43
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
44
+ /* @__PURE__ */ jsx(
45
+ Content2,
46
+ {
47
+ "data-slot": "alert-dialog-content",
48
+ className: cn(
49
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
50
+ className
51
+ ),
52
+ ...props
53
+ }
54
+ )
55
+ ] });
56
+ }
57
+ function AlertDialogHeader({
58
+ className,
59
+ ...props
60
+ }) {
61
+ return /* @__PURE__ */ jsx(
62
+ "div",
63
+ {
64
+ "data-slot": "alert-dialog-header",
65
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function AlertDialogFooter({
71
+ className,
72
+ ...props
73
+ }) {
74
+ return /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ "data-slot": "alert-dialog-footer",
78
+ className: cn(
79
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
80
+ className
81
+ ),
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+ function AlertDialogTitle({
87
+ className,
88
+ ...props
89
+ }) {
90
+ return /* @__PURE__ */ jsx(
91
+ Title2,
92
+ {
93
+ "data-slot": "alert-dialog-title",
94
+ className: cn("text-lg font-semibold", className),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function AlertDialogDescription({
100
+ className,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsx(
104
+ Description2,
105
+ {
106
+ "data-slot": "alert-dialog-description",
107
+ className: cn("text-muted-foreground text-sm", className),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function AlertDialogAction({
113
+ className,
114
+ ...props
115
+ }) {
116
+ return /* @__PURE__ */ jsx(
117
+ Action,
118
+ {
119
+ className: cn(buttonVariants(), className),
120
+ ...props
121
+ }
122
+ );
123
+ }
124
+ function AlertDialogCancel({
125
+ className,
126
+ ...props
127
+ }) {
128
+ return /* @__PURE__ */ jsx(
129
+ Cancel,
130
+ {
131
+ className: cn(buttonVariants({ variant: "outline" }), className),
132
+ ...props
133
+ }
134
+ );
135
+ }
136
+
137
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.CbuN2zVV.cjs';
5
+ import '../../../shared/stack.CoPoHVfV.cjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.CbuN2zVV.mjs';
5
+ import '../../../shared/stack.CoPoHVfV.mjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.CbuN2zVV.js';
5
+ import '../../../shared/stack.CoPoHVfV.js';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -5,6 +5,7 @@ const blogHooks = require('../../../../packages/better-stack/src/plugins/blog/cl
5
5
 
6
6
 
7
7
  exports.useCreatePost = blogHooks.useCreatePost;
8
+ exports.useDeletePost = blogHooks.useDeletePost;
8
9
  exports.useNextPreviousPosts = blogHooks.useNextPreviousPosts;
9
10
  exports.usePost = blogHooks.usePost;
10
11
  exports.usePostSearch = blogHooks.usePostSearch;
@@ -1,5 +1,5 @@
1
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.CbuN2zVV.cjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CoPoHVfV.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  interface UsePostsOptions {
@@ -81,10 +81,10 @@ declare function useSuspenseTags(): {
81
81
  };
82
82
  /** Create a new post */
83
83
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
84
+ published: boolean;
84
85
  title: string;
85
86
  content: string;
86
87
  excerpt: string;
87
- published: boolean;
88
88
  tags: ({
89
89
  name: string;
90
90
  } | {
@@ -93,8 +93,8 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
93
93
  slug: string;
94
94
  })[];
95
95
  slug?: string | undefined;
96
- publishedAt?: Date | undefined;
97
96
  createdAt?: Date | undefined;
97
+ publishedAt?: Date | undefined;
98
98
  updatedAt?: Date | undefined;
99
99
  image?: string | undefined;
100
100
  }, unknown>;
@@ -103,6 +103,12 @@ declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<Serial
103
103
  id: string;
104
104
  data: PostUpdateInput;
105
105
  }, unknown>;
106
+ /** Delete a post by id */
107
+ declare function useDeletePost(): _tanstack_react_query.UseMutationResult<{
108
+ success: boolean;
109
+ }, Error, {
110
+ id: string;
111
+ }, unknown>;
106
112
  /**
107
113
  * Hook for searching posts by a free-text query. Uses `usePosts` under the hood.
108
114
  * Debounces the query and preserves last successful results to avoid flicker.
@@ -146,5 +152,5 @@ declare function useRecentPosts(options?: UseRecentPostsOptions): UseRecentPosts
146
152
  inView: boolean;
147
153
  };
148
154
 
149
- export { useCreatePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
155
+ export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
150
156
  export type { PostCreateInput, PostUpdateInput, UseNextPreviousPostsOptions, UseNextPreviousPostsResult, UsePostResult, UsePostSearchOptions, UsePostSearchResult, UsePostsOptions, UsePostsResult, UseRecentPostsOptions, UseRecentPostsResult };
@@ -1,5 +1,5 @@
1
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.CbuN2zVV.mjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CoPoHVfV.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  interface UsePostsOptions {
@@ -81,10 +81,10 @@ declare function useSuspenseTags(): {
81
81
  };
82
82
  /** Create a new post */
83
83
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
84
+ published: boolean;
84
85
  title: string;
85
86
  content: string;
86
87
  excerpt: string;
87
- published: boolean;
88
88
  tags: ({
89
89
  name: string;
90
90
  } | {
@@ -93,8 +93,8 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
93
93
  slug: string;
94
94
  })[];
95
95
  slug?: string | undefined;
96
- publishedAt?: Date | undefined;
97
96
  createdAt?: Date | undefined;
97
+ publishedAt?: Date | undefined;
98
98
  updatedAt?: Date | undefined;
99
99
  image?: string | undefined;
100
100
  }, unknown>;
@@ -103,6 +103,12 @@ declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<Serial
103
103
  id: string;
104
104
  data: PostUpdateInput;
105
105
  }, unknown>;
106
+ /** Delete a post by id */
107
+ declare function useDeletePost(): _tanstack_react_query.UseMutationResult<{
108
+ success: boolean;
109
+ }, Error, {
110
+ id: string;
111
+ }, unknown>;
106
112
  /**
107
113
  * Hook for searching posts by a free-text query. Uses `usePosts` under the hood.
108
114
  * Debounces the query and preserves last successful results to avoid flicker.
@@ -146,5 +152,5 @@ declare function useRecentPosts(options?: UseRecentPostsOptions): UseRecentPosts
146
152
  inView: boolean;
147
153
  };
148
154
 
149
- export { useCreatePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
155
+ export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
150
156
  export type { PostCreateInput, PostUpdateInput, UseNextPreviousPostsOptions, UseNextPreviousPostsResult, UsePostResult, UsePostSearchOptions, UsePostSearchResult, UsePostsOptions, UsePostsResult, UseRecentPostsOptions, UseRecentPostsResult };
@@ -1,5 +1,5 @@
1
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.CbuN2zVV.js';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CoPoHVfV.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  interface UsePostsOptions {
@@ -81,10 +81,10 @@ declare function useSuspenseTags(): {
81
81
  };
82
82
  /** Create a new post */
83
83
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
84
+ published: boolean;
84
85
  title: string;
85
86
  content: string;
86
87
  excerpt: string;
87
- published: boolean;
88
88
  tags: ({
89
89
  name: string;
90
90
  } | {
@@ -93,8 +93,8 @@ declare function useCreatePost(): _tanstack_react_query.UseMutationResult<Serial
93
93
  slug: string;
94
94
  })[];
95
95
  slug?: string | undefined;
96
- publishedAt?: Date | undefined;
97
96
  createdAt?: Date | undefined;
97
+ publishedAt?: Date | undefined;
98
98
  updatedAt?: Date | undefined;
99
99
  image?: string | undefined;
100
100
  }, unknown>;
@@ -103,6 +103,12 @@ declare function useUpdatePost(): _tanstack_react_query.UseMutationResult<Serial
103
103
  id: string;
104
104
  data: PostUpdateInput;
105
105
  }, unknown>;
106
+ /** Delete a post by id */
107
+ declare function useDeletePost(): _tanstack_react_query.UseMutationResult<{
108
+ success: boolean;
109
+ }, Error, {
110
+ id: string;
111
+ }, unknown>;
106
112
  /**
107
113
  * Hook for searching posts by a free-text query. Uses `usePosts` under the hood.
108
114
  * Debounces the query and preserves last successful results to avoid flicker.
@@ -146,5 +152,5 @@ declare function useRecentPosts(options?: UseRecentPostsOptions): UseRecentPosts
146
152
  inView: boolean;
147
153
  };
148
154
 
149
- export { useCreatePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
155
+ export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost };
150
156
  export type { PostCreateInput, PostUpdateInput, UseNextPreviousPostsOptions, UseNextPreviousPostsResult, UsePostResult, UsePostSearchOptions, UsePostSearchResult, UsePostsOptions, UsePostsResult, UseRecentPostsOptions, UseRecentPostsResult };
@@ -1 +1 @@
1
- export { useCreatePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost } from '../../../../packages/better-stack/src/plugins/blog/client/hooks/blog-hooks.mjs';
1
+ export { useCreatePost, useDeletePost, useNextPreviousPosts, usePost, usePostSearch, usePosts, useRecentPosts, useSuspensePost, useSuspensePosts, useSuspenseTags, useTags, useUpdatePost } from '../../../../packages/better-stack/src/plugins/blog/client/hooks/blog-hooks.mjs';