@tempots/beatui 0.73.0 → 0.75.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.
@@ -1,5 +1,5 @@
1
- import { U as sn, V as ye, B as Gs, o as ze, m as br, p as Xs, C as Zs, t as xs, l as Ys, j as Qs, N as ei, k as ti, s as ri, r as ni, q as ai, R as si, S as ii, E as rs, W as oi, u as ci, X as ui } from "../widget-customization-29Hl2gKT.js";
2
- import { c as gf, d as vf, f as $f } from "../widget-customization-29Hl2gKT.js";
1
+ import { U as sn, V as ye, B as Gs, o as ze, m as br, p as Xs, C as Zs, t as xs, l as Ys, j as Qs, N as ei, k as ti, s as ri, r as ni, q as ai, R as si, S as ii, E as rs, W as oi, u as ci, X as ui } from "../widget-customization-CobH7Rj_.js";
2
+ import { Y as gf, c as vf, d as $f, f as bf } from "../widget-customization-CobH7Rj_.js";
3
3
  import { g as dr } from "../_commonjsHelpers-C6fGbg64.js";
4
4
  import { a as Ee, S as me, I as nt, c as te, j as _r, b as on, L as We, M as li, C as ns, g as di, A as fi, h as mi } from "../use-form-B7A865EM.js";
5
5
  import { _ as Kr, g as pi, S as hi, f as yi, N as as, l as de, W as gi, e as vi, t as Xe, T as $i, U as bi, b as Mr, c as _i, M as st, h as wi, G as Si, L as Pi, i as ji, j as Ei } from "../deep-merge-CQQCMLwG.js";
@@ -8821,16 +8821,18 @@ function Hd(e, t) {
8821
8821
  }
8822
8822
  function Gd(e) {
8823
8823
  const t = new ui();
8824
- for (const r of e)
8825
- t.register(r.name, {
8826
- factory: r.factory,
8827
- displayName: r.displayName || r.name,
8828
- description: r.description,
8829
- supportedTypes: r.supportedTypes,
8830
- priority: r.priority ?? 50,
8824
+ for (let r = 0; r < e.length; r++) {
8825
+ const n = e[r], s = n.displayName ?? `custom-widget-${r}`;
8826
+ t.register(s, {
8827
+ factory: n.factory,
8828
+ displayName: n.displayName ?? `Custom Widget ${r + 1}`,
8829
+ description: n.description,
8830
+ supportedTypes: n.supportedTypes,
8831
+ priority: n.priority ?? 50,
8831
8832
  canFallback: !0,
8832
- matcher: r.matcher
8833
+ matcher: n.matcher
8833
8834
  });
8835
+ }
8834
8836
  return t;
8835
8837
  }
8836
8838
  function mf({
@@ -8978,12 +8980,13 @@ export {
8978
8980
  Yr as compileWithCache,
8979
8981
  Dl as composeEffectiveObjectSchema,
8980
8982
  pf as createAJVStandardSchema,
8983
+ gf as createDiagnosticWidget,
8981
8984
  Is as evaluateIfThenElseOverlay,
8982
8985
  Ml as evaluateNotViolation,
8983
8986
  Be as extractSchemaDefaults,
8984
- gf as forFormat,
8985
- vf as forTypeAndFormat,
8986
- $f as forXUI,
8987
+ vf as forFormat,
8988
+ $f as forTypeAndFormat,
8989
+ bf as forXUI,
8987
8990
  Ol as getAjvForSchema,
8988
8991
  df as getCacheStats,
8989
8992
  Qe as getEvaluatedProperties,
@@ -4,4 +4,4 @@ export * from './controls';
4
4
  export * from './json-schema-form';
5
5
  export * from './validator';
6
6
  export * from './schema-defaults';
7
- export { type CustomWidgets, type CustomWidgetRegistration, type WidgetFactory, forXUI, forFormat, forTypeAndFormat, } from './widgets/widget-customization';
7
+ export { type CustomWidgets, type CustomWidgetRegistration, type WidgetFactory, forXUI, forFormat, forTypeAndFormat, createDiagnosticWidget, } from './widgets/widget-customization';
@@ -65,20 +65,18 @@ export interface WidgetCustomization {
65
65
  * Custom widget registration for form-scoped widgets
66
66
  */
67
67
  export interface CustomWidgetRegistration<T = unknown> {
68
- /** Widget name */
69
- name: string;
70
68
  /** Widget factory function */
71
69
  factory: WidgetFactory<T>;
72
- /** Widget display name */
70
+ /** Custom matcher function for widget selection (required) */
71
+ matcher: (ctx: SchemaContext) => boolean;
72
+ /** Widget priority (higher = preferred, default: 50) */
73
+ priority?: number;
74
+ /** Widget display name (for debugging) */
73
75
  displayName?: string;
74
76
  /** Widget description */
75
77
  description?: string;
76
78
  /** Supported JSON Schema types */
77
79
  supportedTypes?: string[];
78
- /** Widget priority (higher = preferred, default: 50) */
79
- priority?: number;
80
- /** Custom matcher function for widget selection */
81
- matcher?: (ctx: SchemaContext) => boolean;
82
80
  }
83
81
  /**
84
82
  * Array of custom widget registrations for the customWidgets option
@@ -152,7 +150,7 @@ export declare function registerWidget<T = unknown>(name: string, factory: Widge
152
150
  * // Matches schema: { type: 'string', 'x:ui': 'fancy-email' }
153
151
  * ```
154
152
  */
155
- export declare function forXUI<T = unknown>(widgetName: string, factory: WidgetFactory<T>, options?: Partial<Omit<CustomWidgetRegistration<T>, 'name' | 'factory' | 'matcher'>>): CustomWidgetRegistration<T>;
153
+ export declare function forXUI<T = unknown>(widgetName: string, factory: WidgetFactory<T>, options?: Partial<Omit<CustomWidgetRegistration<T>, 'factory' | 'matcher'>>): CustomWidgetRegistration<T>;
156
154
  /**
157
155
  * Create a custom widget registration that matches by schema format
158
156
  *
@@ -173,3 +171,40 @@ export declare function forFormat<T = unknown>(format: string, factory: WidgetFa
173
171
  * ```
174
172
  */
175
173
  export declare function forTypeAndFormat<T = unknown>(type: string, format: string, factory: WidgetFactory<T>, options?: Partial<Omit<CustomWidgetRegistration<T>, 'factory' | 'matcher'>>): CustomWidgetRegistration<T>;
174
+ /**
175
+ * Create a diagnostic custom widget registration for debugging custom widget matching.
176
+ *
177
+ * This utility helps diagnose issues where custom widgets aren't being matched as expected.
178
+ * It logs detailed information about each property that's being processed, including:
179
+ * - Property name and path
180
+ * - Schema type
181
+ * - Whether the widgetRegistry is available
182
+ * - Custom matcher results
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const customWidgets = [
187
+ * // Add the diagnostic widget first to trace all properties
188
+ * createDiagnosticWidget({
189
+ * logPrefix: 'CUSTOM_WIDGET_DEBUG',
190
+ * filterFn: (ctx) => true, // Log all properties
191
+ * }),
192
+ * // Then add your actual custom widgets
193
+ * myCustomWidget,
194
+ * ]
195
+ * ```
196
+ */
197
+ export declare function createDiagnosticWidget<T = unknown>(options?: {
198
+ /** Prefix for log messages (default: 'WIDGET_DIAG') */
199
+ logPrefix?: string;
200
+ /** Filter function to control which properties are logged */
201
+ filterFn?: (ctx: SchemaContext) => boolean;
202
+ /** Callback function called for each processed property */
203
+ onProcess?: (info: {
204
+ name: string | undefined;
205
+ path: string[];
206
+ type: string | undefined;
207
+ hasRegistry: boolean;
208
+ definition: unknown;
209
+ }) => void;
210
+ }): CustomWidgetRegistration<T>;