@valbuild/tanstack 0.146.1 → 0.146.3
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 +21 -0
- package/dist/valbuild-tanstack.cjs.dev.js +92 -36
- package/dist/valbuild-tanstack.cjs.prod.js +92 -36
- package/dist/valbuild-tanstack.esm.js +92 -36
- package/dist/{version-87a5d814.cjs.prod.js → version-1226397e.cjs.dev.js} +1 -1
- package/dist/{version-ff96f246.cjs.dev.js → version-2e1a465b.cjs.prod.js} +1 -1
- package/dist/{version-c570b9ae.esm.js → version-d506fa5a.esm.js} +1 -1
- package/package.json +8 -8
- package/server/dist/valbuild-tanstack-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-tanstack-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-tanstack-server.esm.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @valbuild/tanstack
|
|
2
2
|
|
|
3
|
+
## 0.146.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
up until the Studio is ready to be seen, instead of disappearing as soon as the
|
|
9
|
+
page loaded and leaving a blank page while the Studio downloaded.
|
|
10
|
+
|
|
11
|
+
## 0.146.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`e4913e1`](https://github.com/valbuild/val/commit/e4913e1f1178e09987a7c03fd540909ab4b499b0), [`04f81ba`](https://github.com/valbuild/val/commit/04f81baeee4a98054c0673ca9fdc34bc5cadacb9), [`04f81ba`](https://github.com/valbuild/val/commit/04f81baeee4a98054c0673ca9fdc34bc5cadacb9), [`04f81ba`](https://github.com/valbuild/val/commit/04f81baeee4a98054c0673ca9fdc34bc5cadacb9)]:
|
|
16
|
+
- @valbuild/core@0.146.2
|
|
17
|
+
- @valbuild/shared@0.146.2
|
|
18
|
+
- @valbuild/server@0.146.2
|
|
19
|
+
- @valbuild/ui@0.146.2
|
|
20
|
+
- @valbuild/language-server@0.146.2
|
|
21
|
+
- @valbuild/mcp@0.146.2
|
|
22
|
+
- @valbuild/react@0.146.2
|
|
23
|
+
|
|
3
24
|
## 0.146.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('./version-
|
|
5
|
+
var version = require('./version-1226397e.cjs.dev.js');
|
|
6
6
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-4497beef.cjs.dev.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
@@ -2004,6 +2004,20 @@ function ValVideo(props) {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
|
|
2006
2006
|
var VAL_READY_PING_MS = 100;
|
|
2007
|
+
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
2010
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
2011
|
+
* route left and come back to -- must not wait for it a second time.
|
|
2012
|
+
*/
|
|
2013
|
+
var studioStylesLoaded = false;
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
2017
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
2018
|
+
* ends.
|
|
2019
|
+
*/
|
|
2020
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
2007
2021
|
var ValApp = function ValApp(_ref) {
|
|
2008
2022
|
var config = _ref.config,
|
|
2009
2023
|
children = _ref.children;
|
|
@@ -2037,11 +2051,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
2037
2051
|
}
|
|
2038
2052
|
});
|
|
2039
2053
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2054
|
+
/*
|
|
2055
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
2056
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
2057
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
2058
|
+
*/
|
|
2059
|
+
var _useState3 = React.useState(function () {
|
|
2060
|
+
return !studioStylesLoaded;
|
|
2061
|
+
}),
|
|
2042
2062
|
_useState4 = createForOfIteratorHelper._slicedToArray(_useState3, 2),
|
|
2043
|
-
|
|
2044
|
-
|
|
2063
|
+
covering = _useState4[0],
|
|
2064
|
+
setCovering = _useState4[1];
|
|
2065
|
+
React.useEffect(function () {
|
|
2066
|
+
if (!covering) {
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
var onCssLoaded = function onCssLoaded() {
|
|
2070
|
+
studioStylesLoaded = true;
|
|
2071
|
+
setCovering(false);
|
|
2072
|
+
};
|
|
2073
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
2074
|
+
var timeout = setTimeout(function () {
|
|
2075
|
+
return setCovering(false);
|
|
2076
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
2077
|
+
return function () {
|
|
2078
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2079
|
+
clearTimeout(timeout);
|
|
2080
|
+
};
|
|
2081
|
+
}, [covering]);
|
|
2082
|
+
|
|
2083
|
+
// this theme is used to avoid flickering
|
|
2084
|
+
var _useState5 = React.useState(config.defaultTheme || null),
|
|
2085
|
+
_useState6 = createForOfIteratorHelper._slicedToArray(_useState5, 2),
|
|
2086
|
+
loadingTheme = _useState6[0],
|
|
2087
|
+
setLoadingTheme = _useState6[1];
|
|
2045
2088
|
React.useEffect(function () {
|
|
2046
2089
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
2047
2090
|
if (theme === "dark") {
|
|
@@ -2082,36 +2125,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
2082
2125
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2083
2126
|
};
|
|
2084
2127
|
}, [inMessageMode, loadingTheme]);
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2128
|
+
|
|
2129
|
+
/*
|
|
2130
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
2131
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
2132
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
2133
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
2134
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
2135
|
+
* It is the first element both in the server render and after, so hydration
|
|
2136
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
2137
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
2138
|
+
*/
|
|
2139
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2140
|
+
style: {
|
|
2141
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
2142
|
+
display: "flex",
|
|
2143
|
+
justifyContent: "center",
|
|
2144
|
+
alignItems: "center",
|
|
2145
|
+
padding: "1rem",
|
|
2146
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
2147
|
+
position: "fixed",
|
|
2148
|
+
inset: 0,
|
|
2149
|
+
zIndex: 2147483647
|
|
2150
|
+
},
|
|
2151
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("style", {
|
|
2152
|
+
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}")
|
|
2153
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
2154
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2155
|
+
width: "24",
|
|
2156
|
+
height: "24",
|
|
2157
|
+
viewBox: "0 0 24 24",
|
|
2158
|
+
fill: "none",
|
|
2159
|
+
stroke: "currentColor",
|
|
2160
|
+
strokeWidth: "2",
|
|
2161
|
+
strokeLinecap: "round",
|
|
2162
|
+
strokeLinejoin: "round",
|
|
2163
|
+
className: cn(["animate-spin"]),
|
|
2164
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2165
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
2166
|
+
})
|
|
2167
|
+
})]
|
|
2168
|
+
});
|
|
2169
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
2170
|
+
return loadingScreen;
|
|
2115
2171
|
}
|
|
2116
2172
|
if (inMessageMode) {
|
|
2117
2173
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -2119,7 +2175,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
2119
2175
|
});
|
|
2120
2176
|
}
|
|
2121
2177
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2122
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ValScript, {
|
|
2178
|
+
children: [loadingScreen, /*#__PURE__*/jsxRuntime.jsx(ValScript, {
|
|
2123
2179
|
src: "".concat(route, "/static").concat(ui.VERSION ? "/".concat(ui.VERSION) : "").concat(ui.VAL_APP_PATH)
|
|
2124
2180
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2125
2181
|
id: ui.VAL_APP_ID,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('./version-
|
|
5
|
+
var version = require('./version-2e1a465b.cjs.prod.js');
|
|
6
6
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-9afd7d2d.cjs.prod.js');
|
|
7
7
|
var core = require('@valbuild/core');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
@@ -2004,6 +2004,20 @@ function ValVideo(props) {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
|
|
2006
2006
|
var VAL_READY_PING_MS = 100;
|
|
2007
|
+
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
2010
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
2011
|
+
* route left and come back to -- must not wait for it a second time.
|
|
2012
|
+
*/
|
|
2013
|
+
var studioStylesLoaded = false;
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
2017
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
2018
|
+
* ends.
|
|
2019
|
+
*/
|
|
2020
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
2007
2021
|
var ValApp = function ValApp(_ref) {
|
|
2008
2022
|
var config = _ref.config,
|
|
2009
2023
|
children = _ref.children;
|
|
@@ -2037,11 +2051,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
2037
2051
|
}
|
|
2038
2052
|
});
|
|
2039
2053
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2054
|
+
/*
|
|
2055
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
2056
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
2057
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
2058
|
+
*/
|
|
2059
|
+
var _useState3 = React.useState(function () {
|
|
2060
|
+
return !studioStylesLoaded;
|
|
2061
|
+
}),
|
|
2042
2062
|
_useState4 = createForOfIteratorHelper._slicedToArray(_useState3, 2),
|
|
2043
|
-
|
|
2044
|
-
|
|
2063
|
+
covering = _useState4[0],
|
|
2064
|
+
setCovering = _useState4[1];
|
|
2065
|
+
React.useEffect(function () {
|
|
2066
|
+
if (!covering) {
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
var onCssLoaded = function onCssLoaded() {
|
|
2070
|
+
studioStylesLoaded = true;
|
|
2071
|
+
setCovering(false);
|
|
2072
|
+
};
|
|
2073
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
2074
|
+
var timeout = setTimeout(function () {
|
|
2075
|
+
return setCovering(false);
|
|
2076
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
2077
|
+
return function () {
|
|
2078
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2079
|
+
clearTimeout(timeout);
|
|
2080
|
+
};
|
|
2081
|
+
}, [covering]);
|
|
2082
|
+
|
|
2083
|
+
// this theme is used to avoid flickering
|
|
2084
|
+
var _useState5 = React.useState(config.defaultTheme || null),
|
|
2085
|
+
_useState6 = createForOfIteratorHelper._slicedToArray(_useState5, 2),
|
|
2086
|
+
loadingTheme = _useState6[0],
|
|
2087
|
+
setLoadingTheme = _useState6[1];
|
|
2045
2088
|
React.useEffect(function () {
|
|
2046
2089
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
2047
2090
|
if (theme === "dark") {
|
|
@@ -2082,36 +2125,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
2082
2125
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2083
2126
|
};
|
|
2084
2127
|
}, [inMessageMode, loadingTheme]);
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2128
|
+
|
|
2129
|
+
/*
|
|
2130
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
2131
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
2132
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
2133
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
2134
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
2135
|
+
* It is the first element both in the server render and after, so hydration
|
|
2136
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
2137
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
2138
|
+
*/
|
|
2139
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2140
|
+
style: {
|
|
2141
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
2142
|
+
display: "flex",
|
|
2143
|
+
justifyContent: "center",
|
|
2144
|
+
alignItems: "center",
|
|
2145
|
+
padding: "1rem",
|
|
2146
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
2147
|
+
position: "fixed",
|
|
2148
|
+
inset: 0,
|
|
2149
|
+
zIndex: 2147483647
|
|
2150
|
+
},
|
|
2151
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("style", {
|
|
2152
|
+
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}")
|
|
2153
|
+
}), /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
2154
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2155
|
+
width: "24",
|
|
2156
|
+
height: "24",
|
|
2157
|
+
viewBox: "0 0 24 24",
|
|
2158
|
+
fill: "none",
|
|
2159
|
+
stroke: "currentColor",
|
|
2160
|
+
strokeWidth: "2",
|
|
2161
|
+
strokeLinecap: "round",
|
|
2162
|
+
strokeLinejoin: "round",
|
|
2163
|
+
className: cn(["animate-spin"]),
|
|
2164
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2165
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
2166
|
+
})
|
|
2167
|
+
})]
|
|
2168
|
+
});
|
|
2169
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
2170
|
+
return loadingScreen;
|
|
2115
2171
|
}
|
|
2116
2172
|
if (inMessageMode) {
|
|
2117
2173
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -2119,7 +2175,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
2119
2175
|
});
|
|
2120
2176
|
}
|
|
2121
2177
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2122
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ValScript, {
|
|
2178
|
+
children: [loadingScreen, /*#__PURE__*/jsxRuntime.jsx(ValScript, {
|
|
2123
2179
|
src: "".concat(route, "/static").concat(ui.VERSION ? "/".concat(ui.VERSION) : "").concat(ui.VAL_APP_PATH)
|
|
2124
2180
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2125
2181
|
id: ui.VAL_APP_ID,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-
|
|
1
|
+
import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-d506fa5a.esm.js';
|
|
2
2
|
import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper } from './createForOfIteratorHelper-93a62170.esm.js';
|
|
3
3
|
import { Internal as Internal$1, initVal as initVal$1, DEFAULT_CONTENT_HOST } from '@valbuild/core';
|
|
4
4
|
import * as core from '@valbuild/core';
|
|
@@ -1980,6 +1980,20 @@ function ValVideo(props) {
|
|
|
1980
1980
|
}
|
|
1981
1981
|
|
|
1982
1982
|
var VAL_READY_PING_MS = 100;
|
|
1983
|
+
|
|
1984
|
+
/**
|
|
1985
|
+
* Whether the Studio's stylesheet has loaded in this page. `val-css-loaded`
|
|
1986
|
+
* fires once per page, so a `ValApp` that mounts again after it -- the `/val`
|
|
1987
|
+
* route left and come back to -- must not wait for it a second time.
|
|
1988
|
+
*/
|
|
1989
|
+
var studioStylesLoaded = false;
|
|
1990
|
+
|
|
1991
|
+
/**
|
|
1992
|
+
* The longest the loading screen covers the page. Past it, whatever the Studio
|
|
1993
|
+
* shows -- unstyled, or its own error -- is better than a spinner that never
|
|
1994
|
+
* ends.
|
|
1995
|
+
*/
|
|
1996
|
+
var LOADING_SCREEN_MAX_MS = 15000;
|
|
1983
1997
|
var ValApp = function ValApp(_ref) {
|
|
1984
1998
|
var config = _ref.config,
|
|
1985
1999
|
children = _ref.children;
|
|
@@ -2013,11 +2027,40 @@ var ValApp = function ValApp(_ref) {
|
|
|
2013
2027
|
}
|
|
2014
2028
|
});
|
|
2015
2029
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2030
|
+
/*
|
|
2031
|
+
* Whether the loading screen still covers the page: until the Studio's
|
|
2032
|
+
* stylesheet has loaded, or the wait runs out. Its own state rather than
|
|
2033
|
+
* `loadingTheme`, which a new `config` sets again after the event has fired.
|
|
2034
|
+
*/
|
|
2035
|
+
var _useState3 = useState(function () {
|
|
2036
|
+
return !studioStylesLoaded;
|
|
2037
|
+
}),
|
|
2018
2038
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
2019
|
-
|
|
2020
|
-
|
|
2039
|
+
covering = _useState4[0],
|
|
2040
|
+
setCovering = _useState4[1];
|
|
2041
|
+
useEffect(function () {
|
|
2042
|
+
if (!covering) {
|
|
2043
|
+
return;
|
|
2044
|
+
}
|
|
2045
|
+
var onCssLoaded = function onCssLoaded() {
|
|
2046
|
+
studioStylesLoaded = true;
|
|
2047
|
+
setCovering(false);
|
|
2048
|
+
};
|
|
2049
|
+
window.addEventListener("val-css-loaded", onCssLoaded);
|
|
2050
|
+
var timeout = setTimeout(function () {
|
|
2051
|
+
return setCovering(false);
|
|
2052
|
+
}, LOADING_SCREEN_MAX_MS);
|
|
2053
|
+
return function () {
|
|
2054
|
+
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2055
|
+
clearTimeout(timeout);
|
|
2056
|
+
};
|
|
2057
|
+
}, [covering]);
|
|
2058
|
+
|
|
2059
|
+
// this theme is used to avoid flickering
|
|
2060
|
+
var _useState5 = useState(config.defaultTheme || null),
|
|
2061
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2062
|
+
loadingTheme = _useState6[0],
|
|
2063
|
+
setLoadingTheme = _useState6[1];
|
|
2021
2064
|
useEffect(function () {
|
|
2022
2065
|
var theme = localStorage.getItem("val-theme-" + ((config === null || config === void 0 ? void 0 : config.project) || "unknown"));
|
|
2023
2066
|
if (theme === "dark") {
|
|
@@ -2058,36 +2101,49 @@ var ValApp = function ValApp(_ref) {
|
|
|
2058
2101
|
window.removeEventListener("val-css-loaded", onCssLoaded);
|
|
2059
2102
|
};
|
|
2060
2103
|
}, [inMessageMode, loadingTheme]);
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2104
|
+
|
|
2105
|
+
/*
|
|
2106
|
+
* The loading screen stays up until the Studio's stylesheet has loaded, as
|
|
2107
|
+
* an overlay above the Studio mounting underneath it. It used to be rendered
|
|
2108
|
+
* INSTEAD of the Studio and dropped at hydration, which was before the
|
|
2109
|
+
* Studio's script had even been requested: the spinner went, an empty page
|
|
2110
|
+
* stood there while the Studio downloaded, and then the Studio appeared.
|
|
2111
|
+
* It is the first element both in the server render and after, so hydration
|
|
2112
|
+
* keeps it rather than restarting it. Only with a theme to draw it in --
|
|
2113
|
+
* `config.defaultTheme`, as the templates set -- as before.
|
|
2114
|
+
*/
|
|
2115
|
+
var loadingScreen = !covering || loadingTheme === null || inMessageMode ? null : /*#__PURE__*/jsxs("div", {
|
|
2116
|
+
style: {
|
|
2117
|
+
color: loadingTheme === "dark" ? "white" : "black",
|
|
2118
|
+
display: "flex",
|
|
2119
|
+
justifyContent: "center",
|
|
2120
|
+
alignItems: "center",
|
|
2121
|
+
padding: "1rem",
|
|
2122
|
+
backgroundColor: loadingTheme === "dark" ? darkBg : lightBg,
|
|
2123
|
+
position: "fixed",
|
|
2124
|
+
inset: 0,
|
|
2125
|
+
zIndex: 2147483647
|
|
2126
|
+
},
|
|
2127
|
+
children: [/*#__PURE__*/jsx("style", {
|
|
2128
|
+
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}")
|
|
2129
|
+
}), /*#__PURE__*/jsx("svg", {
|
|
2130
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2131
|
+
width: "24",
|
|
2132
|
+
height: "24",
|
|
2133
|
+
viewBox: "0 0 24 24",
|
|
2134
|
+
fill: "none",
|
|
2135
|
+
stroke: "currentColor",
|
|
2136
|
+
strokeWidth: "2",
|
|
2137
|
+
strokeLinecap: "round",
|
|
2138
|
+
strokeLinejoin: "round",
|
|
2139
|
+
className: cn(["animate-spin"]),
|
|
2140
|
+
children: /*#__PURE__*/jsx("path", {
|
|
2141
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
2142
|
+
})
|
|
2143
|
+
})]
|
|
2144
|
+
});
|
|
2145
|
+
if (isClientSIde && loadingScreen !== null) {
|
|
2146
|
+
return loadingScreen;
|
|
2091
2147
|
}
|
|
2092
2148
|
if (inMessageMode) {
|
|
2093
2149
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -2095,7 +2151,7 @@ var ValApp = function ValApp(_ref) {
|
|
|
2095
2151
|
});
|
|
2096
2152
|
}
|
|
2097
2153
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2098
|
-
children: [/*#__PURE__*/jsx(ValScript, {
|
|
2154
|
+
children: [loadingScreen, /*#__PURE__*/jsx(ValScript, {
|
|
2099
2155
|
src: "".concat(route, "/static").concat(VERSION ? "/".concat(VERSION) : "").concat(VAL_APP_PATH)
|
|
2100
2156
|
}), /*#__PURE__*/jsx("div", {
|
|
2101
2157
|
id: VAL_APP_ID,
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"tanstack-router",
|
|
15
15
|
"react"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.146.
|
|
17
|
+
"version": "0.146.3",
|
|
18
18
|
"main": "dist/valbuild-tanstack.cjs.js",
|
|
19
19
|
"module": "dist/valbuild-tanstack.esm.js",
|
|
20
20
|
"exports": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"exports": true
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@valbuild/core": "0.
|
|
46
|
-
"@valbuild/language-server": "0.146.
|
|
47
|
-
"@valbuild/mcp": "0.146.
|
|
48
|
-
"@valbuild/react": "0.146.
|
|
49
|
-
"@valbuild/server": "0.146.
|
|
50
|
-
"@valbuild/shared": "0.146.
|
|
51
|
-
"@valbuild/ui": "0.146.
|
|
45
|
+
"@valbuild/core": "0.146.2",
|
|
46
|
+
"@valbuild/language-server": "0.146.2",
|
|
47
|
+
"@valbuild/mcp": "0.146.2",
|
|
48
|
+
"@valbuild/react": "0.146.2",
|
|
49
|
+
"@valbuild/server": "0.146.2",
|
|
50
|
+
"@valbuild/shared": "0.146.2",
|
|
51
|
+
"@valbuild/ui": "0.146.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@tanstack/react-router": "^1.170.41",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-1226397e.cjs.dev.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
7
|
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-4497beef.cjs.dev.js');
|
|
8
8
|
var server = require('@valbuild/server');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = require('../../dist/version-
|
|
5
|
+
var version = require('../../dist/version-2e1a465b.cjs.prod.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
7
|
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-9afd7d2d.cjs.prod.js');
|
|
8
8
|
var server = require('@valbuild/server');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-
|
|
1
|
+
import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-d506fa5a.esm.js';
|
|
2
2
|
import { Internal } from '@valbuild/core';
|
|
3
3
|
import { _ as _objectSpread2, a as _slicedToArray, e as _arrayLikeToArray, f as _unsupportedIterableToArray, b as _createForOfIteratorHelper, d as _defineProperty } from '../../dist/createForOfIteratorHelper-93a62170.esm.js';
|
|
4
4
|
import { createValApiRouter, createValServer, layeredSnapshot, proposalSnapshotForReaders, proposalSnapshot } from '@valbuild/server';
|