@tempots/beatui 0.68.0 → 0.71.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/dist/{ar-aMLQTGVh.js → ar-BbgpGwJp.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +106 -105
- package/dist/beatui.css +401 -0
- package/dist/beatui.tailwind.css +401 -0
- package/dist/{de-DBFOC44R.js → de-R7lPfyZ4.js} +1 -1
- package/dist/deep-merge-CQQCMLwG.js +1636 -0
- package/dist/deep-merge-DZxfgKqX.cjs +1 -0
- package/dist/duration-input-D-SIoDoo.cjs +1 -0
- package/dist/duration-input-DKxZ6OCa.js +277 -0
- package/dist/{es-C4xOThaT.js → es-DV0Jr_BZ.js} +1 -1
- package/dist/{fa-B7X_xydY.js → fa-DXvHejs9.js} +1 -1
- package/dist/{fr-AmjzbxN_.js → fr-D8FOMX0o.js} +1 -1
- package/dist/{he-DY-9yiOC.js → he-B19Qsx-u.js} +1 -1
- package/dist/{hi-Clkyp5Fu.js → hi-DozFnE3b.js} +1 -1
- package/dist/{index-GLoRnI6r.js → index-CYb1YxDX.js} +1 -1
- package/dist/{index-CzuXAuLZ.js → index-DdpYvBeh.js} +3 -3
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2830 -3079
- package/dist/{it-BC32WmGF.js → it-But8uzNi.js} +1 -1
- package/dist/{ja-JNSZS_Hv.js → ja-DkwTnFdU.js} +1 -1
- package/dist/json-schema/index.cjs.js +6 -6
- package/dist/json-schema/index.es.js +3459 -3333
- package/dist/json-structure/index.cjs.js +1 -0
- package/dist/json-structure/index.es.js +3157 -0
- package/dist/{ko-B8l0TJp0.js → ko-Cqv-IjhX.js} +1 -1
- package/dist/modal-5P9mU_a4.cjs +1 -0
- package/dist/{modal-DJWj5M5e.js → modal-MofsfmAe.js} +2 -2
- package/dist/{nl-BpYESHP8.js → nl-YSiU3rFI.js} +1 -1
- package/dist/notice-Cqq8g17n.js +209 -0
- package/dist/notice-DP209Ed8.cjs +1 -0
- package/dist/{pl-_sWhGdrs.js → pl-DXmHc2Nh.js} +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-BmiQvHUz.js → pt-Bf3z_-26.js} +1 -1
- package/dist/{ru-DacnqexG.js → ru-Sy00qUeG.js} +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -0
- package/dist/{toolbar-Bk5-22ln.js → toolbar-C_Ec0_XC.js} +1 -1
- package/dist/{tr-BSS5b_v6.js → tr-BDxG3qd6.js} +1 -1
- package/dist/{translations-zGwuSQWQ.js → translations-BmsRhth7.js} +1 -1
- package/dist/{translations-BUTBIDsS.js → translations-DQxouiBG.js} +24 -24
- package/dist/types/components/form/index.d.ts +1 -0
- package/dist/types/components/form/utils/deep-merge.d.ts +27 -0
- package/dist/types/components/form/utils/index.d.ts +1 -0
- package/dist/types/components/json-schema/controls/generic-control.d.ts +2 -1
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +17 -1
- package/dist/types/components/json-schema/index.d.ts +2 -0
- package/dist/types/components/json-schema/json-schema-form.d.ts +25 -3
- package/dist/types/components/json-schema/schema-context.d.ts +3 -0
- package/dist/types/components/json-schema/schema-defaults.d.ts +39 -0
- package/dist/types/components/json-schema/widgets/widget-customization.d.ts +55 -0
- package/dist/types/components/json-structure/controls/any-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/array-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/binary-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/boolean-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/choice-control.d.ts +19 -0
- package/dist/types/components/json-structure/controls/decimal-control.d.ts +17 -0
- package/dist/types/components/json-structure/controls/deprecation-utils.d.ts +14 -0
- package/dist/types/components/json-structure/controls/enum-const-controls.d.ts +22 -0
- package/dist/types/components/json-structure/controls/generic-control.d.ts +31 -0
- package/dist/types/components/json-structure/controls/index.d.ts +21 -0
- package/dist/types/components/json-structure/controls/integer-control.d.ts +18 -0
- package/dist/types/components/json-structure/controls/map-control.d.ts +17 -0
- package/dist/types/components/json-structure/controls/object-control.d.ts +17 -0
- package/dist/types/components/json-structure/controls/set-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/string-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/temporal-control.d.ts +18 -0
- package/dist/types/components/json-structure/controls/tuple-control.d.ts +19 -0
- package/dist/types/components/json-structure/controls/union-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/uri-control.d.ts +15 -0
- package/dist/types/components/json-structure/controls/uuid-control.d.ts +15 -0
- package/dist/types/components/json-structure/extends-utils.d.ts +36 -0
- package/dist/types/components/json-structure/index.d.ts +25 -0
- package/dist/types/components/json-structure/json-structure-form.d.ts +96 -0
- package/dist/types/components/json-structure/ref-utils.d.ts +55 -0
- package/dist/types/components/json-structure/structure-context.d.ts +176 -0
- package/dist/types/components/json-structure/structure-defaults.d.ts +46 -0
- package/dist/types/components/json-structure/structure-types.d.ts +173 -0
- package/dist/types/components/json-structure/validation/error-transform.d.ts +56 -0
- package/dist/types/components/json-structure/validation/index.d.ts +5 -0
- package/dist/types/components/json-structure/validation/sdk-validator.d.ts +46 -0
- package/dist/types/components/json-structure/widgets/default-widgets.d.ts +27 -0
- package/dist/types/components/json-structure/widgets/index.d.ts +6 -0
- package/dist/types/components/json-structure/widgets/widget-registry.d.ts +143 -0
- package/dist/types/components/json-structure/widgets/widget-utils.d.ts +79 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/json-structure/index.d.ts +9 -0
- package/dist/{ur-C6Ky6OCl.js → ur-55zdT2TQ.js} +1 -1
- package/dist/{notice-Um1LwKBF.js → use-form-B7A865EM.js} +329 -532
- package/dist/use-form-DVJXMMoN.cjs +2 -0
- package/dist/{vi-Bx2gx2S0.js → vi-C7K7W0hM.js} +1 -1
- package/dist/widget-customization-29Hl2gKT.js +1171 -0
- package/dist/widget-customization-BXiewbt-.cjs +1 -0
- package/dist/{zh-eixtg-Ce.js → zh-DvJBV9D8.js} +1 -1
- package/package.json +10 -2
- package/dist/modal-D_paG9Sr.cjs +0 -1
- package/dist/notice-CgT9ma2m.cjs +0 -2
- package/dist/utils-7JQljUYX.js +0 -2554
- package/dist/utils-CPtkOy9f.cjs +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widget Resolution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for resolving and configuring widgets based on structure context.
|
|
5
|
+
*/
|
|
6
|
+
import type { StructureContext } from '../structure-context';
|
|
7
|
+
import type { WidgetRegistry, ResolvedWidget } from './widget-registry';
|
|
8
|
+
/**
|
|
9
|
+
* Options extracted from widget configuration
|
|
10
|
+
*/
|
|
11
|
+
export interface WidgetOptions {
|
|
12
|
+
/** Widget-specific options from definition */
|
|
13
|
+
options?: Record<string, unknown>;
|
|
14
|
+
/** Priority override */
|
|
15
|
+
priority?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the best widget for a given context
|
|
19
|
+
*
|
|
20
|
+
* Resolution order:
|
|
21
|
+
* 1. Form-scoped registry (if provided in context)
|
|
22
|
+
* 2. Global registry
|
|
23
|
+
* 3. Returns null if no matching widget found
|
|
24
|
+
*
|
|
25
|
+
* @param ctx - Structure context containing type information
|
|
26
|
+
* @param registry - Optional form-scoped registry (overrides global)
|
|
27
|
+
* @returns Resolved widget or null if no match
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveWidget(ctx: StructureContext, registry?: WidgetRegistry): ResolvedWidget | null;
|
|
30
|
+
/**
|
|
31
|
+
* Extract widget options from context definition
|
|
32
|
+
*
|
|
33
|
+
* Looks for widget configuration in:
|
|
34
|
+
* - `x:ui` extension field
|
|
35
|
+
* - `widget` field (legacy)
|
|
36
|
+
* - Direct widget options
|
|
37
|
+
*
|
|
38
|
+
* @param ctx - Structure context
|
|
39
|
+
* @returns Widget options if found
|
|
40
|
+
*/
|
|
41
|
+
export declare function getWidgetOptions(ctx: StructureContext): WidgetOptions | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Get widget name from explicit definition override
|
|
44
|
+
*
|
|
45
|
+
* Checks for explicit widget name in:
|
|
46
|
+
* - `x:ui.widget` (if string)
|
|
47
|
+
* - `widget.type` (legacy)
|
|
48
|
+
*
|
|
49
|
+
* @param ctx - Structure context
|
|
50
|
+
* @returns Explicit widget name or undefined
|
|
51
|
+
*/
|
|
52
|
+
export declare function getExplicitWidgetName(ctx: StructureContext): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Check if a context has a custom widget override
|
|
55
|
+
*
|
|
56
|
+
* @param ctx - Structure context
|
|
57
|
+
* @returns True if an explicit widget is specified
|
|
58
|
+
*/
|
|
59
|
+
export declare function hasCustomWidget(ctx: StructureContext): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve widget with explicit name override
|
|
62
|
+
*
|
|
63
|
+
* If the context specifies an explicit widget name, tries to resolve
|
|
64
|
+
* that widget directly. Otherwise, falls back to automatic resolution.
|
|
65
|
+
*
|
|
66
|
+
* @param ctx - Structure context
|
|
67
|
+
* @param registry - Optional form-scoped registry
|
|
68
|
+
* @returns Resolved widget or null
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveWidgetWithOverride(ctx: StructureContext, registry?: WidgetRegistry): ResolvedWidget | null;
|
|
71
|
+
/**
|
|
72
|
+
* Merge widget options from multiple sources
|
|
73
|
+
*
|
|
74
|
+
* @param baseOptions - Base options from widget registration
|
|
75
|
+
* @param contextOptions - Options from context definition
|
|
76
|
+
* @param userOptions - User-provided options
|
|
77
|
+
* @returns Merged options (user > context > base)
|
|
78
|
+
*/
|
|
79
|
+
export declare function mergeWidgetOptions(baseOptions?: Record<string, unknown>, contextOptions?: Record<string, unknown>, userOptions?: Record<string, unknown>): Record<string, unknown>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,3 +18,4 @@ export * from './tokens';
|
|
|
18
18
|
export * from './tailwind';
|
|
19
19
|
export * from './utils';
|
|
20
20
|
export * from './temporal';
|
|
21
|
+
export { type CustomWidgets, type CustomWidgetRegistration, type WidgetFactory, forXUI, forFormat, forTypeAndFormat, } from './components/json-schema/widgets/widget-customization';
|