@rilaykit/core 12.0.0 → 13.0.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/index.d.mts CHANGED
@@ -291,6 +291,116 @@ interface ComponentRenderProps<TProps = any> {
291
291
  isValidating?: boolean;
292
292
  [key: string]: any;
293
293
  }
294
+ /**
295
+ * Property editor definition for builder property panel
296
+ * Generic and extensible to support any custom editor type
297
+ */
298
+ interface PropertyEditorDefinition<TValue = any> {
299
+ /** Property key in component props */
300
+ readonly key: string;
301
+ /** Display label in property panel */
302
+ readonly label: string;
303
+ /**
304
+ * Editor type - can be any string to support custom editors
305
+ * Built-in types: 'text', 'number', 'boolean', 'select', 'multiselect', 'color', 'textarea', 'json'
306
+ * Custom types: 'phone', 'currency', 'location', 'rating', 'file-upload', etc.
307
+ */
308
+ readonly editorType: string;
309
+ /** Optional description/help text */
310
+ readonly helpText?: string;
311
+ /** Default value for this property */
312
+ readonly defaultValue?: TValue;
313
+ /** Options for select/multiselect editors */
314
+ readonly options?: Array<{
315
+ label: string;
316
+ value: any;
317
+ [key: string]: any;
318
+ }>;
319
+ /** Validation function for the property value */
320
+ readonly validate?: (value: TValue) => boolean | string | Promise<boolean | string>;
321
+ /** Group/section for organizing properties */
322
+ readonly group?: string;
323
+ /** Whether this property is required */
324
+ readonly required?: boolean;
325
+ /** Placeholder text for input fields */
326
+ readonly placeholder?: string;
327
+ /** Custom editor component for advanced use cases */
328
+ readonly customEditor?: React__default.ComponentType<PropertyEditorProps<TValue>>;
329
+ /** Additional configuration specific to the editor type */
330
+ readonly editorConfig?: Record<string, any>;
331
+ /** Dependencies - other properties that affect this one */
332
+ readonly dependencies?: string[];
333
+ /** Conditional rendering based on other property values */
334
+ readonly visible?: (props: Record<string, any>) => boolean;
335
+ /** Transform value before saving */
336
+ readonly transform?: (value: TValue) => any;
337
+ /** Parse value when loading */
338
+ readonly parse?: (value: any) => TValue;
339
+ }
340
+ /**
341
+ * Props passed to custom property editors
342
+ */
343
+ interface PropertyEditorProps<TValue = any> {
344
+ /** Current property value */
345
+ readonly value: TValue;
346
+ /** Callback to update the value */
347
+ readonly onChange: (value: TValue) => void;
348
+ /** Property definition */
349
+ readonly definition: PropertyEditorDefinition<TValue>;
350
+ /** All current property values (for dependencies) */
351
+ readonly allValues: Record<string, any>;
352
+ /** Whether the field is disabled */
353
+ readonly disabled?: boolean;
354
+ /** Validation errors */
355
+ readonly errors?: string[];
356
+ }
357
+ /**
358
+ * Builder metadata for visual editing capabilities
359
+ * This is optional and only used by @rilaykit/builder
360
+ * Fully generic to support any component type and configuration
361
+ */
362
+ interface ComponentBuilderMetadata<TProps = any> {
363
+ /** Category for grouping in component palette (e.g., 'Input', 'Layout', 'Advanced') */
364
+ readonly category?: string;
365
+ /** Icon identifier (e.g., 'text', 'email', 'calendar') */
366
+ readonly icon?: string;
367
+ /** Whether this component should be hidden from the builder palette */
368
+ readonly hidden?: boolean;
369
+ /** Preview component or description for the palette */
370
+ readonly preview?: React__default.ReactNode;
371
+ /** Editable properties configuration for property panel */
372
+ readonly editableProps?: PropertyEditorDefinition[];
373
+ /** Tags for search and filtering */
374
+ readonly tags?: string[];
375
+ /**
376
+ * Custom field schema for advanced type systems
377
+ * Allows defining complex field types with their own validation and structure
378
+ */
379
+ readonly fieldSchema?: FieldSchemaDefinition<TProps>;
380
+ }
381
+ /**
382
+ * Field schema definition for complex field types
383
+ * Supports defining custom field types with validation, defaults, and metadata
384
+ */
385
+ interface FieldSchemaDefinition<TProps = any> {
386
+ /** Field type identifier (e.g., 'location', 'phone', 'currency') */
387
+ readonly type: string;
388
+ /** Schema validation (Zod, Yup, or any Standard Schema) */
389
+ readonly schema?: any;
390
+ /** Default configuration for this field type */
391
+ readonly defaultConfig?: Partial<TProps>;
392
+ /** Sub-fields for complex types (e.g., Location has address, city, country) */
393
+ readonly subFields?: Array<{
394
+ key: string;
395
+ label: string;
396
+ type: string;
397
+ required?: boolean;
398
+ }>;
399
+ /** Custom serialization for complex data structures */
400
+ readonly serialize?: (value: any) => any;
401
+ /** Custom deserialization for complex data structures */
402
+ readonly deserialize?: (value: any) => any;
403
+ }
294
404
  interface ComponentConfig<TProps = any> {
295
405
  readonly id: string;
296
406
  readonly type: string;
@@ -300,6 +410,8 @@ interface ComponentConfig<TProps = any> {
300
410
  readonly defaultProps?: Partial<TProps>;
301
411
  readonly useFieldRenderer?: boolean;
302
412
  readonly validation?: FieldValidationConfig;
413
+ /** Optional builder metadata for visual editing (only used by @rilaykit/builder) */
414
+ readonly builder?: ComponentBuilderMetadata;
303
415
  }
304
416
  interface ConditionalBehavior {
305
417
  readonly visible?: ConditionConfig;
@@ -956,4 +1068,4 @@ declare class DevelopmentAdapter implements MonitoringAdapter {
956
1068
  private logErrorSummary;
957
1069
  }
958
1070
 
959
- export { type ComponentConfig, type ComponentPerformanceMetrics, type ComponentRenderProps, type ComponentRenderer, type ComponentRendererBaseProps, ComponentRendererWrapper, type ComponentRendererWrapperProps, type ConditionBuilder as Condition, type ConditionBuilder, type ConditionConfig, type ConditionEvaluator, type ConditionOperator, type ConditionValue, type ConditionalBehavior, ConsoleAdapter, type ConsoleMonitoringAdapter, type CustomStepRenderer, DevelopmentAdapter, type EnhancedFormAnalytics, type EnhancedWorkflowAnalytics, type ErrorMonitoringEvent, type FieldRenderer, type FieldRendererProps, type FieldValidationConfig, type FieldValidator, type FormBodyRenderer, type FormBodyRendererProps, type FormComponentRendererProps, type FormConfiguration, type FormFieldConfig, type FormFieldRow, type FormPerformanceMetrics, type FormRenderConfig, type FormRowRenderer, type FormRowRendererProps, type FormSubmitButtonRenderer, type FormSubmitButtonRendererProps, type FormValidationConfig, type FormValidator, IdGenerator, type InferInput, type InferOutput, LocalStorageAdapter, type LogicalOperator, type MonitoringAdapter, type MonitoringConfig, type MonitoringContext, type MonitoringEvent, type MonitoringEventType, type PerformanceMetrics, type PerformanceProfiler, type PerformanceThresholds, type PerformanceWarningEvent, RemoteAdapter, type RemoteMonitoringAdapter, type RendererChildrenFunction, type RilayInstance, type RilayLicenseConfig, RilayMonitor, type StandardSchema, type StepConditionalBehavior, type StepConfig, type StepDataHelper, type ValidationContext, type ValidationError, type ValidationResult, type WorkflowAnalytics, type WorkflowComponentRendererBaseProps, type WorkflowConfig, type WorkflowContext, type WorkflowNextButtonRenderer, type WorkflowNextButtonRendererProps, type WorkflowPerformanceMetrics, type WorkflowPlugin, type WorkflowPreviousButtonRenderer, type WorkflowPreviousButtonRendererProps, type WorkflowRenderConfig, type WorkflowSkipButtonRenderer, type WorkflowSkipButtonRendererProps, type WorkflowStepperRenderer, type WorkflowStepperRendererProps, async, combine, combineSchemas, configureObject, createErrorResult, createStandardValidator, createSuccessResult, createValidationContext, createValidationResult, custom, deepClone, destroyGlobalMonitoring, email, ensureUnique, evaluateCondition, getGlobalMonitor, getSchemaInfo, hasSchemaTypes, hasUnifiedValidation, initializeMonitoring, isStandardSchema, isValidationRule, max, maxLength, mergeInto, min, minLength, normalizeToArray, normalizeValidationRules, number, pattern, required, resolveRendererChildren, ril, url, validateFormWithUnifiedConfig, validateRequired, validateWithStandardSchema, validateWithUnifiedConfig, when };
1071
+ export { type ComponentBuilderMetadata, type ComponentConfig, type ComponentPerformanceMetrics, type ComponentRenderProps, type ComponentRenderer, type ComponentRendererBaseProps, ComponentRendererWrapper, type ComponentRendererWrapperProps, type ConditionBuilder as Condition, type ConditionBuilder, type ConditionConfig, type ConditionEvaluator, type ConditionOperator, type ConditionValue, type ConditionalBehavior, ConsoleAdapter, type ConsoleMonitoringAdapter, type CustomStepRenderer, DevelopmentAdapter, type EnhancedFormAnalytics, type EnhancedWorkflowAnalytics, type ErrorMonitoringEvent, type FieldRenderer, type FieldRendererProps, type FieldSchemaDefinition, type FieldValidationConfig, type FieldValidator, type FormBodyRenderer, type FormBodyRendererProps, type FormComponentRendererProps, type FormConfiguration, type FormFieldConfig, type FormFieldRow, type FormPerformanceMetrics, type FormRenderConfig, type FormRowRenderer, type FormRowRendererProps, type FormSubmitButtonRenderer, type FormSubmitButtonRendererProps, type FormValidationConfig, type FormValidator, IdGenerator, type InferInput, type InferOutput, LocalStorageAdapter, type LogicalOperator, type MonitoringAdapter, type MonitoringConfig, type MonitoringContext, type MonitoringEvent, type MonitoringEventType, type PerformanceMetrics, type PerformanceProfiler, type PerformanceThresholds, type PerformanceWarningEvent, type PropertyEditorDefinition, type PropertyEditorProps, RemoteAdapter, type RemoteMonitoringAdapter, type RendererChildrenFunction, type RilayInstance, type RilayLicenseConfig, RilayMonitor, type StandardSchema, type StepConditionalBehavior, type StepConfig, type StepDataHelper, type ValidationContext, type ValidationError, type ValidationResult, type WorkflowAnalytics, type WorkflowComponentRendererBaseProps, type WorkflowConfig, type WorkflowContext, type WorkflowNextButtonRenderer, type WorkflowNextButtonRendererProps, type WorkflowPerformanceMetrics, type WorkflowPlugin, type WorkflowPreviousButtonRenderer, type WorkflowPreviousButtonRendererProps, type WorkflowRenderConfig, type WorkflowSkipButtonRenderer, type WorkflowSkipButtonRendererProps, type WorkflowStepperRenderer, type WorkflowStepperRendererProps, async, combine, combineSchemas, configureObject, createErrorResult, createStandardValidator, createSuccessResult, createValidationContext, createValidationResult, custom, deepClone, destroyGlobalMonitoring, email, ensureUnique, evaluateCondition, getGlobalMonitor, getSchemaInfo, hasSchemaTypes, hasUnifiedValidation, initializeMonitoring, isStandardSchema, isValidationRule, max, maxLength, mergeInto, min, minLength, normalizeToArray, normalizeValidationRules, number, pattern, required, resolveRendererChildren, ril, url, validateFormWithUnifiedConfig, validateRequired, validateWithStandardSchema, validateWithUnifiedConfig, when };
package/dist/index.d.ts CHANGED
@@ -291,6 +291,116 @@ interface ComponentRenderProps<TProps = any> {
291
291
  isValidating?: boolean;
292
292
  [key: string]: any;
293
293
  }
294
+ /**
295
+ * Property editor definition for builder property panel
296
+ * Generic and extensible to support any custom editor type
297
+ */
298
+ interface PropertyEditorDefinition<TValue = any> {
299
+ /** Property key in component props */
300
+ readonly key: string;
301
+ /** Display label in property panel */
302
+ readonly label: string;
303
+ /**
304
+ * Editor type - can be any string to support custom editors
305
+ * Built-in types: 'text', 'number', 'boolean', 'select', 'multiselect', 'color', 'textarea', 'json'
306
+ * Custom types: 'phone', 'currency', 'location', 'rating', 'file-upload', etc.
307
+ */
308
+ readonly editorType: string;
309
+ /** Optional description/help text */
310
+ readonly helpText?: string;
311
+ /** Default value for this property */
312
+ readonly defaultValue?: TValue;
313
+ /** Options for select/multiselect editors */
314
+ readonly options?: Array<{
315
+ label: string;
316
+ value: any;
317
+ [key: string]: any;
318
+ }>;
319
+ /** Validation function for the property value */
320
+ readonly validate?: (value: TValue) => boolean | string | Promise<boolean | string>;
321
+ /** Group/section for organizing properties */
322
+ readonly group?: string;
323
+ /** Whether this property is required */
324
+ readonly required?: boolean;
325
+ /** Placeholder text for input fields */
326
+ readonly placeholder?: string;
327
+ /** Custom editor component for advanced use cases */
328
+ readonly customEditor?: React__default.ComponentType<PropertyEditorProps<TValue>>;
329
+ /** Additional configuration specific to the editor type */
330
+ readonly editorConfig?: Record<string, any>;
331
+ /** Dependencies - other properties that affect this one */
332
+ readonly dependencies?: string[];
333
+ /** Conditional rendering based on other property values */
334
+ readonly visible?: (props: Record<string, any>) => boolean;
335
+ /** Transform value before saving */
336
+ readonly transform?: (value: TValue) => any;
337
+ /** Parse value when loading */
338
+ readonly parse?: (value: any) => TValue;
339
+ }
340
+ /**
341
+ * Props passed to custom property editors
342
+ */
343
+ interface PropertyEditorProps<TValue = any> {
344
+ /** Current property value */
345
+ readonly value: TValue;
346
+ /** Callback to update the value */
347
+ readonly onChange: (value: TValue) => void;
348
+ /** Property definition */
349
+ readonly definition: PropertyEditorDefinition<TValue>;
350
+ /** All current property values (for dependencies) */
351
+ readonly allValues: Record<string, any>;
352
+ /** Whether the field is disabled */
353
+ readonly disabled?: boolean;
354
+ /** Validation errors */
355
+ readonly errors?: string[];
356
+ }
357
+ /**
358
+ * Builder metadata for visual editing capabilities
359
+ * This is optional and only used by @rilaykit/builder
360
+ * Fully generic to support any component type and configuration
361
+ */
362
+ interface ComponentBuilderMetadata<TProps = any> {
363
+ /** Category for grouping in component palette (e.g., 'Input', 'Layout', 'Advanced') */
364
+ readonly category?: string;
365
+ /** Icon identifier (e.g., 'text', 'email', 'calendar') */
366
+ readonly icon?: string;
367
+ /** Whether this component should be hidden from the builder palette */
368
+ readonly hidden?: boolean;
369
+ /** Preview component or description for the palette */
370
+ readonly preview?: React__default.ReactNode;
371
+ /** Editable properties configuration for property panel */
372
+ readonly editableProps?: PropertyEditorDefinition[];
373
+ /** Tags for search and filtering */
374
+ readonly tags?: string[];
375
+ /**
376
+ * Custom field schema for advanced type systems
377
+ * Allows defining complex field types with their own validation and structure
378
+ */
379
+ readonly fieldSchema?: FieldSchemaDefinition<TProps>;
380
+ }
381
+ /**
382
+ * Field schema definition for complex field types
383
+ * Supports defining custom field types with validation, defaults, and metadata
384
+ */
385
+ interface FieldSchemaDefinition<TProps = any> {
386
+ /** Field type identifier (e.g., 'location', 'phone', 'currency') */
387
+ readonly type: string;
388
+ /** Schema validation (Zod, Yup, or any Standard Schema) */
389
+ readonly schema?: any;
390
+ /** Default configuration for this field type */
391
+ readonly defaultConfig?: Partial<TProps>;
392
+ /** Sub-fields for complex types (e.g., Location has address, city, country) */
393
+ readonly subFields?: Array<{
394
+ key: string;
395
+ label: string;
396
+ type: string;
397
+ required?: boolean;
398
+ }>;
399
+ /** Custom serialization for complex data structures */
400
+ readonly serialize?: (value: any) => any;
401
+ /** Custom deserialization for complex data structures */
402
+ readonly deserialize?: (value: any) => any;
403
+ }
294
404
  interface ComponentConfig<TProps = any> {
295
405
  readonly id: string;
296
406
  readonly type: string;
@@ -300,6 +410,8 @@ interface ComponentConfig<TProps = any> {
300
410
  readonly defaultProps?: Partial<TProps>;
301
411
  readonly useFieldRenderer?: boolean;
302
412
  readonly validation?: FieldValidationConfig;
413
+ /** Optional builder metadata for visual editing (only used by @rilaykit/builder) */
414
+ readonly builder?: ComponentBuilderMetadata;
303
415
  }
304
416
  interface ConditionalBehavior {
305
417
  readonly visible?: ConditionConfig;
@@ -956,4 +1068,4 @@ declare class DevelopmentAdapter implements MonitoringAdapter {
956
1068
  private logErrorSummary;
957
1069
  }
958
1070
 
959
- export { type ComponentConfig, type ComponentPerformanceMetrics, type ComponentRenderProps, type ComponentRenderer, type ComponentRendererBaseProps, ComponentRendererWrapper, type ComponentRendererWrapperProps, type ConditionBuilder as Condition, type ConditionBuilder, type ConditionConfig, type ConditionEvaluator, type ConditionOperator, type ConditionValue, type ConditionalBehavior, ConsoleAdapter, type ConsoleMonitoringAdapter, type CustomStepRenderer, DevelopmentAdapter, type EnhancedFormAnalytics, type EnhancedWorkflowAnalytics, type ErrorMonitoringEvent, type FieldRenderer, type FieldRendererProps, type FieldValidationConfig, type FieldValidator, type FormBodyRenderer, type FormBodyRendererProps, type FormComponentRendererProps, type FormConfiguration, type FormFieldConfig, type FormFieldRow, type FormPerformanceMetrics, type FormRenderConfig, type FormRowRenderer, type FormRowRendererProps, type FormSubmitButtonRenderer, type FormSubmitButtonRendererProps, type FormValidationConfig, type FormValidator, IdGenerator, type InferInput, type InferOutput, LocalStorageAdapter, type LogicalOperator, type MonitoringAdapter, type MonitoringConfig, type MonitoringContext, type MonitoringEvent, type MonitoringEventType, type PerformanceMetrics, type PerformanceProfiler, type PerformanceThresholds, type PerformanceWarningEvent, RemoteAdapter, type RemoteMonitoringAdapter, type RendererChildrenFunction, type RilayInstance, type RilayLicenseConfig, RilayMonitor, type StandardSchema, type StepConditionalBehavior, type StepConfig, type StepDataHelper, type ValidationContext, type ValidationError, type ValidationResult, type WorkflowAnalytics, type WorkflowComponentRendererBaseProps, type WorkflowConfig, type WorkflowContext, type WorkflowNextButtonRenderer, type WorkflowNextButtonRendererProps, type WorkflowPerformanceMetrics, type WorkflowPlugin, type WorkflowPreviousButtonRenderer, type WorkflowPreviousButtonRendererProps, type WorkflowRenderConfig, type WorkflowSkipButtonRenderer, type WorkflowSkipButtonRendererProps, type WorkflowStepperRenderer, type WorkflowStepperRendererProps, async, combine, combineSchemas, configureObject, createErrorResult, createStandardValidator, createSuccessResult, createValidationContext, createValidationResult, custom, deepClone, destroyGlobalMonitoring, email, ensureUnique, evaluateCondition, getGlobalMonitor, getSchemaInfo, hasSchemaTypes, hasUnifiedValidation, initializeMonitoring, isStandardSchema, isValidationRule, max, maxLength, mergeInto, min, minLength, normalizeToArray, normalizeValidationRules, number, pattern, required, resolveRendererChildren, ril, url, validateFormWithUnifiedConfig, validateRequired, validateWithStandardSchema, validateWithUnifiedConfig, when };
1071
+ export { type ComponentBuilderMetadata, type ComponentConfig, type ComponentPerformanceMetrics, type ComponentRenderProps, type ComponentRenderer, type ComponentRendererBaseProps, ComponentRendererWrapper, type ComponentRendererWrapperProps, type ConditionBuilder as Condition, type ConditionBuilder, type ConditionConfig, type ConditionEvaluator, type ConditionOperator, type ConditionValue, type ConditionalBehavior, ConsoleAdapter, type ConsoleMonitoringAdapter, type CustomStepRenderer, DevelopmentAdapter, type EnhancedFormAnalytics, type EnhancedWorkflowAnalytics, type ErrorMonitoringEvent, type FieldRenderer, type FieldRendererProps, type FieldSchemaDefinition, type FieldValidationConfig, type FieldValidator, type FormBodyRenderer, type FormBodyRendererProps, type FormComponentRendererProps, type FormConfiguration, type FormFieldConfig, type FormFieldRow, type FormPerformanceMetrics, type FormRenderConfig, type FormRowRenderer, type FormRowRendererProps, type FormSubmitButtonRenderer, type FormSubmitButtonRendererProps, type FormValidationConfig, type FormValidator, IdGenerator, type InferInput, type InferOutput, LocalStorageAdapter, type LogicalOperator, type MonitoringAdapter, type MonitoringConfig, type MonitoringContext, type MonitoringEvent, type MonitoringEventType, type PerformanceMetrics, type PerformanceProfiler, type PerformanceThresholds, type PerformanceWarningEvent, type PropertyEditorDefinition, type PropertyEditorProps, RemoteAdapter, type RemoteMonitoringAdapter, type RendererChildrenFunction, type RilayInstance, type RilayLicenseConfig, RilayMonitor, type StandardSchema, type StepConditionalBehavior, type StepConfig, type StepDataHelper, type ValidationContext, type ValidationError, type ValidationResult, type WorkflowAnalytics, type WorkflowComponentRendererBaseProps, type WorkflowConfig, type WorkflowContext, type WorkflowNextButtonRenderer, type WorkflowNextButtonRendererProps, type WorkflowPerformanceMetrics, type WorkflowPlugin, type WorkflowPreviousButtonRenderer, type WorkflowPreviousButtonRendererProps, type WorkflowRenderConfig, type WorkflowSkipButtonRenderer, type WorkflowSkipButtonRendererProps, type WorkflowStepperRenderer, type WorkflowStepperRendererProps, async, combine, combineSchemas, configureObject, createErrorResult, createStandardValidator, createSuccessResult, createValidationContext, createValidationResult, custom, deepClone, destroyGlobalMonitoring, email, ensureUnique, evaluateCondition, getGlobalMonitor, getSchemaInfo, hasSchemaTypes, hasUnifiedValidation, initializeMonitoring, isStandardSchema, isValidationRule, max, maxLength, mergeInto, min, minLength, normalizeToArray, normalizeValidationRules, number, pattern, required, resolveRendererChildren, ril, url, validateFormWithUnifiedConfig, validateRequired, validateWithStandardSchema, validateWithUnifiedConfig, when };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rilaykit/core",
3
- "version": "12.0.0",
3
+ "version": "13.0.0",
4
4
  "description": "Core types, configurations, and utilities for the RilayKit form library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",