@solidxai/core-ui 0.1.12-beta.7 → 0.1.12-beta.9

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 (233) hide show
  1. package/dist/components/auth/AuthLayout.d.ts.map +1 -1
  2. package/dist/components/auth/AuthLayout.js +19 -17
  3. package/dist/components/auth/AuthLayout.js.map +1 -1
  4. package/dist/components/auth/AuthLayout.tsx +59 -34
  5. package/dist/components/common/BackendReconnectIndicator.d.ts +6 -0
  6. package/dist/components/common/BackendReconnectIndicator.d.ts.map +1 -0
  7. package/dist/components/common/BackendReconnectIndicator.js +25 -0
  8. package/dist/components/common/BackendReconnectIndicator.js.map +1 -0
  9. package/dist/components/common/BackendReconnectIndicator.tsx +45 -0
  10. package/dist/components/common/SettingsComponent.d.ts.map +1 -1
  11. package/dist/components/common/SettingsComponent.js +7 -3
  12. package/dist/components/common/SettingsComponent.js.map +1 -1
  13. package/dist/components/common/SettingsComponent.module.css +144 -12
  14. package/dist/components/common/SettingsComponent.tsx +22 -3
  15. package/dist/components/common/SolidAdmin.d.ts.map +1 -1
  16. package/dist/components/common/SolidAdmin.js +7 -2
  17. package/dist/components/common/SolidAdmin.js.map +1 -1
  18. package/dist/components/common/SolidAdmin.tsx +7 -2
  19. package/dist/components/common/SolidBreadcrumb.d.ts.map +1 -1
  20. package/dist/components/common/SolidBreadcrumb.js +1 -6
  21. package/dist/components/common/SolidBreadcrumb.js.map +1 -1
  22. package/dist/components/common/SolidBreadcrumb.tsx +1 -8
  23. package/dist/components/common/SolidMaterialSymbol.d.ts +10 -0
  24. package/dist/components/common/SolidMaterialSymbol.d.ts.map +1 -0
  25. package/dist/components/common/SolidMaterialSymbol.js +69 -0
  26. package/dist/components/common/SolidMaterialSymbol.js.map +1 -0
  27. package/dist/components/common/SolidMaterialSymbol.tsx +96 -0
  28. package/dist/components/common/SolidToastProvider.d.ts.map +1 -1
  29. package/dist/components/common/SolidToastProvider.js +14 -1
  30. package/dist/components/common/SolidToastProvider.js.map +1 -1
  31. package/dist/components/common/SolidToastProvider.tsx +19 -1
  32. package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.module.css +3 -1
  33. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  34. package/dist/components/core/common/SolidGlobalSearchElement.js +3 -2
  35. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  36. package/dist/components/core/common/SolidGlobalSearchElement.tsx +14 -18
  37. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map +1 -1
  38. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +43 -16
  39. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
  40. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +24 -2
  41. package/dist/components/core/form/SolidFormFooter.js +1 -1
  42. package/dist/components/core/form/SolidFormFooter.js.map +1 -1
  43. package/dist/components/core/form/SolidFormFooter.tsx +1 -1
  44. package/dist/components/core/form/SolidFormLayouts.js +1 -1
  45. package/dist/components/core/form/SolidFormLayouts.js.map +1 -1
  46. package/dist/components/core/form/SolidFormLayouts.tsx +2 -2
  47. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  48. package/dist/components/core/form/fields/SolidMediaMultipleField.js +120 -56
  49. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  50. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +63 -50
  51. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  52. package/dist/components/core/form/fields/SolidMediaSingleField.js +115 -37
  53. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  54. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +36 -35
  55. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  56. package/dist/components/core/form/fields/SolidRichTextField.js +54 -5
  57. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  58. package/dist/components/core/form/fields/SolidRichTextField.tsx +71 -7
  59. package/dist/components/core/form/fields/mediaFieldUtils.d.ts +3 -0
  60. package/dist/components/core/form/fields/mediaFieldUtils.d.ts.map +1 -0
  61. package/dist/components/core/form/fields/mediaFieldUtils.js +30 -0
  62. package/dist/components/core/form/fields/mediaFieldUtils.js.map +1 -0
  63. package/dist/components/core/form/fields/mediaFieldUtils.ts +45 -0
  64. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.d.ts.map +1 -1
  65. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js +1 -1
  66. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.js.map +1 -1
  67. package/dist/components/core/form/fields/relations/RolesGroupedByModuleWidget.tsx +3 -1
  68. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  69. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +22 -23
  70. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  71. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +13 -7
  72. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.d.ts.map +1 -1
  73. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +16 -11
  74. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
  75. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +32 -18
  76. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.d.ts.map +1 -1
  77. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js +3 -1
  78. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.js.map +1 -1
  79. package/dist/components/core/form/fields/widgets/SolidIconViewWidget.tsx +11 -5
  80. package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
  81. package/dist/components/core/list/SolidDataTable.js +3 -2
  82. package/dist/components/core/list/SolidDataTable.js.map +1 -1
  83. package/dist/components/core/list/SolidDataTable.tsx +3 -2
  84. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  85. package/dist/components/core/list/SolidListView.js +11 -5
  86. package/dist/components/core/list/SolidListView.js.map +1 -1
  87. package/dist/components/core/list/SolidListView.tsx +15 -8
  88. package/dist/components/core/list/SolidListViewColumn.d.ts.map +1 -1
  89. package/dist/components/core/list/SolidListViewColumn.js +1 -0
  90. package/dist/components/core/list/SolidListViewColumn.js.map +1 -1
  91. package/dist/components/core/list/SolidListViewColumn.tsx +1 -0
  92. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  93. package/dist/components/core/list/columns/SolidShortTextColumn.js +7 -2
  94. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  95. package/dist/components/core/list/columns/SolidShortTextColumn.tsx +7 -2
  96. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.d.ts.map +1 -1
  97. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js +4 -1
  98. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.js.map +1 -1
  99. package/dist/components/core/list/columns/relations/SolidRelationManyToManyColumn.tsx +5 -2
  100. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
  101. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +2 -1
  102. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
  103. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -1
  104. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.d.ts.map +1 -1
  105. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js +4 -1
  106. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.js.map +1 -1
  107. package/dist/components/core/list/columns/relations/SolidRelationOneToManyColumn.tsx +5 -2
  108. package/dist/components/core/locales/SolidLocale.d.ts.map +1 -1
  109. package/dist/components/core/locales/SolidLocale.js +1 -1
  110. package/dist/components/core/locales/SolidLocale.js.map +1 -1
  111. package/dist/components/core/locales/SolidLocale.tsx +1 -0
  112. package/dist/components/core/model/CreateModel.css +26 -0
  113. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  114. package/dist/components/core/model/FieldMetaData.js +21 -3
  115. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  116. package/dist/components/core/model/FieldMetaData.tsx +45 -4
  117. package/dist/components/core/model/FieldMetaDataForm.css +82 -0
  118. package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -0
  119. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  120. package/dist/components/core/model/FieldMetaDataForm.js +246 -235
  121. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  122. package/dist/components/core/model/FieldMetaDataForm.tsx +46 -34
  123. package/dist/components/core/model/FieldSelector.js +1 -1
  124. package/dist/components/core/model/FieldSelector.js.map +1 -1
  125. package/dist/components/core/model/FieldSelector.tsx +1 -1
  126. package/dist/components/core/model/ModelMetaData.js +1 -1
  127. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  128. package/dist/components/core/model/ModelMetaData.tsx +1 -1
  129. package/dist/components/core/module/CreateModule.css +55 -2
  130. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  131. package/dist/components/core/module/CreateModule.js +2 -2
  132. package/dist/components/core/module/CreateModule.js.map +1 -1
  133. package/dist/components/core/module/CreateModule.tsx +3 -2
  134. package/dist/components/core/module/ModuleMetadataExplorer.css +27 -0
  135. package/dist/components/core/module/ModuleMetadataExplorer.d.ts.map +1 -1
  136. package/dist/components/core/module/ModuleMetadataExplorer.js +1 -1
  137. package/dist/components/core/module/ModuleMetadataExplorer.js.map +1 -1
  138. package/dist/components/core/module/ModuleMetadataExplorer.tsx +1 -0
  139. package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
  140. package/dist/components/core/tree/SolidTreeView.js +6 -1
  141. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  142. package/dist/components/core/tree/SolidTreeView.tsx +7 -1
  143. package/dist/components/layout/AdminHeaderActions.d.ts.map +1 -1
  144. package/dist/components/layout/AdminHeaderActions.js +10 -9
  145. package/dist/components/layout/AdminHeaderActions.js.map +1 -1
  146. package/dist/components/layout/AdminHeaderActions.tsx +2 -0
  147. package/dist/components/layout/AppSidebar.d.ts.map +1 -1
  148. package/dist/components/layout/AppSidebar.js +2 -1
  149. package/dist/components/layout/AppSidebar.js.map +1 -1
  150. package/dist/components/layout/AppSidebar.tsx +12 -5
  151. package/dist/components/layout/SolidMenuItemIcon.d.ts +9 -0
  152. package/dist/components/layout/SolidMenuItemIcon.d.ts.map +1 -0
  153. package/dist/components/layout/SolidMenuItemIcon.js +20 -0
  154. package/dist/components/layout/SolidMenuItemIcon.js.map +1 -0
  155. package/dist/components/layout/SolidMenuItemIcon.tsx +45 -0
  156. package/dist/components/layout/navbar-two-menu.d.ts.map +1 -1
  157. package/dist/components/layout/navbar-two-menu.js +6 -7
  158. package/dist/components/layout/navbar-two-menu.js.map +1 -1
  159. package/dist/components/layout/navbar-two-menu.tsx +4 -12
  160. package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
  161. package/dist/components/shad-cn-ui/SolidCodeEditor.js +30 -2
  162. package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
  163. package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +38 -1
  164. package/dist/helpers/backendHealthMonitor.d.ts +39 -0
  165. package/dist/helpers/backendHealthMonitor.d.ts.map +1 -0
  166. package/dist/helpers/backendHealthMonitor.js +255 -0
  167. package/dist/helpers/backendHealthMonitor.js.map +1 -0
  168. package/dist/helpers/backendHealthMonitor.ts +177 -0
  169. package/dist/helpers/helpers.d.ts +1 -0
  170. package/dist/helpers/helpers.d.ts.map +1 -1
  171. package/dist/helpers/helpers.js +9 -0
  172. package/dist/helpers/helpers.js.map +1 -1
  173. package/dist/helpers/helpers.ts +11 -1
  174. package/dist/helpers/menuItemIcons.d.ts +34 -0
  175. package/dist/helpers/menuItemIcons.d.ts.map +1 -0
  176. package/dist/helpers/menuItemIcons.js +144 -0
  177. package/dist/helpers/menuItemIcons.js.map +1 -0
  178. package/dist/helpers/menuItemIcons.ts +191 -0
  179. package/dist/helpers/relationDisplay.d.ts +3 -0
  180. package/dist/helpers/relationDisplay.d.ts.map +1 -0
  181. package/dist/helpers/relationDisplay.js +92 -0
  182. package/dist/helpers/relationDisplay.js.map +1 -0
  183. package/dist/helpers/relationDisplay.ts +101 -0
  184. package/dist/helpers/settingsPayload.d.ts +1 -0
  185. package/dist/helpers/settingsPayload.d.ts.map +1 -1
  186. package/dist/helpers/settingsPayload.js.map +1 -1
  187. package/dist/helpers/settingsPayload.ts +1 -0
  188. package/dist/helpers/solidIcons.d.ts +2 -0
  189. package/dist/helpers/solidIcons.d.ts.map +1 -1
  190. package/dist/helpers/solidIcons.js +8 -0
  191. package/dist/helpers/solidIcons.js.map +1 -1
  192. package/dist/helpers/solidIcons.tsx +10 -1
  193. package/dist/helpers/waitForBackendAvailability.d.ts +1 -0
  194. package/dist/helpers/waitForBackendAvailability.d.ts.map +1 -1
  195. package/dist/helpers/waitForBackendAvailability.js +35 -22
  196. package/dist/helpers/waitForBackendAvailability.js.map +1 -1
  197. package/dist/helpers/waitForBackendAvailability.ts +18 -12
  198. package/dist/http/solidHttp.d.ts.map +1 -1
  199. package/dist/http/solidHttp.js +10 -4
  200. package/dist/http/solidHttp.js.map +1 -1
  201. package/dist/http/solidHttp.ts +9 -4
  202. package/dist/redux/api/datasourceIntrospectionApi.d.ts +4 -0
  203. package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -1
  204. package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -1
  205. package/dist/redux/api/datasourceIntrospectionApi.ts +4 -0
  206. package/dist/redux/api/fetchBaseQuery.d.ts.map +1 -1
  207. package/dist/redux/api/fetchBaseQuery.js +9 -3
  208. package/dist/redux/api/fetchBaseQuery.js.map +1 -1
  209. package/dist/redux/api/fetchBaseQuery.tsx +9 -3
  210. package/dist/redux/store/StoreProvider.d.ts.map +1 -1
  211. package/dist/redux/store/StoreProvider.js +4 -3
  212. package/dist/redux/store/StoreProvider.js.map +1 -1
  213. package/dist/redux/store/StoreProvider.tsx +4 -3
  214. package/dist/resources/globals.css +341 -49
  215. package/dist/resources/solid-custom.css +410 -12
  216. package/dist/resources/solid-responsive.css +27 -16
  217. package/dist/resources/solid-tailwind-generated.css +1 -1
  218. package/dist/routes/AppEventListener.d.ts.map +1 -1
  219. package/dist/routes/AppEventListener.js +23 -0
  220. package/dist/routes/AppEventListener.js.map +1 -1
  221. package/dist/routes/AppEventListener.tsx +29 -0
  222. package/dist/routes/pages/admin/core/DashboardPage.module.css +12 -0
  223. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +306 -3
  224. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
  225. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +745 -393
  226. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
  227. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1074 -420
  228. package/dist/routes/pages/admin/core/DatasourcesPage.css +15 -0
  229. package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -1
  230. package/dist/routes/pages/admin/core/DatasourcesPage.js +7 -188
  231. package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -1
  232. package/dist/routes/pages/admin/core/DatasourcesPage.tsx +3 -393
  233. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleMetadataExplorer.js","sourceRoot":"","sources":["../../../../src/components/core/module/ModuleMetadataExplorer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;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C,WAAW,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,cAAM,OAAA,mBAAmB,CAAC,KAAK,CAAC,EAA1B,CAA0B,EAAE,QAAQ,EAAE,eAAe,uBAE/F,EACd,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,QAAQ,qBAEjF,IACI,IACR,IACV,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { ChevronDown, ChevronRight, DatabaseZap, FileSearch, Save, Search, Settings, Wand2 } from \"lucide-react\";\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport {\n useGetModuleMetadataExplorerDocumentQuery,\n useGetModuleMetadataExplorerManifestQuery,\n useSeedModuleMetadataMutation,\n useUpdateModuleMetadataExplorerSectionMutation,\n useValidateModuleMetadataExplorerSectionMutation,\n} from \"../../../redux/api/moduleApi\";\nimport { showToast } from \"../../../redux/features/toastSlice\";\nimport {\n SolidButton,\n SolidDialog,\n SolidDialogBody,\n SolidDialogFooter,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuTrigger,\n SolidInput,\n SolidMessage,\n SolidTag,\n} from \"../../shad-cn-ui\";\nimport \"jsoneditor/dist/jsoneditor.css\";\nimport \"./ModuleMetadataExplorer.css\";\n\ntype ModuleMetadataExplorerProps = {\n moduleName?: string;\n moduleId?: number;\n modelSingularName?: string;\n scopedArrayPath?: string;\n scopedItemValue?: string;\n scopedItemField?: string;\n readOnly?: boolean;\n allowSeed?: boolean;\n};\n\ntype MetadataIssue = {\n path: string;\n message: string;\n severity: \"error\" | \"warning\";\n};\n\ntype ExplorerSectionDefinition = {\n key: string;\n title: string;\n jsonPath: string;\n type: \"object\" | \"array\";\n description: string;\n};\n\ntype ExplorerTreeNode = {\n id: string;\n label: string;\n path: string;\n parentPath: string | null;\n sectionKey: string;\n sectionTitle: string;\n children: ExplorerTreeNode[];\n};\n\ntype JsonEditorHandle = {\n format: () => void;\n};\n\nfunction extractApiErrorMessage(error: any) {\n const message = error?.data?.message ?? error?.message ?? \"Something went wrong\";\n return Array.isArray(message) ? message.join(\", \") : String(message);\n}\n\nfunction serializeJson(value: any) {\n try {\n return JSON.stringify(value);\n } catch (_error) {\n return \"\";\n }\n}\n\nfunction deepCloneJson<T>(value: T): T {\n return JSON.parse(JSON.stringify(value));\n}\n\nfunction humanizeKey(value: string) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim()\n .replace(/^./, (char) => char.toUpperCase());\n}\n\nfunction tokenizePath(path: string) {\n const tokens: Array<string | number> = [];\n const regex = /([^[.\\]]+)|\\[(\\d+)\\]/g;\n let match: RegExpExecArray | null;\n while ((match = regex.exec(path)) !== null) {\n if (match[1] !== undefined) {\n tokens.push(match[1]);\n } else if (match[2] !== undefined) {\n tokens.push(Number(match[2]));\n }\n }\n return tokens;\n}\n\nfunction getValueAtJsonPath(source: any, path: string) {\n if (!path) return source;\n return tokenizePath(path).reduce((current, token) => {\n if (current === undefined || current === null) return undefined;\n return current[token as keyof typeof current];\n }, source);\n}\n\nfunction setValueAtJsonPath(target: any, path: string, value: any) {\n const tokens = tokenizePath(path);\n if (!tokens.length) return;\n\n let current = target;\n for (let index = 0; index < tokens.length - 1; index += 1) {\n current = current[tokens[index] as keyof typeof current];\n }\n\n current[tokens[tokens.length - 1] as keyof typeof current] = value;\n}\n\nfunction appendPath(basePath: string, key: string) {\n return basePath ? `${basePath}.${key}` : key;\n}\n\nfunction getArrayItemLabel(item: any, index: number, parentKey: string) {\n const labelCandidates = [\n \"singularName\",\n \"name\",\n \"displayName\",\n \"pluralName\",\n \"label\",\n \"key\",\n \"title\",\n \"id\",\n ];\n\n for (const candidate of labelCandidates) {\n const nextValue = item?.[candidate];\n if (nextValue !== undefined && nextValue !== null && `${nextValue}`.trim()) {\n return `${nextValue}`;\n }\n }\n\n return `${humanizeKey(parentKey || \"Item\")} ${index + 1}`;\n}\n\nfunction buildTreeNode(\n value: any,\n options: {\n label: string;\n path: string;\n parentPath: string | null;\n sectionKey: string;\n sectionTitle: string;\n hintKey: string;\n },\n): ExplorerTreeNode {\n const { label, path, parentPath, sectionKey, sectionTitle, hintKey } = options;\n\n let children: ExplorerTreeNode[] = [];\n\n if (Array.isArray(value)) {\n children = value\n .filter((item) => item !== null && typeof item === \"object\")\n .map((item, index) => buildTreeNode(item, {\n label: getArrayItemLabel(item, index, hintKey),\n path: `${path}[${index}]`,\n parentPath: path,\n sectionKey,\n sectionTitle,\n hintKey,\n }));\n } else if (value && typeof value === \"object\") {\n children = Object.entries(value)\n .filter(([, nextValue]) => nextValue !== null && typeof nextValue === \"object\")\n .map(([key, nextValue]) => buildTreeNode(nextValue, {\n label: humanizeKey(key),\n path: appendPath(path, key),\n parentPath: path,\n sectionKey,\n sectionTitle,\n hintKey: key,\n }));\n }\n\n return {\n id: path,\n label,\n path,\n parentPath,\n sectionKey,\n sectionTitle,\n children,\n };\n}\n\nfunction buildTreeFromDocument(sections: ExplorerSectionDefinition[], documentValue: any) {\n const nodes = sections\n .map((section) => {\n const sectionValue = getValueAtJsonPath(documentValue, section.jsonPath);\n if (sectionValue === undefined) return null;\n return buildTreeNode(sectionValue, {\n label: section.title,\n path: section.jsonPath,\n parentPath: null,\n sectionKey: section.key,\n sectionTitle: section.title,\n hintKey: section.key,\n });\n })\n .filter(Boolean) as ExplorerTreeNode[];\n\n const nodeMap = new Map<string, ExplorerTreeNode>();\n const visit = (nextNodes: ExplorerTreeNode[]) => {\n nextNodes.forEach((node) => {\n nodeMap.set(node.path, node);\n if (node.children.length) visit(node.children);\n });\n };\n visit(nodes);\n\n return { nodes, nodeMap };\n}\n\nfunction filterTreeNodes(nodes: ExplorerTreeNode[], query: string): ExplorerTreeNode[] {\n const needle = query.trim().toLowerCase();\n if (!needle) return nodes;\n\n const visit = (node: ExplorerTreeNode): ExplorerTreeNode | null => {\n const filteredChildren = node.children\n .map(visit)\n .filter(Boolean) as ExplorerTreeNode[];\n const matches = node.label.toLowerCase().includes(needle) || node.path.toLowerCase().includes(needle);\n\n if (matches || filteredChildren.length) {\n return { ...node, children: filteredChildren };\n }\n\n return null;\n };\n\n return nodes.map(visit).filter(Boolean) as ExplorerTreeNode[];\n}\n\nfunction getAncestorPaths(nodeMap: Map<string, ExplorerTreeNode>, path: string) {\n const paths: string[] = [];\n let current = nodeMap.get(path);\n\n while (current?.parentPath) {\n paths.push(current.parentPath);\n current = nodeMap.get(current.parentPath);\n }\n\n return paths;\n}\n\nfunction getSectionForPath(sections: ExplorerSectionDefinition[], path: string) {\n return sections\n .filter((section) => path === section.jsonPath || path.startsWith(`${section.jsonPath}.`) || path.startsWith(`${section.jsonPath}[`))\n .sort((left, right) => right.jsonPath.length - left.jsonPath.length)[0] ?? null;\n}\n\nfunction filterIssuesForPath(issues: MetadataIssue[], path: string) {\n return issues.filter((issue) => {\n if (!issue.path) return false;\n return issue.path === path || issue.path.startsWith(`${path}.`) || issue.path.startsWith(`${path}[`);\n });\n}\n\nconst JsonEditorSurface = React.forwardRef<JsonEditorHandle, {\n value: any;\n resetToken: string;\n readOnly?: boolean;\n onValueChange: (value: any) => void;\n onErrorChange: (message: string | null) => void;\n}>(function JsonEditorSurface({ value, resetToken, readOnly = false, onValueChange, onErrorChange }, ref) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const editorRef = useRef<any>(null);\n // Keep a ref to the latest value so the async init can seed the editor correctly\n const latestValueRef = useRef<any>(value);\n\n // Sync latest value into ref so async editor init can use it\n useEffect(() => { latestValueRef.current = value; }, [value]);\n\n const emitState = () => {\n const editor = editorRef.current;\n if (!editor) return;\n\n try {\n const nextValue = editor.get();\n onValueChange(nextValue);\n onErrorChange(null);\n } catch (error: any) {\n onErrorChange(error?.message ? String(error.message) : \"The JSON is currently invalid.\");\n }\n };\n\n useImperativeHandle(ref, () => ({\n format() {\n try {\n editorRef.current?.format?.();\n } catch (_error) {\n // jsoneditor already surfaces parse states through onErrorChange\n }\n emitState();\n },\n }), []);\n\n useEffect(() => {\n if (!containerRef.current || editorRef.current) return;\n\n let destroyed = false;\n\n // @ts-ignore\n void import(\"jsoneditor\").then((jsonEditorModule: any) => {\n if (destroyed || !containerRef.current || editorRef.current) {\n return;\n }\n\n const JSONEditor = jsonEditorModule?.default ?? jsonEditorModule;\n editorRef.current = new JSONEditor(containerRef.current, {\n mode: \"code\",\n modes: [\"code\"],\n mainMenuBar: true,\n navigationBar: true,\n statusBar: true,\n search: true,\n enableSort: false,\n enableTransform: false,\n onChange: () => emitState(),\n });\n\n // Seed editor with current value (which may already be set before async init resolved)\n try { editorRef.current.set(latestValueRef.current); } catch (_e) {}\n emitState();\n\n if (editorRef.current?.aceEditor?.setReadOnly) {\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }\n });\n\n return () => {\n destroyed = true;\n editorRef.current?.destroy?.();\n editorRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n if (!editorRef.current) return;\n editorRef.current.set(value);\n emitState();\n }, [resetToken, value]);\n\n useEffect(() => {\n if (!editorRef.current?.aceEditor?.setReadOnly) return;\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }, [readOnly]);\n\n return <div ref={containerRef} className={`solid-module-explorer-editor-host solid-module-explorer-jsoneditor ${readOnly ? \"is-readonly\" : \"\"}`} />;\n});\n\nfunction MetadataTree({\n nodes,\n activePath,\n expandedPaths,\n onToggle,\n onSelect,\n depth = 0,\n}: {\n nodes: ExplorerTreeNode[];\n activePath: string;\n expandedPaths: Set<string>;\n onToggle: (path: string) => void;\n onSelect: (path: string) => void;\n depth?: number;\n}) {\n return (\n <>\n {nodes.map((node) => {\n const isExpanded = expandedPaths.has(node.path);\n const hasChildren = node.children.length > 0;\n const isActive = activePath === node.path;\n\n return (\n <div key={node.id} className=\"solid-module-explorer-tree-node\">\n <div\n className={`solid-module-explorer-tree-row ${isActive ? \"is-active\" : \"\"}`}\n style={{ paddingLeft: `${depth * 0.9}rem` }}\n >\n <button\n type=\"button\"\n className=\"solid-module-explorer-tree-toggle\"\n onClick={() => hasChildren && onToggle(node.path)}\n aria-label={hasChildren ? (isExpanded ? \"Collapse node\" : \"Expand node\") : \"Leaf node\"}\n disabled={!hasChildren}\n >\n {hasChildren ? (isExpanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />) : <span className=\"solid-module-explorer-tree-dot\" />}\n </button>\n <button\n type=\"button\"\n className=\"solid-module-explorer-tree-label\"\n onClick={() => onSelect(node.path)}\n title={node.path}\n >\n {node.label}\n </button>\n </div>\n\n {hasChildren && isExpanded && (\n <MetadataTree\n nodes={node.children}\n activePath={activePath}\n expandedPaths={expandedPaths}\n onToggle={onToggle}\n onSelect={onSelect}\n depth={depth + 1}\n />\n )}\n </div>\n );\n })}\n </>\n );\n}\n\nexport function ModuleMetadataExplorer({\n moduleName,\n moduleId,\n modelSingularName,\n scopedArrayPath,\n scopedItemValue,\n scopedItemField,\n readOnly = false,\n allowSeed = true,\n}: ModuleMetadataExplorerProps) {\n const dispatch = useDispatch();\n const editorRef = useRef<JsonEditorHandle | null>(null);\n const explorerRef = useRef<HTMLDivElement | null>(null);\n const isResizingRef = useRef(false);\n const [activePath, setActivePath] = useState(\"\");\n const [expandedPaths, setExpandedPaths] = useState<Set<string>>(new Set());\n const [treeFilter, setTreeFilter] = useState(\"\");\n const [sidebarWidth, setSidebarWidth] = useState(280);\n const [editorValue, setEditorValue] = useState<any>({});\n const [savedValue, setSavedValue] = useState<any>({});\n const [editorError, setEditorError] = useState<string | null>(null);\n const [editorResetToken, setEditorResetToken] = useState(\"initial\");\n const [validationIssues, setValidationIssues] = useState<MetadataIssue[] | null>(null);\n const [localActionSummary, setLocalActionSummary] = useState(\"\");\n const [isContextDialogOpen, setIsContextDialogOpen] = useState(false);\n const [isSeedDialogOpen, setIsSeedDialogOpen] = useState(false);\n\n const {\n data: manifestData,\n error: manifestError,\n refetch: refetchManifest,\n } = useGetModuleMetadataExplorerManifestQuery(moduleName as string, {\n skip: !moduleName,\n });\n\n const {\n data: documentData,\n isLoading: isDocumentLoading,\n error: documentError,\n refetch: refetchDocument,\n } = useGetModuleMetadataExplorerDocumentQuery(moduleName as string, {\n skip: !moduleName,\n });\n\n const [updateSection, { isLoading: isSavingSection }] = useUpdateModuleMetadataExplorerSectionMutation();\n const [validateSection, { isLoading: isValidatingSection }] = useValidateModuleMetadataExplorerSectionMutation();\n const [seedModuleMetadata, { isLoading: isSeedingModule }] = useSeedModuleMetadataMutation();\n const isReadOnlyExplorer = readOnly || moduleName?.toLowerCase() === \"solid-core\";\n\n const sections = (manifestData?.sections ?? []) as ExplorerSectionDefinition[];\n const fullDocument = documentData?.value ?? {};\n const loadError = !manifestData || !documentData ? (manifestError ?? documentError) : null;\n\n const { nodes: treeNodes, nodeMap } = useMemo(\n () => buildTreeFromDocument(sections, fullDocument),\n [sections, fullDocument],\n );\n\n const scopedRootPath = useMemo(() => {\n // Scope to a specific model definition\n if (modelSingularName) {\n const models = getValueAtJsonPath(fullDocument, \"moduleMetadata.models\");\n if (!Array.isArray(models)) return \"\";\n const modelIndex = models.findIndex((model) => model?.singularName === modelSingularName);\n return modelIndex >= 0 ? `moduleMetadata.models[${modelIndex}]` : \"\";\n }\n // Scope to a specific item in a root-level array (e.g. views, actions, menus)\n if (scopedArrayPath && scopedItemValue) {\n const arr = getValueAtJsonPath(fullDocument, scopedArrayPath);\n if (!Array.isArray(arr)) return \"\";\n const matchField = scopedItemField ?? \"name\";\n const itemIndex = arr.findIndex((item) => item?.[matchField] === scopedItemValue);\n return itemIndex >= 0 ? `${scopedArrayPath}[${itemIndex}]` : \"\";\n }\n return \"\";\n }, [fullDocument, modelSingularName, scopedArrayPath, scopedItemValue, scopedItemField]);\n\n const scopedTreeNodes = useMemo(() => {\n if (!scopedRootPath) return treeNodes;\n const scopedNode = nodeMap.get(scopedRootPath);\n return scopedNode ? [scopedNode] : [];\n }, [nodeMap, scopedRootPath, treeNodes]);\n\n const filteredTreeNodes = useMemo(\n () => filterTreeNodes(scopedTreeNodes, treeFilter),\n [scopedTreeNodes, treeFilter],\n );\n\n const visibleExpandedPaths = useMemo(() => {\n if (!treeFilter.trim()) return expandedPaths;\n const nextExpanded = new Set<string>();\n const visit = (nodesToVisit: ExplorerTreeNode[]) => {\n nodesToVisit.forEach((node) => {\n if (node.children.length) {\n nextExpanded.add(node.path);\n visit(node.children);\n }\n });\n };\n visit(filteredTreeNodes);\n return nextExpanded;\n }, [expandedPaths, filteredTreeNodes, treeFilter]);\n\n const activeNode = activePath ? nodeMap.get(activePath) ?? null : null;\n const activeSection = activePath ? getSectionForPath(sections, activePath) : null;\n const activeValidationIssues = filterIssuesForPath(validationIssues ?? [], activePath);\n const savedSerialized = serializeJson(savedValue);\n const editorSerialized = serializeJson(editorValue);\n const isDirty = editorError ? true : savedSerialized !== editorSerialized;\n const hasMutableChanges = !isReadOnlyExplorer && isDirty;\n const canSave = !isReadOnlyExplorer && isDirty && !editorError;\n const hasValidationFailure = Boolean(editorError) || activeValidationIssues.length > 0;\n const validationSummary = editorError\n ? editorError\n : activeValidationIssues.length\n ? `${activeValidationIssues.length} validation issue${activeValidationIssues.length === 1 ? \"\" : \"s\"}: ${activeValidationIssues[0]?.message ?? \"Review this JSON before saving.\"}`\n : \"\";\n\n useEffect(() => {\n setValidationIssues(documentData?.validation?.issues ?? []);\n }, [documentData?.lastModifiedAt]);\n\n useEffect(() => {\n const handlePointerMove = (event: PointerEvent) => {\n if (!isResizingRef.current || !explorerRef.current) return;\n const bounds = explorerRef.current.getBoundingClientRect();\n const nextWidth = Math.min(Math.max(event.clientX - bounds.left, 220), 520);\n setSidebarWidth(nextWidth);\n };\n\n const handlePointerUp = () => {\n isResizingRef.current = false;\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n };\n\n window.addEventListener(\"pointermove\", handlePointerMove);\n window.addEventListener(\"pointerup\", handlePointerUp);\n\n return () => {\n window.removeEventListener(\"pointermove\", handlePointerMove);\n window.removeEventListener(\"pointerup\", handlePointerUp);\n };\n }, []);\n\n useEffect(() => {\n if (!scopedTreeNodes.length) return;\n\n const isPathInsideScope =\n !scopedRootPath ||\n activePath === scopedRootPath ||\n activePath.startsWith(`${scopedRootPath}.`) ||\n activePath.startsWith(`${scopedRootPath}[`);\n\n if (!activePath || !nodeMap.has(activePath) || !isPathInsideScope) {\n const defaultPath = scopedTreeNodes[0].path;\n setActivePath(defaultPath);\n setExpandedPaths(new Set([defaultPath]));\n }\n }, [activePath, nodeMap, scopedRootPath, scopedTreeNodes]);\n\n useEffect(() => {\n if (!activePath) return;\n const nextValue = getValueAtJsonPath(fullDocument, activePath);\n if (nextValue === undefined) return;\n setSavedValue(nextValue);\n setEditorValue(nextValue);\n setEditorError(null);\n setEditorResetToken(`${activePath}:${documentData?.lastModifiedAt ?? \"\"}`);\n }, [activePath, documentData?.lastModifiedAt, fullDocument]);\n\n const showErrorToast = (error: any) => {\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: extractApiErrorMessage(error),\n life: 4000,\n }));\n };\n\n const toggleExpandedPath = (path: string) => {\n setExpandedPaths((current) => {\n const next = new Set(current);\n if (next.has(path)) {\n next.delete(path);\n } else {\n next.add(path);\n }\n return next;\n });\n };\n\n const selectPath = (path: string) => {\n if (path === activePath) return;\n if (!isReadOnlyExplorer && isDirty) {\n const shouldProceed = window.confirm(\"You have unsaved metadata changes. Switch nodes and discard them?\");\n if (!shouldProceed) return;\n }\n\n const ancestorPaths = getAncestorPaths(nodeMap, path);\n setExpandedPaths((current) => {\n const next = new Set(current);\n ancestorPaths.forEach((ancestorPath) => next.add(ancestorPath));\n return next;\n });\n setActivePath(path);\n };\n\n const handleSidebarResizeStart = () => {\n isResizingRef.current = true;\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n };\n\n const handleCollapseAll = () => {\n setExpandedPaths(new Set());\n };\n\n const handleFormat = () => {\n editorRef.current?.format();\n };\n\n const buildPatchedDocument = () => {\n const nextDocument = deepCloneJson(fullDocument);\n setValueAtJsonPath(nextDocument, activePath, editorValue);\n return nextDocument;\n };\n\n const buildPatchedSectionValue = () => {\n if (!activeSection) return undefined;\n return getValueAtJsonPath(buildPatchedDocument(), activeSection.jsonPath);\n };\n\n const handleValidate = async () => {\n if (!moduleName || !activePath || !activeSection) return;\n\n if (editorError) {\n setLocalActionSummary(\"Validation blocked because the JSON is currently invalid.\");\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: \"Fix the invalid JSON before validating.\",\n life: 3500,\n }));\n return;\n }\n\n try {\n const response: any = await validateSection({\n moduleName,\n sectionKey: activeSection.key,\n value: buildPatchedSectionValue(),\n }).unwrap();\n\n setValidationIssues(response?.issues ?? []);\n setLocalActionSummary(response?.valid ? \"Validation passed for the current JSON fragment.\" : \"Validation reported issues for the current JSON fragment.\");\n dispatch(showToast({\n severity: response?.valid ? \"success\" : \"warn\",\n summary: \"Metadata Explorer\",\n detail: response?.valid ? \"Validation passed.\" : \"Validation reported issues.\",\n life: 3000,\n }));\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n const handleSave = async () => {\n if (!moduleName || !activePath || !activeSection) return;\n\n if (editorError) {\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: \"Fix the invalid JSON before saving.\",\n life: 3500,\n }));\n return;\n }\n\n try {\n const response: any = await updateSection({\n moduleName,\n sectionKey: activeSection.key,\n value: buildPatchedSectionValue(),\n }).unwrap();\n\n setValidationIssues(response?.validation?.issues ?? []);\n setLocalActionSummary(\"JSON fragment saved to the metadata file.\");\n dispatch(showToast({\n severity: \"success\",\n summary: \"Metadata Explorer\",\n detail: \"Metadata saved successfully.\",\n life: 3000,\n }));\n refetchManifest();\n refetchDocument();\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n const handleSeedModule = async () => {\n if (!moduleId) return;\n\n try {\n const response: any = await seedModuleMetadata({ id: moduleId }).unwrap();\n setIsSeedDialogOpen(false);\n setLocalActionSummary(response?.message ?? `Seeded metadata for module ${moduleName}.`);\n dispatch(showToast({\n severity: \"success\",\n summary: \"Metadata Explorer\",\n detail: response?.message ?? \"Module metadata seeded successfully.\",\n life: 3000,\n }));\n refetchManifest();\n refetchDocument();\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n if (!moduleName) {\n return null;\n }\n\n return (\n <div className=\"solid-module-explorer\">\n <div className=\"solid-module-explorer-panel\">\n {loadError && (\n <div className=\"solid-module-explorer-alert\">\n <SolidMessage\n severity=\"error\"\n text={`Unable to load metadata explorer: ${extractApiErrorMessage(loadError)}`}\n className=\"justify-start\"\n />\n </div>\n )}\n\n <div\n ref={explorerRef}\n className=\"solid-module-explorer-workspace\"\n style={{ gridTemplateColumns: `${sidebarWidth}px 8px minmax(0, 1fr)` }}\n >\n <aside className=\"solid-module-explorer-sidebar\">\n <div className=\"solid-module-explorer-sidebar-section solid-module-explorer-sidebar-sections\">\n <div className=\"solid-module-explorer-sidebar-heading\">\n <div className=\"solid-module-explorer-sidebar-heading-main\">\n <div className=\"solid-module-explorer-sidebar-title\">{modelSingularName ? \"Explorer\" : \"Sections\"}</div>\n <SolidTag tone=\"info\">{modelSingularName ? scopedTreeNodes.length : sections.length}</SolidTag>\n </div>\n <button\n type=\"button\"\n className=\"solid-module-explorer-sidebar-action\"\n onClick={handleCollapseAll}\n >\n Collapse all\n </button>\n </div>\n\n <div className=\"solid-module-explorer-sidebar-search\">\n <SolidInput\n value={treeFilter}\n onChange={(event) => setTreeFilter(event.target.value)}\n placeholder=\"Search metadata tree\"\n />\n <div className=\"solid-module-explorer-sidebar-search-icon\">\n <Search size={14} />\n </div>\n </div>\n\n <div className=\"solid-module-explorer-section-list solid-module-explorer-tree-list\">\n <MetadataTree\n nodes={filteredTreeNodes}\n activePath={activePath}\n expandedPaths={visibleExpandedPaths}\n onToggle={toggleExpandedPath}\n onSelect={selectPath}\n />\n </div>\n </div>\n </aside>\n\n <div\n className=\"solid-module-explorer-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize metadata navigation panel\"\n onPointerDown={handleSidebarResizeStart}\n />\n\n <section className=\"solid-module-explorer-main\">\n <div className=\"solid-module-explorer-main-header\">\n <div className=\"solid-module-explorer-main-title\">\n <div className=\"solid-module-explorer-main-heading-row\">\n <h4>{activeNode?.label ?? activeSection?.title ?? \"Metadata\"}</h4>\n <p>{activePath || \"Choose a metadata node from the tree.\"}</p>\n </div>\n {hasValidationFailure && (\n <div className=\"solid-module-explorer-inline-validation\" title={validationSummary}>\n {validationSummary}\n </div>\n )}\n {isReadOnlyExplorer && (\n <div className=\"solid-module-explorer-readonly-note\">\n This metadata is browse-only in the explorer.\n </div>\n )}\n </div>\n <div className=\"solid-module-explorer-main-actions\">\n <div className=\"solid-module-explorer-main-meta\">\n {hasMutableChanges && <SolidTag tone=\"warn\">Unsaved changes</SolidTag>}\n {editorError && <SolidTag tone=\"danger\">Invalid JSON</SolidTag>}\n {isReadOnlyExplorer && <SolidTag tone=\"info\">Read only</SolidTag>}\n </div>\n {!isReadOnlyExplorer && (\n <SolidButton\n size=\"sm\"\n leftIcon={<Save size={14} />}\n onClick={handleSave}\n loading={isSavingSection}\n disabled={!canSave}\n >\n Save Section\n </SolidButton>\n )}\n <SolidDropdownMenu>\n <SolidDropdownMenuTrigger asChild>\n <SolidButton\n variant=\"ghost\"\n size=\"sm\"\n className=\"solid-icon-button\"\n aria-label=\"Explorer actions\"\n >\n <Settings size={16} />\n </SolidButton>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent className=\"solid-module-explorer-actions-menu\">\n {!isReadOnlyExplorer && (\n <SolidDropdownMenuItem onSelect={handleFormat}>\n <div className=\"solid-module-explorer-actions-item\">\n <Wand2 size={14} />\n <span>Format</span>\n </div>\n </SolidDropdownMenuItem>\n )}\n <SolidDropdownMenuItem onSelect={handleValidate} disabled={isValidatingSection}>\n <div className=\"solid-module-explorer-actions-item\">\n <FileSearch size={14} />\n <span>{isValidatingSection ? \"Validating...\" : \"Validate\"}</span>\n </div>\n </SolidDropdownMenuItem>\n <SolidDropdownMenuItem onSelect={() => setIsContextDialogOpen(true)}>\n <div className=\"solid-module-explorer-actions-item\">\n <Settings size={14} />\n <span>Context</span>\n </div>\n </SolidDropdownMenuItem>\n {allowSeed && (\n <SolidDropdownMenuItem onSelect={() => setIsSeedDialogOpen(true)} disabled={!moduleId || isSeedingModule}>\n <div className=\"solid-module-explorer-actions-item\">\n <DatabaseZap size={14} />\n <span>{isSeedingModule ? \"Seeding...\" : \"Seed\"}</span>\n </div>\n </SolidDropdownMenuItem>\n )}\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n </div>\n </div>\n\n <div className=\"solid-module-explorer-editor-wrap\">\n <div className=\"solid-module-explorer-editor-shell\">\n {isDocumentLoading ? (\n <div style={{ padding: \"1rem\" }} className=\"solid-module-explorer-empty\">\n Loading metadata JSON...\n </div>\n ) : (\n <JsonEditorSurface\n ref={editorRef}\n value={savedValue}\n resetToken={editorResetToken}\n readOnly={isReadOnlyExplorer}\n onValueChange={setEditorValue}\n onErrorChange={setEditorError}\n />\n )}\n </div>\n </div>\n </section>\n </div>\n </div>\n\n <SolidDialog\n open={isContextDialogOpen}\n onOpenChange={setIsContextDialogOpen}\n header=\"Context\"\n contentClassName=\"solid-module-explorer-context-dialog\"\n >\n <SolidDialogBody>\n <div className=\"solid-module-explorer-context-dialog-body\">\n <div className=\"solid-module-explorer-context-dialog-header\">\n <div className=\"solid-module-explorer-context-dialog-title\">\n {activeNode?.label ?? \"Metadata node\"}\n </div>\n <div className=\"solid-module-explorer-context-dialog-meta\">\n {activeNode?.sectionTitle && <SolidTag tone=\"info\">{activeNode.sectionTitle}</SolidTag>}\n </div>\n </div>\n\n <div className=\"solid-module-explorer-context-grid\">\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">JSON Path</div>\n <div className=\"solid-module-explorer-context-value\">{activePath || \"-\"}</div>\n </div>\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">File</div>\n <div className=\"solid-module-explorer-context-value\">{manifestData?.filePath ?? \"-\"}</div>\n </div>\n {localActionSummary && (\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">Last Action</div>\n <div className=\"solid-module-explorer-context-value\">{localActionSummary}</div>\n </div>\n )}\n </div>\n\n <div className=\"solid-module-explorer-context-note\">\n Clicking any branch or leaf in the tree opens that exact JSON fragment on the right.\n </div>\n </div>\n </SolidDialogBody>\n </SolidDialog>\n\n <SolidDialog\n open={isSeedDialogOpen}\n onOpenChange={setIsSeedDialogOpen}\n contentClassName=\"solid-module-explorer-seed-dialog\"\n >\n <SolidDialogHeader>\n <SolidDialogTitle>Seed Module Metadata</SolidDialogTitle>\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody>\n <div className=\"solid-module-explorer-seed-dialog-body\">\n <p>\n Re-seed metadata for <strong>{moduleName}</strong> from its JSON file?\n </p>\n <p className=\"solid-module-explorer-seed-dialog-note\">\n This only re-runs metadata seeding for the current module and refreshes database metadata from the module JSON.\n </p>\n </div>\n </SolidDialogBody>\n <SolidDialogFooter>\n <SolidButton variant=\"outline\" size=\"sm\" onClick={() => setIsSeedDialogOpen(false)} disabled={isSeedingModule}>\n Cancel\n </SolidButton>\n <SolidButton size=\"sm\" onClick={handleSeedModule} loading={isSeedingModule} disabled={!moduleId}>\n Seed\n </SolidButton>\n </SolidDialogFooter>\n </SolidDialog>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ModuleMetadataExplorer.js","sourceRoot":"","sources":["../../../../src/components/core/module/ModuleMetadataExplorer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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G,EACxB,KAAC,eAAe,cACd,eAAK,SAAS,EAAC,wCAAwC,aACrD,iDACuB,2BAAS,UAAU,GAAU,4BAChD,EACJ,YAAG,SAAS,EAAC,wCAAwC,gIAEjD,IACA,GACU,EAClB,MAAC,iBAAiB,eAChB,KAAC,WAAW,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,cAAM,OAAA,mBAAmB,CAAC,KAAK,CAAC,EAA1B,CAA0B,EAAE,QAAQ,EAAE,eAAe,uBAE/F,EACd,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,QAAQ,qBAEjF,IACI,IACR,IACV,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { ChevronDown, ChevronRight, DatabaseZap, FileSearch, Save, Search, Settings, Wand2 } from \"lucide-react\";\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport {\n useGetModuleMetadataExplorerDocumentQuery,\n useGetModuleMetadataExplorerManifestQuery,\n useSeedModuleMetadataMutation,\n useUpdateModuleMetadataExplorerSectionMutation,\n useValidateModuleMetadataExplorerSectionMutation,\n} from \"../../../redux/api/moduleApi\";\nimport { showToast } from \"../../../redux/features/toastSlice\";\nimport {\n SolidButton,\n SolidDialog,\n SolidDialogBody,\n SolidDialogFooter,\n SolidDialogHeader,\n SolidDialogSeparator,\n SolidDialogTitle,\n SolidDropdownMenu,\n SolidDropdownMenuContent,\n SolidDropdownMenuItem,\n SolidDropdownMenuTrigger,\n SolidInput,\n SolidMessage,\n SolidTag,\n} from \"../../shad-cn-ui\";\nimport \"jsoneditor/dist/jsoneditor.css\";\nimport \"./ModuleMetadataExplorer.css\";\n\ntype ModuleMetadataExplorerProps = {\n moduleName?: string;\n moduleId?: number;\n modelSingularName?: string;\n scopedArrayPath?: string;\n scopedItemValue?: string;\n scopedItemField?: string;\n readOnly?: boolean;\n allowSeed?: boolean;\n};\n\ntype MetadataIssue = {\n path: string;\n message: string;\n severity: \"error\" | \"warning\";\n};\n\ntype ExplorerSectionDefinition = {\n key: string;\n title: string;\n jsonPath: string;\n type: \"object\" | \"array\";\n description: string;\n};\n\ntype ExplorerTreeNode = {\n id: string;\n label: string;\n path: string;\n parentPath: string | null;\n sectionKey: string;\n sectionTitle: string;\n children: ExplorerTreeNode[];\n};\n\ntype JsonEditorHandle = {\n format: () => void;\n};\n\nfunction extractApiErrorMessage(error: any) {\n const message = error?.data?.message ?? error?.message ?? \"Something went wrong\";\n return Array.isArray(message) ? message.join(\", \") : String(message);\n}\n\nfunction serializeJson(value: any) {\n try {\n return JSON.stringify(value);\n } catch (_error) {\n return \"\";\n }\n}\n\nfunction deepCloneJson<T>(value: T): T {\n return JSON.parse(JSON.stringify(value));\n}\n\nfunction humanizeKey(value: string) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim()\n .replace(/^./, (char) => char.toUpperCase());\n}\n\nfunction tokenizePath(path: string) {\n const tokens: Array<string | number> = [];\n const regex = /([^[.\\]]+)|\\[(\\d+)\\]/g;\n let match: RegExpExecArray | null;\n while ((match = regex.exec(path)) !== null) {\n if (match[1] !== undefined) {\n tokens.push(match[1]);\n } else if (match[2] !== undefined) {\n tokens.push(Number(match[2]));\n }\n }\n return tokens;\n}\n\nfunction getValueAtJsonPath(source: any, path: string) {\n if (!path) return source;\n return tokenizePath(path).reduce((current, token) => {\n if (current === undefined || current === null) return undefined;\n return current[token as keyof typeof current];\n }, source);\n}\n\nfunction setValueAtJsonPath(target: any, path: string, value: any) {\n const tokens = tokenizePath(path);\n if (!tokens.length) return;\n\n let current = target;\n for (let index = 0; index < tokens.length - 1; index += 1) {\n current = current[tokens[index] as keyof typeof current];\n }\n\n current[tokens[tokens.length - 1] as keyof typeof current] = value;\n}\n\nfunction appendPath(basePath: string, key: string) {\n return basePath ? `${basePath}.${key}` : key;\n}\n\nfunction getArrayItemLabel(item: any, index: number, parentKey: string) {\n const labelCandidates = [\n \"singularName\",\n \"name\",\n \"displayName\",\n \"pluralName\",\n \"label\",\n \"key\",\n \"title\",\n \"id\",\n ];\n\n for (const candidate of labelCandidates) {\n const nextValue = item?.[candidate];\n if (nextValue !== undefined && nextValue !== null && `${nextValue}`.trim()) {\n return `${nextValue}`;\n }\n }\n\n return `${humanizeKey(parentKey || \"Item\")} ${index + 1}`;\n}\n\nfunction buildTreeNode(\n value: any,\n options: {\n label: string;\n path: string;\n parentPath: string | null;\n sectionKey: string;\n sectionTitle: string;\n hintKey: string;\n },\n): ExplorerTreeNode {\n const { label, path, parentPath, sectionKey, sectionTitle, hintKey } = options;\n\n let children: ExplorerTreeNode[] = [];\n\n if (Array.isArray(value)) {\n children = value\n .filter((item) => item !== null && typeof item === \"object\")\n .map((item, index) => buildTreeNode(item, {\n label: getArrayItemLabel(item, index, hintKey),\n path: `${path}[${index}]`,\n parentPath: path,\n sectionKey,\n sectionTitle,\n hintKey,\n }));\n } else if (value && typeof value === \"object\") {\n children = Object.entries(value)\n .filter(([, nextValue]) => nextValue !== null && typeof nextValue === \"object\")\n .map(([key, nextValue]) => buildTreeNode(nextValue, {\n label: humanizeKey(key),\n path: appendPath(path, key),\n parentPath: path,\n sectionKey,\n sectionTitle,\n hintKey: key,\n }));\n }\n\n return {\n id: path,\n label,\n path,\n parentPath,\n sectionKey,\n sectionTitle,\n children,\n };\n}\n\nfunction buildTreeFromDocument(sections: ExplorerSectionDefinition[], documentValue: any) {\n const nodes = sections\n .map((section) => {\n const sectionValue = getValueAtJsonPath(documentValue, section.jsonPath);\n if (sectionValue === undefined) return null;\n return buildTreeNode(sectionValue, {\n label: section.title,\n path: section.jsonPath,\n parentPath: null,\n sectionKey: section.key,\n sectionTitle: section.title,\n hintKey: section.key,\n });\n })\n .filter(Boolean) as ExplorerTreeNode[];\n\n const nodeMap = new Map<string, ExplorerTreeNode>();\n const visit = (nextNodes: ExplorerTreeNode[]) => {\n nextNodes.forEach((node) => {\n nodeMap.set(node.path, node);\n if (node.children.length) visit(node.children);\n });\n };\n visit(nodes);\n\n return { nodes, nodeMap };\n}\n\nfunction filterTreeNodes(nodes: ExplorerTreeNode[], query: string): ExplorerTreeNode[] {\n const needle = query.trim().toLowerCase();\n if (!needle) return nodes;\n\n const visit = (node: ExplorerTreeNode): ExplorerTreeNode | null => {\n const filteredChildren = node.children\n .map(visit)\n .filter(Boolean) as ExplorerTreeNode[];\n const matches = node.label.toLowerCase().includes(needle) || node.path.toLowerCase().includes(needle);\n\n if (matches || filteredChildren.length) {\n return { ...node, children: filteredChildren };\n }\n\n return null;\n };\n\n return nodes.map(visit).filter(Boolean) as ExplorerTreeNode[];\n}\n\nfunction getAncestorPaths(nodeMap: Map<string, ExplorerTreeNode>, path: string) {\n const paths: string[] = [];\n let current = nodeMap.get(path);\n\n while (current?.parentPath) {\n paths.push(current.parentPath);\n current = nodeMap.get(current.parentPath);\n }\n\n return paths;\n}\n\nfunction getSectionForPath(sections: ExplorerSectionDefinition[], path: string) {\n return sections\n .filter((section) => path === section.jsonPath || path.startsWith(`${section.jsonPath}.`) || path.startsWith(`${section.jsonPath}[`))\n .sort((left, right) => right.jsonPath.length - left.jsonPath.length)[0] ?? null;\n}\n\nfunction filterIssuesForPath(issues: MetadataIssue[], path: string) {\n return issues.filter((issue) => {\n if (!issue.path) return false;\n return issue.path === path || issue.path.startsWith(`${path}.`) || issue.path.startsWith(`${path}[`);\n });\n}\n\nconst JsonEditorSurface = React.forwardRef<JsonEditorHandle, {\n value: any;\n resetToken: string;\n readOnly?: boolean;\n onValueChange: (value: any) => void;\n onErrorChange: (message: string | null) => void;\n}>(function JsonEditorSurface({ value, resetToken, readOnly = false, onValueChange, onErrorChange }, ref) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const editorRef = useRef<any>(null);\n // Keep a ref to the latest value so the async init can seed the editor correctly\n const latestValueRef = useRef<any>(value);\n\n // Sync latest value into ref so async editor init can use it\n useEffect(() => { latestValueRef.current = value; }, [value]);\n\n const emitState = () => {\n const editor = editorRef.current;\n if (!editor) return;\n\n try {\n const nextValue = editor.get();\n onValueChange(nextValue);\n onErrorChange(null);\n } catch (error: any) {\n onErrorChange(error?.message ? String(error.message) : \"The JSON is currently invalid.\");\n }\n };\n\n useImperativeHandle(ref, () => ({\n format() {\n try {\n editorRef.current?.format?.();\n } catch (_error) {\n // jsoneditor already surfaces parse states through onErrorChange\n }\n emitState();\n },\n }), []);\n\n useEffect(() => {\n if (!containerRef.current || editorRef.current) return;\n\n let destroyed = false;\n\n // @ts-ignore\n void import(\"jsoneditor\").then((jsonEditorModule: any) => {\n if (destroyed || !containerRef.current || editorRef.current) {\n return;\n }\n\n const JSONEditor = jsonEditorModule?.default ?? jsonEditorModule;\n editorRef.current = new JSONEditor(containerRef.current, {\n mode: \"code\",\n modes: [\"code\"],\n mainMenuBar: true,\n navigationBar: true,\n statusBar: true,\n search: true,\n enableSort: false,\n enableTransform: false,\n onChange: () => emitState(),\n });\n\n // Seed editor with current value (which may already be set before async init resolved)\n try { editorRef.current.set(latestValueRef.current); } catch (_e) {}\n emitState();\n\n if (editorRef.current?.aceEditor?.setReadOnly) {\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }\n });\n\n return () => {\n destroyed = true;\n editorRef.current?.destroy?.();\n editorRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n if (!editorRef.current) return;\n editorRef.current.set(value);\n emitState();\n }, [resetToken, value]);\n\n useEffect(() => {\n if (!editorRef.current?.aceEditor?.setReadOnly) return;\n editorRef.current.aceEditor.setReadOnly(readOnly);\n }, [readOnly]);\n\n return <div ref={containerRef} className={`solid-module-explorer-editor-host solid-module-explorer-jsoneditor ${readOnly ? \"is-readonly\" : \"\"}`} />;\n});\n\nfunction MetadataTree({\n nodes,\n activePath,\n expandedPaths,\n onToggle,\n onSelect,\n depth = 0,\n}: {\n nodes: ExplorerTreeNode[];\n activePath: string;\n expandedPaths: Set<string>;\n onToggle: (path: string) => void;\n onSelect: (path: string) => void;\n depth?: number;\n}) {\n return (\n <>\n {nodes.map((node) => {\n const isExpanded = expandedPaths.has(node.path);\n const hasChildren = node.children.length > 0;\n const isActive = activePath === node.path;\n\n return (\n <div key={node.id} className=\"solid-module-explorer-tree-node\">\n <div\n className={`solid-module-explorer-tree-row ${isActive ? \"is-active\" : \"\"}`}\n style={{ paddingLeft: `${depth * 0.9}rem` }}\n >\n <button\n type=\"button\"\n className=\"solid-module-explorer-tree-toggle\"\n onClick={() => hasChildren && onToggle(node.path)}\n aria-label={hasChildren ? (isExpanded ? \"Collapse node\" : \"Expand node\") : \"Leaf node\"}\n disabled={!hasChildren}\n >\n {hasChildren ? (isExpanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />) : <span className=\"solid-module-explorer-tree-dot\" />}\n </button>\n <button\n type=\"button\"\n className=\"solid-module-explorer-tree-label\"\n onClick={() => onSelect(node.path)}\n title={node.path}\n >\n {node.label}\n </button>\n </div>\n\n {hasChildren && isExpanded && (\n <MetadataTree\n nodes={node.children}\n activePath={activePath}\n expandedPaths={expandedPaths}\n onToggle={onToggle}\n onSelect={onSelect}\n depth={depth + 1}\n />\n )}\n </div>\n );\n })}\n </>\n );\n}\n\nexport function ModuleMetadataExplorer({\n moduleName,\n moduleId,\n modelSingularName,\n scopedArrayPath,\n scopedItemValue,\n scopedItemField,\n readOnly = false,\n allowSeed = true,\n}: ModuleMetadataExplorerProps) {\n const dispatch = useDispatch();\n const editorRef = useRef<JsonEditorHandle | null>(null);\n const explorerRef = useRef<HTMLDivElement | null>(null);\n const isResizingRef = useRef(false);\n const [activePath, setActivePath] = useState(\"\");\n const [expandedPaths, setExpandedPaths] = useState<Set<string>>(new Set());\n const [treeFilter, setTreeFilter] = useState(\"\");\n const [sidebarWidth, setSidebarWidth] = useState(280);\n const [editorValue, setEditorValue] = useState<any>({});\n const [savedValue, setSavedValue] = useState<any>({});\n const [editorError, setEditorError] = useState<string | null>(null);\n const [editorResetToken, setEditorResetToken] = useState(\"initial\");\n const [validationIssues, setValidationIssues] = useState<MetadataIssue[] | null>(null);\n const [localActionSummary, setLocalActionSummary] = useState(\"\");\n const [isContextDialogOpen, setIsContextDialogOpen] = useState(false);\n const [isSeedDialogOpen, setIsSeedDialogOpen] = useState(false);\n\n const {\n data: manifestData,\n error: manifestError,\n refetch: refetchManifest,\n } = useGetModuleMetadataExplorerManifestQuery(moduleName as string, {\n skip: !moduleName,\n });\n\n const {\n data: documentData,\n isLoading: isDocumentLoading,\n error: documentError,\n refetch: refetchDocument,\n } = useGetModuleMetadataExplorerDocumentQuery(moduleName as string, {\n skip: !moduleName,\n });\n\n const [updateSection, { isLoading: isSavingSection }] = useUpdateModuleMetadataExplorerSectionMutation();\n const [validateSection, { isLoading: isValidatingSection }] = useValidateModuleMetadataExplorerSectionMutation();\n const [seedModuleMetadata, { isLoading: isSeedingModule }] = useSeedModuleMetadataMutation();\n const isReadOnlyExplorer = readOnly || moduleName?.toLowerCase() === \"solid-core\";\n\n const sections = (manifestData?.sections ?? []) as ExplorerSectionDefinition[];\n const fullDocument = documentData?.value ?? {};\n const loadError = !manifestData || !documentData ? (manifestError ?? documentError) : null;\n\n const { nodes: treeNodes, nodeMap } = useMemo(\n () => buildTreeFromDocument(sections, fullDocument),\n [sections, fullDocument],\n );\n\n const scopedRootPath = useMemo(() => {\n // Scope to a specific model definition\n if (modelSingularName) {\n const models = getValueAtJsonPath(fullDocument, \"moduleMetadata.models\");\n if (!Array.isArray(models)) return \"\";\n const modelIndex = models.findIndex((model) => model?.singularName === modelSingularName);\n return modelIndex >= 0 ? `moduleMetadata.models[${modelIndex}]` : \"\";\n }\n // Scope to a specific item in a root-level array (e.g. views, actions, menus)\n if (scopedArrayPath && scopedItemValue) {\n const arr = getValueAtJsonPath(fullDocument, scopedArrayPath);\n if (!Array.isArray(arr)) return \"\";\n const matchField = scopedItemField ?? \"name\";\n const itemIndex = arr.findIndex((item) => item?.[matchField] === scopedItemValue);\n return itemIndex >= 0 ? `${scopedArrayPath}[${itemIndex}]` : \"\";\n }\n return \"\";\n }, [fullDocument, modelSingularName, scopedArrayPath, scopedItemValue, scopedItemField]);\n\n const scopedTreeNodes = useMemo(() => {\n if (!scopedRootPath) return treeNodes;\n const scopedNode = nodeMap.get(scopedRootPath);\n return scopedNode ? [scopedNode] : [];\n }, [nodeMap, scopedRootPath, treeNodes]);\n\n const filteredTreeNodes = useMemo(\n () => filterTreeNodes(scopedTreeNodes, treeFilter),\n [scopedTreeNodes, treeFilter],\n );\n\n const visibleExpandedPaths = useMemo(() => {\n if (!treeFilter.trim()) return expandedPaths;\n const nextExpanded = new Set<string>();\n const visit = (nodesToVisit: ExplorerTreeNode[]) => {\n nodesToVisit.forEach((node) => {\n if (node.children.length) {\n nextExpanded.add(node.path);\n visit(node.children);\n }\n });\n };\n visit(filteredTreeNodes);\n return nextExpanded;\n }, [expandedPaths, filteredTreeNodes, treeFilter]);\n\n const activeNode = activePath ? nodeMap.get(activePath) ?? null : null;\n const activeSection = activePath ? getSectionForPath(sections, activePath) : null;\n const activeValidationIssues = filterIssuesForPath(validationIssues ?? [], activePath);\n const savedSerialized = serializeJson(savedValue);\n const editorSerialized = serializeJson(editorValue);\n const isDirty = editorError ? true : savedSerialized !== editorSerialized;\n const hasMutableChanges = !isReadOnlyExplorer && isDirty;\n const canSave = !isReadOnlyExplorer && isDirty && !editorError;\n const hasValidationFailure = Boolean(editorError) || activeValidationIssues.length > 0;\n const validationSummary = editorError\n ? editorError\n : activeValidationIssues.length\n ? `${activeValidationIssues.length} validation issue${activeValidationIssues.length === 1 ? \"\" : \"s\"}: ${activeValidationIssues[0]?.message ?? \"Review this JSON before saving.\"}`\n : \"\";\n\n useEffect(() => {\n setValidationIssues(documentData?.validation?.issues ?? []);\n }, [documentData?.lastModifiedAt]);\n\n useEffect(() => {\n const handlePointerMove = (event: PointerEvent) => {\n if (!isResizingRef.current || !explorerRef.current) return;\n const bounds = explorerRef.current.getBoundingClientRect();\n const nextWidth = Math.min(Math.max(event.clientX - bounds.left, 220), 520);\n setSidebarWidth(nextWidth);\n };\n\n const handlePointerUp = () => {\n isResizingRef.current = false;\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n };\n\n window.addEventListener(\"pointermove\", handlePointerMove);\n window.addEventListener(\"pointerup\", handlePointerUp);\n\n return () => {\n window.removeEventListener(\"pointermove\", handlePointerMove);\n window.removeEventListener(\"pointerup\", handlePointerUp);\n };\n }, []);\n\n useEffect(() => {\n if (!scopedTreeNodes.length) return;\n\n const isPathInsideScope =\n !scopedRootPath ||\n activePath === scopedRootPath ||\n activePath.startsWith(`${scopedRootPath}.`) ||\n activePath.startsWith(`${scopedRootPath}[`);\n\n if (!activePath || !nodeMap.has(activePath) || !isPathInsideScope) {\n const defaultPath = scopedTreeNodes[0].path;\n setActivePath(defaultPath);\n setExpandedPaths(new Set([defaultPath]));\n }\n }, [activePath, nodeMap, scopedRootPath, scopedTreeNodes]);\n\n useEffect(() => {\n if (!activePath) return;\n const nextValue = getValueAtJsonPath(fullDocument, activePath);\n if (nextValue === undefined) return;\n setSavedValue(nextValue);\n setEditorValue(nextValue);\n setEditorError(null);\n setEditorResetToken(`${activePath}:${documentData?.lastModifiedAt ?? \"\"}`);\n }, [activePath, documentData?.lastModifiedAt, fullDocument]);\n\n const showErrorToast = (error: any) => {\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: extractApiErrorMessage(error),\n life: 4000,\n }));\n };\n\n const toggleExpandedPath = (path: string) => {\n setExpandedPaths((current) => {\n const next = new Set(current);\n if (next.has(path)) {\n next.delete(path);\n } else {\n next.add(path);\n }\n return next;\n });\n };\n\n const selectPath = (path: string) => {\n if (path === activePath) return;\n if (!isReadOnlyExplorer && isDirty) {\n const shouldProceed = window.confirm(\"You have unsaved metadata changes. Switch nodes and discard them?\");\n if (!shouldProceed) return;\n }\n\n const ancestorPaths = getAncestorPaths(nodeMap, path);\n setExpandedPaths((current) => {\n const next = new Set(current);\n ancestorPaths.forEach((ancestorPath) => next.add(ancestorPath));\n return next;\n });\n setActivePath(path);\n };\n\n const handleSidebarResizeStart = () => {\n isResizingRef.current = true;\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n };\n\n const handleCollapseAll = () => {\n setExpandedPaths(new Set());\n };\n\n const handleFormat = () => {\n editorRef.current?.format();\n };\n\n const buildPatchedDocument = () => {\n const nextDocument = deepCloneJson(fullDocument);\n setValueAtJsonPath(nextDocument, activePath, editorValue);\n return nextDocument;\n };\n\n const buildPatchedSectionValue = () => {\n if (!activeSection) return undefined;\n return getValueAtJsonPath(buildPatchedDocument(), activeSection.jsonPath);\n };\n\n const handleValidate = async () => {\n if (!moduleName || !activePath || !activeSection) return;\n\n if (editorError) {\n setLocalActionSummary(\"Validation blocked because the JSON is currently invalid.\");\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: \"Fix the invalid JSON before validating.\",\n life: 3500,\n }));\n return;\n }\n\n try {\n const response: any = await validateSection({\n moduleName,\n sectionKey: activeSection.key,\n value: buildPatchedSectionValue(),\n }).unwrap();\n\n setValidationIssues(response?.issues ?? []);\n setLocalActionSummary(response?.valid ? \"Validation passed for the current JSON fragment.\" : \"Validation reported issues for the current JSON fragment.\");\n dispatch(showToast({\n severity: response?.valid ? \"success\" : \"warn\",\n summary: \"Metadata Explorer\",\n detail: response?.valid ? \"Validation passed.\" : \"Validation reported issues.\",\n life: 3000,\n }));\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n const handleSave = async () => {\n if (!moduleName || !activePath || !activeSection) return;\n\n if (editorError) {\n dispatch(showToast({\n severity: \"error\",\n summary: \"Metadata Explorer\",\n detail: \"Fix the invalid JSON before saving.\",\n life: 3500,\n }));\n return;\n }\n\n try {\n const response: any = await updateSection({\n moduleName,\n sectionKey: activeSection.key,\n value: buildPatchedSectionValue(),\n }).unwrap();\n\n setValidationIssues(response?.validation?.issues ?? []);\n setLocalActionSummary(\"JSON fragment saved to the metadata file.\");\n dispatch(showToast({\n severity: \"success\",\n summary: \"Metadata Explorer\",\n detail: \"Metadata saved successfully.\",\n life: 3000,\n }));\n refetchManifest();\n refetchDocument();\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n const handleSeedModule = async () => {\n if (!moduleId) return;\n\n try {\n const response: any = await seedModuleMetadata({ id: moduleId }).unwrap();\n setIsSeedDialogOpen(false);\n setLocalActionSummary(response?.message ?? `Seeded metadata for module ${moduleName}.`);\n dispatch(showToast({\n severity: \"success\",\n summary: \"Metadata Explorer\",\n detail: response?.message ?? \"Module metadata seeded successfully.\",\n life: 3000,\n }));\n refetchManifest();\n refetchDocument();\n } catch (error) {\n showErrorToast(error);\n }\n };\n\n if (!moduleName) {\n return null;\n }\n\n return (\n <div className=\"solid-module-explorer\">\n <div className=\"solid-module-explorer-panel\">\n {loadError && (\n <div className=\"solid-module-explorer-alert\">\n <SolidMessage\n severity=\"error\"\n text={`Unable to load metadata explorer: ${extractApiErrorMessage(loadError)}`}\n className=\"justify-start\"\n />\n </div>\n )}\n\n <div\n ref={explorerRef}\n className=\"solid-module-explorer-workspace\"\n style={{ gridTemplateColumns: `${sidebarWidth}px 8px minmax(0, 1fr)` }}\n >\n <aside className=\"solid-module-explorer-sidebar\">\n <div className=\"solid-module-explorer-sidebar-section solid-module-explorer-sidebar-sections\">\n <div className=\"solid-module-explorer-sidebar-heading\">\n <div className=\"solid-module-explorer-sidebar-heading-main\">\n <div className=\"solid-module-explorer-sidebar-title\">{modelSingularName ? \"Explorer\" : \"Sections\"}</div>\n <SolidTag tone=\"info\">{modelSingularName ? scopedTreeNodes.length : sections.length}</SolidTag>\n </div>\n <button\n type=\"button\"\n className=\"solid-module-explorer-sidebar-action\"\n onClick={handleCollapseAll}\n >\n Collapse all\n </button>\n </div>\n\n <div className=\"solid-module-explorer-sidebar-search\">\n <SolidInput\n value={treeFilter}\n onChange={(event) => setTreeFilter(event.target.value)}\n placeholder=\"Search metadata tree\"\n />\n <div className=\"solid-module-explorer-sidebar-search-icon\">\n <Search size={14} />\n </div>\n </div>\n\n <div className=\"solid-module-explorer-section-list solid-module-explorer-tree-list\">\n <MetadataTree\n nodes={filteredTreeNodes}\n activePath={activePath}\n expandedPaths={visibleExpandedPaths}\n onToggle={toggleExpandedPath}\n onSelect={selectPath}\n />\n </div>\n </div>\n </aside>\n\n <div\n className=\"solid-module-explorer-resizer\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize metadata navigation panel\"\n onPointerDown={handleSidebarResizeStart}\n />\n\n <section className=\"solid-module-explorer-main\">\n <div className=\"solid-module-explorer-main-header\">\n <div className=\"solid-module-explorer-main-title\">\n <div className=\"solid-module-explorer-main-heading-row\">\n <h4>{activeNode?.label ?? activeSection?.title ?? \"Metadata\"}</h4>\n <p>{activePath || \"Choose a metadata node from the tree.\"}</p>\n </div>\n {hasValidationFailure && (\n <div className=\"solid-module-explorer-inline-validation\" title={validationSummary}>\n {validationSummary}\n </div>\n )}\n {isReadOnlyExplorer && (\n <div className=\"solid-module-explorer-readonly-note\">\n This metadata is browse-only in the explorer.\n </div>\n )}\n </div>\n <div className=\"solid-module-explorer-main-actions\">\n <div className=\"solid-module-explorer-main-meta\">\n {hasMutableChanges && <SolidTag tone=\"warn\">Unsaved changes</SolidTag>}\n {editorError && <SolidTag tone=\"danger\">Invalid JSON</SolidTag>}\n {isReadOnlyExplorer && <SolidTag tone=\"info\">Read only</SolidTag>}\n </div>\n {!isReadOnlyExplorer && (\n <SolidButton\n size=\"sm\"\n leftIcon={<Save size={14} />}\n onClick={handleSave}\n loading={isSavingSection}\n disabled={!canSave}\n >\n Save Section\n </SolidButton>\n )}\n <SolidDropdownMenu>\n <SolidDropdownMenuTrigger asChild>\n <SolidButton\n variant=\"ghost\"\n size=\"sm\"\n className=\"solid-icon-button\"\n aria-label=\"Explorer actions\"\n >\n <Settings size={16} />\n </SolidButton>\n </SolidDropdownMenuTrigger>\n <SolidDropdownMenuContent className=\"solid-module-explorer-actions-menu\">\n {!isReadOnlyExplorer && (\n <SolidDropdownMenuItem onSelect={handleFormat}>\n <div className=\"solid-module-explorer-actions-item\">\n <Wand2 size={14} />\n <span>Format</span>\n </div>\n </SolidDropdownMenuItem>\n )}\n <SolidDropdownMenuItem onSelect={handleValidate} disabled={isValidatingSection}>\n <div className=\"solid-module-explorer-actions-item\">\n <FileSearch size={14} />\n <span>{isValidatingSection ? \"Validating...\" : \"Validate\"}</span>\n </div>\n </SolidDropdownMenuItem>\n <SolidDropdownMenuItem onSelect={() => setIsContextDialogOpen(true)}>\n <div className=\"solid-module-explorer-actions-item\">\n <Settings size={14} />\n <span>Context</span>\n </div>\n </SolidDropdownMenuItem>\n {allowSeed && (\n <SolidDropdownMenuItem onSelect={() => setIsSeedDialogOpen(true)} disabled={!moduleId || isSeedingModule}>\n <div className=\"solid-module-explorer-actions-item\">\n <DatabaseZap size={14} />\n <span>{isSeedingModule ? \"Seeding...\" : \"Seed\"}</span>\n </div>\n </SolidDropdownMenuItem>\n )}\n </SolidDropdownMenuContent>\n </SolidDropdownMenu>\n </div>\n </div>\n\n <div className=\"solid-module-explorer-editor-wrap\">\n <div className=\"solid-module-explorer-editor-shell\">\n {isDocumentLoading ? (\n <div style={{ padding: \"1rem\" }} className=\"solid-module-explorer-empty\">\n Loading metadata JSON...\n </div>\n ) : (\n <JsonEditorSurface\n ref={editorRef}\n value={savedValue}\n resetToken={editorResetToken}\n readOnly={isReadOnlyExplorer}\n onValueChange={setEditorValue}\n onErrorChange={setEditorError}\n />\n )}\n </div>\n </div>\n </section>\n </div>\n </div>\n\n <SolidDialog\n open={isContextDialogOpen}\n onOpenChange={setIsContextDialogOpen}\n header=\"Context\"\n contentClassName=\"solid-module-explorer-context-dialog\"\n >\n <SolidDialogSeparator />\n <SolidDialogBody>\n <div className=\"solid-module-explorer-context-dialog-body\">\n <div className=\"solid-module-explorer-context-dialog-header\">\n <div className=\"solid-module-explorer-context-dialog-title\">\n {activeNode?.label ?? \"Metadata node\"}\n </div>\n <div className=\"solid-module-explorer-context-dialog-meta\">\n {activeNode?.sectionTitle && <SolidTag tone=\"info\">{activeNode.sectionTitle}</SolidTag>}\n </div>\n </div>\n\n <div className=\"solid-module-explorer-context-grid\">\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">JSON Path</div>\n <div className=\"solid-module-explorer-context-value\">{activePath || \"-\"}</div>\n </div>\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">File</div>\n <div className=\"solid-module-explorer-context-value\">{manifestData?.filePath ?? \"-\"}</div>\n </div>\n {localActionSummary && (\n <div className=\"solid-module-explorer-context-row\">\n <div className=\"solid-module-explorer-context-label\">Last Action</div>\n <div className=\"solid-module-explorer-context-value\">{localActionSummary}</div>\n </div>\n )}\n </div>\n\n <div className=\"solid-module-explorer-context-note\">\n Clicking any branch or leaf in the tree opens that exact JSON fragment on the right.\n </div>\n </div>\n </SolidDialogBody>\n </SolidDialog>\n\n <SolidDialog\n open={isSeedDialogOpen}\n onOpenChange={setIsSeedDialogOpen}\n contentClassName=\"solid-module-explorer-seed-dialog\"\n >\n <SolidDialogHeader>\n <SolidDialogTitle>Seed Module Metadata</SolidDialogTitle>\n </SolidDialogHeader>\n <SolidDialogSeparator />\n <SolidDialogBody>\n <div className=\"solid-module-explorer-seed-dialog-body\">\n <p>\n Re-seed metadata for <strong>{moduleName}</strong> from its JSON file?\n </p>\n <p className=\"solid-module-explorer-seed-dialog-note\">\n This only re-runs metadata seeding for the current module and refreshes database metadata from the module JSON.\n </p>\n </div>\n </SolidDialogBody>\n <SolidDialogFooter>\n <SolidButton variant=\"outline\" size=\"sm\" onClick={() => setIsSeedDialogOpen(false)} disabled={isSeedingModule}>\n Cancel\n </SolidButton>\n <SolidButton size=\"sm\" onClick={handleSeedModule} loading={isSeedingModule} disabled={!moduleId}>\n Seed\n </SolidButton>\n </SolidDialogFooter>\n </SolidDialog>\n </div>\n );\n}\n"]}
@@ -932,6 +932,7 @@ export function ModuleMetadataExplorer({
932
932
  header="Context"
933
933
  contentClassName="solid-module-explorer-context-dialog"
934
934
  >
935
+ <SolidDialogSeparator />
935
936
  <SolidDialogBody>
936
937
  <div className="solid-module-explorer-context-dialog-body">
937
938
  <div className="solid-module-explorer-context-dialog-header">
@@ -1 +1 @@
1
- {"version":3,"file":"SolidTreeView.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tree/SolidTreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAqCf,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,CAAC,MAAM,EAAE;QACpB,uBAAuB,CAAC,EAAE,GAAG,CAAC;QAC9B,gBAAgB,CAAC,EAAE,GAAG,CAAC;QACvB,sBAAsB,CAAC,EAAE,GAAG,CAAC;QAC7B,2BAA2B,CAAC,EAAE,GAAG,CAAC;KACnC,KAAK,IAAI,CAAC;IACX,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACpE,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,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AM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACpE,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,MAAM;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,EAAE,GAAG,CAAC;QACb,gBAAgB,EAAE,GAAG,CAAC;QACtB,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH,CAAC;AA0CF,eAAO,MAAM,aAAa,iGAk6DxB,CAAC"}
@@ -85,6 +85,7 @@ import { useHandleListCustomButtonClick } from "../../../components/common/useHa
85
85
  import { SolidButton, SolidDialog, SolidDialogBody, SolidDialogDescription, SolidDialogFooter, SolidDialogHeader, SolidDialogSeparator, SolidDialogTitle, SolidDropdownMenu, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuSeparator, SolidDropdownMenuTrigger, SolidIcon, SolidSelect } from "../../shad-cn-ui";
86
86
  import { SolidHeaderRequestStatus } from "../../common/SolidHeaderRequestStatus";
87
87
  import { storeCurrentModelViewContext } from "../../../helpers/modelViewPersistence";
88
+ import { getRelationDisplayText } from "../../../helpers/relationDisplay";
88
89
  import { Column as SolidTreeColumn, SolidTreeTable } from "./SolidTreeTable";
89
90
  var DEFAULT_PAGE_SIZE = 25;
90
91
  var DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100];
@@ -717,7 +718,11 @@ export var SolidTreeView = forwardRef(function (params, ref) {
717
718
  var dateGranularity = getDateGranularity(rule);
718
719
  return (groupMetaRows || []).map(function (groupMeta, index) {
719
720
  var _a;
720
- var groupLabel = isEmptyGroupValue(groupMeta === null || groupMeta === void 0 ? void 0 : groupMeta.groupName) ? "(empty)" : groupMeta === null || groupMeta === void 0 ? void 0 : groupMeta.groupName;
721
+ var rawGroupLabel = groupMeta === null || groupMeta === void 0 ? void 0 : groupMeta.groupName;
722
+ var normalizedGroupLabel = rawGroupLabel === "[object Object]"
723
+ ? getRelationDisplayText(groupMeta === null || groupMeta === void 0 ? void 0 : groupMeta.groupValue)
724
+ : getRelationDisplayText(rawGroupLabel);
725
+ var groupLabel = isEmptyGroupValue(normalizedGroupLabel) ? "(empty)" : normalizedGroupLabel;
721
726
  var groupValue = (_a = groupMeta === null || groupMeta === void 0 ? void 0 : groupMeta.groupValue) !== null && _a !== void 0 ? _a : "(empty)";
722
727
  var idCount = extractGroupCount(groupMeta);
723
728
  var groupPath = __spreadArray(__spreadArray([], parentPath, true), [