svelte-tweakpane-ui 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,13 +1,20 @@
1
1
  # svelte-tweakpane-ui
2
2
 
3
+ [![NPM Package](https://img.shields.io/npm/v/svelte-tweakpane-ui.svg)](https://npmjs.com/package/svelte-tweakpane-ui)
4
+ [![Documentation](https://img.shields.io/badge/-documentation-ffdd00?logo=readthedocs&logoColor=222222)](https://kitschpatrol.com/svelte-tweakpane-ui)
5
+
3
6
  ## Overview
4
7
 
5
- 🎛️ **_Svelte Tweakpane UI_** wraps user-interface elements from the excellent [Tweakpane](https://cocopon.github.io/tweakpane/) library in a collection of 31 idiomatic, reactive, type-safe, carefully-crafted [Svelte](https://svelte.dev) components.
8
+ 🎛️ **_Svelte Tweakpane UI_** wraps user-interface elements from the excellent [Tweakpane](https://cocopon.github.io/tweakpane/) library in a collection of 31 idiomatic, reactive, type-safe, carefully-crafted, and obsessively-documented [Svelte](https://svelte.dev) components.
6
9
 
7
- The library makes it easy to quickly and declaratively add knobs and dials to your projects using components that feel like they belong in the DOM. It also augments Tweakpane with a few [extra features](https://kitschpatrol.com/svelte-tweakpane-ui/docs/features) for your convenience and enjoyment.
10
+ The library makes it easy to quickly and declaratively add knobs and dials to your projects using components that feel like they were made for Svelte. It also augments Tweakpane with a few [extra features](https://kitschpatrol.com/svelte-tweakpane-ui/docs/features) for your convenience and enjoyment.
8
11
 
9
12
  [The components](https://kitschpatrol.com/svelte-tweakpane-ui/docs#components) should be useful for integrating controls and value monitoring in parametrically driven artworks or simulations.
10
13
 
14
+ ## Demo
15
+
16
+ ![Svelte Tweakpane UI quick demo](./docs/public/quick-demo.gif)
17
+
11
18
  ## Documentation
12
19
 
13
20
  **_Please see the documentation site for much more information:_**
@@ -28,7 +35,7 @@ npm install svelte-tweakpane-ui
28
35
  import { Button } from 'svelte-tweakpane-ui';
29
36
  </script>
30
37
 
31
- <Button on:click={() => alert('Hi from STUI')} />
38
+ <Button on:click={() => alert('🎛️')} />
32
39
  ```
33
40
 
34
41
  ---
@@ -33,11 +33,11 @@
33
33
  view: 'buttongrid'
34
34
  };
35
35
  $: gridBlade &&
36
- gridBlade.on('click', (ev) => {
36
+ gridBlade.on('click', (event) => {
37
37
  dispatch('click', {
38
- cell: { x: ev.index[0], y: ev.index[1] },
39
- index: ev.index[1] * gridDimensions.columns + ev.index[0],
40
- label: ev.cell.title
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
41
  });
42
42
  });
43
43
  </script>
@@ -128,7 +128,9 @@ export type ButtonGridSlots = typeof __propDef.slots;
128
128
  * } from 'svelte-tweakpane-ui';
129
129
  *
130
130
  * const keyboard = [
131
- * ...Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i)),
131
+ * ...Array.from({ length: 26 }, (_, index) =>
132
+ * String.fromCodePoint(65 + index)
133
+ * ),
132
134
  * ',',
133
135
  * '.',
134
136
  * '!',
@@ -137,11 +139,11 @@ export type ButtonGridSlots = typeof __propDef.slots;
137
139
  *
138
140
  * let textBuffer = '';
139
141
  *
140
- * function handleClick(e: ButtonGridClickEvent) {
142
+ * function handleClick(event: ButtonGridClickEvent) {
141
143
  * textBuffer =
142
- * e.detail.label === '⌫'
144
+ * event.detail.label === '⌫'
143
145
  * ? textBuffer.slice(0, -1)
144
- * : textBuffer + e.detail.label;
146
+ * : textBuffer + event.detail.label;
145
147
  * }
146
148
  * </script>
147
149
  *
@@ -14,31 +14,23 @@
14
14
  let cubicBezierBlade;
15
15
  const buttonClass = 'tp-cbzv_b';
16
16
  function getValue() {
17
- if (Array.isArray(value)) {
18
- return value;
19
- } else {
20
- return [value.x1, value.y1, value.x2, value.y2];
21
- }
17
+ return Array.isArray(value) ? value : [value.x1, value.y1, value.x2, value.y2];
22
18
  }
23
19
  function setValue() {
24
- if (Array.isArray(value)) {
25
- cubicBezierBlade.value = new CubicBezier(value[0], value[1], value[2], value[3]);
26
- } else {
27
- cubicBezierBlade.value = new CubicBezier(value.x1, value.y1, value.x2, value.y2);
28
- }
20
+ cubicBezierBlade.value = Array.isArray(value)
21
+ ? new CubicBezier(value[0], value[1], value[2], value[3])
22
+ : new CubicBezier(value.x1, value.y1, value.x2, value.y2);
29
23
  }
30
24
  function addEvent() {
31
- cubicBezierBlade.on('change', (ev) => {
32
- if (Array.isArray(value)) {
33
- value = [ev.value.x1, ev.value.y1, ev.value.x2, ev.value.y2];
34
- } else {
35
- value = {
36
- x1: ev.value.x1,
37
- y1: ev.value.y1,
38
- x2: ev.value.x2,
39
- y2: ev.value.y2
40
- };
41
- }
25
+ cubicBezierBlade.on('change', (event) => {
26
+ value = Array.isArray(value)
27
+ ? [event.value.x1, event.value.y1, event.value.x2, event.value.y2]
28
+ : {
29
+ x1: event.value.x1,
30
+ y1: event.value.y1,
31
+ x2: event.value.x2,
32
+ y2: event.value.y2
33
+ };
42
34
  });
43
35
  }
44
36
  $: options = {
@@ -136,7 +136,7 @@ export type CubicBezierSlots = typeof __propDef.slots;
136
136
  * import { tweened } from 'svelte/motion';
137
137
  *
138
138
  * // could also be a tuple
139
- * let value: CubicBezierValue = { x1: 0.25, y1: 0.1, x2: 0.25, y2: 1.0 };
139
+ * let value: CubicBezierValue = { x1: 0.25, y1: 0.1, x2: 0.25, y2: 1 };
140
140
  * let duration = 1000;
141
141
  * let moods = ['Set', 'Rise'];
142
142
  * let mood: string = moods[0];
@@ -160,7 +160,7 @@ export type CubicBezierSlots = typeof __propDef.slots;
160
160
  * <Slider
161
161
  * bind:value={duration}
162
162
  * min={0}
163
- * max={10000}
163
+ * max={10_000}
164
164
  * format={(v) => `${(v / 1000).toFixed(1)}`}
165
165
  * label="Duration (Seconds)"
166
166
  * />
@@ -125,14 +125,14 @@ export type ImageSlots = typeof __propDef.slots;
125
125
  * <script lang="ts">
126
126
  * import { Button, Image } from 'svelte-tweakpane-ui';
127
127
  *
128
- * let src = 'placeholder';
128
+ * let source = 'placeholder';
129
129
  * let kittenIndex = 1;
130
130
  * </script>
131
131
  *
132
- * <Image bind:value={src} fit="contain" label="Image" />
132
+ * <Image bind:value={source} fit="contain" label="Image" />
133
133
  * <Button
134
134
  * on:click={() => {
135
- * src = `https://placekitten.com/1024/1024?image=${kittenIndex}`;
135
+ * source = `https://placekitten.com/1024/1024?image=${kittenIndex}`;
136
136
  * kittenIndex = (kittenIndex % 16) + 1;
137
137
  * }}
138
138
  * label="Random Placeholder"
@@ -140,10 +140,10 @@ export type ImageSlots = typeof __propDef.slots;
140
140
  * />
141
141
  *
142
142
  * <div class="demo">
143
- * {#if src === 'placeholder'}
143
+ * {#if source === 'placeholder'}
144
144
  * <p>Tap “No Image” above to load an image from disk.</p>
145
145
  * {:else}
146
- * <img alt="" {src} />
146
+ * <img alt="" src={source} />
147
147
  * {/if}
148
148
  * </div>
149
149
  *
@@ -10,8 +10,8 @@
10
10
  let listBlade;
11
11
  let bladeOptions;
12
12
  function addEvent() {
13
- listBlade.on('change', (ev) => {
14
- value = ev.value;
13
+ listBlade.on('change', (event) => {
14
+ value = event.value;
15
15
  });
16
16
  }
17
17
  function getInitialValue() {
@@ -28,16 +28,16 @@
28
28
  return value;
29
29
  }
30
30
  }
31
- function isArrayStyleListOptions(obj) {
31
+ function isArrayStyleListOptions(object) {
32
32
  return (
33
- Array.isArray(obj) &&
34
- obj.every(
33
+ Array.isArray(object) &&
34
+ object.every(
35
35
  (item) => typeof item === 'object' && item !== null && 'text' in item && 'value' in item
36
36
  )
37
37
  );
38
38
  }
39
- function isObjectStyleListOptions(obj) {
40
- return typeof obj === 'object' && obj !== null && !Array.isArray(obj);
39
+ function isObjectStyleListOptions(object) {
40
+ return typeof object === 'object' && object !== null && !Array.isArray(object);
41
41
  }
42
42
  function getInternalOptions(options2) {
43
43
  if (isArrayStyleListOptions(options2)) {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  }
15
15
  function updateListeners(live2, destroy = false) {
16
- let input = ref?.controller.valueController.view.element.getElementsByTagName('input')[0];
16
+ let input = ref?.controller.valueController.view.element.querySelector('input');
17
17
  if (input) {
18
18
  input.removeEventListener('input', onInput);
19
19
  !destroy && live2 && input.addEventListener('input', onInput);
@@ -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.getElementsByTagName('textarea')[0];
25
+ var input = ref?.controller.valueController.view.element.querySelector('textarea');
26
26
  if (input) {
27
27
  input.removeEventListener('blur', onBlur);
28
28
  input.removeEventListener('input', onInput);
@@ -22,15 +22,13 @@
22
22
  $tabGroupStore?.dispose();
23
23
  });
24
24
  function setUpListeners(t) {
25
- t?.on('select', (e) => {
26
- selectedIndex = e.index;
25
+ t?.on('select', (event) => {
26
+ selectedIndex = event.index;
27
27
  });
28
28
  }
29
29
  function setSelectedIndex(index) {
30
30
  const tabPageApi = $tabGroupStore?.pages.at(index);
31
- if (tabPageApi) {
32
- if (!tabPageApi.selected) tabPageApi.selected = true;
33
- }
31
+ if (tabPageApi && !tabPageApi.selected) tabPageApi.selected = true;
34
32
  }
35
33
  $: BROWSER && setUpListeners($tabGroupStore);
36
34
  $: BROWSER && setSelectedIndex(selectedIndex);
@@ -12,13 +12,15 @@
12
12
  export let prettyLabels = true;
13
13
  export let object;
14
14
  const parentStore = getContext('parentStore');
15
- function isPointObject(obj) {
16
- return Point2d.isObject(obj) || Point3d.isObject(obj) || Point4d.isObject(obj);
15
+ function isPointObject(testObject) {
16
+ return (
17
+ Point2d.isObject(testObject) || Point3d.isObject(testObject) || Point4d.isObject(testObject)
18
+ );
17
19
  }
18
20
  function prettify(value, active = true) {
19
21
  if (!active) return value;
20
22
  return value
21
- .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
23
+ .replace(/([\da-z])([A-Z])/g, '$1 $2')
22
24
  .replace(/[_-]+/g, ' ')
23
25
  .toLowerCase()
24
26
  .replace(/\b[a-z]/g, (letter) => {
@@ -27,7 +27,7 @@
27
27
  <div
28
28
  class="element-container"
29
29
  style:height={BROWSER ? null : `${maxHeight}px`}
30
- style:max-height={maxHeight !== undefined ? `${maxHeight}px` : null}
30
+ style:max-height={maxHeight === undefined ? null : `${maxHeight}px`}
31
31
  style:overflow={BROWSER ? null : 'hidden'}
32
32
  >
33
33
  <div class:reset={resetStyle}>
@@ -44,20 +44,22 @@ declare const __propDef: {
44
44
  'options' | 'disabled' | 'ref' | 'plugin'
45
45
  > & {
46
46
  /**
47
- * Maximum height of the element block, in pixels. By default, the element block will expand
48
- * vertically to fit its contents, but clip any horizontal excess.
47
+ * Maximum height of the element block, in pixels. By default, the element
48
+ * block will expand vertically to fit its contents, but clip any horizontal
49
+ * excess.
49
50
  *
50
- * If a max height is set, it is used as the component height during SSR. If the actual
51
- * element content is less than the max, you will see CLS. If it is not set, the contents
52
- * are rendered... but keep in mind that style and other contextual changes during the
53
- * client render could result in CLS.
51
+ * If a max height is set, it is used as the component height during SSR. If
52
+ * the actual element content is less than the max, you will see CLS. If it
53
+ * is not set, the contents are rendered... but keep in mind that style and
54
+ * other contextual changes during the client render could result in CLS.
54
55
  * @default `undefined` \
55
56
  * No max height.
56
57
  */
57
58
  maxHeight?: number | undefined;
58
59
  /**
59
- * Whether to reset the CSS of the element block to its default values. Avoids inheritance
60
- * of Tweakpane's CSS styles. Note that this uses a simple `all: initial;` rule.
60
+ * Whether to reset the CSS of the element block to its default values.
61
+ * Avoids inheritance of Tweakpane's CSS styles. Note that this uses a
62
+ * simple `all: initial;` rule.
61
63
  * @default `true`
62
64
  */
63
65
  resetStyle?: boolean | undefined;
@@ -78,25 +80,30 @@ export type ElementSlots = typeof __propDef.slots;
78
80
  /**
79
81
  * A component for embedding arbitrary HTML elements into a pane.
80
82
  *
81
- * Any children wrapped in this component will be rendered into the pane. Any content larger than the
82
- * pane in the horizontal axis will be clipped.
83
+ * Any children wrapped in this component will be rendered into the pane. Any
84
+ * content larger than the pane in the horizontal axis will be clipped.
83
85
  *
84
- * Useful for quickly prototyping UIs, or adding content to a pane that's not easily represented by the
85
- * built-in components.
86
+ * Useful for quickly prototyping UIs, or adding content to a pane that's not
87
+ * easily represented by the built-in components.
86
88
  *
87
- * Think of this component as an escape hatch for getting something into the pane that you couldn't
88
- * otherwise, but it's recommended to abstract new functionality for reuse by extending one of the
89
- * internal component types in 'svelte-tweakpane-ui', or better yet by creating a new [Tweakpane
90
- * Plugin](https://github.com/tweakpane/plugin-template).
89
+ * This component does not have a direct analog in the vanilla Tweakpane universe.
91
90
  *
92
- * In many cases, this component should not be necessary because _Svelte Tweakpane UI_ already makes it
93
- * easy to combine tweakpane components with other inline elements simply by not using a wrapping
94
- * `<Pane>` component. It should generally be the most useful when you're using `<Pane
95
- * position='draggable'>` or `<Pane position='fixed'>` and you want a custom element embedded in the
96
- * pane.
91
+ * Think of `<Element>` as an escape hatch for getting something into the pane that
92
+ * you couldn't otherwise. Generally, it's recommended to abstract new
93
+ * functionality for reuse by extending one of the internal component types in
94
+ * 'svelte-tweakpane-ui', or better yet by creating a new [Tweakpane
95
+ * Plugin](https://github.com/tweakpane/plugin-template) — but sometimes you just
96
+ * need to get something into the pane quickly.
97
97
  *
98
- * Usage outside of a `<Pane>` component doesn't make a ton of sense, but in such a case the
99
- * `<Element>` will be implicitly wrapped in `<Pane position='inline'>`.
98
+ * In many cases, this component should not be necessary because _Svelte Tweakpane
99
+ * UI_ already makes it easy to combine tweakpane components with other inline
100
+ * elements simply by using stand-alone components or a `<Pane position='inline'>`
101
+ * component. `<Element>` should generally be the most useful when you're using
102
+ * `<Pane position='draggable'>` or `<Pane position='fixed'>` and you want a custom
103
+ * element embedded in the pane.
104
+ *
105
+ * Usage outside of a `<Pane>` component doesn't make a ton of sense, but in such a
106
+ * case the `<Element>` will be implicitly wrapped in `<Pane position='inline'>`.
100
107
  *
101
108
  * @example
102
109
  * ```svelte
@@ -10,15 +10,15 @@
10
10
  return '#' + Math.floor(Math.random() * 16777215).toString(16);
11
11
  }
12
12
  function getPixelValue(s) {
13
- return parseFloat(s.replace('px', ''));
13
+ return Number.parseFloat(s.replace('px', ''));
14
14
  }
15
15
  function getTotal(add, sub, extra2 = 0) {
16
16
  return (
17
- add.reduce((acc, key) => {
18
- return (acc += getPixelValue(getValueOrFallback(theme, key)));
17
+ add.reduce((accumulator, key) => {
18
+ return (accumulator += getPixelValue(getValueOrFallback(theme, key)));
19
19
  }, 0) -
20
- sub.reduce((acc, key) => {
21
- return (acc += getPixelValue(getValueOrFallback(theme, key)));
20
+ sub.reduce((accumulator, key) => {
21
+ return (accumulator += getPixelValue(getValueOrFallback(theme, key)));
22
22
  }, 0) +
23
23
  extra2
24
24
  );
@@ -14,8 +14,8 @@
14
14
  let internalExpanded = initialExpanded;
15
15
  $: if (!gotBlade && ref) {
16
16
  gotBlade = true;
17
- ref.controller?.valueController?.foldable_?.value('expanded').emitter.on('change', (e) => {
18
- internalExpanded = e.rawValue;
17
+ ref.controller?.valueController?.foldable_?.value('expanded').emitter.on('change', (event) => {
18
+ internalExpanded = event.rawValue;
19
19
  expanded = internalExpanded;
20
20
  });
21
21
  }
@@ -31,8 +31,8 @@
31
31
  $: ref &&
32
32
  buttonClass !== void 0 &&
33
33
  expanded !== internalExpanded &&
34
- ref.element.getElementsByClassName(buttonClass).length > 0 &&
35
- ref.element.getElementsByClassName(buttonClass)[0].click();
34
+ ref.element.querySelectorAll(`.${buttonClass}`).length > 0 &&
35
+ ref.element.querySelector(`.${buttonClass}`).click();
36
36
  </script>
37
37
 
38
38
  <Blade bind:ref {options} {...$$restProps} />
@@ -18,8 +18,8 @@
18
18
  let internalExpanded = initialExpanded;
19
19
  $: if (!gotBinding && ref) {
20
20
  gotBinding = true;
21
- ref.controller?.valueController?.foldable_?.value('expanded').emitter.on('change', (e) => {
22
- internalExpanded = e.rawValue;
21
+ ref.controller?.valueController?.foldable_?.value('expanded').emitter.on('change', (event) => {
22
+ internalExpanded = event.rawValue;
23
23
  expanded = internalExpanded;
24
24
  });
25
25
  }
@@ -33,8 +33,8 @@
33
33
  $: ref &&
34
34
  buttonClass &&
35
35
  expanded !== internalExpanded &&
36
- ref.element.getElementsByClassName(buttonClass).length > 0 &&
37
- ref.element.getElementsByClassName(buttonClass)[0].click();
36
+ ref.element.querySelectorAll(`.${buttonClass}`).length > 0 &&
37
+ ref.element.querySelector(`.${buttonClass}`).click();
38
38
  </script>
39
39
 
40
40
  <GenericInput bind:value bind:ref options={optionsInternal} {...$$restProps} />
@@ -88,93 +88,97 @@
88
88
  const dy = documentHeight - documentHeightPrevious;
89
89
  const centerPercentX = (x + width / 2) / documentWidth;
90
90
  const centerPercentY = (y + containerHeightScaled / 2) / documentHeight;
91
- if (!isNaN(dx) && centerPercentX >= 0.5) {
91
+ if (!Number.isNaN(dx) && centerPercentX >= 0.5) {
92
92
  x += dx;
93
93
  }
94
- if (!isNaN(dy) && centerPercentY >= 0.5) {
94
+ if (!Number.isNaN(dy) && centerPercentY >= 0.5) {
95
95
  y += dy;
96
96
  }
97
97
  }
98
98
  }
99
- const clickBlocker = (e) => {
100
- e.stopPropagation();
99
+ const clickBlocker = (event) => {
100
+ event.stopPropagation();
101
101
  };
102
102
  let startWidth = 0;
103
103
  let startOffsetX = 0;
104
104
  let startOffsetY = 0;
105
105
  let moveDistance = 0;
106
- const doubleClickListener = (e) => {
107
- e.stopPropagation();
108
- if (e.target) {
109
- if (width !== void 0 && e.target === widthHandleElement) {
110
- if (width < maxAvailablePanelWidth) {
111
- width = maxAvailablePanelWidth;
112
- } else {
113
- width = minWidth;
114
- }
115
- } else if (TITLEBAR_WINDOW_SHADE_DOUBLE_CLICK && e.target === dragBarElement) {
106
+ const doubleClickListener = (event) => {
107
+ event.stopPropagation();
108
+ if (event.target) {
109
+ if (width !== void 0 && event.target === widthHandleElement) {
110
+ width = width < maxAvailablePanelWidth ? maxAvailablePanelWidth : minWidth;
111
+ } else if (TITLEBAR_WINDOW_SHADE_DOUBLE_CLICK && event.target === dragBarElement) {
116
112
  paneRef.expanded = !paneRef.expanded;
117
113
  }
118
114
  }
119
115
  };
120
- const downListener = (e) => {
121
- if (x !== void 0 && y !== void 0 && e.button === 0 && e.target instanceof HTMLElement) {
116
+ const downListener = (event) => {
117
+ if (x !== void 0 && y !== void 0 && event.button === 0 && event.target instanceof HTMLElement) {
122
118
  moveDistance = 0;
123
- e.target.setPointerCapture(e.pointerId);
124
- e.target.addEventListener('pointermove', moveListener);
125
- e.target.addEventListener('pointerup', upListener);
119
+ event.target.setPointerCapture(event.pointerId);
120
+ event.target.addEventListener('pointermove', moveListener);
121
+ event.target.addEventListener('pointerup', upListener);
126
122
  startWidth = width ?? 0;
127
- startOffsetX = x - e.pageX;
128
- startOffsetY = y - e.pageY;
123
+ startOffsetX = x - event.pageX;
124
+ startOffsetY = y - event.pageY;
129
125
  }
130
126
  };
131
- const moveListener = (e) => {
127
+ const moveListener = (event) => {
132
128
  if (
133
- e.target instanceof HTMLElement &&
129
+ event.target instanceof HTMLElement &&
134
130
  width !== void 0 &&
135
131
  minWidth !== void 0 &&
136
132
  x !== void 0 &&
137
133
  y !== void 0
138
134
  ) {
139
- if (e.target === dragBarElement) {
140
- moveDistance += Math.sqrt(e.movementX * e.movementX + e.movementY * e.movementY);
141
- x = e.pageX + startOffsetX;
142
- y = e.pageY + startOffsetY;
143
- } else if (e.target === widthHandleElement) {
144
- width = clamp(e.pageX + startOffsetX + startWidth - x, minWidth, maxAvailablePanelWidth);
135
+ if (event.target === dragBarElement) {
136
+ moveDistance += Math.hypot(event.movementX, event.movementY);
137
+ x = event.pageX + startOffsetX;
138
+ y = event.pageY + startOffsetY;
139
+ } else if (event.target === widthHandleElement) {
140
+ width = clamp(
141
+ event.pageX + startOffsetX + startWidth - x,
142
+ minWidth,
143
+ maxAvailablePanelWidth
144
+ );
145
145
  }
146
146
  }
147
147
  };
148
- const upListener = (e) => {
149
- e.stopImmediatePropagation();
150
- if (e.target instanceof HTMLElement) {
151
- e.target.releasePointerCapture(e.pointerId);
152
- e.target.removeEventListener('pointermove', moveListener);
153
- e.target.removeEventListener('pointerup', upListener);
154
- if (TITLEBAR_WINDOW_SHADE_SINGLE_CLICK && e.target === dragBarElement) {
155
- if (moveDistance < 3 && userExpandable) paneRef.expanded = !paneRef.expanded;
156
- }
148
+ const upListener = (event) => {
149
+ event.stopImmediatePropagation();
150
+ if (event.target instanceof HTMLElement) {
151
+ event.target.releasePointerCapture(event.pointerId);
152
+ event.target.removeEventListener('pointermove', moveListener);
153
+ event.target.removeEventListener('pointerup', upListener);
154
+ if (
155
+ TITLEBAR_WINDOW_SHADE_SINGLE_CLICK &&
156
+ event.target === dragBarElement &&
157
+ moveDistance < 3 &&
158
+ userExpandable
159
+ )
160
+ paneRef.expanded = !paneRef.expanded;
157
161
  }
158
162
  };
159
- const touchScrollBlocker = (e) => {
160
- e.preventDefault();
163
+ const touchScrollBlocker = (event) => {
164
+ event.preventDefault();
161
165
  };
162
166
  onMount(() => {
163
167
  setDocumentSize();
164
168
  if (paneRef) {
165
- containerElement.appendChild(paneRef.element);
169
+ containerElement.append(paneRef.element);
166
170
  } else {
167
171
  console.warn('no pane ref in draggable');
168
172
  }
169
173
  containerElement.addEventListener('touchmove', touchScrollBlocker, { passive: false });
170
- dragBarElement = containerElement.getElementsByClassName('tp-rotv_t')[0];
174
+ dragBarElement = containerElement.querySelector('.tp-rotv_t');
171
175
  dragBarElement.addEventListener('click', clickBlocker);
172
176
  dragBarElement.addEventListener('dblclick', doubleClickListener);
173
177
  dragBarElement.addEventListener('pointerdown', downListener);
174
178
  widthHandleElement = dragBarElement.parentElement?.appendChild(document.createElement('div'));
175
179
  if (widthHandleElement) {
176
180
  widthHandleElement.className = 'tp-custom-width-handle';
177
- widthHandleElement.innerText = '\u2194';
181
+ widthHandleElement.textContent = '\u2194';
178
182
  widthHandleElement.addEventListener('click', clickBlocker);
179
183
  widthHandleElement.addEventListener('dblclick', doubleClickListener);
180
184
  widthHandleElement.addEventListener('pointerdown', downListener);
@@ -204,18 +208,13 @@
204
208
  });
205
209
  function updateResizability(isResizable) {
206
210
  if (widthHandleElement) {
207
- if (isResizable) {
208
- widthHandleElement.style.display = 'block';
209
- } else {
210
- widthHandleElement.style.display = 'none';
211
- }
211
+ widthHandleElement.style.display = isResizable ? 'block' : 'none';
212
212
  }
213
213
  }
214
214
  $: paneRef && resizable && updateResizability(resizable);
215
215
  function recursiveCollapse(children, maxToCollapse = Number.MAX_SAFE_INTEGER) {
216
- console.log(maxToCollapse);
217
216
  if (maxToCollapse > 0) {
218
- children.forEach((child) => {
217
+ for (const child of children) {
219
218
  if ('expanded' in child) {
220
219
  if (child.expanded) {
221
220
  maxToCollapse--;
@@ -231,7 +230,7 @@
231
230
  swatchButton.click();
232
231
  }
233
232
  }
234
- });
233
+ }
235
234
  }
236
235
  }
237
236
  $: if (
@@ -270,7 +269,8 @@
270
269
  containerHeightScaled = containerHeight;
271
270
  } else {
272
271
  const style = window.getComputedStyle(containerElement);
273
- const vPadding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
272
+ const vPadding =
273
+ Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom);
274
274
  containerHeightScaled = (containerHeight - vPadding) * scale + vPadding;
275
275
  }
276
276
  }
@@ -323,6 +323,11 @@ draggable-container"
323
323
  /* stylelint-disable-next-line selector-class-pattern */
324
324
  div.draggable-container :global(div.tp-rotv_t) {
325
325
  cursor: grab;
326
+ overflow: hidden;
327
+ /* Ensure draggable hit zone does not collapse if title is missing */
328
+ /* Fixes #1 */
329
+ height: 100%;
330
+ text-overflow: ellipsis;
326
331
  }
327
332
 
328
333
  div.draggable-container.not-collapsable :global(div.tp-rotv_t) {
@@ -14,7 +14,7 @@
14
14
  onMount(() => {
15
15
  if (paneRef) {
16
16
  const fixedContainer = paneRef.element.parentElement;
17
- containerElement.appendChild(paneRef.element);
17
+ containerElement.append(paneRef.element);
18
18
  fixedContainer?.remove();
19
19
  } else {
20
20
  console.warn('paneRef is undefined');
@@ -22,7 +22,7 @@
22
22
  });
23
23
  </script>
24
24
 
25
- <div bind:this={containerElement} style:width={width !== undefined ? `${width}px` : null}>
25
+ <div bind:this={containerElement} style:width={width === undefined ? null : `${width}px`}>
26
26
  <GenericPane bind:expanded bind:paneRef {theme} {...removeKeys($$restProps, 'position')}>
27
27
  <slot />
28
28
  </GenericPane>
@@ -50,8 +50,11 @@
50
50
  observer = new MutationObserver((mutations) => {
51
51
  for (const mutation of mutations) {
52
52
  if (mutation.type === 'characterData' || mutation.type === 'childList') {
53
- const fps = parseInt(mutation.target.innerText);
54
- !isNaN(fps) && dispatch('change', fps);
53
+ const fpsText = mutation.target.textContent;
54
+ if (fpsText !== null) {
55
+ const fps = Number.parseInt(fpsText);
56
+ !Number.isNaN(fps) && dispatch('change', fps);
57
+ }
55
58
  }
56
59
  }
57
60
  });
@@ -181,8 +181,8 @@ export type FpsGraphSlots = typeof __propDef.slots;
181
181
  * <Slider bind:value={rotationSpeed} label="Rotation Speed" />
182
182
  *
183
183
  * <div class="demo">
184
- * {#each Array.from({ length: gridSize }, (_, i) => i) as x}
185
- * {#each Array.from({ length: gridSize }, (_, i) => i) as y}
184
+ * {#each Array.from({ length: gridSize }, (_, index) => index) as x}
185
+ * {#each Array.from({ length: gridSize }, (_, index) => index) as y}
186
186
  * <div
187
187
  * class="box"
188
188
  * style:left="{(x / gridSize) * 100}%"
@@ -501,7 +501,7 @@ export type MonitorSlots<W extends number | string | boolean | unknown> = Return
501
501
  *
502
502
  * setInterval(() => {
503
503
  * booleanToMonitor = !booleanToMonitor;
504
- * stringToMonitor = stringToMonitor.split('').reverse().join('');
504
+ * stringToMonitor = [...stringToMonitor].reverse().join('');
505
505
  * }, 1000);
506
506
  * </script>
507
507
  *
@@ -7,11 +7,11 @@
7
7
  import { fillWith } from '../utils';
8
8
  import { BROWSER } from 'esm-env';
9
9
  import { createEventDispatcher, onDestroy } from 'svelte';
10
- function _measure(name, fn) {
11
- profilerBlade?.measure(name, fn);
10
+ function _measure(name, functionToMeasure) {
11
+ profilerBlade?.measure(name, functionToMeasure);
12
12
  }
13
- async function _measureAsync(name, fn) {
14
- profilerBlade?.measureAsync(name, fn);
13
+ async function _measureAsync(name, functionToMeasure) {
14
+ profilerBlade?.measureAsync(name, functionToMeasure);
15
15
  }
16
16
  export let label = void 0;
17
17
  export let bufferSize = void 0;
@@ -37,8 +37,11 @@
37
37
  observer = new MutationObserver((mutations) => {
38
38
  for (const mutation of mutations) {
39
39
  if (mutation.type === 'characterData' || mutation.type === 'childList') {
40
- const delta = parseFloat(mutation.target.innerText);
41
- !isNaN(delta) && dispatch('change', delta);
40
+ const fpsText = mutation.target.textContent;
41
+ if (fpsText !== null) {
42
+ const delta = Number.parseFloat(fpsText);
43
+ !Number.isNaN(delta) && dispatch('change', delta);
44
+ }
42
45
  }
43
46
  }
44
47
  });
@@ -3,8 +3,11 @@ import type { ProfilerBladeMeasureHandler } from '@0b5vr/tweakpane-plugin-profil
3
3
  import type { Simplify } from '../utils';
4
4
  export type ProfilerCalcMode = 'frame' | 'mean' | 'median';
5
5
  export type ProfilerChangeEvent = CustomEvent<number>;
6
- export type ProfilerMeasure = (name: string, fn: () => void) => void;
7
- export type ProfilerMeasureAsync = (name: string, fn: () => Promise<void>) => Promise<void>;
6
+ export type ProfilerMeasure = (name: string, functionToMeasure: () => void) => void;
7
+ export type ProfilerMeasureAsync = (
8
+ name: string,
9
+ functionToMeasure: () => Promise<void>
10
+ ) => Promise<void>;
8
11
  export type ProfilerMeasureHandler = Simplify<ProfilerBladeMeasureHandler>;
9
12
  import type { ProfilerBladeApi as ProfilerRef } from '@0b5vr/tweakpane-plugin-profiler/dist/types/ProfilerBladeApi.js';
10
13
  import type { ProfilerBladePluginParams as ProfilerOptions } from '@0b5vr/tweakpane-plugin-profiler/dist/types/ProfilerBladePluginParams.js';
@@ -201,10 +204,10 @@ export type ProfilerSlots = typeof __propDef.slots;
201
204
  * let loopExponent = 1;
202
205
  *
203
206
  * // helper to test Math functions
204
- * function hardWork(fn: (n: number) => number, exponent: number): void {
205
- * measure(fn.name, () => {
207
+ * function hardWork(function_: (n: number) => number, exponent: number): void {
208
+ * measure(function_.name, () => {
206
209
  * for (let sum = 0; sum < Number('1e' + exponent); sum++) {
207
- * fn(sum);
210
+ * function_(sum);
208
211
  * }
209
212
  * });
210
213
  * }
package/dist/theme.js CHANGED
@@ -36,9 +36,9 @@ const standard = {
36
36
  // pluginThumbnailListHeight: '400px', pluginThumbnailListThumbSize: '20px',
37
37
  // pluginThumbnailListWidth: '200px'
38
38
  };
39
- export const keys = Object.keys(standard).reduce((acc, key) => {
40
- acc[key] = key;
41
- return acc;
39
+ export const keys = Object.keys(standard).reduce((accumulator, key) => {
40
+ accumulator[key] = key;
41
+ return accumulator;
42
42
  }, {});
43
43
  const light = {
44
44
  baseBackgroundColor: 'hsla(230, 5%, 90%, 1.00)',
@@ -254,9 +254,9 @@ function expandVariableKey(name) {
254
254
  if (name.startsWith('--tp-')) {
255
255
  return name;
256
256
  } else {
257
- const varName = keyToCssVariableMap.get(name);
258
- if (varName) {
259
- return varName;
257
+ const variableName = keyToCssVariableMap.get(name);
258
+ if (variableName) {
259
+ return variableName;
260
260
  } else {
261
261
  throw new Error(`Unknown Tweakpane CSS theme map variable key: "${name}"`);
262
262
  }
@@ -266,24 +266,22 @@ function expandVariableKey(name) {
266
266
  * Used during SSR to calculate metrics Returns CSS string.
267
267
  */
268
268
  export function getValueOrFallback(theme, key) {
269
- if (theme === undefined || theme[key] === undefined) {
270
- return stringToCssValue(standard[key]);
271
- } else {
272
- return stringToCssValue(theme[key]);
273
- }
269
+ return theme === undefined || theme[key] === undefined
270
+ ? stringToCssValue(standard[key])
271
+ : stringToCssValue(theme[key]);
274
272
  }
275
273
  export function applyTheme(element, theme) {
276
- const rootDoc = getWindowDocument().documentElement;
274
+ const rootDocument = getWindowDocument().documentElement;
277
275
  if (theme === undefined) {
278
- Object.keys(standard).forEach((k) => {
276
+ for (const k of Object.keys(standard)) {
279
277
  const key = expandVariableKey(k);
280
278
  if (element.style.getPropertyValue(key).length > 0) {
281
279
  // console.log(`Unsetting via undefined theme ${key}`);
282
280
  element.style.removeProperty(key);
283
281
  }
284
- });
282
+ }
285
283
  } else {
286
- Object.entries(theme).forEach(([k, v]) => {
284
+ for (const [k, v] of Object.entries(theme)) {
287
285
  const key = expandVariableKey(k);
288
286
  const value = stringToCssValue(v);
289
287
  // console.log(`Inspecting ${key}: ${value}`);
@@ -292,7 +290,7 @@ export function applyTheme(element, theme) {
292
290
  // then apply it anyway so that any global theme is overridden TODO normalize color
293
291
  // representation for comparison? TODO tests for this logic
294
292
  const standardValue = standard[k] || undefined;
295
- const rootValue = rootDoc.style.getPropertyValue(key) || undefined;
293
+ const rootValue = rootDocument.style.getPropertyValue(key) || undefined;
296
294
  const isDeviationFromRoot = (rootValue && value !== rootValue) || false;
297
295
  const isDeviationFromStandard = (standardValue && value !== standardValue) || false;
298
296
  if (
@@ -308,7 +306,7 @@ export function applyTheme(element, theme) {
308
306
  element.style.removeProperty(key);
309
307
  }
310
308
  }
311
- });
309
+ }
312
310
  }
313
311
  }
314
312
  /**
package/dist/utils.d.ts CHANGED
@@ -65,13 +65,13 @@ export declare function enforceReadonly(
65
65
  internal: unknown,
66
66
  external: unknown,
67
67
  componentName?: string,
68
- propName?: string,
68
+ propertyName?: string,
69
69
  allowAssignmentToUndefined?: boolean
70
70
  ): void;
71
71
  export declare function isRootPane(container: Container): boolean;
72
72
  export declare function clamp(value: number, min: number, max: number): number;
73
73
  export declare function getElementIndex(element: HTMLElement): number;
74
- export declare function removeKeys<T extends object>(obj: T, ...keys: string[]): T;
74
+ export declare function removeKeys<T extends object>(object: T, ...keys: string[]): T;
75
75
  export declare function updateCollapsibility(
76
76
  isUserExpandableEnabled: boolean,
77
77
  element: HTMLElement,
@@ -103,19 +103,19 @@ export declare function tupleToObject<
103
103
  }
104
104
  >(tuple: number[], keys: T[]): O;
105
105
  export declare function objectToTuple<T extends string, O extends Record<T, number>>(
106
- obj: O,
106
+ object: O,
107
107
  keys: [T]
108
108
  ): [number];
109
109
  export declare function objectToTuple<T extends string, O extends Record<T, number>>(
110
- obj: O,
110
+ object: O,
111
111
  keys: [T, T]
112
112
  ): [number, number];
113
113
  export declare function objectToTuple<T extends string, O extends Record<T, number>>(
114
- obj: O,
114
+ object: O,
115
115
  keys: [T, T, T]
116
116
  ): [number, number, number];
117
117
  export declare function objectToTuple<T extends string, O extends Record<T, number>>(
118
- obj: O,
118
+ object: O,
119
119
  keys: [T, T, T, T]
120
120
  ): [number, number, number, number];
121
121
  export declare function pickerIsOpen(blade: BladeApi<BladeController<View>>): boolean;
package/dist/utils.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * For CLS SSR calculation
5
5
  */
6
- export function rowsForMonitor(buffer = undefined, rows = undefined, graph = undefined) {
6
+ export function rowsForMonitor(buffer, rows, graph) {
7
7
  if (graph) {
8
8
  return Math.max(rows ?? 3, 3);
9
9
  } else if (buffer === undefined && rows === undefined) {
@@ -23,7 +23,7 @@ export function rowsForMonitor(buffer = undefined, rows = undefined, graph = und
23
23
  * Fills an array of length `quantity` with a `value`
24
24
  */
25
25
  export function fillWith(value, quantity) {
26
- return [...Array(quantity).fill(value)];
26
+ return Array.from({ length: quantity }, () => value);
27
27
  }
28
28
  /**
29
29
  * There's no way to enforce readonly properties in Svelte components, so this is a workaround. See
@@ -52,7 +52,7 @@ export function enforceReadonly(
52
52
  internal,
53
53
  external,
54
54
  componentName,
55
- propName,
55
+ propertyName,
56
56
  allowAssignmentToUndefined
57
57
  ) {
58
58
  allowAssignmentToUndefined ??= false;
@@ -63,9 +63,9 @@ export function enforceReadonly(
63
63
  )
64
64
  ) {
65
65
  const componentString = componentName ? `<${componentName}> ` : '';
66
- const propString = propName ? `property "${propName}" ` : '';
66
+ const propertyString = propertyName ? `property "${propertyName}" ` : '';
67
67
  console.error(
68
- `Svelte component ${componentString}property ${propString}is intended for readonly use.\nAssigning\n"${external}"\nto\n"${internal}"\nis not allowed.`
68
+ `Svelte component ${componentString}property ${propertyString}is intended for readonly use.\nAssigning\n"${external}"\nto\n"${internal}"\nis not allowed.`
69
69
  );
70
70
  }
71
71
  }
@@ -85,25 +85,25 @@ export function getElementIndex(element) {
85
85
  return index;
86
86
  }
87
87
  // doesn't create a new object, only works with string keys
88
- export function removeKeys(obj, ...keys) {
89
- keys.forEach((key) => {
90
- if (key in obj) {
91
- delete obj[key];
88
+ export function removeKeys(object, ...keys) {
89
+ for (const key of keys) {
90
+ if (key in object) {
91
+ delete object[key];
92
92
  }
93
- });
94
- return obj;
93
+ }
94
+ return object;
95
95
  }
96
- function clickBlocker(e) {
96
+ function clickBlocker(event) {
97
97
  // only block user clicks, not programmatic ones
98
- console.log(e.detail);
99
- if (e.isTrusted) e.stopPropagation();
98
+ console.log(event.detail);
99
+ if (event.isTrusted) event.stopPropagation();
100
100
  }
101
101
  // used by folder and pane TODO rewrite to use getSwatchButton etc.
102
102
  export function updateCollapsibility(isUserExpandableEnabled, element, titleBarClass, iconClass) {
103
103
  if (element) {
104
- const titleBarElement = element.getElementsByClassName(titleBarClass)[0];
104
+ const titleBarElement = element.querySelector(`.${titleBarClass}`);
105
105
  if (titleBarElement !== undefined) {
106
- const iconElement = iconClass ? element.getElementsByClassName(iconClass)[0] : undefined;
106
+ const iconElement = iconClass ? element.querySelector(`.${iconClass}`) : undefined;
107
107
  if (isUserExpandableEnabled) {
108
108
  titleBarElement.removeEventListener('click', clickBlocker, { capture: true });
109
109
  titleBarElement.style.cursor = 'pointer';
@@ -152,14 +152,14 @@ export function getGridDimensions(itemCount, maxColumns, maxRows) {
152
152
  }
153
153
  export function tupleToObject(tuple, keys) {
154
154
  const result = {};
155
- keys.forEach((key, index) => {
155
+ for (const [index, key] of keys.entries()) {
156
156
  // Assert that the assignment is safe
157
157
  result[key] = tuple[index];
158
- });
158
+ }
159
159
  return result;
160
160
  }
161
- export function objectToTuple(obj, keys) {
162
- return keys.map((key) => obj[key]);
161
+ export function objectToTuple(object, keys) {
162
+ return keys.map((key) => object[key]);
163
163
  }
164
164
  // tweakpane helpers
165
165
  export function pickerIsOpen(blade) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-tweakpane-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -191,51 +191,35 @@
191
191
  "@tweakpane/plugin-camerakit": "^0.3.0",
192
192
  "@tweakpane/plugin-essentials": "^0.2.0",
193
193
  "esm-env": "^1.0.0",
194
- "nanoid": "^5.0.3",
194
+ "nanoid": "^5.0.4",
195
195
  "svelte-local-storage-store": "^0.6.4",
196
196
  "tweakpane": "^4.0.1",
197
197
  "tweakpane-plugin-waveform": "^1.0.0"
198
198
  },
199
199
  "devDependencies": {
200
+ "@kitschpatrol/shared-config": "^2.0.1",
200
201
  "@phenomnomnominal/tsquery": "^6.1.3",
201
202
  "@stkb/rewrap": "^0.1.0",
202
203
  "@sveltejs/adapter-static": "^2.0.3",
203
- "@sveltejs/kit": "^1.27.6",
204
+ "@sveltejs/kit": "^1.27.7",
204
205
  "@sveltejs/package": "^2.2.3",
205
206
  "@types/eslint": "^8.44.8",
206
207
  "@types/fs-extra": "^11.0.4",
207
- "@types/node": "^20.10.2",
208
- "@typescript-eslint/eslint-plugin": "^6.13.1",
209
- "@typescript-eslint/parser": "^6.13.1",
210
- "cspell": "^8.1.0",
211
- "eslint": "^8.55.0",
212
- "eslint-config-prettier": "^9.0.0",
213
- "eslint-plugin-perfectionist": "^2.5.0",
214
- "eslint-plugin-svelte": "^2.35.1",
208
+ "@types/node": "^20.10.4",
215
209
  "fs-extra": "^11.2.0",
216
210
  "glob": "^10.3.10",
217
- "markdownlint": "^0.32.1",
218
- "markdownlint-cli": "^0.37.0",
219
211
  "npm-run-all": "^4.1.5",
220
212
  "postcss-html": "^1.5.0",
221
- "prettier": "^3.1.0",
222
- "prettier-plugin-astro": "^0.12.2",
223
- "prettier-plugin-pkg": "^0.18.0",
224
- "prettier-plugin-svelte": "^3.1.2",
225
213
  "publint": "^0.2.6",
226
- "stylelint": "^15.11.0",
227
- "stylelint-config-clean-order": "^5.2.0",
228
- "stylelint-config-html": "^1.1.0",
229
- "stylelint-config-standard": "^34.0.0",
230
214
  "svelte": "^4.2.8",
231
215
  "svelte-check": "^3.6.2",
232
216
  "svelte-language-server": "^0.16.1",
233
217
  "svelte2tsx": "^0.6.27",
234
- "ts-morph": "^20.0.0",
218
+ "ts-morph": "^21.0.1",
235
219
  "tslib": "^2.6.2",
236
- "tsx": "^4.6.1",
237
- "typescript": "^5.3.2",
238
- "vite": "^4.5.0",
220
+ "tsx": "^4.6.2",
221
+ "typescript": "^5.3.3",
222
+ "vite": "^4.5.1",
239
223
  "yaml": "^2.3.4"
240
224
  },
241
225
  "scripts": {
@@ -246,9 +230,9 @@
246
230
  "build:04-format": "pnpm run format",
247
231
  "build:05-package": "svelte-package && publint",
248
232
  "build:06-heal-dts-comments": "tsx ./scripts/heal-dts-comments.ts",
249
- "build:07-strip-component-docs": "tsx ./scripts/strip-component-docs.ts",
233
+ "build:07-strip-component-documentation": "tsx ./scripts/strip-component-documentation.ts",
250
234
  "build:08-format-library": "prettier --ignore-path --plugin prettier-plugin-svelte --write ./dist",
251
- "build:09-doc-data": "tsx ./scripts/generate-doc-data.ts",
235
+ "build:09-doc-data": "tsx ./scripts/generate-documentation-data.ts",
252
236
  "build:10-examples-to-kit": "tsx ./scripts/generate-kit-examples.ts",
253
237
  "build:11-examples-to-docs": "tsx ./scripts/generate-example-components.ts",
254
238
  "build:12-acknowledgments-data": "mkdir -p ./docs/src/content/acknowledgments && pnpm licenses list --json > ./docs/src/content/acknowledgments/acknowledgments-lib.json",
@@ -260,21 +244,14 @@
260
244
  "docs-dev": "pnpm -C ./docs run dev",
261
245
  "docs-preview": "pnpm -C ./docs run preview",
262
246
  "format": "run-s --print-label format:*",
263
- "format:1-eslint": "eslint --fix ./src ./scripts ./docs/src",
264
- "format:2-stylelint": "stylelint --fix './src/**/*.{css,svelte,html}'",
265
- "format:3-rewrap": "rewrap -i --column 100 `find src \\( -name '*.svelte' -o -name '*.ts' -o -name '*.html' \\) -type f | grep -v src/examples`",
266
- "format:4-prettier": "prettier --plugin=prettier-plugin-svelte --plugin=prettier-plugin-astro --write .",
267
- "format:5-embedded": "tsx ./scripts/format-embedded-code.ts",
247
+ "format:1-shared": "shared-config --fix",
248
+ "format:2-embedded": "tsx ./scripts/format-embedded-code.ts",
268
249
  "kit-build": "pnpm run kit-examples && vite build",
269
250
  "kit-dev": " pnpm run kit-examples && vite dev",
270
251
  "kit-examples": "tsx ./scripts/generate-kit-examples.ts",
271
252
  "kit-preview": "vite preview",
272
- "lint": "run-p --print-label lint:*",
273
- "lint:eslint": "eslint ./src ./scripts ./docs/src",
274
- "lint:markdown": "markdownlint **/*.{md,mdx} --ignore node_modules",
275
- "lint:prettier": "prettier --plugin=prettier-plugin-svelte --plugin=prettier-plugin-astro --check .",
276
- "lint:spelling": "cspell --quiet .",
277
- "lint:stylelint": "stylelint './src/**/*.{css,svelte,html}'",
278
- "lint:typescript": "tsc --noEmit"
253
+ "lint": "shared-config --check",
254
+ "rewrap": "rewrap -i --column 100 `find src \\( -name '*.svelte' -o -name '*.ts' -o -name '*.html' \\) -type f | grep -v src/examples`",
255
+ "type-check": "tsc --noEmit"
279
256
  }
280
257
  }