@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.
- package/dist/components/PreviewChromeControls.svelte +15 -21
- package/dist/components/WidgetPreview.svelte +136 -105
- package/dist/components/color-select/ColorSelect.svelte +203 -224
- package/dist/components/color-select/constants.d.ts +4 -2
- package/dist/components/color-select/constants.js +4 -2
- package/dist/components/color-select/render.js +10 -9
- package/dist/components/editors/CompositionEditorApp.svelte +55 -40
- package/dist/components/editors/EditLeaseNotice.svelte +44 -33
- package/dist/components/editors/EmbedEditor.svelte +133 -259
- package/dist/components/editors/PropsEditor.svelte +426 -1333
- package/dist/components/editors/props-editor.css +5 -68
- package/dist/components/ic/AngleInputController.svelte +202 -277
- package/dist/components/ic/BrowserInputController.svelte +813 -803
- package/dist/components/ic/CheckboxInputController.svelte +92 -169
- package/dist/components/ic/CheckboxInputController.svelte.d.ts +2 -8
- package/dist/components/ic/ColorPickerInputController.svelte +1589 -1587
- package/dist/components/ic/ColorPickerInputController.svelte.d.ts +3 -3
- package/dist/components/ic/DateFieldInputController.svelte +455 -465
- package/dist/components/ic/DatePickerInputController.svelte +355 -368
- package/dist/components/ic/DatePickerInputController.svelte.d.ts +1 -1
- package/dist/components/ic/DropdownInputController.svelte +130 -200
- package/dist/components/ic/FixedPositionInputController.svelte +255 -276
- package/dist/components/ic/FixedPositionInputController.svelte.d.ts +5 -1
- package/dist/components/ic/FontInputController.svelte +2110 -2231
- package/dist/components/ic/FontInputController.svelte.d.ts +11 -11
- package/dist/components/ic/InputControllerHeader.svelte +141 -147
- package/dist/components/ic/InputControllerRenderer.svelte +5 -1
- package/dist/components/ic/InputControllerRenderer.svelte.d.ts +2 -1
- package/dist/components/ic/InputControllerRow.svelte +74 -0
- package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte +401 -0
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte.d.ts +11 -0
- package/dist/components/ic/KnowledgeTextForm.svelte +109 -0
- package/dist/components/ic/KnowledgeTextForm.svelte.d.ts +15 -0
- package/dist/components/ic/NumberControls.svelte +303 -269
- package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
- package/dist/components/ic/NumberInputController.svelte +361 -301
- package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
- package/dist/components/ic/PositionInputController.svelte +253 -176
- package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
- package/dist/components/ic/RadioGroupInputController.svelte +71 -137
- package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
- package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
- package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
- package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
- package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
- package/dist/components/ic/SliderInputController.svelte +263 -332
- package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
- package/dist/components/ic/SliderRangeInputController.svelte +140 -144
- package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
- package/dist/components/ic/SwitchInputController.svelte +47 -109
- package/dist/components/ic/TagsInputController.svelte +95 -110
- package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
- package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
- package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
- package/dist/components/ic/TextInputController.svelte +65 -75
- package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
- package/dist/components/ic/TimeInputController.svelte +433 -431
- package/dist/components/ic/VectorInputController.svelte +1833 -1831
- package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
- package/dist/components/ic/index.d.ts +2 -0
- package/dist/components/ic/index.js +2 -0
- package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
- package/dist/components/ic/shared/ItemGrid.svelte +145 -179
- package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
- package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
- package/dist/composition/compositionApi.d.ts +21 -1
- package/dist/composition/compositionApi.js +64 -5
- package/dist/composition/knowledgeDocuments.d.ts +90 -0
- package/dist/composition/knowledgeDocuments.js +94 -0
- package/dist/composition/knowledgeDocumentsPanel.d.ts +152 -0
- package/dist/composition/knowledgeDocumentsPanel.js +443 -0
- package/dist/i18n/language.d.ts +86 -36
- package/dist/i18n/messages.d.ts +97 -34
- package/dist/i18n/messages.js +104 -34
- package/dist/i18n/translate.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/knowledgeDocumentsContext.d.ts +10 -0
- package/dist/knowledgeDocumentsContext.js +31 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +26 -2
- package/package.json +4 -4
|
@@ -1,176 +1,110 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
21
|
+
import { Label, RadioGroup } from '@widgetic/design-system/components';
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
+
function handleValueChange(newValue: string) {
|
|
61
40
|
// console.log('RadioGroupInputController: handleValueChange', newValue);
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
81
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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>;
|