@contember/bindx-react 0.1.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 (194) hide show
  1. package/dist/batching/QueryBatcher.d.ts +31 -0
  2. package/dist/batching/QueryBatcher.d.ts.map +1 -0
  3. package/dist/batching/index.d.ts +2 -0
  4. package/dist/batching/index.d.ts.map +1 -0
  5. package/dist/components/EntityScope.d.ts +28 -0
  6. package/dist/components/EntityScope.d.ts.map +1 -0
  7. package/dist/dataview/DataGrid.d.ts +45 -0
  8. package/dist/dataview/DataGrid.d.ts.map +1 -0
  9. package/dist/dataview/DataGridPagination.d.ts +24 -0
  10. package/dist/dataview/DataGridPagination.d.ts.map +1 -0
  11. package/dist/dataview/DataGridToolbar.d.ts +16 -0
  12. package/dist/dataview/DataGridToolbar.d.ts.map +1 -0
  13. package/dist/dataview/DataViewContext.d.ts +32 -0
  14. package/dist/dataview/DataViewContext.d.ts.map +1 -0
  15. package/dist/dataview/columns.d.ts +115 -0
  16. package/dist/dataview/columns.d.ts.map +1 -0
  17. package/dist/dataview/contextHooks.d.ts +48 -0
  18. package/dist/dataview/contextHooks.d.ts.map +1 -0
  19. package/dist/dataview/dataAttribute.d.ts +6 -0
  20. package/dist/dataview/dataAttribute.d.ts.map +1 -0
  21. package/dist/dataview/export.d.ts +46 -0
  22. package/dist/dataview/export.d.ts.map +1 -0
  23. package/dist/dataview/filterComponents.d.ts +127 -0
  24. package/dist/dataview/filterComponents.d.ts.map +1 -0
  25. package/dist/dataview/filterContext.d.ts +10 -0
  26. package/dist/dataview/filterContext.d.ts.map +1 -0
  27. package/dist/dataview/filterHooks.d.ts +74 -0
  28. package/dist/dataview/filterHooks.d.ts.map +1 -0
  29. package/dist/dataview/filterScope.d.ts +54 -0
  30. package/dist/dataview/filterScope.d.ts.map +1 -0
  31. package/dist/dataview/filterWrappers.d.ts +65 -0
  32. package/dist/dataview/filterWrappers.d.ts.map +1 -0
  33. package/dist/dataview/index.d.ts +21 -0
  34. package/dist/dataview/index.d.ts.map +1 -0
  35. package/dist/dataview/infiniteLoad.d.ts +32 -0
  36. package/dist/dataview/infiniteLoad.d.ts.map +1 -0
  37. package/dist/dataview/loaderComponents.d.ts +80 -0
  38. package/dist/dataview/loaderComponents.d.ts.map +1 -0
  39. package/dist/dataview/pagingComponents.d.ts +50 -0
  40. package/dist/dataview/pagingComponents.d.ts.map +1 -0
  41. package/dist/dataview/renderCellValue.d.ts +9 -0
  42. package/dist/dataview/renderCellValue.d.ts.map +1 -0
  43. package/dist/dataview/selectionComponents.d.ts +62 -0
  44. package/dist/dataview/selectionComponents.d.ts.map +1 -0
  45. package/dist/dataview/sortingComponents.d.ts +39 -0
  46. package/dist/dataview/sortingComponents.d.ts.map +1 -0
  47. package/dist/dataview/stateStorage.d.ts +19 -0
  48. package/dist/dataview/stateStorage.d.ts.map +1 -0
  49. package/dist/dataview/useDataView.d.ts +58 -0
  50. package/dist/dataview/useDataView.d.ts.map +1 -0
  51. package/dist/dataview/useDataViewState.d.ts +89 -0
  52. package/dist/dataview/useDataViewState.d.ts.map +1 -0
  53. package/dist/hooks/BackendAdapterContext.d.ts +110 -0
  54. package/dist/hooks/BackendAdapterContext.d.ts.map +1 -0
  55. package/dist/hooks/ContemberBindxProvider.d.ts +67 -0
  56. package/dist/hooks/ContemberBindxProvider.d.ts.map +1 -0
  57. package/dist/hooks/createBindx.d.ts +39 -0
  58. package/dist/hooks/createBindx.d.ts.map +1 -0
  59. package/dist/hooks/index.d.ts +10 -0
  60. package/dist/hooks/index.d.ts.map +1 -0
  61. package/dist/hooks/useBindxEvents.d.ts +83 -0
  62. package/dist/hooks/useBindxEvents.d.ts.map +1 -0
  63. package/dist/hooks/useEntity.d.ts +123 -0
  64. package/dist/hooks/useEntity.d.ts.map +1 -0
  65. package/dist/hooks/useEntityBeforePersist.d.ts +22 -0
  66. package/dist/hooks/useEntityBeforePersist.d.ts.map +1 -0
  67. package/dist/hooks/useEntityCore.d.ts +52 -0
  68. package/dist/hooks/useEntityCore.d.ts.map +1 -0
  69. package/dist/hooks/useEntityImpl.d.ts +105 -0
  70. package/dist/hooks/useEntityImpl.d.ts.map +1 -0
  71. package/dist/hooks/useEntityList.d.ts +102 -0
  72. package/dist/hooks/useEntityList.d.ts.map +1 -0
  73. package/dist/hooks/useEntityListCore.d.ts +49 -0
  74. package/dist/hooks/useEntityListCore.d.ts.map +1 -0
  75. package/dist/hooks/useEntityListImpl.d.ts +70 -0
  76. package/dist/hooks/useEntityListImpl.d.ts.map +1 -0
  77. package/dist/hooks/useErrors.d.ts +72 -0
  78. package/dist/hooks/useErrors.d.ts.map +1 -0
  79. package/dist/hooks/usePersist.d.ts +115 -0
  80. package/dist/hooks/usePersist.d.ts.map +1 -0
  81. package/dist/hooks/useSelectionCollection.d.ts +41 -0
  82. package/dist/hooks/useSelectionCollection.d.ts.map +1 -0
  83. package/dist/hooks/useSelectionCollectionForList.d.ts +40 -0
  84. package/dist/hooks/useSelectionCollectionForList.d.ts.map +1 -0
  85. package/dist/hooks/useStableSelectionMeta.d.ts +11 -0
  86. package/dist/hooks/useStableSelectionMeta.d.ts.map +1 -0
  87. package/dist/hooks/useStoreSubscription.d.ts +19 -0
  88. package/dist/hooks/useStoreSubscription.d.ts.map +1 -0
  89. package/dist/hooks/useUndo.d.ts +45 -0
  90. package/dist/hooks/useUndo.d.ts.map +1 -0
  91. package/dist/index.d.ts +17 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/jsx/SelectionMeta.d.ts +2 -0
  94. package/dist/jsx/SelectionMeta.d.ts.map +1 -0
  95. package/dist/jsx/analyzer.d.ts +22 -0
  96. package/dist/jsx/analyzer.d.ts.map +1 -0
  97. package/dist/jsx/collectorProxy.d.ts +14 -0
  98. package/dist/jsx/collectorProxy.d.ts.map +1 -0
  99. package/dist/jsx/componentBuilder.d.ts +51 -0
  100. package/dist/jsx/componentBuilder.d.ts.map +1 -0
  101. package/dist/jsx/componentBuilder.types.d.ts +268 -0
  102. package/dist/jsx/componentBuilder.types.d.ts.map +1 -0
  103. package/dist/jsx/componentBuilderCompat.d.ts +17 -0
  104. package/dist/jsx/componentBuilderCompat.d.ts.map +1 -0
  105. package/dist/jsx/componentFactory.d.ts +39 -0
  106. package/dist/jsx/componentFactory.d.ts.map +1 -0
  107. package/dist/jsx/components/Entity.d.ts +82 -0
  108. package/dist/jsx/components/Entity.d.ts.map +1 -0
  109. package/dist/jsx/components/EntityList.d.ts +48 -0
  110. package/dist/jsx/components/EntityList.d.ts.map +1 -0
  111. package/dist/jsx/components/Field.d.ts +27 -0
  112. package/dist/jsx/components/Field.d.ts.map +1 -0
  113. package/dist/jsx/components/HasMany.d.ts +34 -0
  114. package/dist/jsx/components/HasMany.d.ts.map +1 -0
  115. package/dist/jsx/components/HasOne.d.ts +25 -0
  116. package/dist/jsx/components/HasOne.d.ts.map +1 -0
  117. package/dist/jsx/components/HasRole.d.ts +51 -0
  118. package/dist/jsx/components/HasRole.d.ts.map +1 -0
  119. package/dist/jsx/components/If.d.ts +51 -0
  120. package/dist/jsx/components/If.d.ts.map +1 -0
  121. package/dist/jsx/components/Show.d.ts +33 -0
  122. package/dist/jsx/components/Show.d.ts.map +1 -0
  123. package/dist/jsx/components/index.d.ts +8 -0
  124. package/dist/jsx/components/index.d.ts.map +1 -0
  125. package/dist/jsx/conditions.d.ts +310 -0
  126. package/dist/jsx/conditions.d.ts.map +1 -0
  127. package/dist/jsx/createComponent.d.ts +44 -0
  128. package/dist/jsx/createComponent.d.ts.map +1 -0
  129. package/dist/jsx/index.d.ts +19 -0
  130. package/dist/jsx/index.d.ts.map +1 -0
  131. package/dist/jsx/inlineProxy.d.ts +14 -0
  132. package/dist/jsx/inlineProxy.d.ts.map +1 -0
  133. package/dist/jsx/legacyTypes.d.ts +26 -0
  134. package/dist/jsx/legacyTypes.d.ts.map +1 -0
  135. package/dist/jsx/proxy.d.ts +2 -0
  136. package/dist/jsx/proxy.d.ts.map +1 -0
  137. package/dist/jsx/proxyShared.d.ts +14 -0
  138. package/dist/jsx/proxyShared.d.ts.map +1 -0
  139. package/dist/jsx/runtimeProxy.d.ts +11 -0
  140. package/dist/jsx/runtimeProxy.d.ts.map +1 -0
  141. package/dist/jsx/standaloneCreateComponent.d.ts +30 -0
  142. package/dist/jsx/standaloneCreateComponent.d.ts.map +1 -0
  143. package/dist/jsx/types.d.ts +109 -0
  144. package/dist/jsx/types.d.ts.map +1 -0
  145. package/dist/jsx/withCollector.d.ts +39 -0
  146. package/dist/jsx/withCollector.d.ts.map +1 -0
  147. package/dist/roles/RoleContext.d.ts +31 -0
  148. package/dist/roles/RoleContext.d.ts.map +1 -0
  149. package/dist/roles/index.d.ts +2 -0
  150. package/dist/roles/index.d.ts.map +1 -0
  151. package/package.json +34 -0
  152. package/src/batching/QueryBatcher.ts +114 -0
  153. package/src/batching/index.ts +1 -0
  154. package/src/components/EntityScope.tsx +43 -0
  155. package/src/hooks/BackendAdapterContext.tsx +214 -0
  156. package/src/hooks/ContemberBindxProvider.tsx +158 -0
  157. package/src/hooks/index.ts +61 -0
  158. package/src/hooks/useBindxEvents.ts +229 -0
  159. package/src/hooks/useEntity.ts +489 -0
  160. package/src/hooks/useEntityBeforePersist.ts +32 -0
  161. package/src/hooks/useEntityList.ts +444 -0
  162. package/src/hooks/useErrors.ts +150 -0
  163. package/src/hooks/usePersist.ts +377 -0
  164. package/src/hooks/useSelectionCollection.ts +122 -0
  165. package/src/hooks/useStoreSubscription.ts +51 -0
  166. package/src/hooks/useUndo.ts +83 -0
  167. package/src/index.ts +357 -0
  168. package/src/jsx/SelectionMeta.ts +2 -0
  169. package/src/jsx/analyzer.ts +261 -0
  170. package/src/jsx/collectorProxy.ts +282 -0
  171. package/src/jsx/componentBuilder.ts +180 -0
  172. package/src/jsx/componentBuilder.types.ts +463 -0
  173. package/src/jsx/componentBuilderCompat.ts +39 -0
  174. package/src/jsx/componentFactory.ts +400 -0
  175. package/src/jsx/components/Entity.tsx +383 -0
  176. package/src/jsx/components/EntityList.tsx +147 -0
  177. package/src/jsx/components/Field.tsx +79 -0
  178. package/src/jsx/components/HasMany.tsx +109 -0
  179. package/src/jsx/components/HasOne.tsx +78 -0
  180. package/src/jsx/components/HasRole.tsx +95 -0
  181. package/src/jsx/components/If.tsx +127 -0
  182. package/src/jsx/components/Show.tsx +56 -0
  183. package/src/jsx/components/index.ts +20 -0
  184. package/src/jsx/conditions.ts +472 -0
  185. package/src/jsx/createComponent.ts +175 -0
  186. package/src/jsx/index.ts +135 -0
  187. package/src/jsx/legacyTypes.ts +30 -0
  188. package/src/jsx/proxy.ts +1 -0
  189. package/src/jsx/proxyShared.ts +42 -0
  190. package/src/jsx/standaloneCreateComponent.ts +47 -0
  191. package/src/jsx/types.ts +192 -0
  192. package/src/jsx/withCollector.ts +45 -0
  193. package/src/roles/RoleContext.tsx +57 -0
  194. package/src/roles/index.ts +1 -0
@@ -0,0 +1,41 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { SelectionMeta } from '@contember/bindx';
3
+ import type { EntityAccessor } from '../jsx/types.js';
4
+ /**
5
+ * Options for useSelectionCollection hook.
6
+ */
7
+ export interface UseSelectionCollectionOptions {
8
+ /** Entity type name (for debugging) */
9
+ entityType: string;
10
+ /** Stable key for useMemo dependencies (e.g., entityId or JSON-serialized options) */
11
+ depsKey: string;
12
+ /** Collector function — receives a collector proxy, returns JSX for analysis */
13
+ collect: (collector: EntityAccessor<unknown>) => ReactNode;
14
+ /** Extra data to include in the query key (e.g., filter/orderBy for lists) */
15
+ queryKeyExtra?: Record<string, unknown>;
16
+ }
17
+ /**
18
+ * Result from useSelectionCollection hook.
19
+ */
20
+ export interface SelectionCollectionResult {
21
+ /** Selection metadata for query building */
22
+ selection: SelectionMeta;
23
+ /** Stable query key for dependency tracking */
24
+ queryKey: string;
25
+ }
26
+ /**
27
+ * Hook for collecting field selection from JSX children.
28
+ * Implements the two-phase rendering approach:
29
+ * 1. Creates a collector proxy
30
+ * 2. Calls the collect function with the proxy to gather field accesses
31
+ * 3. Analyzes returned JSX for component-level selections
32
+ * 4. Merges both sources of selection
33
+ *
34
+ * **Limitation:** Selection is collected once per `depsKey`.
35
+ * Fields accessed conditionally in the collect function are only captured
36
+ * if they are accessed during the initial collection phase.
37
+ *
38
+ * @internal This hook is for internal use only.
39
+ */
40
+ export declare function useSelectionCollection(options: UseSelectionCollectionOptions): SelectionCollectionResult;
41
+ //# sourceMappingURL=useSelectionCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectionCollection.d.ts","sourceRoot":"","sources":["../../src/hooks/useSelectionCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGrD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,OAAO,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK,SAAS,CAAA;IAC1D,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,4CAA4C;IAC5C,SAAS,EAAE,aAAa,CAAA;IACxB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;CAChB;AAUD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,6BAA6B,GACpC,yBAAyB,CAgE3B"}
@@ -0,0 +1,40 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { SelectionMeta } from '@contember/bindx';
3
+ import type { EntityAccessor } from '../jsx/types.js';
4
+ /**
5
+ * Options for useSelectionCollectionForList hook.
6
+ */
7
+ export interface UseSelectionCollectionForListOptions<T> {
8
+ /** Entity type name (for debugging) */
9
+ entityType: string;
10
+ /** Optional filter (for dependency tracking) */
11
+ filter?: Record<string, unknown>;
12
+ /** Optional ordering (for dependency tracking) */
13
+ orderBy?: readonly Record<string, unknown>[];
14
+ /** Optional limit (for dependency tracking) */
15
+ limit?: number;
16
+ /** Optional offset (for dependency tracking) */
17
+ offset?: number;
18
+ /** Children render function - receives entity and index */
19
+ children: (entity: EntityAccessor<T>, index: number) => ReactNode;
20
+ }
21
+ /**
22
+ * Result from useSelectionCollectionForList hook.
23
+ */
24
+ export interface SelectionCollectionForListResult {
25
+ /** Selection metadata for query building */
26
+ selection: SelectionMeta;
27
+ /** Stable query key for dependency tracking */
28
+ queryKey: string;
29
+ }
30
+ /**
31
+ * Hook for collecting field selection from JSX children for entity lists.
32
+ * Similar to useSelectionCollection but for list rendering.
33
+ *
34
+ * Calls children once with a collector proxy and index 0 to gather
35
+ * the template selection that will be applied to all items.
36
+ *
37
+ * @internal This hook is for internal use only.
38
+ */
39
+ export declare function useSelectionCollectionForList<T>(options: UseSelectionCollectionForListOptions<T>): SelectionCollectionForListResult;
40
+ //# sourceMappingURL=useSelectionCollectionForList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectionCollectionForList.d.ts","sourceRoot":"","sources":["../../src/hooks/useSelectionCollectionForList.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGrD;;GAEG;AACH,MAAM,WAAW,oCAAoC,CAAC,CAAC;IACtD,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,kDAAkD;IAClD,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAA;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,4CAA4C;IAC5C,SAAS,EAAE,aAAa,CAAA;IACxB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;CAChB;AAUD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC9C,OAAO,EAAE,oCAAoC,CAAC,CAAC,CAAC,GAC9C,gCAAgC,CA6DlC"}
@@ -0,0 +1,11 @@
1
+ import { type SelectionInput, type SelectionMeta } from '@contember/bindx';
2
+ /**
3
+ * Resolves a SelectionInput to SelectionMeta with referential stability.
4
+ *
5
+ * Always resolves the latest definer on every render, but returns a stable
6
+ * object reference when the resulting query structure hasn't changed.
7
+ * This fixes the memoization bug where changing the definer had no effect,
8
+ * while avoiding unnecessary re-fetches from inline function references.
9
+ */
10
+ export declare function useStableSelectionMeta<TModel, TResult extends object>(definer: SelectionInput<TModel, TResult>): SelectionMeta;
11
+ //# sourceMappingURL=useStableSelectionMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStableSelectionMeta.d.ts","sourceRoot":"","sources":["../../src/hooks/useStableSelectionMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,SAAS,MAAM,EACpE,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,aAAa,CAUf"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Options for useStoreSubscription hook.
3
+ */
4
+ export interface UseStoreSubscriptionOptions<T> {
5
+ /** Function to subscribe to store changes */
6
+ subscribe: (callback: () => void) => () => void;
7
+ /** Function to get current snapshot */
8
+ getSnapshot: () => T;
9
+ /** Optional equality function for cache comparison (defaults to ===) */
10
+ isEqual?: (a: T, b: T) => boolean;
11
+ }
12
+ /**
13
+ * Generic hook for subscribing to store changes with useSyncExternalStore.
14
+ * Provides snapshot caching for referential stability.
15
+ *
16
+ * @internal This hook is for internal use only.
17
+ */
18
+ export declare function useStoreSubscription<T>(options: UseStoreSubscriptionOptions<T>): T;
19
+ //# sourceMappingURL=useStoreSubscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoreSubscription.d.ts","sourceRoot":"","sources":["../../src/hooks/useStoreSubscription.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,2BAA2B,CAAC,CAAC;IAC7C,6CAA6C;IAC7C,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;IAC/C,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC,CAAA;IACpB,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACrC,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACrC,CAAC,CAqBH"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Result type for useUndo hook.
3
+ */
4
+ export interface UndoHookResult {
5
+ /** Whether undo is available */
6
+ canUndo: boolean;
7
+ /** Whether redo is available */
8
+ canRedo: boolean;
9
+ /** Whether undo/redo is currently blocked (e.g., during persist) */
10
+ isBlocked: boolean;
11
+ /** Number of entries in undo stack */
12
+ undoCount: number;
13
+ /** Number of entries in redo stack */
14
+ redoCount: number;
15
+ /** Undo the last action or group */
16
+ undo: () => void;
17
+ /** Redo the last undone action or group */
18
+ redo: () => void;
19
+ /** Begin a manual group - all actions until endGroup are grouped as one undo entry */
20
+ beginGroup: (label?: string) => string;
21
+ /** End a manual group */
22
+ endGroup: (groupId: string) => void;
23
+ /** Clear all undo/redo history */
24
+ clear: () => void;
25
+ }
26
+ /**
27
+ * Hook to access undo/redo functionality.
28
+ * Must be used within a BindxProvider with enableUndo={true}.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * function Editor() {
33
+ * const { canUndo, canRedo, undo, redo } = useUndo()
34
+ *
35
+ * return (
36
+ * <div>
37
+ * <button onClick={undo} disabled={!canUndo}>Undo</button>
38
+ * <button onClick={redo} disabled={!canRedo}>Redo</button>
39
+ * </div>
40
+ * )
41
+ * }
42
+ * ```
43
+ */
44
+ export declare function useUndo(): UndoHookResult;
45
+ //# sourceMappingURL=useUndo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUndo.d.ts","sourceRoot":"","sources":["../../src/hooks/useUndo.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAA;IAClB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,sFAAsF;IACtF,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,yBAAyB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,kCAAkC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,IAAI,cAAc,CAkCxC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * React Bindx - Type-safe React data binding framework
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export type { RelationType, ScalarFieldDef, HasOneRelationDef, HasManyRelationDef, FieldDef, EntitySchemaDef, SchemaDefinition, InferModel, InferEntityNames, EntityDef, InferEntityDef, UnionToIntersection, RoleNames, CommonEntity, EntityForRoles, ResolveEntity, SingleRoleMap, DefaultRole, SelectionBuilder, SelectionMeta, SelectionFieldMeta, FluentFragment, FluentDefiner, HasManyOptions, InferSelection, QuerySpec, QueryFieldSpec, EntityWhere, EntityOrderBy, ScalarCondition, OrderDirection, TypedHasManyOptions, AliasOptions, HasOneRelationState, InputProps, EntityFields, SelectedEntityFields, ScalarKeys, HasManyKeys, HasOneKeys, FieldRefMeta, FieldRef, HasManyRef, HasOneRef, EntityRef, ExtractHasOneEntityName, ExtractHasManyEntityName, ExtractRoleMap, BackendAdapter, QueryOptions, Query, GetQuery, ListQuery, QueryResult, GetQueryResult, ListQueryResult, MockDataStore, MockAdapterOptions, ContemberAdapterOptions, EntityLoadResult, EntityListLoadResult, LoadEntityOptions, LoadEntityListOptions, SelectionInput, CoreFluentDefiner, EntitySnapshot, FieldSnapshot, HasOneRelationSnapshot, HasManySnapshot, EntityState, LoadStatus, UndoManagerConfig, UndoState, UndoEntry, BindxEvent, FieldScopedEvent, FieldChangingEvent, FieldChangedEvent, RelationConnectingEvent, RelationConnectedEvent, RelationDisconnectingEvent, RelationDisconnectedEvent, RelationDeletingEvent, RelationDeletedEvent, HasManyConnectingEvent, HasManyConnectedEvent, HasManyDisconnectingEvent, HasManyDisconnectedEvent, EntityPersistingEvent, EntityPersistedEvent, EntityPersistFailedEvent, EntityResettingEvent, EntityResetEvent, EntityDeletingEvent, EntityDeletedEvent, ErrorAddedEvent, ErrorsClearedEvent, LoadStateChangedEvent, BeforeEvent, AfterEvent, AnyBindxEvent, EventTypeMap, InterceptorResult, Interceptor, EventListener, Unsubscribe, BeforeEventTypes, AfterEventTypes, } from '@contember/bindx';
7
+ export { scalar, hasOne, hasMany, defineSchema, entityDef, roleEntityDef, DEFAULT_ROLE, SchemaRegistry, createFragment, buildQueryFromSelection, EntityHandle, HasOneHandle, HasManyListHandle, FieldHandle, FIELD_REF_META, MockAdapter, ContemberAdapter, createEntityLoader, resolveSelectionMeta, buildQuery, SnapshotStore, ActionDispatcher, isTempId, isPlaceholderId, isPersistedId, generatePlaceholderId, BatchPersister, ChangeRegistry, UndoManager, EventEmitter, __internal, } from '@contember/bindx';
8
+ export type { BindxProviderProps, BindxContextValue, UseEntityOptions, UseEntityListOptions, LoadingEntityAccessor, ErrorEntityAccessor, NotFoundEntityAccessor, ReadyEntityAccessor, EntityAccessorResult, LoadingEntityListAccessor, ErrorEntityListAccessor, ReadyEntityListAccessor, EntityListAccessorResult, PersistApi, EntityPersistApi, AnyRefWithMeta, } from './hooks/index.js';
9
+ export type { DirtyEntity, PersistScope, AllScope, EntityScope as EntityPersistScope, FieldsScope, RelationScope, CustomScope, EntityPersistResult, PersistenceResult, BatchPersistOptions, } from '@contember/bindx';
10
+ export type { EntityAccessor, FieldRefBase, FieldProps, HasManyProps, HasOneProps, IfProps, EntityComponentProps, HasManyComponentOptions, ShowProps, SelectionPropMeta, SelectionProvider, EntityPropKeys, EntityFromProp, SelectionFromProp, ImplicitFragmentProperties, BindxComponentBase, BindxComponent, ComponentBuilder, ComponentBuilderState, CreateComponentOptions, InterfaceEntityPropConfig, ImplicitInterfaceEntityConfig, ExplicitInterfaceEntityConfig, AddInterfaces, InterfaceSelectorsMap, AnyEntityPropConfig, EntityPropConfig, ImplicitEntityConfig, ExplicitEntityConfig, AddImplicitEntity, AddExplicitEntity, AddImplicitInterfaceEntity, AddExplicitInterfaceEntity, SetScalarProps, BuildEntityProps, BuildProps, BuildFragmentProps, InitialBuilderState, } from './jsx/index.js';
11
+ export { BindxProvider, useBackendAdapter, useSnapshotStore, useDispatcher, useBatchPersister, useBindxContext, useSchemaRegistry, useEntity, useEntityList, usePersist, usePersistEntity, useUndo, useOnEvent, useOnEntityEvent, useOnFieldEvent, useIntercept, useInterceptEntity, useInterceptField, ContemberBindxProvider, schemaNamesToDef, } from './hooks/index.js';
12
+ export { RoleProvider, useHasRole, type RoleProviderProps } from './roles/index.js';
13
+ export type { UndoHookResult } from './hooks/useUndo.js';
14
+ export { Field, HasMany, HasOne, If, Show, Entity, type EntityProps, EntityList, type EntityListProps, HasRole, type HasRoleProps, BINDX_COMPONENT, cond, type Condition, createComponent, withCollector, isBindxComponent, mergeFragments, COMPONENT_MARKER, COMPONENT_BRAND, COMPONENT_SELECTIONS, createComponentBuilder, getComponentBrand, setBrandValidation, validateBrand, } from './jsx/index.js';
15
+ export { EntityScope, useEntityScope, useOptionalEntityScope, type EntityScopeProps, } from './components/EntityScope.js';
16
+ export { SelectionMetaCollector, mergeSelections, createEmptySelection, createCollectorProxy, analyzeJsx, collectSelection, convertToQuerySelection, debugSelection, } from './jsx/index.js';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,YAAY,EAEX,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,cAAc,EAEd,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EAEX,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EAEd,WAAW,EACX,aAAa,EACb,eAA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,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAEjB,SAAS,EACT,aAAa,EAEb,UAAU,EACV,gBAAgB,EAEhB,OAAO,EAEP,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EAEjB,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGnF,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD,OAAO,EACN,KAAK,EACL,OAAO,EACP,MAAM,EACN,EAAE,EACF,IAAI,EACJ,MAAM,EACN,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,eAAe,EACpB,OAAO,EACP,KAAK,YAAY,EACjB,eAAe,EAEf,IAAI,EACJ,KAAK,SAAS,EAEd,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACb,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACN,WAAW,EACX,cAAc,EACd,sBAAsB,EACtB,KAAK,gBAAgB,GACrB,MAAM,6BAA6B,CAAA;AAMpC,OAAO,EACN,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,GACd,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { SelectionMetaCollector, mergeSelections, createEmptySelection } from '@contember/bindx';
2
+ //# sourceMappingURL=SelectionMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectionMeta.d.ts","sourceRoot":"","sources":["../../src/jsx/SelectionMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { SelectionMeta } from './types.js';
3
+ import { SelectionMetaCollector } from './SelectionMeta.js';
4
+ /**
5
+ * Analyzes JSX tree to extract field selection metadata.
6
+ * This is called during the collection phase to determine which fields need to be fetched.
7
+ */
8
+ export declare function analyzeJsx(node: ReactNode, selection: SelectionMetaCollector): void;
9
+ /**
10
+ * Collects all field selections from a JSX tree.
11
+ * Entry point for the collection phase.
12
+ */
13
+ export declare function collectSelection(jsx: ReactNode): SelectionMetaCollector;
14
+ /**
15
+ * Converts JSX selection metadata to the format used by query builder
16
+ */
17
+ export declare function convertToQuerySelection(jsxSelection: SelectionMeta): Record<string, unknown>;
18
+ /**
19
+ * Debug helper - prints selection tree
20
+ */
21
+ export declare function debugSelection(selection: SelectionMeta, indent?: number): string;
22
+ //# sourceMappingURL=analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/jsx/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAyC,MAAM,YAAY,CAAA;AAEtF,OAAO,EAAE,sBAAsB,EAAmB,MAAM,oBAAoB,CAAA;AAI5E;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,sBAAsB,GAAG,IAAI,CA8GnF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,sBAAsB,CAIvE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA6B5F;AAiED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,SAAI,GAAG,MAAM,CA0B3E"}
@@ -0,0 +1,14 @@
1
+ import type { SchemaRegistry } from '@contember/bindx';
2
+ import { SelectionScope } from '@contember/bindx';
3
+ import { type EntityAccessor } from './types.js';
4
+ /**
5
+ * Creates a collector proxy for the collection phase.
6
+ * This proxy captures field access and builds selection metadata using SelectionScope.
7
+ * Supports direct field access: `entity.fieldName` is equivalent to `entity.$fields.fieldName`.
8
+ *
9
+ * @param scope - The SelectionScope to collect fields into
10
+ * @param entityName - The entity type name (e.g., 'Task'), used for schema lookups
11
+ * @param schemaRegistry - The schema registry for field type information
12
+ */
13
+ export declare function createCollectorProxy<T>(scope: SelectionScope, entityName?: string | null, schemaRegistry?: SchemaRegistry<Record<string, object>> | null): EntityAccessor<T>;
14
+ //# sourceMappingURL=collectorProxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectorProxy.d.ts","sourceRoot":"","sources":["../../src/jsx/collectorProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAyB,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAEN,KAAK,cAAc,EAOnB,MAAM,YAAY,CAAA;AAQnB;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACrC,KAAK,EAAE,cAAc,EACrB,UAAU,GAAE,MAAM,GAAG,IAAW,EAChC,cAAc,GAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAW,GAClE,cAAc,CAAC,CAAC,CAAC,CA0CnB"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Unified createComponent builder implementation.
3
+ *
4
+ * Provides a fluent builder for creating bindx components with support for
5
+ * both implicit (JSX-analyzed) and explicit (selector-based) entity props.
6
+ */
7
+ import type { ReactNode } from 'react';
8
+ import type { SchemaRegistry, SelectionBuilder, EntityDef } from '@contember/bindx';
9
+ import { ComponentBrand } from '@contember/bindx';
10
+ import type { ComponentBuilder, ComponentBuilderState } from './componentBuilder.types.js';
11
+ export type { SelectionPropMeta } from './componentBuilder.types.js';
12
+ import type { Condition } from './conditions.js';
13
+ import { type EntityConfig } from './componentFactory.js';
14
+ export { COMPONENT_MARKER, COMPONENT_BRAND, COMPONENT_SELECTIONS } from './componentFactory.js';
15
+ /**
16
+ * Implementation of the ComponentBuilder interface.
17
+ * Accumulates entity configs and builds the component on .render().
18
+ *
19
+ * Note: The implementation uses broad types (Record<string, unknown>, object)
20
+ * because TypeScript cannot track the accumulating state types through method chaining.
21
+ * Type safety for consumers is provided by the ComponentBuilder interface.
22
+ */
23
+ export declare class ComponentBuilderImpl<TState extends ComponentBuilderState> {
24
+ private readonly schemaRegistry;
25
+ private readonly entityConfigs;
26
+ private readonly roles;
27
+ private readonly hasInterfacesMode;
28
+ private readonly conditionFn;
29
+ constructor(schemaRegistry: SchemaRegistry<Record<string, object>> | null, entityConfigs: Map<string, EntityConfig>, roles: readonly string[], hasInterfacesMode?: boolean, conditionFn?: ((props: Record<string, unknown>) => Condition) | null);
30
+ entity(propName: string, entity: EntityDef | string, selector?: (builder: SelectionBuilder<object>) => SelectionBuilder<object, object, object>): ComponentBuilderImpl<TState>;
31
+ interfaces(selectors?: Record<string, (builder: SelectionBuilder<object>) => SelectionBuilder<object, object, object>>): ComponentBuilderImpl<TState>;
32
+ props<TNewScalarProps extends object>(): ComponentBuilderImpl<TState>;
33
+ if(conditionFn: (props: Record<string, unknown>) => Condition): ComponentBuilderImpl<TState>;
34
+ render(renderFn: (props: Record<string, unknown>) => ReactNode): unknown;
35
+ }
36
+ /**
37
+ * Creates a new component builder with initial state.
38
+ *
39
+ * @param schemaRegistry - Optional schema registry for validation
40
+ * @param roles - Optional role constraints
41
+ */
42
+ export declare function createComponentBuilder(schemaRegistry: SchemaRegistry<Record<string, object>> | null, roles?: readonly string[]): ComponentBuilder<ComponentBuilderState<{}, object, typeof roles>>;
43
+ /**
44
+ * Type guard to check if a value is a component created with createComponent
45
+ */
46
+ export declare function isBindxComponent(value: unknown): boolean;
47
+ /**
48
+ * Gets the component brand from a bindx component
49
+ */
50
+ export declare function getComponentBrand(component: unknown): ComponentBrand | undefined;
51
+ //# sourceMappingURL=componentBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentBuilder.d.ts","sourceRoot":"","sources":["../../src/jsx/componentBuilder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACN,cAAc,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EACX,gBAAgB,EAChB,qBAAqB,EAErB,MAAM,6BAA6B,CAAA;AACpC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAGzE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAO/F;;;;;;;GAOG;AACH,qBAAa,oBAAoB,CAChC,MAAM,SAAS,qBAAqB;IAGnC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAJX,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,EAC7D,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACxC,KAAK,EAAE,SAAS,M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;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAKhF"}
@@ -0,0 +1,268 @@
1
+ /**
2
+ * Type definitions for the unified createComponent builder API.
3
+ *
4
+ * This provides a fluent builder interface for creating bindx components
5
+ * with support for both implicit (JSX-analyzed) and explicit (selector-based)
6
+ * entity props, scalar props, and optional role constraints.
7
+ */
8
+ import type { ReactNode, ComponentType } from 'react';
9
+ import type { EntityAccessor, EntityAccessorBase, FluentFragment, SelectionBuilder, AnyBrand, SelectionMeta, EntityDef, ResolveEntity } from '@contember/bindx';
10
+ import type { SelectionProvider } from './types.js';
11
+ import type { Condition } from './conditions.js';
12
+ export declare const COMPONENT_MARKER: unique symbol;
13
+ export declare const COMPONENT_BRAND: unique symbol;
14
+ export declare const COMPONENT_SELECTIONS: unique symbol;
15
+ /**
16
+ * Configuration for a single entity prop.
17
+ * Can be implicit (selection from JSX) or explicit (selection from selector).
18
+ * Stores the entity type directly (not entity name).
19
+ */
20
+ export interface EntityPropConfig<TEntity extends object = object, TSelected extends object = object, TIsImplicit extends boolean = boolean> {
21
+ readonly __entity: TEntity;
22
+ readonly isImplicit: TIsImplicit;
23
+ readonly __selected: TSelected;
24
+ }
25
+ /**
26
+ * Creates an implicit entity prop config type.
27
+ */
28
+ export type ImplicitEntityConfig<TEntity extends object> = EntityPropConfig<TEntity, TEntity, true>;
29
+ /**
30
+ * Creates an explicit entity prop config type.
31
+ */
32
+ export type ExplicitEntityConfig<TEntity extends object, TSelected extends object> = EntityPropConfig<TEntity, TSelected, false>;
33
+ /**
34
+ * Configuration for an interface-based entity prop.
35
+ * Unlike EntityPropConfig, this doesn't require a specific entity type.
36
+ * Instead, it constrains the TSelected type to extend TInterface.
37
+ */
38
+ export interface InterfaceEntityPropConfig<TInterface extends object = object, TIsImplicit extends boolean = boolean> {
39
+ readonly isInterface: true;
40
+ readonly isImplicit: TIsImplicit;
41
+ readonly __interface: TInterface;
42
+ }
43
+ /**
44
+ * Creates an implicit interface entity prop config type.
45
+ */
46
+ export type ImplicitInterfaceEntityConfig<TInterface extends object> = InterfaceEntityPropConfig<TInterface, true>;
47
+ /**
48
+ * Creates an explicit interface entity prop config type.
49
+ */
50
+ export type ExplicitInterfaceEntityConfig<TInterface extends object> = InterfaceEntityPropConfig<TInterface, false>;
51
+ /**
52
+ * Union type for all entity prop config types.
53
+ */
54
+ export type AnyEntityPropConfig = EntityPropConfig | InterfaceEntityPropConfig;
55
+ /**
56
+ * Accumulated builder state (type-level).
57
+ * Grows as you chain builder methods.
58
+ */
59
+ export interface ComponentBuilderState<TEntityProps extends Record<string, AnyEntityPropConfig> = {}, TScalarProps extends object = object, TRoles extends readonly string[] = readonly string[]> {
60
+ readonly __entityProps: TEntityProps;
61
+ readonly __scalarProps: TScalarProps;
62
+ readonly __roles: TRoles;
63
+ }
64
+ /**
65
+ * Add an implicit entity to builder state.
66
+ * Entity type comes directly from the EntityDef.
67
+ */
68
+ export type AddImplicitEntity<TState extends ComponentBuilderState, TPropName extends string, TEntity extends object> = ComponentBuilderState<TState['__entityProps'] & {
69
+ readonly [K in TPropName]: ImplicitEntityConfig<TEntity>;
70
+ }, TState['__scalarProps'], TState['__roles']>;
71
+ /**
72
+ * Add an explicit entity to builder state.
73
+ * Entity type comes directly from the EntityDef.
74
+ */
75
+ export type AddExplicitEntity<TState extends ComponentBuilderState, TPropName extends string, TEntity extends object, TSelected extends object> = ComponentBuilderState<TState['__entityProps'] & {
76
+ readonly [K in TPropName]: ExplicitEntityConfig<TEntity, TSelected>;
77
+ }, TState['__scalarProps'], TState['__roles']>;
78
+ /**
79
+ * Add an implicit interface entity to builder state.
80
+ */
81
+ export type AddImplicitInterfaceEntity<TState extends ComponentBuilderState, TPropName extends string, TInterface extends object> = ComponentBuilderState<TState['__entityProps'] & {
82
+ readonly [K in TPropName]: ImplicitInterfaceEntityConfig<TInterface>;
83
+ }, TState['__scalarProps'], TState['__roles']>;
84
+ /**
85
+ * Add an explicit interface entity to builder state.
86
+ */
87
+ export type AddExplicitInterfaceEntity<TState extends ComponentBuilderState, TPropName extends string, TInterface extends object> = ComponentBuilderState<TState['__entityProps'] & {
88
+ readonly [K in TPropName]: ExplicitInterfaceEntityConfig<TInterface>;
89
+ }, TState['__scalarProps'], TState['__roles']>;
90
+ /**
91
+ * Add multiple interface entities to builder state.
92
+ * Each key in TInterfaces becomes a prop.
93
+ */
94
+ export type AddInterfaces<TState extends ComponentBuilderState, TInterfaces extends Record<string, object>> = ComponentBuilderState<TState['__entityProps'] & {
95
+ readonly [K in keyof TInterfaces]: InterfaceEntityPropConfig<TInterfaces[K]>;
96
+ }, TState['__scalarProps'], TState['__roles']>;
97
+ /**
98
+ * Type for selectors parameter in interfaces() method.
99
+ * Maps prop names to selector functions.
100
+ */
101
+ export type InterfaceSelectorsMap<TInterfaces extends Record<string, object>> = {
102
+ readonly [K in keyof TInterfaces]?: (e: SelectionBuilder<TInterfaces[K]>) => SelectionBuilder<TInterfaces[K], TInterfaces[K], object>;
103
+ };
104
+ /**
105
+ * Set scalar props in builder state.
106
+ */
107
+ export type SetScalarProps<TState extends ComponentBuilderState, TNewScalarProps extends object> = ComponentBuilderState<TState['__entityProps'], TNewScalarProps, TState['__roles']>;
108
+ /**
109
+ * Build EntityAccessor props from entity config.
110
+ *
111
+ * For explicit selection (selector provided): Returns EntityAccessor with full access
112
+ * - Allows direct field access: `entity.fieldName.value`
113
+ * - Allows relation access: `entity.relation.length`, `entity.relation.$entity`
114
+ *
115
+ * For implicit selection (no selector): Returns EntityAccessorBase with restricted access
116
+ * - Blocks direct field access to enforce declarative patterns
117
+ * - Users must use components: `<Field field={entity.fieldName} />`
118
+ * - Users must use condition DSL: `<If condition={cond.hasItems(entity.relation)} />`
119
+ */
120
+ export type BuildEntityProps<TEntityProps extends Record<string, AnyEntityPropConfig>, TRoles extends readonly string[]> = {
121
+ readonly [K in keyof TEntityProps]: TEntityProps[K] extends EntityPropConfig<infer TEntity, infer TSelected, infer TIsImplicit> ? TIsImplicit extends true ? EntityAccessorBase<TEntity, TSelected, AnyBrand, string> : EntityAccessor<TEntity, TSelected, AnyBrand, string> : TEntityProps[K] extends InterfaceEntityPropConfig<infer TInterface, infer TIsImplicit> ? TIsImplicit extends true ? EntityAccessorBase<TInterface, TInterface, AnyBrand, string> : EntityAccessor<TInterface, TInterface, AnyBrand, string> : never;
122
+ };
123
+ /**
124
+ * Build complete props type from builder state.
125
+ */
126
+ export type BuildProps<TState extends ComponentBuilderState> = TState['__scalarProps'] & BuildEntityProps<TState['__entityProps'], TState['__roles']>;
127
+ /**
128
+ * Build fragment properties ($propName) from entity config.
129
+ */
130
+ export type BuildFragmentProps<TEntityProps extends Record<string, AnyEntityPropConfig>, TRoles extends readonly string[]> = {
131
+ readonly [K in keyof TEntityProps as `$${K & string}`]: TEntityProps[K] extends EntityPropConfig<infer TEntity, infer TSelected, infer _TIsImplicit> ? FluentFragment<TEntity, TSelected, AnyBrand> : TEntityProps[K] extends InterfaceEntityPropConfig<infer TInterface, infer _TIsImplicit> ? FluentFragment<TInterface, TInterface, AnyBrand> : never;
132
+ };
133
+ /**
134
+ * Metadata for entity prop selections.
135
+ */
136
+ export interface SelectionPropMeta {
137
+ readonly selection: SelectionMeta;
138
+ readonly fragment: FluentFragment<unknown, object>;
139
+ }
140
+ /**
141
+ * Base component type with markers.
142
+ */
143
+ export type BindxComponentBase<TProps extends object> = ComponentType<TProps> & SelectionProvider & {
144
+ readonly [COMPONENT_MARKER]: true;
145
+ readonly [COMPONENT_SELECTIONS]: Map<string, SelectionPropMeta>;
146
+ readonly __componentRoles?: readonly string[];
147
+ };
148
+ /**
149
+ * Complete bindx component type with fragment properties.
150
+ */
151
+ export type BindxComponent<TState extends ComponentBuilderState> = BindxComponentBase<BuildProps<TState>> & BuildFragmentProps<TState['__entityProps'], TState['__roles']>;
152
+ /**
153
+ * Fluent builder for creating bindx components.
154
+ *
155
+ * @typeParam TState - Accumulated builder state
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * createComponent()
160
+ * .entity('article', schema.Article) // implicit
161
+ * .entity('author', schema.Author, e => e.id().name()) // explicit
162
+ * .props<{ className?: string }>()
163
+ * .render(({ article, author, className }) => ...)
164
+ * ```
165
+ */
166
+ export interface ComponentBuilder<TState extends ComponentBuilderState = ComponentBuilderState> {
167
+ /**
168
+ * Add an entity prop with implicit selection (collected from JSX).
169
+ * Entity type is resolved based on the builder's roles via ResolveEntity.
170
+ *
171
+ * @param propName - Name of the prop
172
+ * @param entity - EntityDef reference
173
+ */
174
+ entity<TPropName extends string, TRoleMap extends Record<string, object>>(propName: TPropName, entity: EntityDef<TRoleMap>): ComponentBuilder<AddImplicitEntity<TState, TPropName, ResolveEntity<TRoleMap, TState['__roles'][number]>>>;
175
+ /**
176
+ * Add an entity prop with explicit selection (from selector function).
177
+ * Entity type is resolved based on the builder's roles via ResolveEntity.
178
+ *
179
+ * @param propName - Name of the prop
180
+ * @param entity - EntityDef reference
181
+ * @param selector - Selection builder function
182
+ */
183
+ entity<TPropName extends string, TRoleMap extends Record<string, object>, TSelected extends object>(propName: TPropName, entity: EntityDef<TRoleMap>, selector: (e: SelectionBuilder<ResolveEntity<TRoleMap, TState['__roles'][number]>>) => SelectionBuilder<ResolveEntity<TRoleMap, TState['__roles'][number]>, TSelected, object>): ComponentBuilder<AddExplicitEntity<TState, TPropName, ResolveEntity<TRoleMap, TState['__roles'][number]>, TSelected>>;
184
+ /**
185
+ * Add interface-based entity props that accept any EntityRef with matching fields.
186
+ * Each key in TInterfaces becomes a prop name, and the value defines required fields.
187
+ *
188
+ * Props without selectors use implicit mode (selection collected from JSX).
189
+ * Props with selectors use explicit mode (selection from selector function).
190
+ *
191
+ * @example
192
+ * ```typescript
193
+ * interface HasName { name: string }
194
+ * interface HasArchivedAt { archivedAt: string | null }
195
+ *
196
+ * // Implicit mode - selection from JSX
197
+ * const NameCard = createComponent()
198
+ * .interfaces<{ item: HasName }>()
199
+ * .render(({ item }) => <span>{item.fields.name.value}</span>)
200
+ *
201
+ * // Explicit mode - selection from selector
202
+ * const ArchiveIndicator = createComponent()
203
+ * .interfaces<{ item: HasArchivedAt }>({
204
+ * item: e => e.archivedAt(),
205
+ * })
206
+ * .render(({ item }) => <span>{item.data?.archivedAt ? 'Archived' : 'Active'}</span>)
207
+ *
208
+ * // Mixed mode - some implicit, some explicit
209
+ * const Card = createComponent()
210
+ * .interfaces<{ item: HasName; status: HasArchivedAt }>({
211
+ * status: e => e.archivedAt(), // explicit
212
+ * // item has no selector -> implicit from JSX
213
+ * })
214
+ * .render(({ item, status }) => ...)
215
+ * ```
216
+ */
217
+ interfaces<TInterfaces extends Record<string, object>>(selectors?: InterfaceSelectorsMap<TInterfaces>): ComponentBuilder<AddInterfaces<TState, TInterfaces>>;
218
+ /**
219
+ * Define additional scalar (non-entity) props.
220
+ * This is a type-only operation - no runtime effect.
221
+ *
222
+ * @example
223
+ * ```typescript
224
+ * .props<{ className?: string; onClick?: () => void }>()
225
+ * ```
226
+ */
227
+ props<TNewScalarProps extends object>(): ComponentBuilder<SetScalarProps<TState, TNewScalarProps>>;
228
+ /**
229
+ * Add a condition that must be true for the component to render.
230
+ * If the condition is false, the component renders null.
231
+ *
232
+ * Fields used in the condition are automatically collected for the GraphQL query.
233
+ *
234
+ * @param conditionFn - Function that receives entity props and returns a Condition
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * createComponent()
239
+ * .entity('task', schema.Task)
240
+ * .if(({ task }) => cond.isTruthy(task.project.company.canSeeTimeEstimates))
241
+ * .render(({ task }) => (
242
+ * // Only renders if canSeeTimeEstimates is truthy
243
+ * <div>...</div>
244
+ * ))
245
+ * ```
246
+ */
247
+ if(conditionFn: (props: BuildEntityProps<TState['__entityProps'], TState['__roles']>) => Condition): ComponentBuilder<TState>;
248
+ /**
249
+ * Build the component with the render function.
250
+ *
251
+ * @param renderFn - React render function receiving typed props
252
+ * @returns Bindx component with fragment properties
253
+ */
254
+ render(renderFn: (props: BuildProps<TState>) => ReactNode): BindxComponent<TState>;
255
+ }
256
+ /**
257
+ * Initial builder state with empty entity props and scalar props.
258
+ * Note: Uses {} instead of Record<string, never> to avoid index signature issues
259
+ * when combining with scalar props.
260
+ */
261
+ export type InitialBuilderState<TRoles extends readonly string[] = readonly string[]> = ComponentBuilderState<{}, object, TRoles>;
262
+ /**
263
+ * Options for createComponent.
264
+ */
265
+ export interface CreateComponentOptions<TRoles extends readonly string[] = readonly string[]> {
266
+ readonly roles?: TRoles;
267
+ }
268
+ //# sourceMappingURL=componentBuilder.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentBuilder.types.d.ts","sourceRoot":"","sources":["../../src/jsx/componentBuilder.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAEX,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAMhD,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAA;AACpD,MAAM,CAAC,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,MAAM,CAAA;AACnD,MAAM,CAAC,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,MAAM,CAAA;AAMxD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAChC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,WAAW,SAAS,OAAO,GAAG,OAAO;IAErC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAA;IAChC,Q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MAAM,EAAE,MAAM,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,MAAM,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Backwards compatibility exports for createComponent.
3
+ * These are used by other parts of the codebase that haven't been migrated yet.
4
+ */
5
+ import type { ComponentType } from 'react';
6
+ import type { SelectionPropMeta } from './componentBuilder.types.js';
7
+ /**
8
+ * Assigns $propName fragment properties to a component.
9
+ * @internal
10
+ */
11
+ export declare function assignFragmentProperties(component: ComponentType<any>, selectionsMap: Map<string, SelectionPropMeta>): void;
12
+ /**
13
+ * Assigns standard bindx component markers to a component.
14
+ * @internal
15
+ */
16
+ export declare function assignComponentMarkers(component: ComponentType<any>, selectionsMap: Map<string, SelectionPropMeta>): void;
17
+ //# sourceMappingURL=componentBuilderCompat.d.ts.map