@sanity/ui 2.15.14 → 2.15.15-canary.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.15-canary.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -60,32 +60,6 @@
|
|
|
60
60
|
"exports",
|
|
61
61
|
"src"
|
|
62
62
|
],
|
|
63
|
-
"scripts": {
|
|
64
|
-
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
65
|
-
"clean": "rimraf .workshop dist",
|
|
66
|
-
"commit": "cz",
|
|
67
|
-
"cypress:dev": "run-p dev cypress:open",
|
|
68
|
-
"cypress:open": "cypress open",
|
|
69
|
-
"cypress:run": "cypress run",
|
|
70
|
-
"dev": "run-p storybook:dev workshop:dev",
|
|
71
|
-
"figma:pkg:build": "cd figma && pnpm build",
|
|
72
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
73
|
-
"lint": "eslint .",
|
|
74
|
-
"pkg:build": "pkg build --strict",
|
|
75
|
-
"pkg:check": "pkg --strict",
|
|
76
|
-
"prepare": "husky install",
|
|
77
|
-
"prepack": "pnpm build",
|
|
78
|
-
"release": "semantic-release",
|
|
79
|
-
"storybook:build": "storybook build",
|
|
80
|
-
"storybook:dev": "storybook dev -p 6006",
|
|
81
|
-
"test": "jest",
|
|
82
|
-
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
83
|
-
"ts:check": "tsc",
|
|
84
|
-
"watch": "pkg watch --strict",
|
|
85
|
-
"workshop:build": "workshop build",
|
|
86
|
-
"workshop:dev": "workshop dev",
|
|
87
|
-
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
88
|
-
},
|
|
89
63
|
"commitlint": {
|
|
90
64
|
"extends": [
|
|
91
65
|
"@commitlint/config-conventional"
|
|
@@ -120,7 +94,7 @@
|
|
|
120
94
|
"@sanity/icons": "^3.7.0",
|
|
121
95
|
"csstype": "^3.1.3",
|
|
122
96
|
"framer-motion": "^12.9.2",
|
|
123
|
-
"react-compiler-runtime": "19.
|
|
97
|
+
"react-compiler-runtime": "19.1.0-rc.1",
|
|
124
98
|
"react-refractor": "^2.2.0",
|
|
125
99
|
"use-effect-event": "^1.0.2"
|
|
126
100
|
},
|
|
@@ -135,7 +109,7 @@
|
|
|
135
109
|
"@sanity/pkg-utils": "^7.2.2",
|
|
136
110
|
"@sanity/prettier-config": "^1.0.3",
|
|
137
111
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
138
|
-
"@sanity/ui-workshop": "^2.
|
|
112
|
+
"@sanity/ui-workshop": "^2.1.1",
|
|
139
113
|
"@storybook/addon-a11y": "^8.6.12",
|
|
140
114
|
"@storybook/addon-docs": "^8.6.12",
|
|
141
115
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -162,7 +136,7 @@
|
|
|
162
136
|
"@types/react-is": "^19.0.0",
|
|
163
137
|
"@types/refractor": "^3.4.1",
|
|
164
138
|
"@vitejs/plugin-react": "^4.4.1",
|
|
165
|
-
"babel-plugin-react-compiler": "19.
|
|
139
|
+
"babel-plugin-react-compiler": "19.1.0-rc.1",
|
|
166
140
|
"babel-plugin-styled-components": "^2.1.4",
|
|
167
141
|
"commitizen": "^4.3.1",
|
|
168
142
|
"cypress": "^13.17.0",
|
|
@@ -175,8 +149,7 @@
|
|
|
175
149
|
"eslint-plugin-import": "^2.31.0",
|
|
176
150
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
177
151
|
"eslint-plugin-react": "^7.37.5",
|
|
178
|
-
"eslint-plugin-react-
|
|
179
|
-
"eslint-plugin-react-hooks": "experimental",
|
|
152
|
+
"eslint-plugin-react-hooks": "0.0.0-experimental-0038c501-20250429",
|
|
180
153
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
181
154
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
182
155
|
"eslint-plugin-storybook": "^0.12.0",
|
|
@@ -211,25 +184,37 @@
|
|
|
211
184
|
"react-is": "^18 || >=19.0.0-0",
|
|
212
185
|
"styled-components": "^5.2 || ^6"
|
|
213
186
|
},
|
|
214
|
-
"packageManager": "pnpm@9.15.9",
|
|
215
187
|
"engines": {
|
|
216
188
|
"node": ">=14.0.0"
|
|
217
189
|
},
|
|
218
190
|
"publishConfig": {
|
|
219
191
|
"access": "public"
|
|
220
192
|
},
|
|
221
|
-
"pnpm": {
|
|
222
|
-
"overrides": {
|
|
223
|
-
"@types/react": "$@types/react",
|
|
224
|
-
"@types/react-dom": "$@types/react-dom",
|
|
225
|
-
"@types/react-is": "$@types/react-is",
|
|
226
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0",
|
|
227
|
-
"react": "$react",
|
|
228
|
-
"react-dom": "$react-dom",
|
|
229
|
-
"react-is": "$react-is"
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
193
|
"esm.sh": {
|
|
233
194
|
"bundle": false
|
|
195
|
+
},
|
|
196
|
+
"scripts": {
|
|
197
|
+
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
198
|
+
"clean": "rimraf .workshop dist",
|
|
199
|
+
"commit": "cz",
|
|
200
|
+
"cypress:dev": "run-p dev cypress:open",
|
|
201
|
+
"cypress:open": "cypress open",
|
|
202
|
+
"cypress:run": "cypress run",
|
|
203
|
+
"dev": "run-p storybook:dev workshop:dev",
|
|
204
|
+
"figma:pkg:build": "cd figma && pnpm build",
|
|
205
|
+
"format": "prettier --write --cache --ignore-unknown .",
|
|
206
|
+
"lint": "eslint .",
|
|
207
|
+
"pkg:build": "pkg build --strict",
|
|
208
|
+
"pkg:check": "pkg --strict",
|
|
209
|
+
"release": "semantic-release",
|
|
210
|
+
"storybook:build": "storybook build",
|
|
211
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
212
|
+
"test": "jest",
|
|
213
|
+
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
214
|
+
"ts:check": "tsc",
|
|
215
|
+
"watch": "pkg watch --strict",
|
|
216
|
+
"workshop:build": "workshop build",
|
|
217
|
+
"workshop:dev": "workshop dev",
|
|
218
|
+
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
234
219
|
}
|
|
235
|
-
}
|
|
220
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {useCallback, useDebugValue, useSyncExternalStore} from 'react'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Efficiently subscribes to `window.matchMedia` queries
|
|
@@ -11,36 +11,18 @@ export function useMatchMedia(
|
|
|
11
11
|
mediaQueryString: `(${string})`,
|
|
12
12
|
getServerSnapshot?: () => boolean,
|
|
13
13
|
): boolean {
|
|
14
|
-
const {subscribe, getSnapshot} = useMemo(() => {
|
|
15
|
-
/**
|
|
16
|
-
* `subscribe` and `getSnapshot` are only called on the client and both need access to the same `matchMedia` instance
|
|
17
|
-
* we don't want to eagerly instantiate it to ensure it's only created when actually used
|
|
18
|
-
*/
|
|
19
|
-
let MEDIA_QUERY_CACHE: MediaQueryList | undefined
|
|
20
|
-
|
|
21
|
-
const getMatchMedia = (): MediaQueryList => {
|
|
22
|
-
if (!MEDIA_QUERY_CACHE) {
|
|
23
|
-
// As this function is only called during `subscribe` and `getSnapshot`, we can assume that the
|
|
24
|
-
// the `window` global is available and we're in a browser environment
|
|
25
|
-
MEDIA_QUERY_CACHE = window.matchMedia(mediaQueryString)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return MEDIA_QUERY_CACHE
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
subscribe: (onStoreChange: () => void): (() => void) => {
|
|
33
|
-
const matchMedia = getMatchMedia()
|
|
34
|
-
|
|
35
|
-
matchMedia.addEventListener('change', onStoreChange)
|
|
36
|
-
|
|
37
|
-
return () => matchMedia.removeEventListener('change', onStoreChange)
|
|
38
|
-
},
|
|
39
|
-
getSnapshot: () => getMatchMedia().matches,
|
|
40
|
-
}
|
|
41
|
-
}, [mediaQueryString])
|
|
42
|
-
|
|
43
14
|
useDebugValue(mediaQueryString)
|
|
44
15
|
|
|
45
|
-
return useSyncExternalStore(
|
|
16
|
+
return useSyncExternalStore(
|
|
17
|
+
useCallback(
|
|
18
|
+
(onStoreChange) => {
|
|
19
|
+
const media = window.matchMedia(mediaQueryString)
|
|
20
|
+
media.addEventListener('change', onStoreChange)
|
|
21
|
+
return () => media.removeEventListener('change', onStoreChange)
|
|
22
|
+
},
|
|
23
|
+
[mediaQueryString],
|
|
24
|
+
),
|
|
25
|
+
() => window.matchMedia(mediaQueryString).matches,
|
|
26
|
+
getServerSnapshot,
|
|
27
|
+
)
|
|
46
28
|
}
|