@cratis/components 4.26.4 → 4.28.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 (162) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/Common/CratisComponentsProvider.d.ts +4 -0
  3. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  4. package/dist/esm/Common/CratisComponentsProvider.js +1 -0
  5. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  6. package/dist/esm/DataPage/DataPage.d.ts +2 -0
  7. package/dist/esm/DataPage/DataPage.d.ts.map +1 -1
  8. package/dist/esm/DataPage/DataPage.js.map +1 -1
  9. package/dist/esm/DataTables/DataTableForObservableQuery.d.ts +2 -0
  10. package/dist/esm/DataTables/DataTableForObservableQuery.d.ts.map +1 -1
  11. package/dist/esm/DataTables/DataTableForObservableQuery.js +1 -1
  12. package/dist/esm/DataTables/DataTableForObservableQuery.js.map +1 -1
  13. package/dist/esm/DataTables/DataTableForQuery.d.ts +2 -0
  14. package/dist/esm/DataTables/DataTableForQuery.d.ts.map +1 -1
  15. package/dist/esm/DataTables/DataTableForQuery.js +1 -1
  16. package/dist/esm/DataTables/DataTableForQuery.js.map +1 -1
  17. package/dist/esm/DataTables/PaginatorPageItem.d.ts +13 -0
  18. package/dist/esm/DataTables/PaginatorPageItem.d.ts.map +1 -0
  19. package/dist/esm/DataTables/PaginatorPageItem.js +4 -0
  20. package/dist/esm/DataTables/PaginatorPageItem.js.map +1 -0
  21. package/dist/esm/DataTables/TablePaginator.d.ts +22 -2
  22. package/dist/esm/DataTables/TablePaginator.d.ts.map +1 -1
  23. package/dist/esm/DataTables/TablePaginator.js.map +1 -1
  24. package/dist/esm/DataTables/TablePaginatorImplementation.d.ts +1 -1
  25. package/dist/esm/DataTables/TablePaginatorImplementation.d.ts.map +1 -1
  26. package/dist/esm/DataTables/TablePaginatorImplementation.js +8 -3
  27. package/dist/esm/DataTables/TablePaginatorImplementation.js.map +1 -1
  28. package/dist/esm/DataTables/TablePaginatorPages.d.ts +9 -0
  29. package/dist/esm/DataTables/TablePaginatorPages.d.ts.map +1 -0
  30. package/dist/esm/DataTables/TablePaginatorPages.js +20 -0
  31. package/dist/esm/DataTables/TablePaginatorPages.js.map +1 -0
  32. package/dist/esm/DataTables/index.d.ts +2 -0
  33. package/dist/esm/DataTables/index.d.ts.map +1 -1
  34. package/dist/esm/DataTables/index.js +1 -0
  35. package/dist/esm/DataTables/index.js.map +1 -1
  36. package/dist/esm/DataTables/paginatorPages.d.ts +15 -0
  37. package/dist/esm/DataTables/paginatorPages.d.ts.map +1 -0
  38. package/dist/esm/DataTables/paginatorPages.js +40 -0
  39. package/dist/esm/DataTables/paginatorPages.js.map +1 -0
  40. package/dist/esm/Filter/FilterGroup.d.ts +23 -0
  41. package/dist/esm/Filter/FilterGroup.d.ts.map +1 -0
  42. package/dist/esm/Filter/FilterGroup.js +51 -0
  43. package/dist/esm/Filter/FilterGroup.js.map +1 -0
  44. package/dist/esm/Filter/FilterPanel.d.ts.map +1 -1
  45. package/dist/esm/Filter/FilterPanel.js +24 -257
  46. package/dist/esm/Filter/FilterPanel.js.map +1 -1
  47. package/dist/esm/Filter/FilterSearchBox.d.ts +10 -0
  48. package/dist/esm/Filter/FilterSearchBox.d.ts.map +1 -0
  49. package/dist/esm/Filter/FilterSearchBox.js +10 -0
  50. package/dist/esm/Filter/FilterSearchBox.js.map +1 -0
  51. package/dist/esm/Filter/measurePanelPlacement.d.ts +31 -0
  52. package/dist/esm/Filter/measurePanelPlacement.d.ts.map +1 -0
  53. package/dist/esm/Filter/measurePanelPlacement.js +132 -0
  54. package/dist/esm/Filter/measurePanelPlacement.js.map +1 -0
  55. package/dist/esm/Filter/usePanelDismissal.d.ts +32 -0
  56. package/dist/esm/Filter/usePanelDismissal.d.ts.map +1 -0
  57. package/dist/esm/Filter/usePanelDismissal.js +63 -0
  58. package/dist/esm/Filter/usePanelDismissal.js.map +1 -0
  59. package/dist/esm/Filter/usePanelPosition.d.ts +24 -0
  60. package/dist/esm/Filter/usePanelPosition.d.ts.map +1 -0
  61. package/dist/esm/Filter/usePanelPosition.js +85 -0
  62. package/dist/esm/Filter/usePanelPosition.js.map +1 -0
  63. package/dist/esm/Filter/useResolvedAnchor.d.ts +17 -0
  64. package/dist/esm/Filter/useResolvedAnchor.d.ts.map +1 -0
  65. package/dist/esm/Filter/useResolvedAnchor.js +16 -0
  66. package/dist/esm/Filter/useResolvedAnchor.js.map +1 -0
  67. package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
  68. package/dist/esm/PivotViewer/PivotViewer.js +47 -207
  69. package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
  70. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts +1 -1
  71. package/dist/esm/PivotViewer/components/pivot/visibility.d.ts.map +1 -1
  72. package/dist/esm/PivotViewer/components/pivot/visibility.js +24 -222
  73. package/dist/esm/PivotViewer/components/pivot/visibility.js.map +1 -1
  74. package/dist/esm/PivotViewer/components/pivot/visibilityHelpers.d.ts +114 -0
  75. package/dist/esm/PivotViewer/components/pivot/visibilityHelpers.d.ts.map +1 -0
  76. package/dist/esm/PivotViewer/components/pivot/visibilityHelpers.js +306 -0
  77. package/dist/esm/PivotViewer/components/pivot/visibilityHelpers.js.map +1 -0
  78. package/dist/esm/PivotViewer/hooks/useColorCssVariables.d.ts +9 -0
  79. package/dist/esm/PivotViewer/hooks/useColorCssVariables.d.ts.map +1 -0
  80. package/dist/esm/PivotViewer/hooks/useColorCssVariables.js +32 -0
  81. package/dist/esm/PivotViewer/hooks/useColorCssVariables.js.map +1 -0
  82. package/dist/esm/PivotViewer/hooks/usePivotViewerGrouping.d.ts +27 -0
  83. package/dist/esm/PivotViewer/hooks/usePivotViewerGrouping.d.ts.map +1 -0
  84. package/dist/esm/PivotViewer/hooks/usePivotViewerGrouping.js +40 -0
  85. package/dist/esm/PivotViewer/hooks/usePivotViewerGrouping.js.map +1 -0
  86. package/dist/esm/PivotViewer/hooks/usePivotViewerInteractions.d.ts +27 -0
  87. package/dist/esm/PivotViewer/hooks/usePivotViewerInteractions.d.ts.map +1 -0
  88. package/dist/esm/PivotViewer/hooks/usePivotViewerInteractions.js +46 -0
  89. package/dist/esm/PivotViewer/hooks/usePivotViewerInteractions.js.map +1 -0
  90. package/dist/esm/PivotViewer/hooks/useRawGrouping.d.ts +22 -0
  91. package/dist/esm/PivotViewer/hooks/useRawGrouping.d.ts.map +1 -0
  92. package/dist/esm/PivotViewer/hooks/useRawGrouping.js +56 -0
  93. package/dist/esm/PivotViewer/hooks/useRawGrouping.js.map +1 -0
  94. package/dist/esm/PivotViewer/hooks/useScrollPositionTracking.d.ts +12 -0
  95. package/dist/esm/PivotViewer/hooks/useScrollPositionTracking.d.ts.map +1 -0
  96. package/dist/esm/PivotViewer/hooks/useScrollPositionTracking.js +20 -0
  97. package/dist/esm/PivotViewer/hooks/useScrollPositionTracking.js.map +1 -0
  98. package/dist/esm/PivotViewer/hooks/useViewerLayout.d.ts +16 -0
  99. package/dist/esm/PivotViewer/hooks/useViewerLayout.d.ts.map +1 -0
  100. package/dist/esm/PivotViewer/hooks/useViewerLayout.js +29 -0
  101. package/dist/esm/PivotViewer/hooks/useViewerLayout.js.map +1 -0
  102. package/dist/esm/PivotViewer/hooks/useVisibleIds.d.ts +21 -0
  103. package/dist/esm/PivotViewer/hooks/useVisibleIds.d.ts.map +1 -0
  104. package/dist/esm/PivotViewer/hooks/useVisibleIds.js +34 -0
  105. package/dist/esm/PivotViewer/hooks/useVisibleIds.js.map +1 -0
  106. package/dist/esm/SchemaEditor/SchemaEditor.d.ts +4 -1
  107. package/dist/esm/SchemaEditor/SchemaEditor.d.ts.map +1 -1
  108. package/dist/esm/SchemaEditor/SchemaEditor.js.map +1 -1
  109. package/dist/esm/SchemaEditor/SchemaEditorLabels.d.ts +6 -0
  110. package/dist/esm/SchemaEditor/SchemaEditorLabels.d.ts.map +1 -1
  111. package/dist/esm/SchemaEditor/SchemaEditorLabels.js.map +1 -1
  112. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.d.ts +11 -0
  113. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.d.ts.map +1 -0
  114. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.js +24 -0
  115. package/dist/esm/SchemaEditor/Tree/GeneratedToggle.js.map +1 -0
  116. package/dist/esm/SchemaEditor/Tree/Property.d.ts +6 -0
  117. package/dist/esm/SchemaEditor/Tree/Property.d.ts.map +1 -1
  118. package/dist/esm/SchemaEditor/Tree/Property.js.map +1 -1
  119. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.d.ts +2 -0
  120. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.d.ts.map +1 -1
  121. package/dist/esm/SchemaEditor/Tree/SchemaEditorContext.js.map +1 -1
  122. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.d.ts +2 -0
  123. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.d.ts.map +1 -1
  124. package/dist/esm/SchemaEditor/Tree/SchemaEditorParts.js.map +1 -1
  125. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.d.ts +12 -0
  126. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.d.ts.map +1 -0
  127. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.js +13 -0
  128. package/dist/esm/SchemaEditor/Tree/SchemaOrderedProperty.js.map +1 -0
  129. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.d.ts.map +1 -1
  130. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.js +2 -2
  131. package/dist/esm/SchemaEditor/Tree/SchemaPropertyRow.js.map +1 -1
  132. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.d.ts +8 -1
  133. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.d.ts.map +1 -1
  134. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.js +15 -11
  135. package/dist/esm/SchemaEditor/Tree/TreeSchemaEditor.js.map +1 -1
  136. package/dist/esm/SchemaEditor/Tree/schemaConversion.d.ts +15 -3
  137. package/dist/esm/SchemaEditor/Tree/schemaConversion.d.ts.map +1 -1
  138. package/dist/esm/SchemaEditor/Tree/schemaConversion.js +83 -27
  139. package/dist/esm/SchemaEditor/Tree/schemaConversion.js.map +1 -1
  140. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.d.ts +3 -0
  141. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.d.ts.map +1 -0
  142. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.js +7 -0
  143. package/dist/esm/SchemaEditor/Tree/schemaInOriginalOrder.js.map +1 -0
  144. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.d.ts.map +1 -1
  145. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.js +3 -0
  146. package/dist/esm/SchemaEditor/defaultSchemaEditorLabels.js.map +1 -1
  147. package/dist/esm/SchemaEditor/index.d.ts +1 -1
  148. package/dist/esm/SchemaEditor/index.d.ts.map +1 -1
  149. package/dist/esm/SchemaEditor/index.js +1 -1
  150. package/dist/esm/configuration/CratisComponentsDefaults.d.ts.map +1 -1
  151. package/dist/esm/configuration/CratisComponentsDefaults.js +2 -0
  152. package/dist/esm/configuration/CratisComponentsDefaults.js.map +1 -1
  153. package/dist/esm/styles.DataPage.css +51 -6
  154. package/dist/esm/styles.DataTables.css +51 -6
  155. package/dist/esm/styles.SchemaEditor.css +58 -16
  156. package/dist/esm/styles.css +58 -16
  157. package/dist/esm/styles.renderer.builtin.css +51 -6
  158. package/dist/esm/types/parts.d.ts +6 -2
  159. package/dist/esm/types/parts.d.ts.map +1 -1
  160. package/dist/esm/types/parts.js +6 -2
  161. package/dist/esm/types/parts.js.map +1 -1
  162. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ function singleGroup(ids) {
4
+ return {
5
+ groups: [
6
+ {
7
+ key: 'all',
8
+ label: 'All Items',
9
+ value: 'all',
10
+ ids,
11
+ count: ids.length,
12
+ },
13
+ ],
14
+ };
15
+ }
16
+ function useRawGrouping({ ready, visibleIds, currentGroupBy, viewMode, activeDimensionKey, computeGrouping, sortIds, }) {
17
+ const [rawGrouping, setRawGrouping] = useState({ groups: [] });
18
+ useEffect(() => {
19
+ if (!ready || visibleIds.length === 0) {
20
+ setRawGrouping({ groups: [] });
21
+ return;
22
+ }
23
+ let cancelled = false;
24
+ if (viewMode !== 'collection') {
25
+ void computeGrouping(visibleIds, currentGroupBy).then((result) => {
26
+ if (!cancelled)
27
+ setRawGrouping(result);
28
+ });
29
+ }
30
+ else if (activeDimensionKey) {
31
+ void sortIds(visibleIds, activeDimensionKey).then((sortedIds) => {
32
+ if (cancelled)
33
+ return;
34
+ setRawGrouping(singleGroup(sortedIds));
35
+ });
36
+ }
37
+ else {
38
+ setRawGrouping(singleGroup(visibleIds));
39
+ }
40
+ return () => {
41
+ cancelled = true;
42
+ };
43
+ }, [
44
+ ready,
45
+ visibleIds,
46
+ currentGroupBy,
47
+ viewMode,
48
+ computeGrouping,
49
+ sortIds,
50
+ activeDimensionKey,
51
+ ]);
52
+ return rawGrouping;
53
+ }
54
+
55
+ export { useRawGrouping };
56
+ //# sourceMappingURL=useRawGrouping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRawGrouping.js","sources":["../../../../PivotViewer/hooks/useRawGrouping.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useEffect, useState } from 'react';\nimport type { GroupSpec, GroupingResult } from '../engine/types';\nimport type { ViewMode } from '../components/Toolbar';\n\n/** Inputs for {@link useRawGrouping}. */\nexport interface UseRawGroupingOptions {\n ready: boolean;\n visibleIds: Uint32Array;\n currentGroupBy: GroupSpec;\n viewMode: ViewMode;\n activeDimensionKey: string | null;\n computeGrouping: (visibleIds: Uint32Array, groupBy: GroupSpec) => Promise<GroupingResult>;\n sortIds: (visibleIds: Uint32Array, sortBy: string) => Promise<Uint32Array>;\n}\n\n/** The single \"all items\" group shown in collection mode. */\nfunction singleGroup(ids: Uint32Array): GroupingResult {\n return {\n groups: [\n {\n key: 'all',\n label: 'All Items',\n value: 'all',\n ids,\n count: ids.length,\n },\n ],\n };\n}\n\n/**\n * Computes the (unpresented) grouping of the visible ids. Every async branch ignores a result\n * after its dependencies change, so an older worker response can never overwrite a newer\n * filter/search/view selection.\n *\n * @param options - Engine, view mode and visible ids.\n * @returns The raw grouping result.\n */\nexport function useRawGrouping({\n ready,\n visibleIds,\n currentGroupBy,\n viewMode,\n activeDimensionKey,\n computeGrouping,\n sortIds,\n}: UseRawGroupingOptions): GroupingResult {\n const [rawGrouping, setRawGrouping] = useState<GroupingResult>({ groups: [] });\n\n useEffect(() => {\n if (!ready || visibleIds.length === 0) {\n setRawGrouping({ groups: [] });\n return;\n }\n\n let cancelled = false;\n if (viewMode !== 'collection') {\n void computeGrouping(visibleIds, currentGroupBy).then((result) => {\n if (!cancelled) setRawGrouping(result);\n });\n } else if (activeDimensionKey) {\n // In collection mode, create a single group with all items.\n void sortIds(visibleIds, activeDimensionKey).then((sortedIds) => {\n if (cancelled) return;\n setRawGrouping(singleGroup(sortedIds));\n });\n } else {\n setRawGrouping(singleGroup(visibleIds));\n }\n\n return () => {\n cancelled = true;\n };\n }, [\n ready,\n visibleIds,\n currentGroupBy,\n viewMode,\n computeGrouping,\n sortIds,\n activeDimensionKey,\n ]);\n\n return rawGrouping;\n}\n"],"names":[],"mappings":";;AAmBA,SAAS,WAAW,CAAC,GAAgB,EAAA;IACjC,OAAO;AACH,QAAA,MAAM,EAAE;AACJ,YAAA;AACI,gBAAA,GAAG,EAAE,KAAK;AACV,gBAAA,KAAK,EAAE,WAAW;AAClB,gBAAA,KAAK,EAAE,KAAK;gBACZ,GAAG;gBACH,KAAK,EAAE,GAAG,CAAC,MAAM;AACpB,aAAA;AACJ,SAAA;KACJ;AACL;SAUgB,cAAc,CAA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 *
5
+ * @param containerRef - The scrollable container.
6
+ * @param setScrollPosition - Receives the new scroll offset.
7
+ */
8
+ export declare function useScrollPositionTracking(containerRef: RefObject<HTMLDivElement>, setScrollPosition: (position: {
9
+ x: number;
10
+ y: number;
11
+ }) => void): void;
12
+ //# sourceMappingURL=useScrollPositionTracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollPositionTracking.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/hooks/useScrollPositionTracking.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACrC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,iBAAiB,EAAE,CAAC,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,QAgBlE"}
@@ -0,0 +1,20 @@
1
+ import { useEffect } from 'react';
2
+
3
+ function useScrollPositionTracking(containerRef, setScrollPosition) {
4
+ useEffect(() => {
5
+ const container = containerRef.current;
6
+ if (!container)
7
+ return;
8
+ const handleScroll = () => {
9
+ setScrollPosition({
10
+ x: container.scrollLeft,
11
+ y: container.scrollTop,
12
+ });
13
+ };
14
+ container.addEventListener('scroll', handleScroll);
15
+ return () => container.removeEventListener('scroll', handleScroll);
16
+ }, [containerRef, setScrollPosition]);
17
+ }
18
+
19
+ export { useScrollPositionTracking };
20
+ //# sourceMappingURL=useScrollPositionTracking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollPositionTracking.js","sources":["../../../../PivotViewer/hooks/useScrollPositionTracking.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\n/**\n * Reports the container's scroll offset whenever it scrolls.\n *\n * @param containerRef - The scrollable container.\n * @param setScrollPosition - Receives the new scroll offset.\n */\nexport function useScrollPositionTracking(\n containerRef: RefObject<HTMLDivElement>,\n setScrollPosition: (position: { x: number; y: number }) => void,\n) {\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const handleScroll = () => {\n setScrollPosition({\n x: container.scrollLeft,\n y: container.scrollTop,\n });\n };\n\n container.addEventListener('scroll', handleScroll);\n return () => container.removeEventListener('scroll', handleScroll);\n }, [containerRef, setScrollPosition]);\n}\n"],"names":[],"mappings":";;AAYM,SAAU,yBAAyB,CACrC,YAAuC,EACvC,iBAA+D,EAAA;IAE/D,SAAS,CAAC,MAAK;AACX,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO;AACtC,QAAA,IAAI,CAAC,SAAS;YAAE;QAEhB,MAAM,YAAY,GAAG,MAAK;AACtB,YAAA,iBAAiB,CAAC;gBACd,CAAC,EAAE,SAAS,CAAC,UAAU;gBACvB,CAAC,EAAE,SAAS,CAAC,SAAS;AACzB,aAAA,CAAC;AACN,QAAA,CAAC;AAED,QAAA,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC;QAClD,OAAO,MAAM,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC;AACtE,IAAA,CAAC,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AACzC;;"}
@@ -0,0 +1,16 @@
1
+ import type { GroupingResult } from '../engine/types.js';
2
+ import type { ViewMode } from '../components/Toolbar.js';
3
+ /**
4
+ * Computes the card layout at base dimensions (zoom is applied as a transform).
5
+ *
6
+ * @param grouping - The presented grouping to lay out.
7
+ * @param viewMode - The current view mode.
8
+ * @param zoomLevel - The current zoom level.
9
+ * @param containerDimensions - The measured container size.
10
+ * @returns The computed layout.
11
+ */
12
+ export declare function useViewerLayout(grouping: GroupingResult, viewMode: ViewMode, zoomLevel: number, containerDimensions: {
13
+ width: number;
14
+ height: number;
15
+ }): import("../engine/types.js").LayoutResult;
16
+ //# sourceMappingURL=useViewerLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerLayout.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/hooks/useViewerLayout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAAuB,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,6CA0BzD"}
@@ -0,0 +1,29 @@
1
+ import { useMemo } from 'react';
2
+ import { computeLayout } from '../engine/layout.js';
3
+ import { BASE_CARD_WIDTH, BASE_CARD_HEIGHT, CARDS_PER_COLUMN } from '../constants.js';
4
+
5
+ function useViewerLayout(grouping, viewMode, zoomLevel, containerDimensions) {
6
+ return useMemo(() => {
7
+ const containerWidth = containerDimensions.width / zoomLevel;
8
+ const containerHeight = viewMode === 'collection'
9
+ ? containerDimensions.height / zoomLevel
10
+ : containerDimensions.height;
11
+ return computeLayout(grouping, {
12
+ viewMode,
13
+ cardWidth: BASE_CARD_WIDTH,
14
+ cardHeight: BASE_CARD_HEIGHT,
15
+ cardsPerColumn: CARDS_PER_COLUMN,
16
+ containerWidth,
17
+ containerHeight,
18
+ });
19
+ }, [
20
+ grouping,
21
+ viewMode,
22
+ zoomLevel,
23
+ containerDimensions.width,
24
+ containerDimensions.height,
25
+ ]);
26
+ }
27
+
28
+ export { useViewerLayout };
29
+ //# sourceMappingURL=useViewerLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerLayout.js","sources":["../../../../PivotViewer/hooks/useViewerLayout.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport type { GroupingResult } from '../engine/types';\nimport { computeLayout } from '../engine/layout';\nimport { BASE_CARD_WIDTH, BASE_CARD_HEIGHT, CARDS_PER_COLUMN, GROUP_SPACING } from '../constants';\nimport type { ViewMode } from '../components/Toolbar';\n\n/**\n * Computes the card layout at base dimensions (zoom is applied as a transform).\n *\n * @param grouping - The presented grouping to lay out.\n * @param viewMode - The current view mode.\n * @param zoomLevel - The current zoom level.\n * @param containerDimensions - The measured container size.\n * @returns The computed layout.\n */\nexport function useViewerLayout(\n grouping: GroupingResult,\n viewMode: ViewMode,\n zoomLevel: number,\n containerDimensions: { width: number; height: number },\n) {\n return useMemo(() => {\n const containerWidth = containerDimensions.width / zoomLevel;\n // For grouped mode, use fixed container height to ensure stable layout during zoom\n const containerHeight =\n viewMode === 'collection'\n ? containerDimensions.height / zoomLevel\n : containerDimensions.height;\n\n return computeLayout(grouping, {\n viewMode,\n cardWidth: BASE_CARD_WIDTH,\n cardHeight: BASE_CARD_HEIGHT,\n cardsPerColumn: CARDS_PER_COLUMN,\n groupSpacing: GROUP_SPACING,\n containerWidth,\n containerHeight,\n });\n }, [\n grouping,\n viewMode,\n zoomLevel,\n containerDimensions.width,\n containerDimensions.height,\n ]);\n}\n"],"names":[],"mappings":";;;;AAkBM,SAAU,eAAe,CAC3B,QAAwB,EACxB,QAAkB,EAClB,SAAiB,EACjB,mBAAsD,EAAA;IAEtD,OAAO,OAAO,CAAC,MAAK;AAChB,QAAA,MAAM,cAAc,GAAG,mBAAmB,CAAC,KAAK,GAAG,SAAS;AAE5D,QAAA,MAAM,eAAe,GACjB,QAAQ,KAAK;AACT,cAAE,mBAAmB,CAAC,MAAM,GAAG;AAC/B,cAAE,mBAAmB,CAAC,MAAM;QAEpC,OAAO,aAAa,CAAC,QAAQ,EAAE;YAC3B,QAAQ;AACR,YAAA,SAAS,EAAE,eAAe;AAC1B,YAAA,UAAU,EAAE,gBAAgB;AAC5B,YAAA,cAAc,EAAE,gBAAgB;AAChC,YACA,cAAc;YACd,eAAe;AAClB,SAAA,CAAC;AACN,IAAA,CAAC,EAAE;QACC,QAAQ;QACR,QAAQ;QACR,SAAS;AACT,QAAA,mBAAmB,CAAC,KAAK;AACzB,QAAA,mBAAmB,CAAC,MAAM;AAC7B,KAAA,CAAC;AACN;;"}
@@ -0,0 +1,21 @@
1
+ import type { FilterSpec, FilterResult } from '../engine/types.js';
2
+ import type { PivotViewerProps } from '../types.js';
3
+ /** Inputs for {@link useVisibleIds}. */
4
+ export interface UseVisibleIdsOptions<TItem extends object> {
5
+ ready: boolean;
6
+ data: TItem[];
7
+ currentFilters: FilterSpec[];
8
+ search: string;
9
+ searchFields: PivotViewerProps<TItem>['searchFields'];
10
+ engineApplyFilters: (filters: FilterSpec[]) => Promise<FilterResult>;
11
+ }
12
+ /**
13
+ * Applies filters, then narrows the result by search - a post-filter step over the visible
14
+ * Uint32 ids so it applies identically whether the engine result came from the worker or
15
+ * its synchronous fallback.
16
+ *
17
+ * @param options - Engine, data, filters and search inputs.
18
+ * @returns The ids currently visible.
19
+ */
20
+ export declare function useVisibleIds<TItem extends object>({ ready, data, currentFilters, search, searchFields, engineApplyFilters, }: UseVisibleIdsOptions<TItem>): Uint32Array;
21
+ //# sourceMappingURL=useVisibleIds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVisibleIds.d.ts","sourceRoot":"","sources":["../../../../PivotViewer/hooks/useVisibleIds.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAiB,CAAC;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAU,CAAC;AAEjD,wCAAwC;AACxC,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,MAAM;IACtD,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC;IACtD,kBAAkB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACxE;AAWD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,EAAE,EAChD,KAAK,EACL,IAAI,EACJ,cAAc,EACd,MAAM,EACN,YAAY,EACZ,kBAAkB,GACrB,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAAG,WAAW,CAyB3C"}
@@ -0,0 +1,34 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { filterVisibleIdsBySearch } from '../utils/search.js';
3
+
4
+ function allIds(count) {
5
+ const ids = new Uint32Array(count);
6
+ for (let i = 0; i < count; i++) {
7
+ ids[i] = i;
8
+ }
9
+ return ids;
10
+ }
11
+ function useVisibleIds({ ready, data, currentFilters, search, searchFields, engineApplyFilters, }) {
12
+ const [visibleIds, setVisibleIds] = useState(new Uint32Array(0));
13
+ useEffect(() => {
14
+ if (!ready)
15
+ return;
16
+ let cancelled = false;
17
+ void engineApplyFilters(currentFilters).then((result) => {
18
+ if (cancelled)
19
+ return;
20
+ let ids = result.visibleIds;
21
+ if (ids.length === 0 && currentFilters.length === 0 && data.length > 0) {
22
+ ids = allIds(data.length);
23
+ }
24
+ setVisibleIds(filterVisibleIdsBySearch(data, ids, search, searchFields));
25
+ });
26
+ return () => {
27
+ cancelled = true;
28
+ };
29
+ }, [ready, currentFilters, engineApplyFilters, data, search, searchFields]);
30
+ return visibleIds;
31
+ }
32
+
33
+ export { useVisibleIds };
34
+ //# sourceMappingURL=useVisibleIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVisibleIds.js","sources":["../../../../PivotViewer/hooks/useVisibleIds.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useEffect, useState } from 'react';\nimport type { FilterSpec, FilterResult } from '../engine/types';\nimport { filterVisibleIdsBySearch } from '../utils/search';\nimport type { PivotViewerProps } from '../types';\n\n/** Inputs for {@link useVisibleIds}. */\nexport interface UseVisibleIdsOptions<TItem extends object> {\n ready: boolean;\n data: TItem[];\n currentFilters: FilterSpec[];\n search: string;\n searchFields: PivotViewerProps<TItem>['searchFields'];\n engineApplyFilters: (filters: FilterSpec[]) => Promise<FilterResult>;\n}\n\n/** The full dataset's ids, used when the engine returns nothing while no filters are active. */\nfunction allIds(count: number): Uint32Array {\n const ids = new Uint32Array(count);\n for (let i = 0; i < count; i++) {\n ids[i] = i;\n }\n return ids;\n}\n\n/**\n * Applies filters, then narrows the result by search - a post-filter step over the visible\n * Uint32 ids so it applies identically whether the engine result came from the worker or\n * its synchronous fallback.\n *\n * @param options - Engine, data, filters and search inputs.\n * @returns The ids currently visible.\n */\nexport function useVisibleIds<TItem extends object>({\n ready,\n data,\n currentFilters,\n search,\n searchFields,\n engineApplyFilters,\n}: UseVisibleIdsOptions<TItem>): Uint32Array {\n const [visibleIds, setVisibleIds] = useState<Uint32Array>(new Uint32Array(0));\n\n useEffect(() => {\n if (!ready) return;\n\n let cancelled = false;\n void engineApplyFilters(currentFilters).then((result) => {\n if (cancelled) return;\n let ids = result.visibleIds;\n\n // If the engine failed to return any IDs while no filters are active,\n // fall back to showing the full dataset so the canvas never renders empty.\n if (ids.length === 0 && currentFilters.length === 0 && data.length > 0) {\n ids = allIds(data.length);\n }\n\n setVisibleIds(filterVisibleIdsBySearch(data, ids, search, searchFields));\n });\n return () => {\n cancelled = true;\n };\n }, [ready, currentFilters, engineApplyFilters, data, search, searchFields]);\n\n return visibleIds;\n}\n"],"names":[],"mappings":";;;AAmBA,SAAS,MAAM,CAAC,KAAa,EAAA;AACzB,IAAA,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC;AAClC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;AAC5B,QAAA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACd;AACA,IAAA,OAAO,GAAG;AACd;AAUM,SAAU,aAAa,CAAuB,EAChD,KAAK,EACL,IAAI,EACJ,cAAc,EACd,MAAM,EACN,YAAY,EACZ,kBAAkB,GACQ,EAAA;AAC1B,IAAA,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAc,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAE7E,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,CAAC,KAAK;YAAE;QAEZ,IAAI,SAAS,GAAG,KAAK;QACrB,KAAK,kBAAkB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAI;AACpD,YAAA,IAAI,SAAS;gBAAE;AACf,YAAA,IAAI,GAAG,GAAG,MAAM,CAAC,UAAU;AAI3B,YAAA,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;AACpE,gBAAA,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC7B;AAEA,YAAA,aAAa,CAAC,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAC5E,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,MAAK;YACR,SAAS,GAAG,IAAI;AACpB,QAAA,CAAC;AACL,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AAE3E,IAAA,OAAO,UAAU;AACrB;;"}
@@ -9,7 +9,10 @@ import type { Property } from './Tree/Property.js';
9
9
  import { type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor.js';
10
10
  export { defaultSchemaEditorLabels };
11
11
  export type { SchemaEditorLabels };
12
- /** Properties of the tree layout the table layout has no counterpart for. They are ignored when `layout` is `'table'`. */
12
+ /**
13
+ * Properties of the tree layout the table layout has no counterpart for, including allowGeneratedProperty
14
+ * and onSetGeneratedProperty. They are ignored when `layout` is `'table'`.
15
+ */
13
16
  type TreeOnlyProps = Omit<TreeSchemaEditorProps, 'schema' | 'onChange' | 'labels' | 'className' | 'allowKeyProperty' | 'allowRequired' | 'readOnly' | 'isPropertyProtected' | 'validatePropertyName' | 'onPropertyRemoved' | 'onPropertyRenamed' | 'header' | 'footer'>;
14
17
  /**
15
18
  * Props for {@link SchemaEditor}.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditor.d.ts","sourceRoot":"","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAsB,MAAM,wBAAqB,CAAC;AAC1E,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,wBAAqB,CAAC;AAE5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAiB,CAAC;AAEhD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,4BAAyB,CAAC;AAEvF,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC,0HAA0H;AAC1H,KAAK,aAAa,GAAG,IAAI,CACrB,qBAAqB,EACnB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAAW,GACX,kBAAkB,GAClB,eAAe,GAC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;IAEnB,kGAAkG;IAClG,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC;IAEtD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,MAAM,GAAG,SAAS,CAAC;IAEtG,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAEjD,wGAAwG;IACxG,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvE,mFAAmF;IACnF,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AAsvBD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,UAAW,iBAAiB,gCAC2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditor.js","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, useEffect, useMemo, useCallback } from 'react';\nimport { Button } from '../Common/Button';\nimport { Checkbox } from '../Common/Checkbox';\nimport { DataTableCore } from '../DataTables/DataTableCore';\nimport { Column } from '../DataTables/Column';\nimport { ActionMenubar, type ActionMenuItem } from '../Common/ActionMenubar';\nimport { Tooltip } from '../Common/Tooltip';\nimport { Message } from '../Display/Message';\nimport * as faIcons from 'react-icons/fa6';\nimport { NameCell } from './NameCell';\nimport { TypeCell } from './TypeCell';\nimport type { ReactNode } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport type { JsonSchema, JsonSchemaProperty } from '../types/JsonSchema';\nimport { type TypeFormat, DEFAULT_TYPE_FORMATS } from '../types/TypeFormat';\nimport { validatePropertyName, buildBreadcrumbItems } from './schemaHelpers';\nimport { defaultSchemaEditorLabels } from './defaultSchemaEditorLabels';\nimport type { SchemaEditorLabels } from './SchemaEditorLabels';\n\nimport type { SchemaEditorLayout } from './SchemaEditorLayout';\nimport type { Property } from './Tree/Property';\nimport { jsonSchemaToProperties, KEY_KEYWORD } from './Tree/schemaConversion';\nimport { TreeSchemaEditor, type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor';\n\nexport { defaultSchemaEditorLabels };\nexport type { SchemaEditorLabels };\n\n/** Properties of the tree layout the table layout has no counterpart for. They are ignored when `layout` is `'table'`. */\ntype TreeOnlyProps = Omit<\n TreeSchemaEditorProps,\n | 'schema'\n | 'onChange'\n | 'labels'\n | 'className'\n | 'allowKeyProperty'\n | 'allowRequired'\n | 'readOnly'\n | 'isPropertyProtected'\n | 'validatePropertyName'\n | 'onPropertyRemoved'\n | 'onPropertyRenamed'\n | 'header'\n | 'footer'\n>;\n\nconst emptySchema: JsonSchema = {};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Recursively validates that a parsed schema node, its required names, and every nested\n * `properties`, `definitions`, and `items` schema match the supported object shape. A JSON-valid\n * document can still contain malformed nested values (for example `properties.foo: null`,\n * `required: {}`, or `items: \"string\"`) that later code dereferences as schema data; those are\n * rejected here rather than crashing downstream.\n */\nconst isValidSchemaNode = (node: unknown): node is JsonSchema => {\n if (!isPlainObject(node)) {\n return false;\n }\n\n if (\n node.required !== undefined &&\n (!Array.isArray(node.required) ||\n !node.required.every((propertyName) => typeof propertyName === 'string'))\n ) {\n return false;\n }\n\n for (const nestedSchemas of [node.properties, node.definitions]) {\n if (nestedSchemas === undefined) continue;\n if (!isPlainObject(nestedSchemas)) return false;\n for (const nestedSchema of Object.values(nestedSchemas)) {\n if (!isValidSchemaNode(nestedSchema)) return false;\n }\n }\n\n if (node.items !== undefined && !isValidSchemaNode(node.items)) {\n return false;\n }\n\n return true;\n};\n\nconst cloneSchema = (schema: JsonSchema): JsonSchema | undefined => {\n try {\n const serializedSchema = JSON.stringify(schema);\n if (serializedSchema === undefined) return undefined;\n\n const parsedSchema: unknown = JSON.parse(serializedSchema);\n if (!isValidSchemaNode(parsedSchema)) {\n return undefined;\n }\n\n return parsedSchema;\n } catch {\n return undefined;\n }\n};\n\n/** Follows a drill-down path (property names and `$items`) to the schema it points at. */\nconst findSchemaAtPath = (root: JsonSchema, path: string[]): JsonSchema | undefined => {\n let target: JsonSchema | JsonSchemaProperty = root;\n for (const segment of path) {\n if (target.type === 'array' && segment === '$items') {\n target = target.items || {};\n } else if (target.properties && target.properties[segment]) {\n target = target.properties[segment];\n } else {\n return undefined;\n }\n }\n return target as unknown as JsonSchema;\n};\n\nconst asJsonSchema = (property: JsonSchemaProperty): JsonSchema => {\n // SAFETY: A nested \"object\" property has the same editable shape as a schema —\n // `properties`, `items`, and `required` all mean the same thing on both types.\n return property as unknown as JsonSchema;\n};\n\nconst asJsonSchemaProperty = (schema: JsonSchema): JsonSchemaProperty => {\n // SAFETY: The inverse of asJsonSchema; the shapes are structurally interchangeable.\n return schema as unknown as JsonSchemaProperty;\n};\n\n/**\n * Props for {@link SchemaEditor}.\n */\nexport interface SchemaEditorProps extends TreeOnlyProps {\n /**\n * Which editor to render. `'table'` (the default) is the breadcrumb-navigated table with an Edit, Save and\n * Cancel workflow; `'tree'` is the inline tree editor that applies every edit live. See the layout notes in\n * the documentation for the props each layout honors.\n */\n layout?: SchemaEditorLayout;\n\n /**\n * The JSON Schema being viewed or edited. Required unless the tree layout is controlled through\n * `properties`.\n */\n schema?: JsonSchema;\n\n /** Optional event-type label displayed in the editor header. */\n eventTypeName?: string;\n\n /** When false, the Edit action remains visible but cannot enter edit mode; defaults to `true`. */\n canEdit?: boolean;\n\n /**\n * When {@link canEdit} is false, this string is shown as a tooltip on an\n * inert Edit action to explain why editing is unavailable.\n */\n canNotEditReason?: string;\n\n /** Invoked with the updated schema and optional metadata after any structural change. */\n onChange?: ChangeHandler<JsonSchema>;\n\n /** Invoked when the user activates the Save action. */\n onSave?: () => void;\n\n /** Invoked when the user activates the Cancel action. */\n onCancel?: () => void;\n\n /** Initial edit-mode state; defaults to `false` (read-only). */\n editMode?: boolean;\n\n /** When true, hides the Save menu item even while in edit mode. */\n saveDisabled?: boolean;\n\n /** When true, hides the Cancel menu item even while in edit mode. */\n cancelDisabled?: boolean;\n\n /**\n * Override the list of selectable type formats per JSON Schema type. Each\n * entry contributes options to the type-format dropdown shown in edit\n * mode. Defaults to {@link DEFAULT_TYPE_FORMATS}.\n */\n typeFormats?: TypeFormat[];\n\n /**\n * Extra CSS class names appended to the editor root. Combined with the\n * default `schema-editor` class. For fine-grained styling of internal\n * Components controls, use product tokens and stable Cratis parts.\n */\n className?: string;\n\n /** Override any user-facing string (for localization). See {@link SchemaEditorLabels}. */\n labels?: Partial<SchemaEditorLabels>;\n\n /**\n * Offers the key toggle (`x-key`, at most one property per object). In the table layout this adds a Key\n * column, editable in edit mode; a function enables the column for every row. In the tree layout it is\n * offered on every property, or per property when a function is given.\n */\n allowKeyProperty?: TreeSchemaEditorProps['allowKeyProperty'];\n\n /**\n * Offers the toggle for whether a property must be present (the `required` list). In the table layout this\n * adds a Required column, editable in edit mode.\n */\n allowRequired?: boolean;\n\n /** Offers no edits at all. Tree layout only: the table layout is read-only until Edit is chosen, controlled by `canEdit`. */\n readOnly?: boolean;\n\n /** Decides which properties can be neither renamed nor removed. By default none. Both layouts. */\n isPropertyProtected?: (property: Property) => boolean;\n\n /**\n * Extra check of a new name, after the editor has rejected blank, reserved and duplicate names. Return the\n * message to show, or `undefined` to accept the name. Both layouts.\n */\n validatePropertyName?: (name: string, property: Property, siblings: Property[]) => string | undefined;\n\n /** Called after a property was removed, with the property and everything nested under it. Both layouts. */\n onPropertyRemoved?: (property: Property) => void;\n\n /** Called after a property was renamed, with the renamed property and the name it had. Both layouts. */\n onPropertyRenamed?: (property: Property, previousName: string) => void;\n\n /** Content above the editor, for example the title of the schema. Both layouts. */\n header?: ReactNode;\n\n /** Content below the properties, for example further actions. Both layouts. */\n footer?: ReactNode;\n}\n\n/**\n * A breadcrumb-navigated editor for JSON Schemas. Lets users browse nested\n * `object` and `array` property definitions, add or remove properties, change\n * types and formats, and validate naming rules in place. Designed to drive\n * UIs around event payload schemas and similar structural documents.\n *\n * The editor composes a Cratis data table, action toolbar, and form widgets\n * internally. Restyle it through semantic tokens, the editor root `className`,\n * and documented `data-cratis-part` values rather than a provider preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nconst TableSchemaEditor = ({\n schema: suppliedSchema,\n eventTypeName = '',\n canEdit = true,\n canNotEditReason,\n onChange,\n onSave,\n onCancel,\n editMode,\n saveDisabled = false,\n cancelDisabled = false,\n typeFormats = DEFAULT_TYPE_FORMATS,\n className,\n labels,\n allowKeyProperty,\n allowRequired,\n isPropertyProtected,\n validatePropertyName: validateCustomPropertyName,\n onPropertyRemoved,\n onPropertyRenamed,\n header,\n footer,\n}: SchemaEditorProps) => {\n const schema = suppliedSchema ?? emptySchema;\n const l = useMemo(() => ({ ...defaultSchemaEditorLabels, ...labels }) as Required<SchemaEditorLabels>, [labels]);\n const showKey = allowKeyProperty !== undefined && allowKeyProperty !== false;\n const showRequired = allowRequired === true;\n const [currentPath, setCurrentPath] = useState<string[]>([]);\n const [properties, setProperties] = useState<JsonSchemaProperty[]>([]);\n const [initialParsedSchema] = useState<JsonSchema | undefined>(() =>\n cloneSchema(schema),\n );\n const [currentSchema, setCurrentSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [isEditMode, setIsEditMode] = useState(editMode ?? false);\n const [initialSchema, setInitialSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [schemaJsonIsInvalid, setSchemaJsonIsInvalid] = useState(\n initialParsedSchema === undefined,\n );\n const [validationErrors, setValidationErrors] = useState<Record<string, string>>({});\n\n useEffect(() => {\n if (!isEditMode) {\n setCurrentPath([]);\n }\n }, [isEditMode]);\n\n const validateAllProperties = useCallback(\n (properties: JsonSchemaProperty[], level: Property[] = []) => {\n const errors: Record<string, string> = {};\n\n properties.forEach((prop) => {\n let error = validatePropertyName(prop.name ?? '', prop.id!, properties);\n if (!error && validateCustomPropertyName) {\n const property = level.find((candidate) => candidate.name === prop.name);\n if (property) {\n error = validateCustomPropertyName(property.name, property, level);\n }\n }\n if (error) {\n errors[prop.id!] = error;\n }\n });\n\n setValidationErrors(errors);\n return Object.keys(errors).length === 0;\n },\n [validatePropertyName, validateCustomPropertyName],\n );\n\n useEffect(() => {\n const parsedSchema = cloneSchema(schema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setSchemaJsonIsInvalid(false);\n setCurrentSchema(parsedSchema);\n setInitialSchema(parsedSchema);\n }, [schema]);\n\n useEffect(() => {\n loadPropertiesForCurrentPath();\n }, [currentPath, currentSchema, isEditMode]);\n\n const loadPropertiesForCurrentPath = () => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return;\n }\n }\n\n const schemaProps: JsonSchemaProperty[] = [];\n if (targetSchema.properties) {\n let idCounter = 0;\n for (const [name, property] of Object.entries(targetSchema.properties)) {\n schemaProps.push({\n id: `prop-${currentPath.join('-')}-${idCounter++}`,\n name,\n type: property.type || 'string',\n format: property.format,\n description: property.description,\n items: property.items,\n properties: property.properties,\n // A property's own `required` array (populated when its `type`\n // is \"object\") lists which of *its* properties are required.\n // It is scoped to this property alone — never to the parent\n // schema's `required` array — and is carried through verbatim\n // so navigating into it (see asJsonSchema) sees it intact.\n required: property.required,\n });\n }\n }\n\n setProperties(schemaProps);\n if (isEditMode) {\n validateAllProperties(schemaProps, jsonSchemaToProperties(targetSchema as unknown as JsonSchema));\n }\n };\n\n const updateSchemaAtPath = useCallback(\n (path: string[], updater: (schema: JsonSchema) => JsonSchema) => {\n const newSchema = cloneSchema(currentSchema);\n if (!newSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n if (path.length === 0) {\n const updated = updater(newSchema);\n setCurrentSchema(updated);\n onChange?.(updated, { source: 'user' });\n return;\n }\n\n let targetSchema = newSchema;\n for (let i = 0; i < path.length - 1; i++) {\n const segment = path[i];\n if (targetSchema.type === 'array' && segment === '$items') {\n if (!targetSchema.items) {\n targetSchema.items = { type: 'object', properties: {} };\n }\n targetSchema = targetSchema.items;\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = asJsonSchema(targetSchema.properties[segment]);\n }\n }\n\n const lastSegment = path[path.length - 1];\n if (targetSchema.type === 'array' && lastSegment === '$items') {\n targetSchema.items = updater(targetSchema.items || {});\n } else {\n if (!targetSchema.properties) {\n targetSchema.properties = {};\n }\n const propertySchema = targetSchema.properties[lastSegment];\n targetSchema.properties[lastSegment] = asJsonSchemaProperty(\n updater(propertySchema ? asJsonSchema(propertySchema) : {}),\n );\n }\n\n setCurrentSchema(newSchema);\n onChange?.(newSchema, { source: 'user' });\n },\n [currentSchema, onChange],\n );\n\n const addProperty = useCallback(() => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n let newName = 'newProperty';\n let counter = 1;\n while (newProps[newName]) {\n newName = `newProperty${counter++}`;\n }\n newProps[newName] = { type: 'string' };\n return { ...schema, properties: newProps };\n });\n }, [currentPath, updateSchemaAtPath]);\n\n /** The editable view of the properties at the current path, for the host callbacks. */\n const getLevelProperties = useCallback(\n () => jsonSchemaToProperties(findSchemaAtPath(currentSchema, currentPath)),\n [currentSchema, currentPath],\n );\n\n const isProtected = useCallback(\n (propertyName: string) => {\n if (!isPropertyProtected) return false;\n const property = getLevelProperties().find((candidate) => candidate.name === propertyName);\n return property !== undefined && isPropertyProtected(property);\n },\n [isPropertyProtected, getLevelProperties],\n );\n\n const removeProperty = useCallback(\n (propertyName: string) => {\n const removed = getLevelProperties().find((candidate) => candidate.name === propertyName);\n if (removed && isPropertyProtected?.(removed)) return;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n delete newProps[propertyName];\n\n // Deleting a property must also drop it from this schema's own\n // `required` array, or the array keeps naming a property that no\n // longer exists in `properties`.\n const updated: JsonSchema = { ...schema, properties: newProps };\n if (schema.required?.includes(propertyName)) {\n updated.required = schema.required.filter(\n (name) => name !== propertyName,\n );\n }\n\n return updated;\n });\n if (removed) onPropertyRemoved?.(removed);\n },\n [currentPath, updateSchemaAtPath, getLevelProperties, isPropertyProtected, onPropertyRemoved],\n );\n\n const setRequired = useCallback(\n (propertyName: string, isRequired: boolean) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const others = (schema.required ?? []).filter((name) => name !== propertyName);\n const required = isRequired ? [...others, propertyName] : others;\n const updated: JsonSchema = { ...schema };\n if (required.length > 0) {\n updated.required = required;\n } else {\n delete updated.required;\n }\n return updated;\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const setKey = useCallback(\n (propertyName: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps: Record<string, JsonSchemaProperty> = {};\n for (const [name, property] of Object.entries(schema.properties || {})) {\n const { [KEY_KEYWORD]: previousKey, ...rest } = property as JsonSchemaProperty & Record<string, unknown>;\n const makeKey = name === propertyName && previousKey !== true;\n newProps[name] = (makeKey ? { ...rest, [KEY_KEYWORD]: true } : rest) as JsonSchemaProperty;\n }\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const updateProperty = useCallback(\n (\n oldName: string,\n field: keyof JsonSchemaProperty,\n value: unknown,\n additionalUpdates?: Partial<JsonSchemaProperty>,\n ) => {\n let renamed: Property | undefined;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[oldName] || {}) };\n\n let newRequired = schema.required;\n\n if (field === 'name') {\n const newName = value as string;\n if (newName !== oldName && !newProps[newName] && !isProtected(oldName)) {\n renamed = jsonSchemaToProperties({ properties: { [newName]: prop } })[0];\n newProps[newName] = prop;\n delete newProps[oldName];\n\n // Renaming a required property must keep the `required`\n // array pointing at the new name, or it goes stale and\n // silently references a property that no longer exists.\n if (schema.required?.includes(oldName)) {\n newRequired = schema.required.map((name) =>\n name === oldName ? newName : name,\n );\n }\n }\n } else if (field === 'type') {\n prop.type = value as string;\n // A concept belongs to the type it was chosen for; the table offers no concepts.\n delete (prop as Record<string, unknown>)['x-concept'];\n if (value === 'array') {\n prop.items = { type: 'string' };\n delete prop.format;\n // Only an \"object\" property has a meaningful `required`\n // array of its own; any prior one is now stale.\n delete prop.required;\n } else if (value === 'object') {\n prop.properties = {};\n delete prop.format;\n delete prop.items;\n // Starting fresh with empty `properties`, so any prior\n // `required` array (naming properties that no longer\n // exist here) would be stale.\n delete prop.required;\n } else {\n delete prop.items;\n delete prop.properties;\n delete prop.required;\n }\n\n if (additionalUpdates) {\n if ('format' in additionalUpdates) {\n if (additionalUpdates.format) {\n prop.format = additionalUpdates.format as string;\n } else {\n delete prop.format;\n }\n }\n }\n\n newProps[oldName] = prop;\n } else if (field === 'format') {\n if (value && value !== 'none') {\n prop.format = value as string;\n } else {\n delete prop.format;\n }\n newProps[oldName] = prop;\n }\n\n return { ...schema, properties: newProps, required: newRequired };\n });\n if (renamed) onPropertyRenamed?.(renamed, oldName);\n },\n [currentPath, updateSchemaAtPath, isProtected, onPropertyRenamed],\n );\n\n const updateArrayItemType = useCallback(\n (propertyName: string, itemType: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[propertyName] || {}) };\n\n if (itemType === 'object') {\n prop.items = { type: 'object', properties: {} };\n } else if (itemType === 'array') {\n prop.items = { type: 'array', items: { type: 'string' } };\n } else {\n prop.items = { type: itemType };\n }\n\n newProps[propertyName] = prop;\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const navigateToProperty = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName]);\n },\n [currentPath],\n );\n\n const navigateToArrayItems = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName, '$items']);\n },\n [currentPath],\n );\n\n const navigateBack = useCallback(() => {\n if (currentPath.length > 0) {\n setCurrentPath(currentPath.slice(0, -1));\n }\n }, [currentPath]);\n\n const navigateToBreadcrumb = useCallback(\n (index: number) => {\n const items = getBreadcrumbItems();\n setCurrentPath(items[index].path);\n },\n [currentPath, eventTypeName],\n );\n\n const handleSave = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n onSave?.();\n setIsEditMode(false);\n }, [onSave, schemaJsonIsInvalid]);\n\n const handleCancel = useCallback(() => {\n const restoredSchema = cloneSchema(initialSchema);\n const changedSchema = cloneSchema(initialSchema);\n if (!restoredSchema || !changedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n const hasChanges = JSON.stringify(currentSchema) !== JSON.stringify(initialSchema);\n setCurrentSchema(restoredSchema);\n if (hasChanges) {\n onChange?.(changedSchema, { source: 'reset' });\n }\n setIsEditMode(false);\n onCancel?.();\n }, [currentSchema, initialSchema, onChange, onCancel]);\n\n const handleEdit = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n const parsedSchema = cloneSchema(currentSchema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setInitialSchema(parsedSchema);\n setIsEditMode(true);\n }, [currentSchema, schemaJsonIsInvalid]);\n\n const getBreadcrumbItems = () => buildBreadcrumbItems(eventTypeName, currentPath);\n\n const getCurrentDescription = useCallback(() => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return undefined;\n }\n }\n\n return targetSchema.description;\n }, [currentSchema, currentPath]);\n\n const hasValidationErrors =\n schemaJsonIsInvalid || Object.keys(validationErrors).length > 0;\n\n const menuItems = useMemo<ActionMenuItem[]>(\n () => [\n ...(isEditMode\n ? []\n : [\n {\n label: l.edit,\n icon: <faIcons.FaPencil className='cratis:mr-2' />,\n command:\n canEdit && !schemaJsonIsInvalid ? handleEdit : undefined,\n disabled: schemaJsonIsInvalid,\n className: canEdit ? undefined : 'edit-disabled-with-reason',\n template:\n !canEdit && canNotEditReason\n ? (item: ActionMenuItem) => (\n <Tooltip\n content={canNotEditReason}\n position='bottom'\n >\n <button\n type='button'\n aria-disabled='true'\n style={{\n border: 0,\n background: 'transparent',\n color: 'inherit',\n cursor: 'not-allowed',\n opacity: 0.6,\n display: 'inline-flex',\n alignItems: 'center',\n padding: '0.5rem 0.75rem',\n }}\n >\n {item.icon}\n <span>{item.label}</span>\n </button>\n </Tooltip>\n )\n : undefined,\n },\n ]),\n ...(isEditMode\n ? [\n ...(saveDisabled\n ? []\n : [\n {\n label: l.save,\n icon: <faIcons.FaCheck className='cratis:mr-2' />,\n command: hasValidationErrors ? undefined : handleSave,\n disabled: hasValidationErrors,\n },\n ]),\n ...(cancelDisabled\n ? []\n : [\n {\n label: l.cancel,\n icon: <faIcons.FaXmark className='cratis:mr-2' />,\n command: handleCancel,\n },\n ]),\n {\n label: l.addProperty,\n icon: <faIcons.FaPlus className='cratis:mr-2' />,\n command: schemaJsonIsInvalid ? undefined : addProperty,\n disabled: schemaJsonIsInvalid,\n },\n ]\n : []),\n ],\n [\n isEditMode,\n handleSave,\n handleCancel,\n handleEdit,\n addProperty,\n canEdit,\n canNotEditReason,\n hasValidationErrors,\n schemaJsonIsInvalid,\n saveDisabled,\n cancelDisabled,\n l,\n ],\n );\n\n const breadcrumbItems = getBreadcrumbItems();\n const isAtRoot = currentPath.length === 0;\n const currentDescription = getCurrentDescription();\n const currentLevel = findSchemaAtPath(currentSchema, currentPath);\n\n return (\n <div\n className={className ? `schema-editor ${className}` : 'schema-editor'}\n style={{ display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n {header}\n <div className='cratis:px-4 cratis:py-4'>\n <div className='schema-editor-menubar'>\n <ActionMenubar aria-label={l.actions} model={menuItems} />\n </div>\n {schemaJsonIsInvalid && (\n <Message\n severity='error'\n text={l.invalidJson}\n className='cratis:mt-3'\n />\n )}\n </div>\n\n <div className='cratis:px-4 cratis:py-2 cratis-schema-editor-bottom-border'>\n <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>\n <Tooltip content={l.navigateBack} position='top'>\n <Button\n variant='ghost'\n size='small'\n icon={<faIcons.FaArrowLeft />}\n onClick={navigateBack}\n disabled={isAtRoot}\n aria-label={l.navigateBack}\n />\n </Tooltip>\n <div\n style={{\n fontSize: '0.9rem',\n color: 'var(--cratis-text-color-secondary)',\n cursor: 'pointer',\n }}\n >\n {breadcrumbItems.map((item, index) => (\n <span key={index}>\n {index > 0 && <span className='cratis:mx-2'>&gt;</span>}\n <button\n type='button'\n onClick={() => navigateToBreadcrumb(index)}\n aria-current={\n index === breadcrumbItems.length - 1\n ? 'location'\n : undefined\n }\n style={{\n padding: 0,\n border: 0,\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n cursor: 'pointer',\n textDecoration:\n index < breadcrumbItems.length - 1\n ? 'underline'\n : 'none',\n }}\n >\n {item.name}\n </button>\n </span>\n ))}\n </div>\n </div>\n {currentDescription && (\n <div\n style={{\n fontSize: '0.875rem',\n color: 'var(--cratis-text-color-secondary)',\n marginTop: '0.5rem',\n marginLeft: '2.5rem',\n fontStyle: 'italic',\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n }}\n >\n <faIcons.FaCircleInfo />\n <span>{currentDescription}</span>\n </div>\n )}\n </div>\n\n <div style={{ flex: 1, overflow: 'auto', padding: '1rem' }}>\n <DataTableCore<JsonSchemaProperty>\n key={`${isEditMode}-${currentPath.join('/')}`}\n data={properties}\n dataKey='id'\n emptyMessage={l.emptyMessage}\n rowClassName={(rowData) => {\n if (\n !isEditMode &&\n (rowData.type === 'object' ||\n (rowData.type === 'array' &&\n rowData.items?.type === 'object'))\n ) {\n return 'cratis-schema-editor-navigable-row';\n }\n return '';\n }}\n onRowClick={(e) => {\n if (!isEditMode) {\n const rowData = e.data;\n if (rowData.name) {\n if (rowData.type === 'object') {\n navigateToProperty(rowData.name);\n } else if (\n rowData.type === 'array' &&\n rowData.items?.type === 'object'\n ) {\n navigateToArrayItems(rowData.name);\n }\n }\n }\n }}\n pt={{\n root: { style: { border: 'none' } },\n body: {\n style: {\n borderTop: '1px solid var(--cratis-surface-border)',\n },\n },\n }}\n >\n <Column\n field='name'\n header='Property'\n body={(rowData: JsonSchemaProperty) => (\n <NameCell\n rowData={rowData}\n isEditMode={isEditMode}\n onUpdate={updateProperty}\n validationError={validationErrors[rowData.id!]}\n propertyNameLabel={l.propertyName}\n isLocked={isProtected(rowData.name ?? '')}\n lockedReason={l.protectedProperty}\n />\n )}\n style={{ width: '30%' }}\n />\n {showRequired && (\n <Column\n header={l.requiredColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.requiredProperty(rowData.name ?? '')}\n checked={Boolean(currentLevel?.required?.includes(rowData.name ?? ''))}\n readOnly={!isEditMode}\n onChange={(checked) => setRequired(rowData.name ?? '', checked)}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n {showKey && (\n <Column\n header={l.keyColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.keyProperty(rowData.name ?? '')}\n checked={isKeyProperty(currentLevel, rowData.name ?? '')}\n readOnly={!isEditMode}\n onChange={() => setKey(rowData.name ?? '')}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n <Column\n header='Type'\n body={(rowData: JsonSchemaProperty) => (\n <TypeCell\n rowData={rowData}\n isEditMode={isEditMode}\n typeFormats={typeFormats}\n onUpdateProperty={updateProperty}\n onUpdateArrayItemType={updateArrayItemType}\n onNavigateToProperty={navigateToProperty}\n onNavigateToArrayItems={navigateToArrayItems}\n onRemoveProperty={removeProperty}\n canRemove={!isProtected(rowData.name ?? '')}\n labels={l}\n />\n )}\n style={{ width: '70%' }}\n />\n </DataTableCore>\n </div>\n {footer}\n </div>\n );\n};\n\nconst isKeyProperty = (level: JsonSchema | undefined, propertyName: string): boolean =>\n (level?.properties?.[propertyName] as Record<string, unknown> | undefined)?.[KEY_KEYWORD] === true;\n\n/**\n * Edits the properties of a JSON Schema. By default (`layout='table'`) it is a breadcrumb-navigated table: it\n * lets users browse nested `object` and `array` property definitions, add or remove properties, change types and\n * formats, and validate naming rules in place, behind an Edit, Save and Cancel workflow. With `layout='tree'` it\n * is an inline tree that shows nested properties in place and applies every edit live. Designed to drive UIs\n * around event payload schemas and similar structural documents.\n *\n * Both layouts accept `allowRequired`, `allowKeyProperty`, `isPropertyProtected`, `validatePropertyName`,\n * `onPropertyRenamed`, `onPropertyRemoved`, `header` and `footer`. The tree layout also takes concepts, controlled\n * mode, per-row slots and selection; see the documentation for the exact split.\n *\n * The table layout composes a Cratis data table, action toolbar, and form widgets internally. Restyle it through\n * semantic tokens, the editor root `className`, and documented `data-cratis-part` values rather than a provider\n * preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nexport const SchemaEditor = (props: SchemaEditorProps) =>\n props.layout === 'tree' ? <TreeSchemaEditor {...props} /> : <TableSchemaEditor {...props} />;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,MAAM,WAAW,GAAe,EAAE;AAElC,MAAM,aAAa,GAAG,CAAC,KAAc,KACjC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AASxE,MAAM,iBAAiB,GAAG,CAAC,IAAa,KAAwB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GAAK,KAAK,EAAA,CAAI,GAAGA,GAAA,CAAC,iBAAiB,EAAA,EAAA,GAAK,KAAK;;"}
1
+ {"version":3,"file":"SchemaEditor.js","sources":["../../../SchemaEditor/SchemaEditor.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, useEffect, useMemo, useCallback } from 'react';\nimport { Button } from '../Common/Button';\nimport { Checkbox } from '../Common/Checkbox';\nimport { DataTableCore } from '../DataTables/DataTableCore';\nimport { Column } from '../DataTables/Column';\nimport { ActionMenubar, type ActionMenuItem } from '../Common/ActionMenubar';\nimport { Tooltip } from '../Common/Tooltip';\nimport { Message } from '../Display/Message';\nimport * as faIcons from 'react-icons/fa6';\nimport { NameCell } from './NameCell';\nimport { TypeCell } from './TypeCell';\nimport type { ReactNode } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport type { JsonSchema, JsonSchemaProperty } from '../types/JsonSchema';\nimport { type TypeFormat, DEFAULT_TYPE_FORMATS } from '../types/TypeFormat';\nimport { validatePropertyName, buildBreadcrumbItems } from './schemaHelpers';\nimport { defaultSchemaEditorLabels } from './defaultSchemaEditorLabels';\nimport type { SchemaEditorLabels } from './SchemaEditorLabels';\n\nimport type { SchemaEditorLayout } from './SchemaEditorLayout';\nimport type { Property } from './Tree/Property';\nimport { jsonSchemaToProperties, KEY_KEYWORD } from './Tree/schemaConversion';\nimport { TreeSchemaEditor, type TreeSchemaEditorProps } from './Tree/TreeSchemaEditor';\n\nexport { defaultSchemaEditorLabels };\nexport type { SchemaEditorLabels };\n\n/**\n * Properties of the tree layout the table layout has no counterpart for, including allowGeneratedProperty\n * and onSetGeneratedProperty. They are ignored when `layout` is `'table'`.\n */\ntype TreeOnlyProps = Omit<\n TreeSchemaEditorProps,\n | 'schema'\n | 'onChange'\n | 'labels'\n | 'className'\n | 'allowKeyProperty'\n | 'allowRequired'\n | 'readOnly'\n | 'isPropertyProtected'\n | 'validatePropertyName'\n | 'onPropertyRemoved'\n | 'onPropertyRenamed'\n | 'header'\n | 'footer'\n>;\n\nconst emptySchema: JsonSchema = {};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/**\n * Recursively validates that a parsed schema node, its required names, and every nested\n * `properties`, `definitions`, and `items` schema match the supported object shape. A JSON-valid\n * document can still contain malformed nested values (for example `properties.foo: null`,\n * `required: {}`, or `items: \"string\"`) that later code dereferences as schema data; those are\n * rejected here rather than crashing downstream.\n */\nconst isValidSchemaNode = (node: unknown): node is JsonSchema => {\n if (!isPlainObject(node)) {\n return false;\n }\n\n if (\n node.required !== undefined &&\n (!Array.isArray(node.required) ||\n !node.required.every((propertyName) => typeof propertyName === 'string'))\n ) {\n return false;\n }\n\n for (const nestedSchemas of [node.properties, node.definitions]) {\n if (nestedSchemas === undefined) continue;\n if (!isPlainObject(nestedSchemas)) return false;\n for (const nestedSchema of Object.values(nestedSchemas)) {\n if (!isValidSchemaNode(nestedSchema)) return false;\n }\n }\n\n if (node.items !== undefined && !isValidSchemaNode(node.items)) {\n return false;\n }\n\n return true;\n};\n\nconst cloneSchema = (schema: JsonSchema): JsonSchema | undefined => {\n try {\n const serializedSchema = JSON.stringify(schema);\n if (serializedSchema === undefined) return undefined;\n\n const parsedSchema: unknown = JSON.parse(serializedSchema);\n if (!isValidSchemaNode(parsedSchema)) {\n return undefined;\n }\n\n return parsedSchema;\n } catch {\n return undefined;\n }\n};\n\n/** Follows a drill-down path (property names and `$items`) to the schema it points at. */\nconst findSchemaAtPath = (root: JsonSchema, path: string[]): JsonSchema | undefined => {\n let target: JsonSchema | JsonSchemaProperty = root;\n for (const segment of path) {\n if (target.type === 'array' && segment === '$items') {\n target = target.items || {};\n } else if (target.properties && target.properties[segment]) {\n target = target.properties[segment];\n } else {\n return undefined;\n }\n }\n return target as unknown as JsonSchema;\n};\n\nconst asJsonSchema = (property: JsonSchemaProperty): JsonSchema => {\n // SAFETY: A nested \"object\" property has the same editable shape as a schema —\n // `properties`, `items`, and `required` all mean the same thing on both types.\n return property as unknown as JsonSchema;\n};\n\nconst asJsonSchemaProperty = (schema: JsonSchema): JsonSchemaProperty => {\n // SAFETY: The inverse of asJsonSchema; the shapes are structurally interchangeable.\n return schema as unknown as JsonSchemaProperty;\n};\n\n/**\n * Props for {@link SchemaEditor}.\n */\nexport interface SchemaEditorProps extends TreeOnlyProps {\n /**\n * Which editor to render. `'table'` (the default) is the breadcrumb-navigated table with an Edit, Save and\n * Cancel workflow; `'tree'` is the inline tree editor that applies every edit live. See the layout notes in\n * the documentation for the props each layout honors.\n */\n layout?: SchemaEditorLayout;\n\n /**\n * The JSON Schema being viewed or edited. Required unless the tree layout is controlled through\n * `properties`.\n */\n schema?: JsonSchema;\n\n /** Optional event-type label displayed in the editor header. */\n eventTypeName?: string;\n\n /** When false, the Edit action remains visible but cannot enter edit mode; defaults to `true`. */\n canEdit?: boolean;\n\n /**\n * When {@link canEdit} is false, this string is shown as a tooltip on an\n * inert Edit action to explain why editing is unavailable.\n */\n canNotEditReason?: string;\n\n /** Invoked with the updated schema and optional metadata after any structural change. */\n onChange?: ChangeHandler<JsonSchema>;\n\n /** Invoked when the user activates the Save action. */\n onSave?: () => void;\n\n /** Invoked when the user activates the Cancel action. */\n onCancel?: () => void;\n\n /** Initial edit-mode state; defaults to `false` (read-only). */\n editMode?: boolean;\n\n /** When true, hides the Save menu item even while in edit mode. */\n saveDisabled?: boolean;\n\n /** When true, hides the Cancel menu item even while in edit mode. */\n cancelDisabled?: boolean;\n\n /**\n * Override the list of selectable type formats per JSON Schema type. Each\n * entry contributes options to the type-format dropdown shown in edit\n * mode. Defaults to {@link DEFAULT_TYPE_FORMATS}.\n */\n typeFormats?: TypeFormat[];\n\n /**\n * Extra CSS class names appended to the editor root. Combined with the\n * default `schema-editor` class. For fine-grained styling of internal\n * Components controls, use product tokens and stable Cratis parts.\n */\n className?: string;\n\n /** Override any user-facing string (for localization). See {@link SchemaEditorLabels}. */\n labels?: Partial<SchemaEditorLabels>;\n\n /**\n * Offers the key toggle (`x-key`, at most one property per object). In the table layout this adds a Key\n * column, editable in edit mode; a function enables the column for every row. In the tree layout it is\n * offered on every property, or per property when a function is given.\n */\n allowKeyProperty?: TreeSchemaEditorProps['allowKeyProperty'];\n\n /**\n * Offers the toggle for whether a property must be present (the `required` list). In the table layout this\n * adds a Required column, editable in edit mode.\n */\n allowRequired?: boolean;\n\n /** Offers no edits at all. Tree layout only: the table layout is read-only until Edit is chosen, controlled by `canEdit`. */\n readOnly?: boolean;\n\n /** Decides which properties can be neither renamed nor removed. By default none. Both layouts. */\n isPropertyProtected?: (property: Property) => boolean;\n\n /**\n * Extra check of a new name, after the editor has rejected blank, reserved and duplicate names. Return the\n * message to show, or `undefined` to accept the name. Both layouts.\n */\n validatePropertyName?: (name: string, property: Property, siblings: Property[]) => string | undefined;\n\n /** Called after a property was removed, with the property and everything nested under it. Both layouts. */\n onPropertyRemoved?: (property: Property) => void;\n\n /** Called after a property was renamed, with the renamed property and the name it had. Both layouts. */\n onPropertyRenamed?: (property: Property, previousName: string) => void;\n\n /** Content above the editor, for example the title of the schema. Both layouts. */\n header?: ReactNode;\n\n /** Content below the properties, for example further actions. Both layouts. */\n footer?: ReactNode;\n}\n\n/**\n * A breadcrumb-navigated editor for JSON Schemas. Lets users browse nested\n * `object` and `array` property definitions, add or remove properties, change\n * types and formats, and validate naming rules in place. Designed to drive\n * UIs around event payload schemas and similar structural documents.\n *\n * The editor composes a Cratis data table, action toolbar, and form widgets\n * internally. Restyle it through semantic tokens, the editor root `className`,\n * and documented `data-cratis-part` values rather than a provider preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nconst TableSchemaEditor = ({\n schema: suppliedSchema,\n eventTypeName = '',\n canEdit = true,\n canNotEditReason,\n onChange,\n onSave,\n onCancel,\n editMode,\n saveDisabled = false,\n cancelDisabled = false,\n typeFormats = DEFAULT_TYPE_FORMATS,\n className,\n labels,\n allowKeyProperty,\n allowRequired,\n isPropertyProtected,\n validatePropertyName: validateCustomPropertyName,\n onPropertyRemoved,\n onPropertyRenamed,\n header,\n footer,\n}: SchemaEditorProps) => {\n const schema = suppliedSchema ?? emptySchema;\n const l = useMemo(() => ({ ...defaultSchemaEditorLabels, ...labels }) as Required<SchemaEditorLabels>, [labels]);\n const showKey = allowKeyProperty !== undefined && allowKeyProperty !== false;\n const showRequired = allowRequired === true;\n const [currentPath, setCurrentPath] = useState<string[]>([]);\n const [properties, setProperties] = useState<JsonSchemaProperty[]>([]);\n const [initialParsedSchema] = useState<JsonSchema | undefined>(() =>\n cloneSchema(schema),\n );\n const [currentSchema, setCurrentSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [isEditMode, setIsEditMode] = useState(editMode ?? false);\n const [initialSchema, setInitialSchema] = useState<JsonSchema>(\n initialParsedSchema ?? {},\n );\n const [schemaJsonIsInvalid, setSchemaJsonIsInvalid] = useState(\n initialParsedSchema === undefined,\n );\n const [validationErrors, setValidationErrors] = useState<Record<string, string>>({});\n\n useEffect(() => {\n if (!isEditMode) {\n setCurrentPath([]);\n }\n }, [isEditMode]);\n\n const validateAllProperties = useCallback(\n (properties: JsonSchemaProperty[], level: Property[] = []) => {\n const errors: Record<string, string> = {};\n\n properties.forEach((prop) => {\n let error = validatePropertyName(prop.name ?? '', prop.id!, properties);\n if (!error && validateCustomPropertyName) {\n const property = level.find((candidate) => candidate.name === prop.name);\n if (property) {\n error = validateCustomPropertyName(property.name, property, level);\n }\n }\n if (error) {\n errors[prop.id!] = error;\n }\n });\n\n setValidationErrors(errors);\n return Object.keys(errors).length === 0;\n },\n [validatePropertyName, validateCustomPropertyName],\n );\n\n useEffect(() => {\n const parsedSchema = cloneSchema(schema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setSchemaJsonIsInvalid(false);\n setCurrentSchema(parsedSchema);\n setInitialSchema(parsedSchema);\n }, [schema]);\n\n useEffect(() => {\n loadPropertiesForCurrentPath();\n }, [currentPath, currentSchema, isEditMode]);\n\n const loadPropertiesForCurrentPath = () => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return;\n }\n }\n\n const schemaProps: JsonSchemaProperty[] = [];\n if (targetSchema.properties) {\n let idCounter = 0;\n for (const [name, property] of Object.entries(targetSchema.properties)) {\n schemaProps.push({\n id: `prop-${currentPath.join('-')}-${idCounter++}`,\n name,\n type: property.type || 'string',\n format: property.format,\n description: property.description,\n items: property.items,\n properties: property.properties,\n // A property's own `required` array (populated when its `type`\n // is \"object\") lists which of *its* properties are required.\n // It is scoped to this property alone — never to the parent\n // schema's `required` array — and is carried through verbatim\n // so navigating into it (see asJsonSchema) sees it intact.\n required: property.required,\n });\n }\n }\n\n setProperties(schemaProps);\n if (isEditMode) {\n validateAllProperties(schemaProps, jsonSchemaToProperties(targetSchema as unknown as JsonSchema));\n }\n };\n\n const updateSchemaAtPath = useCallback(\n (path: string[], updater: (schema: JsonSchema) => JsonSchema) => {\n const newSchema = cloneSchema(currentSchema);\n if (!newSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n if (path.length === 0) {\n const updated = updater(newSchema);\n setCurrentSchema(updated);\n onChange?.(updated, { source: 'user' });\n return;\n }\n\n let targetSchema = newSchema;\n for (let i = 0; i < path.length - 1; i++) {\n const segment = path[i];\n if (targetSchema.type === 'array' && segment === '$items') {\n if (!targetSchema.items) {\n targetSchema.items = { type: 'object', properties: {} };\n }\n targetSchema = targetSchema.items;\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = asJsonSchema(targetSchema.properties[segment]);\n }\n }\n\n const lastSegment = path[path.length - 1];\n if (targetSchema.type === 'array' && lastSegment === '$items') {\n targetSchema.items = updater(targetSchema.items || {});\n } else {\n if (!targetSchema.properties) {\n targetSchema.properties = {};\n }\n const propertySchema = targetSchema.properties[lastSegment];\n targetSchema.properties[lastSegment] = asJsonSchemaProperty(\n updater(propertySchema ? asJsonSchema(propertySchema) : {}),\n );\n }\n\n setCurrentSchema(newSchema);\n onChange?.(newSchema, { source: 'user' });\n },\n [currentSchema, onChange],\n );\n\n const addProperty = useCallback(() => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n let newName = 'newProperty';\n let counter = 1;\n while (newProps[newName]) {\n newName = `newProperty${counter++}`;\n }\n newProps[newName] = { type: 'string' };\n return { ...schema, properties: newProps };\n });\n }, [currentPath, updateSchemaAtPath]);\n\n /** The editable view of the properties at the current path, for the host callbacks. */\n const getLevelProperties = useCallback(\n () => jsonSchemaToProperties(findSchemaAtPath(currentSchema, currentPath)),\n [currentSchema, currentPath],\n );\n\n const isProtected = useCallback(\n (propertyName: string) => {\n if (!isPropertyProtected) return false;\n const property = getLevelProperties().find((candidate) => candidate.name === propertyName);\n return property !== undefined && isPropertyProtected(property);\n },\n [isPropertyProtected, getLevelProperties],\n );\n\n const removeProperty = useCallback(\n (propertyName: string) => {\n const removed = getLevelProperties().find((candidate) => candidate.name === propertyName);\n if (removed && isPropertyProtected?.(removed)) return;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n delete newProps[propertyName];\n\n // Deleting a property must also drop it from this schema's own\n // `required` array, or the array keeps naming a property that no\n // longer exists in `properties`.\n const updated: JsonSchema = { ...schema, properties: newProps };\n if (schema.required?.includes(propertyName)) {\n updated.required = schema.required.filter(\n (name) => name !== propertyName,\n );\n }\n\n return updated;\n });\n if (removed) onPropertyRemoved?.(removed);\n },\n [currentPath, updateSchemaAtPath, getLevelProperties, isPropertyProtected, onPropertyRemoved],\n );\n\n const setRequired = useCallback(\n (propertyName: string, isRequired: boolean) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const others = (schema.required ?? []).filter((name) => name !== propertyName);\n const required = isRequired ? [...others, propertyName] : others;\n const updated: JsonSchema = { ...schema };\n if (required.length > 0) {\n updated.required = required;\n } else {\n delete updated.required;\n }\n return updated;\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const setKey = useCallback(\n (propertyName: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps: Record<string, JsonSchemaProperty> = {};\n for (const [name, property] of Object.entries(schema.properties || {})) {\n const { [KEY_KEYWORD]: previousKey, ...rest } = property as JsonSchemaProperty & Record<string, unknown>;\n const makeKey = name === propertyName && previousKey !== true;\n newProps[name] = (makeKey ? { ...rest, [KEY_KEYWORD]: true } : rest) as JsonSchemaProperty;\n }\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const updateProperty = useCallback(\n (\n oldName: string,\n field: keyof JsonSchemaProperty,\n value: unknown,\n additionalUpdates?: Partial<JsonSchemaProperty>,\n ) => {\n let renamed: Property | undefined;\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[oldName] || {}) };\n\n let newRequired = schema.required;\n\n if (field === 'name') {\n const newName = value as string;\n if (newName !== oldName && !newProps[newName] && !isProtected(oldName)) {\n renamed = jsonSchemaToProperties({ properties: { [newName]: prop } })[0];\n newProps[newName] = prop;\n delete newProps[oldName];\n\n // Renaming a required property must keep the `required`\n // array pointing at the new name, or it goes stale and\n // silently references a property that no longer exists.\n if (schema.required?.includes(oldName)) {\n newRequired = schema.required.map((name) =>\n name === oldName ? newName : name,\n );\n }\n }\n } else if (field === 'type') {\n prop.type = value as string;\n // A concept belongs to the type it was chosen for; the table offers no concepts.\n delete (prop as Record<string, unknown>)['x-concept'];\n if (value === 'array') {\n prop.items = { type: 'string' };\n delete prop.format;\n // Only an \"object\" property has a meaningful `required`\n // array of its own; any prior one is now stale.\n delete prop.required;\n } else if (value === 'object') {\n prop.properties = {};\n delete prop.format;\n delete prop.items;\n // Starting fresh with empty `properties`, so any prior\n // `required` array (naming properties that no longer\n // exist here) would be stale.\n delete prop.required;\n } else {\n delete prop.items;\n delete prop.properties;\n delete prop.required;\n }\n\n if (additionalUpdates) {\n if ('format' in additionalUpdates) {\n if (additionalUpdates.format) {\n prop.format = additionalUpdates.format as string;\n } else {\n delete prop.format;\n }\n }\n }\n\n newProps[oldName] = prop;\n } else if (field === 'format') {\n if (value && value !== 'none') {\n prop.format = value as string;\n } else {\n delete prop.format;\n }\n newProps[oldName] = prop;\n }\n\n return { ...schema, properties: newProps, required: newRequired };\n });\n if (renamed) onPropertyRenamed?.(renamed, oldName);\n },\n [currentPath, updateSchemaAtPath, isProtected, onPropertyRenamed],\n );\n\n const updateArrayItemType = useCallback(\n (propertyName: string, itemType: string) => {\n updateSchemaAtPath(currentPath, (schema) => {\n const newProps = { ...(schema.properties || {}) };\n const prop = { ...(newProps[propertyName] || {}) };\n\n if (itemType === 'object') {\n prop.items = { type: 'object', properties: {} };\n } else if (itemType === 'array') {\n prop.items = { type: 'array', items: { type: 'string' } };\n } else {\n prop.items = { type: itemType };\n }\n\n newProps[propertyName] = prop;\n return { ...schema, properties: newProps };\n });\n },\n [currentPath, updateSchemaAtPath],\n );\n\n const navigateToProperty = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName]);\n },\n [currentPath],\n );\n\n const navigateToArrayItems = useCallback(\n (propertyName: string) => {\n setCurrentPath([...currentPath, propertyName, '$items']);\n },\n [currentPath],\n );\n\n const navigateBack = useCallback(() => {\n if (currentPath.length > 0) {\n setCurrentPath(currentPath.slice(0, -1));\n }\n }, [currentPath]);\n\n const navigateToBreadcrumb = useCallback(\n (index: number) => {\n const items = getBreadcrumbItems();\n setCurrentPath(items[index].path);\n },\n [currentPath, eventTypeName],\n );\n\n const handleSave = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n onSave?.();\n setIsEditMode(false);\n }, [onSave, schemaJsonIsInvalid]);\n\n const handleCancel = useCallback(() => {\n const restoredSchema = cloneSchema(initialSchema);\n const changedSchema = cloneSchema(initialSchema);\n if (!restoredSchema || !changedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n const hasChanges = JSON.stringify(currentSchema) !== JSON.stringify(initialSchema);\n setCurrentSchema(restoredSchema);\n if (hasChanges) {\n onChange?.(changedSchema, { source: 'reset' });\n }\n setIsEditMode(false);\n onCancel?.();\n }, [currentSchema, initialSchema, onChange, onCancel]);\n\n const handleEdit = useCallback(() => {\n if (schemaJsonIsInvalid) return;\n\n const parsedSchema = cloneSchema(currentSchema);\n if (!parsedSchema) {\n setSchemaJsonIsInvalid(true);\n return;\n }\n\n setInitialSchema(parsedSchema);\n setIsEditMode(true);\n }, [currentSchema, schemaJsonIsInvalid]);\n\n const getBreadcrumbItems = () => buildBreadcrumbItems(eventTypeName, currentPath);\n\n const getCurrentDescription = useCallback(() => {\n let targetSchema: JsonSchema | JsonSchemaProperty = currentSchema;\n\n for (const segment of currentPath) {\n if (targetSchema.type === 'array' && segment === '$items') {\n targetSchema = targetSchema.items || {};\n } else if (targetSchema.properties && targetSchema.properties[segment]) {\n targetSchema = targetSchema.properties[segment] as\n JsonSchema | JsonSchemaProperty;\n } else {\n return undefined;\n }\n }\n\n return targetSchema.description;\n }, [currentSchema, currentPath]);\n\n const hasValidationErrors =\n schemaJsonIsInvalid || Object.keys(validationErrors).length > 0;\n\n const menuItems = useMemo<ActionMenuItem[]>(\n () => [\n ...(isEditMode\n ? []\n : [\n {\n label: l.edit,\n icon: <faIcons.FaPencil className='cratis:mr-2' />,\n command:\n canEdit && !schemaJsonIsInvalid ? handleEdit : undefined,\n disabled: schemaJsonIsInvalid,\n className: canEdit ? undefined : 'edit-disabled-with-reason',\n template:\n !canEdit && canNotEditReason\n ? (item: ActionMenuItem) => (\n <Tooltip\n content={canNotEditReason}\n position='bottom'\n >\n <button\n type='button'\n aria-disabled='true'\n style={{\n border: 0,\n background: 'transparent',\n color: 'inherit',\n cursor: 'not-allowed',\n opacity: 0.6,\n display: 'inline-flex',\n alignItems: 'center',\n padding: '0.5rem 0.75rem',\n }}\n >\n {item.icon}\n <span>{item.label}</span>\n </button>\n </Tooltip>\n )\n : undefined,\n },\n ]),\n ...(isEditMode\n ? [\n ...(saveDisabled\n ? []\n : [\n {\n label: l.save,\n icon: <faIcons.FaCheck className='cratis:mr-2' />,\n command: hasValidationErrors ? undefined : handleSave,\n disabled: hasValidationErrors,\n },\n ]),\n ...(cancelDisabled\n ? []\n : [\n {\n label: l.cancel,\n icon: <faIcons.FaXmark className='cratis:mr-2' />,\n command: handleCancel,\n },\n ]),\n {\n label: l.addProperty,\n icon: <faIcons.FaPlus className='cratis:mr-2' />,\n command: schemaJsonIsInvalid ? undefined : addProperty,\n disabled: schemaJsonIsInvalid,\n },\n ]\n : []),\n ],\n [\n isEditMode,\n handleSave,\n handleCancel,\n handleEdit,\n addProperty,\n canEdit,\n canNotEditReason,\n hasValidationErrors,\n schemaJsonIsInvalid,\n saveDisabled,\n cancelDisabled,\n l,\n ],\n );\n\n const breadcrumbItems = getBreadcrumbItems();\n const isAtRoot = currentPath.length === 0;\n const currentDescription = getCurrentDescription();\n const currentLevel = findSchemaAtPath(currentSchema, currentPath);\n\n return (\n <div\n className={className ? `schema-editor ${className}` : 'schema-editor'}\n style={{ display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n {header}\n <div className='cratis:px-4 cratis:py-4'>\n <div className='schema-editor-menubar'>\n <ActionMenubar aria-label={l.actions} model={menuItems} />\n </div>\n {schemaJsonIsInvalid && (\n <Message\n severity='error'\n text={l.invalidJson}\n className='cratis:mt-3'\n />\n )}\n </div>\n\n <div className='cratis:px-4 cratis:py-2 cratis-schema-editor-bottom-border'>\n <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>\n <Tooltip content={l.navigateBack} position='top'>\n <Button\n variant='ghost'\n size='small'\n icon={<faIcons.FaArrowLeft />}\n onClick={navigateBack}\n disabled={isAtRoot}\n aria-label={l.navigateBack}\n />\n </Tooltip>\n <div\n style={{\n fontSize: '0.9rem',\n color: 'var(--cratis-text-color-secondary)',\n cursor: 'pointer',\n }}\n >\n {breadcrumbItems.map((item, index) => (\n <span key={index}>\n {index > 0 && <span className='cratis:mx-2'>&gt;</span>}\n <button\n type='button'\n onClick={() => navigateToBreadcrumb(index)}\n aria-current={\n index === breadcrumbItems.length - 1\n ? 'location'\n : undefined\n }\n style={{\n padding: 0,\n border: 0,\n background: 'transparent',\n color: 'inherit',\n font: 'inherit',\n cursor: 'pointer',\n textDecoration:\n index < breadcrumbItems.length - 1\n ? 'underline'\n : 'none',\n }}\n >\n {item.name}\n </button>\n </span>\n ))}\n </div>\n </div>\n {currentDescription && (\n <div\n style={{\n fontSize: '0.875rem',\n color: 'var(--cratis-text-color-secondary)',\n marginTop: '0.5rem',\n marginLeft: '2.5rem',\n fontStyle: 'italic',\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n }}\n >\n <faIcons.FaCircleInfo />\n <span>{currentDescription}</span>\n </div>\n )}\n </div>\n\n <div style={{ flex: 1, overflow: 'auto', padding: '1rem' }}>\n <DataTableCore<JsonSchemaProperty>\n key={`${isEditMode}-${currentPath.join('/')}`}\n data={properties}\n dataKey='id'\n emptyMessage={l.emptyMessage}\n rowClassName={(rowData) => {\n if (\n !isEditMode &&\n (rowData.type === 'object' ||\n (rowData.type === 'array' &&\n rowData.items?.type === 'object'))\n ) {\n return 'cratis-schema-editor-navigable-row';\n }\n return '';\n }}\n onRowClick={(e) => {\n if (!isEditMode) {\n const rowData = e.data;\n if (rowData.name) {\n if (rowData.type === 'object') {\n navigateToProperty(rowData.name);\n } else if (\n rowData.type === 'array' &&\n rowData.items?.type === 'object'\n ) {\n navigateToArrayItems(rowData.name);\n }\n }\n }\n }}\n pt={{\n root: { style: { border: 'none' } },\n body: {\n style: {\n borderTop: '1px solid var(--cratis-surface-border)',\n },\n },\n }}\n >\n <Column\n field='name'\n header='Property'\n body={(rowData: JsonSchemaProperty) => (\n <NameCell\n rowData={rowData}\n isEditMode={isEditMode}\n onUpdate={updateProperty}\n validationError={validationErrors[rowData.id!]}\n propertyNameLabel={l.propertyName}\n isLocked={isProtected(rowData.name ?? '')}\n lockedReason={l.protectedProperty}\n />\n )}\n style={{ width: '30%' }}\n />\n {showRequired && (\n <Column\n header={l.requiredColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.requiredProperty(rowData.name ?? '')}\n checked={Boolean(currentLevel?.required?.includes(rowData.name ?? ''))}\n readOnly={!isEditMode}\n onChange={(checked) => setRequired(rowData.name ?? '', checked)}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n {showKey && (\n <Column\n header={l.keyColumn}\n body={(rowData: JsonSchemaProperty) => (\n <Checkbox\n aria-label={l.keyProperty(rowData.name ?? '')}\n checked={isKeyProperty(currentLevel, rowData.name ?? '')}\n readOnly={!isEditMode}\n onChange={() => setKey(rowData.name ?? '')}\n />\n )}\n style={{ width: '6rem' }}\n />\n )}\n <Column\n header='Type'\n body={(rowData: JsonSchemaProperty) => (\n <TypeCell\n rowData={rowData}\n isEditMode={isEditMode}\n typeFormats={typeFormats}\n onUpdateProperty={updateProperty}\n onUpdateArrayItemType={updateArrayItemType}\n onNavigateToProperty={navigateToProperty}\n onNavigateToArrayItems={navigateToArrayItems}\n onRemoveProperty={removeProperty}\n canRemove={!isProtected(rowData.name ?? '')}\n labels={l}\n />\n )}\n style={{ width: '70%' }}\n />\n </DataTableCore>\n </div>\n {footer}\n </div>\n );\n};\n\nconst isKeyProperty = (level: JsonSchema | undefined, propertyName: string): boolean =>\n (level?.properties?.[propertyName] as Record<string, unknown> | undefined)?.[KEY_KEYWORD] === true;\n\n/**\n * Edits the properties of a JSON Schema. By default (`layout='table'`) it is a breadcrumb-navigated table: it\n * lets users browse nested `object` and `array` property definitions, add or remove properties, change types and\n * formats, and validate naming rules in place, behind an Edit, Save and Cancel workflow. With `layout='tree'` it\n * is an inline tree that shows nested properties in place and applies every edit live. Designed to drive UIs\n * around event payload schemas and similar structural documents.\n *\n * Both layouts accept `allowRequired`, `allowKeyProperty`, `isPropertyProtected`, `validatePropertyName`,\n * `onPropertyRenamed`, `onPropertyRemoved`, `header` and `footer`. The tree layout also takes concepts, controlled\n * mode, per-row slots and selection; see the documentation for the exact split.\n *\n * The table layout composes a Cratis data table, action toolbar, and form widgets internally. Restyle it through\n * semantic tokens, the editor root `className`, and documented `data-cratis-part` values rather than a provider\n * preset.\n *\n * @param props - {@link SchemaEditorProps}.\n */\nexport const SchemaEditor = (props: SchemaEditorProps) =>\n props.layout === 'tree' ? <TreeSchemaEditor {...props} /> : <TableSchemaEditor {...props} />;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAmDA,MAAM,WAAW,GAAe,EAAE;AAElC,MAAM,aAAa,GAAG,CAAC,KAAc,KACjC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AASxE,MAAM,iBAAiB,GAAG,CAAC,IAAa,KAAwB;AAC5D,IAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE;AACtB,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,IACI,IAAI,CAAC,QAAQ,KAAK,SAAS;SAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1B,YAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,KAAK,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,EAC/E;AACE,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,KAAK,MAAM,aAAa,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE;QAC7D,IAAI,aAAa,KAAK,SAAS;YAAE;AACjC,QAAA,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC;AAAE,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xB,gBAAgB,EAAE,cAAc,EAChC,qBAAqB,EAAE,mBAAmB,EAC1C,oBAAoB,EAAE,kBAAkB,EACxC,sBAAsB,EAAE,oBAAoB,EAC5C,gBAAgB,EAAE,cAAc,EAChC,SAAS,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,EAC3C,MAAM,EAAE,CAAC,EAAA,CACX,CACL,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GACzB,CAAA,EAAA,EApGG,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAqGjC,EAAA,CACd,EACL,MAAM,CAAA,EAAA,CACL;AAEd,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,KAA6B,EAAE,YAAoB,KACrE,KAAK,EAAE,UAAU,GAAG,YAAY,CAAyC,GAAG,WAAW,CAAC,KAAK,IAAI;AAmB/F,MAAM,YAAY,GAAG,CAAC,KAAwB,KACjD,KAAK,CAAC,MAAM,KAAK,MAAM,GAAGA,GAAA,CAAC,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,GAAGA,GAAA,CAAC,iBAAiB,EAAA,EAAA,GAAK,KAAK;;"}
@@ -64,6 +64,12 @@ export interface SchemaEditorLabels {
64
64
  setAsKey?: string;
65
65
  /** Tooltip of the key toggle while the property is the key. */
66
66
  isKey?: string;
67
+ /** Tree layout: accessible name of the Generated toggle. */
68
+ generatedProperty?: (propertyName: string) => string;
69
+ /** Tree layout: tooltip of the Generated toggle while the value is entered. */
70
+ setAsGenerated?: string;
71
+ /** Tree layout: tooltip of the Generated toggle while the value is generated. */
72
+ isGenerated?: string;
67
73
  /** Column header of the key column in the table layout. */
68
74
  keyColumn?: string;
69
75
  /** Column header of the required column in the table layout. */