@contember/bindx-react 0.1.0 → 0.1.3

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 (65) hide show
  1. package/package.json +1 -1
  2. package/dist/dataview/DataGrid.d.ts +0 -45
  3. package/dist/dataview/DataGrid.d.ts.map +0 -1
  4. package/dist/dataview/DataGridPagination.d.ts +0 -24
  5. package/dist/dataview/DataGridPagination.d.ts.map +0 -1
  6. package/dist/dataview/DataGridToolbar.d.ts +0 -16
  7. package/dist/dataview/DataGridToolbar.d.ts.map +0 -1
  8. package/dist/dataview/DataViewContext.d.ts +0 -32
  9. package/dist/dataview/DataViewContext.d.ts.map +0 -1
  10. package/dist/dataview/columns.d.ts +0 -115
  11. package/dist/dataview/columns.d.ts.map +0 -1
  12. package/dist/dataview/contextHooks.d.ts +0 -48
  13. package/dist/dataview/contextHooks.d.ts.map +0 -1
  14. package/dist/dataview/dataAttribute.d.ts +0 -6
  15. package/dist/dataview/dataAttribute.d.ts.map +0 -1
  16. package/dist/dataview/export.d.ts +0 -46
  17. package/dist/dataview/export.d.ts.map +0 -1
  18. package/dist/dataview/filterComponents.d.ts +0 -127
  19. package/dist/dataview/filterComponents.d.ts.map +0 -1
  20. package/dist/dataview/filterContext.d.ts +0 -10
  21. package/dist/dataview/filterContext.d.ts.map +0 -1
  22. package/dist/dataview/filterHooks.d.ts +0 -74
  23. package/dist/dataview/filterHooks.d.ts.map +0 -1
  24. package/dist/dataview/filterScope.d.ts +0 -54
  25. package/dist/dataview/filterScope.d.ts.map +0 -1
  26. package/dist/dataview/filterWrappers.d.ts +0 -65
  27. package/dist/dataview/filterWrappers.d.ts.map +0 -1
  28. package/dist/dataview/index.d.ts +0 -21
  29. package/dist/dataview/index.d.ts.map +0 -1
  30. package/dist/dataview/infiniteLoad.d.ts +0 -32
  31. package/dist/dataview/infiniteLoad.d.ts.map +0 -1
  32. package/dist/dataview/loaderComponents.d.ts +0 -80
  33. package/dist/dataview/loaderComponents.d.ts.map +0 -1
  34. package/dist/dataview/pagingComponents.d.ts +0 -50
  35. package/dist/dataview/pagingComponents.d.ts.map +0 -1
  36. package/dist/dataview/renderCellValue.d.ts +0 -9
  37. package/dist/dataview/renderCellValue.d.ts.map +0 -1
  38. package/dist/dataview/selectionComponents.d.ts +0 -62
  39. package/dist/dataview/selectionComponents.d.ts.map +0 -1
  40. package/dist/dataview/sortingComponents.d.ts +0 -39
  41. package/dist/dataview/sortingComponents.d.ts.map +0 -1
  42. package/dist/dataview/stateStorage.d.ts +0 -19
  43. package/dist/dataview/stateStorage.d.ts.map +0 -1
  44. package/dist/dataview/useDataView.d.ts +0 -58
  45. package/dist/dataview/useDataView.d.ts.map +0 -1
  46. package/dist/dataview/useDataViewState.d.ts +0 -89
  47. package/dist/dataview/useDataViewState.d.ts.map +0 -1
  48. package/dist/hooks/createBindx.d.ts +0 -39
  49. package/dist/hooks/createBindx.d.ts.map +0 -1
  50. package/dist/hooks/useEntityCore.d.ts +0 -52
  51. package/dist/hooks/useEntityCore.d.ts.map +0 -1
  52. package/dist/hooks/useEntityImpl.d.ts +0 -105
  53. package/dist/hooks/useEntityImpl.d.ts.map +0 -1
  54. package/dist/hooks/useEntityListCore.d.ts +0 -49
  55. package/dist/hooks/useEntityListCore.d.ts.map +0 -1
  56. package/dist/hooks/useEntityListImpl.d.ts +0 -70
  57. package/dist/hooks/useEntityListImpl.d.ts.map +0 -1
  58. package/dist/hooks/useSelectionCollectionForList.d.ts +0 -40
  59. package/dist/hooks/useSelectionCollectionForList.d.ts.map +0 -1
  60. package/dist/hooks/useStableSelectionMeta.d.ts +0 -11
  61. package/dist/hooks/useStableSelectionMeta.d.ts.map +0 -1
  62. package/dist/jsx/inlineProxy.d.ts +0 -14
  63. package/dist/jsx/inlineProxy.d.ts.map +0 -1
  64. package/dist/jsx/runtimeProxy.d.ts +0 -11
  65. package/dist/jsx/runtimeProxy.d.ts.map +0 -1
@@ -1,89 +0,0 @@
1
- /**
2
- * State management hooks for DataView filtering, sorting, paging, and selection.
3
- *
4
- * All hooks support optional state storage (URL, session, local, custom)
5
- * for persisting state across navigations.
6
- */
7
- import type { FilterHandler, FilterArtifact, SortingState, SortingDirections, SortingDirectionAction, PagingState, PagingInfo, OrderDirection, DataViewLayout, SelectionValues, SelectionState } from '@contember/bindx';
8
- import { type StateStorageOrName } from './stateStorage.js';
9
- export interface RegisteredFilter {
10
- readonly name: string;
11
- readonly handler: FilterHandler<FilterArtifact>;
12
- artifact: FilterArtifact;
13
- }
14
- export interface FilteringState {
15
- readonly filters: ReadonlyMap<string, RegisteredFilter>;
16
- getArtifact(name: string): FilterArtifact | undefined;
17
- setArtifact(name: string, artifact: FilterArtifact): void;
18
- resetFilter(name: string): void;
19
- resetAll(): void;
20
- readonly hasActiveFilters: boolean;
21
- readonly resolvedWhere: Record<string, unknown> | undefined;
22
- }
23
- export interface UseFilteringOptions {
24
- filters: ReadonlyMap<string, {
25
- handler: FilterHandler<FilterArtifact>;
26
- initialArtifact?: FilterArtifact;
27
- }>;
28
- /** State storage backend. Default: 'null' (no persistence) */
29
- stateStorage?: StateStorageOrName;
30
- /** Storage key prefix */
31
- storageKey?: string;
32
- }
33
- export declare function useFilteringState(options: UseFilteringOptions): FilteringState;
34
- export interface UseSortingOptions {
35
- sortableFields: ReadonlySet<string>;
36
- initialSorting?: SortingDirections;
37
- stateStorage?: StateStorageOrName;
38
- storageKey?: string;
39
- }
40
- export interface SortingStateResult {
41
- readonly state: SortingState;
42
- setOrderBy(field: string, action: SortingDirectionAction, append?: boolean): void;
43
- clear(): void;
44
- directionOf(field: string): OrderDirection | null;
45
- readonly resolvedOrderBy: readonly Record<string, unknown>[] | undefined;
46
- }
47
- export declare function useSortingState(options: UseSortingOptions): SortingStateResult;
48
- export interface UsePagingOptions {
49
- /** Initial items per page. null = show all. Default: 50 */
50
- initialItemsPerPage?: number | null;
51
- /** State storage for current page */
52
- currentPageStateStorage?: StateStorageOrName;
53
- /** State storage for page size preference */
54
- pagingSettingsStorage?: StateStorageOrName;
55
- /** Storage key prefix */
56
- storageKey?: string;
57
- }
58
- export interface PagingStateResult {
59
- readonly state: PagingState;
60
- readonly info: PagingInfo;
61
- readonly hasPrevious: boolean;
62
- readonly hasNext: boolean;
63
- goTo(page: number): void;
64
- next(): void;
65
- previous(): void;
66
- first(): void;
67
- last(): void;
68
- setItemsPerPage(count: number | null): void;
69
- setTotalCount(count: number): void;
70
- refreshTotalCount(): void;
71
- readonly queryLimit: number | undefined;
72
- readonly queryOffset: number | undefined;
73
- }
74
- export declare function usePagingState(options?: UsePagingOptions): PagingStateResult;
75
- export interface UseSelectionOptions {
76
- layouts?: readonly DataViewLayout[];
77
- initialSelection?: SelectionValues;
78
- stateStorage?: StateStorageOrName;
79
- storageKey?: string;
80
- }
81
- export interface SelectionStateResult {
82
- readonly state: SelectionState;
83
- setLayout(layout: string | undefined): void;
84
- setVisibility(name: string, visible: boolean | undefined): void;
85
- isVisible(name: string, fallback?: boolean): boolean;
86
- readonly currentLayout: string | undefined;
87
- }
88
- export declare function useSelectionState(options?: UseSelectionOptions): SelectionStateResult;
89
- //# sourceMappingURL=useDataViewState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDataViewState.d.ts","sourceRoot":"","sources":["../../src/dataview/useDataViewState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAM3E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC/C,QAAQ,EAAE,cAAc,CAAA;C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,mBAAmB;IACnC,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IACnC,gBAAgB,CAAC,EAAE,eAAe,CAAA;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IAC3C,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAA;IAC/D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IACpD,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1C;AAID,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,oBAAoB,CA8BzF"}
@@ -1,39 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- import { type SchemaDefinition, SchemaRegistry, type SelectionInput } from '@contember/bindx';
3
- import { type UseEntityOptions, type EntityAccessorResult } from './useEntityImpl.js';
4
- import { type UseEntityListOptions, type EntityListAccessorResult } from './useEntityListImpl.js';
5
- import type { ComponentBuilder, ComponentBuilderState, CreateComponentOptions } from '../jsx/componentBuilder.types.js';
6
- import { type EntityProps } from '../jsx/components/Entity.js';
7
- import { type EntityListProps } from '../jsx/components/EntityList.js';
8
- export { COMPONENT_MARKER, COMPONENT_SELECTIONS, type SelectionPropMeta } from '../jsx/componentBuilder.js';
9
- export type { EntityFields } from '@contember/bindx';
10
- export type { UseEntityOptions, EntityAccessorResult, LoadingEntityAccessor, ErrorEntityAccessor, NotFoundEntityAccessor, ReadyEntityAccessor } from './useEntityImpl.js';
11
- export type { UseEntityListOptions, EntityListAccessorResult, LoadingEntityListAccessor, ErrorEntityListAccessor, ReadyEntityListAccessor } from './useEntityListImpl.js';
12
- /**
13
- * Creates type-safe bindx hooks and components for a specific schema.
14
- *
15
- * @example
16
- * ```ts
17
- * const schema = defineSchema<{
18
- * Article: Article
19
- * Author: Author
20
- * }>({...})
21
- *
22
- * export const { useEntity, useEntityList, Entity, createComponent } = createBindx(schema)
23
- * ```
24
- */
25
- export declare function createBindx<TModels extends {
26
- [K in keyof TModels]: object;
27
- }>(schemaDefinition: SchemaDefinition<TModels>): {
28
- useEntity: <TEntityName extends keyof TModels & string, TResult extends object>(entityType: TEntityName, options: UseEntityOptions, definer: SelectionInput<TModels[TEntityName], TResult>) => EntityAccessorResult<TModels[TEntityName], TResult>;
29
- useEntityList: <TEntityName extends keyof TModels & string, TResult extends object>(entityType: TEntityName, options: UseEntityListOptions, definer: SelectionInput<TModels[TEntityName], TResult>) => EntityListAccessorResult<TResult>;
30
- Entity: <K extends keyof TModels & string>(props: EntityProps<TModels, K>) => ReactElement | null;
31
- EntityList: <K extends keyof TModels & string>(props: EntityListProps<TModels, K>) => ReactElement | null;
32
- createComponent: {
33
- (): ComponentBuilder<TModels, ComponentBuilderState<TModels, {}, object, readonly string[]>>;
34
- <TRoles extends readonly string[]>(options: CreateComponentOptions<TRoles>): ComponentBuilder<TModels, ComponentBuilderState<TModels, {}, object, TRoles>>;
35
- };
36
- schemaRegistry: SchemaRegistry<TModels>;
37
- schema: SchemaRegistry<TModels>;
38
- };
39
- //# sourceMappingURL=createBindx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createBindx.d.ts","sourceRoot":"","sources":["../../src/hooks/createBindx.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EACN,KAAK,gBAAgB,EACrB,cAAc,EACd,KAAK,cAAc,EAGnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAiB,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACpG,OAA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,MAAM,OAAO,GAAG,MAAM,SAAS,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,KAAG,YAAY,GAAG,IAAI;iBAIlF,CAAC,SAAS,MAAM,OAAO,GAAG,MAAM,SAAS,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,KAAG,YAAY,GAAG,IAAI;;YAQvF,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;SAC3F,MAAM,SAAS,SAAS,MAAM,EAAE,WAC/C,sBAAsB,CAAC,MAAM,CAAC,GAErC,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;;;;EAkBhF"}
@@ -1,52 +0,0 @@
1
- import type { SelectionMeta, EntityUniqueWhere, FieldError } from '@contember/bindx';
2
- import type { EntitySnapshot, LoadStatus } from '@contember/bindx';
3
- /**
4
- * Options for useEntityCore hook.
5
- */
6
- export interface UseEntityCoreOptions {
7
- /** Entity type name */
8
- entityType: string;
9
- /** Unique field(s) to identify the entity (e.g., { id: '...' } or { slug: '...' }) */
10
- by: EntityUniqueWhere;
11
- /** Pre-resolved selection metadata */
12
- selectionMeta: SelectionMeta;
13
- /** Optional query key for cache invalidation (used by JSX pattern) */
14
- queryKey?: string;
15
- /** Whether to use cached data if available */
16
- cache?: boolean;
17
- }
18
- /**
19
- * Load state from store
20
- */
21
- interface LoadState {
22
- status: LoadStatus;
23
- error?: FieldError;
24
- }
25
- /**
26
- * Result from useEntityCore hook.
27
- */
28
- export interface EntityCoreResult {
29
- /** Current load status */
30
- status: 'loading' | 'error' | 'not_found' | 'ready';
31
- /** Error if status is 'error' */
32
- error?: FieldError;
33
- /** Entity snapshot when ready */
34
- snapshot: EntitySnapshot | undefined;
35
- /** Load state from store */
36
- loadState: LoadState | undefined;
37
- /** Whether entity is being persisted */
38
- isPersisting: boolean;
39
- }
40
- /**
41
- * Core hook for entity data loading.
42
- * Handles store subscription, data fetching, and state management.
43
- *
44
- * This hook accepts pre-resolved SelectionMeta, allowing it to be used by:
45
- * - useEntity (which resolves fluent builder to SelectionMeta)
46
- * - Entity component (which collects JSX selection to SelectionMeta)
47
- *
48
- * @internal This hook is for internal use only.
49
- */
50
- export declare function useEntityCore(options: UseEntityCoreOptions): EntityCoreResult;
51
- export {};
52
- //# sourceMappingURL=useEntityCore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEntityCore.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityCore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,EAAE,EAAE,iBAAiB,CAAA;IACrB,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAA;CACf;AAED;;GAEG;AACH,UAAU,SAAS;IAClB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,UAAU,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,0BAA0B;IAC1B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;IACnD,iCAAiC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,iCAAiC;IACjC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,4BAA4B;IAC5B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,wCAAwC;IACxC,YAAY,EAAE,OAAO,CAAA;CACrB;AAWD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CA0L7E"}
@@ -1,105 +0,0 @@
1
- import type { SchemaRegistry, EntityUniqueWhere, FieldError } from '@contember/bindx';
2
- import type { SelectionMeta } from '@contember/bindx';
3
- import type { SelectedEntityFields } from '@contember/bindx';
4
- /**
5
- * Options for useEntity hook
6
- */
7
- export interface UseEntityOptions {
8
- /** Unique field(s) to identify the entity (e.g., { id: '...' } or { slug: '...' }) */
9
- by: EntityUniqueWhere;
10
- /** If true, use cached data from store if available (default: false) */
11
- cache?: boolean;
12
- }
13
- /**
14
- * Loading state for entity accessor
15
- */
16
- export interface LoadingEntityAccessor {
17
- readonly status: 'loading';
18
- readonly isLoading: true;
19
- readonly isError: false;
20
- readonly isNotFound: false;
21
- readonly isPersisting: false;
22
- readonly isDirty: false;
23
- readonly id: string;
24
- readonly fields: never;
25
- readonly data: never;
26
- persist(): Promise<void>;
27
- reset(): void;
28
- }
29
- /**
30
- * Error state for entity accessor
31
- */
32
- export interface ErrorEntityAccessor {
33
- readonly status: 'error';
34
- readonly isLoading: false;
35
- readonly isError: true;
36
- readonly isNotFound: false;
37
- readonly error: FieldError;
38
- readonly isPersisting: false;
39
- readonly isDirty: false;
40
- readonly id: string;
41
- readonly fields: never;
42
- readonly data: never;
43
- persist(): Promise<void>;
44
- reset(): void;
45
- }
46
- /**
47
- * Not found state for entity accessor
48
- */
49
- export interface NotFoundEntityAccessor {
50
- readonly status: 'not_found';
51
- readonly isLoading: false;
52
- readonly isError: false;
53
- readonly isNotFound: true;
54
- readonly isPersisting: false;
55
- readonly isDirty: false;
56
- readonly id: string;
57
- readonly fields: never;
58
- readonly data: never;
59
- persist(): Promise<void>;
60
- reset(): void;
61
- }
62
- /**
63
- * Ready state base interface for entity accessor
64
- *
65
- * @typeParam TEntity - The full entity type
66
- * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility)
67
- */
68
- export interface ReadyEntityAccessorBase<TEntity extends object, TSelected extends object = TEntity> {
69
- readonly status: 'ready';
70
- readonly isLoading: false;
71
- readonly isError: false;
72
- readonly isNotFound: false;
73
- readonly isPersisting: boolean;
74
- readonly isDirty: boolean;
75
- readonly id: string;
76
- readonly fields: SelectedEntityFields<TEntity, TSelected>;
77
- readonly data: TSelected;
78
- persist(): Promise<void>;
79
- reset(): void;
80
- }
81
- /**
82
- * Ready state for entity accessor with direct field access via Proxy.
83
- * Access fields directly: `entity.fieldName` instead of `entity.fields.fieldName`.
84
- *
85
- * @typeParam TEntity - The full entity type
86
- * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility)
87
- */
88
- export type ReadyEntityAccessor<TEntity extends object, TSelected extends object = TEntity> = ReadyEntityAccessorBase<TEntity, TSelected> & SelectedEntityFields<TEntity, TSelected>;
89
- /**
90
- * Union of all entity accessor states
91
- *
92
- * @typeParam TEntity - The full entity type
93
- * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility)
94
- */
95
- export type EntityAccessorResult<TEntity extends object, TSelected extends object = TEntity> = LoadingEntityAccessor | ErrorEntityAccessor | NotFoundEntityAccessor | ReadyEntityAccessor<TEntity, TSelected>;
96
- /**
97
- * Generic implementation of useEntity hook.
98
- * Used by createBindx to create typed versions.
99
- *
100
- * @typeParam TEntity - The full entity type
101
- * @typeParam TSelected - The selected subset of fields
102
- * @internal
103
- */
104
- export declare function useEntityImpl<TEntity extends object, TSelected extends object>(entityType: string, options: UseEntityOptions, selectionMeta: SelectionMeta, schema: SchemaRegistry<Record<string, object>>): EntityAccessorResult<TEntity, TSelected>;
105
- //# sourceMappingURL=useEntityImpl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEntityImpl.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityImpl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EA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,CAAA;CACb;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,GAAG,OAAO,IACzF,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAEvF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,GAAG,OAAO,IACxF,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAoF1C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,EAC7E,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CA+F1C"}
@@ -1,49 +0,0 @@
1
- import type { SelectionMeta, FieldError } from '@contember/bindx';
2
- /**
3
- * Options for useEntityListCore hook.
4
- */
5
- export interface UseEntityListCoreOptions {
6
- /** Entity type name */
7
- entityType: string;
8
- /** Optional filter criteria */
9
- filter?: Record<string, unknown>;
10
- /** Optional ordering */
11
- orderBy?: readonly Record<string, unknown>[];
12
- /** Optional limit */
13
- limit?: number;
14
- /** Optional offset */
15
- offset?: number;
16
- /** Pre-resolved selection metadata */
17
- selectionMeta: SelectionMeta;
18
- /** Optional query key for cache invalidation */
19
- queryKey?: string;
20
- }
21
- /**
22
- * Item in the entity list result
23
- */
24
- export interface EntityListCoreItem {
25
- id: string;
26
- data: Record<string, unknown>;
27
- }
28
- /**
29
- * Result from useEntityListCore hook.
30
- */
31
- export interface EntityListCoreResult {
32
- /** Current load status */
33
- status: 'loading' | 'error' | 'ready';
34
- /** Error if status is 'error' */
35
- error?: FieldError;
36
- /** List items when ready */
37
- items: EntityListCoreItem[];
38
- }
39
- /**
40
- * Core hook for entity list data loading.
41
- * Handles store subscription, data fetching, and state management.
42
- *
43
- * This hook accepts pre-resolved SelectionMeta, allowing it to be used by:
44
- * - EntityList component (which collects JSX selection to SelectionMeta)
45
- *
46
- * @internal This hook is for internal use only.
47
- */
48
- export declare function useEntityListCore(options: UseEntityListCoreOptions): EntityListCoreResult;
49
- //# sourceMappingURL=useEntityListCore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEntityListCore.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityListCore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,wBAAwB;IACxB,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,0BAA0B;IAC1B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACrC,iCAAiC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC3B;AAWD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,oBAAoB,CAkKzF"}
@@ -1,70 +0,0 @@
1
- import type { SchemaRegistry, EntityAccessor } from '@contember/bindx';
2
- import type { SelectionMeta, FieldError } from '@contember/bindx';
3
- /**
4
- * Options for useEntityList hook
5
- */
6
- export interface UseEntityListOptions {
7
- /** Optional filter criteria */
8
- filter?: Record<string, unknown>;
9
- /** Optional ordering */
10
- orderBy?: readonly Record<string, unknown>[];
11
- /** Optional limit */
12
- limit?: number;
13
- /** Optional offset */
14
- offset?: number;
15
- }
16
- /**
17
- * Loading state for entity list accessor
18
- */
19
- export interface LoadingEntityListAccessor {
20
- readonly status: 'loading';
21
- readonly isLoading: true;
22
- readonly isError: false;
23
- readonly isDirty: false;
24
- readonly items: never;
25
- readonly length: 0;
26
- add(data?: unknown): string;
27
- remove(key: string): void;
28
- move(fromIndex: number, toIndex: number): void;
29
- }
30
- /**
31
- * Error state for entity list accessor
32
- */
33
- export interface ErrorEntityListAccessor {
34
- readonly status: 'error';
35
- readonly isLoading: false;
36
- readonly isError: true;
37
- readonly error: FieldError;
38
- readonly isDirty: false;
39
- readonly items: never;
40
- readonly length: 0;
41
- add(data?: unknown): string;
42
- remove(key: string): void;
43
- move(fromIndex: number, toIndex: number): void;
44
- }
45
- /**
46
- * Ready state for entity list accessor
47
- */
48
- export interface ReadyEntityListAccessor<T extends object> {
49
- readonly status: 'ready';
50
- readonly isLoading: false;
51
- readonly isError: false;
52
- readonly isDirty: boolean;
53
- readonly items: Array<EntityAccessor<T>>;
54
- readonly length: number;
55
- add(data?: Partial<T>): string;
56
- remove(key: string): void;
57
- move(fromIndex: number, toIndex: number): void;
58
- }
59
- /**
60
- * Union of all entity list accessor states
61
- */
62
- export type EntityListAccessorResult<T extends object> = LoadingEntityListAccessor | ErrorEntityListAccessor | ReadyEntityListAccessor<T>;
63
- /**
64
- * Generic implementation of useEntityList hook.
65
- * Used by createBindx to create typed versions.
66
- *
67
- * @internal
68
- */
69
- export declare function useEntityListImpl<TResult extends object>(entityType: string, options: UseEntityListOptions, selectionMeta: SelectionMeta, schema: SchemaRegistry<Record<string, object>>): EntityListAccessorResult<TResult>;
70
- //# sourceMappingURL=useEntityListImpl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEntityListImpl.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityListImpl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,wBAAwB;IACxB,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClB,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,MAA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AEG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,MAAM,IAClD,yBAAyB,GACzB,uBAAuB,GACvB,uBAAuB,CAAC,CAAC,CAAC,CAAA;AA+C7B;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACvD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,EAC7B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,wBAAwB,CAAC,OAAO,CAAC,CA+OnC"}
@@ -1,40 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,11 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
1
- import type { SnapshotStore, SelectionMeta } from '@contember/bindx';
2
- import { type EntityAccessor, type EntityFields } from './types.js';
3
- import { type NotifyChange } from './proxyShared.js';
4
- /**
5
- * Creates a fields proxy that reads directly from inline data.
6
- * Used for nested relations to avoid store modifications during render.
7
- */
8
- export declare function createInlineFieldsProxy(data: Record<string, unknown>, basePath: string[], store: SnapshotStore, notifyChange: NotifyChange, selection?: SelectionMeta): EntityFields<unknown>;
9
- /**
10
- * Creates an accessor that reads directly from inline data.
11
- * Used for nested relations to avoid store modifications during render.
12
- */
13
- export declare function createInlineAccessor(data: Record<string, unknown>, basePath: string[], store: SnapshotStore, notifyChange: NotifyChange, selection?: SelectionMeta): EntityAccessor<unknown>;
14
- //# sourceMappingURL=inlineProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inlineProxy.d.ts","sourceRoot":"","sources":["../../src/jsx/inlineProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhF,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,YAAY,EAKjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACN,KAAK,YAAY,EAMjB,MAAM,kBAAkB,CAAA;AAEzB;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,SAAS,CAAC,EAAE,aAAa,GACvB,YAAY,CAAC,OAAO,CAAC,CAOvB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,SAAS,CAAC,EAAE,aAAa,GACvB,cAAc,CAAC,OAAO,CAAC,CA6BzB"}
@@ -1,11 +0,0 @@
1
- import type { SnapshotStore, SelectionMeta } from '@contember/bindx';
2
- import { type EntityAccessor } from './types.js';
3
- import { type NotifyChange } from './proxyShared.js';
4
- /**
5
- * Creates a runtime accessor with real data from SnapshotStore.
6
- * Supports direct field access: `entity.fieldName` is equivalent to `entity.$fields.fieldName`.
7
- *
8
- * @param selection - Optional selection metadata. When provided, accessing fields not in the selection will throw UnfetchedFieldError.
9
- */
10
- export declare function createRuntimeAccessor<T>(entityType: string, entityId: string, store: SnapshotStore, notifyChange: NotifyChange, path?: string[], selection?: SelectionMeta): EntityAccessor<T>;
11
- //# sourceMappingURL=runtimeProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimeProxy.d.ts","sourceRoot":"","sources":["../../src/jsx/runtimeProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhF,OAAO,EAEN,KAAK,cAAc,EAMnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACN,KAAK,YAAY,EAOjB,MAAM,kBAAkB,CAAA;AAGzB;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,IAAI,GAAE,MAAM,EAAO,EACnB,SAAS,CAAC,EAAE,aAAa,GACvB,cAAc,CAAC,CAAC,CAAC,CAqEnB"}