@valbuild/next 0.146.2 → 0.146.4
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/CHANGELOG.md +26 -0
- package/dist/{ValApp-3a70afe1.esm.js → ValApp-821536aa.esm.js} +91 -35
- package/dist/ValApp-b17ac306.cjs.js +7 -0
- package/dist/{ValApp-ab8a96fd.cjs.prod.js → ValApp-b17ac306.cjs.prod.js} +91 -35
- package/dist/{ValApp-294e5b53.cjs.dev.js → ValApp-cd14230d.cjs.dev.js} +91 -35
- package/dist/ValNextProvider-3f8bc508.cjs.js +7 -0
- package/dist/{ValNextProvider-da189afe.cjs.prod.js → ValNextProvider-3f8bc508.cjs.prod.js} +19 -1
- package/dist/{ValNextProvider-3d2cd7e4.esm.js → ValNextProvider-9934c628.esm.js} +19 -1
- package/dist/{ValNextProvider-062a8dc9.cjs.dev.js → ValNextProvider-d6de5d9a.cjs.dev.js} +19 -1
- package/dist/valbuild-next.cjs.dev.js +3 -3
- package/dist/valbuild-next.cjs.prod.js +3 -3
- package/dist/valbuild-next.esm.js +3 -3
- package/dist/{version-d10f7db8.esm.js → version-3032da1e.esm.js} +1 -1
- package/dist/{version-44c70cfb.cjs.dev.js → version-c44f56b0.cjs.dev.js} +1 -1
- package/dist/{version-8893f81b.cjs.prod.js → version-f6abce64.cjs.prod.js} +1 -1
- package/package.json +7 -7
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +1 -1
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +1 -1
- package/rsc/dist/valbuild-next-rsc.esm.js +1 -1
- package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-next-server.esm.js +1 -1
- package/dist/ValApp-ab8a96fd.cjs.js +0 -7
- package/dist/ValNextProvider-da189afe.cjs.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @valbuild/next
|
|
2
2
|
|
|
3
|
+
## 0.146.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#870](https://github.com/valbuild/val/pull/870) [`81f2e80`](https://github.com/valbuild/val/commit/81f2e803c4cefdf58bbe6856c06e98ace95a8e0b) Thanks [@freekh](https://github.com/freekh)! - The canvas works on a page behind your site's own login.
|
|
8
|
+
|
|
9
|
+
A site with its own sign-in (a dashboard, an intranet, a members' area) can be edited in the canvas. The canvas is a frame on the same origin as the Studio, so it sends your site's cookies like any other tab: if you are signed in to the site, the canvas shows the page signed in as you.
|
|
10
|
+
|
|
11
|
+
If you were not signed in, the site redirected the canvas to its login page, and the canvas then broke. That page mounted Val's whole overlay inside the canvas, a Studio inside the Studio. The canvas stayed on "Preview is not ready yet" through the sign-in and after it, until you pressed Reload. Now a page shown in the Studio's canvas counts as the canvas wherever it navigated to, so you can sign in inside the canvas and keep editing.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`81f2e80`](https://github.com/valbuild/val/commit/81f2e803c4cefdf58bbe6856c06e98ace95a8e0b), [`59ff6c3`](https://github.com/valbuild/val/commit/59ff6c367bc313b2bb7718b00c1641aaccab949d), [`c31f609`](https://github.com/valbuild/val/commit/c31f609fdeed79aa0e139fa4f652ba0684e96ea3)]:
|
|
14
|
+
- @valbuild/shared@0.146.4
|
|
15
|
+
- @valbuild/ui@0.146.4
|
|
16
|
+
- @valbuild/server@0.146.4
|
|
17
|
+
- @valbuild/language-server@0.146.4
|
|
18
|
+
- @valbuild/mcp@0.146.4
|
|
19
|
+
- @valbuild/react@0.146.4
|
|
20
|
+
|
|
21
|
+
## 0.146.3
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#873](https://github.com/valbuild/val/pull/873) [`289b2f3`](https://github.com/valbuild/val/commit/289b2f3dc6503393697d09ba3ed802b569a914c9) Thanks [@freekh](https://github.com/freekh)! - Opening the Studio no longer flashes an empty page. The loading screen now stays
|
|
26
|
+
up until the Studio is ready to be seen, instead of disappearing as soon as the
|
|
27
|
+
page loaded and leaving a blank page while the Studio downloaded.
|
|
28
|
+
|
|
3
29
|
## 0.146.2
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -10,6 +10,20 @@ import '@valbuild/shared/client';
|
|
|
10
10
|
import '@valbuild/core';
|
|
11
11
|
|
|
12
12
|
var VAL_READY_PING_MS = 100;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
16
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
17
|
+
* route left and come back to -- must not wait for it a second time.
|
|
18
|
+
*/
|
|
19
|
+
var studioStylesLoaded = false;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
23
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
24
|
+
* ends.
|
|
25
|
+
*/
|
|
26
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
13
27
|
var ValApp = function ValApp(_ref) {
|
|
14
28
|
var config = _ref.config,
|
|
15
29
|
children = _ref.children;
|
|
@@ -43,11 +57,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
43
57
|
}
|
|
44
58
|
});
|
|
45
59
|
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
/*
|
|
61
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
62
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
63
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
64
|
+
*/
|
|
65
|
+
var _useState3 = useState(function () {
|
|
66
|
+
return !studioStylesLoaded;
|
|
67
|
+
}),
|
|
48
68
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
-
|
|
50
|
-
|
|
69
|
+
covering = _useState4[0],
|
|
70
|
+
setCovering = _useState4[1];
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
if (!covering) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
var onCssLoaded = function onCssLoaded() {
|
|
76
|
+
studioStylesLoaded = true;
|
|
77
|
+
setCovering(false);
|
|
78
|
+
};
|
|
79
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
80
|
+
var timeout = setTimeout(function () {
|
|
81
|
+
return setCovering(false);
|
|
82
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
83
|
+
return function () {
|
|
84
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
85
|
+
clearTimeout(timeout);
|
|
86
|
+
};
|
|
87
|
+
}, [covering]);
|
|
88
|
+
|
|
89
|
+
// this theme is used to avoid flickering
|
|
90
|
+
var _useState5 = useState(config.defaultTheme || null),
|
|
91
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
92
|
+
loadingTheme = _useState6[0],
|
|
93
|
+
setLoadingTheme = _useState6[1];
|
|
51
94
|
useEffect(function () {
|
|
52
95
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
53
96
|
if (theme === "dark") {
|
|
@@ -88,36 +131,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
88
131
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
89
132
|
};
|
|
90
133
|
}, [inMessageMode, loadingTheme]);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
134
|
+
|
|
135
|
+
/*
|
|
136
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
137
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
138
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
139
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
140
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
141
|
+
* It is the first element both in the server render and after, so hydration
|
|
142
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
143
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
144
|
+
*/
|
|
145
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxs("div", {
|
|
146
|
+
style: {
|
|
147
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
148
|
+
display: "flex",
|
|
149
|
+
justifyContent: "center",
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
padding: "1rem",
|
|
152
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
153
|
+
position: "fixed",
|
|
154
|
+
inset: 0,
|
|
155
|
+
zIndex: 2147483647
|
|
156
|
+
},
|
|
157
|
+
children: [/*#__PURE__*/jsx("style", {
|
|
158
|
+
children: ".".concat(valPrefixedClass, "animate-spin {\n animation: ").concat(valPrefixedClass, "spin 2s linear infinite;\n}\n@keyframes ").concat(valPrefixedClass, "spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}")
|
|
159
|
+
}), /*#__PURE__*/jsx("svg", {
|
|
160
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
161
|
+
width: "24",
|
|
162
|
+
height: "24",
|
|
163
|
+
viewBox: "0 0 24 24",
|
|
164
|
+
fill: "none",
|
|
165
|
+
stroke: "currentColor",
|
|
166
|
+
strokeWidth: "2",
|
|
167
|
+
strokeLinecap: "round",
|
|
168
|
+
strokeLinejoin: "round",
|
|
169
|
+
className: cn(["animate-spin"]),
|
|
170
|
+
children: /*#__PURE__*/jsx("path", {
|
|
171
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
172
|
+
})
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
176
|
+
return loadingScreen;
|
|
121
177
|
}
|
|
122
178
|
if (inMessageMode) {
|
|
123
179
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -125,7 +181,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
125
181
|
});
|
|
126
182
|
}
|
|
127
183
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
128
|
-
children: [/*#__PURE__*/jsx(Script, {
|
|
184
|
+
children: [loadingScreen, /*#__PURE__*/jsx(Script, {
|
|
129
185
|
type: "module",
|
|
130
186
|
src: "".concat(route, "/static").concat(VERSION ? "/".concat(VERSION) : "").concat(VAL_APP_PATH),
|
|
131
187
|
crossOrigin: "anonymous"
|
|
@@ -18,6 +18,20 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
18
18
|
var Script__default = /*#__PURE__*/_interopDefault(Script);
|
|
19
19
|
|
|
20
20
|
var VAL_READY_PING_MS = 100;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
24
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
25
|
+
* route left and come back to -- must not wait for it a second time.
|
|
26
|
+
*/
|
|
27
|
+
var studioStylesLoaded = false;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
31
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
32
|
+
* ends.
|
|
33
|
+
*/
|
|
34
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
21
35
|
var ValApp = function ValApp(_ref) {
|
|
22
36
|
var config = _ref.config,
|
|
23
37
|
children = _ref.children;
|
|
@@ -51,11 +65,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
51
65
|
}
|
|
52
66
|
});
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
/*
|
|
69
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
70
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
71
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
72
|
+
*/
|
|
73
|
+
var _useState3 = React.useState(function () {
|
|
74
|
+
return !studioStylesLoaded;
|
|
75
|
+
}),
|
|
56
76
|
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
57
|
-
|
|
58
|
-
|
|
77
|
+
covering = _useState4[0],
|
|
78
|
+
setCovering = _useState4[1];
|
|
79
|
+
React.useEffect(function () {
|
|
80
|
+
if (!covering) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
var onCssLoaded = function onCssLoaded() {
|
|
84
|
+
studioStylesLoaded = true;
|
|
85
|
+
setCovering(false);
|
|
86
|
+
};
|
|
87
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
88
|
+
var timeout = setTimeout(function () {
|
|
89
|
+
return setCovering(false);
|
|
90
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
91
|
+
return function () {
|
|
92
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
93
|
+
clearTimeout(timeout);
|
|
94
|
+
};
|
|
95
|
+
}, [covering]);
|
|
96
|
+
|
|
97
|
+
// this theme is used to avoid flickering
|
|
98
|
+
var _useState5 = React.useState(config.defaultTheme || null),
|
|
99
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
100
|
+
loadingTheme = _useState6[0],
|
|
101
|
+
setLoadingTheme = _useState6[1];
|
|
59
102
|
React.useEffect(function () {
|
|
60
103
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
61
104
|
if (theme === "dark") {
|
|
@@ -96,36 +139,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
96
139
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
97
140
|
};
|
|
98
141
|
}, [inMessageMode, loadingTheme]);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
145
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
146
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
147
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
148
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
149
|
+
* It is the first element both in the server render and after, so hydration
|
|
150
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
151
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
152
|
+
*/
|
|
153
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
154
|
+
style: {
|
|
155
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
156
|
+
display: "flex",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
padding: "1rem",
|
|
160
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
161
|
+
position: "fixed",
|
|
162
|
+
inset: 0,
|
|
163
|
+
zIndex: 2147483647
|
|
164
|
+
},
|
|
165
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("style", {
|
|
166
|
+
children: ".".concat(fallbackColors.valPrefixedClass, "animate-spin {\n animation: ").concat(fallbackColors.valPrefixedClass, "spin 2s linear infinite;\n}\n@keyframes ").concat(fallbackColors.valPrefixedClass, "spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}")
|
|
167
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
168
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
169
|
+
width: "24",
|
|
170
|
+
height: "24",
|
|
171
|
+
viewBox: "0 0 24 24",
|
|
172
|
+
fill: "none",
|
|
173
|
+
stroke: "currentColor",
|
|
174
|
+
strokeWidth: "2",
|
|
175
|
+
strokeLinecap: "round",
|
|
176
|
+
strokeLinejoin: "round",
|
|
177
|
+
className: fallbackColors.cn(["animate-spin"]),
|
|
178
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
179
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
180
|
+
})
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
184
|
+
return loadingScreen;
|
|
129
185
|
}
|
|
130
186
|
if (inMessageMode) {
|
|
131
187
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -133,7 +189,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
133
189
|
});
|
|
134
190
|
}
|
|
135
191
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
136
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Script__default["default"], {
|
|
192
|
+
children: [loadingScreen, /*#__PURE__*/jsxRuntime.jsx(Script__default["default"], {
|
|
137
193
|
type: "module",
|
|
138
194
|
src: "".concat(route, "/static").concat(ui.VERSION ? "/".concat(ui.VERSION) : "").concat(ui.VAL_APP_PATH),
|
|
139
195
|
crossOrigin: "anonymous"
|
|
@@ -18,6 +18,20 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
18
18
|
var Script__default = /*#__PURE__*/_interopDefault(Script);
|
|
19
19
|
|
|
20
20
|
var VAL_READY_PING_MS = 100;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
24
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
25
|
+
* route left and come back to -- must not wait for it a second time.
|
|
26
|
+
*/
|
|
27
|
+
var studioStylesLoaded = false;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
31
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
32
|
+
* ends.
|
|
33
|
+
*/
|
|
34
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
21
35
|
var ValApp = function ValApp(_ref) {
|
|
22
36
|
var config = _ref.config,
|
|
23
37
|
children = _ref.children;
|
|
@@ -51,11 +65,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
51
65
|
}
|
|
52
66
|
});
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
/*
|
|
69
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
70
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
71
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
72
|
+
*/
|
|
73
|
+
var _useState3 = React.useState(function () {
|
|
74
|
+
return !studioStylesLoaded;
|
|
75
|
+
}),
|
|
56
76
|
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
57
|
-
|
|
58
|
-
|
|
77
|
+
covering = _useState4[0],
|
|
78
|
+
setCovering = _useState4[1];
|
|
79
|
+
React.useEffect(function () {
|
|
80
|
+
if (!covering) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
var onCssLoaded = function onCssLoaded() {
|
|
84
|
+
studioStylesLoaded = true;
|
|
85
|
+
setCovering(false);
|
|
86
|
+
};
|
|
87
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
88
|
+
var timeout = setTimeout(function () {
|
|
89
|
+
return setCovering(false);
|
|
90
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
91
|
+
return function () {
|
|
92
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
93
|
+
clearTimeout(timeout);
|
|
94
|
+
};
|
|
95
|
+
}, [covering]);
|
|
96
|
+
|
|
97
|
+
// this theme is used to avoid flickering
|
|
98
|
+
var _useState5 = React.useState(config.defaultTheme || null),
|
|
99
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
100
|
+
loadingTheme = _useState6[0],
|
|
101
|
+
setLoadingTheme = _useState6[1];
|
|
59
102
|
React.useEffect(function () {
|
|
60
103
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
61
104
|
if (theme === "dark") {
|
|
@@ -96,36 +139,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
96
139
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
97
140
|
};
|
|
98
141
|
}, [inMessageMode, loadingTheme]);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
145
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
146
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
147
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
148
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
149
|
+
* It is the first element both in the server render and after, so hydration
|
|
150
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
151
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
152
|
+
*/
|
|
153
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
154
|
+
style: {
|
|
155
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
156
|
+
display: "flex",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
padding: "1rem",
|
|
160
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
161
|
+
position: "fixed",
|
|
162
|
+
inset: 0,
|
|
163
|
+
zIndex: 2147483647
|
|
164
|
+
},
|
|
165
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("style", {
|
|
166
|
+
children: ".".concat(fallbackColors.valPrefixedClass, "animate-spin {\n animation: ").concat(fallbackColors.valPrefixedClass, "spin 2s linear infinite;\n}\n@keyframes ").concat(fallbackColors.valPrefixedClass, "spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}")
|
|
167
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
168
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
169
|
+
width: "24",
|
|
170
|
+
height: "24",
|
|
171
|
+
viewBox: "0 0 24 24",
|
|
172
|
+
fill: "none",
|
|
173
|
+
stroke: "currentColor",
|
|
174
|
+
strokeWidth: "2",
|
|
175
|
+
strokeLinecap: "round",
|
|
176
|
+
strokeLinejoin: "round",
|
|
177
|
+
className: fallbackColors.cn(["animate-spin"]),
|
|
178
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
179
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
180
|
+
})
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
184
|
+
return loadingScreen;
|
|
129
185
|
}
|
|
130
186
|
if (inMessageMode) {
|
|
131
187
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -133,7 +189,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
133
189
|
});
|
|
134
190
|
}
|
|
135
191
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
136
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Script__default["default"], {
|
|
192
|
+
children: [loadingScreen, /*#__PURE__*/jsxRuntime.jsx(Script__default["default"], {
|
|
137
193
|
type: "module",
|
|
138
194
|
src: "".concat(route, "/static").concat(ui.VERSION ? "/".concat(ui.VERSION) : "").concat(ui.VAL_APP_PATH),
|
|
139
195
|
crossOrigin: "anonymous"
|
|
@@ -366,7 +366,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
366
366
|
setMountOverlay(false);
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
setIsCanvas(client.isValCanvasFrame(location.search));
|
|
369
|
+
setIsCanvas(client.isValCanvasFrame(location.search, readParentPathname()));
|
|
370
370
|
setMountOverlay(hasValEnableCookie(document.cookie));
|
|
371
371
|
}, []);
|
|
372
372
|
React__default["default"].useEffect(function () {
|
|
@@ -874,6 +874,24 @@ function isValStudioPath(pathname) {
|
|
|
874
874
|
return pathname.startsWith("/val");
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
+
/**
|
|
878
|
+
* The path of the window framing this document, or `null`.
|
|
879
|
+
*
|
|
880
|
+
* `null` for a top-level document, and for a parent on another origin: reading
|
|
881
|
+
* a cross-origin `location` throws, and a page on another origin is not the
|
|
882
|
+
* studio, whose canvas is always the same app. See `isValCanvasFrame`.
|
|
883
|
+
*/
|
|
884
|
+
function readParentPathname() {
|
|
885
|
+
try {
|
|
886
|
+
if (window.parent === window) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
return window.parent.location.pathname;
|
|
890
|
+
} catch (_unused) {
|
|
891
|
+
return null;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
877
895
|
// Same guards as the mountOverlay effect: suspending where the overlay can't
|
|
878
896
|
// mount would only ever stall into the waitForLoad timeout. Browser-only.
|
|
879
897
|
function shouldEnableVal() {
|
|
@@ -339,7 +339,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
339
339
|
setMountOverlay(false);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
setIsCanvas(isValCanvasFrame(location.search));
|
|
342
|
+
setIsCanvas(isValCanvasFrame(location.search, readParentPathname()));
|
|
343
343
|
setMountOverlay(hasValEnableCookie(document.cookie));
|
|
344
344
|
}, []);
|
|
345
345
|
React.useEffect(function () {
|
|
@@ -847,6 +847,24 @@ function isValStudioPath(pathname) {
|
|
|
847
847
|
return pathname.startsWith("/val");
|
|
848
848
|
}
|
|
849
849
|
|
|
850
|
+
/**
|
|
851
|
+
* The path of the window framing this document, or `null`.
|
|
852
|
+
*
|
|
853
|
+
* `null` for a top-level document, and for a parent on another origin: reading
|
|
854
|
+
* a cross-origin `location` throws, and a page on another origin is not the
|
|
855
|
+
* studio, whose canvas is always the same app. See `isValCanvasFrame`.
|
|
856
|
+
*/
|
|
857
|
+
function readParentPathname() {
|
|
858
|
+
try {
|
|
859
|
+
if (window.parent === window) {
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
return window.parent.location.pathname;
|
|
863
|
+
} catch (_unused) {
|
|
864
|
+
return null;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
850
868
|
// Same guards as the mountOverlay effect: suspending where the overlay can't
|
|
851
869
|
// mount would only ever stall into the waitForLoad timeout. Browser-only.
|
|
852
870
|
function shouldEnableVal() {
|
|
@@ -366,7 +366,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
366
366
|
setMountOverlay(false);
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
setIsCanvas(client.isValCanvasFrame(location.search));
|
|
369
|
+
setIsCanvas(client.isValCanvasFrame(location.search, readParentPathname()));
|
|
370
370
|
setMountOverlay(hasValEnableCookie(document.cookie));
|
|
371
371
|
}, []);
|
|
372
372
|
React__default["default"].useEffect(function () {
|
|
@@ -874,6 +874,24 @@ function isValStudioPath(pathname) {
|
|
|
874
874
|
return pathname.startsWith("/val");
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
+
/**
|
|
878
|
+
* The path of the window framing this document, or `null`.
|
|
879
|
+
*
|
|
880
|
+
* `null` for a top-level document, and for a parent on another origin: reading
|
|
881
|
+
* a cross-origin `location` throws, and a page on another origin is not the
|
|
882
|
+
* studio, whose canvas is always the same app. See `isValCanvasFrame`.
|
|
883
|
+
*/
|
|
884
|
+
function readParentPathname() {
|
|
885
|
+
try {
|
|
886
|
+
if (window.parent === window) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
return window.parent.location.pathname;
|
|
890
|
+
} catch (_unused) {
|
|
891
|
+
return null;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
877
895
|
// Same guards as the mountOverlay effect: suspending where the overlay can't
|
|
878
896
|
// mount would only ever stall into the waitForLoad timeout. Browser-only.
|
|
879
897
|
function shouldEnableVal() {
|
|
@@ -8,13 +8,13 @@ var core = require('@valbuild/core');
|
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var objectWithoutProperties = require('./objectWithoutProperties-8f93848f.cjs.dev.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
|
-
var ValNextProvider = require('./ValNextProvider-
|
|
11
|
+
var ValNextProvider = require('./ValNextProvider-d6de5d9a.cjs.dev.js');
|
|
12
12
|
var NextImage = require('next/image');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var ValVideo = require('./ValVideo-b8130c1b.cjs.dev.js');
|
|
15
|
-
var ValApp = require('./ValApp-
|
|
15
|
+
var ValApp = require('./ValApp-cd14230d.cjs.dev.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-c44f56b0.cjs.dev.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
19
19
|
require('./defineProperty-f90345d7.cjs.dev.js');
|
|
20
20
|
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
@@ -8,13 +8,13 @@ var core = require('@valbuild/core');
|
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
9
|
var objectWithoutProperties = require('./objectWithoutProperties-107dcb46.cjs.prod.js');
|
|
10
10
|
var internal = require('@valbuild/react/internal');
|
|
11
|
-
var ValNextProvider = require('./ValNextProvider-
|
|
11
|
+
var ValNextProvider = require('./ValNextProvider-3f8bc508.cjs.prod.js');
|
|
12
12
|
var NextImage = require('next/image');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
var ValVideo = require('./ValVideo-94e5aa28.cjs.prod.js');
|
|
15
|
-
var ValApp = require('./ValApp-
|
|
15
|
+
var ValApp = require('./ValApp-b17ac306.cjs.prod.js');
|
|
16
16
|
var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
|
|
17
|
-
var version = require('./version-
|
|
17
|
+
var version = require('./version-f6abce64.cjs.prod.js');
|
|
18
18
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
19
19
|
require('./defineProperty-8951f469.cjs.prod.js');
|
|
20
20
|
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
@@ -7,13 +7,13 @@ export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@va
|
|
|
7
7
|
import { stegaEncode, attrs, raw, autoTagJSX } from '@valbuild/react/stega';
|
|
8
8
|
import { d as decodeValPathsOfString, _ as _objectWithoutProperties } from './objectWithoutProperties-2daec22c.esm.js';
|
|
9
9
|
export { ValRichText } from '@valbuild/react/internal';
|
|
10
|
-
import { ValNextProvider } from './ValNextProvider-
|
|
10
|
+
import { ValNextProvider } from './ValNextProvider-9934c628.esm.js';
|
|
11
11
|
import NextImage from 'next/image';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
export { ValVideo } from './ValVideo-19f2ab05.esm.js';
|
|
14
|
-
export { ValApp } from './ValApp-
|
|
14
|
+
export { ValApp } from './ValApp-821536aa.esm.js';
|
|
15
15
|
export { ValModulesClient, useRegisterValModules } from './ValModulesClient-0dd601a1.esm.js';
|
|
16
|
-
import { V as VERSION } from './version-
|
|
16
|
+
import { V as VERSION } from './version-3032da1e.esm.js';
|
|
17
17
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
18
18
|
import './defineProperty-cca5affa.esm.js';
|
|
19
19
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"next",
|
|
13
13
|
"react"
|
|
14
14
|
],
|
|
15
|
-
"version": "0.146.
|
|
15
|
+
"version": "0.146.4",
|
|
16
16
|
"main": "dist/valbuild-next.cjs.js",
|
|
17
17
|
"module": "dist/valbuild-next.esm.js",
|
|
18
18
|
"exports": {
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"client-only": "^0.0.1",
|
|
49
49
|
"server-only": "^0.0.1",
|
|
50
|
-
"@valbuild/language-server": "0.146.2",
|
|
51
50
|
"@valbuild/core": "0.146.2",
|
|
52
|
-
"@valbuild/
|
|
53
|
-
"@valbuild/
|
|
54
|
-
"@valbuild/
|
|
55
|
-
"@valbuild/
|
|
56
|
-
"@valbuild/
|
|
51
|
+
"@valbuild/language-server": "0.146.4",
|
|
52
|
+
"@valbuild/mcp": "0.146.4",
|
|
53
|
+
"@valbuild/react": "0.146.4",
|
|
54
|
+
"@valbuild/server": "0.146.4",
|
|
55
|
+
"@valbuild/shared": "0.146.4",
|
|
56
|
+
"@valbuild/ui": "0.146.4"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@testing-library/react": "^16.3.3",
|
|
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var server = require('@valbuild/server');
|
|
15
|
-
var version = require('../../dist/version-
|
|
15
|
+
var version = require('../../dist/version-c44f56b0.cjs.dev.js');
|
|
16
16
|
require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
17
17
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
18
18
|
require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var internal = require('@valbuild/shared/internal');
|
|
14
14
|
var server = require('@valbuild/server');
|
|
15
|
-
var version = require('../../dist/version-
|
|
15
|
+
var version = require('../../dist/version-f6abce64.cjs.prod.js');
|
|
16
16
|
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
17
17
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
18
18
|
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
@@ -8,7 +8,7 @@ import { Internal } from '@valbuild/core';
|
|
|
8
8
|
import { cache } from 'react';
|
|
9
9
|
import { VAL_SESSION_COOKIE, memoizePerRequest } from '@valbuild/shared/internal';
|
|
10
10
|
import { createValServer } from '@valbuild/server';
|
|
11
|
-
import { V as VERSION } from '../../dist/version-
|
|
11
|
+
import { V as VERSION } from '../../dist/version-3032da1e.esm.js';
|
|
12
12
|
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
13
13
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
14
14
|
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58024783.cjs.dev.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-c44f56b0.cjs.dev.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
15
15
|
require('../../dist/defineProperty-f90345d7.cjs.dev.js');
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-f6abce64.cjs.prod.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
15
15
|
require('../../dist/defineProperty-8951f469.cjs.prod.js');
|
|
@@ -6,7 +6,7 @@ import { Internal } from '@valbuild/core';
|
|
|
6
6
|
import { createValApiRouter, createValServer } from '@valbuild/server';
|
|
7
7
|
export { createPrettierFormatter } from '@valbuild/server';
|
|
8
8
|
import { NextResponse } from 'next/server';
|
|
9
|
-
import { V as VERSION } from '../../dist/version-
|
|
9
|
+
import { V as VERSION } from '../../dist/version-3032da1e.esm.js';
|
|
10
10
|
import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
12
12
|
import '../../dist/defineProperty-cca5affa.esm.js';
|