sanity-plugin-iframe-pane 4.0.1 → 5.0.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/LICENSE +1 -1
- package/README.md +0 -17
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +417 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -81
- package/lib/index.cjs +0 -375
- package/lib/index.cjs.map +0 -1
- package/lib/index.d.cts +0 -75
- package/lib/index.d.ts +0 -75
- package/lib/index.js +0 -384
- package/lib/index.js.map +0 -1
- package/sanity.json +0 -8
- package/src/DisplayUrl.tsx +0 -16
- package/src/Iframe.tsx +0 -443
- package/src/Toolbar.tsx +0 -185
- package/src/index.ts +0 -8
- package/src/types.ts +0 -11
- package/v2-incompatible.js +0 -11
package/package.json
CHANGED
|
@@ -1,105 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-iframe-pane",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Display any URL in a View Pane, along with helpful buttons to Copy the URL or open in a new tab",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sanity",
|
|
7
|
+
"sanity-plugin"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-iframe-pane#readme",
|
|
6
10
|
"bugs": {
|
|
7
|
-
"url": "https://github.com/sanity-io/
|
|
11
|
+
"url": "https://github.com/sanity-io/plugins/issues"
|
|
8
12
|
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
9
15
|
"repository": {
|
|
10
16
|
"type": "git",
|
|
11
|
-
"url": "git@github.com
|
|
17
|
+
"url": "git+ssh://git@github.com/sanity-io/plugins.git",
|
|
18
|
+
"directory": "plugins/sanity-plugin-iframe-pane"
|
|
12
19
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
16
23
|
"type": "module",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
17
25
|
"exports": {
|
|
18
|
-
".":
|
|
19
|
-
"source": "./src/index.ts",
|
|
20
|
-
"import": "./lib/index.js",
|
|
21
|
-
"require": "./lib/index.cjs",
|
|
22
|
-
"default": "./lib/index.js"
|
|
23
|
-
},
|
|
26
|
+
".": "./dist/index.js",
|
|
24
27
|
"./package.json": "./package.json"
|
|
25
28
|
},
|
|
26
|
-
"main": "./lib/index.cjs",
|
|
27
|
-
"module": "./lib/index.js",
|
|
28
|
-
"types": "./lib/index.d.ts",
|
|
29
|
-
"files": [
|
|
30
|
-
"src",
|
|
31
|
-
"lib",
|
|
32
|
-
"sanity.json",
|
|
33
|
-
"v2-incompatible.js"
|
|
34
|
-
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "plugin-kit verify-package --silent && pkg-utils build --strict --check --clean",
|
|
37
|
-
"clean": "rimraf lib",
|
|
38
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
39
|
-
"link-watch": "plugin-kit link-watch",
|
|
40
|
-
"lint": "eslint .",
|
|
41
|
-
"prepare": "husky install || true",
|
|
42
|
-
"prepublishOnly": "npm run build",
|
|
43
|
-
"test": "npm run lint && npm run type-check && npm run build",
|
|
44
|
-
"type-check": "tsc --noEmit",
|
|
45
|
-
"watch": "pkg-utils watch --strict"
|
|
46
|
-
},
|
|
47
|
-
"browserslist": "extends @sanity/browserslist-config",
|
|
48
|
-
"prettier": "@sanity/prettier-config",
|
|
49
|
-
"overrides": {
|
|
50
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
51
|
-
},
|
|
52
29
|
"dependencies": {
|
|
53
30
|
"@sanity/icons": "^3.7.4",
|
|
54
|
-
"@sanity/
|
|
55
|
-
"@sanity/
|
|
56
|
-
"
|
|
57
|
-
"framer-motion": "^12.23.12",
|
|
31
|
+
"@sanity/preview-url-secret": "^4.0.2",
|
|
32
|
+
"@sanity/ui": "^3.1.11",
|
|
33
|
+
"motion": "^12.23.26",
|
|
58
34
|
"suspend-react": "0.1.3"
|
|
59
35
|
},
|
|
60
36
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"eslint": "^8.57.1",
|
|
71
|
-
"eslint-config-prettier": "^10.1.8",
|
|
72
|
-
"eslint-config-react-app": "^7.0.1",
|
|
73
|
-
"eslint-config-sanity": "^7.1.4",
|
|
74
|
-
"eslint-plugin-import": "^2.32.0",
|
|
75
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
76
|
-
"eslint-plugin-react": "^7.37.5",
|
|
77
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
78
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
79
|
-
"husky": "^8.0.3",
|
|
80
|
-
"lint-staged": "^15.0.1",
|
|
81
|
-
"prettier": "^3.6.2",
|
|
82
|
-
"react": "^19.1.1",
|
|
83
|
-
"react-dom": "^19.1.1",
|
|
84
|
-
"rimraf": "^5.0.1",
|
|
85
|
-
"sanity": "^4.3.0",
|
|
37
|
+
"@sanity/pkg-utils": "^10.2.5",
|
|
38
|
+
"@types/react": "^19.2.7",
|
|
39
|
+
"@types/react-dom": "^19.2.3",
|
|
40
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
41
|
+
"babel-plugin-styled-components": "^2.1.4",
|
|
42
|
+
"eslint": "^9.39.2",
|
|
43
|
+
"react": "^19.2.3",
|
|
44
|
+
"react-dom": "^19.2.3",
|
|
45
|
+
"sanity": "^5.1.0",
|
|
86
46
|
"styled-components": "^6.1.19",
|
|
87
|
-
"
|
|
47
|
+
"@repo/eslint-config": "0.0.0",
|
|
48
|
+
"@repo/package.config": "0.0.0",
|
|
49
|
+
"@repo/tsconfig": "0.0.0"
|
|
88
50
|
},
|
|
89
51
|
"peerDependencies": {
|
|
90
|
-
"react": "^
|
|
91
|
-
"
|
|
92
|
-
"
|
|
52
|
+
"react": "^19.2",
|
|
53
|
+
"react-dom": "^19.2",
|
|
54
|
+
"sanity": "^5",
|
|
55
|
+
"styled-components": "^6.1"
|
|
93
56
|
},
|
|
94
57
|
"engines": {
|
|
95
|
-
"node": ">=20.19"
|
|
96
|
-
},
|
|
97
|
-
"publishConfig": {
|
|
98
|
-
"access": "public"
|
|
58
|
+
"node": ">=20.19 <22 || >=22.12"
|
|
99
59
|
},
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
}
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "pkg build --strict --check --clean",
|
|
62
|
+
"lint": "eslint ."
|
|
104
63
|
}
|
|
105
|
-
}
|
|
64
|
+
}
|
package/lib/index.cjs
DELETED
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), createSecret = require("@sanity/preview-url-secret/create-secret"), definePreviewUrl = require("@sanity/preview-url-secret/define-preview-url"), ui = require("@sanity/ui"), framerMotion = require("framer-motion"), react = require("react"), sanity = require("sanity"), suspendReact = require("suspend-react"), getRedirectTo = require("@sanity/preview-url-secret/get-redirect-to");
|
|
4
|
-
function DisplayUrl(props) {
|
|
5
|
-
const truncatedUrl = react.useMemo(() => {
|
|
6
|
-
const url = getRedirectTo.getRedirectTo(props.url);
|
|
7
|
-
return `${url.origin === location.origin ? "" : url.origin}${url.pathname}${url.search}`;
|
|
8
|
-
}, [props.url]);
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 0, textOverflow: "ellipsis", children: truncatedUrl });
|
|
10
|
-
}
|
|
11
|
-
const sizes = {
|
|
12
|
-
desktop: {
|
|
13
|
-
width: "100%",
|
|
14
|
-
height: "100%"
|
|
15
|
-
},
|
|
16
|
-
mobile: {
|
|
17
|
-
width: 414,
|
|
18
|
-
height: 746
|
|
19
|
-
}
|
|
20
|
-
}, DEFAULT_SIZE = "desktop";
|
|
21
|
-
function Toolbar(props) {
|
|
22
|
-
const { url, iframeSize, setIframeSize, reloading, showUrl, reloadButton, handleReload } = props, validUrl = url instanceof URL, input = react.useRef(null), { push: pushToast } = ui.useToast(), [, copy] = useCopyToClipboard();
|
|
23
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
24
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
-
"textarea",
|
|
26
|
-
{
|
|
27
|
-
style: { position: "absolute", pointerEvents: "none", opacity: 0 },
|
|
28
|
-
ref: input,
|
|
29
|
-
value: validUrl ? url.toString() : "",
|
|
30
|
-
readOnly: !0,
|
|
31
|
-
tabIndex: -1
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Card, { padding: 2, borderBottom: !0, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", gap: 2, children: [
|
|
35
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { align: "center", gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
-
ui.Tooltip,
|
|
37
|
-
{
|
|
38
|
-
animate: !0,
|
|
39
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { whiteSpace: "nowrap" }, children: iframeSize === "mobile" ? "Exit mobile preview" : "Preview mobile viewport" }),
|
|
40
|
-
padding: 2,
|
|
41
|
-
placement: "bottom-start",
|
|
42
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
ui.Button,
|
|
44
|
-
{
|
|
45
|
-
disabled: !validUrl,
|
|
46
|
-
fontSize: [1],
|
|
47
|
-
padding: 2,
|
|
48
|
-
mode: iframeSize === "mobile" ? "default" : "ghost",
|
|
49
|
-
icon: icons.MobileDeviceIcon,
|
|
50
|
-
onClick: () => setIframeSize(iframeSize === "mobile" ? "desktop" : "mobile")
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
) }),
|
|
55
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { flex: 1, children: showUrl && validUrl && /* @__PURE__ */ jsxRuntime.jsx(DisplayUrl, { url }) }),
|
|
56
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", gap: 1, children: [
|
|
57
|
-
reloadButton ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
-
ui.Tooltip,
|
|
59
|
-
{
|
|
60
|
-
animate: !0,
|
|
61
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { whiteSpace: "nowrap" }, children: reloading ? "Reloading\u2026" : "Reload" }),
|
|
62
|
-
padding: 2,
|
|
63
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
-
ui.Button,
|
|
65
|
-
{
|
|
66
|
-
disabled: !validUrl,
|
|
67
|
-
mode: "bleed",
|
|
68
|
-
fontSize: [1],
|
|
69
|
-
padding: 2,
|
|
70
|
-
icon: icons.RefreshIcon,
|
|
71
|
-
loading: reloading,
|
|
72
|
-
"aria-label": "Reload",
|
|
73
|
-
onClick: () => handleReload()
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
) : null,
|
|
78
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
-
ui.Tooltip,
|
|
80
|
-
{
|
|
81
|
-
animate: !0,
|
|
82
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { whiteSpace: "nowrap" }, children: "Copy URL" }),
|
|
83
|
-
padding: 2,
|
|
84
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
-
ui.Button,
|
|
86
|
-
{
|
|
87
|
-
mode: "bleed",
|
|
88
|
-
disabled: !validUrl,
|
|
89
|
-
fontSize: [1],
|
|
90
|
-
icon: icons.CopyIcon,
|
|
91
|
-
padding: [2],
|
|
92
|
-
"aria-label": "Copy URL",
|
|
93
|
-
onClick: () => {
|
|
94
|
-
input?.current?.value && copy(input.current.value).then((copied) => {
|
|
95
|
-
pushToast(copied ? {
|
|
96
|
-
closable: !0,
|
|
97
|
-
status: "success",
|
|
98
|
-
title: "The URL is copied to the clipboard"
|
|
99
|
-
} : {
|
|
100
|
-
closable: !0,
|
|
101
|
-
status: "error",
|
|
102
|
-
title: "Failed to copy the URL to the clipboard"
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
-
ui.Tooltip,
|
|
112
|
-
{
|
|
113
|
-
animate: !0,
|
|
114
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { whiteSpace: "nowrap" }, children: "Open URL in a new tab" }),
|
|
115
|
-
padding: 2,
|
|
116
|
-
placement: "bottom-end",
|
|
117
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
-
ui.Button,
|
|
119
|
-
{
|
|
120
|
-
disabled: !validUrl,
|
|
121
|
-
fontSize: [1],
|
|
122
|
-
icon: icons.LaunchIcon,
|
|
123
|
-
mode: "ghost",
|
|
124
|
-
paddingY: [2],
|
|
125
|
-
text: "Open",
|
|
126
|
-
"aria-label": "Open URL in a new tab",
|
|
127
|
-
onClick: validUrl ? () => window.open(url.toString()) : void 0
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
] })
|
|
133
|
-
] }) })
|
|
134
|
-
] });
|
|
135
|
-
}
|
|
136
|
-
function useCopyToClipboard() {
|
|
137
|
-
const [copiedText, setCopiedText] = react.useState(null), copy = react.useCallback(async (text) => {
|
|
138
|
-
if (!navigator?.clipboard)
|
|
139
|
-
return console.warn("Clipboard not supported"), !1;
|
|
140
|
-
try {
|
|
141
|
-
return await navigator.clipboard.writeText(text), setCopiedText(text), !0;
|
|
142
|
-
} catch (error) {
|
|
143
|
-
return console.warn("Copy failed", error), setCopiedText(null), !1;
|
|
144
|
-
}
|
|
145
|
-
}, []);
|
|
146
|
-
return [copiedText, copy];
|
|
147
|
-
}
|
|
148
|
-
const MotionFlex = framerMotion.motion.create(ui.Flex);
|
|
149
|
-
function encodeStudioPerspective(studioPerspective) {
|
|
150
|
-
return Array.isArray(studioPerspective) ? studioPerspective.join(",") : studioPerspective;
|
|
151
|
-
}
|
|
152
|
-
function Iframe(props) {
|
|
153
|
-
const { document, options } = props, draft = document.draft || document.published || document.displayed, { defaultSize = DEFAULT_SIZE, reload, attributes, showDisplayUrl = !0, key } = options, basePath = sanity.useActiveWorkspace()?.activeWorkspace?.basePath || "/", urlRef = react.useRef(options.url), [draftSnapshot, setDraftSnapshot] = react.useState(() => ({ key, draft }));
|
|
154
|
-
react.useEffect(() => {
|
|
155
|
-
urlRef.current = options.url;
|
|
156
|
-
}, [options.url]), react.useEffect(() => {
|
|
157
|
-
JSON.stringify({ key, draft }) !== JSON.stringify(draftSnapshot) && startTransition(() => setDraftSnapshot({ key, draft }));
|
|
158
|
-
}, [draft, draftSnapshot, key]);
|
|
159
|
-
const currentUser = sanity.useCurrentUser(), client = sanity.useClient({ apiVersion: "2023-10-16" }), [expiresAt, setExpiresAt] = react.useState(), previewSecretRef = react.useRef(void 0), [isResolvingUrl, startTransition] = react.useTransition(), { perspectiveStack, selectedPerspectiveName } = sanity.usePerspective(), perspective = react.useMemo(
|
|
160
|
-
() => ({
|
|
161
|
-
perspectiveStack,
|
|
162
|
-
selectedPerspectiveName
|
|
163
|
-
}),
|
|
164
|
-
[perspectiveStack, selectedPerspectiveName]
|
|
165
|
-
), url = react.useCallback(
|
|
166
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
167
|
-
async (draft2) => {
|
|
168
|
-
if (typeof location > "u")
|
|
169
|
-
return;
|
|
170
|
-
const urlProp = urlRef.current;
|
|
171
|
-
if (typeof urlProp == "string")
|
|
172
|
-
return new URL(urlProp, location.origin);
|
|
173
|
-
if (typeof urlProp == "function") {
|
|
174
|
-
const url2 = await urlProp(draft2, perspective);
|
|
175
|
-
return typeof url2 == "string" ? new URL(url2, location.origin) : url2;
|
|
176
|
-
}
|
|
177
|
-
if (typeof urlProp == "object") {
|
|
178
|
-
const preview = typeof urlProp.preview == "function" ? await urlProp.preview(draft2, perspective) : urlProp.preview;
|
|
179
|
-
if (typeof preview != "string")
|
|
180
|
-
return preview;
|
|
181
|
-
if (!previewSecretRef.current) {
|
|
182
|
-
const { secret, expiresAt: expiresAt2 } = await createSecret.createPreviewSecret(
|
|
183
|
-
client,
|
|
184
|
-
"sanity-plugin-iframe-pane",
|
|
185
|
-
location.href,
|
|
186
|
-
currentUser?.id
|
|
187
|
-
);
|
|
188
|
-
previewSecretRef.current = secret, startTransition(() => setExpiresAt(expiresAt2.getTime()));
|
|
189
|
-
}
|
|
190
|
-
const url2 = await definePreviewUrl.definePreviewUrl({
|
|
191
|
-
origin: urlProp.origin === "same-origin" ? location.origin : urlProp.origin,
|
|
192
|
-
preview,
|
|
193
|
-
draftMode: {
|
|
194
|
-
enable: urlProp.draftMode
|
|
195
|
-
}
|
|
196
|
-
})({
|
|
197
|
-
client,
|
|
198
|
-
previewUrlSecret: previewSecretRef.current,
|
|
199
|
-
previewSearchParam: null,
|
|
200
|
-
studioBasePath: basePath,
|
|
201
|
-
studioPreviewPerspective: encodeStudioPerspective(perspective.perspectiveStack)
|
|
202
|
-
});
|
|
203
|
-
return new URL(url2, location.origin);
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
[basePath, client, currentUser?.id, perspective]
|
|
207
|
-
);
|
|
208
|
-
return react.useEffect(() => {
|
|
209
|
-
if (expiresAt) {
|
|
210
|
-
const timeout = setTimeout(
|
|
211
|
-
() => {
|
|
212
|
-
startTransition(() => setExpiresAt(void 0)), previewSecretRef.current = void 0;
|
|
213
|
-
},
|
|
214
|
-
Math.max(0, expiresAt - Date.now())
|
|
215
|
-
);
|
|
216
|
-
return () => clearTimeout(timeout);
|
|
217
|
-
}
|
|
218
|
-
}, [expiresAt]), /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(Loading, { iframeSize: "desktop" }), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
-
IframeInner,
|
|
220
|
-
{
|
|
221
|
-
_key: draftSnapshot.key,
|
|
222
|
-
draftSnapshot: draftSnapshot.draft,
|
|
223
|
-
url,
|
|
224
|
-
isResolvingUrl,
|
|
225
|
-
attributes,
|
|
226
|
-
perspective,
|
|
227
|
-
defaultSize,
|
|
228
|
-
reload,
|
|
229
|
-
showDisplayUrl,
|
|
230
|
-
userId: currentUser?.id
|
|
231
|
-
},
|
|
232
|
-
`${draftSnapshot.key}-${selectedPerspectiveName || "draft"}`
|
|
233
|
-
) });
|
|
234
|
-
}
|
|
235
|
-
const IframeInner = react.memo(function(props) {
|
|
236
|
-
const {
|
|
237
|
-
isResolvingUrl,
|
|
238
|
-
defaultSize = DEFAULT_SIZE,
|
|
239
|
-
reload,
|
|
240
|
-
attributes = {},
|
|
241
|
-
showDisplayUrl = !0,
|
|
242
|
-
draftSnapshot,
|
|
243
|
-
userId,
|
|
244
|
-
expiresAt,
|
|
245
|
-
perspective: { selectedPerspectiveName, perspectiveStack },
|
|
246
|
-
_key
|
|
247
|
-
} = props, [iframeSize, setIframeSize] = react.useState(sizes?.[defaultSize] ? defaultSize : DEFAULT_SIZE), prefersReducedMotion = ui.usePrefersReducedMotion(), url = suspendReact.suspend(
|
|
248
|
-
() => props.url(draftSnapshot),
|
|
249
|
-
[
|
|
250
|
-
// Cache based on a few specific conditions
|
|
251
|
-
"sanity-plugin-iframe-pane",
|
|
252
|
-
draftSnapshot,
|
|
253
|
-
selectedPerspectiveName,
|
|
254
|
-
perspectiveStack,
|
|
255
|
-
userId,
|
|
256
|
-
expiresAt,
|
|
257
|
-
_key,
|
|
258
|
-
resolveUUID
|
|
259
|
-
]
|
|
260
|
-
), [loading, setLoading] = react.useState(!0), [_reloading, setReloading] = react.useState(!1), reloading = _reloading || isResolvingUrl, iframe = react.useRef(null), handleReload = react.useCallback(() => {
|
|
261
|
-
iframe?.current && (iframe.current.src = iframe.current.src, setReloading(!0));
|
|
262
|
-
}, []);
|
|
263
|
-
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.MotionConfig, { transition: prefersReducedMotion ? { duration: 0 } : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { direction: "column", style: { height: "100%" }, children: [
|
|
264
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
-
Toolbar,
|
|
266
|
-
{
|
|
267
|
-
url,
|
|
268
|
-
iframeSize,
|
|
269
|
-
reloading,
|
|
270
|
-
setIframeSize,
|
|
271
|
-
showUrl: showDisplayUrl,
|
|
272
|
-
reloadButton: !!reload?.button,
|
|
273
|
-
handleReload
|
|
274
|
-
}
|
|
275
|
-
),
|
|
276
|
-
url instanceof Error ? /* @__PURE__ */ jsxRuntime.jsx(ErrorCard, { error: url }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { tone: "transparent", style: { height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
277
|
-
Frame,
|
|
278
|
-
{
|
|
279
|
-
ref: iframe,
|
|
280
|
-
loading,
|
|
281
|
-
reloading,
|
|
282
|
-
iframeSize,
|
|
283
|
-
setReloading,
|
|
284
|
-
setLoading,
|
|
285
|
-
url,
|
|
286
|
-
attributes
|
|
287
|
-
}
|
|
288
|
-
) })
|
|
289
|
-
] }) });
|
|
290
|
-
}), Frame = react.forwardRef(function(props, iframe) {
|
|
291
|
-
const { loading, setLoading, iframeSize, attributes, reloading, url, setReloading } = props;
|
|
292
|
-
function handleIframeLoad() {
|
|
293
|
-
setLoading(!1), setReloading(!1), attributes.onLoad && typeof attributes.onLoad == "function" && attributes.onLoad();
|
|
294
|
-
}
|
|
295
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", justify: "center", style: { height: "100%", position: "relative" }, children: [
|
|
296
|
-
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: !url || loading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
297
|
-
MotionFlex,
|
|
298
|
-
{
|
|
299
|
-
initial: "initial",
|
|
300
|
-
animate: "animate",
|
|
301
|
-
exit: "exit",
|
|
302
|
-
variants: spinnerVariants,
|
|
303
|
-
justify: "center",
|
|
304
|
-
align: "center",
|
|
305
|
-
style: { inset: "0", position: "absolute" },
|
|
306
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Loading, { iframeSize })
|
|
307
|
-
}
|
|
308
|
-
) }),
|
|
309
|
-
url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
310
|
-
framerMotion.motion.iframe,
|
|
311
|
-
{
|
|
312
|
-
ref: iframe,
|
|
313
|
-
title: "preview",
|
|
314
|
-
frameBorder: "0",
|
|
315
|
-
style: { maxHeight: "100%" },
|
|
316
|
-
src: url.toString(),
|
|
317
|
-
initial: ["background", iframeSize],
|
|
318
|
-
variants: iframeVariants,
|
|
319
|
-
animate: [
|
|
320
|
-
loading ? "background" : "active",
|
|
321
|
-
reloading ? "reloading" : "idle",
|
|
322
|
-
iframeSize
|
|
323
|
-
],
|
|
324
|
-
...attributes,
|
|
325
|
-
onLoad: handleIframeLoad
|
|
326
|
-
}
|
|
327
|
-
)
|
|
328
|
-
] });
|
|
329
|
-
}), spinnerVariants = {
|
|
330
|
-
initial: { opacity: 1 },
|
|
331
|
-
animate: { opacity: [0, 0, 1] },
|
|
332
|
-
exit: { opacity: [1, 0, 0] }
|
|
333
|
-
}, iframeVariants = {
|
|
334
|
-
...sizes,
|
|
335
|
-
desktop: {
|
|
336
|
-
...sizes.desktop,
|
|
337
|
-
boxShadow: "0 0 0 0px var(--card-shadow-outline-color)"
|
|
338
|
-
},
|
|
339
|
-
mobile: {
|
|
340
|
-
...sizes.mobile,
|
|
341
|
-
boxShadow: "0 0 0 1px var(--card-shadow-outline-color)"
|
|
342
|
-
},
|
|
343
|
-
background: {
|
|
344
|
-
opacity: 0,
|
|
345
|
-
scale: 1
|
|
346
|
-
},
|
|
347
|
-
idle: {
|
|
348
|
-
scale: 1
|
|
349
|
-
},
|
|
350
|
-
reloading: {
|
|
351
|
-
scale: [1, 1, 1, 0.98]
|
|
352
|
-
},
|
|
353
|
-
active: {
|
|
354
|
-
opacity: [0, 0, 1],
|
|
355
|
-
scale: 1
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
function Loading({ iframeSize }) {
|
|
359
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { style: { ...sizes[iframeSize] }, justify: "center", align: "center", direction: "column", gap: 4, children: [
|
|
360
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Spinner, { muted: !0 }),
|
|
361
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 1, children: "Loading\u2026" })
|
|
362
|
-
] });
|
|
363
|
-
}
|
|
364
|
-
function ErrorCard({ error }) {
|
|
365
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { height: "fill", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Flex, { align: "center", height: "fill", justify: "center", padding: 4, sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Container, { width: 0, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { padding: 4, radius: 2, shadow: 1, tone: "caution", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { children: [
|
|
366
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, children: /* @__PURE__ */ jsxRuntime.jsx(icons.WarningOutlineIcon, {}) }) }),
|
|
367
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { flex: 1, marginLeft: 3, space: 3, children: [
|
|
368
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { as: "h1", size: 1, weight: "bold", children: error.name }),
|
|
369
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { as: "p", muted: !0, size: 1, children: error.message })
|
|
370
|
-
] })
|
|
371
|
-
] }) }) }) }) });
|
|
372
|
-
}
|
|
373
|
-
const resolveUUID = Symbol();
|
|
374
|
-
exports.Iframe = Iframe;
|
|
375
|
-
//# sourceMappingURL=index.cjs.map
|
package/lib/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/DisplayUrl.tsx","../src/Toolbar.tsx","../src/Iframe.tsx"],"sourcesContent":["import {getRedirectTo} from '@sanity/preview-url-secret/get-redirect-to'\nimport {Text} from '@sanity/ui'\nimport {useMemo} from 'react'\n\nexport function DisplayUrl(props: {url: URL}) {\n const truncatedUrl = useMemo(() => {\n const url = getRedirectTo(props.url)\n return `${url.origin === location.origin ? '' : url.origin}${url.pathname}${url.search}`\n }, [props.url])\n\n return (\n <Text size={0} textOverflow=\"ellipsis\">\n {truncatedUrl}\n </Text>\n )\n}\n","import {CopyIcon, LaunchIcon, MobileDeviceIcon, RefreshIcon} from '@sanity/icons'\nimport {Box, Button, Card, Flex, Text, Tooltip, useToast} from '@sanity/ui'\nimport {useCallback, useRef, useState} from 'react'\n\nimport {DisplayUrl} from './DisplayUrl'\nimport type {IframeSizeKey, SizeProps} from './types'\n\nexport const sizes: SizeProps = {\n desktop: {\n width: '100%',\n height: '100%',\n },\n mobile: {\n width: 414,\n height: 746,\n },\n}\n\nexport const DEFAULT_SIZE = 'desktop'\n\nexport interface ToolbarProps {\n url: URL | Error | undefined\n iframeSize: IframeSizeKey\n setIframeSize: (size: IframeSizeKey) => void\n showUrl: boolean\n reloading: boolean\n reloadButton: boolean\n handleReload: () => void\n}\nexport function Toolbar(props: ToolbarProps) {\n const {url, iframeSize, setIframeSize, reloading, showUrl, reloadButton, handleReload} = props\n const validUrl = url instanceof URL\n\n const input = useRef<HTMLTextAreaElement>(null)\n const {push: pushToast} = useToast()\n const [, copy] = useCopyToClipboard()\n\n return (\n <>\n <textarea\n style={{position: 'absolute', pointerEvents: 'none', opacity: 0}}\n ref={input}\n value={validUrl ? url.toString() : ''}\n readOnly\n tabIndex={-1}\n />\n <Card padding={2} borderBottom>\n <Flex align=\"center\" gap={2}>\n <Flex align=\"center\" gap={1}>\n <Tooltip\n animate\n content={\n <Text size={1} style={{whiteSpace: 'nowrap'}}>\n {iframeSize === 'mobile' ? 'Exit mobile preview' : 'Preview mobile viewport'}\n </Text>\n }\n padding={2}\n placement=\"bottom-start\"\n >\n <Button\n disabled={!validUrl}\n fontSize={[1]}\n padding={2}\n mode={iframeSize === 'mobile' ? 'default' : 'ghost'}\n icon={MobileDeviceIcon}\n onClick={() => setIframeSize(iframeSize === 'mobile' ? 'desktop' : 'mobile')}\n />\n </Tooltip>\n </Flex>\n <Box flex={1}>{showUrl && validUrl && <DisplayUrl url={url} />}</Box>\n <Flex align=\"center\" gap={1}>\n {reloadButton ? (\n <Tooltip\n animate\n content={\n <Text size={1} style={{whiteSpace: 'nowrap'}}>\n {reloading ? 'Reloading…' : 'Reload'}\n </Text>\n }\n padding={2}\n >\n <Button\n disabled={!validUrl}\n mode=\"bleed\"\n fontSize={[1]}\n padding={2}\n icon={RefreshIcon}\n loading={reloading}\n aria-label=\"Reload\"\n onClick={() => handleReload()}\n />\n </Tooltip>\n ) : null}\n <Tooltip\n animate\n content={\n <Text size={1} style={{whiteSpace: 'nowrap'}}>\n Copy URL\n </Text>\n }\n padding={2}\n >\n <Button\n mode=\"bleed\"\n disabled={!validUrl}\n fontSize={[1]}\n icon={CopyIcon}\n padding={[2]}\n aria-label=\"Copy URL\"\n onClick={() => {\n if (!input?.current?.value) return\n\n copy(input.current.value).then((copied) => {\n if (copied) {\n pushToast({\n closable: true,\n status: 'success',\n title: 'The URL is copied to the clipboard',\n })\n } else {\n pushToast({\n closable: true,\n status: 'error',\n title: 'Failed to copy the URL to the clipboard',\n })\n }\n })\n }}\n />\n </Tooltip>\n <Tooltip\n animate\n content={\n <Text size={1} style={{whiteSpace: 'nowrap'}}>\n Open URL in a new tab\n </Text>\n }\n padding={2}\n placement=\"bottom-end\"\n >\n <Button\n disabled={!validUrl}\n fontSize={[1]}\n icon={LaunchIcon}\n mode=\"ghost\"\n paddingY={[2]}\n text=\"Open\"\n aria-label=\"Open URL in a new tab\"\n onClick={validUrl ? () => window.open(url.toString()) : undefined}\n />\n </Tooltip>\n </Flex>\n </Flex>\n </Card>\n </>\n )\n}\n\ntype CopiedValue = string | null\n\ntype CopyFn = (text: string) => Promise<boolean>\n\nfunction useCopyToClipboard(): [CopiedValue, CopyFn] {\n const [copiedText, setCopiedText] = useState<CopiedValue>(null)\n\n const copy: CopyFn = useCallback(async (text) => {\n if (!navigator?.clipboard) {\n console.warn('Clipboard not supported')\n return false\n }\n\n // Try to save to clipboard then save it in the state if worked\n try {\n await navigator.clipboard.writeText(text)\n setCopiedText(text)\n return true\n } catch (error) {\n console.warn('Copy failed', error)\n setCopiedText(null)\n return false\n }\n }, [])\n\n return [copiedText, copy]\n}\n","import {WarningOutlineIcon} from '@sanity/icons'\nimport {createPreviewSecret} from '@sanity/preview-url-secret/create-secret'\nimport {definePreviewUrl} from '@sanity/preview-url-secret/define-preview-url'\nimport {Box, Card, Container, Flex, Spinner, Stack, Text, usePrefersReducedMotion} from '@sanity/ui'\nimport {AnimatePresence, motion, MotionConfig} from 'framer-motion'\nimport type {HTMLAttributeReferrerPolicy} from 'react'\nimport {\n forwardRef,\n memo,\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useTransition,\n} from 'react'\nimport {\n type SanityDocument,\n useActiveWorkspace,\n useClient,\n useCurrentUser,\n usePerspective,\n} from 'sanity'\nimport {suspend} from 'suspend-react'\n\nimport {DEFAULT_SIZE, sizes, Toolbar} from './Toolbar'\nimport type {IframeSizeKey} from './types'\n\nexport type UrlResolver = (\n document: SanityDocument | null,\n perspective: Pick<\n ReturnType<typeof usePerspective>,\n 'selectedPerspectiveName' | 'perspectiveStack'\n >,\n) => string | Error | undefined | Promise<string | Error | undefined>\n\nexport type {IframeSizeKey}\n\nexport interface IframeOptions {\n /**\n * If you have multiple iframe instances side-by-side you need to give each a unique key.\n */\n key?: string\n url:\n | string\n | UrlResolver\n | {\n /**\n * The URL origin of where the preview is hosted, for example `https://example.com`.\n * If it's an embedded Studio then set it to `'same-origin'`.\n */\n origin: 'same-origin' | string\n /**\n * The route to redirect to after enabling Draft Mode.\n * If you don't have enough data to build the URL, return an `Error` instance to show an error message.\n * @example `return new Error('Missing slug')`\n * To prolong the loading state, return `undefined`\n */\n preview: string | UrlResolver\n /**\n * The route that enables Draft Mode\n * @example '/api/draft'\n */\n draftMode: string\n }\n defaultSize?: IframeSizeKey\n showDisplayUrl?: boolean\n reload?: {\n button?: boolean\n }\n attributes?: Partial<{\n allow: string\n referrerPolicy: HTMLAttributeReferrerPolicy | undefined\n sandbox: string\n onLoad: () => void\n }>\n}\n\nconst MotionFlex = motion.create(Flex)\n\nexport interface IframeProps {\n document: {\n displayed: SanityDocument\n draft: SanityDocument | null\n published: SanityDocument | null\n }\n options: IframeOptions\n}\n\nfunction encodeStudioPerspective(studioPerspective: string[] | string): string {\n return Array.isArray(studioPerspective) ? studioPerspective.join(',') : studioPerspective\n}\n\nexport function Iframe(props: IframeProps): React.JSX.Element {\n const {document, options} = props\n const draft = document.draft || document.published || document.displayed\n\n const {defaultSize = DEFAULT_SIZE, reload, attributes, showDisplayUrl = true, key} = options\n\n const workspace = useActiveWorkspace()\n const basePath = workspace?.activeWorkspace?.basePath || '/'\n const urlRef = useRef(options.url)\n const [draftSnapshot, setDraftSnapshot] = useState(() => ({key, draft}))\n useEffect(() => {\n urlRef.current = options.url\n }, [options.url])\n useEffect(() => {\n if (JSON.stringify({key, draft}) !== JSON.stringify(draftSnapshot)) {\n startTransition(() => setDraftSnapshot({key, draft}))\n }\n }, [draft, draftSnapshot, key])\n const currentUser = useCurrentUser()\n const client = useClient({apiVersion: '2023-10-16'})\n const [expiresAt, setExpiresAt] = useState<number | undefined>()\n const previewSecretRef = useRef<string | undefined>(undefined)\n const [isResolvingUrl, startTransition] = useTransition()\n const {perspectiveStack, selectedPerspectiveName} = usePerspective()\n const perspective = useMemo(\n () => ({\n perspectiveStack,\n selectedPerspectiveName,\n }),\n [perspectiveStack, selectedPerspectiveName],\n )\n\n const url = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-shadow\n async (draft: SanityDocument | null) => {\n if (typeof location === 'undefined') {\n return undefined\n }\n const urlProp = urlRef.current\n if (typeof urlProp === 'string') {\n return new URL(urlProp, location.origin)\n }\n if (typeof urlProp === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const url = await urlProp(draft, perspective)\n return typeof url === 'string' ? new URL(url, location.origin) : url\n }\n if (typeof urlProp === 'object') {\n const preview =\n typeof urlProp.preview === 'function'\n ? await urlProp.preview(draft, perspective)\n : urlProp.preview\n if (typeof preview !== 'string') {\n return preview\n }\n if (!previewSecretRef.current) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const {secret, expiresAt} = await createPreviewSecret(\n client,\n 'sanity-plugin-iframe-pane',\n location.href,\n currentUser?.id,\n )\n previewSecretRef.current = secret\n startTransition(() => setExpiresAt(expiresAt.getTime()))\n }\n\n const resolvePreviewUrl = definePreviewUrl({\n origin: urlProp.origin === 'same-origin' ? location.origin : urlProp.origin,\n preview,\n draftMode: {\n enable: urlProp.draftMode,\n },\n })\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const url = await resolvePreviewUrl({\n client,\n previewUrlSecret: previewSecretRef.current,\n previewSearchParam: null,\n studioBasePath: basePath,\n studioPreviewPerspective: encodeStudioPerspective(perspective.perspectiveStack),\n })\n return new URL(url, location.origin)\n }\n return undefined\n },\n [basePath, client, currentUser?.id, perspective],\n )\n useEffect(() => {\n if (expiresAt) {\n const timeout = setTimeout(\n () => {\n startTransition(() => setExpiresAt(undefined))\n previewSecretRef.current = undefined\n },\n Math.max(0, expiresAt - Date.now()),\n )\n return () => clearTimeout(timeout)\n }\n return undefined\n }, [expiresAt])\n\n return (\n <Suspense fallback={<Loading iframeSize=\"desktop\" />}>\n <IframeInner\n key={`${draftSnapshot.key}-${selectedPerspectiveName || 'draft'}`}\n _key={draftSnapshot.key}\n draftSnapshot={draftSnapshot.draft}\n url={url}\n isResolvingUrl={isResolvingUrl}\n attributes={attributes}\n perspective={perspective}\n defaultSize={defaultSize}\n reload={reload}\n showDisplayUrl={showDisplayUrl}\n userId={currentUser?.id}\n />\n </Suspense>\n )\n}\n\nexport interface IframeInnerProps extends Omit<IframeOptions, 'url'> {\n url: (draftSnapshot: SanityDocument | null) => Promise<URL | Error | undefined>\n isResolvingUrl: boolean\n draftSnapshot: SanityDocument | null\n perspective: Parameters<UrlResolver>[1]\n userId?: string\n expiresAt?: number\n _key?: string\n}\nconst IframeInner = memo(function IframeInner(props: IframeInnerProps) {\n const {\n isResolvingUrl,\n defaultSize = DEFAULT_SIZE,\n reload,\n attributes = {},\n showDisplayUrl = true,\n draftSnapshot,\n userId,\n expiresAt,\n perspective: {selectedPerspectiveName, perspectiveStack},\n _key,\n } = props\n const [iframeSize, setIframeSize] = useState(sizes?.[defaultSize] ? defaultSize : DEFAULT_SIZE)\n\n const prefersReducedMotion = usePrefersReducedMotion()\n\n const url = suspend(\n () => props.url(draftSnapshot),\n [\n // Cache based on a few specific conditions\n 'sanity-plugin-iframe-pane',\n draftSnapshot,\n selectedPerspectiveName,\n perspectiveStack,\n userId,\n expiresAt,\n _key,\n resolveUUID,\n ],\n )\n\n const [loading, setLoading] = useState(true)\n const [_reloading, setReloading] = useState(false)\n const reloading = _reloading || isResolvingUrl\n\n const iframe = useRef<HTMLIFrameElement>(null)\n\n const handleReload = useCallback(() => {\n if (!iframe?.current) {\n return\n }\n\n // Funky way to reload an iframe without CORS issues\n // eslint-disable-next-line no-self-assign\n iframe.current.src = iframe.current.src\n\n setReloading(true)\n }, [])\n\n return (\n <MotionConfig transition={prefersReducedMotion ? {duration: 0} : undefined}>\n <Flex direction=\"column\" style={{height: '100%'}}>\n <Toolbar\n url={url}\n iframeSize={iframeSize}\n reloading={reloading}\n setIframeSize={setIframeSize}\n showUrl={showDisplayUrl}\n reloadButton={!!reload?.button}\n handleReload={handleReload}\n />\n {url instanceof Error ? (\n <ErrorCard error={url} />\n ) : (\n <Card tone=\"transparent\" style={{height: '100%'}}>\n <Frame\n ref={iframe}\n loading={loading}\n reloading={reloading}\n iframeSize={iframeSize}\n setReloading={setReloading}\n setLoading={setLoading}\n url={url}\n attributes={attributes}\n />\n </Card>\n )}\n </Flex>\n </MotionConfig>\n )\n})\n\ninterface FrameProps extends Required<Pick<IframeOptions, 'attributes'>> {\n loading: boolean\n reloading: boolean\n setLoading: (loading: boolean) => void\n setReloading: (reloading: boolean) => void\n iframeSize: IframeSizeKey\n url: URL | undefined\n}\nconst Frame = forwardRef(function Frame(\n props: FrameProps,\n iframe: React.ForwardedRef<HTMLIFrameElement>,\n) {\n const {loading, setLoading, iframeSize, attributes, reloading, url, setReloading} = props\n\n function handleIframeLoad() {\n setLoading(false)\n setReloading(false)\n // Run onLoad from attributes\n if (attributes.onLoad && typeof attributes.onLoad === 'function') {\n attributes.onLoad()\n }\n }\n\n return (\n <Flex align=\"center\" justify=\"center\" style={{height: '100%', position: 'relative'}}>\n <AnimatePresence>\n {!url ||\n (loading && (\n <MotionFlex\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n variants={spinnerVariants}\n justify=\"center\"\n align=\"center\"\n style={{inset: '0', position: 'absolute'}}\n >\n <Loading iframeSize={iframeSize} />\n </MotionFlex>\n ))}\n </AnimatePresence>\n {url && (\n <motion.iframe\n ref={iframe}\n title=\"preview\"\n frameBorder=\"0\"\n style={{maxHeight: '100%'}}\n src={url.toString()}\n initial={['background', iframeSize]}\n variants={iframeVariants}\n animate={[\n loading ? 'background' : 'active',\n reloading ? 'reloading' : 'idle',\n iframeSize,\n ]}\n {...attributes}\n onLoad={handleIframeLoad}\n />\n )}\n </Flex>\n )\n})\n\nconst spinnerVariants = {\n initial: {opacity: 1},\n animate: {opacity: [0, 0, 1]},\n exit: {opacity: [1, 0, 0]},\n}\n\nconst iframeVariants = {\n ...sizes,\n desktop: {\n ...sizes.desktop,\n boxShadow: '0 0 0 0px var(--card-shadow-outline-color)',\n },\n mobile: {\n ...sizes.mobile,\n boxShadow: '0 0 0 1px var(--card-shadow-outline-color)',\n },\n background: {\n opacity: 0,\n scale: 1,\n },\n idle: {\n scale: 1,\n },\n reloading: {\n scale: [1, 1, 1, 0.98],\n },\n active: {\n opacity: [0, 0, 1],\n scale: 1,\n },\n}\n\nfunction Loading({iframeSize}: {iframeSize: IframeSizeKey}) {\n return (\n <Flex style={{...sizes[iframeSize]}} justify=\"center\" align=\"center\" direction=\"column\" gap={4}>\n <Spinner muted />\n <Text muted size={1}>\n Loading…\n </Text>\n </Flex>\n )\n}\n\nexport function ErrorCard({error}: {error: Error}) {\n return (\n <Card height=\"fill\">\n <Flex align=\"center\" height=\"fill\" justify=\"center\" padding={4} sizing=\"border\">\n <Container width={0}>\n <Card padding={4} radius={2} shadow={1} tone=\"caution\">\n <Flex>\n <Box>\n <Text size={1}>\n <WarningOutlineIcon />\n </Text>\n </Box>\n <Stack flex={1} marginLeft={3} space={3}>\n <Text as=\"h1\" size={1} weight=\"bold\">\n {error.name}\n </Text>\n <Text as=\"p\" muted size={1}>\n {error.message}\n </Text>\n </Stack>\n </Flex>\n </Card>\n </Container>\n </Flex>\n </Card>\n )\n}\n\n// https://github.com/pmndrs/suspend-react?tab=readme-ov-file#making-cache-keys-unique\nconst resolveUUID = Symbol()\n"],"names":["useMemo","getRedirectTo","Text","useRef","useToast","jsxs","Fragment","jsx","Card","Flex","Tooltip","Button","MobileDeviceIcon","Box","RefreshIcon","CopyIcon","LaunchIcon","useState","useCallback","motion","useActiveWorkspace","useEffect","useCurrentUser","useClient","useTransition","usePerspective","draft","url","expiresAt","createPreviewSecret","definePreviewUrl","Suspense","memo","usePrefersReducedMotion","suspend","MotionConfig","forwardRef","AnimatePresence","Spinner","Container","WarningOutlineIcon","Stack"],"mappings":";;;AAIO,SAAS,WAAW,OAAmB;AAC5C,QAAM,eAAeA,MAAAA,QAAQ,MAAM;AACjC,UAAM,MAAMC,cAAAA,cAAc,MAAM,GAAG;AACnC,WAAO,GAAG,IAAI,WAAW,SAAS,SAAS,KAAK,IAAI,MAAM,GAAG,IAAI,QAAQ,GAAG,IAAI,MAAM;AAAA,EACxF,GAAG,CAAC,MAAM,GAAG,CAAC;AAEd,wCACGC,SAAA,EAAK,MAAM,GAAG,cAAa,YACzB,UAAA,cACH;AAEJ;ACRO,MAAM,QAAmB;AAAA,EAC9B,SAAS;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAAA,EAEV,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAEZ,GAEa,eAAe;AAWrB,SAAS,QAAQ,OAAqB;AAC3C,QAAM,EAAC,KAAK,YAAY,eAAe,WAAW,SAAS,cAAc,aAAA,IAAgB,OACnF,WAAW,eAAe,KAE1B,QAAQC,MAAAA,OAA4B,IAAI,GACxC,EAAC,MAAM,UAAA,IAAaC,YAAA,GACpB,GAAG,IAAI,IAAI,mBAAA;AAEjB,SACEC,2BAAAA,KAAAC,qBAAA,EACE,UAAA;AAAA,IAAAC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO,EAAC,UAAU,YAAY,eAAe,QAAQ,SAAS,EAAA;AAAA,QAC9D,KAAK;AAAA,QACL,OAAO,WAAW,IAAI,SAAA,IAAa;AAAA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