@btst/stack 1.0.1 → 1.1.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.
- package/README.md +156 -709
- package/dist/api/index.cjs +2 -1
- package/dist/api/index.d.cts +4 -3
- package/dist/api/index.d.mts +4 -3
- package/dist/api/index.d.ts +4 -3
- package/dist/api/index.mjs +1 -1
- package/dist/client/components/compose.cjs +68 -0
- package/dist/client/components/compose.mjs +65 -0
- package/dist/client/components/error-boundary.cjs +24 -0
- package/dist/client/components/error-boundary.mjs +22 -0
- package/dist/client/components/index.cjs +10 -0
- package/dist/client/components/index.d.cts +52 -0
- package/dist/client/components/index.d.mts +52 -0
- package/dist/client/components/index.d.ts +52 -0
- package/dist/client/components/index.mjs +2 -0
- package/dist/client/index.cjs +24 -5
- package/dist/client/index.d.cts +125 -8
- package/dist/client/index.d.mts +125 -8
- package/dist/client/index.d.ts +125 -8
- package/dist/client/index.mjs +21 -4
- package/dist/client/meta-utils.cjs +162 -0
- package/dist/client/meta-utils.mjs +160 -0
- package/dist/client/path-utils.cjs +15 -0
- package/dist/client/path-utils.mjs +13 -0
- package/dist/client/sitemap-utils.cjs +14 -0
- package/dist/client/sitemap-utils.mjs +12 -0
- package/dist/context/index.cjs +6 -63
- package/dist/context/index.d.cts +21 -24
- package/dist/context/index.d.mts +21 -24
- package/dist/context/index.d.ts +21 -24
- package/dist/context/index.mjs +1 -61
- package/dist/context/provider.cjs +51 -0
- package/dist/context/provider.mjs +46 -0
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +1 -2
- package/dist/plugins/api/index.cjs +13 -0
- package/dist/plugins/api/index.d.cts +40 -0
- package/dist/plugins/api/index.d.mts +40 -0
- package/dist/plugins/api/index.d.ts +40 -0
- package/dist/plugins/api/index.mjs +8 -0
- package/dist/plugins/blog/api/index.cjs +11 -0
- package/dist/plugins/blog/api/index.d.cts +7 -0
- package/dist/plugins/blog/api/index.d.mts +7 -0
- package/dist/plugins/blog/api/index.d.ts +7 -0
- package/dist/plugins/blog/api/index.mjs +2 -0
- package/dist/plugins/blog/api/plugin.cjs +569 -0
- package/dist/plugins/blog/api/plugin.mjs +565 -0
- package/dist/plugins/blog/client/components/forms/image-field.cjs +133 -0
- package/dist/plugins/blog/client/components/forms/image-field.mjs +131 -0
- package/dist/plugins/blog/client/components/forms/markdown-editor-styles.css +30 -0
- package/dist/plugins/blog/client/components/forms/markdown-editor.cjs +106 -0
- package/dist/plugins/blog/client/components/forms/markdown-editor.mjs +104 -0
- package/dist/plugins/blog/client/components/forms/post-forms.cjs +401 -0
- package/dist/plugins/blog/client/components/forms/post-forms.mjs +398 -0
- package/dist/plugins/blog/client/components/forms/tags-multiselect.cjs +71 -0
- package/dist/plugins/blog/client/components/forms/tags-multiselect.mjs +65 -0
- package/dist/plugins/blog/client/components/index.cjs +17 -0
- package/dist/plugins/blog/client/components/index.d.cts +22 -0
- package/dist/plugins/blog/client/components/index.d.mts +22 -0
- package/dist/plugins/blog/client/components/index.d.ts +22 -0
- package/dist/plugins/blog/client/components/index.mjs +12 -0
- package/dist/plugins/blog/client/components/loading/form-page-skeleton.cjs +62 -0
- package/dist/plugins/blog/client/components/loading/form-page-skeleton.mjs +60 -0
- package/dist/plugins/blog/client/components/loading/index.cjs +20 -0
- package/dist/plugins/blog/client/components/loading/index.mjs +16 -0
- package/dist/plugins/blog/client/components/loading/list-page-skeleton.cjs +26 -0
- package/dist/plugins/blog/client/components/loading/list-page-skeleton.mjs +24 -0
- package/dist/plugins/blog/client/components/loading/page-header-skeleton.cjs +13 -0
- package/dist/plugins/blog/client/components/loading/page-header-skeleton.mjs +11 -0
- package/dist/plugins/blog/client/components/loading/post-card-skeleton.cjs +22 -0
- package/dist/plugins/blog/client/components/loading/post-card-skeleton.mjs +20 -0
- package/dist/plugins/blog/client/components/loading/post-page-skeleton.cjs +56 -0
- package/dist/plugins/blog/client/components/loading/post-page-skeleton.mjs +54 -0
- package/dist/plugins/blog/client/components/pages/404-page.cjs +19 -0
- package/dist/plugins/blog/client/components/pages/404-page.mjs +17 -0
- package/dist/plugins/blog/client/components/pages/edit-post-page.cjs +41 -0
- package/dist/plugins/blog/client/components/pages/edit-post-page.internal.cjs +57 -0
- package/dist/plugins/blog/client/components/pages/edit-post-page.internal.mjs +55 -0
- package/dist/plugins/blog/client/components/pages/edit-post-page.mjs +39 -0
- package/dist/plugins/blog/client/components/pages/home-page.cjs +41 -0
- package/dist/plugins/blog/client/components/pages/home-page.internal.cjs +61 -0
- package/dist/plugins/blog/client/components/pages/home-page.internal.mjs +59 -0
- package/dist/plugins/blog/client/components/pages/home-page.mjs +39 -0
- package/dist/plugins/blog/client/components/pages/new-post-page.cjs +37 -0
- package/dist/plugins/blog/client/components/pages/new-post-page.internal.cjs +53 -0
- package/dist/plugins/blog/client/components/pages/new-post-page.internal.mjs +51 -0
- package/dist/plugins/blog/client/components/pages/new-post-page.mjs +35 -0
- package/dist/plugins/blog/client/components/pages/post-page.cjs +39 -0
- package/dist/plugins/blog/client/components/pages/post-page.internal.cjs +101 -0
- package/dist/plugins/blog/client/components/pages/post-page.internal.mjs +99 -0
- package/dist/plugins/blog/client/components/pages/post-page.mjs +37 -0
- package/dist/plugins/blog/client/components/pages/tag-page.cjs +39 -0
- package/dist/plugins/blog/client/components/pages/tag-page.internal.cjs +61 -0
- package/dist/plugins/blog/client/components/pages/tag-page.internal.mjs +59 -0
- package/dist/plugins/blog/client/components/pages/tag-page.mjs +37 -0
- package/dist/plugins/blog/client/components/shared/better-blog-attribution.cjs +24 -0
- package/dist/plugins/blog/client/components/shared/better-blog-attribution.mjs +22 -0
- package/dist/plugins/blog/client/components/shared/default-error.cjs +18 -0
- package/dist/plugins/blog/client/components/shared/default-error.mjs +16 -0
- package/dist/plugins/blog/client/components/shared/defaults.cjs +13 -0
- package/dist/plugins/blog/client/components/shared/defaults.mjs +10 -0
- package/dist/plugins/blog/client/components/shared/empty-list.cjs +21 -0
- package/dist/plugins/blog/client/components/shared/empty-list.mjs +19 -0
- package/dist/plugins/blog/client/components/shared/error-placeholder.cjs +24 -0
- package/dist/plugins/blog/client/components/shared/error-placeholder.mjs +22 -0
- package/dist/plugins/blog/client/components/shared/highlight-text.cjs +53 -0
- package/dist/plugins/blog/client/components/shared/highlight-text.mjs +51 -0
- package/dist/plugins/blog/client/components/shared/markdown-content-styles.css +328 -0
- package/dist/plugins/blog/client/components/shared/markdown-content.cjs +324 -0
- package/dist/plugins/blog/client/components/shared/markdown-content.mjs +315 -0
- package/dist/plugins/blog/client/components/shared/on-this-page.cjs +161 -0
- package/dist/plugins/blog/client/components/shared/on-this-page.mjs +158 -0
- package/dist/plugins/blog/client/components/shared/page-header.cjs +40 -0
- package/dist/plugins/blog/client/components/shared/page-header.mjs +38 -0
- package/dist/plugins/blog/client/components/shared/page-layout.cjs +24 -0
- package/dist/plugins/blog/client/components/shared/page-layout.mjs +22 -0
- package/dist/plugins/blog/client/components/shared/page-wrapper.cjs +23 -0
- package/dist/plugins/blog/client/components/shared/page-wrapper.mjs +21 -0
- package/dist/plugins/blog/client/components/shared/post-card.cjs +279 -0
- package/dist/plugins/blog/client/components/shared/post-card.mjs +277 -0
- package/dist/plugins/blog/client/components/shared/post-navigation.cjs +74 -0
- package/dist/plugins/blog/client/components/shared/post-navigation.mjs +72 -0
- package/dist/plugins/blog/client/components/shared/posts-list.cjs +48 -0
- package/dist/plugins/blog/client/components/shared/posts-list.mjs +46 -0
- package/dist/plugins/blog/client/components/shared/recent-posts-carousel.cjs +59 -0
- package/dist/plugins/blog/client/components/shared/recent-posts-carousel.mjs +57 -0
- package/dist/plugins/blog/client/components/shared/search-input.cjs +136 -0
- package/dist/plugins/blog/client/components/shared/search-input.mjs +117 -0
- package/dist/plugins/blog/client/components/shared/search-modal.cjs +135 -0
- package/dist/plugins/blog/client/components/shared/search-modal.mjs +116 -0
- package/dist/plugins/blog/client/components/shared/tags-list.cjs +22 -0
- package/dist/plugins/blog/client/components/shared/tags-list.mjs +20 -0
- package/dist/plugins/blog/client/components/shared/use-route-lifecycle.cjs +50 -0
- package/dist/plugins/blog/client/components/shared/use-route-lifecycle.mjs +48 -0
- package/dist/plugins/blog/client/hooks/blog-hooks.cjs +380 -0
- package/dist/plugins/blog/client/hooks/blog-hooks.mjs +368 -0
- package/dist/plugins/blog/client/hooks/index.cjs +17 -0
- package/dist/plugins/blog/client/hooks/index.d.cts +150 -0
- package/dist/plugins/blog/client/hooks/index.d.mts +150 -0
- package/dist/plugins/blog/client/hooks/index.d.ts +150 -0
- package/dist/plugins/blog/client/hooks/index.mjs +1 -0
- package/dist/plugins/blog/client/hooks/use-debounce.cjs +16 -0
- package/dist/plugins/blog/client/hooks/use-debounce.mjs +14 -0
- package/dist/plugins/blog/client/index.cjs +7 -0
- package/dist/plugins/blog/client/index.d.cts +414 -0
- package/dist/plugins/blog/client/index.d.mts +414 -0
- package/dist/plugins/blog/client/index.d.ts +414 -0
- package/dist/plugins/blog/client/index.mjs +1 -0
- package/dist/plugins/blog/client/localization/blog-card.cjs +7 -0
- package/dist/plugins/blog/client/localization/blog-card.mjs +5 -0
- package/dist/plugins/blog/client/localization/blog-common.cjs +10 -0
- package/dist/plugins/blog/client/localization/blog-common.mjs +8 -0
- package/dist/plugins/blog/client/localization/blog-forms.cjs +40 -0
- package/dist/plugins/blog/client/localization/blog-forms.mjs +38 -0
- package/dist/plugins/blog/client/localization/blog-list.cjs +18 -0
- package/dist/plugins/blog/client/localization/blog-list.mjs +16 -0
- package/dist/plugins/blog/client/localization/blog-post.cjs +13 -0
- package/dist/plugins/blog/client/localization/blog-post.mjs +11 -0
- package/dist/plugins/blog/client/localization/index.cjs +17 -0
- package/dist/plugins/blog/client/localization/index.mjs +15 -0
- package/dist/plugins/blog/client/plugin.cjs +462 -0
- package/dist/plugins/blog/client/plugin.mjs +460 -0
- package/dist/plugins/blog/client.css +3 -0
- package/dist/plugins/blog/db.cjs +90 -0
- package/dist/plugins/blog/db.mjs +88 -0
- package/dist/plugins/blog/query-keys.cjs +181 -0
- package/dist/plugins/blog/query-keys.d.cts +530 -0
- package/dist/plugins/blog/query-keys.d.mts +530 -0
- package/dist/plugins/blog/query-keys.d.ts +530 -0
- package/dist/plugins/blog/query-keys.mjs +179 -0
- package/dist/plugins/blog/schemas.cjs +39 -0
- package/dist/plugins/blog/schemas.mjs +35 -0
- package/dist/plugins/blog/style.css +22 -0
- package/dist/plugins/blog/utils.cjs +97 -0
- package/dist/plugins/blog/utils.mjs +87 -0
- package/dist/plugins/client/index.cjs +15 -0
- package/dist/plugins/client/index.d.cts +57 -0
- package/dist/plugins/client/index.d.mts +57 -0
- package/dist/plugins/client/index.d.ts +57 -0
- package/dist/plugins/client/index.mjs +9 -0
- package/dist/{shared/stack.3OUyGp_E.mjs → plugins/utils.mjs} +1 -1
- package/dist/shared/{stack.DORw_1ps.d.cts → stack.ByOugz9d.d.cts} +17 -1
- package/dist/shared/{stack.DORw_1ps.d.mts → stack.ByOugz9d.d.mts} +17 -1
- package/dist/shared/{stack.DORw_1ps.d.ts → stack.ByOugz9d.d.ts} +17 -1
- package/dist/shared/stack.CoPoHVfV.d.cts +76 -0
- package/dist/shared/stack.CoPoHVfV.d.mts +76 -0
- package/dist/shared/stack.CoPoHVfV.d.ts +76 -0
- package/package.json +102 -14
- package/src/__tests__/plugins.test.tsx +539 -0
- package/src/__tests__/sitemap.test.ts +60 -0
- package/src/api/index.ts +75 -0
- package/src/client/components/compose.tsx +116 -0
- package/src/client/components/error-boundary.tsx +30 -0
- package/src/client/components/index.tsx +2 -0
- package/src/client/index.ts +109 -0
- package/src/client/meta-utils.ts +228 -0
- package/src/client/path-utils.ts +38 -0
- package/src/client/sitemap-utils.ts +46 -0
- package/src/context/index.ts +1 -0
- package/src/context/provider.tsx +157 -0
- package/src/index.ts +1 -0
- package/src/plugins/api/index.ts +50 -0
- package/src/plugins/blog/api/index.ts +2 -0
- package/src/plugins/blog/api/plugin.ts +759 -0
- package/src/plugins/blog/client/components/forms/image-field.tsx +165 -0
- package/src/plugins/blog/client/components/forms/markdown-editor-styles.css +30 -0
- package/src/plugins/blog/client/components/forms/markdown-editor.tsx +136 -0
- package/src/plugins/blog/client/components/forms/post-forms.tsx +531 -0
- package/src/plugins/blog/client/components/forms/tags-multiselect.tsx +79 -0
- package/src/plugins/blog/client/components/index.tsx +11 -0
- package/src/plugins/blog/client/components/loading/form-page-skeleton.tsx +75 -0
- package/src/plugins/blog/client/components/loading/index.tsx +27 -0
- package/src/plugins/blog/client/components/loading/list-page-skeleton.tsx +38 -0
- package/src/plugins/blog/client/components/loading/page-header-skeleton.tsx +10 -0
- package/src/plugins/blog/client/components/loading/post-card-skeleton.tsx +30 -0
- package/src/plugins/blog/client/components/loading/post-page-skeleton.tsx +75 -0
- package/src/plugins/blog/client/components/pages/404-page.tsx +23 -0
- package/src/plugins/blog/client/components/pages/edit-post-page.internal.tsx +60 -0
- package/src/plugins/blog/client/components/pages/edit-post-page.tsx +40 -0
- package/src/plugins/blog/client/components/pages/home-page.internal.tsx +71 -0
- package/src/plugins/blog/client/components/pages/home-page.tsx +42 -0
- package/src/plugins/blog/client/components/pages/new-post-page.internal.tsx +59 -0
- package/src/plugins/blog/client/components/pages/new-post-page.tsx +36 -0
- package/src/plugins/blog/client/components/pages/post-page.internal.tsx +142 -0
- package/src/plugins/blog/client/components/pages/post-page.tsx +38 -0
- package/src/plugins/blog/client/components/pages/tag-page.internal.tsx +74 -0
- package/src/plugins/blog/client/components/pages/tag-page.tsx +38 -0
- package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +19 -0
- package/src/plugins/blog/client/components/shared/default-error.tsx +20 -0
- package/src/plugins/blog/client/components/shared/defaults.tsx +9 -0
- package/src/plugins/blog/client/components/shared/empty-list.tsx +25 -0
- package/src/plugins/blog/client/components/shared/error-placeholder.tsx +20 -0
- package/src/plugins/blog/client/components/shared/highlight-text.tsx +80 -0
- package/src/plugins/blog/client/components/shared/markdown-content-styles.css +328 -0
- package/src/plugins/blog/client/components/shared/markdown-content.tsx +448 -0
- package/src/plugins/blog/client/components/shared/on-this-page.tsx +234 -0
- package/src/plugins/blog/client/components/shared/page-header.tsx +35 -0
- package/src/plugins/blog/client/components/shared/page-layout.tsx +23 -0
- package/src/plugins/blog/client/components/shared/page-wrapper.tsx +32 -0
- package/src/plugins/blog/client/components/shared/post-card.tsx +308 -0
- package/src/plugins/blog/client/components/shared/post-navigation.tsx +98 -0
- package/src/plugins/blog/client/components/shared/posts-list.tsx +67 -0
- package/src/plugins/blog/client/components/shared/recent-posts-carousel.tsx +79 -0
- package/src/plugins/blog/client/components/shared/search-input.tsx +146 -0
- package/src/plugins/blog/client/components/shared/search-modal.tsx +162 -0
- package/src/plugins/blog/client/components/shared/tags-list.tsx +34 -0
- package/src/plugins/blog/client/components/shared/use-route-lifecycle.tsx +68 -0
- package/src/plugins/blog/client/hooks/blog-hooks.tsx +623 -0
- package/src/plugins/blog/client/hooks/index.tsx +1 -0
- package/src/plugins/blog/client/hooks/use-debounce.ts +43 -0
- package/src/plugins/blog/client/index.ts +9 -0
- package/src/plugins/blog/client/localization/blog-card.ts +3 -0
- package/src/plugins/blog/client/localization/blog-common.ts +7 -0
- package/src/plugins/blog/client/localization/blog-forms.ts +45 -0
- package/src/plugins/blog/client/localization/blog-list.ts +14 -0
- package/src/plugins/blog/client/localization/blog-post.ts +9 -0
- package/src/plugins/blog/client/localization/index.ts +15 -0
- package/src/plugins/blog/client/overrides.ts +123 -0
- package/src/plugins/blog/client/plugin.tsx +672 -0
- package/src/plugins/blog/client.css +3 -0
- package/src/plugins/blog/db.ts +90 -0
- package/src/plugins/blog/query-keys.ts +267 -0
- package/src/plugins/blog/schemas.ts +39 -0
- package/src/plugins/blog/style.css +22 -0
- package/src/plugins/blog/types.ts +37 -0
- package/src/plugins/blog/utils.ts +144 -0
- package/src/plugins/client/index.ts +53 -0
- package/src/plugins/index.ts +0 -0
- package/src/plugins/utils.ts +35 -0
- package/src/types.ts +209 -0
- package/dist/plugins/index.cjs +0 -15
- package/dist/plugins/index.d.cts +0 -64
- package/dist/plugins/index.d.mts +0 -64
- package/dist/plugins/index.d.ts +0 -64
- package/dist/plugins/index.mjs +0 -11
- package/dist/shared/stack.DrUAVfIH.d.cts +0 -17
- package/dist/shared/stack.DrUAVfIH.d.mts +0 -17
- package/dist/shared/stack.DrUAVfIH.d.ts +0 -17
- /package/dist/{shared/stack.CktCg4PJ.cjs → plugins/utils.cjs} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const BLOG_FORMS = {
|
|
2
|
+
BLOG_FORMS_TITLE_LABEL: "Title",
|
|
3
|
+
BLOG_FORMS_REQUIRED_ASTERISK: " *",
|
|
4
|
+
BLOG_FORMS_TITLE_PLACEHOLDER: "Enter your post title...",
|
|
5
|
+
|
|
6
|
+
BLOG_FORMS_SLUG_LABEL: "Slug",
|
|
7
|
+
BLOG_FORMS_SLUG_PLACEHOLDER: "url-friendly-slug",
|
|
8
|
+
|
|
9
|
+
BLOG_FORMS_EXCERPT_LABEL: "Excerpt",
|
|
10
|
+
BLOG_FORMS_EXCERPT_PLACEHOLDER: "Brief summary of your post...",
|
|
11
|
+
|
|
12
|
+
BLOG_FORMS_TAGS_LABEL: "Tags",
|
|
13
|
+
BLOG_FORMS_TAGS_PLACEHOLDER: "Enter your post tags...",
|
|
14
|
+
|
|
15
|
+
BLOG_FORMS_CONTENT_LABEL: "Content",
|
|
16
|
+
|
|
17
|
+
BLOG_FORMS_PUBLISHED_LABEL: "Published",
|
|
18
|
+
BLOG_FORMS_PUBLISHED_DESCRIPTION: "Toggle to publish immediately",
|
|
19
|
+
|
|
20
|
+
BLOG_FORMS_SUBMIT_CREATE_IDLE: "Create Post",
|
|
21
|
+
BLOG_FORMS_SUBMIT_CREATE_PENDING: "Creating...",
|
|
22
|
+
BLOG_FORMS_SUBMIT_UPDATE_IDLE: "Update Post",
|
|
23
|
+
BLOG_FORMS_SUBMIT_UPDATE_PENDING: "Updating...",
|
|
24
|
+
BLOG_FORMS_CANCEL_BUTTON: "Cancel",
|
|
25
|
+
|
|
26
|
+
BLOG_FORMS_TOAST_CREATE_SUCCESS: "Post created successfully",
|
|
27
|
+
BLOG_FORMS_TOAST_UPDATE_SUCCESS: "Post updated successfully",
|
|
28
|
+
BLOG_FORMS_LOADING_POST: "Loading post...",
|
|
29
|
+
|
|
30
|
+
// Markdown editor
|
|
31
|
+
BLOG_FORMS_EDITOR_PLACEHOLDER: "Write something...",
|
|
32
|
+
|
|
33
|
+
// Featured image field
|
|
34
|
+
BLOG_FORMS_FEATURED_IMAGE_LABEL: "Image",
|
|
35
|
+
BLOG_FORMS_FEATURED_IMAGE_REQUIRED_ASTERISK: " *",
|
|
36
|
+
BLOG_FORMS_FEATURED_IMAGE_INPUT_PLACEHOLDER: "Image URL or upload below...",
|
|
37
|
+
BLOG_FORMS_FEATURED_IMAGE_UPLOAD_BUTTON: "Upload",
|
|
38
|
+
BLOG_FORMS_FEATURED_IMAGE_UPLOADING_BUTTON: "Uploading...",
|
|
39
|
+
BLOG_FORMS_FEATURED_IMAGE_UPLOADING_TEXT: "Uploading image...",
|
|
40
|
+
BLOG_FORMS_FEATURED_IMAGE_PREVIEW_ALT: "Featured image preview",
|
|
41
|
+
BLOG_FORMS_FEATURED_IMAGE_ERROR_NOT_IMAGE: "Please select an image file",
|
|
42
|
+
BLOG_FORMS_FEATURED_IMAGE_ERROR_TOO_LARGE: "Image size must be less than 4MB",
|
|
43
|
+
BLOG_FORMS_FEATURED_IMAGE_TOAST_SUCCESS: "Image uploaded successfully",
|
|
44
|
+
BLOG_FORMS_FEATURED_IMAGE_TOAST_FAILURE: "Failed to upload image",
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const BLOG_LIST = {
|
|
2
|
+
BLOG_LIST_TITLE: "Blog Posts",
|
|
3
|
+
BLOG_LIST_DRAFTS_TITLE: "Draft Posts",
|
|
4
|
+
BLOG_LIST_EMPTY: "There are no posts here yet.",
|
|
5
|
+
BLOG_LIST_LOAD_MORE: "Load more posts",
|
|
6
|
+
BLOG_LIST_LOADING_MORE: "Loading more...",
|
|
7
|
+
BLOG_LIST_SEARCH_PLACEHOLDER: "Search Blog Posts...",
|
|
8
|
+
BLOG_LIST_SEARCH_BUTTON: "Search Posts",
|
|
9
|
+
BLOG_LIST_SEARCH_EMPTY: "No blog posts found.",
|
|
10
|
+
BLOG_TAG_PAGE_TITLE: "{tag} Posts",
|
|
11
|
+
BLOG_TAG_PAGE_DESCRIPTION: "Browse all posts with this tag",
|
|
12
|
+
BLOG_TAG_NOT_FOUND: "Tag not found",
|
|
13
|
+
BLOG_TAG_NOT_FOUND_DESCRIPTION: "The tag you are looking for does not exist.",
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const BLOG_POST = {
|
|
2
|
+
BLOG_POST_ADD_TITLE: "Add New Post",
|
|
3
|
+
BLOG_POST_ADD_DESCRIPTION: "Create a new blog post.",
|
|
4
|
+
BLOG_POST_EDIT_TITLE: "Edit Post",
|
|
5
|
+
BLOG_POST_EDIT_DESCRIPTION: "Update your blog post.",
|
|
6
|
+
BLOG_POST_ON_THIS_PAGE: "In This Post",
|
|
7
|
+
BLOG_POST_KEEP_READING: "Keep Reading",
|
|
8
|
+
BLOG_POST_VIEW_ALL: "View all",
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BLOG_CARD } from "./blog-card";
|
|
2
|
+
import { BLOG_COMMON } from "./blog-common";
|
|
3
|
+
import { BLOG_LIST } from "./blog-list";
|
|
4
|
+
import { BLOG_POST } from "./blog-post";
|
|
5
|
+
import { BLOG_FORMS } from "./blog-forms";
|
|
6
|
+
|
|
7
|
+
export const BLOG_LOCALIZATION = {
|
|
8
|
+
...BLOG_COMMON,
|
|
9
|
+
...BLOG_LIST,
|
|
10
|
+
...BLOG_CARD,
|
|
11
|
+
...BLOG_POST,
|
|
12
|
+
...BLOG_FORMS,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type BlogLocalization = typeof BLOG_LOCALIZATION;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { SerializedPost } from "../types";
|
|
2
|
+
import type { ComponentType } from "react";
|
|
3
|
+
import type { BlogLocalization } from "./localization";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Context passed to lifecycle hooks
|
|
7
|
+
*/
|
|
8
|
+
export interface RouteContext {
|
|
9
|
+
path: string;
|
|
10
|
+
params?: Record<string, string>;
|
|
11
|
+
isSSR: boolean;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Overridable components and functions for the Blog plugin
|
|
17
|
+
*
|
|
18
|
+
* External consumers can provide their own implementations of these
|
|
19
|
+
* to customize the behavior for their framework (Next.js, React Router, etc.)
|
|
20
|
+
*/
|
|
21
|
+
export interface BlogPluginOverrides {
|
|
22
|
+
Link?: ComponentType<React.ComponentProps<"a"> & Record<string, any>>;
|
|
23
|
+
PostCard?: ComponentType<{
|
|
24
|
+
post: SerializedPost;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Navigation function for programmatic navigation
|
|
28
|
+
*/
|
|
29
|
+
navigate: (path: string) => void | Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Refresh function to invalidate server-side cache (e.g., Next.js router.refresh())
|
|
32
|
+
*/
|
|
33
|
+
refresh?: () => void | Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Image component for displaying images
|
|
36
|
+
*/
|
|
37
|
+
Image?: ComponentType<
|
|
38
|
+
React.ImgHTMLAttributes<HTMLImageElement> & Record<string, any>
|
|
39
|
+
>;
|
|
40
|
+
/**
|
|
41
|
+
* Function used to upload an image and return its URL.
|
|
42
|
+
*/
|
|
43
|
+
uploadImage: (file: File) => Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Localization object for the blog plugin
|
|
46
|
+
*/
|
|
47
|
+
localization?: BlogLocalization;
|
|
48
|
+
/**
|
|
49
|
+
* API base URL
|
|
50
|
+
*/
|
|
51
|
+
apiBaseURL: string;
|
|
52
|
+
/**
|
|
53
|
+
* API base path
|
|
54
|
+
*/
|
|
55
|
+
apiBasePath: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to show the attribution
|
|
58
|
+
*/
|
|
59
|
+
showAttribution?: boolean;
|
|
60
|
+
|
|
61
|
+
// Lifecycle Hooks (optional)
|
|
62
|
+
/**
|
|
63
|
+
* Called when a route is rendered
|
|
64
|
+
* @param routeName - Name of the route (e.g., 'posts', 'post', 'newPost')
|
|
65
|
+
* @param context - Route context with path, params, etc.
|
|
66
|
+
*/
|
|
67
|
+
onRouteRender?: (
|
|
68
|
+
routeName: string,
|
|
69
|
+
context: RouteContext,
|
|
70
|
+
) => void | Promise<void>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Called when a route encounters an error
|
|
74
|
+
* @param routeName - Name of the route
|
|
75
|
+
* @param error - The error that occurred
|
|
76
|
+
* @param context - Route context
|
|
77
|
+
*/
|
|
78
|
+
onRouteError?: (
|
|
79
|
+
routeName: string,
|
|
80
|
+
error: Error,
|
|
81
|
+
context: RouteContext,
|
|
82
|
+
) => void | Promise<void>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Called before the posts list page is rendered
|
|
86
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
87
|
+
* @param context - Route context
|
|
88
|
+
*/
|
|
89
|
+
onBeforePostsPageRendered?: (context: RouteContext) => boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Called before a single post page is rendered
|
|
93
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
94
|
+
* @param slug - The post slug
|
|
95
|
+
* @param context - Route context
|
|
96
|
+
*/
|
|
97
|
+
onBeforePostPageRendered?: (slug: string, context: RouteContext) => boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Called before the new post page is rendered
|
|
101
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
102
|
+
* @param context - Route context
|
|
103
|
+
*/
|
|
104
|
+
onBeforeNewPostPageRendered?: (context: RouteContext) => boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Called before the edit post page is rendered
|
|
108
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
109
|
+
* @param slug - The post slug being edited
|
|
110
|
+
* @param context - Route context
|
|
111
|
+
*/
|
|
112
|
+
onBeforeEditPostPageRendered?: (
|
|
113
|
+
slug: string,
|
|
114
|
+
context: RouteContext,
|
|
115
|
+
) => boolean;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Called before the drafts page is rendered
|
|
119
|
+
* Return false to prevent rendering (e.g., for authorization)
|
|
120
|
+
* @param context - Route context
|
|
121
|
+
*/
|
|
122
|
+
onBeforeDraftsPageRendered?: (context: RouteContext) => boolean;
|
|
123
|
+
}
|