@jhits/plugin-blog 0.0.9 → 0.0.11

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 (276) hide show
  1. package/package.json +58 -59
  2. package/src/api/categories.ts +0 -43
  3. package/src/api/check-title.ts +0 -60
  4. package/src/api/config-handler.ts +0 -76
  5. package/src/api/handler.ts +0 -418
  6. package/src/api/index.ts +0 -33
  7. package/src/api/route.ts +0 -116
  8. package/src/api/router.ts +0 -128
  9. package/src/api-server.ts +0 -11
  10. package/src/config.ts +0 -161
  11. package/src/hooks/index.d.ts +0 -8
  12. package/src/hooks/index.d.ts.map +0 -1
  13. package/src/hooks/index.js +0 -7
  14. package/src/hooks/index.ts +0 -9
  15. package/src/hooks/useBlog.d.ts +0 -31
  16. package/src/hooks/useBlog.d.ts.map +0 -1
  17. package/src/hooks/useBlog.js +0 -57
  18. package/src/hooks/useBlog.ts +0 -85
  19. package/src/hooks/useBlogs.d.ts +0 -39
  20. package/src/hooks/useBlogs.d.ts.map +0 -1
  21. package/src/hooks/useBlogs.js +0 -82
  22. package/src/hooks/useBlogs.ts +0 -123
  23. package/src/hooks/useCategories.d.ts +0 -9
  24. package/src/hooks/useCategories.d.ts.map +0 -1
  25. package/src/hooks/useCategories.js +0 -70
  26. package/src/hooks/useCategories.ts +0 -76
  27. package/src/index.d.ts +0 -55
  28. package/src/index.d.ts.map +0 -1
  29. package/src/index.js +0 -228
  30. package/src/index.server.ts +0 -14
  31. package/src/index.tsx +0 -335
  32. package/src/init.d.ts +0 -40
  33. package/src/init.d.ts.map +0 -1
  34. package/src/init.js +0 -41
  35. package/src/init.tsx +0 -63
  36. package/src/lib/blocks/BlockRenderer.d.ts +0 -54
  37. package/src/lib/blocks/BlockRenderer.d.ts.map +0 -1
  38. package/src/lib/blocks/BlockRenderer.js +0 -54
  39. package/src/lib/blocks/BlockRenderer.tsx +0 -141
  40. package/src/lib/blocks/index.ts +0 -6
  41. package/src/lib/config-storage.d.ts +0 -30
  42. package/src/lib/config-storage.d.ts.map +0 -1
  43. package/src/lib/config-storage.js +0 -31
  44. package/src/lib/config-storage.ts +0 -65
  45. package/src/lib/index.ts +0 -9
  46. package/src/lib/layouts/blocks/ColumnsBlock.d.ts +0 -25
  47. package/src/lib/layouts/blocks/ColumnsBlock.d.ts.map +0 -1
  48. package/src/lib/layouts/blocks/ColumnsBlock.js +0 -182
  49. package/src/lib/layouts/blocks/ColumnsBlock.tsx +0 -298
  50. package/src/lib/layouts/blocks/ColumnsBlock.tsx.tmp +0 -81
  51. package/src/lib/layouts/blocks/SectionBlock.d.ts +0 -25
  52. package/src/lib/layouts/blocks/SectionBlock.d.ts.map +0 -1
  53. package/src/lib/layouts/blocks/SectionBlock.js +0 -44
  54. package/src/lib/layouts/blocks/SectionBlock.tsx +0 -104
  55. package/src/lib/layouts/blocks/index.ts +0 -8
  56. package/src/lib/layouts/index.d.ts +0 -23
  57. package/src/lib/layouts/index.d.ts.map +0 -1
  58. package/src/lib/layouts/index.js +0 -45
  59. package/src/lib/layouts/index.ts +0 -52
  60. package/src/lib/layouts/registerLayoutBlocks.d.ts +0 -9
  61. package/src/lib/layouts/registerLayoutBlocks.d.ts.map +0 -1
  62. package/src/lib/layouts/registerLayoutBlocks.js +0 -60
  63. package/src/lib/layouts/registerLayoutBlocks.ts +0 -64
  64. package/src/lib/mappers/apiMapper.d.ts +0 -66
  65. package/src/lib/mappers/apiMapper.d.ts.map +0 -1
  66. package/src/lib/mappers/apiMapper.js +0 -191
  67. package/src/lib/mappers/apiMapper.ts +0 -254
  68. package/src/lib/migration/index.ts +0 -6
  69. package/src/lib/migration/mapper.ts +0 -140
  70. package/src/lib/rich-text/RichTextEditor.d.ts +0 -45
  71. package/src/lib/rich-text/RichTextEditor.d.ts.map +0 -1
  72. package/src/lib/rich-text/RichTextEditor.js +0 -564
  73. package/src/lib/rich-text/RichTextEditor.tsx +0 -826
  74. package/src/lib/rich-text/RichTextPreview.d.ts +0 -16
  75. package/src/lib/rich-text/RichTextPreview.d.ts.map +0 -1
  76. package/src/lib/rich-text/RichTextPreview.js +0 -144
  77. package/src/lib/rich-text/RichTextPreview.tsx +0 -210
  78. package/src/lib/rich-text/index.d.ts +0 -9
  79. package/src/lib/rich-text/index.d.ts.map +0 -1
  80. package/src/lib/rich-text/index.js +0 -6
  81. package/src/lib/rich-text/index.ts +0 -10
  82. package/src/lib/utils/blockHelpers.d.ts +0 -23
  83. package/src/lib/utils/blockHelpers.d.ts.map +0 -1
  84. package/src/lib/utils/blockHelpers.js +0 -65
  85. package/src/lib/utils/blockHelpers.ts +0 -72
  86. package/src/lib/utils/configValidation.d.ts +0 -23
  87. package/src/lib/utils/configValidation.d.ts.map +0 -1
  88. package/src/lib/utils/configValidation.js +0 -113
  89. package/src/lib/utils/configValidation.ts +0 -137
  90. package/src/lib/utils/index.ts +0 -8
  91. package/src/lib/utils/slugify.ts +0 -79
  92. package/src/registry/BlockRegistry.d.ts +0 -62
  93. package/src/registry/BlockRegistry.d.ts.map +0 -1
  94. package/src/registry/BlockRegistry.js +0 -112
  95. package/src/registry/BlockRegistry.ts +0 -139
  96. package/src/registry/index.d.ts +0 -6
  97. package/src/registry/index.d.ts.map +0 -1
  98. package/src/registry/index.js +0 -4
  99. package/src/registry/index.ts +0 -11
  100. package/src/state/EditorContext.d.ts +0 -45
  101. package/src/state/EditorContext.d.ts.map +0 -1
  102. package/src/state/EditorContext.js +0 -215
  103. package/src/state/EditorContext.tsx +0 -283
  104. package/src/state/index.d.ts +0 -7
  105. package/src/state/index.d.ts.map +0 -1
  106. package/src/state/index.js +0 -6
  107. package/src/state/index.ts +0 -8
  108. package/src/state/reducer.d.ts +0 -11
  109. package/src/state/reducer.d.ts.map +0 -1
  110. package/src/state/reducer.js +0 -443
  111. package/src/state/reducer.ts +0 -694
  112. package/src/state/types.d.ts +0 -162
  113. package/src/state/types.d.ts.map +0 -1
  114. package/src/state/types.js +0 -27
  115. package/src/state/types.ts +0 -160
  116. package/src/types/block.d.ts +0 -221
  117. package/src/types/block.d.ts.map +0 -1
  118. package/src/types/block.js +0 -6
  119. package/src/types/block.ts +0 -269
  120. package/src/types/index.d.ts +0 -8
  121. package/src/types/index.d.ts.map +0 -1
  122. package/src/types/index.js +0 -5
  123. package/src/types/index.ts +0 -17
  124. package/src/types/post.d.ts +0 -136
  125. package/src/types/post.d.ts.map +0 -1
  126. package/src/types/post.js +0 -5
  127. package/src/types/post.ts +0 -169
  128. package/src/utils/client.d.ts +0 -48
  129. package/src/utils/client.d.ts.map +0 -1
  130. package/src/utils/client.js +0 -77
  131. package/src/utils/client.ts +0 -122
  132. package/src/utils/index.ts +0 -7
  133. package/src/views/CanvasEditor/BlockWrapper.d.ts +0 -16
  134. package/src/views/CanvasEditor/BlockWrapper.d.ts.map +0 -1
  135. package/src/views/CanvasEditor/BlockWrapper.js +0 -276
  136. package/src/views/CanvasEditor/BlockWrapper.tsx +0 -522
  137. package/src/views/CanvasEditor/CanvasEditorView.d.ts +0 -14
  138. package/src/views/CanvasEditor/CanvasEditorView.d.ts.map +0 -1
  139. package/src/views/CanvasEditor/CanvasEditorView.js +0 -209
  140. package/src/views/CanvasEditor/CanvasEditorView.tsx +0 -337
  141. package/src/views/CanvasEditor/EditorBody.d.ts +0 -22
  142. package/src/views/CanvasEditor/EditorBody.d.ts.map +0 -1
  143. package/src/views/CanvasEditor/EditorBody.js +0 -505
  144. package/src/views/CanvasEditor/EditorBody.tsx +0 -665
  145. package/src/views/CanvasEditor/EditorHeader.d.ts +0 -18
  146. package/src/views/CanvasEditor/EditorHeader.d.ts.map +0 -1
  147. package/src/views/CanvasEditor/EditorHeader.js +0 -101
  148. package/src/views/CanvasEditor/EditorHeader.tsx +0 -268
  149. package/src/views/CanvasEditor/LayoutContainer.d.ts +0 -17
  150. package/src/views/CanvasEditor/LayoutContainer.d.ts.map +0 -1
  151. package/src/views/CanvasEditor/LayoutContainer.js +0 -222
  152. package/src/views/CanvasEditor/LayoutContainer.tsx +0 -322
  153. package/src/views/CanvasEditor/SaveConfirmationModal.d.ts +0 -13
  154. package/src/views/CanvasEditor/SaveConfirmationModal.d.ts.map +0 -1
  155. package/src/views/CanvasEditor/SaveConfirmationModal.js +0 -78
  156. package/src/views/CanvasEditor/SaveConfirmationModal.tsx +0 -233
  157. package/src/views/CanvasEditor/components/CustomBlockItem.d.ts +0 -14
  158. package/src/views/CanvasEditor/components/CustomBlockItem.d.ts.map +0 -1
  159. package/src/views/CanvasEditor/components/CustomBlockItem.js +0 -44
  160. package/src/views/CanvasEditor/components/CustomBlockItem.tsx +0 -92
  161. package/src/views/CanvasEditor/components/EditorCanvas.d.ts +0 -29
  162. package/src/views/CanvasEditor/components/EditorCanvas.d.ts.map +0 -1
  163. package/src/views/CanvasEditor/components/EditorCanvas.js +0 -32
  164. package/src/views/CanvasEditor/components/EditorCanvas.tsx +0 -160
  165. package/src/views/CanvasEditor/components/EditorLibrary.d.ts +0 -7
  166. package/src/views/CanvasEditor/components/EditorLibrary.d.ts.map +0 -1
  167. package/src/views/CanvasEditor/components/EditorLibrary.js +0 -25
  168. package/src/views/CanvasEditor/components/EditorLibrary.tsx +0 -122
  169. package/src/views/CanvasEditor/components/EditorSidebar.d.ts +0 -13
  170. package/src/views/CanvasEditor/components/EditorSidebar.d.ts.map +0 -1
  171. package/src/views/CanvasEditor/components/EditorSidebar.js +0 -20
  172. package/src/views/CanvasEditor/components/EditorSidebar.tsx +0 -181
  173. package/src/views/CanvasEditor/components/ErrorBanner.d.ts +0 -6
  174. package/src/views/CanvasEditor/components/ErrorBanner.d.ts.map +0 -1
  175. package/src/views/CanvasEditor/components/ErrorBanner.js +0 -8
  176. package/src/views/CanvasEditor/components/ErrorBanner.tsx +0 -31
  177. package/src/views/CanvasEditor/components/FeaturedMediaSection.d.ts +0 -25
  178. package/src/views/CanvasEditor/components/FeaturedMediaSection.d.ts.map +0 -1
  179. package/src/views/CanvasEditor/components/FeaturedMediaSection.js +0 -182
  180. package/src/views/CanvasEditor/components/FeaturedMediaSection.tsx +0 -341
  181. package/src/views/CanvasEditor/components/LibraryItem.d.ts +0 -14
  182. package/src/views/CanvasEditor/components/LibraryItem.d.ts.map +0 -1
  183. package/src/views/CanvasEditor/components/LibraryItem.js +0 -43
  184. package/src/views/CanvasEditor/components/LibraryItem.tsx +0 -80
  185. package/src/views/CanvasEditor/components/PrivacySettingsSection.d.ts +0 -15
  186. package/src/views/CanvasEditor/components/PrivacySettingsSection.d.ts.map +0 -1
  187. package/src/views/CanvasEditor/components/PrivacySettingsSection.js +0 -63
  188. package/src/views/CanvasEditor/components/PrivacySettingsSection.tsx +0 -212
  189. package/src/views/CanvasEditor/components/index.d.ts +0 -21
  190. package/src/views/CanvasEditor/components/index.d.ts.map +0 -1
  191. package/src/views/CanvasEditor/components/index.js +0 -12
  192. package/src/views/CanvasEditor/components/index.ts +0 -28
  193. package/src/views/CanvasEditor/hooks/index.d.ts +0 -10
  194. package/src/views/CanvasEditor/hooks/index.d.ts.map +0 -1
  195. package/src/views/CanvasEditor/hooks/index.js +0 -9
  196. package/src/views/CanvasEditor/hooks/index.ts +0 -10
  197. package/src/views/CanvasEditor/hooks/useHeroBlock.d.ts +0 -8
  198. package/src/views/CanvasEditor/hooks/useHeroBlock.d.ts.map +0 -1
  199. package/src/views/CanvasEditor/hooks/useHeroBlock.js +0 -79
  200. package/src/views/CanvasEditor/hooks/useHeroBlock.ts +0 -103
  201. package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts +0 -3
  202. package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  203. package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.js +0 -114
  204. package/src/views/CanvasEditor/hooks/useKeyboardShortcuts.ts +0 -142
  205. package/src/views/CanvasEditor/hooks/usePostLoader.d.ts +0 -5
  206. package/src/views/CanvasEditor/hooks/usePostLoader.d.ts.map +0 -1
  207. package/src/views/CanvasEditor/hooks/usePostLoader.js +0 -32
  208. package/src/views/CanvasEditor/hooks/usePostLoader.ts +0 -39
  209. package/src/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts +0 -2
  210. package/src/views/CanvasEditor/hooks/useRegisteredBlocks.d.ts.map +0 -1
  211. package/src/views/CanvasEditor/hooks/useRegisteredBlocks.js +0 -47
  212. package/src/views/CanvasEditor/hooks/useRegisteredBlocks.ts +0 -55
  213. package/src/views/CanvasEditor/hooks/useUnsavedChanges.d.ts +0 -25
  214. package/src/views/CanvasEditor/hooks/useUnsavedChanges.d.ts.map +0 -1
  215. package/src/views/CanvasEditor/hooks/useUnsavedChanges.js +0 -285
  216. package/src/views/CanvasEditor/hooks/useUnsavedChanges.ts +0 -339
  217. package/src/views/CanvasEditor/index.d.ts +0 -16
  218. package/src/views/CanvasEditor/index.d.ts.map +0 -1
  219. package/src/views/CanvasEditor/index.js +0 -9
  220. package/src/views/CanvasEditor/index.ts +0 -16
  221. package/src/views/PostManager/EmptyState.d.ts +0 -10
  222. package/src/views/PostManager/EmptyState.d.ts.map +0 -1
  223. package/src/views/PostManager/EmptyState.js +0 -12
  224. package/src/views/PostManager/EmptyState.tsx +0 -42
  225. package/src/views/PostManager/PostActionsMenu.d.ts +0 -12
  226. package/src/views/PostManager/PostActionsMenu.d.ts.map +0 -1
  227. package/src/views/PostManager/PostActionsMenu.js +0 -58
  228. package/src/views/PostManager/PostActionsMenu.tsx +0 -112
  229. package/src/views/PostManager/PostCards.d.ts +0 -15
  230. package/src/views/PostManager/PostCards.d.ts.map +0 -1
  231. package/src/views/PostManager/PostCards.js +0 -79
  232. package/src/views/PostManager/PostCards.tsx +0 -197
  233. package/src/views/PostManager/PostFilters.d.ts +0 -16
  234. package/src/views/PostManager/PostFilters.d.ts.map +0 -1
  235. package/src/views/PostManager/PostFilters.js +0 -10
  236. package/src/views/PostManager/PostFilters.tsx +0 -95
  237. package/src/views/PostManager/PostManagerView.d.ts +0 -11
  238. package/src/views/PostManager/PostManagerView.d.ts.map +0 -1
  239. package/src/views/PostManager/PostManagerView.js +0 -174
  240. package/src/views/PostManager/PostManagerView.tsx +0 -289
  241. package/src/views/PostManager/PostStats.d.ts +0 -11
  242. package/src/views/PostManager/PostStats.d.ts.map +0 -1
  243. package/src/views/PostManager/PostStats.js +0 -46
  244. package/src/views/PostManager/PostStats.tsx +0 -81
  245. package/src/views/PostManager/PostTable.d.ts +0 -15
  246. package/src/views/PostManager/PostTable.d.ts.map +0 -1
  247. package/src/views/PostManager/PostTable.js +0 -79
  248. package/src/views/PostManager/PostTable.tsx +0 -230
  249. package/src/views/PostManager/index.d.ts +0 -12
  250. package/src/views/PostManager/index.d.ts.map +0 -1
  251. package/src/views/PostManager/index.js +0 -11
  252. package/src/views/PostManager/index.ts +0 -15
  253. package/src/views/Preview/PreviewBridgeView.d.ts +0 -12
  254. package/src/views/Preview/PreviewBridgeView.d.ts.map +0 -1
  255. package/src/views/Preview/PreviewBridgeView.js +0 -11
  256. package/src/views/Preview/PreviewBridgeView.tsx +0 -64
  257. package/src/views/Preview/index.d.ts +0 -6
  258. package/src/views/Preview/index.d.ts.map +0 -1
  259. package/src/views/Preview/index.js +0 -4
  260. package/src/views/Preview/index.ts +0 -7
  261. package/src/views/Settings/SettingsView.d.ts +0 -10
  262. package/src/views/Settings/SettingsView.d.ts.map +0 -1
  263. package/src/views/Settings/SettingsView.js +0 -111
  264. package/src/views/Settings/SettingsView.tsx +0 -298
  265. package/src/views/Settings/index.d.ts +0 -6
  266. package/src/views/Settings/index.d.ts.map +0 -1
  267. package/src/views/Settings/index.js +0 -4
  268. package/src/views/Settings/index.ts +0 -7
  269. package/src/views/SlugSEO/SlugSEOManagerView.d.ts +0 -12
  270. package/src/views/SlugSEO/SlugSEOManagerView.d.ts.map +0 -1
  271. package/src/views/SlugSEO/SlugSEOManagerView.js +0 -11
  272. package/src/views/SlugSEO/SlugSEOManagerView.tsx +0 -94
  273. package/src/views/SlugSEO/index.d.ts +0 -6
  274. package/src/views/SlugSEO/index.d.ts.map +0 -1
  275. package/src/views/SlugSEO/index.js +0 -4
  276. package/src/views/SlugSEO/index.ts +0 -7
@@ -1,269 +0,0 @@
1
- /**
2
- * Core Block Types
3
- * Foundation for the Block-Based Architecture
4
- * Multi-Tenant Plugin Architecture - Blocks are provided by client applications
5
- */
6
-
7
- import React from 'react';
8
-
9
- /**
10
- * Base Block Interface
11
- * Every block in the system extends this structure
12
- */
13
- export interface Block {
14
- /** Unique identifier for the block */
15
- id: string;
16
-
17
- /** Block type identifier (e.g., 'heading', 'paragraph', 'image', 'plantSpec') */
18
- type: string;
19
-
20
- /** Block-specific data (varies by type) */
21
- data: Record<string, unknown>;
22
-
23
- /**
24
- * Child blocks (for container blocks like Section, Columns)
25
- * Can be an array of Block IDs (for flat storage) or Block objects (for nested structure)
26
- */
27
- children?: string[] | Block[];
28
-
29
- /** Optional metadata for editor state, styling, etc. */
30
- meta?: {
31
- /** Visual order in the editor */
32
- order?: number;
33
- /** Whether block is collapsed in editor */
34
- collapsed?: boolean;
35
- /** Custom styling overrides */
36
- style?: Record<string, string>;
37
- /** Editor-specific flags */
38
- flags?: string[];
39
- /** Column index (for column container blocks) */
40
- columnIndex?: number;
41
- /** Additional custom metadata */
42
- [key: string]: unknown;
43
- };
44
- }
45
-
46
- /**
47
- * Block Edit Component Props
48
- * Props passed to the Edit component in the dashboard editor
49
- */
50
- export interface BlockEditProps {
51
- /** The block being edited */
52
- block: Block;
53
-
54
- /** Update handler - call this to update the block's data */
55
- onUpdate: (data: Partial<Block['data']>) => void;
56
-
57
- /** Delete handler - call this to remove the block */
58
- onDelete?: () => void;
59
-
60
- /** Duplicate handler - call this to duplicate the block */
61
- onDuplicate?: () => void;
62
-
63
- /** Whether the block is currently selected */
64
- isSelected?: boolean;
65
-
66
- /** Whether the block is currently being dragged */
67
- isDragging?: boolean;
68
-
69
- /** Focus mode state */
70
- focusMode?: boolean;
71
-
72
- /** Child blocks (for container blocks like Section, Columns) */
73
- childBlocks?: Block[];
74
-
75
- /** Add a child block (for container blocks) */
76
- onChildBlockAdd?: (type: string, index?: number, containerId?: string) => void;
77
-
78
- /** Update a child block (for container blocks) */
79
- onChildBlockUpdate?: (id: string, data: Partial<Block['data']>, containerId?: string) => void;
80
-
81
- /** Delete a child block (for container blocks) */
82
- onChildBlockDelete?: (id: string, containerId?: string) => void;
83
-
84
- /** Move a child block (for container blocks) */
85
- onChildBlockMove?: (id: string, newIndex: number, containerId?: string) => void;
86
- }
87
-
88
- /**
89
- * Block Preview Component Props
90
- * Props passed to the Preview component for headless rendering
91
- */
92
- export interface BlockPreviewProps {
93
- /** The block to render */
94
- block: Block;
95
-
96
- /** Additional rendering context */
97
- context?: {
98
- /** Site ID */
99
- siteId?: string;
100
- /** Locale */
101
- locale?: string;
102
- /** Custom render props */
103
- [key: string]: unknown;
104
- };
105
-
106
- /** Child blocks (for container blocks like Section, Columns) */
107
- childBlocks?: Block[];
108
-
109
- /** Render a child block (for container blocks) */
110
- renderChild?: (childBlock: Block) => React.ReactElement;
111
- }
112
-
113
- /**
114
- * Strict Block Component Interface
115
- * Every client-provided block MUST implement this interface
116
- */
117
- export interface IBlockComponent {
118
- /**
119
- * Edit Component - Rendered in the dashboard editor
120
- * Must use dashboard design system (earth-tone palette, typography)
121
- */
122
- Edit: React.ComponentType<BlockEditProps>;
123
-
124
- /**
125
- * Preview Component - Rendered in headless/frontend context
126
- * Can use client's own design system
127
- */
128
- Preview: React.ComponentType<BlockPreviewProps>;
129
-
130
- /**
131
- * Icon Component - Shown in block palette
132
- * Should be a simple icon (lucide-react recommended)
133
- */
134
- Icon?: React.ComponentType<{ className?: string }>;
135
- }
136
-
137
- /**
138
- * Block Type Definition
139
- * Complete definition of a block type for the registry
140
- */
141
- export interface BlockTypeDefinition {
142
- /** Unique type identifier */
143
- type: string;
144
-
145
- /** Human-readable name */
146
- name: string;
147
-
148
- /** Description of the block (shown in tooltips) */
149
- description: string;
150
-
151
- /** Icon component (React component) - Optional, falls back to block component's Icon */
152
- icon?: React.ComponentType<{ className?: string }>;
153
-
154
- /** Default data structure for this block type */
155
- defaultData: Record<string, unknown>;
156
-
157
- /** Validation schema (optional, for runtime validation) */
158
- validate?: (data: Record<string, unknown>) => boolean;
159
-
160
- /** Whether this block can contain nested blocks */
161
- isContainer?: boolean;
162
-
163
- /** Allowed child block types (if container) */
164
- allowedChildren?: string[];
165
-
166
- /** Category for grouping in block palette */
167
- category?: 'text' | 'media' | 'layout' | 'interactive' | 'custom';
168
-
169
- /**
170
- * Block Components - REQUIRED for client-provided blocks
171
- * Edit and Preview components must be provided
172
- */
173
- components: IBlockComponent;
174
- }
175
-
176
- /**
177
- * Rich Text Formatting Configuration
178
- * Optional configuration for rich text formatting in text blocks
179
- */
180
- export interface RichTextFormattingConfig {
181
- /** Whether bold formatting is available */
182
- bold?: boolean;
183
- /** Whether italic formatting is available */
184
- italic?: boolean;
185
- /** Whether underline formatting is available */
186
- underline?: boolean;
187
- /** Whether links are available */
188
- links?: boolean;
189
- /** Available colors (array of color values or Tailwind classes) */
190
- colors?: string[];
191
- /** Custom CSS classes for formatted text */
192
- styles?: {
193
- bold?: string;
194
- italic?: string;
195
- underline?: string;
196
- link?: string;
197
- /** Color classes mapped by color value */
198
- colorClasses?: Record<string, string>;
199
- };
200
- }
201
-
202
- /**
203
- * Client Block Definition
204
- * Simplified interface for client apps to provide blocks
205
- */
206
- export interface ClientBlockDefinition {
207
- /** Unique type identifier */
208
- type: string;
209
-
210
- /** Human-readable name */
211
- name: string;
212
-
213
- /** Description of the block */
214
- description: string;
215
-
216
- /** Icon component (optional) */
217
- icon?: React.ComponentType<{ className?: string }>;
218
-
219
- /** Default data structure */
220
- defaultData: Record<string, unknown>;
221
-
222
- /** Validation function (optional) */
223
- validate?: (data: Record<string, unknown>) => boolean;
224
-
225
- /** Whether this block can contain nested blocks */
226
- isContainer?: boolean;
227
-
228
- /** Allowed child block types (if container) */
229
- allowedChildren?: string[];
230
-
231
- /** Category for grouping */
232
- category?: 'text' | 'media' | 'layout' | 'interactive' | 'custom';
233
-
234
- /** Block components - REQUIRED */
235
- components: IBlockComponent;
236
-
237
- /** Rich text formatting configuration (optional) */
238
- richTextFormatting?: RichTextFormattingConfig;
239
- }
240
-
241
- /**
242
- * Block Registry Configuration
243
- * Central registry of all available block types
244
- */
245
- export interface BlockRegistry {
246
- /** Map of block type to definition */
247
- types: Map<string, BlockTypeDefinition>;
248
-
249
- /** Register a new block type */
250
- register(definition: BlockTypeDefinition): void;
251
-
252
- /** Register multiple client blocks at once */
253
- registerClientBlocks(definitions: ClientBlockDefinition[]): void;
254
-
255
- /** Get block type definition */
256
- get(type: string): BlockTypeDefinition | undefined;
257
-
258
- /** Get all registered block types */
259
- getAll(): BlockTypeDefinition[];
260
-
261
- /** Get block types by category */
262
- getByCategory(category: BlockTypeDefinition['category']): BlockTypeDefinition[];
263
-
264
- /** Check if a block type is registered */
265
- has(type: string): boolean;
266
-
267
- /** Clear all registered blocks */
268
- clear(): void;
269
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Central type exports
3
- */
4
- export * from './block';
5
- export * from './post';
6
- export type { IBlockComponent, BlockEditProps, BlockPreviewProps, ClientBlockDefinition, } from './block';
7
- export type { BlockRegistry } from './block';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAGvB,YAAY,EACR,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Central type exports
3
- */
4
- export * from './block';
5
- export * from './post';
@@ -1,17 +0,0 @@
1
- /**
2
- * Central type exports
3
- */
4
-
5
- export * from './block';
6
- export * from './post';
7
-
8
- // Re-export commonly used types for convenience
9
- export type {
10
- IBlockComponent,
11
- BlockEditProps,
12
- BlockPreviewProps,
13
- ClientBlockDefinition,
14
- } from './block';
15
-
16
-
17
- export type { BlockRegistry } from './block';
@@ -1,136 +0,0 @@
1
- /**
2
- * Post Types
3
- * Data structures for blog posts
4
- */
5
- import { Block } from './block';
6
- /**
7
- * Post Status
8
- */
9
- export type PostStatus = 'draft' | 'published' | 'scheduled' | 'archived';
10
- /**
11
- * SEO Metadata
12
- */
13
- export interface SEOMetadata {
14
- /** SEO title (can differ from post title) */
15
- title?: string;
16
- /** Meta description */
17
- description?: string;
18
- /** Open Graph image URL */
19
- ogImage?: string;
20
- /** Keywords/tags for SEO */
21
- keywords?: string[];
22
- /** Canonical URL */
23
- canonicalUrl?: string;
24
- }
25
- /**
26
- * Publication Data
27
- */
28
- export interface PublicationData {
29
- /** Publication status */
30
- status: PostStatus;
31
- /** Publication date (ISO string) */
32
- date?: string;
33
- /** Scheduled publication date (if status is 'scheduled') */
34
- scheduledDate?: string;
35
- /** Author ID */
36
- authorId?: string;
37
- /** Last modified date */
38
- updatedAt?: string;
39
- }
40
- /**
41
- * Privacy Settings
42
- */
43
- export interface PrivacySettings {
44
- /** Whether the post is private (not publicly accessible) */
45
- isPrivate?: boolean;
46
- /** Password protection (if set, post requires password to view) */
47
- password?: string;
48
- /** List of user IDs who have access (from plugin-users) */
49
- sharedWithUsers?: string[];
50
- }
51
- /**
52
- * Post Metadata
53
- */
54
- export interface PostMetadata {
55
- /** Featured image */
56
- featuredImage?: {
57
- id?: string;
58
- src?: string;
59
- alt?: string;
60
- brightness?: number;
61
- blur?: number;
62
- scale?: number;
63
- positionX?: number;
64
- positionY?: number;
65
- isCustom?: boolean;
66
- };
67
- /** Categories */
68
- categories?: string[];
69
- /** Tags */
70
- tags?: string[];
71
- /** Excerpt/summary */
72
- excerpt?: string;
73
- /** Language code */
74
- lang?: string;
75
- /** Privacy settings */
76
- privacy?: PrivacySettings;
77
- }
78
- /**
79
- * Complete Blog Post Structure
80
- * This is the headless JSON structure stored in the database
81
- */
82
- export interface BlogPost {
83
- /** Unique post identifier */
84
- id: string;
85
- /** Post title */
86
- title: string;
87
- /** URL slug (unique, auto-generated from title) */
88
- slug: string;
89
- /** Array of content blocks */
90
- blocks: Block[];
91
- /** SEO metadata */
92
- seo: SEOMetadata;
93
- /** Publication data */
94
- publication: PublicationData;
95
- /** Additional metadata */
96
- metadata: PostMetadata;
97
- /** Creation timestamp */
98
- createdAt: string;
99
- /** Last update timestamp */
100
- updatedAt: string;
101
- /** Version number for revision tracking */
102
- version?: number;
103
- }
104
- /**
105
- * Post List Item (for list views)
106
- * Lightweight version of BlogPost for performance
107
- */
108
- export interface PostListItem {
109
- id: string;
110
- title: string;
111
- slug: string;
112
- status: PostStatus;
113
- date?: string;
114
- excerpt?: string;
115
- featuredImage?: string;
116
- authorId?: string;
117
- updatedAt: string;
118
- category?: string;
119
- }
120
- /**
121
- * Post Filter Options
122
- */
123
- export interface PostFilterOptions {
124
- status?: PostStatus | PostStatus[];
125
- category?: string;
126
- tag?: string;
127
- authorId?: string;
128
- search?: string;
129
- dateFrom?: string;
130
- dateTo?: string;
131
- limit?: number;
132
- skip?: number;
133
- sortBy?: 'date' | 'title' | 'updatedAt';
134
- sortOrder?: 'asc' | 'desc';
135
- }
136
- //# sourceMappingURL=post.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["post.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,4BAA4B;IAC5B,QAAQ,CAAC,E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,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IACxC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC9B"}
package/src/types/post.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Post Types
3
- * Data structures for blog posts
4
- */
5
- export {};
package/src/types/post.ts DELETED
@@ -1,169 +0,0 @@
1
- /**
2
- * Post Types
3
- * Data structures for blog posts
4
- */
5
-
6
- import { Block } from './block';
7
-
8
- /**
9
- * Post Status
10
- */
11
- export type PostStatus = 'draft' | 'published' | 'scheduled' | 'archived';
12
-
13
- /**
14
- * SEO Metadata
15
- */
16
- export interface SEOMetadata {
17
- /** SEO title (can differ from post title) */
18
- title?: string;
19
-
20
- /** Meta description */
21
- description?: string;
22
-
23
- /** Open Graph image URL */
24
- ogImage?: string;
25
-
26
- /** Keywords/tags for SEO */
27
- keywords?: string[];
28
-
29
- /** Canonical URL */
30
- canonicalUrl?: string;
31
- }
32
-
33
- /**
34
- * Publication Data
35
- */
36
- export interface PublicationData {
37
- /** Publication status */
38
- status: PostStatus;
39
-
40
- /** Publication date (ISO string) */
41
- date?: string;
42
-
43
- /** Scheduled publication date (if status is 'scheduled') */
44
- scheduledDate?: string;
45
-
46
- /** Author ID */
47
- authorId?: string;
48
-
49
- /** Last modified date */
50
- updatedAt?: string;
51
- }
52
-
53
- /**
54
- * Privacy Settings
55
- */
56
- export interface PrivacySettings {
57
- /** Whether the post is private (not publicly accessible) */
58
- isPrivate?: boolean;
59
-
60
- /** Password protection (if set, post requires password to view) */
61
- password?: string;
62
-
63
- /** List of user IDs who have access (from plugin-users) */
64
- sharedWithUsers?: string[];
65
- }
66
-
67
- /**
68
- * Post Metadata
69
- */
70
- export interface PostMetadata {
71
- /** Featured image */
72
- featuredImage?: {
73
- id?: string; // Image ID (preferred, for plugin-images system)
74
- src?: string; // Image URL (legacy support, will be converted to id)
75
- alt?: string;
76
- brightness?: number; // 0-200, 100 = normal
77
- blur?: number; // 0-20
78
- scale?: number; // 0.1-3.0, 1.0 = normal
79
- positionX?: number; // -100 to 100, 0 = center
80
- positionY?: number; // -100 to 100, 0 = center
81
- isCustom?: boolean; // true if edited independently from hero image
82
- };
83
-
84
- /** Categories */
85
- categories?: string[];
86
-
87
- /** Tags */
88
- tags?: string[];
89
-
90
- /** Excerpt/summary */
91
- excerpt?: string;
92
-
93
- /** Language code */
94
- lang?: string;
95
-
96
- /** Privacy settings */
97
- privacy?: PrivacySettings;
98
- }
99
-
100
- /**
101
- * Complete Blog Post Structure
102
- * This is the headless JSON structure stored in the database
103
- */
104
- export interface BlogPost {
105
- /** Unique post identifier */
106
- id: string;
107
-
108
- /** Post title */
109
- title: string;
110
-
111
- /** URL slug (unique, auto-generated from title) */
112
- slug: string;
113
-
114
- /** Array of content blocks */
115
- blocks: Block[];
116
-
117
- /** SEO metadata */
118
- seo: SEOMetadata;
119
-
120
- /** Publication data */
121
- publication: PublicationData;
122
-
123
- /** Additional metadata */
124
- metadata: PostMetadata;
125
-
126
- /** Creation timestamp */
127
- createdAt: string;
128
-
129
- /** Last update timestamp */
130
- updatedAt: string;
131
-
132
- /** Version number for revision tracking */
133
- version?: number;
134
- }
135
-
136
- /**
137
- * Post List Item (for list views)
138
- * Lightweight version of BlogPost for performance
139
- */
140
- export interface PostListItem {
141
- id: string;
142
- title: string;
143
- slug: string;
144
- status: PostStatus;
145
- date?: string;
146
- excerpt?: string;
147
- featuredImage?: string;
148
- authorId?: string;
149
- updatedAt: string;
150
- category?: string;
151
- }
152
-
153
- /**
154
- * Post Filter Options
155
- */
156
- export interface PostFilterOptions {
157
- status?: PostStatus | PostStatus[];
158
- category?: string;
159
- tag?: string;
160
- authorId?: string;
161
- search?: string;
162
- dateFrom?: string;
163
- dateTo?: string;
164
- limit?: number;
165
- skip?: number;
166
- sortBy?: 'date' | 'title' | 'updatedAt';
167
- sortOrder?: 'asc' | 'desc';
168
- }
169
-
@@ -1,48 +0,0 @@
1
- /**
2
- * Client Utilities
3
- * Helper functions for fetching blog data in client applications
4
- */
5
- import { PostListItem, BlogPost } from '../types/post';
6
- export interface FetchBlogsOptions {
7
- /** Maximum number of posts to fetch (default: 10) */
8
- limit?: number;
9
- /** Number of posts to skip (default: 0) */
10
- skip?: number;
11
- /** Filter by status (published, draft, concept) */
12
- status?: string;
13
- /** Whether to fetch all posts for admin (includes drafts) */
14
- admin?: boolean;
15
- /** API base URL (default: '/api/blogs') */
16
- apiBaseUrl?: string;
17
- }
18
- export interface FetchBlogsResult {
19
- /** Array of blog posts */
20
- blogs: PostListItem[];
21
- /** Total number of posts available */
22
- total: number;
23
- }
24
- /**
25
- * Fetch blog posts from the API
26
- *
27
- * @example
28
- * ```ts
29
- * const { blogs, total } = await fetchBlogs({ limit: 5 });
30
- * ```
31
- */
32
- export declare function fetchBlogs(options?: FetchBlogsOptions): Promise<FetchBlogsResult>;
33
- export interface FetchBlogOptions {
34
- /** Blog post slug */
35
- slug: string;
36
- /** API base URL (default: '/api/blogs') */
37
- apiBaseUrl?: string;
38
- }
39
- /**
40
- * Fetch a single blog post by slug
41
- *
42
- * @example
43
- * ```ts
44
- * const blog = await fetchBlog({ slug: 'my-blog-post' });
45
- * ```
46
- */
47
- export declare function fetchBlog(options: FetchBlogOptions): Promise<BlogPost>;
48
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAC9B,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,0BAA0B;IAC1B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiD3F;AAED,MAAM,WAAW,gBAAgB;IAC7B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkB5E"}