@widgetic/editor 4.1.13 → 4.1.15

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 (89) hide show
  1. package/dist/components/PreviewChromeControls.svelte +15 -21
  2. package/dist/components/WidgetPreview.svelte +136 -105
  3. package/dist/components/color-select/ColorSelect.svelte +203 -224
  4. package/dist/components/color-select/constants.d.ts +4 -2
  5. package/dist/components/color-select/constants.js +4 -2
  6. package/dist/components/color-select/render.js +10 -9
  7. package/dist/components/editors/CompositionEditorApp.svelte +55 -40
  8. package/dist/components/editors/EditLeaseNotice.svelte +44 -33
  9. package/dist/components/editors/EmbedEditor.svelte +133 -259
  10. package/dist/components/editors/PropsEditor.svelte +426 -1333
  11. package/dist/components/editors/props-editor.css +5 -68
  12. package/dist/components/ic/AngleInputController.svelte +202 -277
  13. package/dist/components/ic/BrowserInputController.svelte +813 -803
  14. package/dist/components/ic/CheckboxInputController.svelte +92 -169
  15. package/dist/components/ic/CheckboxInputController.svelte.d.ts +2 -8
  16. package/dist/components/ic/ColorPickerInputController.svelte +1589 -1587
  17. package/dist/components/ic/ColorPickerInputController.svelte.d.ts +3 -3
  18. package/dist/components/ic/DateFieldInputController.svelte +455 -465
  19. package/dist/components/ic/DatePickerInputController.svelte +355 -368
  20. package/dist/components/ic/DatePickerInputController.svelte.d.ts +1 -1
  21. package/dist/components/ic/DropdownInputController.svelte +130 -200
  22. package/dist/components/ic/FixedPositionInputController.svelte +255 -276
  23. package/dist/components/ic/FixedPositionInputController.svelte.d.ts +5 -1
  24. package/dist/components/ic/FontInputController.svelte +2110 -2231
  25. package/dist/components/ic/FontInputController.svelte.d.ts +11 -11
  26. package/dist/components/ic/InputControllerHeader.svelte +141 -147
  27. package/dist/components/ic/InputControllerRenderer.svelte +5 -1
  28. package/dist/components/ic/InputControllerRenderer.svelte.d.ts +2 -1
  29. package/dist/components/ic/InputControllerRow.svelte +74 -0
  30. package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
  31. package/dist/components/ic/KnowledgeDocumentsInputController.svelte +401 -0
  32. package/dist/components/ic/KnowledgeDocumentsInputController.svelte.d.ts +11 -0
  33. package/dist/components/ic/KnowledgeTextForm.svelte +109 -0
  34. package/dist/components/ic/KnowledgeTextForm.svelte.d.ts +15 -0
  35. package/dist/components/ic/NumberControls.svelte +303 -269
  36. package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
  37. package/dist/components/ic/NumberInputController.svelte +361 -301
  38. package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
  39. package/dist/components/ic/PositionInputController.svelte +253 -176
  40. package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
  41. package/dist/components/ic/RadioGroupInputController.svelte +71 -137
  42. package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
  43. package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
  44. package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
  45. package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
  46. package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
  47. package/dist/components/ic/SliderInputController.svelte +263 -332
  48. package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
  49. package/dist/components/ic/SliderRangeInputController.svelte +140 -144
  50. package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
  51. package/dist/components/ic/SwitchInputController.svelte +47 -109
  52. package/dist/components/ic/TagsInputController.svelte +95 -110
  53. package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
  54. package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
  55. package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
  56. package/dist/components/ic/TextInputController.svelte +65 -75
  57. package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
  58. package/dist/components/ic/TimeInputController.svelte +433 -431
  59. package/dist/components/ic/VectorInputController.svelte +1833 -1831
  60. package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
  61. package/dist/components/ic/index.d.ts +2 -0
  62. package/dist/components/ic/index.js +2 -0
  63. package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
  64. package/dist/components/ic/shared/ItemGrid.svelte +145 -179
  65. package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
  66. package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
  67. package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
  68. package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
  69. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
  70. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
  71. package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
  72. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
  73. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
  74. package/dist/composition/compositionApi.d.ts +21 -1
  75. package/dist/composition/compositionApi.js +64 -5
  76. package/dist/composition/knowledgeDocuments.d.ts +90 -0
  77. package/dist/composition/knowledgeDocuments.js +94 -0
  78. package/dist/composition/knowledgeDocumentsPanel.d.ts +152 -0
  79. package/dist/composition/knowledgeDocumentsPanel.js +443 -0
  80. package/dist/i18n/language.d.ts +86 -36
  81. package/dist/i18n/messages.d.ts +97 -34
  82. package/dist/i18n/messages.js +104 -34
  83. package/dist/i18n/translate.d.ts +1 -1
  84. package/dist/index.d.ts +1 -0
  85. package/dist/knowledgeDocumentsContext.d.ts +10 -0
  86. package/dist/knowledgeDocumentsContext.js +31 -0
  87. package/dist/utils.d.ts +7 -0
  88. package/dist/utils.js +26 -2
  89. package/package.json +4 -4
@@ -1,176 +1,110 @@
1
1
  <script module lang="ts">
2
- import type { InputControllerConfig } from './index';
2
+ import type { InputControllerConfig } from './index';
3
3
 
4
4
  /** Declared props contract — export lets below are annotated from it so the
5
5
  * interface cannot drift from what the component actually reads. */
6
- export interface RadioGroupInputControllerProps {
7
- value: string | { value: string; label: string };
8
- onChange: (newValue: string) => void;
9
- config?: InputControllerConfig;
10
- description?: string;
11
- onFocus?: () => void;
12
- options?: { value: string; label: string }[];
13
- }
6
+ export interface RadioGroupInputControllerProps {
7
+ value: string | { value: string; label: string };
8
+ onChange: (newValue: string) => void;
9
+ config?: InputControllerConfig;
10
+ description?: string;
11
+ onFocus?: () => void;
12
+ options?: { value: string; label: string }[];
13
+ }
14
14
  </script>
15
15
 
16
16
  <script lang="ts">
17
- /**
18
- * RadioGroupInputController Component
19
- * A reusable radio group input component that handles selection from a list of options.
20
- * Supports custom styling, external state management, and accessibility features.
21
- */
22
-
23
- /**
24
- * Svelte Lifecycle Imports
25
- * Required for component setup and cleanup
26
- */
27
- import { onMount, onDestroy } from 'svelte';
28
-
29
17
  /**
30
18
  * UI Components Imports
31
19
  * Shadcn UI radio group components for consistent styling and behavior
32
20
  */
33
- import { Label, RadioGroup } from '@widgetic/design-system/components';
21
+ import { Label, RadioGroup } from '@widgetic/design-system/components';
34
22
 
35
- /**
36
- * Component Props
37
- * External properties that configure the radio group's behavior and appearance
38
- */
39
- export let value: RadioGroupInputControllerProps['value']; // Currently selected value
40
- export let onChange: RadioGroupInputControllerProps['onChange']; // Callback for value changes
41
- export let config: RadioGroupInputControllerProps['config'] = {}; // Additional configuration options
42
- export let description: RadioGroupInputControllerProps['description'] = undefined; // Optional help description text
43
- export let onFocus: RadioGroupInputControllerProps['onFocus'] = () => {}; // Focus event handler
44
-
45
- /**
46
- * Configuration Options
47
- * Derived from config prop with fallbacks
48
- */
49
- export let options: RadioGroupInputControllerProps['options'] = config.options || []; // Available options
23
+ export let value: RadioGroupInputControllerProps['value'];
24
+ export let onChange: RadioGroupInputControllerProps['onChange'];
25
+ export let config: RadioGroupInputControllerProps['config'] = {};
26
+ export let description: RadioGroupInputControllerProps['description'] = undefined;
27
+ export let onFocus: RadioGroupInputControllerProps['onFocus'] = () => {};
28
+ export let options: RadioGroupInputControllerProps['options'] = config.options || [];
50
29
 
51
30
  /**
52
31
  * Local state
53
32
  */
54
- let localValue: string = typeof value === 'object' ? value.value : value;
33
+ let localValue: string = typeof value === 'object' ? value.value : value;
55
34
 
56
35
  /**
57
36
  * Handles value changes from the radio group
58
37
  * @param newValue - The newly selected value
59
38
  */
60
- function handleValueChange(newValue: string) {
39
+ function handleValueChange(newValue: string) {
61
40
  // console.log('RadioGroupInputController: handleValueChange', newValue);
62
- localValue = newValue;
63
- onChange(newValue);
64
- }
41
+ localValue = newValue;
42
+ onChange(newValue);
43
+ }
65
44
 
66
45
  /**
67
46
  * Handles click on the entire row
68
47
  * @param optionValue - The value to select
69
48
  */
70
- function handleRowClick(optionValue: string) {
71
- if (localValue !== optionValue) {
72
- handleValueChange(optionValue);
73
- }
74
- }
49
+ function handleRowClick(optionValue: string) {
50
+ if (localValue !== optionValue) {
51
+ handleValueChange(optionValue);
52
+ }
53
+ }
75
54
 
76
55
  /**
77
56
  * Stops event propagation to prevent double-firing of click events
78
57
  * @param event - The mouse event
79
58
  */
80
- function stopPropagation(event: MouseEvent) {
81
- event.stopPropagation();
82
- }
83
-
84
- /**
85
- * Create proper event handlers for shadcn components
86
- */
87
- function createHandlers() {
88
- return {
89
- // Use a function that returns a new object with events
90
- // Note that these are not Svelte event directives but rather
91
- // props expected by the shadcn components
92
- onclick: stopPropagation
93
- };
94
- }
59
+ function stopPropagation(event: MouseEvent) {
60
+ event.stopPropagation();
61
+ }
95
62
 
96
63
  /**
97
64
  * Update local value when external value changes
98
65
  */
99
- $: {
100
- if (value) {
101
- localValue = typeof value === 'object' ? value.value : value;
102
- }
103
- }
66
+ $: {
67
+ if (value) {
68
+ localValue = typeof value === 'object' ? value.value : value;
69
+ }
70
+ }
104
71
  </script>
105
72
 
106
- <div class="flex flex-col gap-2 widgetic-colors">
107
- <div
108
- class="px-4 py-2 rounded-large border border-grey2 bg-grey1 transition-colors duration-200 hover:border-forest-green"
109
- onfocusin={onFocus}
110
- >
111
- <RadioGroup.Root
112
- value={localValue}
113
- onValueChange={handleValueChange}
114
- class="flex flex-col gap-2 py-2"
115
- >
116
- {#each options as option}
117
- <!-- svelte-ignore a11y_click_events_have_key_events -->
118
- <!-- svelte-ignore a11y_no_static_element_interactions -->
119
- <div class="flex items-center space-x-2 cursor-pointer" onclick={() => handleRowClick(option.value)}>
120
- <RadioGroup.Item
121
- value={option.value}
122
- id={`radio-${option.value}`}
123
- class="radio-item size-4 rounded-full border border-grey7 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
124
- style="width: 20px; height: 20px; border-width: 2px; background-color: white;"
125
- onclick={stopPropagation}
126
- />
127
- <Label
128
- for={`radio-${option.value}`}
129
- class="subtext text-grey7 cursor-pointer select-none w-full"
130
- onclick={stopPropagation}
131
- >
132
- {option.label}
133
- </Label>
134
- </div>
135
- {/each}
136
- </RadioGroup.Root>
137
- </div>
138
-
139
- {#if description}
140
- <p class="subtext text-grey5">{description}</p>
141
- {/if}
73
+ <div class="flex flex-col gap-1">
74
+ <div
75
+ class="flex w-full flex-col gap-2 rounded-lg bg-accent px-3 py-4 transition-colors duration-fast hover:bg-accent-hover focus-within:outline-hidden focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background"
76
+ onfocusin={onFocus}
77
+ >
78
+ <RadioGroup.Root
79
+ value={localValue}
80
+ onValueChange={handleValueChange}
81
+ class="flex flex-col gap-2"
82
+ >
83
+ {#each options as option}
84
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
85
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
86
+ <div
87
+ class="flex cursor-pointer items-center gap-2"
88
+ onclick={() => handleRowClick(option.value)}
89
+ >
90
+ <RadioGroup.Item
91
+ value={option.value}
92
+ id={`radio-${option.value}`}
93
+ onclick={stopPropagation}
94
+ />
95
+ <Label
96
+ for={`radio-${option.value}`}
97
+ class="w-full cursor-pointer select-none text-body text-foreground"
98
+ onclick={stopPropagation}
99
+ >
100
+ {option.label}
101
+ </Label>
102
+ </div>
103
+ {/each}
104
+ </RadioGroup.Root>
105
+ </div>
106
+
107
+ {#if description}
108
+ <p class="text-caption text-muted-foreground">{description}</p>
109
+ {/if}
142
110
  </div>
143
-
144
- <style>
145
- /* Custom radio styling to match design system */
146
- :global(.radio-item[data-state="checked"]) {
147
- border-color: hsl(var(--sage-green));
148
- background-color: white;
149
- position: relative;
150
- }
151
-
152
- :global(.radio-item[data-state="checked"])::after {
153
- content: "";
154
- display: block;
155
- width: 10px;
156
- height: 10px;
157
- border-radius: 50%;
158
- background-color: hsl(var(--sage-green));
159
- position: absolute;
160
- top: 50%;
161
- left: 50%;
162
- transform: translate(-50%, -50%);
163
- }
164
-
165
- /* Remove focus outline from container when radio is focused */
166
- :global(.radio-item:focus-visible),
167
- :global(.radio-item:focus-within) {
168
- outline: none;
169
- }
170
-
171
- /* Remove pointer events from labels when disabled */
172
- :global(.radio-item[disabled] + label) {
173
- pointer-events: none;
174
- opacity: 0.5;
175
- }
176
- </style>
@@ -29,18 +29,12 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
29
29
  z_$$bindings?: Bindings;
30
30
  }
31
31
  declare const RadioGroupInputController: $$__sveltets_2_IsomorphicComponent<{
32
- /**
33
- * Component Props
34
- * External properties that configure the radio group's behavior and appearance
35
- */ value: RadioGroupInputControllerProps["value"];
32
+ value: RadioGroupInputControllerProps["value"];
36
33
  onChange: RadioGroupInputControllerProps["onChange"];
37
34
  config?: RadioGroupInputControllerProps["config"];
38
35
  description?: RadioGroupInputControllerProps["description"];
39
36
  onFocus?: RadioGroupInputControllerProps["onFocus"];
40
- /**
41
- * Configuration Options
42
- * Derived from config prop with fallbacks
43
- */ options?: RadioGroupInputControllerProps["options"];
37
+ options?: RadioGroupInputControllerProps["options"];
44
38
  }, {
45
39
  [evt: string]: CustomEvent<any>;
46
40
  }, {}, {}, string>;