@sanity/ui 2.1.3-canary.0 → 2.1.3-canary.1
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +10 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/core/components/menu/menuContext.ts +2 -5
- package/src/core/components/toast/toastContext.ts +2 -5
- package/src/core/components/tree/treeContext.ts +2 -5
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +3 -6
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +5 -6
- package/src/core/utils/layer/layerContext.ts +2 -5
- package/src/core/utils/portal/portalContext.ts +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.1.3-canary.
|
|
3
|
+
"version": "2.1.3-canary.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@commitlint/cli": "^19.2.1",
|
|
94
94
|
"@commitlint/config-conventional": "^19.1.0",
|
|
95
95
|
"@juggle/resize-observer": "^3.4.0",
|
|
96
|
-
"@sanity/pkg-utils": "^6.
|
|
96
|
+
"@sanity/pkg-utils": "^6.6.1",
|
|
97
97
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
98
98
|
"@sanity/ui-workshop": "^2.0.12",
|
|
99
99
|
"@storybook/addon-a11y": "^8.0.7",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
3
2
|
|
|
4
3
|
export interface MenuContextValue {
|
|
5
4
|
version: 0.0
|
|
@@ -26,6 +25,4 @@ export interface MenuContextValue {
|
|
|
26
25
|
|
|
27
26
|
const key = Symbol.for('@sanity/ui/context/menu')
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export const MenuContext: React.Context<MenuContextValue | null> = globalScope[key]
|
|
28
|
+
export const MenuContext = createGlobalScopedContext<MenuContextValue | null>(key, null)
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
3
2
|
import {ToastContextValue} from './types'
|
|
4
3
|
|
|
5
4
|
const key = Symbol.for('@sanity/ui/context/toast')
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const ToastContext: React.Context<ToastContextValue | null> = globalScope[key]
|
|
6
|
+
export const ToastContext = createGlobalScopedContext<ToastContextValue | null>(key, null)
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
3
2
|
import {TreeContextValue} from './types'
|
|
4
3
|
|
|
5
4
|
const key = Symbol.for('@sanity/ui/context/tree')
|
|
6
5
|
|
|
7
|
-
globalScope[key] = globalScope[key] || createContext<TreeContextValue | null>(null)
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
7
|
* @internal
|
|
11
8
|
*/
|
|
12
|
-
export const TreeContext
|
|
9
|
+
export const TreeContext = createGlobalScopedContext<TreeContextValue | null>(key, null)
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../../lib/createGlobalScopedContext'
|
|
3
2
|
import {TooltipDelayGroupContextValue} from './types'
|
|
4
3
|
|
|
5
4
|
const key = Symbol.for('@sanity/ui/context/tooltipDelayGroup')
|
|
6
5
|
|
|
7
|
-
globalScope[key] = globalScope[key] || createContext<TooltipDelayGroupContextValue | null>(null)
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
7
|
* @beta
|
|
11
8
|
*/
|
|
12
|
-
export const TooltipDelayGroupContext
|
|
13
|
-
|
|
9
|
+
export const TooltipDelayGroupContext =
|
|
10
|
+
createGlobalScopedContext<TooltipDelayGroupContextValue | null>(key, null)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
3
2
|
import {BoundaryElementContextValue} from './types'
|
|
4
3
|
|
|
5
4
|
const key = Symbol.for('@sanity/ui/context/boundaryElement')
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const BoundaryElementContext = createGlobalScopedContext<BoundaryElementContextValue | null>(
|
|
7
|
+
key,
|
|
8
|
+
null,
|
|
9
|
+
)
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {globalScope} from '../../lib/globalScope'
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
3
2
|
import {LayerContextValue} from './types'
|
|
4
3
|
|
|
5
4
|
const key = Symbol.for('@sanity/ui/context/layer')
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const LayerContext: Context<LayerContextValue | null> = globalScope[key]
|
|
6
|
+
export const LayerContext = createGlobalScopedContext<LayerContextValue | null>(key, null)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
2
2
|
import {globalScope} from '../../lib/globalScope'
|
|
3
3
|
import {PortalContextValue} from './types'
|
|
4
4
|
|
|
@@ -28,6 +28,4 @@ export const defaultContextValue: PortalContextValue = {
|
|
|
28
28
|
},
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export const PortalContext: React.Context<PortalContextValue> = globalScope[key]
|
|
31
|
+
export const PortalContext = createGlobalScopedContext<PortalContextValue>(key, defaultContextValue)
|