@window-splitter/state 0.5.1 → 0.5.3
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +1316 -839
- package/CHANGELOG.md +24 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +35 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +5 -6
- package/src/index.ts +6 -7
- package/src/machine.test.ts +2 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@window-splitter/state",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.3",
|
|
6
6
|
"description": "A state machine for a WAI-ARIA compliant window splitter",
|
|
7
7
|
"homepage": "https://react-window-splitter-six.vercel.app",
|
|
8
8
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@internal/eslint-config": "0.5.
|
|
31
|
+
"@internal/eslint-config": "0.5.3",
|
|
32
32
|
"@testing-library/react": "^16.0.0",
|
|
33
33
|
"@types/big.js": "^6.2.2",
|
|
34
34
|
"@vitest/browser": "^2.0.5",
|
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@react-spring/rafz": "^9.7.4",
|
|
46
|
-
"@types/invariant": "^2.2.37",
|
|
47
46
|
"big.js": "^6.2.1",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
47
|
+
"tiny-cookie": "^2.5.1",
|
|
48
|
+
"tiny-invariant": "^1.3.3",
|
|
50
49
|
"xstate": "^5.17.4"
|
|
51
50
|
},
|
|
52
51
|
"tshy": {
|
|
@@ -80,5 +79,5 @@
|
|
|
80
79
|
"window"
|
|
81
80
|
],
|
|
82
81
|
"types": "./dist/commonjs/index.d.ts",
|
|
83
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "686f0f6b0d0f0253a7a127fe44936b16c057c3c1"
|
|
84
83
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Cookies from "
|
|
1
|
+
import * as Cookies from "tiny-cookie";
|
|
2
2
|
import { raf } from "@react-spring/rafz";
|
|
3
3
|
import {
|
|
4
4
|
createMachine,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
fromPromise,
|
|
8
8
|
Snapshot,
|
|
9
9
|
} from "xstate";
|
|
10
|
-
import invariant from "invariant";
|
|
10
|
+
import invariant from "tiny-invariant";
|
|
11
11
|
import Big from "big.js";
|
|
12
12
|
|
|
13
13
|
// #region Constants
|
|
@@ -1850,11 +1850,10 @@ export const groupMachine = createMachine(
|
|
|
1850
1850
|
if (context.autosaveStrategy === "localStorage") {
|
|
1851
1851
|
localStorage.setItem(context.groupId, data);
|
|
1852
1852
|
} else {
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
cookies.set(context.groupId, data, { path: "/", maxAge: 31536000 });
|
|
1853
|
+
Cookies.set(context.groupId, data, {
|
|
1854
|
+
path: "/",
|
|
1855
|
+
"max-age": 31536000,
|
|
1856
|
+
});
|
|
1858
1857
|
}
|
|
1859
1858
|
},
|
|
1860
1859
|
notifyCollapseToggle: ({ context, event }) => {
|
package/src/machine.test.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { Actor, createActor } from "xstate";
|
|
21
21
|
import { spring } from "framer-motion";
|
|
22
22
|
import Big from "big.js";
|
|
23
|
-
import Cookies from "
|
|
23
|
+
import * as Cookies from "tiny-cookie";
|
|
24
24
|
|
|
25
25
|
function getTemplate(actor: Actor<typeof groupMachine>) {
|
|
26
26
|
return buildTemplate(actor.getSnapshot().context);
|
|
@@ -2040,9 +2040,7 @@ describe("autosave", () => {
|
|
|
2040
2040
|
|
|
2041
2041
|
await waitForIdle(actor);
|
|
2042
2042
|
|
|
2043
|
-
const
|
|
2044
|
-
const cookies = new ActualClass(null, { path: "/" });
|
|
2045
|
-
const snapshot = prepareSnapshot(cookies.get("group-2")!);
|
|
2043
|
+
const snapshot = prepareSnapshot(JSON.parse(Cookies.get("group-2")!));
|
|
2046
2044
|
const actor2 = createActor(groupMachine, {
|
|
2047
2045
|
// @ts-expect-error For tests
|
|
2048
2046
|
input: {},
|