@judo/core 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.
- package/LICENSE +277 -0
- package/README.md +213 -0
- package/dist/contexts/application-context.d.ts +46 -0
- package/dist/contexts/application-context.d.ts.map +1 -0
- package/dist/contexts/customizations-context.d.ts +227 -0
- package/dist/contexts/customizations-context.d.ts.map +1 -0
- package/dist/contexts/data-context.d.ts +30 -0
- package/dist/contexts/data-context.d.ts.map +1 -0
- package/dist/contexts/dispatch-context.d.ts +39 -0
- package/dist/contexts/dispatch-context.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +12 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/mui-pro-context.d.ts +52 -0
- package/dist/contexts/mui-pro-context.d.ts.map +1 -0
- package/dist/contexts/navigation-context.d.ts +113 -0
- package/dist/contexts/navigation-context.d.ts.map +1 -0
- package/dist/contexts/page-context.d.ts +43 -0
- package/dist/contexts/page-context.d.ts.map +1 -0
- package/dist/contexts/refresh-signal-context.d.ts +18 -0
- package/dist/contexts/refresh-signal-context.d.ts.map +1 -0
- package/dist/contexts/runtime-config-context.d.ts +70 -0
- package/dist/contexts/runtime-config-context.d.ts.map +1 -0
- package/dist/contexts/selector-selection-context.d.ts +44 -0
- package/dist/contexts/selector-selection-context.d.ts.map +1 -0
- package/dist/contexts/validation-context.d.ts +57 -0
- package/dist/contexts/validation-context.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-data-selector.d.ts +51 -0
- package/dist/hooks/use-data-selector.d.ts.map +1 -0
- package/dist/hooks/use-debounced-callback.d.ts +36 -0
- package/dist/hooks/use-debounced-callback.d.ts.map +1 -0
- package/dist/hooks/use-edit-mode.d.ts +23 -0
- package/dist/hooks/use-edit-mode.d.ts.map +1 -0
- package/dist/hooks/use-element-disabled.d.ts +16 -0
- package/dist/hooks/use-element-disabled.d.ts.map +1 -0
- package/dist/hooks/use-element-visibility.d.ts +16 -0
- package/dist/hooks/use-element-visibility.d.ts.map +1 -0
- package/dist/hooks/use-validation.d.ts +32 -0
- package/dist/hooks/use-validation.d.ts.map +1 -0
- package/dist/hooks/use-visual-binding.d.ts +38 -0
- package/dist/hooks/use-visual-binding.d.ts.map +1 -0
- package/dist/hooks/use-visual-element.d.ts +13 -0
- package/dist/hooks/use-visual-element.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +764 -0
- package/dist/index.js.map +1 -0
- package/dist/store/data-store.d.ts +168 -0
- package/dist/store/data-store.d.ts.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/selectors.d.ts +58 -0
- package/dist/store/selectors.d.ts.map +1 -0
- package/dist/utils/deep-equal.d.ts +10 -0
- package/dist/utils/deep-equal.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ActionLifecycle, AnyComponentInterceptor, ItemContainerConfig, ColumnCustomizerFn, CustomComponent, CustomizationsConfig, DateValidationProps, GuestPageProps, HeroComponentProps, NavigationItem, PageCustomization, SubThemeHook, TableRowHighlightConfig, VisualPropertySet, PageDefinition, VisualElement } from '@judo/model-api';
|
|
3
|
+
/**
|
|
4
|
+
* @internal Context value for the customizations system.
|
|
5
|
+
*
|
|
6
|
+
* This is a framework-internal contract. Developers access customizations
|
|
7
|
+
* through the generated `createCustomizations()` factory, not this context directly.
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomizationsContextType {
|
|
10
|
+
/** Internal version counter for HMR / change detection */
|
|
11
|
+
version: number;
|
|
12
|
+
/** @internal Get the page customization bundle (keyed by page's xmi:id, resolved from the model element) */
|
|
13
|
+
getPageCustomization(pageSourceId: string): PageCustomization | undefined;
|
|
14
|
+
/** @internal Get the custom component (keyed by element's xmi:id, resolved from the model element) */
|
|
15
|
+
getComponent(elementSourceId: string): CustomComponent | undefined;
|
|
16
|
+
/** Get the component interceptor for an element @type */
|
|
17
|
+
getComponentInterceptor(elementType: string): AnyComponentInterceptor | undefined;
|
|
18
|
+
/** Get the sub-theme provider for a named sub-theme */
|
|
19
|
+
getSubThemeProvider(subThemeName: string): SubThemeHook | undefined;
|
|
20
|
+
/** Get the redirect handler component for the /_redirect route */
|
|
21
|
+
getRedirectHandler(): ComponentType | undefined;
|
|
22
|
+
/** Get custom routes to inject into the router */
|
|
23
|
+
getCustomRoutes(): Array<{
|
|
24
|
+
path: string;
|
|
25
|
+
element: ReactElement;
|
|
26
|
+
}> | undefined;
|
|
27
|
+
/** Get the menu customizer function */
|
|
28
|
+
getMenuCustomizer(): ((items: NavigationItem[]) => NavigationItem[]) | undefined;
|
|
29
|
+
/** Get the footer text (static or dynamic) */
|
|
30
|
+
getFooterText(): string | (() => string) | undefined;
|
|
31
|
+
/** Get the custom hero component for the AppBar */
|
|
32
|
+
getHeroComponent(): ComponentType<HeroComponentProps> | undefined;
|
|
33
|
+
/** Get the settings page component */
|
|
34
|
+
getSettingsPage(): ComponentType | undefined;
|
|
35
|
+
/** Get the custom guest page component (for supportGuestAccess mode) */
|
|
36
|
+
getGuestComponent(): ComponentType<GuestPageProps> | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Hook to access customizations context.
|
|
40
|
+
* @throws Error if used outside CustomizationsProvider
|
|
41
|
+
*/
|
|
42
|
+
export declare function useCustomizations(): CustomizationsContextType;
|
|
43
|
+
/**
|
|
44
|
+
* Hook to access customizations context (optional).
|
|
45
|
+
* Returns null if no CustomizationsProvider is in the tree.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useCustomizationsOptional(): CustomizationsContextType | null;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the custom component for a visual element, if registered.
|
|
50
|
+
*
|
|
51
|
+
* @internal This is a framework-internal hook used by `VisualElementRenderer`.
|
|
52
|
+
* Developers register component overrides via the type-safe `createCustomizations()`
|
|
53
|
+
* factory using human-readable names — never raw sourceIds.
|
|
54
|
+
*
|
|
55
|
+
* @param element - The VisualElement model object (identity resolved from element["xmi:id"])
|
|
56
|
+
* @returns The custom component or null
|
|
57
|
+
*/
|
|
58
|
+
export declare function useComponentOverride(element: VisualElement): CustomComponent | null;
|
|
59
|
+
/**
|
|
60
|
+
* Returns an intercepted component for a visual element based on its @type.
|
|
61
|
+
*
|
|
62
|
+
* @internal This is a framework-internal hook used by `VisualElementRenderer`.
|
|
63
|
+
* Developers register interceptors via the type-safe `createCustomizations()`
|
|
64
|
+
* factory using the `componentInterceptors` property with human-readable @type keys
|
|
65
|
+
* (e.g., 'TextInput', 'Table').
|
|
66
|
+
*
|
|
67
|
+
* Called after `useComponentOverride` (per-element override takes priority over type interceptor).
|
|
68
|
+
*
|
|
69
|
+
* @param element - The VisualElement model object
|
|
70
|
+
* @returns The intercepted custom component or null
|
|
71
|
+
*/
|
|
72
|
+
export declare function useComponentInterceptor(element: VisualElement): CustomComponent | null;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the sub-theme provider hook for an element's `subTheme` property.
|
|
75
|
+
*
|
|
76
|
+
* @internal This is a framework-internal hook used by `SubThemeWrapper`.
|
|
77
|
+
* Developers register sub-theme providers via the type-safe `createCustomizations()`
|
|
78
|
+
* factory using the `subThemeProviders` property with human-readable sub-theme names.
|
|
79
|
+
*
|
|
80
|
+
* @param element - The VisualElement model object (must have `subTheme` property)
|
|
81
|
+
* @returns The SubThemeHook or null if not registered
|
|
82
|
+
*/
|
|
83
|
+
export declare function useSubThemeProvider(element: VisualElement): SubThemeHook | null;
|
|
84
|
+
/**
|
|
85
|
+
* Returns the action lifecycle overrides for a specific action on a page.
|
|
86
|
+
* Used by the action dispatch system to compose overrides with built-in handlers.
|
|
87
|
+
*
|
|
88
|
+
* @param page - The PageDefinition
|
|
89
|
+
* @param action - The Action to check
|
|
90
|
+
* @returns Partial ActionLifecycle or null
|
|
91
|
+
*/
|
|
92
|
+
export declare function usePageActionOverrides(page: PageDefinition | undefined, action: {
|
|
93
|
+
"xmi:id"?: string;
|
|
94
|
+
} | undefined): Partial<ActionLifecycle> | null;
|
|
95
|
+
/**
|
|
96
|
+
* Returns visual property overrides for an element on the current page.
|
|
97
|
+
*
|
|
98
|
+
* @internal This is a framework-internal hook used by `useVisualBinding` and component renderers.
|
|
99
|
+
* Developers provide visual property overrides via the type-safe `createCustomizations()`
|
|
100
|
+
* factory using human-readable element names within page scopes.
|
|
101
|
+
*
|
|
102
|
+
* @param element - The VisualElement model object
|
|
103
|
+
* @returns Partial VisualPropertySet or null
|
|
104
|
+
*/
|
|
105
|
+
export declare function useVisualPropertyOverrides(element: VisualElement): Partial<VisualPropertySet> | null;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the typeahead provider for a text input element on the current page.
|
|
108
|
+
*
|
|
109
|
+
* @internal This is a framework-internal hook called by input renderers.
|
|
110
|
+
* Developers register typeahead providers via the type-safe `createCustomizations()`
|
|
111
|
+
* factory using human-readable element names.
|
|
112
|
+
*
|
|
113
|
+
* @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied)
|
|
114
|
+
* @returns The typeahead provider function, or undefined if not registered
|
|
115
|
+
*/
|
|
116
|
+
export declare function useTypeaheadProvider(elementSourceId: string | undefined): ((text: string) => Promise<string[]>) | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Returns the row highlighting configuration for a table element on the current page.
|
|
119
|
+
*
|
|
120
|
+
* @internal This is a framework-internal hook called by `TableRenderer`.
|
|
121
|
+
* Developers register row highlighting via the type-safe `createCustomizations()`
|
|
122
|
+
* factory using human-readable table element names.
|
|
123
|
+
*
|
|
124
|
+
* @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied)
|
|
125
|
+
* @returns Array of highlight configs, or undefined if not registered
|
|
126
|
+
*/
|
|
127
|
+
export declare function useTableRowHighlighting(elementSourceId: string | undefined): TableRowHighlightConfig[] | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Returns a wrapped enumeration option filter for an enum input element on the current page.
|
|
130
|
+
*
|
|
131
|
+
* @internal This is a framework-internal hook called by `InputRenderer`.
|
|
132
|
+
* Developers register enum filters via the type-safe `createCustomizations()`
|
|
133
|
+
* factory using human-readable element names.
|
|
134
|
+
*
|
|
135
|
+
* @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied)
|
|
136
|
+
* @returns A function that takes options and returns filtered options, or undefined if not registered
|
|
137
|
+
*/
|
|
138
|
+
export declare function useEnumOptionFilter(elementSourceId: string | undefined): ((options: Array<{
|
|
139
|
+
value: string;
|
|
140
|
+
label: string;
|
|
141
|
+
}>) => Array<{
|
|
142
|
+
value: string;
|
|
143
|
+
label: string;
|
|
144
|
+
}>) | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Returns resolved date validation props for a date/datetime input element on the current page.
|
|
147
|
+
*
|
|
148
|
+
* @internal This is a framework-internal hook called by date input renderers.
|
|
149
|
+
* Developers register date validation via the type-safe `createCustomizations()`
|
|
150
|
+
* factory using human-readable element names.
|
|
151
|
+
*
|
|
152
|
+
* @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied)
|
|
153
|
+
* @returns Resolved date validation props, or undefined if not registered
|
|
154
|
+
*/
|
|
155
|
+
export declare function useDateValidationProps(elementSourceId: string | undefined): DateValidationProps | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Returns all column customizer functions for the current page.
|
|
158
|
+
*
|
|
159
|
+
* @internal This is a framework-internal hook called by `TableRenderer`.
|
|
160
|
+
* Developers register column customizers via the type-safe `createCustomizations()`
|
|
161
|
+
* factory using human-readable column element names.
|
|
162
|
+
*
|
|
163
|
+
* @returns Record of column xmi:id → customizer function, or undefined if not registered
|
|
164
|
+
*/
|
|
165
|
+
export declare function useColumnCustomizers(): Record<string, ColumnCustomizerFn> | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Returns the item container configuration for a specific table element.
|
|
168
|
+
*
|
|
169
|
+
* @internal This is a framework-internal hook called by `TableRenderer`.
|
|
170
|
+
* Developers register item container configs via the type-safe `createCustomizations()`
|
|
171
|
+
* factory using human-readable table element names.
|
|
172
|
+
*
|
|
173
|
+
* @param elementSourceId - The element's xmi:id (resolved from the model object, not developer-supplied)
|
|
174
|
+
* @returns Item container config or undefined if not registered
|
|
175
|
+
*/
|
|
176
|
+
export declare function useItemContainerConfig(elementSourceId: string | undefined): ItemContainerConfig | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* @internal Hook to get the resolved action overrides for the current page.
|
|
179
|
+
* Returns all action overrides keyed by action xmi:id.
|
|
180
|
+
*/
|
|
181
|
+
export declare function useResolvedPageActionOverrides(): Record<string, Partial<ActionLifecycle>> | null;
|
|
182
|
+
/**
|
|
183
|
+
* @internal Get lifecycle overrides for a specific action.
|
|
184
|
+
* The actionSourceId is the action's xmi:id, resolved from the Action model object
|
|
185
|
+
* (not developer-supplied).
|
|
186
|
+
*/
|
|
187
|
+
export declare function useActionLifecycleOverrides(actionSourceId: string | undefined): Partial<ActionLifecycle> | null;
|
|
188
|
+
/**
|
|
189
|
+
* Provider that calls the registered page action hook and provides
|
|
190
|
+
* the resolved overrides to descendants.
|
|
191
|
+
* Must be rendered inside PageProvider.
|
|
192
|
+
*/
|
|
193
|
+
export declare function PageActionOverridesProvider({ children }: {
|
|
194
|
+
children: ReactNode;
|
|
195
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
196
|
+
/**
|
|
197
|
+
* Provider that calls the registered visual properties hook and provides
|
|
198
|
+
* the resolved overrides to descendants.
|
|
199
|
+
* Must be rendered inside PageProvider.
|
|
200
|
+
*/
|
|
201
|
+
export declare function VisualPropertiesProvider({ children }: {
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
204
|
+
/**
|
|
205
|
+
* Props for CustomizationsProvider.
|
|
206
|
+
*/
|
|
207
|
+
export interface CustomizationsProviderProps {
|
|
208
|
+
children: ReactNode;
|
|
209
|
+
/** The customizations config (from createCustomizations() or manually built) */
|
|
210
|
+
customizations?: CustomizationsConfig | null;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Provider for the customizations system.
|
|
214
|
+
*
|
|
215
|
+
* Stores the config in a ref and uses a version counter for HMR support.
|
|
216
|
+
* When the customizations object identity changes (e.g., during HMR),
|
|
217
|
+
* the version bumps and all consumers re-render with new values.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```tsx
|
|
221
|
+
* <CustomizationsProvider customizations={myCustomizations}>
|
|
222
|
+
* <JudoRuntime modelSource="/models/app.model" />
|
|
223
|
+
* </CustomizationsProvider>
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export declare function CustomizationsProvider({ children, customizations }: CustomizationsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
227
|
+
//# sourceMappingURL=customizations-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customizations-context.d.ts","sourceRoot":"","sources":["../../src/contexts/customizations-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACX,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EAEvB,iBAAiB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACN,KAAK,SAAS,EASd,MAAM,OAAO,CAAC;AASf;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACzC,0DAA0D;IAC1D,OAA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AI,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,SAAS,CASrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,GAAG,SAAS,CAS3G;AAYD;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG,IAAI,CAEhG;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAI/G;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAYhF;AAQD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAW7E;AAMD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,gFAAgF;IAChF,cAAc,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,2BAA2B,2CAgC/F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DataStore } from '../store';
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access the data store.
|
|
5
|
+
*
|
|
6
|
+
* @returns DataStore instance
|
|
7
|
+
* @throws Error if used outside DataProvider
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDataStore(): DataStore;
|
|
10
|
+
/**
|
|
11
|
+
* Hook to access the data store (optional).
|
|
12
|
+
* Returns null if not within provider instead of throwing.
|
|
13
|
+
*
|
|
14
|
+
* @returns DataStore instance or null
|
|
15
|
+
*/
|
|
16
|
+
export declare function useDataStoreOptional(): DataStore | null;
|
|
17
|
+
/**
|
|
18
|
+
* Props for DataProvider.
|
|
19
|
+
*/
|
|
20
|
+
export interface DataProviderProps {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** Optional initial store (for testing) */
|
|
23
|
+
store?: DataStore;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Provider for data context.
|
|
27
|
+
* Creates a DataStore instance that persists for the lifetime of the provider.
|
|
28
|
+
*/
|
|
29
|
+
export declare function DataProvider({ children, store: initialStore }: DataProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=data-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-context.d.ts","sourceRoot":"","sources":["../../src/contexts/data-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAMxC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,SAAS,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,iBAAiB,2CAIhF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '@judo/actions';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Dispatch function type for actions.
|
|
5
|
+
*/
|
|
6
|
+
export type DispatchFn = (action: Action) => Promise<unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Dispatch context type.
|
|
9
|
+
*/
|
|
10
|
+
export interface DispatchContextType {
|
|
11
|
+
/** Dispatch an action */
|
|
12
|
+
dispatch: DispatchFn;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Hook to access dispatch context.
|
|
16
|
+
*
|
|
17
|
+
* @returns DispatchContextType
|
|
18
|
+
* @throws Error if used outside DispatchProvider
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDispatch(): DispatchContextType;
|
|
21
|
+
/**
|
|
22
|
+
* Hook to access dispatch context (optional).
|
|
23
|
+
*
|
|
24
|
+
* @returns DispatchContextType | null
|
|
25
|
+
*/
|
|
26
|
+
export declare function useDispatchOptional(): DispatchContextType | null;
|
|
27
|
+
/**
|
|
28
|
+
* Props for DispatchProvider.
|
|
29
|
+
*/
|
|
30
|
+
export interface DispatchProviderProps {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
dispatch: DispatchFn;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Provider for dispatch context.
|
|
36
|
+
* Provides the dispatch function to all child components.
|
|
37
|
+
*/
|
|
38
|
+
export declare function DispatchProvider({ children, dispatch }: DispatchProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=dispatch-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-context.d.ts","sourceRoot":"","sources":["../../src/contexts/dispatch-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,yBAAyB;IACzB,QAAQ,EAAE,UAAU,CAAC;CACrB;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,mBAAmB,CAMjD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,mBAAmB,GAAG,IAAI,CAEhE;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAI7E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ApplicationProvider, useApplication, useApplicationOptional, type ApplicationContextType, type ApplicationProviderProps, } from './application-context';
|
|
2
|
+
export { NavigationProvider, useNavigation, useNavigationOptional, type NavigationContextType, type NavigationProviderProps, type NavigationState, type PageStackEntry, type DialogState, type DialogCloseResult, type DialogCloseResultType, type DialogCloseCallback, } from './navigation-context';
|
|
3
|
+
export { DataProvider, useDataStore, useDataStoreOptional, type DataProviderProps } from './data-context';
|
|
4
|
+
export { ValidationProvider, useValidationContext, useValidationContextOptional, type ValidationContextType, type ValidationProviderProps, type ValidationState, } from './validation-context';
|
|
5
|
+
export { PageProvider, usePageContext, usePageContextOptional, type PageContextType, type PageProviderProps, } from './page-context';
|
|
6
|
+
export { RuntimeConfigProvider, useRuntimeConfig, useRuntimeConfigOptional, type RuntimeConfigContextType, type RuntimeConfigProviderProps, type RuntimeConfig, type FeaturesConfig, } from './runtime-config-context';
|
|
7
|
+
export { DispatchProvider, useDispatch, useDispatchOptional, type DispatchContextType, type DispatchProviderProps, type DispatchFn, } from './dispatch-context';
|
|
8
|
+
export { CustomizationsProvider, useCustomizations, useCustomizationsOptional, useComponentOverride, useComponentInterceptor, useSubThemeProvider, usePageActionOverrides, useVisualPropertyOverrides, useResolvedPageActionOverrides, useActionLifecycleOverrides, useTypeaheadProvider, useTableRowHighlighting, useEnumOptionFilter, useDateValidationProps, useColumnCustomizers, useItemContainerConfig, PageActionOverridesProvider, VisualPropertiesProvider, type CustomizationsContextType, type CustomizationsProviderProps, } from './customizations-context';
|
|
9
|
+
export { SelectorSelectionProvider, useSelectorSelection, useSelectorSelectionOptional, type SelectorSelectionContextType, type SelectorSelectionProviderProps, } from './selector-selection-context';
|
|
10
|
+
export { MuiProProvider, useMuiPro, useMuiProOptional, type MuiProContextType, type MuiProProviderProps, } from './mui-pro-context';
|
|
11
|
+
export { RefreshSignalProvider, useRefreshSignal, type RefreshSignalProviderProps } from './refresh-signal-context';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,cAAc,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,GACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* MUI Pro components context.
|
|
4
|
+
*
|
|
5
|
+
* When MUI X Pro is available (license key set + pro packages installed),
|
|
6
|
+
* components can retrieve upgraded Pro variants (e.g., DataGridPro instead of DataGrid)
|
|
7
|
+
* via the `getComponent` helper.
|
|
8
|
+
*/
|
|
9
|
+
export interface MuiProContextType {
|
|
10
|
+
/** Whether MUI Pro features are enabled (license key present and activated). */
|
|
11
|
+
isProEnabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve a MUI Pro component by name.
|
|
14
|
+
* Returns `null` if Pro is not enabled or the component was not registered.
|
|
15
|
+
*
|
|
16
|
+
* Known component names:
|
|
17
|
+
* - `"DataGrid"` → `DataGridPro` from `@mui/x-data-grid-pro`
|
|
18
|
+
*/
|
|
19
|
+
getComponent: (name: string) => ComponentType<any> | null;
|
|
20
|
+
}
|
|
21
|
+
export interface MuiProProviderProps {
|
|
22
|
+
/** Whether MUI Pro is enabled. */
|
|
23
|
+
isProEnabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Map of Pro component names to actual component references.
|
|
26
|
+
* Populated during app initialization via dynamic import.
|
|
27
|
+
*
|
|
28
|
+
* Example: `{ DataGrid: DataGridPro }`
|
|
29
|
+
*/
|
|
30
|
+
components?: Record<string, ComponentType<any>>;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Provider for MUI Pro components.
|
|
35
|
+
*
|
|
36
|
+
* Typically wrapped around the application by JudoRuntime when a `muiProLicenseKey`
|
|
37
|
+
* is configured. Components use `useMuiPro()` / `useMuiProOptional()` to access
|
|
38
|
+
* Pro-upgraded components.
|
|
39
|
+
*/
|
|
40
|
+
export declare function MuiProProvider({ isProEnabled, components, children }: MuiProProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
/**
|
|
42
|
+
* Hook to access MUI Pro context.
|
|
43
|
+
* Throws if used outside MuiProProvider.
|
|
44
|
+
*/
|
|
45
|
+
export declare function useMuiPro(): MuiProContextType;
|
|
46
|
+
/**
|
|
47
|
+
* Hook to access MUI Pro context (optional).
|
|
48
|
+
* Returns `null` if used outside MuiProProvider.
|
|
49
|
+
* Preferred in library components that should work with or without Pro.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useMuiProOptional(): MuiProContextType | null;
|
|
52
|
+
//# sourceMappingURL=mui-pro-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mui-pro-context.d.ts","sourceRoot":"","sources":["../../src/contexts/mui-pro-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAmD,MAAM,OAAO,CAAC;AAE5G;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC,gFAAgF;IAChF,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CAC1D;AAID,MAAM,WAAW,mBAAmB;IACnC,kCAAkC;IAClC,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,UAAe,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAY9F;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,iBAAiB,CAM7C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,GAAG,IAAI,CAE5D"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { PageDefinition, DialogSize } from '@judo/model-api';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Page stack entry.
|
|
5
|
+
*/
|
|
6
|
+
export interface PageStackEntry {
|
|
7
|
+
pageDefinition: PageDefinition;
|
|
8
|
+
params?: Record<string, unknown>;
|
|
9
|
+
scrollPosition?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Dialog close result types.
|
|
13
|
+
*/
|
|
14
|
+
export type DialogCloseResultType = "cancelled" | "created" | "updated" | "deleted" | "selected" | "submitted";
|
|
15
|
+
/**
|
|
16
|
+
* Result returned when dialog closes.
|
|
17
|
+
* Uses discriminated union for type-safe handling of different outcomes.
|
|
18
|
+
*/
|
|
19
|
+
export type DialogCloseResult = {
|
|
20
|
+
type: "cancelled";
|
|
21
|
+
} | {
|
|
22
|
+
type: "created";
|
|
23
|
+
isEager: boolean;
|
|
24
|
+
data?: unknown;
|
|
25
|
+
} | {
|
|
26
|
+
type: "updated";
|
|
27
|
+
data?: unknown;
|
|
28
|
+
} | {
|
|
29
|
+
type: "deleted";
|
|
30
|
+
data?: unknown;
|
|
31
|
+
} | {
|
|
32
|
+
type: "selected";
|
|
33
|
+
data?: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
type: "submitted";
|
|
36
|
+
data?: unknown;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Dialog state.
|
|
40
|
+
*/
|
|
41
|
+
export interface DialogState {
|
|
42
|
+
pageDefinition: PageDefinition;
|
|
43
|
+
size: DialogSize;
|
|
44
|
+
params?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Navigation state.
|
|
48
|
+
*/
|
|
49
|
+
export interface NavigationState {
|
|
50
|
+
/** Current page stack (for back navigation) */
|
|
51
|
+
pageStack: PageStackEntry[];
|
|
52
|
+
/** Current page definition */
|
|
53
|
+
currentPage: PageDefinition | null;
|
|
54
|
+
/** Dialog stack — supports nested dialogs. Top of stack is the active dialog. */
|
|
55
|
+
dialogStack: DialogState[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Callback invoked when dialog closes.
|
|
59
|
+
*/
|
|
60
|
+
export type DialogCloseCallback = (result?: DialogCloseResult) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Navigation context type.
|
|
63
|
+
*/
|
|
64
|
+
export interface NavigationContextType extends NavigationState {
|
|
65
|
+
/** Top dialog (convenience — same as dialogStack[dialogStack.length - 1] or null) */
|
|
66
|
+
dialog: DialogState | null;
|
|
67
|
+
/** Navigate to page */
|
|
68
|
+
navigateTo: (page: PageDefinition, params?: Record<string, unknown>) => void;
|
|
69
|
+
/** Navigate back */
|
|
70
|
+
goBack: () => void;
|
|
71
|
+
/** Open page in dialog with optional onClose callback */
|
|
72
|
+
openDialog: (page: PageDefinition, params?: Record<string, unknown>, onClose?: DialogCloseCallback) => void;
|
|
73
|
+
/** Close current dialog with optional result */
|
|
74
|
+
closeDialog: (result?: DialogCloseResult) => void;
|
|
75
|
+
/** Replace current page (no stack) */
|
|
76
|
+
replacePage: (page: PageDefinition, params?: Record<string, unknown>) => void;
|
|
77
|
+
/** Clear navigation stack */
|
|
78
|
+
clearStack: () => void;
|
|
79
|
+
/** Check if can go back */
|
|
80
|
+
canGoBack: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Hook to access navigation context.
|
|
84
|
+
*
|
|
85
|
+
* @returns NavigationContextType
|
|
86
|
+
* @throws Error if used outside NavigationProvider
|
|
87
|
+
*/
|
|
88
|
+
export declare function useNavigation(): NavigationContextType;
|
|
89
|
+
/**
|
|
90
|
+
* Hook to access navigation context (optional).
|
|
91
|
+
*
|
|
92
|
+
* @returns NavigationContextType | null
|
|
93
|
+
*/
|
|
94
|
+
export declare function useNavigationOptional(): NavigationContextType | null;
|
|
95
|
+
/**
|
|
96
|
+
* Props for NavigationProvider.
|
|
97
|
+
*/
|
|
98
|
+
export interface NavigationProviderProps {
|
|
99
|
+
children: ReactNode;
|
|
100
|
+
/** Initial page (optional) */
|
|
101
|
+
initialPage?: PageDefinition;
|
|
102
|
+
/** Optional navigate function for React Router integration */
|
|
103
|
+
navigate?: (path: string, options?: {
|
|
104
|
+
state?: unknown;
|
|
105
|
+
}) => void;
|
|
106
|
+
/** Optional function to get route path for a page */
|
|
107
|
+
getRouteForPage?: (page: PageDefinition) => string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Provider for navigation context.
|
|
111
|
+
*/
|
|
112
|
+
export declare function NavigationProvider({ children, initialPage, navigate, getRouteForPage }: NavigationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
//# sourceMappingURL=navigation-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../../src/contexts/navigation-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,SAAS,EAA4D,MAAM,OAAO,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAE/G;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAC1B;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,cAAc,EAA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B,aAAa,IAAI,qBAAqB,CAMrD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,qBAAqB,GAAG,IAAI,CAEpE;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACjE,qDAAqD;IACrD,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,MAAM,CAAC;CACnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,uBAAuB,2CA8J/G"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PageDefinition } from '@judo/model-api';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Page context type.
|
|
5
|
+
*/
|
|
6
|
+
export interface PageContextType {
|
|
7
|
+
/** Current page definition */
|
|
8
|
+
pageDefinition: PageDefinition;
|
|
9
|
+
/** Transfer ID for this page (if applicable) */
|
|
10
|
+
transferId: string | null;
|
|
11
|
+
/** Page parameters */
|
|
12
|
+
params: Record<string, unknown>;
|
|
13
|
+
/** Whether page is in a dialog */
|
|
14
|
+
isDialog: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hook to access page context.
|
|
18
|
+
*
|
|
19
|
+
* @returns PageContextType
|
|
20
|
+
* @throws Error if used outside PageProvider
|
|
21
|
+
*/
|
|
22
|
+
export declare function usePageContext(): PageContextType;
|
|
23
|
+
/**
|
|
24
|
+
* Hook to access page context (optional).
|
|
25
|
+
*
|
|
26
|
+
* @returns PageContextType | null
|
|
27
|
+
*/
|
|
28
|
+
export declare function usePageContextOptional(): PageContextType | null;
|
|
29
|
+
/**
|
|
30
|
+
* Props for PageProvider.
|
|
31
|
+
*/
|
|
32
|
+
export interface PageProviderProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
pageDefinition: PageDefinition;
|
|
35
|
+
transferId?: string | null;
|
|
36
|
+
params?: Record<string, unknown>;
|
|
37
|
+
isDialog?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Provider for page context.
|
|
41
|
+
*/
|
|
42
|
+
export declare function PageProvider({ children, pageDefinition, transferId, params, isDialog, }: PageProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=page-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-context.d.ts","sourceRoot":"","sources":["../../src/contexts/page-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,8BAA8B;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,gDAAgD;IAChD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;CAClB;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,eAAe,CAMhD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,GAAG,IAAI,CAE/D;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,UAAiB,EACjB,MAAW,EACX,QAAgB,GAChB,EAAE,iBAAiB,2CASnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Read the current refresh signal value.
|
|
4
|
+
* Returns 0 when used outside a RefreshSignalProvider.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useRefreshSignal(): number;
|
|
7
|
+
export interface RefreshSignalProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** Current refresh signal value (managed by parent container). */
|
|
10
|
+
signal: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Provides a refresh signal to descendant components.
|
|
14
|
+
* The parent container owns the state and increments `signal` when a
|
|
15
|
+
* page-wide refresh is needed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RefreshSignalProvider({ children, signal }: RefreshSignalProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=refresh-signal-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-signal-context.d.ts","sourceRoot":"","sources":["../../src/contexts/refresh-signal-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAclE;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,0BAA0B,2CAErF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Feature toggles configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface FeaturesConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Enable navigation guards (unsaved changes, session timeout).
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
guards?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Force showTotalCount for all lazy (non-eager) tables.
|
|
13
|
+
* When enabled, all lazy tables will request total row count from backend,
|
|
14
|
+
* overriding individual table's showTotalCount setting.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
forceShowTotalCountForLazyTables?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Enable inline header filters in DataGrid tables.
|
|
20
|
+
* Requires MUI X Pro license (`muiProLicenseKey` must be set).
|
|
21
|
+
* When enabled, each column header shows an inline filter input,
|
|
22
|
+
* replacing the standalone filter panel for a more streamlined UX.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
headerFilters?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Runtime configuration available to components.
|
|
29
|
+
*/
|
|
30
|
+
export interface RuntimeConfig {
|
|
31
|
+
features?: FeaturesConfig;
|
|
32
|
+
/**
|
|
33
|
+
* UI density level from theme configuration.
|
|
34
|
+
* @default 'compact'
|
|
35
|
+
*/
|
|
36
|
+
density?: "compact" | "comfortable" | "standard";
|
|
37
|
+
/**
|
|
38
|
+
* MUI X Pro license key.
|
|
39
|
+
* When set, the runtime will activate MUI Pro and automatically wire in
|
|
40
|
+
* Pro variants of MUI X components (DataGridPro, DatePickerPro, etc.).
|
|
41
|
+
* Requires `@mui/x-data-grid-pro` (and/or other Pro packages) to be installed.
|
|
42
|
+
*/
|
|
43
|
+
muiProLicenseKey?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* RuntimeConfig context provides access to runtime feature flags.
|
|
47
|
+
*/
|
|
48
|
+
export interface RuntimeConfigContextType {
|
|
49
|
+
config: RuntimeConfig;
|
|
50
|
+
}
|
|
51
|
+
export interface RuntimeConfigProviderProps {
|
|
52
|
+
config?: RuntimeConfig;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Provider for runtime configuration.
|
|
57
|
+
* Typically wraps the app at a high level (e.g., in JudoRuntime).
|
|
58
|
+
*/
|
|
59
|
+
export declare function RuntimeConfigProvider({ config, children }: RuntimeConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* Hook to access runtime configuration.
|
|
62
|
+
* Throws if used outside RuntimeConfigProvider.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useRuntimeConfig(): RuntimeConfigContextType;
|
|
65
|
+
/**
|
|
66
|
+
* Hook to access runtime configuration (optional).
|
|
67
|
+
* Returns null if used outside RuntimeConfigProvider.
|
|
68
|
+
*/
|
|
69
|
+
export declare function useRuntimeConfigOptional(): RuntimeConfigContextType | null;
|
|
70
|
+
//# sourceMappingURL=runtime-config-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-config-context.d.ts","sourceRoot":"","sources":["../../src/contexts/runtime-config-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAE3C;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;IACjD;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,aAAa,CAAC;CACtB;AAID,MAAM,WAAW,0BAA0B;IAC1C,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,MAAW,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CAE1F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,wBAAwB,CAM3D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,wBAAwB,GAAG,IAAI,CAE1E"}
|