@window-splitter/svelte 0.8.4 → 0.8.6

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.
@@ -15,16 +15,7 @@ const config: StorybookConfig = {
15
15
  "../src/**/*.stories.@(js|ts|svelte)",
16
16
  "../stories/**/*.stories.@(js|ts|svelte)",
17
17
  ],
18
- addons: [
19
- {
20
- name: getAbsolutePath("@storybook/addon-essentials"),
21
- options: {
22
- docs: false,
23
- },
24
- },
25
- getAbsolutePath("@storybook/addon-svelte-csf"),
26
- getAbsolutePath("@storybook/addon-interactions"),
27
- ],
18
+ addons: [getAbsolutePath("@storybook/addon-svelte-csf")],
28
19
  framework: {
29
20
  name: getAbsolutePath("@storybook/svelte-vite"),
30
21
  options: {},
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @window-splitter/svelte@0.8.3 build /Users/andrew/Documents/react-window-splitter/packages/svelte
3
+ > @window-splitter/svelte@0.8.5 build /Users/andrew/Documents/react-window-splitter/packages/svelte
4
4
  > svelte-package
5
5
 
6
6
  src/lib -> dist
@@ -0,0 +1,18 @@
1
+
2
+ 
3
+ > @window-splitter/svelte@0.8.4 lint /Users/andrew/Documents/react-window-splitter/packages/svelte
4
+ > eslint .
5
+
6
+ =============
7
+
8
+ WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
9
+
10
+ You may find that it works just fine, or you may not.
11
+
12
+ SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.6.0
13
+
14
+ YOUR TYPESCRIPT VERSION: 5.8.3
15
+
16
+ Please only submit bug reports when using the officially supported version.
17
+
18
+ =============
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # v0.8.5 (Sun May 04 2025)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Vue Adapter [#56](https://github.com/hipstersmoothie/window-splitter/pull/56) ([@hipstersmoothie](https://github.com/hipstersmoothie))
6
+ - fix unmount not running ([@hipstersmoothie](https://github.com/hipstersmoothie))
7
+ - get builds working ([@hipstersmoothie](https://github.com/hipstersmoothie))
8
+ - catalogs ([@hipstersmoothie](https://github.com/hipstersmoothie))
9
+ - linting ([@hipstersmoothie](https://github.com/hipstersmoothie))
10
+ - starting to work ([@hipstersmoothie](https://github.com/hipstersmoothie))
11
+
12
+ #### ⚠️ Pushed to `main`
13
+
14
+ - add link ([@hipstersmoothie](https://github.com/hipstersmoothie))
15
+
16
+ #### Authors: 1
17
+
18
+ - Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
19
+
20
+ ---
21
+
1
22
  # v0.8.4 (Sat May 03 2025)
2
23
 
3
24
  #### 🐛 Bug Fix
package/dist/Panel.svelte CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
  export { PanelHandle } from "@window-splitter/interface";
21
21
 
22
- interface Props
22
+ export interface PanelProps
23
23
  extends SharedPanelProps<boolean>,
24
24
  HTMLAttributes<HTMLDivElement> {}
25
25
 
@@ -38,7 +38,7 @@
38
38
  default: defaultSize,
39
39
  isStaticAtRest,
40
40
  ...attrs
41
- }: Props = $props();
41
+ }: PanelProps = $props();
42
42
 
43
43
  const defaultId = $props.id();
44
44
  const id = _id || defaultId;
@@ -119,9 +119,7 @@
119
119
  });
120
120
 
121
121
  $effect(() => () => {
122
- requestAnimationFrame(() => {
123
- send({ type: "unregisterPanel", id });
124
- });
122
+ requestAnimationFrame(() => send({ type: "unregisterPanel", id }));
125
123
  });
126
124
 
127
125
  const isControlledCollapse = $derived(panelData()?.collapseIsControlled);
@@ -1,9 +1,9 @@
1
1
  import type { SharedPanelProps } from "@window-splitter/interface";
2
2
  import type { Unit } from "@window-splitter/state";
3
3
  import type { HTMLAttributes } from "svelte/elements";
4
- interface Props extends SharedPanelProps<boolean>, HTMLAttributes<HTMLDivElement> {
4
+ export interface PanelProps extends SharedPanelProps<boolean>, HTMLAttributes<HTMLDivElement> {
5
5
  }
6
- declare const Panel: import("svelte").Component<Props, {
6
+ declare const Panel: import("svelte").Component<PanelProps, {
7
7
  PanelHandle: typeof PanelHandle;
8
8
  getId: () => string;
9
9
  collapse: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Panel.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AASnE,OAAO,KAAK,EAIR,IAAI,EACL,MAAM,wBAAwB,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,UAAU,KACR,SAAQ,gBAAgB,CAAC,OAAO,CAAC,EAC/B,cAAc,CAAC,cAAc,CAAC;CAAG;AAkKvC,QAAA,MAAM,KAAK;iBADsQ,OAAO,WAAW;;;;;;;oBAXzQ,IAAI;;MAYqB,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Panel.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Panel.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AASnE,OAAO,KAAK,EAIR,IAAI,EACL,MAAM,wBAAwB,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,UACf,SAAQ,gBAAgB,CAAC,OAAO,CAAC,EAC/B,cAAc,CAAC,cAAc,CAAC;CAAG;AAgKvC,QAAA,MAAM,KAAK;iBAD2Q,OAAO,WAAW;;;;;;;oBAX9Q,IAAI;;MAYqB,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -16,7 +16,7 @@
16
16
 
17
17
  export { PanelGroupHandle } from "@window-splitter/interface";
18
18
 
19
- interface Props
19
+ export interface PanelGroupProps
20
20
  extends SharedPanelGroupProps,
21
21
  HTMLAttributes<HTMLDivElement> {
22
22
  id: string;
@@ -29,7 +29,7 @@
29
29
  autosaveId,
30
30
  snapshot,
31
31
  ...attrs
32
- }: Props = $props();
32
+ }: PanelGroupProps = $props();
33
33
 
34
34
  if (
35
35
  !snapshot &&
@@ -54,10 +54,7 @@
54
54
  autosaveStrategy,
55
55
  ...(snapshot ? prepareSnapshot(snapshot) : undefined),
56
56
  },
57
- (s) => {
58
- if (!context) return;
59
- updateContext(s);
60
- }
57
+ (s) => updateContext(s)
61
58
  );
62
59
 
63
60
  const context = $state<GroupMachineContextValue>(initialState);
@@ -101,7 +98,8 @@
101
98
  // re-render when the childIds change
102
99
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
103
100
  childIds;
104
- measureGroupChildren(id, (childrenSizes) => {
101
+
102
+ return measureGroupChildren(id, (childrenSizes) => {
105
103
  send({ type: "setActualItemsSize", childrenSizes });
106
104
  });
107
105
  });
@@ -1,10 +1,10 @@
1
1
  import type { SharedPanelGroupProps } from "@window-splitter/interface";
2
2
  import type { Unit } from "@window-splitter/state";
3
3
  import type { HTMLAttributes } from "svelte/elements";
4
- interface Props extends SharedPanelGroupProps, HTMLAttributes<HTMLDivElement> {
4
+ export interface PanelGroupProps extends SharedPanelGroupProps, HTMLAttributes<HTMLDivElement> {
5
5
  id: string;
6
6
  }
7
- declare const PanelGroup: import("svelte").Component<Props, {
7
+ declare const PanelGroup: import("svelte").Component<PanelGroupProps, {
8
8
  PanelGroupHandle: typeof PanelGroupHandle;
9
9
  getId: () => string;
10
10
  getPixelSizes: () => number[];
@@ -1 +1 @@
1
- {"version":3,"file":"PanelGroup.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PanelGroup.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAWxE,OAAO,KAAK,EAA4B,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,UAAU,KACR,SAAQ,qBAAqB,EAC3B,cAAc,CAAC,cAAc,CAAC;IAChC,EAAE,EAAE,MAAM,CAAC;CACZ;AA0IH,QAAA,MAAM,UAAU;sBADgP,OAAO,gBAAgB;;;;;;wBA3BzP,KAAK,CAAC,IAAI,CAAC;MA4Be,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"PanelGroup.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PanelGroup.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAWxE,OAAO,KAAK,EAA4B,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,eACf,SAAQ,qBAAqB,EAC3B,cAAc,CAAC,cAAc,CAAC;IAChC,EAAE,EAAE,MAAM,CAAC;CACZ;AAwIH,QAAA,MAAM,UAAU;sBAD0P,OAAO,gBAAgB;;;;;;wBA3BnQ,KAAK,CAAC,IAAI,CAAC;MA4Be,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -20,7 +20,7 @@
20
20
  } from "@window-splitter/interface";
21
21
  import type { HTMLAttributes } from "svelte/elements";
22
22
 
23
- interface Props
23
+ export interface PanelResizerProps
24
24
  extends SharedPanelResizerProps,
25
25
  HTMLAttributes<HTMLDivElement> {}
26
26
 
@@ -32,7 +32,7 @@
32
32
  onDragEnd,
33
33
  disabled,
34
34
  ...attrs
35
- }: Props = $props();
35
+ }: PanelResizerProps = $props();
36
36
 
37
37
  const defaultId = $props.id();
38
38
  const id = _id || defaultId;
@@ -87,9 +87,7 @@
87
87
  });
88
88
 
89
89
  $effect(() => () => {
90
- requestAnimationFrame(() => {
91
- send({ type: "unregisterPanelHandle", id });
92
- });
90
+ requestAnimationFrame(() => send({ type: "unregisterPanelHandle", id }));
93
91
  });
94
92
 
95
93
  const { moveProps } = move({
@@ -109,8 +107,8 @@
109
107
  },
110
108
  });
111
109
 
112
- const itemIndex = 1;
113
110
  const panelAttributes = () => {
111
+ const itemIndex = state.items.findIndex((item) => item.id === id);
114
112
  const panelBeforeHandle = state?.items[itemIndex - 1];
115
113
 
116
114
  if (!panelBeforeHandle || !isPanelData(panelBeforeHandle)) return { id };
@@ -1,8 +1,8 @@
1
1
  import type { SharedPanelResizerProps } from "@window-splitter/interface";
2
2
  import type { HTMLAttributes } from "svelte/elements";
3
- interface Props extends SharedPanelResizerProps, HTMLAttributes<HTMLDivElement> {
3
+ export interface PanelResizerProps extends SharedPanelResizerProps, HTMLAttributes<HTMLDivElement> {
4
4
  }
5
- declare const PanelResizer: import("svelte").Component<Props, {}, "">;
5
+ declare const PanelResizer: import("svelte").Component<PanelResizerProps, {}, "">;
6
6
  type PanelResizer = ReturnType<typeof PanelResizer>;
7
7
  export default PanelResizer;
8
8
  //# sourceMappingURL=PanelResizer.svelte.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanelResizer.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PanelResizer.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,UAAU,KACR,SAAQ,uBAAuB,EAC7B,cAAc,CAAC,cAAc,CAAC;CAAG;AAqJvC,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"PanelResizer.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PanelResizer.svelte.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,iBACf,SAAQ,uBAAuB,EAC7B,cAAc,CAAC,cAAc,CAAC;CAAG;AAmJvC,QAAA,MAAM,YAAY,uDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
package/eslint.config.js CHANGED
@@ -6,6 +6,7 @@ import svelteConfig from "./svelte.config.js";
6
6
 
7
7
  export default [
8
8
  ...base,
9
+ { ignores: [".svelte-kit/**"] },
9
10
  ...svelte.configs["flat/recommended"],
10
11
  {
11
12
  files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@window-splitter/svelte",
4
4
  "sideEffects": false,
5
- "version": "0.8.4",
5
+ "version": "0.8.6",
6
6
  "description": "A WAI-ARIA compliant window splitter for Svelte.",
7
7
  "repository": {
8
8
  "url": "https://github.com/hipstersmoothie/window-splitter",
@@ -30,43 +30,38 @@
30
30
  },
31
31
  "license": "MIT",
32
32
  "devDependencies": {
33
- "@internal/eslint-config": "0.8.4",
33
+ "@internal/eslint-config": "0.8.6",
34
34
  "@rsbuild/core": "^1.3.12",
35
35
  "@rsdoctor/rspack-plugin": "^1.0.2",
36
- "@storybook/addon-essentials": "^8.6.12",
37
- "@storybook/addon-interactions": "^8.6.12",
38
36
  "@storybook/addon-svelte-csf": "^5.0.0-next.0",
39
- "@storybook/blocks": "^8.6.12",
40
37
  "@storybook/svelte": "^8.6.12",
41
38
  "@storybook/svelte-vite": "^8.6.12",
42
- "@storybook/test": "^8.6.12",
43
39
  "@sveltejs/package": "^2.3.11",
44
40
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
45
- "@testing-library/jest-dom": "^6.4.8",
41
+ "@testing-library/jest-dom": "catalog:",
46
42
  "@testing-library/svelte": "^5.2.7",
47
43
  "@types/node": "^20.14.10",
48
- "@vitest/browser": "^3.1.2",
49
- "@vitest/coverage-istanbul": "^3.1.2",
50
- "@vitest/coverage-v8": "^3.1.2",
51
- "eslint": "^9.9.0",
52
- "eslint-plugin-storybook": "^0.12.0",
44
+ "@vitest/browser": "catalog:",
45
+ "@vitest/coverage-istanbul": "catalog:",
46
+ "@vitest/coverage-v8": "catalog:",
47
+ "eslint": "catalog:",
53
48
  "eslint-plugin-svelte": "^2.35.1",
54
49
  "framer-motion": "^11.3.28",
55
50
  "jsdom": "^24.1.1",
56
- "playwright": "^1.46.0",
51
+ "playwright": "catalog:",
57
52
  "storybook": "^8.6.12",
58
53
  "svelte": "^5.28.2",
59
54
  "tiny-cookie": "^2.5.1",
60
- "typescript": "^5.5.4",
55
+ "typescript": "catalog:",
61
56
  "vite": "^6.3.3",
62
- "vitest": "^3.1.2"
57
+ "vitest": "catalog:"
63
58
  },
64
59
  "peerDependencies": {
65
60
  "svelte": ">=5.x"
66
61
  },
67
62
  "dependencies": {
68
- "@window-splitter/interface": "0.8.4",
69
- "@window-splitter/state": "0.8.4"
63
+ "@window-splitter/interface": "0.8.6",
64
+ "@window-splitter/state": "0.8.6"
70
65
  },
71
66
  "type": "module",
72
67
  "exports": {
@@ -83,10 +78,5 @@
83
78
  "resizable",
84
79
  "window"
85
80
  ],
86
- "eslintConfig": {
87
- "extends": [
88
- "plugin:storybook/recommended"
89
- ]
90
- },
91
- "gitHead": "b71dcbded56d12a3e78294802e56d97d179b0bf6"
81
+ "gitHead": "7bdd351ea9e9a209d4a8db3a66f7742ee8e2db1b"
92
82
  }
@@ -19,7 +19,7 @@
19
19
 
20
20
  export { PanelHandle } from "@window-splitter/interface";
21
21
 
22
- interface Props
22
+ export interface PanelProps
23
23
  extends SharedPanelProps<boolean>,
24
24
  HTMLAttributes<HTMLDivElement> {}
25
25
 
@@ -38,7 +38,7 @@
38
38
  default: defaultSize,
39
39
  isStaticAtRest,
40
40
  ...attrs
41
- }: Props = $props();
41
+ }: PanelProps = $props();
42
42
 
43
43
  const defaultId = $props.id();
44
44
  const id = _id || defaultId;
@@ -119,9 +119,7 @@
119
119
  });
120
120
 
121
121
  $effect(() => () => {
122
- requestAnimationFrame(() => {
123
- send({ type: "unregisterPanel", id });
124
- });
122
+ requestAnimationFrame(() => send({ type: "unregisterPanel", id }));
125
123
  });
126
124
 
127
125
  const isControlledCollapse = $derived(panelData()?.collapseIsControlled);
@@ -16,7 +16,7 @@
16
16
 
17
17
  export { PanelGroupHandle } from "@window-splitter/interface";
18
18
 
19
- interface Props
19
+ export interface PanelGroupProps
20
20
  extends SharedPanelGroupProps,
21
21
  HTMLAttributes<HTMLDivElement> {
22
22
  id: string;
@@ -29,7 +29,7 @@
29
29
  autosaveId,
30
30
  snapshot,
31
31
  ...attrs
32
- }: Props = $props();
32
+ }: PanelGroupProps = $props();
33
33
 
34
34
  if (
35
35
  !snapshot &&
@@ -54,10 +54,7 @@
54
54
  autosaveStrategy,
55
55
  ...(snapshot ? prepareSnapshot(snapshot) : undefined),
56
56
  },
57
- (s) => {
58
- if (!context) return;
59
- updateContext(s);
60
- }
57
+ (s) => updateContext(s)
61
58
  );
62
59
 
63
60
  const context = $state<GroupMachineContextValue>(initialState);
@@ -101,7 +98,8 @@
101
98
  // re-render when the childIds change
102
99
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
103
100
  childIds;
104
- measureGroupChildren(id, (childrenSizes) => {
101
+
102
+ return measureGroupChildren(id, (childrenSizes) => {
105
103
  send({ type: "setActualItemsSize", childrenSizes });
106
104
  });
107
105
  });
@@ -20,7 +20,7 @@
20
20
  } from "@window-splitter/interface";
21
21
  import type { HTMLAttributes } from "svelte/elements";
22
22
 
23
- interface Props
23
+ export interface PanelResizerProps
24
24
  extends SharedPanelResizerProps,
25
25
  HTMLAttributes<HTMLDivElement> {}
26
26
 
@@ -32,7 +32,7 @@
32
32
  onDragEnd,
33
33
  disabled,
34
34
  ...attrs
35
- }: Props = $props();
35
+ }: PanelResizerProps = $props();
36
36
 
37
37
  const defaultId = $props.id();
38
38
  const id = _id || defaultId;
@@ -87,9 +87,7 @@
87
87
  });
88
88
 
89
89
  $effect(() => () => {
90
- requestAnimationFrame(() => {
91
- send({ type: "unregisterPanelHandle", id });
92
- });
90
+ requestAnimationFrame(() => send({ type: "unregisterPanelHandle", id }));
93
91
  });
94
92
 
95
93
  const { moveProps } = move({
@@ -109,8 +107,8 @@
109
107
  },
110
108
  });
111
109
 
112
- const itemIndex = 1;
113
110
  const panelAttributes = () => {
111
+ const itemIndex = state.items.findIndex((item) => item.id === id);
114
112
  const panelBeforeHandle = state?.items[itemIndex - 1];
115
113
 
116
114
  if (!panelBeforeHandle || !isPanelData(panelBeforeHandle)) return { id };