Skip to content

Commit

Permalink
fix: use-id (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 15, 2024
1 parent e36805b commit d0caad8
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilled-monkeys-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"paneforge": patch
---

fix: issue with useId causing duplicate IDs
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "5.0.0-next.262",
"svelte": "^5.0.0-next.262",
"svelte-eslint-parser": "^0.41.1"
},
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions packages/paneforge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"postcss": "^8.4.32",
"postcss-load-config": "^5.0.2",
"publint": "^0.2.8",
"svelte": "5.0.0-next.262",
"svelte": "^5.0.0-next.262",
"svelte-check": "^4.0.4",
"tailwindcss": "^3.4.1",
"tslib": "^2.6.3",
Expand All @@ -55,6 +55,6 @@
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"svelte-toolbelt": "^0.4.1"
"svelte-toolbelt": "^0.4.2"
}
}
2 changes: 1 addition & 1 deletion packages/paneforge/src/lib/internal/utils/useId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ let count = 0;
* Generates a unique ID based on a global counter.
*/
export function useId(prefix = "paneforge") {
count = count++;
count++;
return `${prefix}-${count}`;
}
6 changes: 3 additions & 3 deletions packages/paneforge/src/lib/paneforge.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class PaneGroupState {
#keyboardResizeBy: PaneGroupStateProps["keyboardResizeBy"];
#onLayout: PaneGroupStateProps["onLayout"];
#storage: PaneGroupStateProps["storage"];
dragState = $state<DragState | null>(null);
layout = $state<number[]>([]);
paneDataArray = $state<PaneData[]>([]);
dragState = $state.raw<DragState | null>(null);
layout = $state.raw<number[]>([]);
paneDataArray = $state.raw<PaneData[]>([]);
paneDataArrayChanged = $state<boolean>(false);

paneIdToLastNotifiedSizeMap = $state<Record<string, number>>({});
Expand Down
214 changes: 113 additions & 101 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"rehype-pretty-code": "^0.13.0",
"remark-gfm": "^4.0.0",
"shiki": "^1.1.3",
"svelte": "5.0.0-next.262",
"svelte": "^5.0.0-next.262",
"svelte-check": "^4.0.4",
"svelte-toolbelt": "^0.4.1",
"tailwind-merge": "^2.2.1",
Expand Down

0 comments on commit d0caad8

Please sign in to comment.