next-sanity 3.0.5 → 3.1.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/README.md +15 -0
- package/dist/_chunks/NextStudioLoading-37471b1b.js +128 -0
- package/dist/_chunks/NextStudioLoading-37471b1b.js.map +1 -0
- package/dist/_chunks/NextStudioLoading-97555646.cjs +132 -0
- package/dist/_chunks/NextStudioLoading-97555646.cjs.map +1 -0
- package/dist/studio/index.cjs +39 -144
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.d.ts +19 -17
- package/dist/studio/index.js +40 -143
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/index.mjs +2 -4
- package/dist/studio/loading.cjs +10 -0
- package/dist/studio/loading.cjs.map +1 -0
- package/dist/studio/loading.d.ts +16 -0
- package/dist/studio/loading.js +7 -0
- package/dist/studio/loading.js.map +1 -0
- package/dist/studio/loading.mjs +5 -0
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +20 -4
- package/src/studio/NextStudio.tsx +25 -23
- package/src/studio/NextStudioClientOnly.tsx +15 -0
- package/src/studio/NextStudioLoading.tsx +116 -0
- package/src/studio/index.ts +1 -2
- package/src/studio/loading.ts +1 -0
- package/src/webhook/parseBody.ts +1 -1
- package/src/studio/NextStudioFallback.tsx +0 -86
- package/src/studio/NextStudioSuspense.tsx +0 -15
package/README.md
CHANGED
|
@@ -522,6 +522,7 @@ export default function StudioPage() {
|
|
|
522
522
|
}
|
|
523
523
|
```
|
|
524
524
|
|
|
525
|
+
Set the right `viewport` meta tag, favicons and mroe
|
|
525
526
|
`app/studio/[[...index]]/head.tsx`:
|
|
526
527
|
|
|
527
528
|
```tsx
|
|
@@ -546,6 +547,20 @@ export default function CustomStudioHead() {
|
|
|
546
547
|
}
|
|
547
548
|
```
|
|
548
549
|
|
|
550
|
+
Improve the Studio loading experience by setting a `loading.tsx` route.
|
|
551
|
+
`app/studio/[[...index]]/loading.tsx`:
|
|
552
|
+
|
|
553
|
+
```tsx
|
|
554
|
+
'use client'
|
|
555
|
+
|
|
556
|
+
import config from '../../../sanity.config'
|
|
557
|
+
import NextStudioLoading from 'next-sanity/studio/loading'
|
|
558
|
+
|
|
559
|
+
export default function Loading() {
|
|
560
|
+
return <NextStudioLoading config={config} />
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
549
564
|
#### Next 12 or `pages/studio`
|
|
550
565
|
|
|
551
566
|
Using just `NextStudio` gives you a fully working Sanity Studio v3. However we recommend also using `NextStudioHead` as it ensures CSS Media Queries that target mobile devices with display cutouts (for example iPhone's "The Notch" and "Dynamic Island") and other details.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { SpinnerIcon } from '@sanity/icons';
|
|
3
|
+
import { _responsive, rem } from '@sanity/ui';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { defaultTheme } from 'sanity';
|
|
6
|
+
function isWorkspaces(config) {
|
|
7
|
+
return Array.isArray(config);
|
|
8
|
+
}
|
|
9
|
+
function isWorkspaceWithTheme(workspace) {
|
|
10
|
+
return Boolean(workspace.theme);
|
|
11
|
+
}
|
|
12
|
+
function useTheme(config) {
|
|
13
|
+
const workspace = useMemo(() => isWorkspaces(config) ? config[0] : config, [config]);
|
|
14
|
+
return useMemo(() => isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme, [workspace]);
|
|
15
|
+
}
|
|
16
|
+
const style = {
|
|
17
|
+
__html: "\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n"
|
|
18
|
+
};
|
|
19
|
+
const NextStudioNoScript = () => /* @__PURE__ */jsx("noscript", {
|
|
20
|
+
children: /* @__PURE__ */jsx("div", {
|
|
21
|
+
className: "sanity-app-no-js__root",
|
|
22
|
+
children: /* @__PURE__ */jsxs("div", {
|
|
23
|
+
className: "sanity-app-no-js__content",
|
|
24
|
+
children: [/* @__PURE__ */jsx("style", {
|
|
25
|
+
type: "text/css",
|
|
26
|
+
dangerouslySetInnerHTML: style
|
|
27
|
+
}), /* @__PURE__ */jsx("h1", {
|
|
28
|
+
children: "JavaScript disabled"
|
|
29
|
+
}), /* @__PURE__ */jsxs("p", {
|
|
30
|
+
children: ["Please ", /* @__PURE__ */jsx("a", {
|
|
31
|
+
href: "https://www.enable-javascript.com/",
|
|
32
|
+
children: "enable JavaScript"
|
|
33
|
+
}), " in your browser and reload the page to proceed."]
|
|
34
|
+
})]
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
const keyframes = "\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n";
|
|
39
|
+
function NextStudioLoading(props) {
|
|
40
|
+
const {
|
|
41
|
+
config,
|
|
42
|
+
scheme = "light",
|
|
43
|
+
unstable__noScript = true
|
|
44
|
+
} = props;
|
|
45
|
+
const id = "next-sanity-spinner";
|
|
46
|
+
const theme = useTheme(config);
|
|
47
|
+
const {
|
|
48
|
+
fonts,
|
|
49
|
+
media
|
|
50
|
+
} = theme;
|
|
51
|
+
const styles = _responsive(media, [2], size => {
|
|
52
|
+
const {
|
|
53
|
+
ascenderHeight,
|
|
54
|
+
descenderHeight,
|
|
55
|
+
lineHeight,
|
|
56
|
+
iconSize
|
|
57
|
+
} = fonts.text.sizes[size];
|
|
58
|
+
const capHeight = lineHeight - ascenderHeight - descenderHeight;
|
|
59
|
+
return {
|
|
60
|
+
wrapper: {
|
|
61
|
+
display: "block",
|
|
62
|
+
animation: "".concat(id, " 500ms linear infinite"),
|
|
63
|
+
color: theme.color[scheme].default.muted.default.enabled.muted.fg,
|
|
64
|
+
width: rem(capHeight),
|
|
65
|
+
height: rem(capHeight)
|
|
66
|
+
},
|
|
67
|
+
svg: {
|
|
68
|
+
display: "block",
|
|
69
|
+
width: rem(iconSize),
|
|
70
|
+
height: rem(iconSize),
|
|
71
|
+
margin: (capHeight - iconSize) / 2
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
})[0];
|
|
75
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
76
|
+
children: [unstable__noScript && /* @__PURE__ */jsx(NextStudioNoScript, {}), /* @__PURE__ */jsx("div", {
|
|
77
|
+
style: {
|
|
78
|
+
fontFamily: fonts.text.family,
|
|
79
|
+
backgroundColor: theme.color[scheme].default.base.bg,
|
|
80
|
+
height: "100vh",
|
|
81
|
+
maxHeight: "100dvh",
|
|
82
|
+
overscrollBehavior: "none",
|
|
83
|
+
WebkitFontSmoothing: "antialiased",
|
|
84
|
+
overflow: "auto"
|
|
85
|
+
},
|
|
86
|
+
children: /* @__PURE__ */jsxs("div", {
|
|
87
|
+
"data-ui": "Flex",
|
|
88
|
+
style: {
|
|
89
|
+
display: "flex",
|
|
90
|
+
minWidth: 0,
|
|
91
|
+
minHeight: 0,
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
justifyContent: "center",
|
|
94
|
+
flexDirection: "column",
|
|
95
|
+
height: "100%",
|
|
96
|
+
margin: 0,
|
|
97
|
+
padding: 0,
|
|
98
|
+
gap: "10px"
|
|
99
|
+
},
|
|
100
|
+
children: [/* @__PURE__ */jsx("style", {
|
|
101
|
+
children: "@keyframes ".concat(id, " {").concat(keyframes, "}")
|
|
102
|
+
}, scheme), /* @__PURE__ */jsx("div", {
|
|
103
|
+
"data-ui": "Text",
|
|
104
|
+
style: {
|
|
105
|
+
position: "relative",
|
|
106
|
+
fontWeight: 400,
|
|
107
|
+
padding: "1px 0px",
|
|
108
|
+
fontSize: "1rem",
|
|
109
|
+
lineHeight: "calc(1.3125)",
|
|
110
|
+
transform: "translateY(-5px)",
|
|
111
|
+
color: theme.color[scheme].default.muted.default.enabled.muted.fg
|
|
112
|
+
},
|
|
113
|
+
children: /* @__PURE__ */jsx("span", {
|
|
114
|
+
children: "Loading\u2026"
|
|
115
|
+
})
|
|
116
|
+
}), /* @__PURE__ */jsx("div", {
|
|
117
|
+
"data-ui": "Spinner",
|
|
118
|
+
style: styles.wrapper,
|
|
119
|
+
children: /* @__PURE__ */jsx(SpinnerIcon, {
|
|
120
|
+
style: styles.svg
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export { NextStudioLoading as N, NextStudioNoScript as a, useTheme as u };
|
|
128
|
+
//# sourceMappingURL=NextStudioLoading-37471b1b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextStudioLoading-37471b1b.js","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'config' | 'scheme'> {\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n display: 'block',\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","style","__html","NextStudioNoScript","jsx","children","className","jsxs","type","dangerouslySetInnerHTML","href","keyframes","NextStudioLoading","props","scheme","unstable__noScript","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","display","animation","color","default","muted","enabled","fg","width","rem","height","svg","margin","Fragment","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","minWidth","minHeight","alignItems","justifyContent","flex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A,CAChB,CAAA,EACC,eAAAD,GAAA,CAAA,KAAA,EAAA;UAAI,SAAQ,EAAA,SAAA;UAAUH,OAAOkB,MAAO,CAAAU,OAAA;UACnCxB,QAAC,EAAA,eAAAD,GAAA,CAAA2D,WAAA,EAAA;YAAY9D,OAAOkB,MAAO,CAAAqB;UAAA,CAAK;QAAA,CAClC,CAAA;MAAA,CACF;IAAA,CACF,CAAA;EAAA,CACF,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var icons = require('@sanity/icons');
|
|
5
|
+
var ui = require('@sanity/ui');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var sanity = require('sanity');
|
|
8
|
+
function isWorkspaces(config) {
|
|
9
|
+
return Array.isArray(config);
|
|
10
|
+
}
|
|
11
|
+
function isWorkspaceWithTheme(workspace) {
|
|
12
|
+
return Boolean(workspace.theme);
|
|
13
|
+
}
|
|
14
|
+
function useTheme(config) {
|
|
15
|
+
const workspace = react.useMemo(() => isWorkspaces(config) ? config[0] : config, [config]);
|
|
16
|
+
return react.useMemo(() => isWorkspaceWithTheme(workspace) ? workspace.theme : sanity.defaultTheme, [workspace]);
|
|
17
|
+
}
|
|
18
|
+
const style = {
|
|
19
|
+
__html: "\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n"
|
|
20
|
+
};
|
|
21
|
+
const NextStudioNoScript = () => /* @__PURE__ */jsxRuntime.jsx("noscript", {
|
|
22
|
+
children: /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
23
|
+
className: "sanity-app-no-js__root",
|
|
24
|
+
children: /* @__PURE__ */jsxRuntime.jsxs("div", {
|
|
25
|
+
className: "sanity-app-no-js__content",
|
|
26
|
+
children: [/* @__PURE__ */jsxRuntime.jsx("style", {
|
|
27
|
+
type: "text/css",
|
|
28
|
+
dangerouslySetInnerHTML: style
|
|
29
|
+
}), /* @__PURE__ */jsxRuntime.jsx("h1", {
|
|
30
|
+
children: "JavaScript disabled"
|
|
31
|
+
}), /* @__PURE__ */jsxRuntime.jsxs("p", {
|
|
32
|
+
children: ["Please ", /* @__PURE__ */jsxRuntime.jsx("a", {
|
|
33
|
+
href: "https://www.enable-javascript.com/",
|
|
34
|
+
children: "enable JavaScript"
|
|
35
|
+
}), " in your browser and reload the page to proceed."]
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const keyframes = "\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n";
|
|
41
|
+
function NextStudioLoading(props) {
|
|
42
|
+
const {
|
|
43
|
+
config,
|
|
44
|
+
scheme = "light",
|
|
45
|
+
unstable__noScript = true
|
|
46
|
+
} = props;
|
|
47
|
+
const id = "next-sanity-spinner";
|
|
48
|
+
const theme = useTheme(config);
|
|
49
|
+
const {
|
|
50
|
+
fonts,
|
|
51
|
+
media
|
|
52
|
+
} = theme;
|
|
53
|
+
const styles = ui._responsive(media, [2], size => {
|
|
54
|
+
const {
|
|
55
|
+
ascenderHeight,
|
|
56
|
+
descenderHeight,
|
|
57
|
+
lineHeight,
|
|
58
|
+
iconSize
|
|
59
|
+
} = fonts.text.sizes[size];
|
|
60
|
+
const capHeight = lineHeight - ascenderHeight - descenderHeight;
|
|
61
|
+
return {
|
|
62
|
+
wrapper: {
|
|
63
|
+
display: "block",
|
|
64
|
+
animation: "".concat(id, " 500ms linear infinite"),
|
|
65
|
+
color: theme.color[scheme].default.muted.default.enabled.muted.fg,
|
|
66
|
+
width: ui.rem(capHeight),
|
|
67
|
+
height: ui.rem(capHeight)
|
|
68
|
+
},
|
|
69
|
+
svg: {
|
|
70
|
+
display: "block",
|
|
71
|
+
width: ui.rem(iconSize),
|
|
72
|
+
height: ui.rem(iconSize),
|
|
73
|
+
margin: (capHeight - iconSize) / 2
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
})[0];
|
|
77
|
+
return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
78
|
+
children: [unstable__noScript && /* @__PURE__ */jsxRuntime.jsx(NextStudioNoScript, {}), /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
79
|
+
style: {
|
|
80
|
+
fontFamily: fonts.text.family,
|
|
81
|
+
backgroundColor: theme.color[scheme].default.base.bg,
|
|
82
|
+
height: "100vh",
|
|
83
|
+
maxHeight: "100dvh",
|
|
84
|
+
overscrollBehavior: "none",
|
|
85
|
+
WebkitFontSmoothing: "antialiased",
|
|
86
|
+
overflow: "auto"
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */jsxRuntime.jsxs("div", {
|
|
89
|
+
"data-ui": "Flex",
|
|
90
|
+
style: {
|
|
91
|
+
display: "flex",
|
|
92
|
+
minWidth: 0,
|
|
93
|
+
minHeight: 0,
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "center",
|
|
96
|
+
flexDirection: "column",
|
|
97
|
+
height: "100%",
|
|
98
|
+
margin: 0,
|
|
99
|
+
padding: 0,
|
|
100
|
+
gap: "10px"
|
|
101
|
+
},
|
|
102
|
+
children: [/* @__PURE__ */jsxRuntime.jsx("style", {
|
|
103
|
+
children: "@keyframes ".concat(id, " {").concat(keyframes, "}")
|
|
104
|
+
}, scheme), /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
105
|
+
"data-ui": "Text",
|
|
106
|
+
style: {
|
|
107
|
+
position: "relative",
|
|
108
|
+
fontWeight: 400,
|
|
109
|
+
padding: "1px 0px",
|
|
110
|
+
fontSize: "1rem",
|
|
111
|
+
lineHeight: "calc(1.3125)",
|
|
112
|
+
transform: "translateY(-5px)",
|
|
113
|
+
color: theme.color[scheme].default.muted.default.enabled.muted.fg
|
|
114
|
+
},
|
|
115
|
+
children: /* @__PURE__ */jsxRuntime.jsx("span", {
|
|
116
|
+
children: "Loading\u2026"
|
|
117
|
+
})
|
|
118
|
+
}), /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
119
|
+
"data-ui": "Spinner",
|
|
120
|
+
style: styles.wrapper,
|
|
121
|
+
children: /* @__PURE__ */jsxRuntime.jsx(icons.SpinnerIcon, {
|
|
122
|
+
style: styles.svg
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
})
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
exports.NextStudioLoading = NextStudioLoading;
|
|
130
|
+
exports.NextStudioNoScript = NextStudioNoScript;
|
|
131
|
+
exports.useTheme = useTheme;
|
|
132
|
+
//# sourceMappingURL=NextStudioLoading-97555646.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextStudioLoading-97555646.cjs","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioLoading.tsx"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","/* eslint-disable no-warning-comments */\n// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport type {StudioProps} from 'sanity'\n\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLoadingProps extends Pick<StudioProps, 'config' | 'scheme'> {\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nexport function NextStudioLoading(props: NextStudioLoadingProps) {\n const {config, scheme = 'light', unstable__noScript = true} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n display: 'block',\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n // @TODO use rem calc\n gap: '10px',\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div\n data-ui=\"Text\"\n style={{\n position: 'relative',\n // @TODO read from theme\n fontWeight: 400,\n // @TODO read from theme\n padding: '1px 0px',\n // @TODO use rem calc\n fontSize: '1rem',\n // @TODO use rem calc\n lineHeight: 'calc(1.3125)',\n // @TODO use rem calc\n transform: 'translateY(-5px)',\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n }}\n >\n <span>Loading…</span>\n </div>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n </>\n )\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","style","__html","NextStudioNoScript","jsx","children","className","jsxs","type","dangerouslySetInnerHTML","href","keyframes","NextStudioLoading","props","scheme","unstable__noScript","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","display","animation","color","default","muted","enabled","fg","width","rem","height","svg","margin","Fragment","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","gap","position","fontWeight","fontSize","transform","SpinnerIcon"],"mappings":";;;;;;;AAeA,SAASA,aAAaC,MAA8C,EAAA;EAC3D,OAAAC,KAAA,CAAMC,QAAQF,MAAM,CAAA;AAC7B;AAEA,SAASG,qBACPC,SACmE,EAAA;EAC5D,OAAAC,OAAA,CAAQD,UAAUE,KAAK,CAAA;AAChC;AAGO,SAASC,SAASP,MAA6B,EAAA;EACpD,MAAMI,SAAY,GAAAI,KAAA,CAAAA,OAAA,CAChB,MAAOT,YAAA,CAAaC,MAAM,CAAA,GAAIA,OAAO,CAAK,CAAA,GAAAA,MAAA,EAC1C,CAACA,MAAM,CAAA,CACT;EACO,OAAAQ,KAAA,CAAAA,OAAA,CACL,MAAOL,oBAAA,CAAqBC,SAAS,CAAA,GAAIA,UAAUE,KAAQ,GAAAG,MAAA,CAAAA,YAAA,EAC3D,CAACL,SAAS,CAAA,CACZ;AACF;ACjCA,MAAMM,KAAQ,GAAA;EACZC,MAAQ;AAoBV,CAAA;AAGa,MAAAC,kBAAA,GAAqB,MAAA,eAC/BC,UAAA,CAAAA,GAAA,CAAA,UAAA,EAAA;EACCC,QAAC,EAAA,eAAAD,UAAA,CAAAA,GAAA,CAAA,KAAA,EAAA;IAAIE,SAAU,EAAA,wBAAA;IACbD,QAAC,EAAA,eAAAE,UAAA,CAAAA,IAAA,CAAA,KAAA,EAAA;MAAID,SAAU,EAAA,2BAAA;MACbD,QAAA,EAAA,CAACD,eAAAA,UAAAA,CAAAA,GAAA,CAAA,OAAA,EAAA;QAAMI,IAAK,EAAA,UAAA;QAAWC,uBAAyB,EAAAR;MAAA,CAAO,CAAA,EACtDG,eAAAA,UAAAA,CAAAA,GAAA,CAAA,IAAA,EAAA;QAAGC,QAAA,EAAA;MAAA,CAAmB,CAAA,EACtBE,eAAAA,UA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,UAAA;YAEVC,UAAY,EAAA,GAAA;YAEZH,OAAS,EAAA,SAAA;YAETI,QAAU,EAAA,MAAA;YAEVrC,UAAY,EAAA,cAAA;YAEZsC,SAAW,EAAA,kBAAA;YACX9B,KAAA,EAAOnC,MAAMmC,KAAM,CAAAlB,MAAA,CAAA,CAAQmB,QAAQC,KAAM,CAAAD,OAAA,CAAQE,QAAQD,KAAM,CAAAE;UACjE,CAAA;UAEA/B,QAAC,EAAA,eAAAD,UAAA,CAAAA,GAAA,CAAA,MAAA,EAAA;YAAKC,QAAA,EAAA;UAAA,CAAQ;QAAA,CAChB,CAAA,EACCD,eAAAA,UAAAA,CAAAA,GAAA,CAAA,KAAA,EAAA;UAAI,SAAQ,EAAA,SAAA;UAAUH,OAAOkB,MAAO,CAAAU,OAAA;UACnCxB,QAAC,EAAA,eAAAD,UAAA,CAAAA,GAAA,CAAA2D,iBAAA,EAAA;YAAY9D,OAAOkB,MAAO,CAAAqB;UAAA,CAAK;QAAA,CAClC,CAAA;MAAA,CACF;IAAA,CACF,CAAA;EAAA,CACF,CAAA;AAEJ;;;"}
|
package/dist/studio/index.cjs
CHANGED
|
@@ -14,120 +14,51 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
14
14
|
var jsxRuntime = require('react/jsx-runtime');
|
|
15
15
|
var react = require('react');
|
|
16
16
|
var sanity = require('sanity');
|
|
17
|
-
var icons = require('@sanity/icons');
|
|
18
|
-
var ui = require('@sanity/ui');
|
|
19
17
|
var styled = require('styled-components');
|
|
18
|
+
var NextStudioLoading = require('../_chunks/NextStudioLoading-97555646.cjs');
|
|
19
|
+
require('@sanity/icons');
|
|
20
|
+
require('@sanity/ui');
|
|
20
21
|
function _interopDefaultLegacy(e) {
|
|
21
22
|
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
22
23
|
'default': e
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
const keyframes = "\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n";
|
|
37
|
-
function NextStudioFallbackComponent(props) {
|
|
38
|
-
const {
|
|
39
|
-
config,
|
|
40
|
-
scheme = "light"
|
|
41
|
-
} = props;
|
|
42
|
-
const id = "next-sanity-spinner";
|
|
43
|
-
const theme = useTheme(config);
|
|
44
|
-
const {
|
|
45
|
-
fonts,
|
|
46
|
-
media
|
|
47
|
-
} = theme;
|
|
48
|
-
const styles = ui._responsive(media, [2], size => {
|
|
49
|
-
const {
|
|
50
|
-
ascenderHeight,
|
|
51
|
-
descenderHeight,
|
|
52
|
-
lineHeight,
|
|
53
|
-
iconSize
|
|
54
|
-
} = fonts.text.sizes[size];
|
|
55
|
-
const capHeight = lineHeight - ascenderHeight - descenderHeight;
|
|
56
|
-
return {
|
|
57
|
-
wrapper: {
|
|
58
|
-
animation: "".concat(id, " 500ms linear infinite"),
|
|
59
|
-
color: theme.color[scheme].default.muted.default.enabled.muted.fg,
|
|
60
|
-
width: ui.rem(capHeight),
|
|
61
|
-
height: ui.rem(capHeight)
|
|
62
|
-
},
|
|
63
|
-
svg: {
|
|
64
|
-
display: "block",
|
|
65
|
-
width: ui.rem(iconSize),
|
|
66
|
-
height: ui.rem(iconSize),
|
|
67
|
-
margin: (capHeight - iconSize) / 2
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
})[0];
|
|
71
|
-
return /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
72
|
-
style: {
|
|
73
|
-
fontFamily: fonts.text.family,
|
|
74
|
-
backgroundColor: theme.color[scheme].default.base.bg,
|
|
75
|
-
height: "100vh",
|
|
76
|
-
maxHeight: "100dvh",
|
|
77
|
-
overscrollBehavior: "none",
|
|
78
|
-
WebkitFontSmoothing: "antialiased",
|
|
79
|
-
overflow: "auto"
|
|
80
|
-
},
|
|
81
|
-
children: /* @__PURE__ */jsxRuntime.jsxs("div", {
|
|
82
|
-
"data-ui": "Flex",
|
|
83
|
-
style: {
|
|
84
|
-
display: "flex",
|
|
85
|
-
minWidth: 0,
|
|
86
|
-
minHeight: 0,
|
|
87
|
-
alignItems: "center",
|
|
88
|
-
justifyContent: "center",
|
|
89
|
-
flexDirection: "column",
|
|
90
|
-
height: "100%",
|
|
91
|
-
margin: 0,
|
|
92
|
-
padding: 0
|
|
93
|
-
},
|
|
94
|
-
children: [/* @__PURE__ */jsxRuntime.jsx("style", {
|
|
95
|
-
children: "@keyframes ".concat(id, " {").concat(keyframes, "}")
|
|
96
|
-
}, scheme), /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
97
|
-
"data-ui": "Spinner",
|
|
98
|
-
style: styles.wrapper,
|
|
99
|
-
children: /* @__PURE__ */jsxRuntime.jsx(icons.SpinnerIcon, {
|
|
100
|
-
style: styles.svg
|
|
101
|
-
})
|
|
102
|
-
})]
|
|
103
|
-
})
|
|
27
|
+
function NextStudioClientOnly(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
children,
|
|
30
|
+
fallback
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [mounted, setMounted] = react.useState(false);
|
|
33
|
+
react.useEffect(() => react.startTransition(() => setMounted(true)), []);
|
|
34
|
+
return /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
35
|
+
children: mounted ? children : fallback
|
|
104
36
|
});
|
|
105
37
|
}
|
|
106
|
-
const
|
|
107
|
-
const Layout = styled__default["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n background-color: ", ";\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ", "\n"])), _ref => {
|
|
38
|
+
const Layout = styled__default["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n background-color: ", ";\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ", "\n"])), _ref2 => {
|
|
108
39
|
let {
|
|
109
40
|
$fontFamily
|
|
110
|
-
} =
|
|
41
|
+
} = _ref2;
|
|
111
42
|
return $fontFamily;
|
|
112
|
-
},
|
|
43
|
+
}, _ref3 => {
|
|
113
44
|
let {
|
|
114
45
|
$bg
|
|
115
|
-
} =
|
|
46
|
+
} = _ref3;
|
|
116
47
|
return $bg;
|
|
117
|
-
},
|
|
48
|
+
}, _ref4 => {
|
|
118
49
|
let {
|
|
119
50
|
$unstable__tailwindSvgFix
|
|
120
|
-
} =
|
|
51
|
+
} = _ref4;
|
|
121
52
|
return $unstable__tailwindSvgFix ? styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n "]))) : "";
|
|
122
53
|
});
|
|
123
|
-
const NextStudioLayoutComponent =
|
|
54
|
+
const NextStudioLayoutComponent = _ref5 => {
|
|
124
55
|
let {
|
|
125
56
|
children,
|
|
126
57
|
config,
|
|
127
58
|
scheme = "light",
|
|
128
59
|
unstable__tailwindSvgFix = true
|
|
129
|
-
} =
|
|
130
|
-
const theme = useTheme(config);
|
|
60
|
+
} = _ref5;
|
|
61
|
+
const theme = NextStudioLoading.useTheme(config);
|
|
131
62
|
return /* @__PURE__ */jsxRuntime.jsx(Layout, {
|
|
132
63
|
"data-ui": "NextStudioLayout",
|
|
133
64
|
$unstable__tailwindSvgFix: unstable__tailwindSvgFix,
|
|
@@ -137,66 +68,31 @@ const NextStudioLayoutComponent = _ref4 => {
|
|
|
137
68
|
});
|
|
138
69
|
};
|
|
139
70
|
const NextStudioLayout = react.memo(NextStudioLayoutComponent);
|
|
140
|
-
const style = {
|
|
141
|
-
__html: "\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n"
|
|
142
|
-
};
|
|
143
|
-
const NextStudioNoScript = () => /* @__PURE__ */jsxRuntime.jsx("noscript", {
|
|
144
|
-
children: /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
145
|
-
className: "sanity-app-no-js__root",
|
|
146
|
-
children: /* @__PURE__ */jsxRuntime.jsxs("div", {
|
|
147
|
-
className: "sanity-app-no-js__content",
|
|
148
|
-
children: [/* @__PURE__ */jsxRuntime.jsx("style", {
|
|
149
|
-
type: "text/css",
|
|
150
|
-
dangerouslySetInnerHTML: style
|
|
151
|
-
}), /* @__PURE__ */jsxRuntime.jsx("h1", {
|
|
152
|
-
children: "JavaScript disabled"
|
|
153
|
-
}), /* @__PURE__ */jsxRuntime.jsxs("p", {
|
|
154
|
-
children: ["Please ", /* @__PURE__ */jsxRuntime.jsx("a", {
|
|
155
|
-
href: "https://www.enable-javascript.com/",
|
|
156
|
-
children: "enable JavaScript"
|
|
157
|
-
}), " in your browser and reload the page to proceed."]
|
|
158
|
-
})]
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
});
|
|
162
|
-
function NextStudioSuspense(_ref5) {
|
|
163
|
-
let {
|
|
164
|
-
children,
|
|
165
|
-
fallback
|
|
166
|
-
} = _ref5;
|
|
167
|
-
const [mounted, mount] = react.useReducer(() => true, false);
|
|
168
|
-
react.useEffect(mount, [mount]);
|
|
169
|
-
return /* @__PURE__ */jsxRuntime.jsx(react.Suspense, {
|
|
170
|
-
fallback,
|
|
171
|
-
children: mounted ? children : fallback
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
71
|
const NextStudioComponent = _ref6 => {
|
|
175
72
|
let {
|
|
176
73
|
children,
|
|
177
74
|
config,
|
|
178
75
|
unstable__tailwindSvgFix = true,
|
|
179
|
-
unstable__noScript
|
|
76
|
+
unstable__noScript,
|
|
180
77
|
scheme
|
|
181
78
|
} = _ref6,
|
|
182
79
|
props = _objectWithoutProperties(_ref6, _excluded);
|
|
183
|
-
return /* @__PURE__ */jsxRuntime.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
80
|
+
return /* @__PURE__ */jsxRuntime.jsx(NextStudioClientOnly, {
|
|
81
|
+
fallback: /* @__PURE__ */jsxRuntime.jsx(NextStudioLoading.NextStudioLoading, {
|
|
82
|
+
unstable__noScript,
|
|
83
|
+
config,
|
|
84
|
+
scheme
|
|
85
|
+
}),
|
|
86
|
+
children: /* @__PURE__ */jsxRuntime.jsx(NextStudioLayout, {
|
|
87
|
+
config,
|
|
88
|
+
scheme,
|
|
89
|
+
unstable__tailwindSvgFix,
|
|
90
|
+
children: children || /* @__PURE__ */jsxRuntime.jsx(sanity.Studio, _objectSpread({
|
|
190
91
|
config,
|
|
191
92
|
scheme,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
scheme,
|
|
196
|
-
unstable_globalStyles: true
|
|
197
|
-
}, props))
|
|
198
|
-
})
|
|
199
|
-
})]
|
|
93
|
+
unstable_globalStyles: true
|
|
94
|
+
}, props))
|
|
95
|
+
})
|
|
200
96
|
});
|
|
201
97
|
};
|
|
202
98
|
const NextStudio = react.memo(NextStudioComponent);
|
|
@@ -222,11 +118,10 @@ const store = createStore();
|
|
|
222
118
|
function usePrefersColorScheme() {
|
|
223
119
|
return react.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);
|
|
224
120
|
}
|
|
121
|
+
exports.NextStudioNoScript = NextStudioLoading.NextStudioNoScript;
|
|
122
|
+
exports.useTheme = NextStudioLoading.useTheme;
|
|
225
123
|
exports.NextStudio = NextStudio;
|
|
226
|
-
exports.
|
|
124
|
+
exports.NextStudioClientOnly = NextStudioClientOnly;
|
|
227
125
|
exports.NextStudioLayout = NextStudioLayout;
|
|
228
|
-
exports.NextStudioNoScript = NextStudioNoScript;
|
|
229
|
-
exports.NextStudioSuspense = NextStudioSuspense;
|
|
230
126
|
exports.usePrefersColorScheme = usePrefersColorScheme;
|
|
231
|
-
exports.useTheme = useTheme;
|
|
232
127
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/studio/useTheme.ts","../../src/studio/NextStudioFallback.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudioNoScript.tsx","../../src/studio/NextStudioSuspense.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {useMemo} from 'react'\nimport {\n type Config,\n type SingleWorkspace,\n type StudioTheme,\n type WorkspaceOptions,\n defaultTheme,\n} from 'sanity'\n\ntype WithTheme = {\n theme: StudioTheme\n}\ntype SingleWorkspaceWithTheme = Omit<SingleWorkspace, 'theme'> & WithTheme\ntype WorkspaceOptionsWithTheme = Omit<WorkspaceOptions, 'theme'> & WithTheme\n\nfunction isWorkspaces(config: Config): config is WorkspaceOptions[] {\n return Array.isArray(config)\n}\n\nfunction isWorkspaceWithTheme(\n workspace: SingleWorkspace | WorkspaceOptions\n): workspace is SingleWorkspaceWithTheme | WorkspaceOptionsWithTheme {\n return Boolean(workspace.theme)\n}\n\n/** @alpha */\nexport function useTheme(config: Config): StudioTheme {\n const workspace = useMemo<SingleWorkspace | WorkspaceOptions>(\n () => (isWorkspaces(config) ? config[0] : config),\n [config]\n )\n return useMemo<StudioTheme>(\n () => (isWorkspaceWithTheme(workspace) ? workspace.theme : defaultTheme),\n [workspace]\n )\n}\n","// Intentionally not using `styled-components` to ensure it works in any `next` setup.\n// Wether 'styled-components' SSR is setup or not.\n\nimport {SpinnerIcon} from '@sanity/icons'\nimport {_responsive, rem} from '@sanity/ui'\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport type NextStudioFallbackProps = Pick<StudioProps, 'config' | 'scheme'>\n\nconst keyframes = `\nfrom {\n transform: rotate(0deg);\n}\n\nto {\n transform: rotate(360deg);\n}\n`\n\nfunction NextStudioFallbackComponent(props: NextStudioFallbackProps) {\n const {config, scheme = 'light'} = props\n const id = 'next-sanity-spinner'\n const theme = useTheme(config)\n const {fonts, media} = theme\n\n const styles: any = _responsive(media, [2], (size: number) => {\n const {ascenderHeight, descenderHeight, lineHeight, iconSize} = fonts.text.sizes[size]\n const capHeight = lineHeight - ascenderHeight - descenderHeight\n\n return {\n wrapper: {\n animation: `${id} 500ms linear infinite`,\n color: theme.color[scheme].default.muted.default.enabled.muted.fg,\n width: rem(capHeight),\n height: rem(capHeight),\n },\n svg: {\n display: 'block',\n width: rem(iconSize),\n height: rem(iconSize),\n margin: (capHeight - iconSize) / 2,\n },\n }\n })[0]\n\n return (\n <div\n style={{\n fontFamily: fonts.text.family,\n backgroundColor: theme.color[scheme].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n <div\n data-ui=\"Flex\"\n style={{\n display: 'flex',\n minWidth: 0,\n minHeight: 0,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n height: '100%',\n margin: 0,\n padding: 0,\n }}\n >\n <style key={scheme}>{`@keyframes ${id} {${keyframes}}`}</style>\n <div data-ui=\"Spinner\" style={styles.wrapper}>\n <SpinnerIcon style={styles.svg} />\n </div>\n </div>\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioFallback = memo(NextStudioFallbackComponent)\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","/* eslint-disable react/no-danger */\n\nconst style = {\n __html: `\n.sanity-app-no-js__root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n z-index: 1;\n}\n\n.sanity-app-no-js__content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`,\n} as const\n\n/** @alpha */\nexport const NextStudioNoScript = () => (\n <noscript>\n <div className=\"sanity-app-no-js__root\">\n <div className=\"sanity-app-no-js__content\">\n <style type=\"text/css\" dangerouslySetInnerHTML={style} />\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n)\n","import {type ReactNode, Suspense, useEffect, useReducer} from 'react'\n\n/** @alpha */\nexport type NextStudioSuspenseProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioSuspense({children, fallback}: NextStudioSuspenseProps) {\n const [mounted, mount] = useReducer(() => true, false)\n useEffect(mount, [mount])\n\n return <Suspense fallback={fallback}>{mounted ? children : fallback}</Suspense>\n}\n","import {memo} from 'react'\nimport {type StudioProps, Studio} from 'sanity'\n\nimport {NextStudioFallback} from './NextStudioFallback'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioNoScript} from './NextStudioNoScript'\nimport {NextStudioSuspense} from './NextStudioSuspense'\n\n// eslint-disable-next-line no-warning-comments\n// FIXME: https://github.com/vercel/next.js/issues/43147\n// const Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript = true,\n scheme,\n ...props\n}: NextStudioProps) => {\n return (\n <>\n {!unstable__noScript && <NextStudioNoScript />}\n <NextStudioSuspense fallback={<NextStudioFallback config={config} scheme={scheme} />}>\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioSuspense>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["isWorkspaces","config","Array","isArray","isWorkspaceWithTheme","workspace","Boolean","theme","useTheme","useMemo","defaultTheme","keyframes","NextStudioFallbackComponent","props","scheme","id","fonts","media","styles","_responsive","size","ascenderHeight","descenderHeight","lineHeight","iconSize","text","sizes","capHeight","wrapper","animation","color","default","muted","enabled","fg","width","rem","height","svg","display","margin","jsx","style","fontFamily","family","backgroundColor","base","bg","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow","children","jsxs","minWidth","minHeight","alignItems","justifyContent","flexDirection","padding","SpinnerIcon","NextStudioFallback","memo","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","unstable__tailwindSvgFix","NextStudioLayout","__html","NextStudioNoScript","className","type","dangerouslySetInnerHTML","href","NextStudioSuspense","fallback","mounted","mount","useReducer","useEffect","Suspense","NextStudioComponent","unstable__noScript","Fragment","Studio","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAASA,aAAaC,MAA8C,EAAA;EAC3D,OAAAC,KAAA,CAAMC,QAAQF,MAAM,CAAA;AAC7B;AAEA,SAASG,qBACPC,SACmE,EAAA;EAC5D,OAAAC,OAAA,CAAQD,UAAUE,KAAK,CAAA;AAChC;AAGO,SAASC,SAASP,MAA6B,EAAA;EACpD,MAAMI,SAAY,GAAAI,KAAA,CAAAA,OAAA,CAChB,MAAOT,YAAA,CAAaC,MAAM,CAAA,GAAIA,OAAO,CAAK,CAAA,GAAAA,MAAA,EAC1C,CAACA,MAAM,CAAA,CACT;EACO,OAAAQ,KAAA,CAAAA,OAAA,CACL,MAAOL,oBAAA,CAAqBC,SAAS,CAAA,GAAIA,UAAUE,KAAQ,GAAAG,MAAA,CAAAA,YAAA,EAC3D,CAACL,SAAS,CAAA,CACZ;AACF;ACtBA,MAAMM,SAAY,uFAAA;AAUlB,SAASC,4BAA4BC,KAAgC,EAAA;EACnE,MAAM;IAACZ,MAAA;IAAQa,MAAS,GAAA;EAAA,CAAW,GAAAD,KAAA;EACnC,MAAME,EAAK,GAAA,qBAAA;EACL,MAAAR,KAAA,GAAQC,SAASP,MAAM,CAAA;EACvB,MAAA;IAACe,KAAO;IAAAC;EAAS,CAAA,GAAAV,KAAA;EAEvB,MAAMW,SAAcC,EAAAA,CAAAA,WAAY,CAAAF,KAAA,EAAO,CAAC,CAAC,CAAA,EAAIG,IAAiB,IAAA;IACtD,MAAA;MAACC;MAAgBC,eAAiB;MAAAC,UAAA;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EAAYK,aAA8B,IAAA;MAC7BF,UAAA,CAAAG,gBAAA,CAAiB,UAAUD,aAAa,CAAA;MACnD,OAAO,MAAMF,UAAA,CAAWI,mBAAoB,CAAA,QAAA,EAAUF,aAAa,CAAA;IACrE,CAAA;IACAJ,WAAa,EAAA,MAAOE,UAAW,CAAAK,OAAA,GAAU,MAAS,GAAA,OAAA;IAClDN,mBAAmB,MAAM;EAAA,CAC3B;AACF;AACA,MAAMO,QAAQX,WAAY,EAAA;AAGnB,SAASY,qBAA6C,GAAA;EAC3D,OAAOC,KAAAA,CAAAA,qBAAqBF,KAAM,CAAAT,SAAA,EAAWS,KAAM,CAAAR,WAAA,EAAaQ,MAAMP,iBAAiB,CAAA;AACzF;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/studio/NextStudioClientOnly.tsx","../../src/studio/NextStudioLayout.tsx","../../src/studio/NextStudio.tsx","../../src/studio/usePrefersColorScheme.ts"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n","/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\nimport styled, {css} from 'styled-components'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n */\n unstable__tailwindSvgFix?: boolean\n}\n\ntype LayoutProps = {\n $unstable__tailwindSvgFix: NextStudioLayoutProps['unstable__tailwindSvgFix']\n $bg: string\n $fontFamily: string\n}\nconst Layout = styled.div<LayoutProps>`\n font-family: ${({$fontFamily}) => $fontFamily};\n background-color: ${({$bg}: any) => $bg};\n height: 100vh;\n max-height: 100dvh;\n overscroll-behavior: none;\n -webkit-font-smoothing: antialiased;\n overflow: auto;\n\n ${({$unstable__tailwindSvgFix}: any) =>\n $unstable__tailwindSvgFix\n ? css`\n /* override tailwind reset */\n *:not([data-ui='Popover__arrow']):not([data-ui='Tooltip__arrow']) > svg {\n display: inline;\n }\n `\n : ''}\n`\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n unstable__tailwindSvgFix = true,\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <Layout\n data-ui=\"NextStudioLayout\"\n $unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n $fontFamily={theme.fonts.text.family}\n $bg={theme.color[scheme].default.base.bg}\n >\n {children}\n </Layout>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n","import {memo} from 'react'\nimport {type StudioProps, Studio} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {type NextStudioLayoutProps, NextStudioLayout} from './NextStudioLayout'\nimport {type NextStudioLoadingProps, NextStudioLoading} from './NextStudioLoading'\n\nexport type {NextStudioLoadingProps}\n\n// eslint-disable-next-line no-warning-comments\n// FIXME: https://github.com/vercel/next.js/issues/43147\n// const Studio = memo(lazy(() => import('./LazyStudio')))\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Apply fix with SVG icon centering that happens if TailwindCSS is loaded\n * @defaultValue true\n * @alpha\n */\n unstable__tailwindSvgFix?: NextStudioLayoutProps['unstable__tailwindSvgFix']\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: NextStudioLoadingProps['unstable__noScript']\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__tailwindSvgFix = true,\n unstable__noScript,\n scheme,\n ...props\n}: NextStudioProps) => (\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout\n config={config}\n scheme={scheme}\n unstable__tailwindSvgFix={unstable__tailwindSvgFix}\n >\n {children || <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />}\n </NextStudioLayout>\n </NextStudioClientOnly>\n)\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport type {ThemeColorSchemeKey} from '@sanity/ui'\nimport {useSyncExternalStore} from 'react'\n\nfunction createStore() {\n if (typeof document === 'undefined') {\n return {\n subscribe: () => () => {},\n getSnapshot: () => 'light' as const,\n getServerSnapshot: () => 'light' as const,\n }\n }\n\n const matchMedia = window.matchMedia('(prefers-color-scheme: dark)')\n\n return {\n subscribe: (onStoreChange: () => void) => {\n matchMedia.addEventListener('change', onStoreChange)\n return () => matchMedia.removeEventListener('change', onStoreChange)\n },\n getSnapshot: () => (matchMedia.matches ? 'dark' : 'light'),\n getServerSnapshot: () => 'light' as const,\n }\n}\nconst store = createStore()\n\n/** @alpha */\nexport function usePrefersColorScheme(): ThemeColorSchemeKey {\n return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot)\n}\n"],"names":["NextStudioClientOnly","children","fallback","mounted","setMounted","useState","useEffect","startTransition","jsx","Fragment","Layout","styled","div","$fontFamily","$bg","$unstable__tailwindSvgFix","css","NextStudioLayoutComponent","config","scheme","unstable__tailwindSvgFix","theme","useTheme","fonts","text","family","color","default","base","bg","NextStudioLayout","memo","NextStudioComponent","unstable__noScript","props","NextStudioLoading","Studio","unstable_globalStyles","NextStudio","createStore","document","subscribe","getSnapshot","getServerSnapshot","matchMedia","window","onStoreChange","addEventListener","removeEventListener","matches","store","usePrefersColorScheme","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAASA,oBAAqB,OAAiD;EAAA,IAAjD;IAACC,QAAU;IAAAC;GAAsC;EACpF,MAAM,CAACC,OAAA,EAASC,UAAU,CAAA,GAAIC,eAAS,KAAK,CAAA;EAClCC,KAAA,CAAAA,SAAA,CAAA,MAAMC,KAAAA,CAAAA,gBAAgB,MAAMH,UAAA,CAAW,IAAI,CAAC,CAAA,EAAG,EAAE,CAAA;EAEpD,OAAAI,eAAAA,UAAAA,CAAAA,GAAA,CAAAC,UAAAA,CAAAA,QAAA,EAAA;IAAGR,oBAAUA,QAAW,GAAAC;EAAA,CAAS,CAAA;AAC1C;ACQA,MAAMQ,SAASC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA,qQACL;EAAA,IAAC;IAACC;EAAiB,CAAA;EAAA,OAAAA,WAAA;AAAA,GACd;EAAA,IAAC;IAACC;EAAc,CAAA;EAAA,OAAAA,GAAA;AAAA,GAOlC;EAAA,IAAC;IAACC;GAAyB;EAAA,OAC3BA,yBACI,GAAAC,MAAAA,CAAAA,GAAA,6PAMA,EAAA;AAAA,EAAA;AAGR,MAAMC,4BAA4B,SAKL;EAAA,IALM;IACjChB,QAAA;IACAiB,MAAA;IACAC,MAAS,GAAA,OAAA;IACTC,wBAA2B,GAAA;EAC7B,CAA6B;EACrB,MAAAC,KAAA,GAAQC,2BAASJ,MAAM,CAAA;EAE7B,OACGV,eAAAA,UAAAA,CAAAA,GAAA,CAAAE,MAAA,EAAA;IACC,SAAQ,EAAA,kBAAA;IACRK,yBAA2B,EAAAK,wBAA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