@window-splitter/solid 0.8.0

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 (48) hide show
  1. package/.storybook/main.ts +24 -0
  2. package/.storybook/preview.ts +14 -0
  3. package/.tshy/build.json +8 -0
  4. package/.tshy/esm.json +18 -0
  5. package/.turbo/turbo-build.log +5 -0
  6. package/.turbo/turbo-lint.log +5 -0
  7. package/CHANGELOG.md +66 -0
  8. package/README.md +54 -0
  9. package/dist/esm/SolidWIndowSplitter.d.ts +19 -0
  10. package/dist/esm/SolidWIndowSplitter.d.ts.map +1 -0
  11. package/dist/esm/SolidWIndowSplitter.jsx +506 -0
  12. package/dist/esm/SolidWIndowSplitter.jsx.map +1 -0
  13. package/dist/esm/SolidWindowSplitter.stories.d.ts +52 -0
  14. package/dist/esm/SolidWindowSplitter.stories.d.ts.map +1 -0
  15. package/dist/esm/SolidWindowSplitter.stories.jsx +470 -0
  16. package/dist/esm/SolidWindowSplitter.stories.jsx.map +1 -0
  17. package/dist/esm/SolidWindowSplitter.test.d.ts +2 -0
  18. package/dist/esm/SolidWindowSplitter.test.d.ts.map +1 -0
  19. package/dist/esm/SolidWindowSplitter.test.jsx +197 -0
  20. package/dist/esm/SolidWindowSplitter.test.jsx.map +1 -0
  21. package/dist/esm/context.d.ts +18 -0
  22. package/dist/esm/context.d.ts.map +1 -0
  23. package/dist/esm/context.jsx +38 -0
  24. package/dist/esm/context.jsx.map +1 -0
  25. package/dist/esm/index.d.ts +2 -0
  26. package/dist/esm/index.d.ts.map +1 -0
  27. package/dist/esm/index.js +2 -0
  28. package/dist/esm/index.js.map +1 -0
  29. package/dist/esm/mergeSolidAttributes.d.ts +6 -0
  30. package/dist/esm/mergeSolidAttributes.d.ts.map +1 -0
  31. package/dist/esm/mergeSolidAttributes.js +45 -0
  32. package/dist/esm/mergeSolidAttributes.js.map +1 -0
  33. package/dist/esm/package.json +3 -0
  34. package/doctor-storybook.log +29 -0
  35. package/eslint.config.js +10 -0
  36. package/index.html +11 -0
  37. package/package.json +104 -0
  38. package/rsbuild.config.js +25 -0
  39. package/src/SolidWIndowSplitter.tsx +683 -0
  40. package/src/SolidWindowSplitter.stories.tsx +689 -0
  41. package/src/SolidWindowSplitter.test.tsx +333 -0
  42. package/src/__snapshots__/SolidWindowSplitter.test.tsx.snap +56 -0
  43. package/src/context.tsx +58 -0
  44. package/src/index.ts +1 -0
  45. package/src/mergeSolidAttributes.ts +61 -0
  46. package/tsconfig.json +8 -0
  47. package/vite.config.js +6 -0
  48. package/vitest.config.ts +22 -0
@@ -0,0 +1,197 @@
1
+ import { test, expect, describe, vi, afterEach } from "vitest";
2
+ import { cleanup, fireEvent, render, waitFor } from "@solidjs/testing-library";
3
+ import * as Cookies from "tiny-cookie";
4
+ import { Autosave, AutosaveCollapsible, Collapsible, ConditionalPanel, Simple, VerticalLayout, DynamicConstraints, AutosaveCookie, } from "./SolidWindowSplitter.stories.jsx";
5
+ import { createTestUtils, dragHandle } from "@window-splitter/interface/test";
6
+ const { expectTemplate, waitForMeasurement, waitForCondition } = createTestUtils({ waitFor });
7
+ afterEach(() => {
8
+ cleanup();
9
+ });
10
+ test("horizontal layout", async () => {
11
+ let handle = null;
12
+ const { getByText } = render(() => (<div style={{ width: "500px" }}>
13
+ <Simple handle={(v) => (handle = v)}/>
14
+ </div>));
15
+ await waitForMeasurement(handle);
16
+ expect(getByText("Panel 1")).toBeInTheDocument();
17
+ expect(getByText("Panel 2")).toBeInTheDocument();
18
+ await expectTemplate(handle, "244px 10px 244px");
19
+ // Should respect the min
20
+ await dragHandle({ delta: 300 });
21
+ await expectTemplate(handle, "388px 10px 100px");
22
+ });
23
+ test("vertical layout", async () => {
24
+ let handle = null;
25
+ const { getByText } = render(() => (<div style={{ width: "500px" }}>
26
+ <VerticalLayout handle={(v) => (handle = v)}/>
27
+ </div>));
28
+ await waitForMeasurement(handle);
29
+ expect(getByText("top")).toBeInTheDocument();
30
+ expect(getByText("middle")).toBeInTheDocument();
31
+ expect(getByText("bottom")).toBeInTheDocument();
32
+ await expectTemplate(handle, "96px 10px 108px 10px 96px");
33
+ // Should respect the min
34
+ await dragHandle({ delta: 100, orientation: "vertical" });
35
+ await expectTemplate(handle, "172px 10px 64px 10px 64px");
36
+ });
37
+ test("Conditional Panels", async () => {
38
+ let handle = null;
39
+ const { getByText } = render(() => (<div style={{ width: "500px" }}>
40
+ <ConditionalPanel handle={(v) => (handle = v)}/>
41
+ </div>));
42
+ await waitForMeasurement(handle);
43
+ await expectTemplate(handle, "244px 10px 244px");
44
+ getByText("Expand").click();
45
+ await expectTemplate(handle, "244px 10px 134px 10px 100px");
46
+ getByText("Close").click();
47
+ await expectTemplate(handle, "244px 10px 244px");
48
+ });
49
+ test("Dynamic constraints", async () => {
50
+ let handle = null;
51
+ const { getByText } = render(() => (<div style={{ width: "1000px" }}>
52
+ <DynamicConstraints handle={(v) => (handle = v)}/>
53
+ </div>));
54
+ await waitForMeasurement(handle);
55
+ await expectTemplate(handle, "100px 10px 178px 10px 700px");
56
+ getByText("Toggle Custom").click();
57
+ await expectTemplate(handle, "500px 10px 178px 10px 300px");
58
+ getByText("Toggle Custom").click();
59
+ await expectTemplate(handle, "400px 10px 178px 10px 400px");
60
+ });
61
+ describe("Autosave", () => {
62
+ test("localStorage", async () => {
63
+ localStorage.clear();
64
+ let handle = null;
65
+ render(() => (<div style={{ width: "500px" }}>
66
+ <Autosave handle={(v) => (handle = v)}/>
67
+ </div>));
68
+ await waitForMeasurement(handle);
69
+ await expectTemplate(handle, "244px 10px 244px");
70
+ await dragHandle({ delta: 100 });
71
+ await expectTemplate(handle, "342px 10px 146px");
72
+ await waitForCondition(() => Boolean(localStorage.getItem("autosave-example-solid")));
73
+ const obj = JSON.parse(localStorage.getItem("autosave-example-solid") || "{}");
74
+ expect(obj.items).toMatchSnapshot();
75
+ });
76
+ test("callback", async () => {
77
+ localStorage.clear();
78
+ let handle = null;
79
+ const spy = vi.fn();
80
+ render(() => (<div style={{ width: "500px" }}>
81
+ <AutosaveCollapsible handle={(v) => (handle = v)} onCollapseChange={spy}/>
82
+ </div>));
83
+ await dragHandle({ delta: -200 });
84
+ await expectTemplate(handle, "100px 10px 388px");
85
+ expect(spy).toHaveBeenCalledWith(true);
86
+ cleanup();
87
+ render(() => (<div style={{ width: "500px" }}>
88
+ <AutosaveCollapsible handle={(v) => (handle = v)} onCollapseChange={spy}/>
89
+ </div>));
90
+ await expectTemplate(handle, "100px 10px 388px");
91
+ await dragHandle({ delta: 200 });
92
+ expect(spy).toHaveBeenCalledWith(false);
93
+ });
94
+ test("cookie", async () => {
95
+ // clear cookies
96
+ document.cookie = "test=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
97
+ let handle = null;
98
+ render(() => (<div style={{ width: "502px" }}>
99
+ <AutosaveCookie handle={(v) => (handle = v)}/>
100
+ </div>));
101
+ await waitForMeasurement(handle);
102
+ await expectTemplate(handle, "245px 10px 245px");
103
+ await dragHandle({ delta: 100 });
104
+ await expectTemplate(handle, "343px 10px 147px");
105
+ await waitForCondition(() => document.cookie.includes("autosave-cookie-solid"));
106
+ expect(document.cookie).toMatchSnapshot();
107
+ const snapshot = Cookies.get("autosave-cookie-solid");
108
+ cleanup();
109
+ render(() => (<div style={{ width: "500px" }}>
110
+ <AutosaveCookie handle={(v) => (handle = v)} snapshot={snapshot ? JSON.parse(snapshot) : undefined}/>
111
+ </div>));
112
+ await expectTemplate(handle, "341.609375px 10px 146.390625px");
113
+ });
114
+ });
115
+ test("Keyboard interactions with collapsed panels", async () => {
116
+ let handle = null;
117
+ render(() => (<div style={{ width: "500px" }}>
118
+ <Collapsible handle={(v) => (handle = v)}/>
119
+ </div>));
120
+ await waitForMeasurement(handle);
121
+ await expectTemplate(handle, "209px 10px 209px 10px 60px");
122
+ const resizer2 = document.getElementById("resizer-2");
123
+ fireEvent.keyDown(resizer2, { key: "Enter" });
124
+ await expectTemplate(handle, "209px 10px 169px 10px 100px");
125
+ fireEvent.keyDown(resizer2, { key: "ArrowLeft" });
126
+ fireEvent.keyDown(resizer2, { key: "ArrowLeft" });
127
+ fireEvent.keyDown(resizer2, { key: "ArrowLeft" });
128
+ fireEvent.keyDown(resizer2, { key: "ArrowLeft" });
129
+ await expectTemplate(handle, "209px 10px 165px 10px 104px");
130
+ fireEvent.keyDown(resizer2, { key: "ArrowLeft", shiftKey: true });
131
+ await expectTemplate(handle, "209.03125px 10px 149.984375px 10px 118.984375px");
132
+ fireEvent.keyDown(resizer2, { key: "Enter" });
133
+ await expectTemplate(handle, "209.03125px 10px 208.96875px 10px 60px");
134
+ fireEvent.keyDown(resizer2, { key: "Enter" });
135
+ await expectTemplate(handle, "209.0625px 10px 149.96875px 10px 118.96875px");
136
+ });
137
+ describe("imperative panel API", async () => {
138
+ test("panel group", async () => {
139
+ let handle;
140
+ render(() => (<div style={{ width: "500px" }}>
141
+ <Collapsible handle={(v) => (handle = v)}/>
142
+ </div>));
143
+ await waitForMeasurement(handle);
144
+ expect(handle.getPercentageSizes()).toMatchInlineSnapshot(`
145
+ [
146
+ 0.5,
147
+ 0.020080321285140562,
148
+ 0.5,
149
+ 0.020080321285140562,
150
+ 0.12048192771084337,
151
+ ]
152
+ `);
153
+ expect(handle.getPixelSizes()).toMatchInlineSnapshot(`
154
+ [
155
+ 209,
156
+ 10,
157
+ 209,
158
+ 10,
159
+ 60,
160
+ ]
161
+ `);
162
+ await expectTemplate(handle, "209px 10px 209px 10px 60px");
163
+ });
164
+ test("panel", async () => {
165
+ let handle;
166
+ let rightHandle;
167
+ let leftHandle;
168
+ render(() => (<div style={{ width: "500px" }}>
169
+ <Collapsible handle={(v) => (handle = v)} rightPanelHandle={(v) => (rightHandle = v)} leftPanelHandle={(v) => (leftHandle = v)}/>
170
+ </div>));
171
+ await waitForMeasurement(handle);
172
+ expect(rightHandle.isCollapsed()).toBe(true);
173
+ expect(rightHandle.isExpanded()).toBe(false);
174
+ rightHandle.expand();
175
+ await new Promise((resolve) => setTimeout(resolve, 2000));
176
+ expect(rightHandle.isCollapsed()).toBe(false);
177
+ expect(rightHandle.isExpanded()).toBe(true);
178
+ rightHandle.collapse();
179
+ await new Promise((resolve) => setTimeout(resolve, 2000));
180
+ expect(rightHandle.isCollapsed()).toBe(true);
181
+ expect(rightHandle.isExpanded()).toBe(false);
182
+ // Test the non controlled version
183
+ expect(leftHandle.isCollapsed()).toBe(false);
184
+ expect(leftHandle.isExpanded()).toBe(true);
185
+ leftHandle.collapse();
186
+ await new Promise((resolve) => setTimeout(resolve, 2000));
187
+ expect(leftHandle.isCollapsed()).toBe(true);
188
+ expect(leftHandle.isExpanded()).toBe(false);
189
+ expect(rightHandle.getPercentageSize()).toBe(leftHandle.getPercentageSize());
190
+ expect(rightHandle.getPixelSize()).toBe(leftHandle.getPixelSize());
191
+ leftHandle.expand();
192
+ await new Promise((resolve) => setTimeout(resolve, 5000));
193
+ expect(leftHandle.isCollapsed()).toBe(false);
194
+ expect(leftHandle.isExpanded()).toBe(true);
195
+ });
196
+ });
197
+ //# sourceMappingURL=SolidWindowSplitter.test.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolidWindowSplitter.test.jsx","sourceRoot":"","sources":["../../src/SolidWindowSplitter.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AAGvC,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE9E,MAAM,EAAE,cAAc,EAAE,k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AC,CAAC,CAAC;QAE1D,MAAM,CAAC,UAAW,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,CAAC,UAAW,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,CAAC,WAAY,CAAC,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAC3C,UAAW,CAAC,iBAAiB,EAAE,CAChC,CAAC;QACF,MAAM,CAAC,WAAY,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,UAAW,CAAC,YAAY,EAAE,CAAC,CAAC;QAErE,UAAW,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAE1D,MAAM,CAAC,UAAW,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,CAAC,UAAW,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect, describe, vi, afterEach } from \"vitest\";\nimport { cleanup, fireEvent, render, waitFor } from \"@solidjs/testing-library\";\nimport * as Cookies from \"tiny-cookie\";\n\nimport { PanelGroupHandle, PanelHandle } from \"@window-splitter/interface\";\nimport {\n Autosave,\n AutosaveCollapsible,\n Collapsible,\n ConditionalPanel,\n Simple,\n VerticalLayout,\n DynamicConstraints,\n AutosaveCookie,\n} from \"./SolidWindowSplitter.stories.jsx\";\nimport { createTestUtils, dragHandle } from \"@window-splitter/interface/test\";\n\nconst { expectTemplate, waitForMeasurement, waitForCondition } =\n createTestUtils({ waitFor });\n\nafterEach(() => {\n cleanup();\n});\n\ntest(\"horizontal layout\", async () => {\n let handle: PanelGroupHandle | null = null!;\n\n const { getByText } = render(() => (\n <div style={{ width: \"500px\" }}>\n <Simple handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n\n expect(getByText(\"Panel 1\")).toBeInTheDocument();\n expect(getByText(\"Panel 2\")).toBeInTheDocument();\n\n await expectTemplate(handle, \"244px 10px 244px\");\n\n // Should respect the min\n await dragHandle({ delta: 300 });\n await expectTemplate(handle, \"388px 10px 100px\");\n});\n\ntest(\"vertical layout\", async () => {\n let handle: PanelGroupHandle | null = null!;\n\n const { getByText } = render(() => (\n <div style={{ width: \"500px\" }}>\n <VerticalLayout handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n\n expect(getByText(\"top\")).toBeInTheDocument();\n expect(getByText(\"middle\")).toBeInTheDocument();\n expect(getByText(\"bottom\")).toBeInTheDocument();\n\n await expectTemplate(handle, \"96px 10px 108px 10px 96px\");\n\n // Should respect the min\n await dragHandle({ delta: 100, orientation: \"vertical\" });\n await expectTemplate(handle, \"172px 10px 64px 10px 64px\");\n});\n\ntest(\"Conditional Panels\", async () => {\n let handle: PanelGroupHandle | null = null!;\n\n const { getByText } = render(() => (\n <div style={{ width: \"500px\" }}>\n <ConditionalPanel handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n await expectTemplate(handle, \"244px 10px 244px\");\n\n getByText(\"Expand\").click();\n await expectTemplate(handle, \"244px 10px 134px 10px 100px\");\n\n getByText(\"Close\").click();\n await expectTemplate(handle, \"244px 10px 244px\");\n});\n\ntest(\"Dynamic constraints\", async () => {\n let handle: PanelGroupHandle | null = null!;\n\n const { getByText } = render(() => (\n <div style={{ width: \"1000px\" }}>\n <DynamicConstraints handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n await expectTemplate(handle, \"100px 10px 178px 10px 700px\");\n\n getByText(\"Toggle Custom\").click();\n await expectTemplate(handle, \"500px 10px 178px 10px 300px\");\n\n getByText(\"Toggle Custom\").click();\n await expectTemplate(handle, \"400px 10px 178px 10px 400px\");\n});\n\ndescribe(\"Autosave\", () => {\n test(\"localStorage\", async () => {\n localStorage.clear();\n\n let handle: PanelGroupHandle | null = null!;\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <Autosave handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n await expectTemplate(handle, \"244px 10px 244px\");\n\n await dragHandle({ delta: 100 });\n await expectTemplate(handle, \"342px 10px 146px\");\n\n await waitForCondition(() =>\n Boolean(localStorage.getItem(\"autosave-example-solid\"))\n );\n const obj = JSON.parse(\n localStorage.getItem(\"autosave-example-solid\") || \"{}\"\n );\n expect(obj.items).toMatchSnapshot();\n });\n\n test(\"callback\", async () => {\n localStorage.clear();\n\n let handle: PanelGroupHandle | null = null!;\n\n const spy = vi.fn();\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <AutosaveCollapsible\n handle={(v) => (handle = v)}\n onCollapseChange={spy}\n />\n </div>\n ));\n\n await dragHandle({ delta: -200 });\n await expectTemplate(handle, \"100px 10px 388px\");\n expect(spy).toHaveBeenCalledWith(true);\n\n cleanup();\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <AutosaveCollapsible\n handle={(v) => (handle = v)}\n onCollapseChange={spy}\n />\n </div>\n ));\n\n await expectTemplate(handle, \"100px 10px 388px\");\n await dragHandle({ delta: 200 });\n expect(spy).toHaveBeenCalledWith(false);\n });\n\n test(\"cookie\", async () => {\n // clear cookies\n document.cookie = \"test=; expires=Thu, 01 Jan 1970 00:00:00 GMT\";\n\n let handle: PanelGroupHandle | null = null!;\n\n render(() => (\n <div style={{ width: \"502px\" }}>\n <AutosaveCookie handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n await expectTemplate(handle, \"245px 10px 245px\");\n\n await dragHandle({ delta: 100 });\n await expectTemplate(handle, \"343px 10px 147px\");\n\n await waitForCondition(() =>\n document.cookie.includes(\"autosave-cookie-solid\")\n );\n\n expect(document.cookie).toMatchSnapshot();\n\n const snapshot = Cookies.get(\"autosave-cookie-solid\");\n\n cleanup();\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <AutosaveCookie\n handle={(v) => (handle = v)}\n snapshot={snapshot ? JSON.parse(snapshot) : undefined}\n />\n </div>\n ));\n\n await expectTemplate(handle, \"341.609375px 10px 146.390625px\");\n });\n});\n\ntest(\"Keyboard interactions with collapsed panels\", async () => {\n let handle: PanelGroupHandle | null = null!;\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <Collapsible handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle);\n await expectTemplate(handle, \"209px 10px 209px 10px 60px\");\n\n const resizer2 = document.getElementById(\"resizer-2\")!;\n fireEvent.keyDown(resizer2, { key: \"Enter\" });\n await expectTemplate(handle, \"209px 10px 169px 10px 100px\");\n\n fireEvent.keyDown(resizer2, { key: \"ArrowLeft\" });\n fireEvent.keyDown(resizer2, { key: \"ArrowLeft\" });\n fireEvent.keyDown(resizer2, { key: \"ArrowLeft\" });\n fireEvent.keyDown(resizer2, { key: \"ArrowLeft\" });\n await expectTemplate(handle, \"209px 10px 165px 10px 104px\");\n\n fireEvent.keyDown(resizer2, { key: \"ArrowLeft\", shiftKey: true });\n await expectTemplate(\n handle,\n \"209.03125px 10px 149.984375px 10px 118.984375px\"\n );\n\n fireEvent.keyDown(resizer2, { key: \"Enter\" });\n await expectTemplate(handle, \"209.03125px 10px 208.96875px 10px 60px\");\n\n fireEvent.keyDown(resizer2, { key: \"Enter\" });\n await expectTemplate(handle, \"209.0625px 10px 149.96875px 10px 118.96875px\");\n});\n\ndescribe(\"imperative panel API\", async () => {\n test(\"panel group\", async () => {\n let handle: PanelGroupHandle;\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <Collapsible handle={(v) => (handle = v)} />\n </div>\n ));\n\n await waitForMeasurement(handle!);\n\n expect(handle!.getPercentageSizes()).toMatchInlineSnapshot(`\n [\n 0.5,\n 0.020080321285140562,\n 0.5,\n 0.020080321285140562,\n 0.12048192771084337,\n ]\n `);\n\n expect(handle!.getPixelSizes()).toMatchInlineSnapshot(`\n [\n 209,\n 10,\n 209,\n 10,\n 60,\n ]\n `);\n\n await expectTemplate(handle!, \"209px 10px 209px 10px 60px\");\n });\n\n test(\"panel\", async () => {\n let handle: PanelGroupHandle;\n let rightHandle: PanelHandle;\n let leftHandle: PanelHandle;\n\n render(() => (\n <div style={{ width: \"500px\" }}>\n <Collapsible\n handle={(v) => (handle = v)}\n rightPanelHandle={(v) => (rightHandle = v)}\n leftPanelHandle={(v) => (leftHandle = v)}\n />\n </div>\n ));\n\n await waitForMeasurement(handle!);\n\n expect(rightHandle!.isCollapsed()).toBe(true);\n expect(rightHandle!.isExpanded()).toBe(false);\n\n rightHandle!.expand();\n await new Promise((resolve) => setTimeout(resolve, 2000));\n\n expect(rightHandle!.isCollapsed()).toBe(false);\n expect(rightHandle!.isExpanded()).toBe(true);\n\n rightHandle!.collapse();\n await new Promise((resolve) => setTimeout(resolve, 2000));\n\n expect(rightHandle!.isCollapsed()).toBe(true);\n expect(rightHandle!.isExpanded()).toBe(false);\n\n // Test the non controlled version\n\n expect(leftHandle!.isCollapsed()).toBe(false);\n expect(leftHandle!.isExpanded()).toBe(true);\n\n leftHandle!.collapse();\n await new Promise((resolve) => setTimeout(resolve, 2000));\n\n expect(leftHandle!.isCollapsed()).toBe(true);\n expect(leftHandle!.isExpanded()).toBe(false);\n expect(rightHandle!.getPercentageSize()).toBe(\n leftHandle!.getPercentageSize()\n );\n expect(rightHandle!.getPixelSize()).toBe(leftHandle!.getPixelSize());\n\n leftHandle!.expand();\n await new Promise((resolve) => setTimeout(resolve, 5000));\n\n expect(leftHandle!.isCollapsed()).toBe(false);\n expect(leftHandle!.isExpanded()).toBe(true);\n });\n});\n"]}
@@ -0,0 +1,18 @@
1
+ import { Accessor, JSXElement } from "solid-js";
2
+ import { GroupMachineContextValue, SendFn } from "@window-splitter/state";
3
+ export declare const InitialPrerenderContext: import("solid-js").Context<Accessor<boolean>>;
4
+ export declare const MachineActorContext: import("solid-js").Context<((event: import("@window-splitter/state").GroupMachineEvent) => void) | undefined>;
5
+ export declare const GroupIdContext: import("solid-js").Context<string | undefined>;
6
+ export declare const MachineStateContext: import("solid-js").Context<Accessor<GroupMachineContextValue | undefined> | undefined>;
7
+ export declare function useInitialPrerenderContext(): Accessor<boolean>;
8
+ export declare function useMachineActor(): ((event: import("@window-splitter/state").GroupMachineEvent) => void) | undefined;
9
+ export declare function useGroupId(): string | undefined;
10
+ export declare function useMachineState(): Accessor<GroupMachineContextValue | undefined> | undefined;
11
+ export declare function GroupMachineProvider(props: {
12
+ children: JSXElement;
13
+ groupId: string;
14
+ send: SendFn;
15
+ state: Accessor<GroupMachineContextValue | undefined>;
16
+ initialPrerender?: Accessor<boolean>;
17
+ }): import("solid-js").JSX.Element;
18
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE1E,eAAO,MAAM,uBAAuB,+CAEnC,CAAC;AACF,eAAO,MAAM,mBAAmB,+GAAsC,CAAC;AACvE,eAAO,MAAM,cAAc,gDAAsC,CAAC;AAClE,eAAO,MAAM,mBAAmB,wFAE7B,CAAC;AAEJ,wBAAgB,0BAA0B,sBAGzC;AAED,wBAAgB,eAAe,sFAG9B;AAED,wBAAgB,UAAU,uBAGzB;AAED,wBAAgB,eAAe,+DAG9B;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IACtD,gBAAgB,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,kCAkBA"}
@@ -0,0 +1,38 @@
1
+ import { createContext, useContext } from "solid-js";
2
+ export const InitialPrerenderContext = createContext(() => false);
3
+ export const MachineActorContext = createContext();
4
+ export const GroupIdContext = createContext();
5
+ export const MachineStateContext = createContext();
6
+ export function useInitialPrerenderContext() {
7
+ const context = useContext(InitialPrerenderContext);
8
+ return context;
9
+ }
10
+ export function useMachineActor() {
11
+ const context = useContext(MachineActorContext);
12
+ return context;
13
+ }
14
+ export function useGroupId() {
15
+ const context = useContext(GroupIdContext);
16
+ return context;
17
+ }
18
+ export function useMachineState() {
19
+ const context = useContext(MachineStateContext);
20
+ return context;
21
+ }
22
+ // Create a provider component that bundles all the contexts together
23
+ export function GroupMachineProvider(props) {
24
+ return (<InitialPrerenderContext.Provider value={props.initialPrerender ?? (() => false)}>
25
+ {/* The rule is wrong. the docs even suggust this pattern */}
26
+ {/* eslint-disable-next-line solid/reactivity */}
27
+ <GroupIdContext.Provider value={props.groupId}>
28
+ {/* eslint-disable-next-line solid/reactivity */}
29
+ <MachineActorContext.Provider value={props.send}>
30
+ {/* eslint-disable-next-line solid/reactivity */}
31
+ <MachineStateContext.Provider value={props.state}>
32
+ {props.children}
33
+ </MachineStateContext.Provider>
34
+ </MachineActorContext.Provider>
35
+ </GroupIdContext.Provider>
36
+ </InitialPrerenderContext.Provider>);
37
+ }
38
+ //# sourceMappingURL=context.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.jsx","sourceRoot":"","sources":["../../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAwB,MAAM,UAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAClD,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,EAAsB,CAAC;AACvE,MA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BAAmB,CAAC,QAAQ,CAChC;MAAA,EAAE,cAAc,CAAC,QAAQ,CAC3B;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAC;AACJ,CAAC","sourcesContent":["import { createContext, useContext, Accessor, JSXElement } from \"solid-js\";\nimport { GroupMachineContextValue, SendFn } from \"@window-splitter/state\";\n\nexport const InitialPrerenderContext = createContext<Accessor<boolean>>(\n () => false\n);\nexport const MachineActorContext = createContext<SendFn | undefined>();\nexport const GroupIdContext = createContext<string | undefined>();\nexport const MachineStateContext = createContext<\n Accessor<GroupMachineContextValue | undefined> | undefined\n>();\n\nexport function useInitialPrerenderContext() {\n const context = useContext(InitialPrerenderContext);\n return context;\n}\n\nexport function useMachineActor() {\n const context = useContext(MachineActorContext);\n return context;\n}\n\nexport function useGroupId() {\n const context = useContext(GroupIdContext);\n return context;\n}\n\nexport function useMachineState() {\n const context = useContext(MachineStateContext);\n return context;\n}\n\n// Create a provider component that bundles all the contexts together\nexport function GroupMachineProvider(props: {\n children: JSXElement;\n groupId: string;\n send: SendFn;\n state: Accessor<GroupMachineContextValue | undefined>;\n initialPrerender?: Accessor<boolean>;\n}) {\n return (\n <InitialPrerenderContext.Provider\n value={props.initialPrerender ?? (() => false)}\n >\n {/* The rule is wrong. the docs even suggust this pattern */}\n {/* eslint-disable-next-line solid/reactivity */}\n <GroupIdContext.Provider value={props.groupId}>\n {/* eslint-disable-next-line solid/reactivity */}\n <MachineActorContext.Provider value={props.send}>\n {/* eslint-disable-next-line solid/reactivity */}\n <MachineStateContext.Provider value={props.state}>\n {props.children}\n </MachineStateContext.Provider>\n </MachineActorContext.Provider>\n </GroupIdContext.Provider>\n </InitialPrerenderContext.Provider>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./SolidWIndowSplitter.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./SolidWIndowSplitter.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./SolidWIndowSplitter.js\";\n"]}
@@ -0,0 +1,6 @@
1
+ export type MaybeAccessor<T> = T | (() => T);
2
+ export declare function mergeSolidAttributes<T>(source: MaybeAccessor<T>): T;
3
+ export declare function mergeSolidAttributes<T, U>(source: MaybeAccessor<T>, source1: MaybeAccessor<U>): T & U;
4
+ export declare function mergeSolidAttributes<T, U, V>(source: MaybeAccessor<T>, source1: MaybeAccessor<U>, source2: MaybeAccessor<V>): T & U & V;
5
+ export declare function mergeSolidAttributes<T, U, V, W>(source: MaybeAccessor<T>, source1: MaybeAccessor<U>, source2: MaybeAccessor<V>, source3: MaybeAccessor<W>): T & U & V & W;
6
+ //# sourceMappingURL=mergeSolidAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeSolidAttributes.d.ts","sourceRoot":"","sources":["../../src/mergeSolidAttributes.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7C,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACrE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EACvC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GACxB,CAAC,GAAG,CAAC,CAAC;AACT,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC1C,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GACxB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACb,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7C,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GACxB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { mergeAttributes as mergeAttributesBase } from "@window-splitter/interface";
3
+ export function mergeSolidAttributes(...sources) {
4
+ const target = {};
5
+ for (let i = 0; i < sources.length; i++) {
6
+ let source = sources[i];
7
+ if (typeof source === "function")
8
+ source = source();
9
+ if (source) {
10
+ const descriptors = Object.getOwnPropertyDescriptors(source);
11
+ for (const key in descriptors) {
12
+ if (key in target)
13
+ continue;
14
+ Object.defineProperty(target, key, {
15
+ enumerable: true,
16
+ get() {
17
+ let e = {};
18
+ if (key === "style" ||
19
+ key === "class" ||
20
+ key === "className" ||
21
+ key.startsWith("on")) {
22
+ for (let j = 0; j < sources.length; j++) {
23
+ let s = sources[j];
24
+ if (typeof s === "function")
25
+ s = s();
26
+ e = mergeAttributesBase(e, { [key]: (s || {})[key] });
27
+ }
28
+ return e[key];
29
+ }
30
+ for (let j = sources.length - 1; j >= 0; j--) {
31
+ let s = sources[j];
32
+ if (typeof s === "function")
33
+ s = s();
34
+ const v = (s || {})[key];
35
+ if (v !== undefined)
36
+ return v;
37
+ }
38
+ },
39
+ });
40
+ }
41
+ }
42
+ }
43
+ return target;
44
+ }
45
+ //# sourceMappingURL=mergeSolidAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeSolidAtt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AAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;4BACxD,CAAC;4BAED,OAAQ,CAAS,CAAC,GAAG,CAAC,CAAC;wBACzB,CAAC;wBACD,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;4BAC7C,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;4BACnB,IAAI,OAAO,CAAC,KAAK,UAAU;gCAAE,CAAC,GAAG,CAAC,EAAE,CAAC;4BACrC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;4BACzB,IAAI,CAAC,KAAK,SAAS;gCAAE,OAAO,CAAC,CAAC;wBAChC,CAAC;oBACH,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { mergeAttributes as mergeAttributesBase } from \"@window-splitter/interface\";\n\nexport type MaybeAccessor<T> = T | (() => T);\n\nexport function mergeSolidAttributes<T>(source: MaybeAccessor<T>): T;\nexport function mergeSolidAttributes<T, U>(\n source: MaybeAccessor<T>,\n source1: MaybeAccessor<U>\n): T & U;\nexport function mergeSolidAttributes<T, U, V>(\n source: MaybeAccessor<T>,\n source1: MaybeAccessor<U>,\n source2: MaybeAccessor<V>\n): T & U & V;\nexport function mergeSolidAttributes<T, U, V, W>(\n source: MaybeAccessor<T>,\n source1: MaybeAccessor<U>,\n source2: MaybeAccessor<V>,\n source3: MaybeAccessor<W>\n): T & U & V & W;\nexport function mergeSolidAttributes(...sources: any[]) {\n const target = {};\n for (let i = 0; i < sources.length; i++) {\n let source = sources[i];\n if (typeof source === \"function\") source = source();\n if (source) {\n const descriptors = Object.getOwnPropertyDescriptors(source);\n for (const key in descriptors) {\n if (key in target) continue;\n Object.defineProperty(target, key, {\n enumerable: true,\n get() {\n let e = {};\n if (\n key === \"style\" ||\n key === \"class\" ||\n key === \"className\" ||\n key.startsWith(\"on\")\n ) {\n for (let j = 0; j < sources.length; j++) {\n let s = sources[j];\n if (typeof s === \"function\") s = s();\n e = mergeAttributesBase(e, { [key]: (s || {})[key] });\n }\n\n return (e as any)[key];\n }\n for (let j = sources.length - 1; j >= 0; j--) {\n let s = sources[j];\n if (typeof s === \"function\") s = s();\n const v = (s || {})[key];\n if (v !== undefined) return v;\n }\n },\n });\n }\n }\n }\n return target;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,29 @@
1
+ 🩺 The doctor is checking the health of your Storybook..
2
+ ╭ Incompatible packages found ─────────────────────────────────────────────────────────────────────────────╮
3
+ │ │
4
+ │ You are currently using Storybook 1.0.0-beta.7 but you have packages which are incompatible with it: │
5
+ │ - @storybook/builder-vite@9.0.0-beta.4 which depends on 9.0.0-beta.4 │
6
+ │ Repo: https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme │
7
+ │ - storybook-solidjs@1.0.0-beta.7 which depends on * │
8
+ │ Repo: https://github.com/storybookjs/storybook/tree/main/renderers/solid │
9
+ │ - storybook-solidjs-vite@1.0.0-beta.7 which depends on * │
10
+ │ Repo: https://github.com/storybookjs/storybook/tree/main/frameworks/solid-vite │
11
+ │ │
12
+ │ │
13
+ │ Please consider updating your packages or contacting the maintainers for compatibility details. │
14
+ │ For more on Storybook 9 compatibility, see the linked GitHub issue: │
15
+ │ https://github.com/storybookjs/storybook/issues/30944 │
16
+ │ │
17
+ │ │
18
+ │ The version of storybook@1.0.0-beta.7 is behind the following core packages: │
19
+ │ - @storybook/builder-vite@9.0.0-beta.4 │
20
+ │ Upgrade Storybook with: │
21
+ │ npx storybook@latest upgrade │
22
+ │ │
23
+ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
24
+
25
+ You can always recheck the health of your project by running:
26
+ npx storybook doctor
27
+
28
+ Full logs are available in /Users/andrew/Documents/react-window-splitter/packages/solid/doctor-storybook.log
29
+
@@ -0,0 +1,10 @@
1
+ import base from "@internal/eslint-config/base.js";
2
+ import solid from "eslint-plugin-solid/configs/typescript";
3
+
4
+ export default [
5
+ ...base,
6
+ {
7
+ files: ["**/*.{ts,tsx}"],
8
+ ...solid,
9
+ },
10
+ ];
package/index.html ADDED
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ </head>
7
+ <body>
8
+ <div id="app"></div>
9
+ <script src="./src/main.tsx" type="module"></script>
10
+ </body>
11
+ </html>
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "@window-splitter/solid",
4
+ "sideEffects": false,
5
+ "version": "0.8.0",
6
+ "description": "A WAI-ARIA compliant window splitter for Solid.",
7
+ "repository": {
8
+ "url": "https://github.com/hipstersmoothie/react-splitter",
9
+ "directory": "packages/solid"
10
+ },
11
+ "author": {
12
+ "name": "Andrew Lisowski",
13
+ "email": "lisowski54@gmail.com"
14
+ },
15
+ "engines": {
16
+ "node": ">=18.0.0"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "scripts": {
22
+ "build": "tshy",
23
+ "test": "CI=true vitest",
24
+ "dev": "tshy -w",
25
+ "lint": "eslint .",
26
+ "stats": "rsbuild --mode production build",
27
+ "storybook": "storybook dev -p 6006",
28
+ "build-storybook": "storybook build",
29
+ "clean": "rm -rf dist .turbo .tshy .tshy-build"
30
+ },
31
+ "license": "MIT",
32
+ "devDependencies": {
33
+ "@chromatic-com/storybook": "^1.6.1",
34
+ "@internal/eslint-config": "0.8.0",
35
+ "@rsbuild/core": "^1.3.12",
36
+ "@rsdoctor/rspack-plugin": "^1.0.2",
37
+ "@storybook/builder-vite": "9.0.0-beta.4",
38
+ "@testing-library/jest-dom": "^6.4.8",
39
+ "@types/node": "^20.14.10",
40
+ "@vitest/browser": "^3.1.2",
41
+ "@vitest/coverage-istanbul": "^3.1.2",
42
+ "eslint": "^9.9.0",
43
+ "eslint-plugin-solid": "^0.14.5",
44
+ "eslint-plugin-storybook": "^0.12.0",
45
+ "framer-motion": "^11.3.28",
46
+ "jsdom": "^24.1.1",
47
+ "playwright": "^1.46.0",
48
+ "react": "^18",
49
+ "solid-js": "^1.9.5",
50
+ "storybook": "9.0.0-beta.4",
51
+ "storybook-solidjs": "1.0.0-beta.6",
52
+ "storybook-solidjs-vite": "1.0.0-beta.6",
53
+ "tiny-cookie": "^2.5.1",
54
+ "tshy": "^3.0.2",
55
+ "typescript": "^5.5.4",
56
+ "vite": "^6.3.3",
57
+ "vite-plugin-solid": "^2.11.6",
58
+ "vitest": "^3.1.2"
59
+ },
60
+ "peerDependencies": {
61
+ "solid-js": ">=1.x"
62
+ },
63
+ "dependencies": {
64
+ "@solidjs/testing-library": "^0.8.10",
65
+ "@window-splitter/interface": "0.8.0",
66
+ "@window-splitter/state": "0.8.0"
67
+ },
68
+ "tshy": {
69
+ "exclude": [
70
+ "node_modules",
71
+ "src/**/*.test.ts",
72
+ "**/*stories.*"
73
+ ],
74
+ "exports": {
75
+ ".": "./src/index.tsx"
76
+ },
77
+ "dialects": [
78
+ "esm"
79
+ ]
80
+ },
81
+ "type": "module",
82
+ "exports": {
83
+ ".": {
84
+ "import": {
85
+ "types": "./dist/esm/index.d.ts",
86
+ "default": "./dist/esm/index.js"
87
+ }
88
+ }
89
+ },
90
+ "module": "./dist/esm/index.js",
91
+ "keywords": [
92
+ "solid",
93
+ "panel",
94
+ "splitter",
95
+ "resizable",
96
+ "window"
97
+ ],
98
+ "eslintConfig": {
99
+ "extends": [
100
+ "plugin:storybook/recommended"
101
+ ]
102
+ },
103
+ "gitHead": "0b59935917fc8cda33c41fc09336b36a4f139707"
104
+ }
@@ -0,0 +1,25 @@
1
+ /** @type {import('@rsbuild/core').RsbuildConfig} */
2
+ export default {
3
+ source: {
4
+ entry: {
5
+ index: "./src/bundle.size.ts",
6
+ },
7
+ },
8
+ tools: {
9
+ htmlPlugin: false,
10
+ },
11
+ performance: {
12
+ bundleAnalyze: {
13
+ generateStatsFile: true,
14
+ statsOptions: {
15
+ preset: "verbose",
16
+ },
17
+ },
18
+ },
19
+ output: {
20
+ externals: {
21
+ react: "React",
22
+ "react-dom": "ReactDOM",
23
+ },
24
+ },
25
+ };