cortex-react-components 2.12.9 → 2.13.0

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 (231) hide show
  1. package/dist/{chunk-N3B3XNV3.mjs → chunk-2BRDNDUB.mjs} +1 -1
  2. package/dist/{chunk-M7NV6EFH.mjs → chunk-3HNU2NYP.mjs} +1 -1
  3. package/dist/{chunk-FKU4VQR6.mjs → chunk-3NRXQBBS.mjs} +1 -1
  4. package/dist/{chunk-NWISIJFD.mjs → chunk-3Y7QG6VP.mjs} +1 -1
  5. package/dist/{chunk-PK3OBSCB.mjs → chunk-5MWZTJYP.mjs} +1 -1
  6. package/dist/chunk-5NIEZE7A.mjs +4 -0
  7. package/dist/chunk-5ROLUQ45.mjs +4 -0
  8. package/dist/chunk-6LEH6XKI.mjs +4 -0
  9. package/dist/{chunk-5SHZBJ5R.mjs → chunk-75F3LJMX.mjs} +1 -1
  10. package/dist/{chunk-MXCW6SOT.mjs → chunk-7R47MHQE.mjs} +1 -1
  11. package/dist/{chunk-LJQPLE4S.mjs → chunk-AJQHGVZ5.mjs} +1 -1
  12. package/dist/chunk-ATBKMJU6.mjs +4 -0
  13. package/dist/{chunk-YKG4FNS4.mjs → chunk-C4RWEPVF.mjs} +1 -1
  14. package/dist/{chunk-OPLUKFRN.mjs → chunk-CXCDV7VP.mjs} +1 -1
  15. package/dist/{chunk-7GMAMIHM.mjs → chunk-CXOVEABI.mjs} +1 -1
  16. package/dist/chunk-DYIBFAK7.mjs +4 -0
  17. package/dist/{chunk-6XD4Y2YK.mjs → chunk-E5LTCCBN.mjs} +1 -1
  18. package/dist/{chunk-5WVFEIMC.mjs → chunk-EM3T2XYC.mjs} +1 -1
  19. package/dist/chunk-EZC3YWSQ.mjs +1 -0
  20. package/dist/{chunk-IF3425JX.mjs → chunk-FE7ZGUPU.mjs} +1 -1
  21. package/dist/chunk-FSCDCSVK.mjs +4 -0
  22. package/dist/{chunk-H3CJOE6S.mjs → chunk-GHOL5L32.mjs} +1 -1
  23. package/dist/{chunk-2RQDJ5XT.mjs → chunk-GTZJWMZR.mjs} +1 -1
  24. package/dist/chunk-I4GYQZGM.mjs +1 -0
  25. package/dist/chunk-J4QINTHR.mjs +4 -0
  26. package/dist/chunk-JCWFPKF3.mjs +4 -0
  27. package/dist/chunk-JDMIQLAZ.mjs +1 -0
  28. package/dist/{chunk-3C2IATPQ.mjs → chunk-JMIUGRDN.mjs} +1 -1
  29. package/dist/chunk-K5MJYNCD.mjs +4 -0
  30. package/dist/{chunk-5BV4MHV6.mjs → chunk-KG3MNGT6.mjs} +1 -1
  31. package/dist/chunk-KO6JUP2L.mjs +4 -0
  32. package/dist/{chunk-LJOWXPWW.mjs → chunk-LJXTXROJ.mjs} +1 -1
  33. package/dist/chunk-MDBYZZXI.mjs +1 -0
  34. package/dist/chunk-MFE4VZPC.mjs +4 -0
  35. package/dist/{chunk-HKGW6JI2.mjs → chunk-NINFDOV5.mjs} +1 -1
  36. package/dist/chunk-PMJGTB6S.mjs +4 -0
  37. package/dist/chunk-POIHYOIP.mjs +4 -0
  38. package/dist/chunk-R4SE63GR.mjs +4 -0
  39. package/dist/{chunk-255P6K5W.mjs → chunk-RGOKBIQ5.mjs} +1 -1
  40. package/dist/{chunk-67QPOSVV.mjs → chunk-RJGYVDOU.mjs} +1 -1
  41. package/dist/{chunk-XSX6S5UQ.mjs → chunk-RS4VD3ML.mjs} +1 -1
  42. package/dist/{chunk-24HD3Y56.mjs → chunk-RXUCV64J.mjs} +1 -1
  43. package/dist/chunk-SGK4ZXKR.mjs +4 -0
  44. package/dist/chunk-SNTLCFXF.mjs +4 -0
  45. package/dist/{chunk-GSOFCLPO.mjs → chunk-TTWEHUP5.mjs} +1 -1
  46. package/dist/{chunk-CBIULUZQ.mjs → chunk-TVTTUSWM.mjs} +1 -1
  47. package/dist/{chunk-SRUG246N.mjs → chunk-TXVA6XJT.mjs} +1 -1
  48. package/dist/chunk-UAEEBFHJ.mjs +4 -0
  49. package/dist/chunk-UBJT7MPU.mjs +4 -0
  50. package/dist/{chunk-CBV5NYAD.mjs → chunk-UXOUJ5YO.mjs} +1 -1
  51. package/dist/{chunk-ERJXTG6X.mjs → chunk-WIRQ5IRT.mjs} +1 -1
  52. package/dist/{chunk-LBUC4M6L.mjs → chunk-ZEALRBXW.mjs} +1 -1
  53. package/dist/chunk-ZKSZJI4F.mjs +4 -0
  54. package/dist/components/AdvancedComponents/user-selection.d.ts +1 -1
  55. package/dist/components/AdvancedComponents/user-selection.js +0 -1
  56. package/dist/components/Blocks/Banner.mjs +1 -1
  57. package/dist/components/Blocks/CallToAction.mjs +1 -1
  58. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  59. package/dist/components/Blocks/Content.mjs +1 -1
  60. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  61. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  62. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  63. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  64. package/dist/components/Blocks/index.mjs +1 -1
  65. package/dist/components/CRM/index.mjs +1 -1
  66. package/dist/components/Cards/ContentCard.mjs +1 -1
  67. package/dist/components/Cards/FeatureCard.mjs +1 -1
  68. package/dist/components/Cards/index.mjs +1 -1
  69. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  70. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  71. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  72. package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
  73. package/dist/components/DigitalColleagues/Views/TeamsIndexView.mjs +1 -1
  74. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  75. package/dist/components/DigitalColleagues/index.mjs +1 -1
  76. package/dist/components/Foundary/AppSidebarLeft.css +1 -0
  77. package/dist/components/Foundary/AppSidebarLeft.d.ts +47 -0
  78. package/dist/components/Foundary/AppSidebarLeft.js +4 -0
  79. package/dist/components/Foundary/AppSidebarLeft.mjs +2 -0
  80. package/dist/components/Foundary/DashboardHeader.css +1 -0
  81. package/dist/components/Foundary/DashboardHeader.d.ts +8 -0
  82. package/dist/components/Foundary/DashboardHeader.js +4 -0
  83. package/dist/components/Foundary/DashboardHeader.mjs +1 -0
  84. package/dist/components/Foundary/DigitalColleageusLayout.css +1 -0
  85. package/dist/components/Foundary/DigitalColleageusLayout.d.ts +28 -0
  86. package/dist/components/Foundary/DigitalColleageusLayout.js +5 -0
  87. package/dist/components/Foundary/DigitalColleageusLayout.mjs +2 -0
  88. package/dist/components/Foundary/MainPage.css +1 -0
  89. package/dist/components/Foundary/MainPage.d.ts +3 -0
  90. package/dist/components/Foundary/MainPage.js +4 -0
  91. package/dist/components/Foundary/MainPage.mjs +2 -0
  92. package/dist/components/Foundary/ManagementSidebar.d.ts +8 -0
  93. package/dist/components/Foundary/ManagementSidebar.js +4 -0
  94. package/dist/components/Foundary/ManagementSidebar.mjs +2 -0
  95. package/dist/components/Foundary/Pages/dashboardpage.css +1 -0
  96. package/dist/components/Foundary/Pages/dashboardpage.d.ts +18 -0
  97. package/dist/components/Foundary/Pages/dashboardpage.js +5 -0
  98. package/dist/components/Foundary/Pages/dashboardpage.mjs +2 -0
  99. package/dist/components/Foundary/README-document-edit.js +238 -0
  100. package/dist/components/Foundary/README-document-edit.mjs +238 -0
  101. package/dist/components/Foundary/README-document-preview.js +210 -0
  102. package/dist/components/Foundary/README-document-preview.mjs +210 -0
  103. package/dist/components/Foundary/SearchableSelect.css +1 -0
  104. package/dist/components/Foundary/SearchableSelect.d.ts +16 -0
  105. package/dist/components/Foundary/SearchableSelect.js +4 -0
  106. package/dist/components/Foundary/SearchableSelect.mjs +1 -0
  107. package/dist/components/Foundary/Views/ColleaguesView.css +1 -0
  108. package/dist/components/Foundary/Views/ColleaguesView.d.ts +14 -0
  109. package/dist/components/Foundary/Views/ColleaguesView.js +5 -0
  110. package/dist/components/Foundary/Views/ColleaguesView.mjs +2 -0
  111. package/dist/components/Foundary/Views/KnowledgeView.css +1 -0
  112. package/dist/components/Foundary/Views/KnowledgeView.d.ts +11 -0
  113. package/dist/components/Foundary/Views/KnowledgeView.docs.js +308 -0
  114. package/dist/components/Foundary/Views/KnowledgeView.docs.mjs +308 -0
  115. package/dist/components/Foundary/Views/KnowledgeView.js +5 -0
  116. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -0
  117. package/dist/components/Foundary/Views/TeamsIndexView.css +1 -0
  118. package/dist/components/Foundary/Views/TeamsIndexView.d.ts +9 -0
  119. package/dist/components/Foundary/Views/TeamsIndexView.js +5 -0
  120. package/dist/components/Foundary/Views/TeamsIndexView.mjs +2 -0
  121. package/dist/components/Foundary/Views/index.css +1 -0
  122. package/dist/components/Foundary/Views/index.d.ts +7 -0
  123. package/dist/components/Foundary/Views/index.js +5 -0
  124. package/dist/components/Foundary/Views/index.mjs +1 -0
  125. package/dist/components/Foundary/colleague-card.css +1 -0
  126. package/dist/components/Foundary/colleague-card.d.ts +12 -0
  127. package/dist/components/Foundary/colleague-card.js +4 -0
  128. package/dist/components/Foundary/colleague-card.mjs +2 -0
  129. package/dist/components/Foundary/colleague-form.css +1 -0
  130. package/dist/components/Foundary/colleague-form.d.ts +14 -0
  131. package/dist/components/Foundary/colleague-form.js +4 -0
  132. package/dist/components/Foundary/colleague-form.mjs +2 -0
  133. package/dist/components/Foundary/colleague-type-selection.css +1 -0
  134. package/dist/components/Foundary/colleague-type-selection.d.ts +7 -0
  135. package/dist/components/Foundary/colleague-type-selection.js +4 -0
  136. package/dist/components/Foundary/colleague-type-selection.mjs +2 -0
  137. package/dist/components/Foundary/digital-colleague-clone.css +1 -0
  138. package/dist/components/Foundary/digital-colleague-clone.d.ts +9 -0
  139. package/dist/components/Foundary/digital-colleague-clone.js +4 -0
  140. package/dist/components/Foundary/digital-colleague-clone.mjs +2 -0
  141. package/dist/components/Foundary/digital-colleague-options.css +1 -0
  142. package/dist/components/Foundary/digital-colleague-options.d.ts +7 -0
  143. package/dist/components/Foundary/digital-colleague-options.js +4 -0
  144. package/dist/components/Foundary/digital-colleague-options.mjs +2 -0
  145. package/dist/components/Foundary/document-edit.css +1 -0
  146. package/dist/components/Foundary/document-edit.d.ts +10 -0
  147. package/dist/components/Foundary/document-edit.js +5 -0
  148. package/dist/components/Foundary/document-edit.mjs +2 -0
  149. package/dist/components/Foundary/document-preview-examples.css +1 -0
  150. package/dist/components/Foundary/document-preview-examples.d.ts +12 -0
  151. package/dist/components/Foundary/document-preview-examples.js +35 -0
  152. package/dist/components/Foundary/document-preview-examples.mjs +31 -0
  153. package/dist/components/Foundary/document-preview.css +1 -0
  154. package/dist/components/Foundary/document-preview.d.ts +18 -0
  155. package/dist/components/Foundary/document-preview.js +5 -0
  156. package/dist/components/Foundary/document-preview.mjs +2 -0
  157. package/dist/components/Foundary/index.css +1 -0
  158. package/dist/components/Foundary/index.d.ts +18 -0
  159. package/dist/components/Foundary/index.js +5 -0
  160. package/dist/components/Foundary/index.mjs +1 -0
  161. package/dist/components/Foundary/knowledge-browser.css +1 -0
  162. package/dist/components/Foundary/knowledge-browser.d.ts +13 -0
  163. package/dist/components/Foundary/knowledge-browser.js +5 -0
  164. package/dist/components/Foundary/knowledge-browser.mjs +2 -0
  165. package/dist/components/Foundary/knowledge-search.css +1 -0
  166. package/dist/components/Foundary/knowledge-search.d.ts +12 -0
  167. package/dist/components/Foundary/knowledge-search.js +5 -0
  168. package/dist/components/Foundary/knowledge-search.mjs +2 -0
  169. package/dist/components/Foundary/team-form.css +1 -0
  170. package/dist/components/Foundary/team-form.d.ts +24 -0
  171. package/dist/components/Foundary/team-form.js +5 -0
  172. package/dist/components/Foundary/team-form.mjs +2 -0
  173. package/dist/components/Foundary/test-data.d.ts +110 -0
  174. package/dist/components/Foundary/test-data.js +1 -0
  175. package/dist/components/Foundary/test-data.mjs +1 -0
  176. package/dist/components/Foundary/types.d.ts +939 -0
  177. package/dist/components/Foundary/types.js +1 -0
  178. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  179. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  180. package/dist/components/HeaderFooter/index.mjs +1 -1
  181. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  182. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  183. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  184. package/dist/components/Heros/PostHero/index.mjs +1 -1
  185. package/dist/components/Heros/RenderHero.mjs +1 -1
  186. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  187. package/dist/components/Heros/index.mjs +1 -1
  188. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  189. package/dist/components/Layouts/Print.mjs +1 -1
  190. package/dist/components/Layouts/SlideShow.mjs +1 -1
  191. package/dist/components/Layouts/index.mjs +1 -1
  192. package/dist/components/Other/index.mjs +1 -1
  193. package/dist/components/Payload/RichText/index.mjs +1 -1
  194. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  195. package/dist/components/Payload/index.mjs +1 -1
  196. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  197. package/dist/components/Projects/ProjectPage.mjs +1 -1
  198. package/dist/components/Projects/ProjectView.mjs +1 -1
  199. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  200. package/dist/components/Projects/index.mjs +1 -1
  201. package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
  202. package/dist/components/dc-temp/index.mjs +1 -1
  203. package/dist/components/index.d.ts +10 -10
  204. package/dist/components/index.js +16 -16
  205. package/dist/components/index.mjs +1 -1
  206. package/dist/components/ui/index.mjs +1 -1
  207. package/dist/index.js +18 -18
  208. package/dist/index.mjs +1 -1
  209. package/dist/metafile-cjs.json +1 -1
  210. package/dist/metafile-esm.json +1 -1
  211. package/dist/pages/Blog.mjs +1 -1
  212. package/dist/pages/Documentation.mjs +1 -1
  213. package/dist/pages/IndexPage.mjs +1 -1
  214. package/dist/pages/Intranet.mjs +1 -1
  215. package/dist/pages/LandingPage.mjs +1 -1
  216. package/dist/pages/Page.mjs +1 -1
  217. package/dist/pages/Publish.mjs +1 -1
  218. package/dist/pages/Website.mjs +1 -1
  219. package/dist/sections/AboutSection.mjs +1 -1
  220. package/dist/sections/BlogDetail.mjs +1 -1
  221. package/dist/sections/BlogList.mjs +1 -1
  222. package/dist/sections/ContactSection.mjs +1 -1
  223. package/dist/sections/PageSections.mjs +1 -1
  224. package/dist/sections/PricingSection.mjs +1 -1
  225. package/dist/sections/ServiceDetail.mjs +1 -1
  226. package/dist/sections/ServiceDetailSection.mjs +1 -1
  227. package/dist/sections/ServiceSection.mjs +1 -1
  228. package/dist/sections/form/index.mjs +1 -1
  229. package/dist/sections/index.mjs +1 -1
  230. package/package.json +1 -1
  231. package/dist/chunk-4BDP6J3T.mjs +0 -5
@@ -0,0 +1,238 @@
1
+ var a=`# Document Edit Component
2
+
3
+ The \`DocumentEdit\` component provides a comprehensive editing interface for knowledge documents with enhanced metadata management and intelligent suggestions.
4
+
5
+ ## Key Features
6
+
7
+ ### \u{1F3F7}\uFE0F Smart Metadata Management
8
+ - **Editable Key-Value Pairs**: Add, edit, and remove metadata fields dynamically
9
+ - **Context-based Suggestions**: Field names suggested from knowledge contexts and existing documents
10
+ - **Value Autocomplete**: Common values suggested for known metadata fields
11
+ - **Visual Guidance**: Shows which fields are commonly used for organization
12
+
13
+ ### \u{1F517} Knowledge Context Integration
14
+ - **Context-aware Fields**: Suggests metadata keys based on knowledge context grouping rules
15
+ - **Organizational Alignment**: Helps maintain consistency with existing document organization
16
+ - **Cross-document Learning**: Learns from existing documents to suggest appropriate values
17
+
18
+ ### \u{1F4DD} Enhanced Editing Experience
19
+ - **Streamlined Interface**: Clean, intuitive design focused on content creation
20
+ - **Rich Metadata**: Support for flexible metadata schemas
21
+ - **Format Support**: Works with markdown, MDX, rich text, and plain text formats
22
+ - **Real-time Validation**: Immediate feedback on changes
23
+
24
+ ## Usage
25
+
26
+ ### Basic Usage
27
+
28
+ \`\`\`tsx
29
+ import { DocumentEdit } from './document-edit'
30
+
31
+ const document = {
32
+ id: '1',
33
+ title: 'My Document',
34
+ description: 'Document description',
35
+ format: 'markdown',
36
+ metadata: { category: 'Development' },
37
+ content: '# Hello World',
38
+ createdAt: new Date()
39
+ }
40
+
41
+ <DocumentEdit
42
+ document={document}
43
+ onSave={(updatedDocument) => console.log('Saved:', updatedDocument)}
44
+ onCancel={() => console.log('Cancelled')}
45
+ />
46
+ \`\`\`
47
+
48
+ ### With Knowledge Context Support
49
+
50
+ \`\`\`tsx
51
+ import { DocumentEdit } from './document-edit'
52
+
53
+ const knowledgeContexts = [
54
+ {
55
+ id: 'development',
56
+ label: 'Development Docs',
57
+ menuConfig: {
58
+ groupBy: ['category', 'team', 'difficulty'],
59
+ sortBy: 'updatedAt'
60
+ }
61
+ }
62
+ ]
63
+
64
+ const availableDocuments = [
65
+ // ... existing documents for learning metadata patterns
66
+ ]
67
+
68
+ <DocumentEdit
69
+ document={document}
70
+ onSave={handleSave}
71
+ onCancel={handleCancel}
72
+ availableDocuments={availableDocuments}
73
+ knowledgeContexts={knowledgeContexts}
74
+ />
75
+ \`\`\`
76
+
77
+ ## Props
78
+
79
+ ### DocumentEditProps
80
+
81
+ | Prop | Type | Default | Description |
82
+ |------|------|---------|-------------|
83
+ | \`document\` | \`KnowledgeDocument\` | - | The document to edit |
84
+ | \`onSave\` | \`(document: KnowledgeDocument) => void\` | - | Callback when document is saved |
85
+ | \`onCancel\` | \`() => void\` | - | Callback when editing is cancelled |
86
+ | \`availableDocuments\` | \`KnowledgeDocument[]\` | \`[]\` | Existing documents for metadata suggestions |
87
+ | \`knowledgeContexts\` | \`KnowledgeContext[]\` | \`[]\` | Knowledge contexts for field suggestions |
88
+
89
+ ## Metadata Features
90
+
91
+ ### Suggested Fields
92
+
93
+ The component automatically suggests metadata field names based on:
94
+
95
+ 1. **Knowledge Context Grouping**: Fields used in \`menuConfig.groupBy\` arrays
96
+ 2. **Existing Documents**: Fields found in \`metadata\` of available documents
97
+ 3. **Common Patterns**: Frequently used organizational fields
98
+
99
+ Common suggested fields include:
100
+ - \`category\` - Document category (Development, Design, Management, etc.)
101
+ - \`type\` - Document type (Guide, Reference, Tutorial, etc.)
102
+ - \`team\` - Responsible team (Frontend, Backend, DevOps, etc.)
103
+ - \`difficulty\` - Complexity level (Beginner, Intermediate, Advanced)
104
+ - \`project\` - Associated project name
105
+ - \`priority\` - Priority level (High, Medium, Low)
106
+
107
+ ### Value Suggestions
108
+
109
+ When editing metadata values:
110
+ - **Dropdown Selection**: Shows common values for known fields
111
+ - **Custom Input**: Option to enter custom values
112
+ - **Learning System**: Builds suggestions from existing document metadata
113
+
114
+ ### Visual Feedback
115
+
116
+ - **Context Hints**: Shows which fields come from knowledge contexts
117
+ - **Value Previews**: Displays common values for each field
118
+ - **Empty State**: Helpful guidance when no metadata exists yet
119
+
120
+ ## Integration Examples
121
+
122
+ ### With Document Browser
123
+
124
+ \`\`\`tsx
125
+ function KnowledgeManager() {
126
+ const [selectedDocument, setSelectedDocument] = useState(null)
127
+ const [isEditing, setIsEditing] = useState(false)
128
+
129
+ return (
130
+ <div className="flex h-screen">
131
+ <KnowledgeBrowser
132
+ documents={documents}
133
+ contexts={knowledgeContexts}
134
+ onDocumentClick={setSelectedDocument}
135
+ />
136
+
137
+ {isEditing ? (
138
+ <DocumentEdit
139
+ document={selectedDocument}
140
+ availableDocuments={documents}
141
+ knowledgeContexts={knowledgeContexts}
142
+ onSave={(doc) => {
143
+ updateDocument(doc)
144
+ setIsEditing(false)
145
+ }}
146
+ onCancel={() => setIsEditing(false)}
147
+ />
148
+ ) : (
149
+ <DocumentPreview
150
+ document={selectedDocument}
151
+ onEdit={() => setIsEditing(true)}
152
+ />
153
+ )}
154
+ </div>
155
+ )
156
+ }
157
+ \`\`\`
158
+
159
+ ### Custom Metadata Schema
160
+
161
+ \`\`\`tsx
162
+ // Define your organization's metadata schema
163
+ const metadataSchema = {
164
+ category: ['Development', 'Design', 'Management', 'Operations'],
165
+ priority: ['Critical', 'High', 'Medium', 'Low'],
166
+ team: ['Frontend', 'Backend', 'DevOps', 'Design', 'Product'],
167
+ status: ['Draft', 'Review', 'Approved', 'Published', 'Archived']
168
+ }
169
+
170
+ // Use with pre-populated documents that follow your schema
171
+ const documentsWithSchema = documents.map(doc => ({
172
+ ...doc,
173
+ metadata: {
174
+ ...doc.metadata,
175
+ category: doc.metadata?.category || 'Development',
176
+ priority: doc.metadata?.priority || 'Medium'
177
+ }
178
+ }))
179
+ \`\`\`
180
+
181
+ ## Best Practices
182
+
183
+ ### Metadata Consistency
184
+ 1. **Define Schema Early**: Establish common metadata fields for your organization
185
+ 2. **Use Knowledge Contexts**: Align metadata with how documents are organized
186
+ 3. **Provide Examples**: Include sample documents with good metadata
187
+ 4. **Regular Review**: Periodically review and standardize metadata usage
188
+
189
+ ### User Experience
190
+ 1. **Progressive Enhancement**: Start with basic fields, add more as needed
191
+ 2. **Clear Labels**: Use descriptive field names that users understand
192
+ 3. **Helpful Defaults**: Pre-populate common fields when possible
193
+ 4. **Validation**: Provide feedback for required or invalid fields
194
+
195
+ ### Performance
196
+ 1. **Lazy Loading**: Load available documents only when needed
197
+ 2. **Debounced Suggestions**: Avoid excessive API calls for suggestions
198
+ 3. **Efficient Filtering**: Optimize metadata value lookups
199
+ 4. **Caching**: Cache frequently used metadata patterns
200
+
201
+ ## Migration from Tags
202
+
203
+ If migrating from a tag-based system:
204
+
205
+ \`\`\`tsx
206
+ // Convert tags to metadata
207
+ function convertTagsToMetadata(document) {
208
+ const metadata = { ...document.metadata }
209
+
210
+ if (document.tags) {
211
+ // Convert common tag patterns to structured metadata
212
+ document.tags.forEach(tag => {
213
+ if (['beginner', 'intermediate', 'advanced'].includes(tag)) {
214
+ metadata.difficulty = tag
215
+ } else if (['frontend', 'backend', 'devops'].includes(tag)) {
216
+ metadata.team = tag
217
+ } else if (['guide', 'reference', 'tutorial'].includes(tag)) {
218
+ metadata.type = tag
219
+ }
220
+ // Add remaining tags as topics or keywords array
221
+ else {
222
+ metadata.topics = metadata.topics || []
223
+ metadata.topics.push(tag)
224
+ }
225
+ })
226
+ }
227
+
228
+ return { ...document, metadata }
229
+ }
230
+ \`\`\`
231
+
232
+ ## Related Components
233
+
234
+ - **DocumentPreview**: For viewing documents with metadata display
235
+ - **KnowledgeBrowser**: For browsing documents organized by metadata
236
+ - **KnowledgeSearch**: For searching documents by metadata fields
237
+ - **KnowledgeView**: For complete knowledge management interfaces
238
+ `;
@@ -0,0 +1,238 @@
1
+ import"../../chunk-YEKQJ4YC.mjs";var a=`# Document Edit Component
2
+
3
+ The \`DocumentEdit\` component provides a comprehensive editing interface for knowledge documents with enhanced metadata management and intelligent suggestions.
4
+
5
+ ## Key Features
6
+
7
+ ### \u{1F3F7}\uFE0F Smart Metadata Management
8
+ - **Editable Key-Value Pairs**: Add, edit, and remove metadata fields dynamically
9
+ - **Context-based Suggestions**: Field names suggested from knowledge contexts and existing documents
10
+ - **Value Autocomplete**: Common values suggested for known metadata fields
11
+ - **Visual Guidance**: Shows which fields are commonly used for organization
12
+
13
+ ### \u{1F517} Knowledge Context Integration
14
+ - **Context-aware Fields**: Suggests metadata keys based on knowledge context grouping rules
15
+ - **Organizational Alignment**: Helps maintain consistency with existing document organization
16
+ - **Cross-document Learning**: Learns from existing documents to suggest appropriate values
17
+
18
+ ### \u{1F4DD} Enhanced Editing Experience
19
+ - **Streamlined Interface**: Clean, intuitive design focused on content creation
20
+ - **Rich Metadata**: Support for flexible metadata schemas
21
+ - **Format Support**: Works with markdown, MDX, rich text, and plain text formats
22
+ - **Real-time Validation**: Immediate feedback on changes
23
+
24
+ ## Usage
25
+
26
+ ### Basic Usage
27
+
28
+ \`\`\`tsx
29
+ import { DocumentEdit } from './document-edit'
30
+
31
+ const document = {
32
+ id: '1',
33
+ title: 'My Document',
34
+ description: 'Document description',
35
+ format: 'markdown',
36
+ metadata: { category: 'Development' },
37
+ content: '# Hello World',
38
+ createdAt: new Date()
39
+ }
40
+
41
+ <DocumentEdit
42
+ document={document}
43
+ onSave={(updatedDocument) => console.log('Saved:', updatedDocument)}
44
+ onCancel={() => console.log('Cancelled')}
45
+ />
46
+ \`\`\`
47
+
48
+ ### With Knowledge Context Support
49
+
50
+ \`\`\`tsx
51
+ import { DocumentEdit } from './document-edit'
52
+
53
+ const knowledgeContexts = [
54
+ {
55
+ id: 'development',
56
+ label: 'Development Docs',
57
+ menuConfig: {
58
+ groupBy: ['category', 'team', 'difficulty'],
59
+ sortBy: 'updatedAt'
60
+ }
61
+ }
62
+ ]
63
+
64
+ const availableDocuments = [
65
+ // ... existing documents for learning metadata patterns
66
+ ]
67
+
68
+ <DocumentEdit
69
+ document={document}
70
+ onSave={handleSave}
71
+ onCancel={handleCancel}
72
+ availableDocuments={availableDocuments}
73
+ knowledgeContexts={knowledgeContexts}
74
+ />
75
+ \`\`\`
76
+
77
+ ## Props
78
+
79
+ ### DocumentEditProps
80
+
81
+ | Prop | Type | Default | Description |
82
+ |------|------|---------|-------------|
83
+ | \`document\` | \`KnowledgeDocument\` | - | The document to edit |
84
+ | \`onSave\` | \`(document: KnowledgeDocument) => void\` | - | Callback when document is saved |
85
+ | \`onCancel\` | \`() => void\` | - | Callback when editing is cancelled |
86
+ | \`availableDocuments\` | \`KnowledgeDocument[]\` | \`[]\` | Existing documents for metadata suggestions |
87
+ | \`knowledgeContexts\` | \`KnowledgeContext[]\` | \`[]\` | Knowledge contexts for field suggestions |
88
+
89
+ ## Metadata Features
90
+
91
+ ### Suggested Fields
92
+
93
+ The component automatically suggests metadata field names based on:
94
+
95
+ 1. **Knowledge Context Grouping**: Fields used in \`menuConfig.groupBy\` arrays
96
+ 2. **Existing Documents**: Fields found in \`metadata\` of available documents
97
+ 3. **Common Patterns**: Frequently used organizational fields
98
+
99
+ Common suggested fields include:
100
+ - \`category\` - Document category (Development, Design, Management, etc.)
101
+ - \`type\` - Document type (Guide, Reference, Tutorial, etc.)
102
+ - \`team\` - Responsible team (Frontend, Backend, DevOps, etc.)
103
+ - \`difficulty\` - Complexity level (Beginner, Intermediate, Advanced)
104
+ - \`project\` - Associated project name
105
+ - \`priority\` - Priority level (High, Medium, Low)
106
+
107
+ ### Value Suggestions
108
+
109
+ When editing metadata values:
110
+ - **Dropdown Selection**: Shows common values for known fields
111
+ - **Custom Input**: Option to enter custom values
112
+ - **Learning System**: Builds suggestions from existing document metadata
113
+
114
+ ### Visual Feedback
115
+
116
+ - **Context Hints**: Shows which fields come from knowledge contexts
117
+ - **Value Previews**: Displays common values for each field
118
+ - **Empty State**: Helpful guidance when no metadata exists yet
119
+
120
+ ## Integration Examples
121
+
122
+ ### With Document Browser
123
+
124
+ \`\`\`tsx
125
+ function KnowledgeManager() {
126
+ const [selectedDocument, setSelectedDocument] = useState(null)
127
+ const [isEditing, setIsEditing] = useState(false)
128
+
129
+ return (
130
+ <div className="flex h-screen">
131
+ <KnowledgeBrowser
132
+ documents={documents}
133
+ contexts={knowledgeContexts}
134
+ onDocumentClick={setSelectedDocument}
135
+ />
136
+
137
+ {isEditing ? (
138
+ <DocumentEdit
139
+ document={selectedDocument}
140
+ availableDocuments={documents}
141
+ knowledgeContexts={knowledgeContexts}
142
+ onSave={(doc) => {
143
+ updateDocument(doc)
144
+ setIsEditing(false)
145
+ }}
146
+ onCancel={() => setIsEditing(false)}
147
+ />
148
+ ) : (
149
+ <DocumentPreview
150
+ document={selectedDocument}
151
+ onEdit={() => setIsEditing(true)}
152
+ />
153
+ )}
154
+ </div>
155
+ )
156
+ }
157
+ \`\`\`
158
+
159
+ ### Custom Metadata Schema
160
+
161
+ \`\`\`tsx
162
+ // Define your organization's metadata schema
163
+ const metadataSchema = {
164
+ category: ['Development', 'Design', 'Management', 'Operations'],
165
+ priority: ['Critical', 'High', 'Medium', 'Low'],
166
+ team: ['Frontend', 'Backend', 'DevOps', 'Design', 'Product'],
167
+ status: ['Draft', 'Review', 'Approved', 'Published', 'Archived']
168
+ }
169
+
170
+ // Use with pre-populated documents that follow your schema
171
+ const documentsWithSchema = documents.map(doc => ({
172
+ ...doc,
173
+ metadata: {
174
+ ...doc.metadata,
175
+ category: doc.metadata?.category || 'Development',
176
+ priority: doc.metadata?.priority || 'Medium'
177
+ }
178
+ }))
179
+ \`\`\`
180
+
181
+ ## Best Practices
182
+
183
+ ### Metadata Consistency
184
+ 1. **Define Schema Early**: Establish common metadata fields for your organization
185
+ 2. **Use Knowledge Contexts**: Align metadata with how documents are organized
186
+ 3. **Provide Examples**: Include sample documents with good metadata
187
+ 4. **Regular Review**: Periodically review and standardize metadata usage
188
+
189
+ ### User Experience
190
+ 1. **Progressive Enhancement**: Start with basic fields, add more as needed
191
+ 2. **Clear Labels**: Use descriptive field names that users understand
192
+ 3. **Helpful Defaults**: Pre-populate common fields when possible
193
+ 4. **Validation**: Provide feedback for required or invalid fields
194
+
195
+ ### Performance
196
+ 1. **Lazy Loading**: Load available documents only when needed
197
+ 2. **Debounced Suggestions**: Avoid excessive API calls for suggestions
198
+ 3. **Efficient Filtering**: Optimize metadata value lookups
199
+ 4. **Caching**: Cache frequently used metadata patterns
200
+
201
+ ## Migration from Tags
202
+
203
+ If migrating from a tag-based system:
204
+
205
+ \`\`\`tsx
206
+ // Convert tags to metadata
207
+ function convertTagsToMetadata(document) {
208
+ const metadata = { ...document.metadata }
209
+
210
+ if (document.tags) {
211
+ // Convert common tag patterns to structured metadata
212
+ document.tags.forEach(tag => {
213
+ if (['beginner', 'intermediate', 'advanced'].includes(tag)) {
214
+ metadata.difficulty = tag
215
+ } else if (['frontend', 'backend', 'devops'].includes(tag)) {
216
+ metadata.team = tag
217
+ } else if (['guide', 'reference', 'tutorial'].includes(tag)) {
218
+ metadata.type = tag
219
+ }
220
+ // Add remaining tags as topics or keywords array
221
+ else {
222
+ metadata.topics = metadata.topics || []
223
+ metadata.topics.push(tag)
224
+ }
225
+ })
226
+ }
227
+
228
+ return { ...document, metadata }
229
+ }
230
+ \`\`\`
231
+
232
+ ## Related Components
233
+
234
+ - **DocumentPreview**: For viewing documents with metadata display
235
+ - **KnowledgeBrowser**: For browsing documents organized by metadata
236
+ - **KnowledgeSearch**: For searching documents by metadata fields
237
+ - **KnowledgeView**: For complete knowledge management interfaces
238
+ `;export{a as default};
@@ -0,0 +1,210 @@
1
+ var r=`# Document Preview Component
2
+
3
+ The \`DocumentPreview\` component displays knowledge documents with support for multiple file formats and custom renderers.
4
+
5
+ ## Supported Formats
6
+
7
+ - **Markdown** (\`.md\`) - Standard markdown with basic formatting
8
+ - **MDX** (\`.mdx\`) - Markdown with embedded React components
9
+ - **RichText** - PayloadCMS rich text content
10
+ - **Text** (\`.txt\`) - Plain text with preserved formatting
11
+
12
+ ## Usage
13
+
14
+ ### Basic Usage
15
+
16
+ \`\`\`tsx
17
+ import { DocumentPreview } from './document-preview'
18
+
19
+ const document = {
20
+ id: '1',
21
+ title: 'My Document',
22
+ format: 'markdown',
23
+ content: '# Hello World\\n\\nThis is **bold** text.',
24
+ createdAt: new Date()
25
+ }
26
+
27
+ <DocumentPreview document={document} />
28
+ \`\`\`
29
+
30
+ ### With Custom Renderers
31
+
32
+ \`\`\`tsx
33
+ import { DocumentPreview } from './document-preview'
34
+ import ReactMarkdown from 'react-markdown'
35
+ import { RichText } from '@payloadcms/richtext-lexical/react'
36
+
37
+ const customRenderers = {
38
+ markdown: (content: string) => (
39
+ <div className="prose prose-slate dark:prose-invert max-w-none">
40
+ <ReactMarkdown>{content}</ReactMarkdown>
41
+ </div>
42
+ ),
43
+
44
+ richtext: (content: string) => {
45
+ const richTextData = JSON.parse(content)
46
+ return (
47
+ <div className="prose prose-slate dark:prose-invert max-w-none">
48
+ <RichText data={richTextData} />
49
+ </div>
50
+ )
51
+ },
52
+
53
+ text: (content: string) => (
54
+ <pre className="whitespace-pre-wrap font-mono text-sm">
55
+ {content}
56
+ </pre>
57
+ )
58
+ }
59
+
60
+ <DocumentPreview
61
+ document={document}
62
+ renderers={customRenderers}
63
+ editable={true}
64
+ onDocumentUpdate={(updatedDoc) => console.log('Updated:', updatedDoc)}
65
+ />
66
+ \`\`\`
67
+
68
+ ## Available Dependencies
69
+
70
+ The project already includes these useful dependencies for rendering:
71
+
72
+ - \`@mdx-js/react\` - For MDX rendering
73
+ - \`@payloadcms/richtext-lexical\` - For PayloadCMS RichText
74
+ - \`@tailwindcss/typography\` - For typography styling
75
+
76
+ ## Custom Renderer Examples
77
+
78
+ ### React Markdown
79
+
80
+ \`\`\`bash
81
+ npm install react-markdown remark-gfm rehype-highlight
82
+ \`\`\`
83
+
84
+ \`\`\`tsx
85
+ import ReactMarkdown from 'react-markdown'
86
+ import remarkGfm from 'remark-gfm'
87
+ import rehypeHighlight from 'rehype-highlight'
88
+
89
+ const markdownRenderer = (content: string) => (
90
+ <div className="prose prose-slate dark:prose-invert max-w-none">
91
+ <ReactMarkdown
92
+ remarkPlugins={[remarkGfm]}
93
+ rehypePlugins={[rehypeHighlight]}
94
+ >
95
+ {content}
96
+ </ReactMarkdown>
97
+ </div>
98
+ )
99
+ \`\`\`
100
+
101
+ ### MDX with next-mdx-remote
102
+
103
+ \`\`\`bash
104
+ npm install next-mdx-remote
105
+ \`\`\`
106
+
107
+ \`\`\`tsx
108
+ import { MDXRemote } from 'next-mdx-remote'
109
+ import { serialize } from 'next-mdx-remote/serialize'
110
+
111
+ const mdxRenderer = async (content: string) => {
112
+ const mdxSource = await serialize(content)
113
+ return (
114
+ <div className="prose prose-slate dark:prose-invert max-w-none">
115
+ <MDXRemote {...mdxSource} />
116
+ </div>
117
+ )
118
+ }
119
+ \`\`\`
120
+
121
+ ### PayloadCMS RichText
122
+
123
+ \`\`\`tsx
124
+ import { RichText } from '@payloadcms/richtext-lexical/react'
125
+
126
+ const richTextRenderer = (content: string) => {
127
+ try {
128
+ const richTextData = JSON.parse(content)
129
+ return (
130
+ <div className="prose prose-slate dark:prose-invert max-w-none">
131
+ <RichText data={richTextData} />
132
+ </div>
133
+ )
134
+ } catch (error) {
135
+ return (
136
+ <div className="text-red-500 text-sm">
137
+ Error parsing RichText content: {error.message}
138
+ </div>
139
+ )
140
+ }
141
+ }
142
+ \`\`\`
143
+
144
+ ## Props
145
+
146
+ ### DocumentPreview Props
147
+
148
+ | Prop | Type | Default | Description |
149
+ |------|------|---------|-------------|
150
+ | \`document\` | \`KnowledgeDocument\` | - | The document to display |
151
+ | \`editable\` | \`boolean\` | \`true\` | Whether the document can be edited |
152
+ | \`renderers\` | \`DocumentRenderers\` | - | Custom renderers for different formats |
153
+ | \`onDocumentUpdate\` | \`(doc: KnowledgeDocument) => void\` | - | Callback when document is updated |
154
+
155
+ ### DocumentRenderers Type
156
+
157
+ \`\`\`tsx
158
+ interface DocumentRenderers {
159
+ markdown?: (content: string) => ReactNode
160
+ mdx?: (content: string) => ReactNode
161
+ richtext?: (content: string) => ReactNode
162
+ text?: (content: string) => ReactNode
163
+ }
164
+ \`\`\`
165
+
166
+ ### KnowledgeDocument Type
167
+
168
+ \`\`\`tsx
169
+ interface KnowledgeDocument {
170
+ id: string
171
+ title: string
172
+ description?: string
173
+ metadata?: Record<string, any>
174
+ content?: string
175
+ format: 'markdown' | 'mdx' | 'richtext' | 'text'
176
+ tags?: string[]
177
+ createdAt: Date
178
+ updatedAt?: Date
179
+ }
180
+ \`\`\`
181
+
182
+ ## Default Renderers
183
+
184
+ If no custom renderers are provided, the component uses built-in default renderers:
185
+
186
+ - **Markdown**: Basic HTML conversion with support for headings, bold, italic, and code
187
+ - **Text**: Monospace font with preserved whitespace
188
+ - **RichText**: Placeholder with raw content display
189
+ - **MDX**: Placeholder with basic markdown rendering
190
+
191
+ ## Styling
192
+
193
+ The component uses Tailwind CSS classes and supports dark mode through CSS variables. Key styling features:
194
+
195
+ - Responsive design
196
+ - Typography classes from \`@tailwindcms/typography\`
197
+ - Dark mode support
198
+ - Smooth animations with Framer Motion
199
+ - Consistent spacing and borders
200
+
201
+ ## Examples
202
+
203
+ Check out the Storybook stories for interactive examples:
204
+
205
+ - \`MarkdownWithCustomRenderer\` - Markdown with enhanced rendering
206
+ - \`TextFormat\` - Plain text documents
207
+ - \`RichTextFormat\` - PayloadCMS rich content
208
+ - \`MDXFormat\` - MDX with React components
209
+ - \`AllFormatsComparison\` - Side-by-side format comparison
210
+ `;