@widgetic/editor 4.1.14 → 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 (76) 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 +47 -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 +418 -1338
  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/InputControllerRow.svelte +74 -0
  28. package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
  29. package/dist/components/ic/KnowledgeDocumentsInputController.svelte +84 -47
  30. package/dist/components/ic/KnowledgeTextForm.svelte +35 -33
  31. package/dist/components/ic/NumberControls.svelte +303 -269
  32. package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
  33. package/dist/components/ic/NumberInputController.svelte +361 -301
  34. package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
  35. package/dist/components/ic/PositionInputController.svelte +253 -176
  36. package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
  37. package/dist/components/ic/RadioGroupInputController.svelte +71 -137
  38. package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
  39. package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
  40. package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
  41. package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
  42. package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
  43. package/dist/components/ic/SliderInputController.svelte +263 -332
  44. package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
  45. package/dist/components/ic/SliderRangeInputController.svelte +140 -144
  46. package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
  47. package/dist/components/ic/SwitchInputController.svelte +47 -109
  48. package/dist/components/ic/TagsInputController.svelte +95 -110
  49. package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
  50. package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
  51. package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
  52. package/dist/components/ic/TextInputController.svelte +65 -75
  53. package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
  54. package/dist/components/ic/TimeInputController.svelte +433 -431
  55. package/dist/components/ic/VectorInputController.svelte +1833 -1831
  56. package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
  57. package/dist/components/ic/index.d.ts +1 -0
  58. package/dist/components/ic/index.js +1 -0
  59. package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
  60. package/dist/components/ic/shared/ItemGrid.svelte +145 -179
  61. package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
  62. package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
  63. package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
  64. package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
  65. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
  66. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
  67. package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
  68. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
  69. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
  70. package/dist/i18n/language.d.ts +43 -36
  71. package/dist/i18n/messages.d.ts +41 -34
  72. package/dist/i18n/messages.js +47 -34
  73. package/dist/i18n/translate.d.ts +1 -1
  74. package/dist/utils.d.ts +7 -0
  75. package/dist/utils.js +26 -2
  76. package/package.json +4 -4
@@ -1,73 +1,10 @@
1
- /* Props Editor custom styles — component-level rules only.
2
- * Global page rules (body, *, focus) live in app.css (standalone only). */
1
+ /* Props Editor — global hooks used by the standalone app (see app.css). Component rules live in PropsEditor.svelte. */
3
2
 
4
- /* Drag Handle specific styles */
5
- /* When header exists, only show on header hover */
6
- .header-hover-area:hover .drag-handle-container {
7
- opacity: 1 !important;
8
- }
9
-
10
- /* When no header exists, show on entire container hover */
11
- .props-editor-container:not(:has(.header-hover-area)) {
12
- position: relative;
13
- }
14
-
15
- .props-editor-container:not(:has(.header-hover-area)):hover .drag-handle-container {
16
- opacity: 1 !important;
17
- }
18
-
19
- .drag-handle-container {
20
- opacity: 0;
21
- transition: opacity 0.3s ease;
22
- }
23
-
24
- .widgetic-colors .drag-handle svg {
25
- color: hsl(var(--grey2)) !important;
26
- transition: color 0.2s ease !important;
27
- }
28
-
29
- .widgetic-colors .drag-handle:hover svg {
30
- color: hsl(var(--grey3)) !important;
31
- }
32
-
33
- /* GENERAL WIDGETIC COLORS RULES in all EDITOR */
34
- /* Ensure buttons don't change background on hover */
35
- .widgetic-colors button.bg-white:hover {
36
- background-color: white !important;
37
- }
38
-
39
- /* Ensure proper button text alignment */
40
- .widgetic-colors button span {
41
- line-height: 1;
42
- }
43
-
44
- /* Override button hover states in all contexts */
45
- .widgetic-colors button.bg-white {
46
- background-color: white !important;
47
- }
48
-
49
- .widgetic-colors button.bg-white:hover {
50
- background-color: white !important;
51
- }
52
-
53
- /* General Icons color states */
54
- .widgetic-colors button svg {
55
- color: hsl(var(--grey5));
56
- }
57
-
58
- .widgetic-colors button:hover svg {
59
- color: hsl(var(--grey7));
60
- }
61
-
62
- .design-tab-content[data-state="active"]{
63
- display: block;
64
- margin-top: var(--has-both-schemas, 1rem);
3
+ .design-tab-content[data-state='active'] {
4
+ display: block;
5
+ margin-top: var(--has-both-schemas, 1rem);
65
6
  }
66
7
 
67
8
  .props-editor-container:has(.tabs-header) {
68
- --has-both-schemas: 1rem;
69
- }
70
-
71
- .content-items-wrapper {
72
- padding-top: 1rem;
9
+ --has-both-schemas: 1rem;
73
10
  }
@@ -1,290 +1,215 @@
1
- <!--
1
+ <!--
2
2
  * AngleInputController
3
- *
3
+ *
4
4
  * Extends NumberInputController to add a visual circular indicator for angle selection.
5
5
  * Maintains all number input functionality while adding drag-to-rotate capability.
6
- *
7
- * Features:
8
- * - Visual angle selection via draggable indicator
9
- * - Full number input functionality from parent
10
- * - Touch and mouse support
11
- * - Smooth transitions and visual feedback
12
6
  -->
13
7
 
14
8
  <script module lang="ts">
15
- import type { InputControllerConfig } from './index';
16
-
17
- /** Declared props contract — export lets below are annotated from it so the
18
- * interface cannot drift from what the component actually reads. */
19
- export interface AngleInputControllerProps {
20
- label: string;
21
- value?: number;
22
- onChange: (newValue: number) => void;
23
- config?: InputControllerConfig;
24
- helpText?: string;
25
- onFocus?: () => void;
26
- }
9
+ import type { InputControllerConfig } from './index';
10
+
11
+ /** Declared props contract — export lets below are annotated from it so the
12
+ * interface cannot drift from what the component actually reads. */
13
+ export interface AngleInputControllerProps {
14
+ label: string;
15
+ value?: number;
16
+ onChange: (newValue: number) => void;
17
+ config?: InputControllerConfig;
18
+ helpText?: string;
19
+ onFocus?: () => void;
20
+ }
27
21
  </script>
28
22
 
29
23
  <script lang="ts">
30
- import { onMount, onDestroy } from 'svelte';
31
- import { Button, Input } from '@widgetic/design-system/components';
32
- import InputControllerHeader from './InputControllerHeader.svelte';
33
- import NumberControls from './NumberControls.svelte';
34
-
35
- export let label: AngleInputControllerProps['label'];
36
- export let value: AngleInputControllerProps['value'] = 0;
37
- export let onChange: AngleInputControllerProps['onChange'];
38
- export let config: AngleInputControllerProps['config'] = {};
39
- export let helpText: AngleInputControllerProps['helpText'] = undefined;
40
- export let onFocus: AngleInputControllerProps['onFocus'] = () => {};
41
-
42
- // Circle indicator state
43
- let isDragging = false;
44
- let circleContainer: HTMLDivElement;
45
- let inputValue = value.toString();
46
- let startAngle = 0;
47
- let startValue = 0;
48
-
49
- // Configuration with defaults
50
- $: min = config.min || 0;
51
- $: max = config.max || 360;
52
- $: step = config.step || 1;
53
-
54
- // Keep input value in sync with value prop
55
- $: {
56
- if (value.toString() !== inputValue) {
57
- inputValue = value.toString();
58
- }
59
- }
60
-
61
- function handleInputChange(event: Event) {
62
- const input = event.target as HTMLInputElement;
63
- const newValue = parseInt(input.value);
64
-
65
- if (!isNaN(newValue)) {
66
- // For manual input, clamp to max (359)
67
- let boundedValue;
68
- if (max === 360) {
69
- // If max is 360, convert 360 to 0 and clamp higher values to 359
70
- if (newValue >= 360) {
71
- boundedValue = 359;
72
- } else {
73
- boundedValue = Math.max(min, Math.min(359, newValue));
74
- }
75
- } else {
76
- // For other max values, clamp normally
77
- boundedValue = Math.max(min, Math.min(max, newValue));
78
- }
79
-
80
- // Snap to step
81
- boundedValue = Math.round(boundedValue / step) * step;
82
-
83
- value = boundedValue;
84
- onChange(boundedValue);
85
- }
86
-
87
- inputValue = value.toString();
88
- }
89
-
90
- /**
91
- * Calculates the angle between two points relative to a center point
92
- */
93
- function calculateAngle(x: number, y: number, centerX: number, centerY: number): number {
94
- // Calculate angle and convert to degrees, with 0 pointing up
95
- const angle = Math.atan2(x - centerX, -(y - centerY)) * (180 / Math.PI);
96
- // Normalize to 0-360 range
97
- return (angle + 360) % 360;
98
- }
99
-
100
- /**
101
- * Updates angle based on mouse/touch position
102
- */
103
- function updateAngle(clientX: number, clientY: number, shouldSnapToPosition: boolean = false) {
104
- if (!circleContainer || (!isDragging && !shouldSnapToPosition)) return;
105
-
106
- const rect = circleContainer.getBoundingClientRect();
107
- const centerX = rect.left + rect.width / 2;
108
- const centerY = rect.top + rect.height / 2;
109
-
110
- // Calculate current angle from cursor position
111
- const currentAngle = calculateAngle(clientX, clientY, centerX, centerY);
112
-
113
- if (shouldSnapToPosition) {
114
- // Directly snap to the clicked position
115
- let newValue = Math.round(currentAngle / step) * step;
116
- if (newValue !== value) {
117
- value = newValue;
118
- onChange(newValue);
119
- // Update the start values for subsequent dragging
120
- startAngle = currentAngle;
121
- startValue = newValue;
122
- }
123
- } else {
124
- // Normal dragging behavior
125
- // Calculate the difference from the start angle
126
- let angleDiff = currentAngle - startAngle;
127
-
128
- // Normalize the difference to handle the 360/0 boundary
129
- if (angleDiff < -180) angleDiff += 360;
130
- if (angleDiff > 180) angleDiff -= 360;
131
-
132
- // Calculate new value based on the starting value and angle difference
133
- let newValue = startValue + angleDiff;
134
-
135
- // Handle wrapping around
136
- if (newValue < 0) newValue += 360;
137
- if (newValue >= 360) newValue -= 360;
138
-
139
- // Snap to step
140
- newValue = Math.round(newValue / step) * step;
141
-
142
- // Update if changed
143
- if (newValue !== value) {
144
- value = newValue;
145
- onChange(newValue);
146
- }
147
- }
148
- }
149
-
150
- function handleMouseDown(event: MouseEvent) {
151
- if (!circleContainer) return;
152
-
153
- // First snap to the clicked position
154
- updateAngle(event.clientX, event.clientY, true);
155
-
156
- isDragging = true;
157
- onFocus();
158
-
159
- const rect = circleContainer.getBoundingClientRect();
160
- const centerX = rect.left + rect.width / 2;
161
- const centerY = rect.top + rect.height / 2;
162
-
163
- // Store the starting angle from cursor position
164
- startAngle = calculateAngle(event.clientX, event.clientY, centerX, centerY);
165
- // Store the current value as the starting value
166
- startValue = value;
167
-
168
- document.addEventListener('mousemove', handleMouseMove);
169
- document.addEventListener('mouseup', handleMouseUp);
170
- }
171
-
172
- function handleMouseMove(event: MouseEvent) {
173
- if (!isDragging) return;
174
- event.preventDefault();
175
- updateAngle(event.clientX, event.clientY);
176
- }
177
-
178
- function handleMouseUp() {
179
- isDragging = false;
180
- document.removeEventListener('mousemove', handleMouseMove);
181
- document.removeEventListener('mouseup', handleMouseUp);
182
- }
183
-
184
- function handleTouchStart(event: TouchEvent) {
185
- if (!circleContainer) return;
186
-
187
- const touch = event.touches[0];
188
- // First snap to the touched position
189
- updateAngle(touch.clientX, touch.clientY, true);
190
-
191
- isDragging = true;
192
- onFocus();
193
- event.preventDefault();
194
-
195
- const rect = circleContainer.getBoundingClientRect();
196
- const centerX = rect.left + rect.width / 2;
197
- const centerY = rect.top + rect.height / 2;
198
-
199
- // Store the starting angle from touch position
200
- startAngle = calculateAngle(touch.clientX, touch.clientY, centerX, centerY);
201
- // Store the current value as the starting value
202
- startValue = value;
203
- }
204
-
205
- function handleTouchMove(event: TouchEvent) {
206
- if (!isDragging) return;
207
- event.preventDefault();
208
- const touch = event.touches[0];
209
- updateAngle(touch.clientX, touch.clientY);
210
- }
211
-
212
- function handleTouchEnd(event: TouchEvent) {
213
- event.preventDefault();
214
- isDragging = false;
215
- }
216
-
217
- function handleClick(adjustment: number) {
218
- let newValue = value + adjustment;
219
- if (newValue >= 360) newValue -= 360;
220
- if (newValue < 0) newValue += 360;
221
- value = newValue;
222
- onChange(newValue);
223
- }
224
-
225
- onDestroy(() => {
226
- document.removeEventListener('mousemove', handleMouseMove);
227
- document.removeEventListener('mouseup', handleMouseUp);
228
- });
24
+ import { onDestroy } from 'svelte';
25
+ import InputControllerRow from './InputControllerRow.svelte';
26
+ import NumberControls from './NumberControls.svelte';
27
+
28
+ export let label: AngleInputControllerProps['label'];
29
+ export let value: AngleInputControllerProps['value'] = 0;
30
+ export let onChange: AngleInputControllerProps['onChange'];
31
+ export let config: AngleInputControllerProps['config'] = {};
32
+ export let helpText: AngleInputControllerProps['helpText'] = undefined;
33
+ export let onFocus: AngleInputControllerProps['onFocus'] = () => {};
34
+
35
+ // Circle indicator state
36
+ let isDragging = false;
37
+ let circleContainer: HTMLDivElement;
38
+ let inputValue = value.toString();
39
+ let startAngle = 0;
40
+ let startValue = 0;
41
+
42
+ // Configuration with defaults
43
+ $: min = config.min || 0;
44
+ $: max = config.max || 360;
45
+ $: step = config.step || 1;
46
+
47
+ // Keep input value in sync with value prop
48
+ $: {
49
+ if (value.toString() !== inputValue) {
50
+ inputValue = value.toString();
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Calculates the angle between two points relative to a center point
56
+ */
57
+ function calculateAngle(x: number, y: number, centerX: number, centerY: number): number {
58
+ // Calculate angle and convert to degrees, with 0 pointing up
59
+ const angle = Math.atan2(x - centerX, -(y - centerY)) * (180 / Math.PI);
60
+ // Normalize to 0-360 range
61
+ return (angle + 360) % 360;
62
+ }
63
+
64
+ /**
65
+ * Updates angle based on mouse/touch position
66
+ */
67
+ function updateAngle(clientX: number, clientY: number, shouldSnapToPosition: boolean = false) {
68
+ if (!circleContainer || (!isDragging && !shouldSnapToPosition)) return;
69
+
70
+ const rect = circleContainer.getBoundingClientRect();
71
+ const centerX = rect.left + rect.width / 2;
72
+ const centerY = rect.top + rect.height / 2;
73
+
74
+ const currentAngle = calculateAngle(clientX, clientY, centerX, centerY);
75
+
76
+ if (shouldSnapToPosition) {
77
+ let newValue = Math.round(currentAngle / step) * step;
78
+ if (newValue !== value) {
79
+ value = newValue;
80
+ onChange(newValue);
81
+ startAngle = currentAngle;
82
+ startValue = newValue;
83
+ }
84
+ } else {
85
+ let angleDiff = currentAngle - startAngle;
86
+ if (angleDiff < -180) angleDiff += 360;
87
+ if (angleDiff > 180) angleDiff -= 360;
88
+
89
+ let newValue = startValue + angleDiff;
90
+ if (newValue < 0) newValue += 360;
91
+ if (newValue >= 360) newValue -= 360;
92
+
93
+ newValue = Math.round(newValue / step) * step;
94
+
95
+ if (newValue !== value) {
96
+ value = newValue;
97
+ onChange(newValue);
98
+ }
99
+ }
100
+ }
101
+
102
+ function handleMouseDown(event: MouseEvent) {
103
+ if (!circleContainer) return;
104
+
105
+ updateAngle(event.clientX, event.clientY, true);
106
+
107
+ isDragging = true;
108
+ onFocus();
109
+
110
+ const rect = circleContainer.getBoundingClientRect();
111
+ const centerX = rect.left + rect.width / 2;
112
+ const centerY = rect.top + rect.height / 2;
113
+
114
+ startAngle = calculateAngle(event.clientX, event.clientY, centerX, centerY);
115
+ startValue = value;
116
+
117
+ document.addEventListener('mousemove', handleMouseMove);
118
+ document.addEventListener('mouseup', handleMouseUp);
119
+ }
120
+
121
+ function handleMouseMove(event: MouseEvent) {
122
+ if (!isDragging) return;
123
+ event.preventDefault();
124
+ updateAngle(event.clientX, event.clientY);
125
+ }
126
+
127
+ function handleMouseUp() {
128
+ isDragging = false;
129
+ document.removeEventListener('mousemove', handleMouseMove);
130
+ document.removeEventListener('mouseup', handleMouseUp);
131
+ }
132
+
133
+ function handleTouchStart(event: TouchEvent) {
134
+ if (!circleContainer) return;
135
+
136
+ const touch = event.touches[0];
137
+ updateAngle(touch.clientX, touch.clientY, true);
138
+
139
+ isDragging = true;
140
+ onFocus();
141
+ event.preventDefault();
142
+
143
+ const rect = circleContainer.getBoundingClientRect();
144
+ const centerX = rect.left + rect.width / 2;
145
+ const centerY = rect.top + rect.height / 2;
146
+
147
+ startAngle = calculateAngle(touch.clientX, touch.clientY, centerX, centerY);
148
+ startValue = value;
149
+ }
150
+
151
+ function handleTouchMove(event: TouchEvent) {
152
+ if (!isDragging) return;
153
+ event.preventDefault();
154
+ const touch = event.touches[0];
155
+ updateAngle(touch.clientX, touch.clientY);
156
+ }
157
+
158
+ function handleTouchEnd(event: TouchEvent) {
159
+ event.preventDefault();
160
+ isDragging = false;
161
+ }
162
+
163
+ onDestroy(() => {
164
+ document.removeEventListener('mousemove', handleMouseMove);
165
+ document.removeEventListener('mouseup', handleMouseUp);
166
+ });
229
167
  </script>
230
168
 
231
- <div class="flex flex-col gap-2 widgetic-colors">
232
- <div class="flex items-center w-full relative">
233
- <div class="flex-1 min-w-0">
234
- <InputControllerHeader {label} {helpText} />
235
- </div>
236
-
237
- <div class="absolute end-0 h-[48px] flex items-center">
238
- <div class="flex items-center justify-end gap-2">
239
- <!-- Circle Indicator -->
240
- <!-- svelte-ignore a11y_no_static_element_interactions -->
241
- <div
242
- bind:this={circleContainer}
243
- class="relative w-[48px] h-[48px] rounded-full bg-grey1 border border-grey2 cursor-grab active:cursor-grabbing flex items-center justify-center transition-colors duration-200 hover:border-forest-green group"
244
- on:mousedown={handleMouseDown}
245
- on:touchstart={handleTouchStart}
246
- on:touchmove={handleTouchMove}
247
- on:touchend={handleTouchEnd}
248
- >
249
- <!-- Indicator Line -->
250
- <!-- svelte-ignore element_invalid_self_closing_tag -->
251
- <div
252
- class="absolute top-1/2 left-1/2 w-[2px] h-[20px] bg-grey5 origin-bottom -translate-x-1/2 pointer-events-none transition-colors duration-200 group-hover:bg-grey7"
253
- class:bg-grey7={isDragging}
254
- style="transform: translate(-50%, -100%) rotate({value}deg)"
255
- />
256
- <!-- Visual Guide -->
257
- <!-- svelte-ignore element_invalid_self_closing_tag -->
258
- <div
259
- class="absolute inset-0 rounded-full border-2 border-transparent"
260
- class:border-grey3={isDragging}
261
- />
262
- </div>
263
-
264
- <!-- Number Controls -->
265
- <NumberControls
266
- {value}
267
- {onChange}
268
- {min}
269
- {max}
270
- {step}
271
- {onFocus}
272
- wrapAround={true}
273
- suffix="°"
274
- width="129px"
275
- customInputClass="text-center"
276
- />
277
- </div>
278
- </div>
279
- </div>
280
- </div>
169
+ <InputControllerRow {label} {helpText}>
170
+ <div class="flex w-full items-center gap-2">
171
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
172
+ <!-- 36×36 dial; needle 2×14 from centre (IC Angle). -->
173
+ <div
174
+ bind:this={circleContainer}
175
+ class="angle-dial relative flex size-9 shrink-0 cursor-grab items-center justify-center overflow-visible rounded-full bg-accent transition-colors duration-fast hover:bg-accent-hover active:cursor-grabbing"
176
+ on:mousedown={handleMouseDown}
177
+ on:touchstart={handleTouchStart}
178
+ on:touchmove={handleTouchMove}
179
+ on:touchend={handleTouchEnd}
180
+ >
181
+ <!-- Sized in scoped CSS: with only w-0.5 + bg-primary, measure.mjs reported background transparent until width/height are explicit. -->
182
+ <div
183
+ class="angle-dial-needle pointer-events-none absolute top-1/2 start-1/2 origin-bottom bg-primary"
184
+ style="transform: translate(-50%, -100%) rotate({value}deg)"
185
+ ></div>
186
+ </div>
187
+
188
+ <NumberControls
189
+ class="min-w-0 flex-1"
190
+ surfacePaddingClass="pe-1.5 ps-3"
191
+ {value}
192
+ {onChange}
193
+ {min}
194
+ {max}
195
+ {step}
196
+ {onFocus}
197
+ wrapAround={true}
198
+ suffix="°"
199
+ />
200
+ </div>
201
+ </InputControllerRow>
281
202
 
282
203
  <style>
283
- /* Prevent text selection during dragging */
284
- .cursor-grab {
285
- user-select: none;
286
- -webkit-user-select: none;
287
- -moz-user-select: none;
288
- -ms-user-select: none;
289
- }
290
- </style>
204
+ .angle-dial-needle {
205
+ z-index: 1;
206
+ width: 2px;
207
+ height: 14px;
208
+ border-radius: 9999px;
209
+ }
210
+
211
+ .angle-dial {
212
+ user-select: none;
213
+ -webkit-user-select: none;
214
+ }
215
+ </style>