svelte-tweakpane-ui 1.0.1 → 1.0.2

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 (53) hide show
  1. package/dist/control/ButtonGrid.svelte +6 -7
  2. package/dist/control/Checkbox.svelte.d.ts +2 -4
  3. package/dist/control/Color.svelte.d.ts +2 -4
  4. package/dist/control/CubicBezier.svelte +1 -1
  5. package/dist/control/CubicBezier.svelte.d.ts +3 -0
  6. package/dist/control/Image.svelte.d.ts +2 -4
  7. package/dist/control/IntervalSlider.svelte.d.ts +2 -4
  8. package/dist/control/List.svelte +7 -13
  9. package/dist/control/List.svelte.d.ts +3 -5
  10. package/dist/control/Point.svelte.d.ts +29 -31
  11. package/dist/control/RadioGrid.svelte.d.ts +2 -4
  12. package/dist/control/Ring.svelte.d.ts +2 -4
  13. package/dist/control/RotationEuler.svelte.d.ts +66 -4
  14. package/dist/control/RotationQuaternion.svelte.d.ts +2 -4
  15. package/dist/control/Slider.svelte.d.ts +2 -4
  16. package/dist/control/Text.svelte.d.ts +2 -4
  17. package/dist/control/Textarea.svelte +1 -1
  18. package/dist/control/Textarea.svelte.d.ts +2 -4
  19. package/dist/control/Wheel.svelte.d.ts +2 -4
  20. package/dist/core/Blade.svelte +1 -1
  21. package/dist/core/TabPage.svelte +2 -2
  22. package/dist/extra/AutoObject.svelte +3 -5
  23. package/dist/extra/AutoValue.svelte.d.ts +6 -4
  24. package/dist/extra/Element.svelte +1 -3
  25. package/dist/index.js +5 -5
  26. package/dist/internal/ClsPad.svelte +2 -6
  27. package/dist/internal/ClsPad.svelte.d.ts +10 -0
  28. package/dist/internal/GenericBinding.svelte.d.ts +2 -4
  29. package/dist/internal/GenericBladeFolding.svelte +1 -1
  30. package/dist/internal/GenericInput.svelte.d.ts +2 -4
  31. package/dist/internal/GenericInputFolding.svelte +2 -2
  32. package/dist/internal/GenericInputFolding.svelte.d.ts +2 -4
  33. package/dist/internal/GenericMonitor.svelte +1 -1
  34. package/dist/internal/GenericMonitor.svelte.d.ts +2 -4
  35. package/dist/internal/GenericPane.svelte +4 -7
  36. package/dist/internal/GenericSlider.svelte.d.ts +2 -4
  37. package/dist/internal/InternalMonitorBoolean.svelte.d.ts +2 -4
  38. package/dist/internal/InternalMonitorNumber.svelte.d.ts +2 -4
  39. package/dist/internal/InternalMonitorString.svelte.d.ts +2 -4
  40. package/dist/internal/InternalPaneDraggable.svelte +19 -16
  41. package/dist/internal/InternalPaneFixed.svelte +1 -3
  42. package/dist/internal/InternalPaneInline.svelte +1 -1
  43. package/dist/monitor/FpsGraph.svelte +2 -2
  44. package/dist/monitor/Monitor.svelte.d.ts +23 -31
  45. package/dist/monitor/Profiler.svelte +2 -2
  46. package/dist/monitor/WaveformMonitor.svelte.d.ts +2 -4
  47. package/dist/theme.d.ts +1 -3
  48. package/dist/theme.js +25 -32
  49. package/dist/utils.d.ts +5 -2
  50. package/dist/utils.js +34 -27
  51. package/package.json +13 -7
  52. /package/{LICENSE → license.txt} +0 -0
  53. /package/{README.md → readme.md} +0 -0
@@ -32,14 +32,13 @@
32
32
  size: [gridDimensions.columns, gridDimensions.rows],
33
33
  view: 'buttongrid'
34
34
  };
35
- $: gridBlade &&
36
- gridBlade.on('click', (event) => {
37
- dispatch('click', {
38
- cell: { x: event.index[0], y: event.index[1] },
39
- index: event.index[1] * gridDimensions.columns + event.index[0],
40
- label: event.cell.title
41
- });
35
+ $: gridBlade?.on('click', (event) => {
36
+ dispatch('click', {
37
+ cell: { x: event.index[0], y: event.index[1] },
38
+ index: event.index[1] * gridDimensions.columns + event.index[0],
39
+ label: event.cell.title
42
40
  });
41
+ });
43
42
  </script>
44
43
 
45
44
  <Blade bind:ref={gridBlade} {options} plugin={pluginModule} {...$$restProps} />
@@ -7,11 +7,9 @@ declare const __propDef: {
7
7
  * The binding's target object with values to manipulate.
8
8
  * @bindable
9
9
  */
10
- object: import('@tweakpane/core').Bindable & {
11
- [x: string]: boolean;
12
- };
10
+ object: import('@tweakpane/core').Bindable & Record<string, boolean>;
13
11
  /** The key for the value in the target `object` that the control should manipulate. */
14
- key: string | number;
12
+ key: string;
15
13
  /**
16
14
  * Prevent interactivity and gray out the control.
17
15
  * @default `false`
@@ -25,11 +25,9 @@ declare const __propDef: {
25
25
  * The binding's target object with values to manipulate.
26
26
  * @bindable
27
27
  */
28
- object: import('@tweakpane/core').Bindable & {
29
- [x: string]: ColorValue;
30
- };
28
+ object: import('@tweakpane/core').Bindable & Record<string, ColorValue>;
31
29
  /** The key for the value in the target `object` that the control should manipulate. */
32
- key: string | number;
30
+ key: string;
33
31
  /**
34
32
  * Prevent interactivity and gray out the control.
35
33
  * @default `false`
@@ -30,7 +30,7 @@
30
30
  y1: event.value.y1,
31
31
  x2: event.value.x2,
32
32
  y2: event.value.y2
33
- };
33
+ };
34
34
  });
35
35
  }
36
36
  $: options = {
@@ -118,6 +118,9 @@ export type CubicBezierSlots = typeof __propDef.slots;
118
118
  * Usage outside of a `<Pane>` component will implicitly wrap the cubic bezier control in `<Pane
119
119
  * position='inline'>`.
120
120
  *
121
+ * Complete functionality of the `scale` prop is [pending a pull
122
+ * request](https://github.com/tweakpane/plugin-essentials/pull/19).
123
+ *
121
124
  * _Note: A memory leak has been observed in situations when the `value` prop is written frequently
122
125
  * from outside the component. See [issue
123
126
  * #18](https://github.com/tweakpane/plugin-essentials/issues/18) on the Plugin Essentials repo for
@@ -8,11 +8,9 @@ declare const __propDef: {
8
8
  * The binding's target object with values to manipulate.
9
9
  * @bindable
10
10
  */
11
- object: import('@tweakpane/core').Bindable & {
12
- [x: string]: ImageValue;
13
- };
11
+ object: import('@tweakpane/core').Bindable & Record<string, ImageValue>;
14
12
  /** The key for the value in the target `object` that the control should manipulate. */
15
- key: string | number;
13
+ key: string;
16
14
  /**
17
15
  * Prevent interactivity and gray out the control.
18
16
  * @default `false`
@@ -14,11 +14,9 @@ declare const __propDef: {
14
14
  * The binding's target object with values to manipulate.
15
15
  * @bindable
16
16
  */
17
- object: import('@tweakpane/core').Bindable & {
18
- [x: string]: IntervalSliderValue;
19
- };
17
+ object: import('@tweakpane/core').Bindable & Record<string, IntervalSliderValue>;
20
18
  /** The key for the value in the target `object` that the control should manipulate. */
21
- key: string | number;
19
+ key: string;
22
20
  /**
23
21
  * Prevent interactivity and gray out the control.
24
22
  * @default `false`
@@ -20,13 +20,11 @@
20
20
  if (Array.isArray(internalOptions)) {
21
21
  value = internalOptions[0].value;
22
22
  return value;
23
- } else {
24
- value = internalOptions[Object.keys(internalOptions)[0]];
25
- return value;
26
23
  }
27
- } else {
24
+ value = internalOptions[Object.keys(internalOptions)[0]];
28
25
  return value;
29
26
  }
27
+ return value;
30
28
  }
31
29
  function isArrayStyleListOptions(object) {
32
30
  return (
@@ -40,15 +38,11 @@
40
38
  return typeof object === 'object' && object !== null && !Array.isArray(object);
41
39
  }
42
40
  function getInternalOptions(options2) {
43
- if (isArrayStyleListOptions(options2)) {
44
- return options2;
45
- } else if (isObjectStyleListOptions(options2)) {
46
- return options2;
47
- } else {
48
- return options2.map((value2) => {
49
- return { value: value2, text: JSON.stringify(value2) };
50
- });
51
- }
41
+ return isArrayStyleListOptions(options2)
42
+ ? options2
43
+ : isObjectStyleListOptions(options2)
44
+ ? options2
45
+ : options2.map((value2) => ({ value: value2, text: JSON.stringify(value2) }));
52
46
  }
53
47
  function setValue() {
54
48
  listBlade.value = value;
@@ -1,13 +1,11 @@
1
1
  import { SvelteComponent } from 'svelte';
2
2
  import type { Simplify } from '../utils';
3
3
  export type ListOptionsArray<T> = T[];
4
- export type ListOptionsObjectArray<T> = {
4
+ export type ListOptionsObjectArray<T> = Array<{
5
5
  value: T;
6
6
  text: string;
7
- }[];
8
- export type ListOptionsRecord<T> = {
9
- [text: string]: T;
10
- };
7
+ }>;
8
+ export type ListOptionsRecord<T> = Record<string, T>;
11
9
  export type ListOptions<T> = Simplify<
12
10
  ListOptionsArray<T> | ListOptionsObjectArray<T> | ListOptionsRecord<T>
13
11
  >;
@@ -31,10 +31,10 @@ export type PointOptions<
31
31
  > = Dimensions extends '4'
32
32
  ? Point4dInputParams[Axis]
33
33
  : Dimensions extends '3'
34
- ? Point3dInputParams[Axis]
35
- : Dimensions extends '2'
36
- ? Point2dInputParams[Axis]
37
- : never;
34
+ ? Point3dInputParams[Axis]
35
+ : Dimensions extends '2'
36
+ ? Point2dInputParams[Axis]
37
+ : never;
38
38
  declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointValue4d> {
39
39
  props(): Omit<
40
40
  Omit<
@@ -43,11 +43,9 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
43
43
  * The binding's target object with values to manipulate.
44
44
  * @bindable
45
45
  */
46
- object: import('@tweakpane/core').Bindable & {
47
- [x: string]: T;
48
- };
46
+ object: import('@tweakpane/core').Bindable & Record<string, T>;
49
47
  /** The key for the value in the target `object` that the control should manipulate. */
50
- key: string | number;
48
+ key: string;
51
49
  /**
52
50
  * Prevent interactivity and gray out the control.
53
51
  * @default `false`
@@ -74,10 +72,10 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
74
72
  | (T extends PointValue4d
75
73
  ? Point4dInputParams
76
74
  : T extends PointValue3d
77
- ? Point3dInputParams
78
- : T extends PointValue2d
79
- ? Point2dInputParams
80
- : unknown)
75
+ ? Point3dInputParams
76
+ : T extends PointValue2d
77
+ ? Point2dInputParams
78
+ : unknown)
81
79
  | undefined;
82
80
  /**
83
81
  * Custom color scheme.
@@ -207,10 +205,10 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
207
205
  ? T_1 extends PointValue4d
208
206
  ? Point4dInputParams
209
207
  : T_1 extends PointValue3d
210
- ? Point3dInputParams
211
- : T_1 extends PointValue2d
212
- ? Point2dInputParams
213
- : unknown
208
+ ? Point3dInputParams
209
+ : T_1 extends PointValue2d
210
+ ? Point2dInputParams
211
+ : unknown
214
212
  : never
215
213
  : never)['x']
216
214
  | undefined;
@@ -231,14 +229,14 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
231
229
  ? T_2 extends PointValue4d
232
230
  ? Point4dInputParams
233
231
  : T_2 extends PointValue3d
234
- ? Point3dInputParams
235
- : T_2 extends PointValue2d
236
- ? Point2dInputParams
237
- : unknown
232
+ ? Point3dInputParams
233
+ : T_2 extends PointValue2d
234
+ ? Point2dInputParams
235
+ : unknown
238
236
  : never
239
237
  : never)['y']
240
238
  | undefined;
241
- }
239
+ }
242
240
  : unknown) &
243
241
  (T extends PointValue3d | PointValue4d
244
242
  ? {
@@ -255,14 +253,14 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
255
253
  ? T_3 extends PointValue4d
256
254
  ? Point4dInputParams
257
255
  : T_3 extends PointValue3d
258
- ? Point3dInputParams
259
- : T_3 extends PointValue2d
260
- ? Point2dInputParams
261
- : unknown
256
+ ? Point3dInputParams
257
+ : T_3 extends PointValue2d
258
+ ? Point2dInputParams
259
+ : unknown
262
260
  : never
263
261
  : never)['z']
264
262
  | undefined;
265
- }
263
+ }
266
264
  : unknown) &
267
265
  (T extends PointValue4d
268
266
  ? {
@@ -279,14 +277,14 @@ declare class __sveltets_Render<T extends PointValue2d | PointValue3d | PointVal
279
277
  ? T_4 extends PointValue4d
280
278
  ? Point4dInputParams
281
279
  : T_4 extends PointValue3d
282
- ? Point3dInputParams
283
- : T_4 extends PointValue2d
284
- ? Point2dInputParams
285
- : unknown
280
+ ? Point3dInputParams
281
+ : T_4 extends PointValue2d
282
+ ? Point2dInputParams
283
+ : unknown
286
284
  : never
287
285
  : never)['w']
288
286
  | undefined;
289
- }
287
+ }
290
288
  : unknown);
291
289
  events(): {} & {
292
290
  [evt: string]: CustomEvent<any>;
@@ -7,11 +7,9 @@ declare class __sveltets_Render<T extends number | string | boolean> {
7
7
  * The binding's target object with values to manipulate.
8
8
  * @bindable
9
9
  */
10
- object: import('@tweakpane/core').Bindable & {
11
- [x: string]: T;
12
- };
10
+ object: import('@tweakpane/core').Bindable & Record<string, T>;
13
11
  /** The key for the value in the target `object` that the control should manipulate. */
14
- key: string | number;
12
+ key: string;
15
13
  /**
16
14
  * Prevent interactivity and gray out the control.
17
15
  * @default `false`
@@ -33,11 +33,9 @@ declare const __propDef: {
33
33
  * The binding's target object with values to manipulate.
34
34
  * @bindable
35
35
  */
36
- object: import('@tweakpane/core').Bindable & {
37
- [x: string]: number;
38
- };
36
+ object: import('@tweakpane/core').Bindable & Record<string, number>;
39
37
  /** The key for the value in the target `object` that the control should manipulate. */
40
- key: string | number;
38
+ key: string;
41
39
  /**
42
40
  * Prevent interactivity and gray out the control.
43
41
  * @default `false`
@@ -22,11 +22,73 @@ declare const __propDef: {
22
22
  * The binding's target object with values to manipulate.
23
23
  * @bindable
24
24
  */
25
- object: import('@tweakpane/core').Bindable & {
26
- [x: string]: RotationEulerValue;
27
- };
25
+ object: import('@tweakpane/core').Bindable & Record<string, RotationEulerValue>;
28
26
  /** The key for the value in the target `object` that the control should manipulate. */
29
- key: string | number;
27
+ key: string /**
28
+ * Integrates the [euler
29
+ * rotation](https://github.com/0b5vr/tweakpane-plugin-rotation/blob/dev/src/RotationInputPluginEuler.ts)
30
+ * control from [0b5vr's](https://0b5vr.com)
31
+ * [tweakpane-plugin-rotation](https://github.com/0b5vr/tweakpane-plugin-rotation).
32
+ *
33
+ * _Svelte Tweakpane UI_ extends the original API to support tuple values in addition to object values.
34
+ * (Useful when working with frameworks like [three.js](https://threejs.org) /
35
+ * [threlte](https://threlte.xyz).)
36
+ *
37
+ * A utility function `Utils.eulerToCssTransform()` is also provided to easily convert a quaternion
38
+ * value object or tuple into a CSS transform string.
39
+ *
40
+ * See also <RotationQuaternion> if you're feeling gimbal locked.
41
+ *
42
+ * Usage outside of a `<Pane>` component will implicitly wrap the profiler in `<Pane
43
+ * position='inline'>`.
44
+ *
45
+ * @example
46
+ * ```svelte
47
+ * <script lang="ts">
48
+ * import {
49
+ * Button,
50
+ * RotationEuler,
51
+ * type RotationEulerValueObject,
52
+ * Utils
53
+ * } from 'svelte-tweakpane-ui';
54
+ *
55
+ * // Value could also be a tuple
56
+ * // e.g. [0, 0, 0]
57
+ * let value: RotationEulerValueObject = { x: 0, y: 0, z: 0 };
58
+ *
59
+ * $: transform = Utils.eulerToCssTransform(value);
60
+ * $: valueRows = Object.values(value)
61
+ * .map((v) => `${v >= 0 ? '+' : ''}${v.toFixed(6)}`)
62
+ * .join('\n');
63
+ * </script>
64
+ *
65
+ * <RotationEuler
66
+ * bind:value
67
+ * expanded={true}
68
+ * label="CSS Rotation"
69
+ * picker={'inline'}
70
+ * />
71
+ * <Button on:click={() => (value = { x: 0, y: 0, z: 0 })} title="Reset" />
72
+ *
73
+ * <div class="billboard" style:transform>
74
+ * <pre>{valueRows}</pre>
75
+ * </div>
76
+ *
77
+ * <style>
78
+ * div.billboard {
79
+ * display: flex;
80
+ * align-items: center;
81
+ * justify-content: center;
82
+ * aspect-ratio: 1;
83
+ * width: 100%;
84
+ * background: linear-gradient(45deg, magenta, orange);
85
+ * }
86
+ * </style>
87
+ * ```
88
+ *
89
+ * @sourceLink
90
+ * [RotationEuler.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/control/RotationEuler.svelte)
91
+ */;
30
92
  /**
31
93
  * Prevent interactivity and gray out the control.
32
94
  * @default `false`
@@ -21,11 +21,9 @@ declare const __propDef: {
21
21
  * The binding's target object with values to manipulate.
22
22
  * @bindable
23
23
  */
24
- object: import('@tweakpane/core').Bindable & {
25
- [x: string]: RotationQuaternionValue;
26
- };
24
+ object: import('@tweakpane/core').Bindable & Record<string, RotationQuaternionValue>;
27
25
  /** The key for the value in the target `object` that the control should manipulate. */
28
- key: string | number;
26
+ key: string;
29
27
  /**
30
28
  * Prevent interactivity and gray out the control.
31
29
  * @default `false`
@@ -7,11 +7,9 @@ declare const __propDef: {
7
7
  * The binding's target object with values to manipulate.
8
8
  * @bindable
9
9
  */
10
- object: import('@tweakpane/core').Bindable & {
11
- [x: string]: number;
12
- };
10
+ object: import('@tweakpane/core').Bindable & Record<string, number>;
13
11
  /** The key for the value in the target `object` that the control should manipulate. */
14
- key: string | number;
12
+ key: string;
15
13
  /**
16
14
  * Prevent interactivity and gray out the control.
17
15
  * @default `false`
@@ -8,11 +8,9 @@ declare const __propDef: {
8
8
  * The binding's target object with values to manipulate.
9
9
  * @bindable
10
10
  */
11
- object: import('@tweakpane/core').Bindable & {
12
- [x: string]: string;
13
- };
11
+ object: import('@tweakpane/core').Bindable & Record<string, string>;
14
12
  /** The key for the value in the target `object` that the control should manipulate. */
15
- key: string | number;
13
+ key: string;
16
14
  /**
17
15
  * Prevent interactivity and gray out the control.
18
16
  * @default `false`
@@ -22,7 +22,7 @@
22
22
  value = event.target.value;
23
23
  }
24
24
  function updateListeners(live2, destroy = false) {
25
- var input = ref?.controller.valueController.view.element.querySelector('textarea');
25
+ const input = ref?.controller.valueController.view.element.querySelector('textarea');
26
26
  if (input) {
27
27
  input.removeEventListener('blur', onBlur);
28
28
  input.removeEventListener('input', onInput);
@@ -9,11 +9,9 @@ declare const __propDef: {
9
9
  * The binding's target object with values to manipulate.
10
10
  * @bindable
11
11
  */
12
- object: import('@tweakpane/core').Bindable & {
13
- [x: string]: string;
14
- };
12
+ object: import('@tweakpane/core').Bindable & Record<string, string>;
15
13
  /** The key for the value in the target `object` that the control should manipulate. */
16
- key: string | number;
14
+ key: string;
17
15
  /**
18
16
  * Prevent interactivity and gray out the control.
19
17
  * @default `false`
@@ -7,11 +7,9 @@ declare const __propDef: {
7
7
  * The binding's target object with values to manipulate.
8
8
  * @bindable
9
9
  */
10
- object: import('@tweakpane/core').Bindable & {
11
- [x: string]: number;
12
- };
10
+ object: import('@tweakpane/core').Bindable & Record<string, number>;
13
11
  /** The key for the value in the target `object` that the control should manipulate. */
14
- key: string | number;
12
+ key: string;
15
13
  /**
16
14
  * Prevent interactivity and gray out the control.
17
15
  * @default `false`
@@ -26,7 +26,7 @@
26
26
  index,
27
27
  ...options,
28
28
  disabled
29
- // why last?
29
+ // Why last?
30
30
  });
31
31
  ref = _ref;
32
32
  }
@@ -24,10 +24,10 @@
24
24
  function create() {
25
25
  if (!$tabGroupStore) {
26
26
  $tabGroupStore = $parentStore.addTab({
27
- // tabs MUST be created with at least one page how to handle tabs with no children?
27
+ // Tabs MUST be created with at least one page how to handle tabs with no children?
28
28
  disabled: false,
29
29
  index: $tabIndexStore,
30
- // could be cleaner to have children create the tab as needed?
30
+ // Could be cleaner to have children create the tab as needed?
31
31
  pages: [{ title }]
32
32
  });
33
33
  $tabPageStore = $tabGroupStore.pages[0];
@@ -20,12 +20,10 @@
20
20
  function prettify(value, active = true) {
21
21
  if (!active) return value;
22
22
  return value
23
- .replace(/([\da-z])([A-Z])/g, '$1 $2')
24
- .replace(/[_-]+/g, ' ')
23
+ .replaceAll(/([\da-z])([A-Z])/g, '$1 $2')
24
+ .replaceAll(/[_-]+/g, ' ')
25
25
  .toLowerCase()
26
- .replace(/\b[a-z]/g, (letter) => {
27
- return letter.toUpperCase();
28
- });
26
+ .replaceAll(/\b[a-z]/g, (letter) => letter.toUpperCase());
29
27
  }
30
28
  </script>
31
29
 
@@ -7,11 +7,10 @@ declare const __propDef: {
7
7
  * The binding's target object with values to manipulate.
8
8
  * @bindable
9
9
  */
10
- object: import('@tweakpane/core').Bindable & {
11
- [x: string]: string | number | boolean | object;
12
- };
10
+ object: import('@tweakpane/core').Bindable &
11
+ Record<string, string | number | boolean | object>;
13
12
  /** The key for the value in the target `object` that the control should manipulate. */
14
- key: string | number;
13
+ key: string;
15
14
  /**
16
15
  * Prevent interactivity and gray out the control.
17
16
  * @default `false`
@@ -114,6 +113,9 @@ export type AutoValueSlots = typeof __propDef.slots;
114
113
  * <AutoValue bind:value={point} label="Point" />
115
114
  * <AutoValue bind:value={text} label="Text" />
116
115
  * ```
116
+ *
117
+ * @sourceLink
118
+ * [AutoValue.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/extra/AutoValue.svelte)
117
119
  */
118
120
  export default class AutoValue extends SvelteComponent<
119
121
  AutoValueProps,
@@ -9,9 +9,7 @@
9
9
  };
10
10
  let ref;
11
11
  let sourceDiv;
12
- $: if (ref && ref.element) {
13
- ref.element.replaceChildren(sourceDiv);
14
- }
12
+ $: ref?.element.replaceChildren(sourceDiv);
15
13
  </script>
16
14
 
17
15
  {#if BROWSER}
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- // components
1
+ // Components
2
2
  // essentials (1st party plugins)
3
3
  export { default as ButtonGrid } from './control/ButtonGrid.svelte';
4
4
  export { default as Checkbox } from './control/Checkbox.svelte';
5
5
  export { default as Color } from './control/Color.svelte';
6
6
  export { default as CubicBezier } from './control/CubicBezier.svelte';
7
- // additional plugins (3rd party / community)
7
+ // Additional plugins (3rd party / community)
8
8
  export { default as Image } from './control/Image.svelte';
9
9
  export { default as IntervalSlider } from './control/IntervalSlider.svelte';
10
10
  export { default as List } from './control/List.svelte';
11
11
  export { default as Point } from './control/Point.svelte';
12
12
  export { default as RadioGrid } from './control/RadioGrid.svelte';
13
- // camerakit (1st party plugins)
13
+ // Camerakit (1st party plugins)
14
14
  export { default as Ring } from './control/Ring.svelte';
15
15
  export { default as RotationEuler } from './control/RotationEuler.svelte';
16
16
  export { default as RotationQuaternion } from './control/RotationQuaternion.svelte';
@@ -18,7 +18,7 @@ export { default as Slider } from './control/Slider.svelte';
18
18
  export { default as Text } from './control/Text.svelte';
19
19
  export { default as Textarea } from './control/Textarea.svelte';
20
20
  export { default as Wheel } from './control/Wheel.svelte';
21
- // core (tweakpane building blocks)
21
+ // Core (tweakpane building blocks)
22
22
  export { default as Binding } from './core/Binding.svelte';
23
23
  export { default as Blade } from './core/Blade.svelte';
24
24
  export { default as Button } from './core/Button.svelte';
@@ -27,7 +27,7 @@ export { default as Pane } from './core/Pane.svelte';
27
27
  export { default as Separator } from './core/Separator.svelte';
28
28
  export { default as TabGroup } from './core/TabGroup.svelte';
29
29
  export { default as TabPage } from './core/TabPage.svelte';
30
- // extra (svelte convenience components)
30
+ // Extra (svelte convenience components)
31
31
  export { default as AutoObject } from './extra/AutoObject.svelte';
32
32
  export { default as AutoValue } from './extra/AutoValue.svelte';
33
33
  export { default as Element } from './extra/Element.svelte';
@@ -14,12 +14,8 @@
14
14
  }
15
15
  function getTotal(add, sub, extra2 = 0) {
16
16
  return (
17
- add.reduce((accumulator, key) => {
18
- return (accumulator += getPixelValue(getValueOrFallback(theme, key)));
19
- }, 0) -
20
- sub.reduce((accumulator, key) => {
21
- return (accumulator += getPixelValue(getValueOrFallback(theme, key)));
22
- }, 0) +
17
+ add.reduce((acc, key) => (acc += getPixelValue(getValueOrFallback(theme, key))), 0) -
18
+ sub.reduce((acc, key) => (acc += getPixelValue(getValueOrFallback(theme, key))), 0) +
23
19
  extra2
24
20
  );
25
21
  }
@@ -91,5 +91,15 @@ declare const __propDef: {
91
91
  export type ClsPadProps = typeof __propDef.props;
92
92
  export type ClsPadEvents = typeof __propDef.events;
93
93
  export type ClsPadSlots = typeof __propDef.slots;
94
+ /**
95
+ * This component is for internal use only.
96
+ *
97
+ * It's a utility to assist in estimating the rendered height of Tweakpane components for use during prerendering in an attempt to minimize layout shift upon hydration.
98
+ *
99
+ * The associated SSR / prerendering CLS prevention feature is experimental.
100
+ *
101
+ * @sourceLink
102
+ * [ClsPad.svelte](https://github.com/kitschpatrol/svelte-tweakpane-ui/blob/main/src/lib/internal/ClsPad.svelte)
103
+ */
94
104
  export default class ClsPad extends SvelteComponent<ClsPadProps, ClsPadEvents, ClsPadSlots> {}
95
105
  export {};
@@ -11,11 +11,9 @@ declare class __sveltets_Render<
11
11
  * The binding's target object with values to manipulate.
12
12
  * @bindable
13
13
  */
14
- object: import('@tweakpane/core').Bindable & {
15
- [x: string]: T;
16
- };
14
+ object: import('@tweakpane/core').Bindable & Record<string, T>;
17
15
  /** The key for the value in the target `object` that the control should manipulate. */
18
- key: string | number;
16
+ key: string;
19
17
  /**
20
18
  * Prevent interactivity and gray out the control.
21
19
  * @default `false`
@@ -22,7 +22,7 @@
22
22
  $: options = {
23
23
  ...options,
24
24
  expanded: initialExpanded,
25
- // only set once
25
+ // Only set once
26
26
  picker
27
27
  };
28
28
  $: ref &&