@jhits/plugin-blog 0.0.8 → 0.0.10
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/dist/api/categories.d.ts +8 -0
- package/dist/api/categories.d.ts.map +1 -0
- package/dist/api/categories.js +30 -0
- package/dist/api/check-title.d.ts +8 -0
- package/dist/api/check-title.d.ts.map +1 -0
- package/dist/api/check-title.js +47 -0
- package/dist/api/config-handler.d.ts +21 -0
- package/dist/api/config-handler.d.ts.map +1 -0
- package/dist/api/config-handler.js +46 -0
- package/dist/api/handler.d.ts +42 -0
- package/dist/api/handler.d.ts.map +1 -0
- package/dist/api/handler.js +331 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +12 -0
- package/dist/api/route.d.ts +50 -0
- package/dist/api/route.d.ts.map +1 -0
- package/dist/api/route.js +69 -0
- package/dist/api/router.d.ts +27 -0
- package/dist/api/router.d.ts.map +1 -0
- package/dist/api/router.js +98 -0
- package/dist/api-server.d.ts +9 -0
- package/dist/api-server.d.ts.map +1 -0
- package/dist/api-server.js +9 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +156 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/useBlog.d.ts +31 -0
- package/dist/hooks/useBlog.d.ts.map +1 -0
- package/dist/hooks/useBlog.js +57 -0
- package/dist/hooks/useBlogs.d.ts +39 -0
- package/dist/hooks/useBlogs.d.ts.map +1 -0
- package/dist/hooks/useBlogs.js +82 -0
- package/dist/hooks/useCategories.d.ts +9 -0
- package/dist/hooks/useCategories.d.ts.map +1 -0
- package/dist/hooks/useCategories.js +70 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +228 -0
- package/dist/index.server.d.ts +12 -0
- package/dist/index.server.d.ts.map +1 -0
- package/dist/index.server.js +10 -0
- package/dist/init.d.ts +40 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +41 -0
- package/dist/lib/blocks/BlockRenderer.d.ts +54 -0
- package/dist/lib/blocks/BlockRenderer.d.ts.map +1 -0
- package/dist/lib/blocks/BlockRenderer.js +54 -0
- package/dist/lib/blocks/index.d.ts +5 -0
- package/dist/lib/blocks/index.d.ts.map +1 -0
- package/dist/lib/blocks/index.js +4 -0
- package/dist/lib/config-storage.d.ts +30 -0
- package/dist/lib/config-storage.d.ts.map +1 -0
- package/dist/lib/config-storage.js +31 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/layouts/blocks/ColumnsBlock.d.ts +25 -0
- package/dist/lib/layouts/blocks/ColumnsBlock.d.ts.map +1 -0
- package/dist/lib/layouts/blocks/ColumnsBlock.js +186 -0
- package/dist/lib/layouts/blocks/SectionBlock.d.ts +25 -0
- package/dist/lib/layouts/blocks/SectionBlock.d.ts.map +1 -0
- package/dist/lib/layouts/blocks/SectionBlock.js +44 -0
- package/dist/lib/layouts/blocks/index.d.ts +7 -0
- package/dist/lib/layouts/blocks/index.d.ts.map +1 -0
- package/dist/lib/layouts/blocks/index.js +6 -0
- package/dist/lib/layouts/index.d.ts +23 -0
- package/dist/lib/layouts/index.d.ts.map +1 -0
- package/dist/lib/layouts/index.js +45 -0
- package/dist/lib/layouts/registerLayoutBlocks.d.ts +9 -0
- package/dist/lib/layouts/registerLayoutBlocks.d.ts.map +1 -0
- package/dist/lib/layouts/registerLayoutBlocks.js +60 -0
- package/dist/lib/mappers/apiMapper.d.ts +66 -0
- package/dist/lib/mappers/apiMapper.d.ts.map +1 -0
- package/dist/lib/mappers/apiMapper.js +188 -0
- package/dist/lib/migration/index.d.ts +5 -0
- package/dist/lib/migration/index.d.ts.map +1 -0
- package/dist/lib/migration/index.js +4 -0
- package/dist/lib/migration/mapper.d.ts +37 -0
- package/dist/lib/migration/mapper.d.ts.map +1 -0
- package/dist/lib/migration/mapper.js +98 -0
- package/dist/lib/rich-text/RichTextEditor.d.ts +45 -0
- package/dist/lib/rich-text/RichTextEditor.d.ts.map +1 -0
- package/dist/lib/rich-text/RichTextEditor.js +556 -0
- package/dist/lib/rich-text/RichTextPreview.d.ts +16 -0
- package/dist/lib/rich-text/RichTextPreview.d.ts.map +1 -0
- package/dist/lib/rich-text/RichTextPreview.js +144 -0
- package/dist/lib/rich-text/index.d.ts +9 -0
- package/dist/lib/rich-text/index.d.ts.map +1 -0
- package/dist/lib/rich-text/index.js +6 -0
- package/dist/lib/utils/blockHelpers.d.ts +23 -0
- package/dist/lib/utils/blockHelpers.d.ts.map +1 -0
- package/dist/lib/utils/blockHelpers.js +65 -0
- package/dist/lib/utils/configValidation.d.ts +23 -0
- package/dist/lib/utils/configValidation.d.ts.map +1 -0
- package/dist/lib/utils/configValidation.js +111 -0
- package/dist/lib/utils/index.d.ts +7 -0
- package/dist/lib/utils/index.d.ts.map +1 -0
- package/dist/lib/utils/index.js +6 -0
- package/dist/lib/utils/slugify.d.ts +25 -0
- package/dist/lib/utils/slugify.d.ts.map +1 -0
- package/dist/lib/utils/slugify.js +65 -0
- package/dist/registry/BlockRegistry.d.ts +62 -0
- package/dist/registry/BlockRegistry.d.ts.map +1 -0
- package/dist/registry/BlockRegistry.js +112 -0
- package/dist/registry/index.d.ts +6 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +4 -0
- package/dist/state/EditorContext.d.ts +45 -0
- package/dist/state/EditorContext.d.ts.map +1 -0
- package/dist/state/EditorContext.js +215 -0
- package/dist/state/index.d.ts +7 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +6 -0
- package/dist/state/reducer.d.ts +11 -0
- package/dist/state/reducer.d.ts.map +1 -0
- package/dist/state/reducer.js +599 -0
- package/dist/state/types.d.ts +162 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +27 -0
- package/dist/types/block.d.ts +221 -0
- package/dist/types/block.d.ts.map +1 -0
- package/dist/types/block.js +6 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/post.d.ts +136 -0
- package/dist/types/post.d.ts.map +1 -0
- package/dist/types/post.js +5 -0
- package/dist/utils/client.d.ts +48 -0
- package/dist/utils/client.d.ts.map +1 -0
- package/dist/utils/client.js +77 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/views/CanvasEditor/BlockWrapper.d.ts +16 -0
- package/dist/views/CanvasEditor/BlockWrapper.d.ts.map +1 -0
- package/dist/views/CanvasEditor/BlockWrapper.js +285 -0
- package/dist/views/CanvasEditor/CanvasEditorView.d.ts +14 -0
- package/dist/views/CanvasEditor/CanvasEditorView.d.ts.map +1 -0
- package/dist/views/CanvasEditor/CanvasEditorView.js +215 -0
- package/dist/views/CanvasEditor/EditorBody.d.ts +22 -0
- package/dist/views/CanvasEditor/EditorBody.d.ts.map +1 -0
- package/dist/views/CanvasEditor/EditorBody.js +505 -0
- package/dist/views/CanvasEditor/EditorHeader.d.ts +18 -0
- package/dist/views/CanvasEditor/EditorHeader.d.ts.map +1 -0
- package/dist/views/CanvasEditor/EditorHeader.js +101 -0
- package/dist/views/CanvasEditor/LayoutContainer.d.ts +17 -0
- package/dist/views/CanvasEditor/LayoutContainer.d.ts.map +1 -0
- package/dist/views/CanvasEditor/LayoutContainer.js +222 -0
- package/dist/views/CanvasEditor/SaveConfirmationModal.d.ts +13 -0
- package/dist/views/CanvasEditor/SaveConfirmationModal.d.ts.map +1 -0
- package/dist/views/CanvasEditor/SaveConfirmationModal.js +78 -0
- package/dist/views/CanvasEditor/components/CustomBlockItem.d.ts +14 -0
- package/dist/views/CanvasEditor/components/CustomBlockItem.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/CustomBlockItem.js +44 -0
- package/dist/views/CanvasEditor/components/EditorCanvas.d.ts +29 -0
- package/dist/views/CanvasEditor/components/EditorCanvas.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/EditorCanvas.js +32 -0
- package/dist/views/CanvasEditor/components/EditorLibrary.d.ts +7 -0
- package/dist/views/CanvasEditor/components/EditorLibrary.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/EditorLibrary.js +25 -0
- package/dist/views/CanvasEditor/components/EditorSidebar.d.ts +13 -0
- package/dist/views/CanvasEditor/components/EditorSidebar.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/EditorSidebar.js +19 -0
- package/dist/views/CanvasEditor/components/ErrorBanner.d.ts +6 -0
- package/dist/views/CanvasEditor/components/ErrorBanner.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/ErrorBanner.js +8 -0
- package/dist/views/CanvasEditor/components/FeaturedMediaSection.d.ts +25 -0
- package/dist/views/CanvasEditor/components/FeaturedMediaSection.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/FeaturedMediaSection.js +199 -0
- package/dist/views/CanvasEditor/components/LibraryItem.d.ts +14 -0
- package/dist/views/CanvasEditor/components/LibraryItem.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/LibraryItem.js +43 -0
- package/dist/views/CanvasEditor/components/PrivacySettingsSection.d.ts +15 -0
- package/dist/views/CanvasEditor/components/PrivacySettingsSection.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/PrivacySettingsSection.js +70 -0
- package/dist/views/CanvasEditor/components/index.d.ts +21 -0
- package/dist/views/CanvasEditor/components/index.d.ts.map +1 -0
- package/dist/views/CanvasEditor/components/index.js +12 -0
- package/dist/views/CanvasEditor/hooks/index.d.ts +10 -0
- package/dist/views/CanvasEditor/hooks/index.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/index.js +9 -0
- package/dist/views/CanvasEditor/hooks/useHeroBlock.d.ts +8 -0
- package/dist/views/CanvasEditor/hooks/useHeroBlock.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/useHeroBlock.js +90 -0
- package/dist/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts +3 -0
- package/dist/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/useKeyboardShortcuts.js +119 -0
- package/dist/views/CanvasEditor/hooks/usePostLoader.d.ts +5 -0
- package/dist/views/CanvasEditor/hooks/usePostLoader.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/usePostLoader.js +32 -0
- package/dist/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts +2 -0
- package/dist/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/useRegisteredBlocks.js +47 -0
- package/dist/views/CanvasEditor/hooks/useUnsavedChanges.d.ts +25 -0
- package/dist/views/CanvasEditor/hooks/useUnsavedChanges.d.ts.map +1 -0
- package/dist/views/CanvasEditor/hooks/useUnsavedChanges.js +285 -0
- package/dist/views/CanvasEditor/index.d.ts +16 -0
- package/dist/views/CanvasEditor/index.d.ts.map +1 -0
- package/dist/views/CanvasEditor/index.js +9 -0
- package/dist/views/PostManager/EmptyState.d.ts +10 -0
- package/dist/views/PostManager/EmptyState.d.ts.map +1 -0
- package/dist/views/PostManager/EmptyState.js +12 -0
- package/dist/views/PostManager/PostActionsMenu.d.ts +12 -0
- package/dist/views/PostManager/PostActionsMenu.d.ts.map +1 -0
- package/dist/views/PostManager/PostActionsMenu.js +58 -0
- package/dist/views/PostManager/PostCards.d.ts +15 -0
- package/dist/views/PostManager/PostCards.d.ts.map +1 -0
- package/dist/views/PostManager/PostCards.js +77 -0
- package/dist/views/PostManager/PostFilters.d.ts +16 -0
- package/dist/views/PostManager/PostFilters.d.ts.map +1 -0
- package/dist/views/PostManager/PostFilters.js +10 -0
- package/dist/views/PostManager/PostManagerView.d.ts +11 -0
- package/dist/views/PostManager/PostManagerView.d.ts.map +1 -0
- package/dist/views/PostManager/PostManagerView.js +179 -0
- package/dist/views/PostManager/PostStats.d.ts +11 -0
- package/dist/views/PostManager/PostStats.d.ts.map +1 -0
- package/dist/views/PostManager/PostStats.js +46 -0
- package/dist/views/PostManager/PostTable.d.ts +15 -0
- package/dist/views/PostManager/PostTable.d.ts.map +1 -0
- package/dist/views/PostManager/PostTable.js +77 -0
- package/dist/views/PostManager/index.d.ts +12 -0
- package/dist/views/PostManager/index.d.ts.map +1 -0
- package/dist/views/PostManager/index.js +11 -0
- package/dist/views/Preview/PreviewBridgeView.d.ts +12 -0
- package/dist/views/Preview/PreviewBridgeView.d.ts.map +1 -0
- package/dist/views/Preview/PreviewBridgeView.js +11 -0
- package/dist/views/Preview/index.d.ts +6 -0
- package/dist/views/Preview/index.d.ts.map +1 -0
- package/dist/views/Preview/index.js +4 -0
- package/dist/views/Settings/SettingsView.d.ts +10 -0
- package/dist/views/Settings/SettingsView.d.ts.map +1 -0
- package/dist/views/Settings/SettingsView.js +113 -0
- package/dist/views/Settings/index.d.ts +6 -0
- package/dist/views/Settings/index.d.ts.map +1 -0
- package/dist/views/Settings/index.js +4 -0
- package/dist/views/SlugSEO/SlugSEOManagerView.d.ts +12 -0
- package/dist/views/SlugSEO/SlugSEOManagerView.d.ts.map +1 -0
- package/dist/views/SlugSEO/SlugSEOManagerView.js +11 -0
- package/dist/views/SlugSEO/index.d.ts +6 -0
- package/dist/views/SlugSEO/index.d.ts.map +1 -0
- package/dist/views/SlugSEO/index.js +4 -0
- package/package.json +4 -4
- package/src/hooks/index.d.ts +8 -0
- package/src/hooks/index.d.ts.map +1 -0
- package/src/hooks/index.js +7 -0
- package/src/hooks/useBlog.d.ts +31 -0
- package/src/hooks/useBlog.d.ts.map +1 -0
- package/src/hooks/useBlog.js +57 -0
- package/src/hooks/useBlogs.d.ts +39 -0
- package/src/hooks/useBlogs.d.ts.map +1 -0
- package/src/hooks/useBlogs.js +82 -0
- package/src/hooks/useCategories.d.ts +9 -0
- package/src/hooks/useCategories.d.ts.map +1 -0
- package/src/hooks/useCategories.js +70 -0
- package/src/index.d.ts +55 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +228 -0
- package/src/init.d.ts +40 -0
- package/src/init.d.ts.map +1 -0
- package/src/init.js +41 -0
- package/src/lib/blocks/BlockRenderer.d.ts +54 -0
- package/src/lib/blocks/BlockRenderer.d.ts.map +1 -0
- package/src/lib/blocks/BlockRenderer.js +54 -0
- package/src/lib/config-storage.d.ts +30 -0
- package/src/lib/config-storage.d.ts.map +1 -0
- package/src/lib/config-storage.js +31 -0
- package/src/lib/layouts/blocks/ColumnsBlock.d.ts +25 -0
- package/src/lib/layouts/blocks/ColumnsBlock.d.ts.map +1 -0
- package/src/lib/layouts/blocks/ColumnsBlock.js +182 -0
- package/src/lib/layouts/blocks/SectionBlock.d.ts +25 -0
- package/src/lib/layouts/blocks/SectionBlock.d.ts.map +1 -0
- package/src/lib/layouts/blocks/SectionBlock.js +44 -0
- package/src/lib/layouts/index.d.ts +23 -0
- package/src/lib/layouts/index.d.ts.map +1 -0
- package/src/lib/layouts/index.js +45 -0
- package/src/lib/layouts/registerLayoutBlocks.d.ts +9 -0
- package/src/lib/layouts/registerLayoutBlocks.d.ts.map +1 -0
- package/src/lib/layouts/registerLayoutBlocks.js +60 -0
- package/src/lib/mappers/apiMapper.d.ts +66 -0
- package/src/lib/mappers/apiMapper.d.ts.map +1 -0
- package/src/lib/mappers/apiMapper.js +191 -0
- package/src/lib/rich-text/RichTextEditor.d.ts +45 -0
- package/src/lib/rich-text/RichTextEditor.d.ts.map +1 -0
- package/src/lib/rich-text/RichTextEditor.js +564 -0
- package/src/lib/rich-text/RichTextPreview.d.ts +16 -0
- package/src/lib/rich-text/RichTextPreview.d.ts.map +1 -0
- package/src/lib/rich-text/RichTextPreview.js +144 -0
- package/src/lib/rich-text/index.d.ts +9 -0
- package/src/lib/rich-text/index.d.ts.map +1 -0
- package/src/lib/rich-text/index.js +6 -0
- package/src/lib/utils/blockHelpers.d.ts +23 -0
- package/src/lib/utils/blockHelpers.d.ts.map +1 -0
- package/src/lib/utils/blockHelpers.js +65 -0
- package/src/lib/utils/configValidation.d.ts +23 -0
- package/src/lib/utils/configValidation.d.ts.map +1 -0
- package/src/lib/utils/configValidation.js +113 -0
- package/src/registry/BlockRegistry.d.ts +62 -0
- package/src/registry/BlockRegistry.d.ts.map +1 -0
- package/src/registry/BlockRegistry.js +112 -0
- package/src/registry/index.d.ts +6 -0
- package/src/registry/index.d.ts.map +1 -0
- package/src/registry/index.js +4 -0
- package/src/state/EditorContext.d.ts +45 -0
- package/src/state/EditorContext.d.ts.map +1 -0
- package/src/state/EditorContext.js +215 -0
- package/src/state/index.d.ts +7 -0
- package/src/state/index.d.ts.map +1 -0
- package/src/state/index.js +6 -0
- package/src/state/reducer.d.ts +11 -0
- package/src/state/reducer.d.ts.map +1 -0
- package/src/state/reducer.js +443 -0
- package/src/state/types.d.ts +162 -0
- package/src/state/types.d.ts.map +1 -0
- package/src/state/types.js +27 -0
- package/src/types/block.d.ts +221 -0
- package/src/types/block.d.ts.map +1 -0
- package/src/types/block.js +6 -0
- package/src/types/index.d.ts +8 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.js +5 -0
- package/src/types/post.d.ts +136 -0
- package/src/types/post.d.ts.map +1 -0
- package/src/types/post.js +5 -0
- package/src/utils/client.d.ts +48 -0
- package/src/utils/client.d.ts.map +1 -0
- package/src/utils/client.js +77 -0
- package/src/views/CanvasEditor/BlockWrapper.d.ts +16 -0
- package/src/views/CanvasEditor/BlockWrapper.d.ts.map +1 -0
- package/src/views/CanvasEditor/BlockWrapper.js +276 -0
- package/src/views/CanvasEditor/CanvasEditorView.d.ts +14 -0
- package/src/views/CanvasEditor/CanvasEditorView.d.ts.map +1 -0
- package/src/views/CanvasEditor/CanvasEditorView.js +209 -0
- package/src/views/CanvasEditor/EditorBody.d.ts +22 -0
- package/src/views/CanvasEditor/EditorBody.d.ts.map +1 -0
- package/src/views/CanvasEditor/EditorBody.js +505 -0
- package/src/views/CanvasEditor/EditorHeader.d.ts +18 -0
- package/src/views/CanvasEditor/EditorHeader.d.ts.map +1 -0
- package/src/views/CanvasEditor/EditorHeader.js +101 -0
- package/src/views/CanvasEditor/LayoutContainer.d.ts +17 -0
- package/src/views/CanvasEditor/LayoutContainer.d.ts.map +1 -0
- package/src/views/CanvasEditor/LayoutContainer.js +222 -0
- package/src/views/CanvasEditor/SaveConfirmationModal.d.ts +13 -0
- package/src/views/CanvasEditor/SaveConfirmationModal.d.ts.map +1 -0
- package/src/views/CanvasEditor/SaveConfirmationModal.js +78 -0
- package/src/views/CanvasEditor/components/CustomBlockItem.d.ts +14 -0
- package/src/views/CanvasEditor/components/CustomBlockItem.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/CustomBlockItem.js +44 -0
- package/src/views/CanvasEditor/components/EditorCanvas.d.ts +29 -0
- package/src/views/CanvasEditor/components/EditorCanvas.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/EditorCanvas.js +32 -0
- package/src/views/CanvasEditor/components/EditorLibrary.d.ts +7 -0
- package/src/views/CanvasEditor/components/EditorLibrary.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/EditorLibrary.js +25 -0
- package/src/views/CanvasEditor/components/EditorSidebar.d.ts +13 -0
- package/src/views/CanvasEditor/components/EditorSidebar.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/EditorSidebar.js +20 -0
- package/src/views/CanvasEditor/components/ErrorBanner.d.ts +6 -0
- package/src/views/CanvasEditor/components/ErrorBanner.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/ErrorBanner.js +8 -0
- package/src/views/CanvasEditor/components/FeaturedMediaSection.d.ts +25 -0
- package/src/views/CanvasEditor/components/FeaturedMediaSection.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/FeaturedMediaSection.js +182 -0
- package/src/views/CanvasEditor/components/LibraryItem.d.ts +14 -0
- package/src/views/CanvasEditor/components/LibraryItem.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/LibraryItem.js +43 -0
- package/src/views/CanvasEditor/components/PrivacySettingsSection.d.ts +15 -0
- package/src/views/CanvasEditor/components/PrivacySettingsSection.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/PrivacySettingsSection.js +63 -0
- package/src/views/CanvasEditor/components/index.d.ts +21 -0
- package/src/views/CanvasEditor/components/index.d.ts.map +1 -0
- package/src/views/CanvasEditor/components/index.js +12 -0
- package/src/views/CanvasEditor/hooks/index.d.ts +10 -0
- package/src/views/CanvasEditor/hooks/index.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/index.js +9 -0
- package/src/views/CanvasEditor/hooks/useHeroBlock.d.ts +8 -0
- package/src/views/CanvasEditor/hooks/useHeroBlock.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/useHeroBlock.js +79 -0
- package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts +3 -0
- package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.js +114 -0
- package/src/views/CanvasEditor/hooks/usePostLoader.d.ts +5 -0
- package/src/views/CanvasEditor/hooks/usePostLoader.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/usePostLoader.js +32 -0
- package/src/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts +2 -0
- package/src/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/useRegisteredBlocks.js +47 -0
- package/src/views/CanvasEditor/hooks/useUnsavedChanges.d.ts +25 -0
- package/src/views/CanvasEditor/hooks/useUnsavedChanges.d.ts.map +1 -0
- package/src/views/CanvasEditor/hooks/useUnsavedChanges.js +285 -0
- package/src/views/CanvasEditor/index.d.ts +16 -0
- package/src/views/CanvasEditor/index.d.ts.map +1 -0
- package/src/views/CanvasEditor/index.js +9 -0
- package/src/views/PostManager/EmptyState.d.ts +10 -0
- package/src/views/PostManager/EmptyState.d.ts.map +1 -0
- package/src/views/PostManager/EmptyState.js +12 -0
- package/src/views/PostManager/PostActionsMenu.d.ts +12 -0
- package/src/views/PostManager/PostActionsMenu.d.ts.map +1 -0
- package/src/views/PostManager/PostActionsMenu.js +58 -0
- package/src/views/PostManager/PostCards.d.ts +15 -0
- package/src/views/PostManager/PostCards.d.ts.map +1 -0
- package/src/views/PostManager/PostCards.js +79 -0
- package/src/views/PostManager/PostFilters.d.ts +16 -0
- package/src/views/PostManager/PostFilters.d.ts.map +1 -0
- package/src/views/PostManager/PostFilters.js +10 -0
- package/src/views/PostManager/PostManagerView.d.ts +11 -0
- package/src/views/PostManager/PostManagerView.d.ts.map +1 -0
- package/src/views/PostManager/PostManagerView.js +174 -0
- package/src/views/PostManager/PostStats.d.ts +11 -0
- package/src/views/PostManager/PostStats.d.ts.map +1 -0
- package/src/views/PostManager/PostStats.js +46 -0
- package/src/views/PostManager/PostTable.d.ts +15 -0
- package/src/views/PostManager/PostTable.d.ts.map +1 -0
- package/src/views/PostManager/PostTable.js +79 -0
- package/src/views/PostManager/index.d.ts +12 -0
- package/src/views/PostManager/index.d.ts.map +1 -0
- package/src/views/PostManager/index.js +11 -0
- package/src/views/Preview/PreviewBridgeView.d.ts +12 -0
- package/src/views/Preview/PreviewBridgeView.d.ts.map +1 -0
- package/src/views/Preview/PreviewBridgeView.js +11 -0
- package/src/views/Preview/index.d.ts +6 -0
- package/src/views/Preview/index.d.ts.map +1 -0
- package/src/views/Preview/index.js +4 -0
- package/src/views/Settings/SettingsView.d.ts +10 -0
- package/src/views/Settings/SettingsView.d.ts.map +1 -0
- package/src/views/Settings/SettingsView.js +111 -0
- package/src/views/Settings/index.d.ts +6 -0
- package/src/views/Settings/index.d.ts.map +1 -0
- package/src/views/Settings/index.js +4 -0
- package/src/views/SlugSEO/SlugSEOManagerView.d.ts +12 -0
- package/src/views/SlugSEO/SlugSEOManagerView.d.ts.map +1 -0
- package/src/views/SlugSEO/SlugSEOManagerView.js +11 -0
- package/src/views/SlugSEO/index.d.ts +6 -0
- package/src/views/SlugSEO/index.d.ts.map +1 -0
- package/src/views/SlugSEO/index.js +4 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to fetch categories from existing blog posts
|
|
3
|
+
* Extracts categories from Hero blocks in all posts
|
|
4
|
+
*/
|
|
5
|
+
'use client';
|
|
6
|
+
import { useState, useEffect } from 'react';
|
|
7
|
+
export function useCategories() {
|
|
8
|
+
const [categories, setCategories] = useState([]);
|
|
9
|
+
const [loading, setLoading] = useState(true);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const fetchCategories = async () => {
|
|
12
|
+
try {
|
|
13
|
+
const categorySet = new Set();
|
|
14
|
+
// 1. Fetch from categories endpoint (legacy categoryTags.category)
|
|
15
|
+
try {
|
|
16
|
+
const categoriesResponse = await fetch('/api/plugin-blog/categories');
|
|
17
|
+
if (categoriesResponse.ok) {
|
|
18
|
+
const categoriesData = await categoriesResponse.json();
|
|
19
|
+
if (Array.isArray(categoriesData.categories)) {
|
|
20
|
+
categoriesData.categories.forEach((cat) => {
|
|
21
|
+
if (cat && cat.trim()) {
|
|
22
|
+
categorySet.add(cat.trim());
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
// Categories endpoint not available, continue
|
|
30
|
+
}
|
|
31
|
+
// 2. Fetch all blog posts and extract categories from Hero blocks
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch('/api/plugin-blog?admin=true&limit=1000');
|
|
34
|
+
if (response.ok) {
|
|
35
|
+
const data = await response.json();
|
|
36
|
+
const posts = Array.isArray(data.blogs) ? data.blogs : (Array.isArray(data) ? data : []);
|
|
37
|
+
posts.forEach((post) => {
|
|
38
|
+
if (post.blocks && Array.isArray(post.blocks)) {
|
|
39
|
+
// Find Hero block
|
|
40
|
+
const heroBlock = post.blocks.find((block) => block.type === 'hero');
|
|
41
|
+
if (heroBlock && heroBlock.data && heroBlock.data.category) {
|
|
42
|
+
const category = heroBlock.data.category.trim();
|
|
43
|
+
if (category) {
|
|
44
|
+
categorySet.add(category);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
console.error('Failed to fetch posts for categories:', e);
|
|
53
|
+
}
|
|
54
|
+
// Convert to sorted array
|
|
55
|
+
const sortedCategories = Array.from(categorySet).sort();
|
|
56
|
+
setCategories(sortedCategories);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error('Failed to fetch categories:', error);
|
|
60
|
+
// Fallback to empty array
|
|
61
|
+
setCategories([]);
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
setLoading(false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
fetchCategories();
|
|
68
|
+
}, []);
|
|
69
|
+
return { categories, loading };
|
|
70
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Blog - Main Entry Point
|
|
3
|
+
* Block-Based Blog Management System
|
|
4
|
+
* Multi-Tenant Architecture: Accepts custom blocks from client applications
|
|
5
|
+
*/
|
|
6
|
+
import { ClientBlockDefinition } from './types/block';
|
|
7
|
+
/**
|
|
8
|
+
* Plugin Props Interface
|
|
9
|
+
* Matches the PluginProps from @jhits/jhits-dashboard
|
|
10
|
+
*/
|
|
11
|
+
export interface PluginProps {
|
|
12
|
+
subPath: string[];
|
|
13
|
+
siteId: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
/** Custom blocks from client application (optional, can also come from window.__JHITS_PLUGIN_PROPS__) */
|
|
16
|
+
customBlocks?: ClientBlockDefinition[];
|
|
17
|
+
/** Enable dark mode for content area and wrappers (default: true) */
|
|
18
|
+
darkMode?: boolean;
|
|
19
|
+
/** Background colors for the editor */
|
|
20
|
+
backgroundColors?: {
|
|
21
|
+
/** Background color for light mode (REQUIRED) */
|
|
22
|
+
light: string;
|
|
23
|
+
/** Background color for dark mode (optional) */
|
|
24
|
+
dark?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Main Router Component
|
|
29
|
+
* Handles routing within the blog plugin
|
|
30
|
+
*
|
|
31
|
+
* Client Handshake:
|
|
32
|
+
* - Client apps can pass customBlocks via props
|
|
33
|
+
* - Or via window.__JHITS_PLUGIN_PROPS__['plugin-blog'].customBlocks
|
|
34
|
+
* - The EditorProvider will automatically register these blocks
|
|
35
|
+
*/
|
|
36
|
+
export default function BlogPlugin(props: PluginProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export { BlogPlugin as Index };
|
|
38
|
+
export type { Block, BlockTypeDefinition, ClientBlockDefinition, RichTextFormattingConfig, BlockEditProps, BlockPreviewProps, IBlockComponent, } from './types';
|
|
39
|
+
export type { SEOMetadata, PublicationData, PostStatus, PostMetadata, BlogPost, PostListItem, PostFilterOptions, } from './types/post';
|
|
40
|
+
export { initBlogPlugin } from './init';
|
|
41
|
+
export type { BlogPluginConfig } from './init';
|
|
42
|
+
export { RichTextEditor, RichTextPreview } from './lib/rich-text';
|
|
43
|
+
export type { RichTextEditorProps, RichTextPreviewProps } from './lib/rich-text';
|
|
44
|
+
export { useBlogs, useBlog } from './hooks';
|
|
45
|
+
export type { UseBlogsOptions, UseBlogsResult, UseBlogOptions, UseBlogResult } from './hooks';
|
|
46
|
+
export { fetchBlogs, fetchBlog } from './utils/client';
|
|
47
|
+
export type { FetchBlogsOptions, FetchBlogsResult, FetchBlogOptions } from './utils/client';
|
|
48
|
+
export { BlockRenderer, BlocksRenderer } from './lib/blocks/BlockRenderer';
|
|
49
|
+
export { blockRegistry } from './registry';
|
|
50
|
+
export { registerLayoutBlocks } from './lib/layouts/registerLayoutBlocks';
|
|
51
|
+
export { getPluginConfig, savePluginConfig } from './lib/config-storage';
|
|
52
|
+
export { EditorProvider, useEditor } from './state/EditorContext';
|
|
53
|
+
export type { EditorProviderProps, EditorState, EditorContextValue } from './state';
|
|
54
|
+
export { useCategories } from './hooks/useCategories';
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAStD;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,yGAAyG;IACzG,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE;QACf,iDAAiD;QACjD,KAAK,EAAE,MAAM,CAAC;QACd,gDAAgD;QAChD,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,WAAW,2CA4NpD;AAID,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,CAAC;AAG/B,YAAY,EACR,KAAK,EACL,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAClB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,iBAAiB,GACpB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAGjF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG9F,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Blog - Main Entry Point
|
|
3
|
+
* Block-Based Blog Management System
|
|
4
|
+
* Multi-Tenant Architecture: Accepts custom blocks from client applications
|
|
5
|
+
*/
|
|
6
|
+
'use client';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { useMemo, useEffect } from 'react';
|
|
9
|
+
import { EditorProvider } from './state/EditorContext';
|
|
10
|
+
import { PostManagerView } from './views/PostManager';
|
|
11
|
+
import { CanvasEditorView } from './views/CanvasEditor';
|
|
12
|
+
import { editorStateToAPI } from './lib/mappers/apiMapper';
|
|
13
|
+
import { SlugSEOManagerView } from './views/SlugSEO';
|
|
14
|
+
import { PreviewBridgeView } from './views/Preview';
|
|
15
|
+
import { SettingsView } from './views/Settings';
|
|
16
|
+
import { useHeroBlockValidation, findHeroBlock } from './lib/utils/configValidation';
|
|
17
|
+
/**
|
|
18
|
+
* Main Router Component
|
|
19
|
+
* Handles routing within the blog plugin
|
|
20
|
+
*
|
|
21
|
+
* Client Handshake:
|
|
22
|
+
* - Client apps can pass customBlocks via props
|
|
23
|
+
* - Or via window.__JHITS_PLUGIN_PROPS__['plugin-blog'].customBlocks
|
|
24
|
+
* - The EditorProvider will automatically register these blocks
|
|
25
|
+
*/
|
|
26
|
+
export default function BlogPlugin(props) {
|
|
27
|
+
const { subPath, siteId, locale, customBlocks: propsCustomBlocks, darkMode: propsDarkMode, backgroundColors: propsBackgroundColors } = props;
|
|
28
|
+
// Get custom blocks from props or window global (client app injection point)
|
|
29
|
+
const customBlocks = useMemo(() => {
|
|
30
|
+
// First, try props
|
|
31
|
+
if (propsCustomBlocks && propsCustomBlocks.length > 0) {
|
|
32
|
+
return propsCustomBlocks;
|
|
33
|
+
}
|
|
34
|
+
// Fallback to window global (for client app injection)
|
|
35
|
+
if (typeof window !== 'undefined' && window.__JHITS_PLUGIN_PROPS__) {
|
|
36
|
+
const pluginProps = window.__JHITS_PLUGIN_PROPS__['plugin-blog'];
|
|
37
|
+
if (pluginProps?.customBlocks) {
|
|
38
|
+
return pluginProps.customBlocks;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
}, [propsCustomBlocks]);
|
|
43
|
+
// Get dark mode setting from props, localStorage (dev settings), or window global
|
|
44
|
+
// Priority: localStorage (dev) > props > window global > default
|
|
45
|
+
const darkMode = useMemo(() => {
|
|
46
|
+
// First, check localStorage for dev settings (highest priority for dev)
|
|
47
|
+
if (typeof window !== 'undefined') {
|
|
48
|
+
try {
|
|
49
|
+
const saved = localStorage.getItem('__JHITS_PLUGIN_BLOG_CONFIG__');
|
|
50
|
+
if (saved) {
|
|
51
|
+
const config = JSON.parse(saved);
|
|
52
|
+
if (config.darkMode !== undefined) {
|
|
53
|
+
return config.darkMode;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
// Ignore localStorage errors
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Then try props
|
|
62
|
+
if (propsDarkMode !== undefined) {
|
|
63
|
+
return propsDarkMode;
|
|
64
|
+
}
|
|
65
|
+
// Fallback to window global if prop not provided
|
|
66
|
+
if (typeof window !== 'undefined' && window.__JHITS_PLUGIN_PROPS__) {
|
|
67
|
+
const pluginProps = window.__JHITS_PLUGIN_PROPS__['plugin-blog'];
|
|
68
|
+
if (pluginProps?.darkMode !== undefined) {
|
|
69
|
+
return pluginProps.darkMode;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true; // Default to dark mode enabled
|
|
73
|
+
}, [propsDarkMode]);
|
|
74
|
+
// Get background colors from props, localStorage (dev settings), or window global
|
|
75
|
+
// Priority: localStorage (dev) > props > window global
|
|
76
|
+
const backgroundColors = useMemo(() => {
|
|
77
|
+
// First, check localStorage for dev settings (highest priority for dev)
|
|
78
|
+
if (typeof window !== 'undefined') {
|
|
79
|
+
try {
|
|
80
|
+
const saved = localStorage.getItem('__JHITS_PLUGIN_BLOG_CONFIG__');
|
|
81
|
+
if (saved) {
|
|
82
|
+
const config = JSON.parse(saved);
|
|
83
|
+
if (config.backgroundColors) {
|
|
84
|
+
return config.backgroundColors;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
// Ignore localStorage errors
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// Then try props
|
|
93
|
+
if (propsBackgroundColors) {
|
|
94
|
+
return propsBackgroundColors;
|
|
95
|
+
}
|
|
96
|
+
// Fallback to window global
|
|
97
|
+
if (typeof window !== 'undefined' && window.__JHITS_PLUGIN_PROPS__) {
|
|
98
|
+
const pluginProps = window.__JHITS_PLUGIN_PROPS__['plugin-blog'];
|
|
99
|
+
if (pluginProps?.backgroundColors) {
|
|
100
|
+
return pluginProps.backgroundColors;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
}, [propsBackgroundColors]);
|
|
105
|
+
const route = subPath[0] || 'posts';
|
|
106
|
+
// Validate hero block configuration (only checks when needed)
|
|
107
|
+
useHeroBlockValidation(route, customBlocks, propsCustomBlocks);
|
|
108
|
+
// Get hero block definition for logging/debugging (only for routes that need it)
|
|
109
|
+
const heroBlockDefinition = useMemo(() => {
|
|
110
|
+
const needsHeroBlock = route === 'editor' || route === 'new' || route === 'preview';
|
|
111
|
+
return needsHeroBlock ? findHeroBlock(customBlocks) : undefined;
|
|
112
|
+
}, [customBlocks, route]);
|
|
113
|
+
// Listen for config updates from settings screen
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (typeof window === 'undefined')
|
|
116
|
+
return;
|
|
117
|
+
const handleConfigUpdate = () => {
|
|
118
|
+
// Reload page to apply changes (simplest way to ensure all components pick up new values)
|
|
119
|
+
window.location.reload();
|
|
120
|
+
};
|
|
121
|
+
window.addEventListener('blog-plugin-config-updated', handleConfigUpdate);
|
|
122
|
+
return () => {
|
|
123
|
+
window.removeEventListener('blog-plugin-config-updated', handleConfigUpdate);
|
|
124
|
+
};
|
|
125
|
+
}, []);
|
|
126
|
+
if (heroBlockDefinition !== undefined) {
|
|
127
|
+
console.log('[BlogPlugin] Hero block definition:', heroBlockDefinition ? 'found' : 'not found (REQUIRED)');
|
|
128
|
+
}
|
|
129
|
+
// Route to appropriate view
|
|
130
|
+
switch (route) {
|
|
131
|
+
case 'posts':
|
|
132
|
+
return _jsx(PostManagerView, { siteId: siteId, locale: locale });
|
|
133
|
+
case 'editor':
|
|
134
|
+
const postId = subPath[1]; // This is actually the slug, not the ID
|
|
135
|
+
return (_jsx(EditorProvider, { customBlocks: customBlocks, darkMode: darkMode, backgroundColors: backgroundColors, onSave: async (state, heroBlock) => {
|
|
136
|
+
// Save to API - update existing post
|
|
137
|
+
// Use the route postId (original slug) to identify which blog to update
|
|
138
|
+
// If route postId is missing, use state.slug or state.postId as fallback
|
|
139
|
+
const originalSlug = postId || state.slug || state.postId;
|
|
140
|
+
if (!originalSlug) {
|
|
141
|
+
throw new Error('Cannot save: no post identifier available. Please reload the page.');
|
|
142
|
+
}
|
|
143
|
+
console.log('[BlogPlugin] Saving post with slug:', originalSlug);
|
|
144
|
+
const apiData = editorStateToAPI(state, undefined, heroBlock);
|
|
145
|
+
const response = await fetch(`/api/plugin-blog/${originalSlug}`, {
|
|
146
|
+
method: 'PUT',
|
|
147
|
+
headers: { 'Content-Type': 'application/json' },
|
|
148
|
+
credentials: 'include', // Include cookies for authentication
|
|
149
|
+
body: JSON.stringify(apiData),
|
|
150
|
+
});
|
|
151
|
+
if (!response.ok) {
|
|
152
|
+
const error = await response.json();
|
|
153
|
+
console.error('[BlogPlugin] Save failed:', {
|
|
154
|
+
status: response.status,
|
|
155
|
+
statusText: response.statusText,
|
|
156
|
+
error,
|
|
157
|
+
missingFields: error.missingFields,
|
|
158
|
+
});
|
|
159
|
+
// Provide more detailed error message if available
|
|
160
|
+
const errorMessage = error.message || error.error || 'Failed to save post';
|
|
161
|
+
const missingFieldsMsg = error.missingFields && error.missingFields.length > 0
|
|
162
|
+
? ` Missing: ${error.missingFields.join(', ')}`
|
|
163
|
+
: '';
|
|
164
|
+
throw new Error(errorMessage + missingFieldsMsg);
|
|
165
|
+
}
|
|
166
|
+
const result = await response.json();
|
|
167
|
+
// If the slug changed, update the URL
|
|
168
|
+
if (result.slug && result.slug !== originalSlug) {
|
|
169
|
+
window.history.replaceState(null, '', `/dashboard/blog/editor/${result.slug}`);
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}, children: _jsx(CanvasEditorView, { postId: postId, siteId: siteId, locale: locale, darkMode: darkMode, backgroundColors: backgroundColors }) }));
|
|
173
|
+
case 'new':
|
|
174
|
+
return (_jsx(EditorProvider, { customBlocks: customBlocks, darkMode: darkMode, backgroundColors: backgroundColors, onSave: async (state) => {
|
|
175
|
+
// Save to API - create new post
|
|
176
|
+
const apiData = editorStateToAPI(state);
|
|
177
|
+
const response = await fetch('/api/plugin-blog/new', {
|
|
178
|
+
method: 'POST',
|
|
179
|
+
headers: { 'Content-Type': 'application/json' },
|
|
180
|
+
credentials: 'include', // Include cookies for authentication
|
|
181
|
+
body: JSON.stringify(apiData),
|
|
182
|
+
});
|
|
183
|
+
if (!response.ok) {
|
|
184
|
+
const error = await response.json();
|
|
185
|
+
throw new Error(error.message || 'Failed to create post');
|
|
186
|
+
}
|
|
187
|
+
const result = await response.json();
|
|
188
|
+
// Update the URL to the new post's slug
|
|
189
|
+
if (result.slug) {
|
|
190
|
+
window.history.replaceState(null, '', `/dashboard/blog/editor/${result.slug}`);
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
}, children: _jsx(CanvasEditorView, { siteId: siteId, locale: locale, darkMode: darkMode, backgroundColors: backgroundColors }) }));
|
|
194
|
+
case 'seo':
|
|
195
|
+
const seoPostId = subPath[1];
|
|
196
|
+
return _jsx(SlugSEOManagerView, { postId: seoPostId, siteId: siteId, locale: locale });
|
|
197
|
+
case 'preview':
|
|
198
|
+
const previewPostId = subPath[1];
|
|
199
|
+
return _jsx(PreviewBridgeView, { postId: previewPostId, siteId: siteId, locale: locale });
|
|
200
|
+
case 'settings':
|
|
201
|
+
case 'install':
|
|
202
|
+
return _jsx(SettingsView, { siteId: siteId, locale: locale });
|
|
203
|
+
default:
|
|
204
|
+
return _jsx(PostManagerView, { siteId: siteId, locale: locale });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Export for use as default
|
|
208
|
+
export { BlogPlugin as Index };
|
|
209
|
+
// Export initialization utility for easy setup
|
|
210
|
+
export { initBlogPlugin } from './init';
|
|
211
|
+
// Export rich text components for client applications
|
|
212
|
+
export { RichTextEditor, RichTextPreview } from './lib/rich-text';
|
|
213
|
+
// Export hooks for client applications
|
|
214
|
+
export { useBlogs, useBlog } from './hooks';
|
|
215
|
+
// Export client utilities
|
|
216
|
+
export { fetchBlogs, fetchBlog } from './utils/client';
|
|
217
|
+
// Export block rendering components
|
|
218
|
+
export { BlockRenderer, BlocksRenderer } from './lib/blocks/BlockRenderer';
|
|
219
|
+
// Export block registry
|
|
220
|
+
export { blockRegistry } from './registry';
|
|
221
|
+
// Export layout block registration
|
|
222
|
+
export { registerLayoutBlocks } from './lib/layouts/registerLayoutBlocks';
|
|
223
|
+
// Export config storage utilities
|
|
224
|
+
export { getPluginConfig, savePluginConfig } from './lib/config-storage';
|
|
225
|
+
// Export editor state management
|
|
226
|
+
export { EditorProvider, useEditor } from './state/EditorContext';
|
|
227
|
+
// Export hooks
|
|
228
|
+
export { useCategories } from './hooks/useCategories';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Blog - Server-Only Entry Point
|
|
4
|
+
* This file exports only server-side API handlers
|
|
5
|
+
* Used by the dynamic plugin router via @jhits/plugin-blog/server
|
|
6
|
+
*
|
|
7
|
+
* Note: This file is server-only (no 'use server' needed - that's only for Server Actions)
|
|
8
|
+
*/
|
|
9
|
+
export { handleBlogApi as handleApi } from './api/router';
|
|
10
|
+
export { handleBlogApi } from './api/router';
|
|
11
|
+
export type { BlogApiRouterConfig } from './api/router';
|
|
12
|
+
//# sourceMappingURL=index.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Blog - Server-Only Entry Point
|
|
4
|
+
* This file exports only server-side API handlers
|
|
5
|
+
* Used by the dynamic plugin router via @jhits/plugin-blog/server
|
|
6
|
+
*
|
|
7
|
+
* Note: This file is server-only (no 'use server' needed - that's only for Server Actions)
|
|
8
|
+
*/
|
|
9
|
+
export { handleBlogApi as handleApi } from './api/router';
|
|
10
|
+
export { handleBlogApi } from './api/router'; // Keep original export for backward compatibility
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blog Plugin Initialization Utility
|
|
3
|
+
*
|
|
4
|
+
* Simple function to initialize the blog plugin with client configuration.
|
|
5
|
+
* Call this once in your app (e.g., in a script tag or root layout) to configure
|
|
6
|
+
* the blog plugin without needing a React component.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { initBlogPlugin } from '@jhits/plugin-blog/init';
|
|
11
|
+
* import { blogConfig } from '@/plugins/blog-config';
|
|
12
|
+
*
|
|
13
|
+
* // Call once when your app loads
|
|
14
|
+
* initBlogPlugin(blogConfig);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import type { ClientBlockDefinition } from './types/block';
|
|
18
|
+
export interface BlogPluginConfig {
|
|
19
|
+
/** Custom blocks available in the editor */
|
|
20
|
+
customBlocks?: ClientBlockDefinition[];
|
|
21
|
+
/** Dark mode setting for the editor content area and wrappers (default: true) */
|
|
22
|
+
darkMode?: boolean;
|
|
23
|
+
/** Background colors for the editor */
|
|
24
|
+
backgroundColors?: {
|
|
25
|
+
/** Background color for light mode (REQUIRED) - CSS color value (hex, rgb, or named color) */
|
|
26
|
+
light: string;
|
|
27
|
+
/** Background color for dark mode (optional) - CSS color value (hex, rgb, or named color) */
|
|
28
|
+
dark?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Initialize the blog plugin with client configuration
|
|
33
|
+
*
|
|
34
|
+
* This function sets up the window global that the plugin reads from automatically.
|
|
35
|
+
* Call this once when your app loads, before the plugin is rendered.
|
|
36
|
+
*
|
|
37
|
+
* @param config - Blog plugin configuration (customBlocks, darkMode, etc.)
|
|
38
|
+
*/
|
|
39
|
+
export declare function initBlogPlugin(config: BlogPluginConfig): void;
|
|
40
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC7B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE;QACf,8FAA8F;QAC9F,KAAK,EAAE,MAAM,CAAC;QACd,6FAA6F;QAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAiB7D"}
|
package/dist/init.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blog Plugin Initialization Utility
|
|
3
|
+
*
|
|
4
|
+
* Simple function to initialize the blog plugin with client configuration.
|
|
5
|
+
* Call this once in your app (e.g., in a script tag or root layout) to configure
|
|
6
|
+
* the blog plugin without needing a React component.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { initBlogPlugin } from '@jhits/plugin-blog/init';
|
|
11
|
+
* import { blogConfig } from '@/plugins/blog-config';
|
|
12
|
+
*
|
|
13
|
+
* // Call once when your app loads
|
|
14
|
+
* initBlogPlugin(blogConfig);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
'use client';
|
|
18
|
+
/**
|
|
19
|
+
* Initialize the blog plugin with client configuration
|
|
20
|
+
*
|
|
21
|
+
* This function sets up the window global that the plugin reads from automatically.
|
|
22
|
+
* Call this once when your app loads, before the plugin is rendered.
|
|
23
|
+
*
|
|
24
|
+
* @param config - Blog plugin configuration (customBlocks, darkMode, etc.)
|
|
25
|
+
*/
|
|
26
|
+
export function initBlogPlugin(config) {
|
|
27
|
+
if (typeof window === 'undefined') {
|
|
28
|
+
// Server-side: no-op
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// Initialize the global plugin props object if it doesn't exist
|
|
32
|
+
if (!window.__JHITS_PLUGIN_PROPS__) {
|
|
33
|
+
window.__JHITS_PLUGIN_PROPS__ = {};
|
|
34
|
+
}
|
|
35
|
+
// Set blog plugin configuration
|
|
36
|
+
window.__JHITS_PLUGIN_PROPS__['plugin-blog'] = {
|
|
37
|
+
customBlocks: config.customBlocks || [],
|
|
38
|
+
darkMode: config.darkMode !== undefined ? config.darkMode : true, // Default to true
|
|
39
|
+
backgroundColors: config.backgroundColors || undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block Renderer
|
|
3
|
+
* Library component for rendering blocks (decoupled from editor)
|
|
4
|
+
* This is the "headless" rendering layer
|
|
5
|
+
*
|
|
6
|
+
* Multi-Tenant: Uses Preview components from client-provided blocks
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Block, BlockPreviewProps } from '../../types/block';
|
|
10
|
+
/**
|
|
11
|
+
* Block Renderer Props
|
|
12
|
+
*/
|
|
13
|
+
export interface BlockRendererProps {
|
|
14
|
+
/** Block to render */
|
|
15
|
+
block: Block;
|
|
16
|
+
/** Custom renderers for specific block types (optional override) */
|
|
17
|
+
customRenderers?: Map<string, React.ComponentType<BlockPreviewProps>>;
|
|
18
|
+
/** Additional context for rendering */
|
|
19
|
+
context?: {
|
|
20
|
+
siteId?: string;
|
|
21
|
+
locale?: string;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Block Renderer Component
|
|
27
|
+
* Renders a single block using its Preview component from the registry
|
|
28
|
+
*
|
|
29
|
+
* This is the headless rendering layer - it uses the Preview component
|
|
30
|
+
* provided by the client application, allowing each client to have
|
|
31
|
+
* their own design system in the frontend while the editor uses
|
|
32
|
+
* the dashboard's design system.
|
|
33
|
+
*/
|
|
34
|
+
export declare function BlockRenderer({ block, customRenderers, context }: BlockRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* Blocks Renderer
|
|
37
|
+
* Renders an array of blocks
|
|
38
|
+
*/
|
|
39
|
+
export interface BlocksRendererProps {
|
|
40
|
+
/** Array of blocks to render */
|
|
41
|
+
blocks: Block[];
|
|
42
|
+
/** Custom renderers for specific block types */
|
|
43
|
+
customRenderers?: Map<string, React.ComponentType<{
|
|
44
|
+
block: Block;
|
|
45
|
+
}>>;
|
|
46
|
+
/** Additional props to pass to renderers */
|
|
47
|
+
renderProps?: Record<string, unknown>;
|
|
48
|
+
/** Wrapper component for the blocks */
|
|
49
|
+
wrapper?: React.ComponentType<{
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export declare function BlocksRenderer({ blocks, customRenderers, renderProps, wrapper: Wrapper, }: BlocksRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
//# sourceMappingURL=BlockRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockRenderer.d.ts","sourceRoot":"","sources":["../../../src/lib/blocks/BlockRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,sBAAsB;IACtB,KAAK,EAAE,KAAK,CAAC;IAEb,oEAAoE;IACpE,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAEtE,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;CACL;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,eAAe,EACf,OAAY,EACf,EAAE,kBAAkB,2CAqDpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,gCAAgC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB,gDAAgD;IAChD,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC,CAAC;IAErE,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC,uCAAuC;IACvC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CAChE;AAED,wBAAgB,cAAc,CAAC,EAC3B,MAAM,EACN,eAAe,EACf,WAAW,EACX,OAAO,EAAE,OAAO,GACnB,EAAE,mBAAmB,2CAerB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block Renderer
|
|
3
|
+
* Library component for rendering blocks (decoupled from editor)
|
|
4
|
+
* This is the "headless" rendering layer
|
|
5
|
+
*
|
|
6
|
+
* Multi-Tenant: Uses Preview components from client-provided blocks
|
|
7
|
+
*/
|
|
8
|
+
'use client';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
import { blockRegistry } from '../../registry/BlockRegistry';
|
|
11
|
+
/**
|
|
12
|
+
* Block Renderer Component
|
|
13
|
+
* Renders a single block using its Preview component from the registry
|
|
14
|
+
*
|
|
15
|
+
* This is the headless rendering layer - it uses the Preview component
|
|
16
|
+
* provided by the client application, allowing each client to have
|
|
17
|
+
* their own design system in the frontend while the editor uses
|
|
18
|
+
* the dashboard's design system.
|
|
19
|
+
*/
|
|
20
|
+
export function BlockRenderer({ block, customRenderers, context = {} }) {
|
|
21
|
+
// Check for custom renderer override first
|
|
22
|
+
if (customRenderers?.has(block.type)) {
|
|
23
|
+
const CustomRenderer = customRenderers.get(block.type);
|
|
24
|
+
return _jsx(CustomRenderer, { block: block, context: context });
|
|
25
|
+
}
|
|
26
|
+
// Get block definition from registry
|
|
27
|
+
const definition = blockRegistry.get(block.type);
|
|
28
|
+
if (!definition) {
|
|
29
|
+
console.warn(`Block type "${block.type}" not found in registry. Available types:`, blockRegistry.getAll().map(b => b.type).join(', '));
|
|
30
|
+
return (_jsxs("div", { className: "p-4 border border-red-300 bg-red-50 rounded", children: [_jsxs("p", { className: "text-red-600", children: ["Unknown block type: ", block.type] }), _jsx("p", { className: "text-xs text-red-500 mt-1", children: "Make sure this block type is registered via customBlocks prop" })] }));
|
|
31
|
+
}
|
|
32
|
+
// Use the Preview component from the block definition
|
|
33
|
+
// This is provided by the client application
|
|
34
|
+
const PreviewComponent = definition.components.Preview;
|
|
35
|
+
// Check if this is a container block with children
|
|
36
|
+
const isContainer = definition.isContainer === true;
|
|
37
|
+
const childBlocks = isContainer && block.children && Array.isArray(block.children) && block.children.length > 0
|
|
38
|
+
? (typeof block.children[0] === 'object'
|
|
39
|
+
? block.children
|
|
40
|
+
: [])
|
|
41
|
+
: [];
|
|
42
|
+
// If container block, pass child blocks and render function
|
|
43
|
+
if (isContainer) {
|
|
44
|
+
return (_jsx(PreviewComponent, { block: block, context: context, childBlocks: childBlocks, renderChild: (childBlock) => (_jsx(BlockRenderer, { block: childBlock, customRenderers: customRenderers, context: context })) }));
|
|
45
|
+
}
|
|
46
|
+
return _jsx(PreviewComponent, { block: block, context: context });
|
|
47
|
+
}
|
|
48
|
+
export function BlocksRenderer({ blocks, customRenderers, renderProps, wrapper: Wrapper, }) {
|
|
49
|
+
const content = blocks.map((block, index) => (_jsx(BlockRenderer, { block: block, customRenderers: customRenderers, context: renderProps }, block.id || index)));
|
|
50
|
+
if (Wrapper) {
|
|
51
|
+
return _jsx(Wrapper, { children: content });
|
|
52
|
+
}
|
|
53
|
+
return _jsx(_Fragment, { children: content });
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/blocks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Configuration Storage
|
|
3
|
+
* Stores plugin-specific configuration in MongoDB
|
|
4
|
+
* Used by both client apps and dashboard
|
|
5
|
+
*/
|
|
6
|
+
export interface PluginConfigDocument {
|
|
7
|
+
_id?: string;
|
|
8
|
+
pluginId: string;
|
|
9
|
+
siteId: string;
|
|
10
|
+
config: {
|
|
11
|
+
customBlocks?: unknown[];
|
|
12
|
+
darkMode?: boolean;
|
|
13
|
+
backgroundColors?: {
|
|
14
|
+
light: string;
|
|
15
|
+
dark?: string;
|
|
16
|
+
};
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
}
|
|
21
|
+
export declare function getPluginConfigCollection(getDb: () => Promise<{
|
|
22
|
+
db: any;
|
|
23
|
+
}>): Promise<any>;
|
|
24
|
+
export declare function getPluginConfig(getDb: () => Promise<{
|
|
25
|
+
db: any;
|
|
26
|
+
}>, pluginId: string, siteId?: string): Promise<PluginConfigDocument | null>;
|
|
27
|
+
export declare function savePluginConfig(getDb: () => Promise<{
|
|
28
|
+
db: any;
|
|
29
|
+
}>, pluginId: string, siteId: string, config: PluginConfigDocument['config']): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=config-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-storage.d.ts","sourceRoot":"","sources":["../../src/lib/config-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE;QACJ,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,gBAAgB,CAAC,EAAE;YACf,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KAC1B,CAAC;IACF,SAAS,EAAE,IAAI,CAAC;CACnB;AAKD,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,CAAC,gBAIhF;AAGD,wBAAsB,eAAe,CACjC,KAAK,EAAE,MAAM,OAAO,CAAC;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAkB,GAC3B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAGtC;AAGD,wBAAsB,gBAAgB,CAClC,KAAK,EAAE,MAAM,OAAO,CAAC;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|