@widgetic/editor 4.0.1 โ†’ 4.0.3

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 (39) hide show
  1. package/dist/components/MockWidget.svelte +1 -1
  2. package/dist/components/WidgetPreview.svelte +36 -52
  3. package/dist/components/editors/EmbedEditor.svelte +1 -1
  4. package/dist/components/editors/PropsEditor.svelte +309 -227
  5. package/dist/components/ic/BrowserInputController.svelte +26 -19
  6. package/dist/components/ic/CheckboxInputController.svelte +1 -1
  7. package/dist/components/ic/ColorPickerInputController.svelte +37 -37
  8. package/dist/components/ic/DatePickerInputController.svelte +6 -6
  9. package/dist/components/ic/DropdownInputController.svelte +1 -1
  10. package/dist/components/ic/FontInputController.svelte +225 -116
  11. package/dist/components/ic/FontInputController.svelte.d.ts +4 -2
  12. package/dist/components/ic/NumberInputController.svelte +37 -37
  13. package/dist/components/ic/RadioGroupInputController.svelte +1 -1
  14. package/dist/components/ic/SliderRangeInputController.svelte +1 -1
  15. package/dist/components/ic/SwitchInputController.svelte +1 -1
  16. package/dist/components/ic/TextAreaInputController.svelte +213 -85
  17. package/dist/components/ic/TextAreaInputController.svelte.d.ts +1 -0
  18. package/dist/components/ic/TextAreaPreviewInputController.svelte +81 -79
  19. package/dist/components/ic/VectorInputController.svelte +34 -34
  20. package/dist/components/ic/shared/CategoryTabs.svelte +1 -0
  21. package/dist/components/ic/shared/RecentItemsSection.svelte +21 -6
  22. package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -0
  23. package/dist/config.d.ts +6 -0
  24. package/dist/config.js +19 -7
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +1 -0
  27. package/dist/stores/userSession.d.ts +1 -1
  28. package/dist/stores/userSession.js +17 -2
  29. package/dist/utils/FontManager.d.ts +3 -1
  30. package/dist/utils/FontManager.js +95 -103
  31. package/dist/utils/VectorManager.d.ts +3 -1
  32. package/dist/utils/VectorManager.js +30 -70
  33. package/dist/utils/colorTransparency.js +3 -3
  34. package/dist/utils/fontUtils.js +1 -1
  35. package/dist/utils/passiveEvents.d.ts +5 -0
  36. package/dist/utils/passiveEvents.js +9 -18
  37. package/dist/utils/recentColors.js +15 -15
  38. package/dist/utils/vectorUtils.js +1 -1
  39. package/package.json +1 -1
@@ -57,9 +57,9 @@
57
57
 
58
58
  if (!isEditing && !bothBoundsUndefined) {
59
59
  if (value < minValue || value > maxValue) {
60
- console.log('Value out of bounds, adjusting:', {
61
- value, minValue, maxValue, isEditing
62
- });
60
+ // console.log('Value out of bounds, adjusting:', {
61
+ // value, minValue, maxValue, isEditing
62
+ // });
63
63
  const clampedValue = Math.max(minValue, Math.min(maxValue, value));
64
64
  value = clampedValue;
65
65
  if (typeof onChange === 'function') {
@@ -98,24 +98,24 @@
98
98
  */
99
99
  function handleValueChange(adjustment: number) {
100
100
  try {
101
- console.log('๐Ÿ”„ handleValueChange:', { currentValue: value, adjustment, min, max });
101
+ // console.log('๐Ÿ”„ handleValueChange:', { currentValue: value, adjustment, min, max });
102
102
  const newValue = value + adjustment;
103
103
 
104
104
  if (min !== undefined && newValue < min) {
105
- console.log('โš ๏ธ Value would go below min, clamping to:', min);
105
+ // console.log('โš ๏ธ Value would go below min, clamping to:', min);
106
106
  value = min;
107
107
  if (onChange) onChange(min);
108
108
  return;
109
109
  }
110
110
 
111
111
  if (max !== undefined && newValue > max) {
112
- console.log('โš ๏ธ Value would exceed max, clamping to:', max);
112
+ // console.log('โš ๏ธ Value would exceed max, clamping to:', max);
113
113
  value = max;
114
114
  if (onChange) onChange(max);
115
115
  return;
116
116
  }
117
117
 
118
- console.log('โœ… Setting new value:', newValue);
118
+ // console.log('โœ… Setting new value:', newValue);
119
119
  value = newValue;
120
120
  if (onChange) onChange(newValue);
121
121
  } catch (error) {
@@ -132,24 +132,24 @@
132
132
  const input = e.currentTarget as HTMLInputElement;
133
133
  const inputValue = input.value;
134
134
 
135
- console.log('handleInput start:', {
136
- inputValue,
137
- isEditing,
138
- currentValue: value,
139
- min,
140
- max
141
- });
135
+ // console.log('handleInput start:', {
136
+ // inputValue,
137
+ // isEditing,
138
+ // currentValue: value,
139
+ // min,
140
+ // max
141
+ // });
142
142
 
143
143
  // Handle empty input
144
144
  if (inputValue === '') {
145
- console.log('Empty input detected - allowing editing');
145
+ // console.log('Empty input detected - allowing editing');
146
146
  isEditing = true;
147
147
  return;
148
148
  }
149
149
 
150
150
  // Prevent multiple minus signs
151
151
  if (inputValue.split('-').length > 2) {
152
- console.log('Multiple minus signs detected, preventing');
152
+ // console.log('Multiple minus signs detected, preventing');
153
153
  input.value = inputValue.charAt(0) === '-' ?
154
154
  '-' + inputValue.replace(/-/g, '') :
155
155
  inputValue.replace(/-/g, '');
@@ -158,14 +158,14 @@
158
158
 
159
159
  // Allow single minus sign for negative numbers
160
160
  if (inputValue === '-' && min! < 0) {
161
- console.log('Single minus sign detected');
161
+ // console.log('Single minus sign detected');
162
162
  isEditing = true;
163
163
  return;
164
164
  }
165
165
 
166
166
  // Validate numeric input
167
167
  if (!/^-?\d*$/.test(inputValue)) {
168
- console.log('Invalid character detected');
168
+ // console.log('Invalid character detected');
169
169
  input.value = inputValue.replace(/[^\d-]/g, '');
170
170
  return;
171
171
  }
@@ -173,7 +173,7 @@
173
173
  const numValue = parseFloat(inputValue);
174
174
  if (!isNaN(numValue)) {
175
175
  if (max !== undefined && numValue > max) {
176
- console.log('Number exceeds max:', { numValue, max });
176
+ // console.log('Number exceeds max:', { numValue, max });
177
177
  input.value = String(max);
178
178
  value = max;
179
179
  return;
@@ -190,7 +190,7 @@
190
190
  * Validates and normalizes input when focus is lost
191
191
  */
192
192
  function handleBlur() {
193
- console.log('handleBlur:', { value, isEditing, min, max });
193
+ // console.log('handleBlur:', { value, isEditing, min, max });
194
194
 
195
195
  isEditing = false;
196
196
  const input = document.getElementById('number-input') as HTMLInputElement;
@@ -228,7 +228,7 @@
228
228
  * Handles continuous increment/decrement while button is held
229
229
  */
230
230
  function startAutoRepeat(operation: 'increment' | 'decrement', event: MouseEvent) {
231
- console.log('๐ŸŽฏ startAutoRepeat called:', { operation });
231
+ // console.log('๐ŸŽฏ startAutoRepeat called:', { operation });
232
232
  event.preventDefault();
233
233
  event.stopPropagation();
234
234
 
@@ -239,20 +239,20 @@
239
239
  isPressed = true;
240
240
 
241
241
  // Handle initial click
242
- console.log('๐Ÿ‘† Initial click, applying adjustment:', adjustment);
242
+ // console.log('๐Ÿ‘† Initial click, applying adjustment:', adjustment);
243
243
  handleValueChange(adjustment);
244
244
 
245
245
  // Set up auto-repeat
246
- console.log('โณ Setting up auto-repeat timer for', HOLD_DELAY, 'ms');
246
+ // console.log('โณ Setting up auto-repeat timer for', HOLD_DELAY, 'ms');
247
247
 
248
248
  // Start auto-repeat after hold delay
249
249
  autoRepeatTimer = setTimeout(() => {
250
- console.log('โŒ› Hold delay completed, isPressed:', isPressed);
250
+ // console.log('โŒ› Hold delay completed, isPressed:', isPressed);
251
251
  if (isPressed) {
252
- console.log('๐Ÿ”„ Starting interval timer with delay:', REPEAT_INTERVAL);
252
+ // console.log('๐Ÿ”„ Starting interval timer with delay:', REPEAT_INTERVAL);
253
253
  autoRepeatInterval = setInterval(() => {
254
254
  if (isPressed) {
255
- console.log('โšก Interval tick - applying adjustment:', adjustment);
255
+ // console.log('โšก Interval tick - applying adjustment:', adjustment);
256
256
  handleValueChange(adjustment);
257
257
  }
258
258
  }, REPEAT_INTERVAL);
@@ -270,15 +270,15 @@
270
270
  event.stopPropagation();
271
271
  }
272
272
 
273
- console.log('๐Ÿ›‘ stopAutoRepeat called');
273
+ // console.log('๐Ÿ›‘ stopAutoRepeat called');
274
274
 
275
275
  if (autoRepeatTimer) {
276
- console.log('๐Ÿงน Clearing auto-repeat timer');
276
+ // console.log('๐Ÿงน Clearing auto-repeat timer');
277
277
  clearTimeout(autoRepeatTimer);
278
278
  autoRepeatTimer = undefined;
279
279
  }
280
280
  if (autoRepeatInterval) {
281
- console.log('๐Ÿงน Clearing auto-repeat interval');
281
+ // console.log('๐Ÿงน Clearing auto-repeat interval');
282
282
  clearInterval(autoRepeatInterval);
283
283
  autoRepeatInterval = undefined;
284
284
  }
@@ -291,7 +291,7 @@
291
291
  * Ensures auto-repeat timer is cleared when component is destroyed
292
292
  */
293
293
  onDestroy(() => {
294
- console.log('โ™ป๏ธ Component destroying, cleaning up timers');
294
+ // console.log('โ™ป๏ธ Component destroying, cleaning up timers');
295
295
  stopAutoRepeat();
296
296
  });
297
297
 
@@ -321,16 +321,16 @@
321
321
  * Manages keyboard interactions and shortcuts
322
322
  */
323
323
  function handleKeyDown(e: KeyboardEvent) {
324
- console.log('handleKeyDown:', {
325
- key: e.key,
326
- metaKey: e.metaKey,
327
- ctrlKey: e.ctrlKey,
328
- isEditing
329
- });
324
+ // console.log('handleKeyDown:', {
325
+ // key: e.key,
326
+ // metaKey: e.metaKey,
327
+ // ctrlKey: e.ctrlKey,
328
+ // isEditing
329
+ // });
330
330
 
331
331
  // Handle selection shortcuts
332
332
  if ((e.metaKey || e.ctrlKey) && e.key === 'a') {
333
- console.log('CMD+A detected, setting editing mode');
333
+ // console.log('CMD+A detected, setting editing mode');
334
334
  isEditing = true;
335
335
  return;
336
336
  }
@@ -44,7 +44,7 @@
44
44
  * @param newValue - The newly selected value
45
45
  */
46
46
  function handleValueChange(newValue: string) {
47
- console.log('RadioGroupInputController: handleValueChange', newValue);
47
+ // console.log('RadioGroupInputController: handleValueChange', newValue);
48
48
  localValue = newValue;
49
49
  onChange(newValue);
50
50
  }
@@ -84,7 +84,7 @@
84
84
  const adjustedValue = validateAndAdjustValue(value);
85
85
 
86
86
  if (adjustedValue[0] !== value[0] || adjustedValue[1] !== value[1]) {
87
- console.log('Adjusting initial range values to match constraints:', { original: value, adjusted: adjustedValue });
87
+ // console.log('Adjusting initial range values to match constraints:', { original: value, adjusted: adjustedValue });
88
88
  value = adjustedValue;
89
89
 
90
90
  // Wait for next tick to prevent scroll jump
@@ -15,7 +15,7 @@
15
15
 
16
16
  function toggle(newValue?: boolean) {
17
17
  value = typeof newValue === 'boolean' ? newValue : !value;
18
- console.log('[SwitchIC] Toggled:', { label, value });
18
+ // console.log('[SwitchIC] Toggled:', { label, value });
19
19
  onChange(value);
20
20
  }
21
21
  </script>