@nuraly/runtime 0.1.4 → 0.1.5

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 (48) hide show
  1. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -1
  2. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -2
  3. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -1
  4. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -1
  5. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -1
  6. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -1
  7. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +60 -0
  8. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +108 -0
  9. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +1 -1
  10. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.types.ts +1 -0
  11. package/dist/CodeEditor-BiNku87K.js +808 -0
  12. package/dist/{CodeEditor-Ch2tv9BE.js → CodeEditor-G6E8PUI7.js} +14593 -14607
  13. package/dist/{SmartAttributeHandler-hoSLpm1Y.js → SmartAttributeHandler-C9vS-cHW.js} +1 -1
  14. package/dist/SmartAttributeHandler-u-ZHGueR.js +193 -0
  15. package/dist/assets/editor.worker-C_S4Avdt.js +11 -0
  16. package/dist/assets/{html.worker-BSmGlhXp.js → html.worker-DfuQASUV.js} +18 -18
  17. package/dist/assets/json.worker-Cucz4wxY.js +42 -0
  18. package/dist/assets/{ts.worker-DyHHPhrh.js → ts.worker-Dme6S0YK.js} +78 -78
  19. package/dist/cssMode-B7NVlrDV.js +1443 -0
  20. package/dist/{freemarker2-DNc2IxPf.js → freemarker2-DS_7G9b8.js} +1 -1
  21. package/dist/{handlebars-CIbFckEw.js → handlebars-BDyyLkzw.js} +1 -1
  22. package/dist/{html-nRs_fneU.js → html-DphGFjig.js} +1 -1
  23. package/dist/{htmlMode-BjehA1YF.js → htmlMode-4zNnSWFo.js} +278 -281
  24. package/dist/index-B4yIOSMd.js +3847 -0
  25. package/dist/{javascript-Bn0HduZA.js → javascript-CC1jWyQy.js} +1 -1
  26. package/dist/{jsonMode-CfGfcJRX.js → jsonMode-Bfzb6wZf.js} +369 -372
  27. package/dist/{liquid-m4D_LCnC.js → liquid-lTBpqagR.js} +1 -1
  28. package/dist/{mdx-CakMRbCr.js → mdx-DX66Bp07.js} +1 -1
  29. package/dist/{micro-app-entry-CI1Rupdh.js → micro-app-entry-DDsAWUJh.js} +5138 -5322
  30. package/dist/micro-app.bundle.js +1 -1
  31. package/dist/micro-app.js +9775 -0
  32. package/dist/{python-oJwaiPUY.js → python-BGUhyO4G.js} +1 -1
  33. package/dist/{razor-u_dd4rqc.js → razor-DEVWQFSa.js} +1 -1
  34. package/dist/runtime.js +401 -0
  35. package/dist/style.css +1 -1
  36. package/dist/tsMode-CYFi80Jf.js +800 -0
  37. package/dist/{typescript-Bjs2N5Be.js → typescript-B1xIbH_T.js} +1 -1
  38. package/dist/{wgsl-Bv2xeo60.js → wgsl-C9yjop46.js} +1 -1
  39. package/dist/{xml-BCveATLl.js → xml-DmdvyqrE.js} +1 -1
  40. package/dist/{yaml-BfWQPJQi.js → yaml-LGNo48fy.js} +1 -1
  41. package/package.json +2 -2
  42. package/vite.config.ts +8 -8
  43. package/dist/.claude/settings.local.json +0 -9
  44. package/dist/assets/editor.worker-vBWydyGC.js +0 -11
  45. package/dist/assets/json.worker-Dqnoedz4.js +0 -42
  46. package/dist/cssMode-Bt2uK8XM.js +0 -1446
  47. package/dist/micro-app.bundle.umd.cjs +0 -5051
  48. package/dist/tsMode-DlZ38d3D.js +0 -813
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReactiveController, ReactiveControllerHost } from 'lit';
3
2
  import { DropdownController, DropdownHost, DropdownPosition, DropdownSpace } from './dropdown.interface.js';
4
3
  /**
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
- /// <reference types="node" />
3
1
  /**
4
2
  * Shared dropdown controller interface
5
3
  */
@@ -3,7 +3,6 @@
3
3
  * Copyright 2023 Nuraly, Laabidi Aymen
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- /// <reference types="react" />
7
6
  import { ReactiveController, ReactiveControllerHost } from 'lit';
8
7
  import { ThemeVariant } from '../themes.js';
9
8
  /**
@@ -3,7 +3,6 @@
3
3
  * Copyright 2023 Nuraly, Laabidi Aymen
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- /// <reference types="react" />
7
6
  import { LitElement } from 'lit';
8
7
  declare type Constructor<T = {}> = new (...args: any[]) => T;
9
8
  /**
@@ -3,7 +3,6 @@
3
3
  * Copyright 2023 Nuraly, Laabidi Aymen
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- /// <reference types="react" />
7
6
  import { LitElement } from 'lit';
8
7
  /**
9
8
  * Theme detection and management mixin for Lit components
@@ -3,7 +3,6 @@
3
3
  * Copyright 2023 Nuraly, Laabidi Aymen
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- /// <reference types="react" />
7
6
  /**
8
7
  * Theme utilities and type definitions
9
8
  *
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Nuraly, Laabidi Aymen
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ /**
7
+ * Throttles a function call to limit execution frequency
8
+ * Useful for performance optimization of frequently called functions
9
+ *
10
+ * @param func - Function to throttle
11
+ * @param limit - Milliseconds to limit between calls
12
+ * @returns Throttled function that will execute at most once per limit period
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const throttledScroll = throttle((event) => {
17
+ * console.log('Scroll event:', event);
18
+ * }, 16); // 60fps limit
19
+ *
20
+ * window.addEventListener('scroll', throttledScroll);
21
+ * ```
22
+ */
23
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
24
+ /**
25
+ * Debounces a function call to delay execution until after a period of inactivity
26
+ * Useful for search inputs, resize handlers, etc.
27
+ *
28
+ * @param func - Function to debounce
29
+ * @param delay - Milliseconds to wait after last call
30
+ * @returns Debounced function that will execute after delay period of inactivity
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const debouncedSearch = debounce((query: string) => {
35
+ * console.log('Searching for:', query);
36
+ * }, 300); // Wait 300ms after user stops typing
37
+ *
38
+ * input.addEventListener('input', (e) => debouncedSearch(e.target.value));
39
+ * ```
40
+ */
41
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
42
+ /**
43
+ * RAF (RequestAnimationFrame) throttle for smooth animations
44
+ * Ensures function is called at most once per animation frame
45
+ *
46
+ * @param func - Function to throttle to animation frames
47
+ * @returns Function that will execute at most once per animation frame
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * const rafThrottledUpdate = rafThrottle(() => {
52
+ * // Expensive DOM updates
53
+ * updateUI();
54
+ * });
55
+ *
56
+ * element.addEventListener('mousemove', rafThrottledUpdate);
57
+ * ```
58
+ */
59
+ export declare function rafThrottle<T extends (...args: any[]) => any>(func: T): (...args: Parameters<T>) => void;
60
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Nuraly, Laabidi Aymen
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ /**
7
+ * Validation event detail structure that validation controllers emit
8
+ */
9
+ export interface ValidationEventDetail {
10
+ /** Whether the field is currently valid */
11
+ isValid: boolean;
12
+ /** Current validation message */
13
+ validationMessage: string;
14
+ /** Current validation state */
15
+ validationState: string;
16
+ /** Array of error messages */
17
+ errors: string[];
18
+ /** Array of warning messages */
19
+ warnings: string[];
20
+ /** Complete validation result object */
21
+ validationResult: any;
22
+ }
23
+ /**
24
+ * Validation status information returned by getValidationStatus()
25
+ */
26
+ export interface ValidationStatus {
27
+ /** Whether the field is currently valid */
28
+ isValid: boolean;
29
+ /** Whether validation is currently in progress */
30
+ isValidating?: boolean;
31
+ /** Array of error messages */
32
+ errors: string[];
33
+ /** Array of warning messages */
34
+ warnings: string[];
35
+ }
36
+ /**
37
+ * Generic validation rule interface
38
+ */
39
+ export interface ValidationRule {
40
+ /** Validation function */
41
+ validator: (value: any) => boolean | Promise<boolean>;
42
+ /** Error/warning message */
43
+ message: string;
44
+ /** Validation level */
45
+ level?: 'error' | 'warning';
46
+ /** Whether this rule blocks form submission */
47
+ blocking?: boolean;
48
+ }
49
+ /**
50
+ * Interface for components that support validation through events and API
51
+ * This is the shared pattern used by input, textarea, and other form field components
52
+ */
53
+ export interface ValidatableComponent {
54
+ /** Field name for form submission */
55
+ name?: string;
56
+ /** Field value */
57
+ value: any;
58
+ /** Required field indicator */
59
+ required?: boolean;
60
+ /** Disabled state */
61
+ disabled?: boolean;
62
+ /** Readonly state */
63
+ readonly?: boolean;
64
+ /** Current validation message */
65
+ validationMessage?: string;
66
+ /** Add a validation rule */
67
+ addRule?(rule: ValidationRule): void;
68
+ /** Remove validation rules matching predicate */
69
+ removeRule?(predicate: (rule: ValidationRule) => boolean): void;
70
+ /** Clear all validation rules */
71
+ clearRules?(): void;
72
+ /** Get current validation status */
73
+ getValidationStatus(): ValidationStatus;
74
+ /** Trigger validation manually */
75
+ validate(): Promise<boolean> | boolean;
76
+ /** Clear validation state */
77
+ clearValidation?(): void;
78
+ /** Dispatches 'nr-validation' events with ValidationEventDetail */
79
+ addEventListener(type: 'nr-validation', listener: (event: CustomEvent<ValidationEventDetail>) => void): void;
80
+ /** Removes 'nr-validation' event listeners */
81
+ removeEventListener(type: 'nr-validation', listener: (event: CustomEvent<ValidationEventDetail>) => void): void;
82
+ }
83
+ /**
84
+ * Form field information for form integration
85
+ */
86
+ export interface FormFieldInfo {
87
+ element: HTMLElement & ValidatableComponent;
88
+ name: string;
89
+ value: any;
90
+ isValid: boolean;
91
+ validationMessage: string;
92
+ required: boolean;
93
+ touched: boolean;
94
+ dirty: boolean;
95
+ }
96
+ /**
97
+ * Constants for validation events
98
+ */
99
+ export declare const VALIDATION_EVENTS: {
100
+ readonly VALIDATION: "nr-validation";
101
+ readonly FIELD_FOCUS: "nr-focus";
102
+ readonly FIELD_BLUR: "nr-blur";
103
+ readonly FIELD_CHANGE: "nr-change";
104
+ readonly FIELD_INPUT: "nr-input";
105
+ readonly FIELD_CLEAR: "nr-clear";
106
+ };
107
+ export declare type ValidationEventType = typeof VALIDATION_EVENTS[keyof typeof VALIDATION_EVENTS];
108
+ //# sourceMappingURL=validation.types.d.ts.map
@@ -420,7 +420,7 @@ export class NrRadioGroupElement extends NuralyUIBaseMixin(LitElement) {
420
420
  [RadioButtonType.Default, () => this.renderOptionDefault()],
421
421
  [RadioButtonType.Button, () => this.renderOptionsWithButtons()],
422
422
  [RadioButtonType.Slot, () => this.renderOptionsWithSlots()],
423
- ['button-slot', () => this.renderButtonsWithSlots()], // Special case for button with slots
423
+ [RadioButtonType.ButtonSlot, () => this.renderButtonsWithSlots()], // Special case for button with slots
424
424
  ])} `;
425
425
  }
426
426
  }
@@ -29,6 +29,7 @@ export enum RadioButtonType {
29
29
  Default = 'default',
30
30
  Button = 'button',
31
31
  Slot = 'slot',
32
+ ButtonSlot = 'button-slot',
32
33
  }
33
34
 
34
35
  export enum RadioButtonSize {