@valbuild/next 0.64.0 → 0.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -91
- package/client/dist/valbuild-next-client.cjs.d.ts +2 -2
- package/client/dist/valbuild-next-client.cjs.dev.js +19 -31
- package/client/dist/valbuild-next-client.cjs.prod.js +19 -31
- package/client/dist/valbuild-next-client.esm.js +19 -31
- package/dist/ValApp-50ec1e10.esm.js +53 -0
- package/dist/ValApp-9eefeefd.cjs.js +7 -0
- package/dist/ValApp-9eefeefd.cjs.prod.js +61 -0
- package/dist/ValApp-de156df4.cjs.dev.js +61 -0
- package/dist/ValNextProvider-0b711372.esm.js +430 -0
- package/dist/ValNextProvider-313af7bb.cjs.js +7 -0
- package/dist/ValNextProvider-313af7bb.cjs.prod.js +439 -0
- package/dist/ValNextProvider-abfbfdb5.cjs.dev.js +439 -0
- package/dist/{ValContext-06fe6f7e.cjs.dev.js → ValOverlayContext-55dae3ea.cjs.dev.js} +62 -71
- package/dist/ValOverlayContext-811e9be9.cjs.js +7 -0
- package/dist/{ValContext-12a3eca2.cjs.prod.js → ValOverlayContext-811e9be9.cjs.prod.js} +62 -71
- package/dist/{ValContext-8a8d9183.esm.js → ValOverlayContext-a2fdbce0.esm.js} +59 -69
- package/dist/{asyncToGenerator-0859ab5c.esm.js → asyncToGenerator-5f8c02f3.esm.js} +19 -24
- package/dist/{asyncToGenerator-ba66657c.cjs.dev.js → asyncToGenerator-67a5ff70.cjs.prod.js} +19 -24
- package/dist/{asyncToGenerator-3551d940.cjs.prod.js → asyncToGenerator-6ba61221.cjs.dev.js} +19 -24
- package/dist/declarations/src/ValApp.d.ts +1 -1
- package/dist/declarations/src/ValImage.d.ts +0 -1
- package/dist/declarations/src/ValProvider.d.ts +3 -5
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +31 -2
- package/dist/declarations/src/rsc/initValRsc.d.ts +4 -2
- package/dist/declarations/src/server/initValServer.d.ts +1 -1
- package/dist/{objectSpread2-bb9509e8.cjs.dev.js → objectSpread2-3c87fb4f.cjs.prod.js} +12 -18
- package/dist/{objectSpread2-24e737a6.cjs.prod.js → objectSpread2-792eb2c2.cjs.dev.js} +12 -18
- package/dist/{objectSpread2-439bdcdd.esm.js → objectSpread2-c1340c1c.esm.js} +12 -18
- package/dist/{slicedToArray-c03b6356.cjs.dev.js → slicedToArray-44036a76.cjs.dev.js} +5 -5
- package/dist/{slicedToArray-1ff80c5e.esm.js → slicedToArray-aa291011.esm.js} +5 -5
- package/dist/{slicedToArray-1d91551a.cjs.prod.js → slicedToArray-ce613de6.cjs.prod.js} +5 -5
- package/dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js +17 -0
- package/dist/unsupportedIterableToArray-5baabfdc.esm.js +15 -0
- package/dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js +17 -0
- package/dist/valbuild-next.cjs.d.ts +2 -2
- package/dist/valbuild-next.cjs.dev.js +23 -28
- package/dist/valbuild-next.cjs.prod.js +23 -28
- package/dist/valbuild-next.esm.js +23 -28
- package/package.json +6 -6
- package/rsc/dist/valbuild-next-rsc.cjs.d.ts +2 -2
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +202 -134
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +203 -132
- package/rsc/dist/valbuild-next-rsc.esm.js +203 -135
- package/server/dist/valbuild-next-server.cjs.d.ts +2 -2
- package/server/dist/valbuild-next-server.cjs.dev.js +23 -14
- package/server/dist/valbuild-next-server.cjs.prod.js +23 -14
- package/server/dist/valbuild-next-server.esm.js +23 -14
- package/client/dist/valbuild-next-client.cjs.d.ts.map +0 -1
- package/dist/ValApp-0ec0c7f3.cjs.js +0 -7
- package/dist/ValApp-0ec0c7f3.cjs.prod.js +0 -34
- package/dist/ValApp-61103149.esm.js +0 -26
- package/dist/ValApp-aff60572.cjs.dev.js +0 -34
- package/dist/ValContext-12a3eca2.cjs.js +0 -7
- package/dist/ValNextProvider-5226c452.cjs.js +0 -7
- package/dist/ValNextProvider-5226c452.cjs.prod.js +0 -101
- package/dist/ValNextProvider-ccbea1bd.cjs.dev.js +0 -101
- package/dist/ValNextProvider-d94cd904.esm.js +0 -92
- package/dist/unsupportedIterableToArray-51bb61c2.esm.js +0 -16
- package/dist/unsupportedIterableToArray-9e97e24a.cjs.dev.js +0 -18
- package/dist/unsupportedIterableToArray-afbea1dd.cjs.prod.js +0 -18
- package/dist/valbuild-next.cjs.d.ts.map +0 -1
- package/rsc/dist/valbuild-next-rsc.cjs.d.ts.map +0 -1
- package/server/dist/valbuild-next-server.cjs.d.ts.map +0 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-aa291011.esm.js';
|
|
3
|
+
import { Internal } from '@valbuild/core';
|
|
4
|
+
import { VAL_APP_PATH, VAL_OVERLAY_ID } from '@valbuild/ui';
|
|
5
|
+
import { useRouter } from 'next/navigation';
|
|
6
|
+
import Script from 'next/script';
|
|
7
|
+
import React, { useEffect } from 'react';
|
|
8
|
+
import { ValExternalStore, ValOverlayProvider } from './ValOverlayContext-a2fdbce0.esm.js';
|
|
9
|
+
import { SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
10
|
+
import { createValClient } from '@valbuild/shared/internal';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
13
|
+
|
|
14
|
+
var ValNextProvider = function ValNextProvider(props) {
|
|
15
|
+
// TODO: use config:
|
|
16
|
+
var route = "/api/val";
|
|
17
|
+
var client = React.useMemo(function () {
|
|
18
|
+
return createValClient(route);
|
|
19
|
+
}, [route]);
|
|
20
|
+
|
|
21
|
+
// TODO: move below into react package
|
|
22
|
+
var valStore = React.useMemo(function () {
|
|
23
|
+
return new ValExternalStore();
|
|
24
|
+
}, []);
|
|
25
|
+
var _React$useState = React.useState(),
|
|
26
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
+
showOverlay = _React$useState2[0],
|
|
28
|
+
setShowOverlay = _React$useState2[1];
|
|
29
|
+
var _React$useState3 = React.useState(null),
|
|
30
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
31
|
+
draftMode = _React$useState4[0],
|
|
32
|
+
setDraftMode = _React$useState4[1];
|
|
33
|
+
var _React$useState5 = React.useState(false),
|
|
34
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
35
|
+
spaReady = _React$useState6[0],
|
|
36
|
+
setSpaReady = _React$useState6[1];
|
|
37
|
+
var router = useRouter();
|
|
38
|
+
var _React$useTransition = React.useTransition(),
|
|
39
|
+
_React$useTransition2 = _slicedToArray(_React$useTransition, 2),
|
|
40
|
+
startTransition = _React$useTransition2[1];
|
|
41
|
+
var rerenderCounterRef = React.useRef(0);
|
|
42
|
+
var _React$useState7 = React.useState(null),
|
|
43
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
44
|
+
iframeSrc = _React$useState8[0],
|
|
45
|
+
setIframeSrc = _React$useState8[1];
|
|
46
|
+
useConsoleLogEnableVal(showOverlay);
|
|
47
|
+
React.useEffect(function () {
|
|
48
|
+
if (location.search === "?message_onready=true") {
|
|
49
|
+
console.warn("In message mode");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (isValStudioPath(location.pathname)) {
|
|
53
|
+
setShowOverlay(false);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setShowOverlay(document.cookie.includes("".concat(Internal.VAL_ENABLE_COOKIE_NAME, "=true")));
|
|
57
|
+
}, []);
|
|
58
|
+
React.useEffect(function () {
|
|
59
|
+
if (!showOverlay) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
var interval = setInterval(function () {
|
|
63
|
+
if (rerenderCounterRef.current > 0) {
|
|
64
|
+
if (!props.disableRefresh) {
|
|
65
|
+
rerenderCounterRef.current = 0;
|
|
66
|
+
startTransition(function () {
|
|
67
|
+
router.refresh();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, 500);
|
|
72
|
+
return function () {
|
|
73
|
+
clearInterval(interval);
|
|
74
|
+
};
|
|
75
|
+
}, [showOverlay, props.disableRefresh]);
|
|
76
|
+
React.useEffect(function () {
|
|
77
|
+
if (!showOverlay) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (draftMode === null) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
var valProviderOverlayListener = function valProviderOverlayListener(event) {
|
|
84
|
+
if (event instanceof CustomEvent) {
|
|
85
|
+
if (!(event !== null && event !== void 0 && event.detail.type)) {
|
|
86
|
+
console.error("Val: invalid event detail (val-overlay-provider)", event);
|
|
87
|
+
}
|
|
88
|
+
if (event.detail.type === "spa-ready") {
|
|
89
|
+
setSpaReady(true);
|
|
90
|
+
} else if (event.detail.type === "draftMode" && (typeof event.detail.value === "boolean" || event.detail.value === null)) {
|
|
91
|
+
var _draftMode = event.detail.value;
|
|
92
|
+
if (_draftMode === true) {
|
|
93
|
+
setIframeSrc(function (prev) {
|
|
94
|
+
if (prev === null) {
|
|
95
|
+
return "".concat(route, "/draft/enable?redirect_to=").concat(encodeURIComponent(window.location.origin + "/val?message_onready=true"));
|
|
96
|
+
}
|
|
97
|
+
return prev;
|
|
98
|
+
});
|
|
99
|
+
} else if (_draftMode === false) {
|
|
100
|
+
setIframeSrc(function (prev) {
|
|
101
|
+
if (prev === null) {
|
|
102
|
+
return "".concat(route, "/draft/disable?redirect_to=").concat(encodeURIComponent(window.location.origin + "/val?message_onready=true"));
|
|
103
|
+
}
|
|
104
|
+
return prev;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
console.error("Val: invalid event detail (val-overlay-provider)", event.detail);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
console.error("Val: invalid event (val-overlay-provider)", event);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
window.addEventListener("val-overlay-provider", valProviderOverlayListener);
|
|
115
|
+
return function () {
|
|
116
|
+
window.removeEventListener("val-overlay-provider", valProviderOverlayListener);
|
|
117
|
+
};
|
|
118
|
+
}, [showOverlay, draftMode]);
|
|
119
|
+
var pollDraftStatIdRef = React.useRef(0);
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
// continous polling to check for updates:
|
|
122
|
+
|
|
123
|
+
var timeout;
|
|
124
|
+
function pollCurrentDraftMode() {
|
|
125
|
+
if (!showOverlay) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
window.dispatchEvent(new CustomEvent("val-overlay-spa", {
|
|
129
|
+
detail: {
|
|
130
|
+
type: "draftModeLoading",
|
|
131
|
+
value: iframeSrc !== null
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
var pollDraftStatId = ++pollDraftStatIdRef.current;
|
|
135
|
+
client("/draft/stat", "GET", {}).then(function (res) {
|
|
136
|
+
if (pollDraftStatIdRef.current !== pollDraftStatId) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (res.status === null) {
|
|
140
|
+
// ignore network errors
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (res.status !== 200) {
|
|
144
|
+
console.error("Val: could not get draft mode status", res);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
setDraftMode(function (prev) {
|
|
148
|
+
if (prev !== res.json.draftMode) {
|
|
149
|
+
rerenderCounterRef.current++;
|
|
150
|
+
return res.json.draftMode;
|
|
151
|
+
}
|
|
152
|
+
return prev;
|
|
153
|
+
});
|
|
154
|
+
})["catch"](function (err) {
|
|
155
|
+
console.error("Val: could not get draft mode status", err);
|
|
156
|
+
})["finally"](function () {
|
|
157
|
+
if (pollDraftStatIdRef.current !== pollDraftStatId) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
pollDraftStatIdRef.current--;
|
|
161
|
+
timeout = setTimeout(pollCurrentDraftMode, iframeSrc === null ? 1000 : 100);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
pollCurrentDraftMode();
|
|
165
|
+
return function () {
|
|
166
|
+
clearTimeout(timeout);
|
|
167
|
+
};
|
|
168
|
+
}, [showOverlay, iframeSrc]);
|
|
169
|
+
React.useEffect(function () {
|
|
170
|
+
if (!showOverlay) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
window.dispatchEvent(new CustomEvent("val-overlay-spa", {
|
|
174
|
+
detail: {
|
|
175
|
+
type: "draftMode",
|
|
176
|
+
value: draftMode
|
|
177
|
+
}
|
|
178
|
+
}));
|
|
179
|
+
}, [showOverlay, draftMode, spaReady]);
|
|
180
|
+
React.useEffect(function () {
|
|
181
|
+
if (!showOverlay) {
|
|
182
|
+
SET_AUTO_TAG_JSX_ENABLED(false);
|
|
183
|
+
} else {
|
|
184
|
+
if (draftMode) {
|
|
185
|
+
SET_AUTO_TAG_JSX_ENABLED(true);
|
|
186
|
+
var reactServerComponentRefreshListener = function reactServerComponentRefreshListener(event) {
|
|
187
|
+
if (event instanceof CustomEvent) {
|
|
188
|
+
var _event$detail;
|
|
189
|
+
if (((_event$detail = event.detail) === null || _event$detail === void 0 ? void 0 : _event$detail.type) === "source-update") {
|
|
190
|
+
var _event$detail2, _event$detail3;
|
|
191
|
+
var moduleFilePath = (_event$detail2 = event.detail) === null || _event$detail2 === void 0 ? void 0 : _event$detail2.moduleFilePath;
|
|
192
|
+
var source = (_event$detail3 = event.detail) === null || _event$detail3 === void 0 ? void 0 : _event$detail3.source;
|
|
193
|
+
if (typeof moduleFilePath === "string" && source !== undefined) {
|
|
194
|
+
valStore.update(moduleFilePath, source);
|
|
195
|
+
if (!props.disableRefresh) {
|
|
196
|
+
rerenderCounterRef.current++;
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
console.error("Val: invalid event detail", event.detail);
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
console.error("Val: invalid custom event details (val-event)", event.detail);
|
|
203
|
+
}
|
|
204
|
+
} else {
|
|
205
|
+
console.error("Val: invalid custom event (val-event)", event);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
window.addEventListener("val-event", reactServerComponentRefreshListener);
|
|
209
|
+
return function () {
|
|
210
|
+
window.removeEventListener("val-event", reactServerComponentRefreshListener);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}, [showOverlay, draftMode, props.disableRefresh]);
|
|
215
|
+
React.useEffect(function () {
|
|
216
|
+
if (!showOverlay) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
var listener = function listener(event) {
|
|
220
|
+
if (event.origin === location.origin && event.data.type === "val-ready") {
|
|
221
|
+
setIframeSrc(null);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
window.addEventListener("message", listener);
|
|
225
|
+
return function () {
|
|
226
|
+
window.removeEventListener("message", listener);
|
|
227
|
+
};
|
|
228
|
+
}, [showOverlay]);
|
|
229
|
+
var _React$useState9 = React.useState(null),
|
|
230
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
231
|
+
dropZone = _React$useState10[0],
|
|
232
|
+
setDropZone = _React$useState10[1];
|
|
233
|
+
React.useEffect(function () {
|
|
234
|
+
var storedDropZone = localStorage.getItem("val-menu-drop-zone-default");
|
|
235
|
+
if (storedDropZone) {
|
|
236
|
+
setDropZone(storedDropZone);
|
|
237
|
+
} else {
|
|
238
|
+
setDropZone("val-menu-right-center");
|
|
239
|
+
}
|
|
240
|
+
}, []);
|
|
241
|
+
return /*#__PURE__*/jsxs(ValOverlayProvider, {
|
|
242
|
+
draftMode: draftMode,
|
|
243
|
+
store: valStore,
|
|
244
|
+
children: [props.children, !spaReady && showOverlay && dropZone && /*#__PURE__*/jsxs(React.Fragment, {
|
|
245
|
+
children: [/*#__PURE__*/jsx("style", {
|
|
246
|
+
children: "\n".concat(positionStyles, "\n.backdrop-blur {\n backdrop-filter: blur(10px);\n}\n.text-white {\n color: white;\n}\n.bg-black {\n background: black;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.fixed {\n position: fixed;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.right-12 {\n right: 3rem;\n}\n.right-16 {\n right: 4rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.animate-spin {\n animation: spin 2s linear infinite;\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}")
|
|
247
|
+
}), /*#__PURE__*/jsx("div", {
|
|
248
|
+
className: getPositionClassName(dropZone) + " p-4",
|
|
249
|
+
children: /*#__PURE__*/jsx("div", {
|
|
250
|
+
className: "flex items-center justify-center p-2 text-white bg-black rounded backdrop-blur",
|
|
251
|
+
children: /*#__PURE__*/jsx(Clock, {
|
|
252
|
+
className: "animate-spin",
|
|
253
|
+
size: 16
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
})]
|
|
257
|
+
}), showOverlay && draftMode !== undefined && /*#__PURE__*/jsxs(React.Fragment, {
|
|
258
|
+
children: [/*#__PURE__*/jsx(Script, {
|
|
259
|
+
type: "module",
|
|
260
|
+
src: "".concat(route, "/static").concat(VAL_APP_PATH)
|
|
261
|
+
}), /*#__PURE__*/jsx("div", {
|
|
262
|
+
id: VAL_OVERLAY_ID
|
|
263
|
+
})]
|
|
264
|
+
}), iframeSrc && draftMode !== null && showOverlay && /*#__PURE__*/jsx("iframe", {
|
|
265
|
+
style: {
|
|
266
|
+
top: 0,
|
|
267
|
+
left: 0,
|
|
268
|
+
position: "absolute",
|
|
269
|
+
width: 0,
|
|
270
|
+
height: 0
|
|
271
|
+
},
|
|
272
|
+
src: iframeSrc
|
|
273
|
+
}, iframeSrc)]
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
function useConsoleLogEnableVal(showOverlay) {
|
|
277
|
+
React.useEffect(function () {
|
|
278
|
+
if (process.env["NODE_ENV"] === "development" && showOverlay === false && !isValStudioPath(location.pathname)) {
|
|
279
|
+
console.warn("\n###########\n###########\n########### @@@@\n########### @@\n########### @@ @@ @@@@@@ @ @@\n########### @@ @@ @@ @@ @@\n########### @@ @@ %@ @ @@\n#### ##### @@ @@ .@ .@ @@\n### #### @@@@ @@: @@@. @@\n#### ##### @@@@ @@@@ =@@@@@@@@@\n###########\n\nThis page is built with Val Build - the lightweight CMS where content is code.\n\nVal is currently hidden.\n\nTo show Val, go to the following URL:\n".concat(window.location.origin, "/api/val/enable?redirect_to=").concat(encodeURIComponent(window.location.href), "\n \nYou are seeing this message because you are in development mode."));
|
|
280
|
+
}
|
|
281
|
+
}, [showOverlay]);
|
|
282
|
+
}
|
|
283
|
+
var positionStyles = "\n.left-0 {\n left: 0;\n}\n.top-0 {\n top: 0;\n}\n.left-1\\/2 {\n left: 50%;\n}\n.top-1\\/2 {\n top: 50%;\n}\n.-translate-y-1\\/2 {\n transform: translateY(-50%);\n}\n.-translate-x-1\\/2 {\n transform: translateX(-50%);\n}\n.right-0 {\n right: 0;\n}\n.bottom-0 {\n bottom: 0;\n}";
|
|
284
|
+
// This is a copy of the function from the ValMenu component.
|
|
285
|
+
function getPositionClassName(dropZone) {
|
|
286
|
+
var className = "fixed transform";
|
|
287
|
+
if (dropZone === "val-menu-left-top") {
|
|
288
|
+
className += " left-0 top-0";
|
|
289
|
+
} else if (dropZone === "val-menu-left-center") {
|
|
290
|
+
className += " left-0 top-1/2 -translate-y-1/2";
|
|
291
|
+
} else if (dropZone === "val-menu-left-bottom") {
|
|
292
|
+
className += " left-0 bottom-0";
|
|
293
|
+
} else if (dropZone === "val-menu-center-top") {
|
|
294
|
+
className += " left-1/2 -translate-x-1/2 top-0";
|
|
295
|
+
} else if (dropZone === "val-menu-center-bottom") {
|
|
296
|
+
className += " left-1/2 -translate-x-1/2 bottom-0";
|
|
297
|
+
} else if (dropZone === "val-menu-right-top") {
|
|
298
|
+
className += " right-0 top-0";
|
|
299
|
+
} else if (dropZone === "val-menu-right-center") {
|
|
300
|
+
className += " right-0 top-1/2 -translate-y-1/2";
|
|
301
|
+
} else if (dropZone === "val-menu-right-bottom") {
|
|
302
|
+
className += " right-0 bottom-0";
|
|
303
|
+
} else {
|
|
304
|
+
className += " right-0 bottom-0";
|
|
305
|
+
}
|
|
306
|
+
return className;
|
|
307
|
+
}
|
|
308
|
+
function isValStudioPath(pathname) {
|
|
309
|
+
return pathname.startsWith("/val");
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// function ValIcon() {
|
|
313
|
+
// return (
|
|
314
|
+
// <svg
|
|
315
|
+
// width="32"
|
|
316
|
+
// height="32"
|
|
317
|
+
// viewBox="0 0 105 149"
|
|
318
|
+
// fill="none"
|
|
319
|
+
// xmlns="http://www.w3.org/2000/svg"
|
|
320
|
+
// >
|
|
321
|
+
// <g filter="url(#filter0_d_14_634)">
|
|
322
|
+
// <path
|
|
323
|
+
// d="M21.4768 23.3474C21.4768 22.4628 22.1939 21.7457 23.0785 21.7457H77.1357C78.0203 21.7457 78.7374 22.4628 78.7374 23.3474V125.055C78.7374 125.94 78.0203 126.657 77.1357 126.657H23.0785C22.1939 126.657 21.4768 125.94 21.4768 125.055V23.3474Z"
|
|
324
|
+
// fill="#38CD98"
|
|
325
|
+
// />
|
|
326
|
+
// </g>
|
|
327
|
+
// <g filter="url(#filter1_i_14_634)">
|
|
328
|
+
// <circle cx="49.9068" cy="104.233" r="9.61017" fill="#1E1F2A" />
|
|
329
|
+
// </g>
|
|
330
|
+
// <defs>
|
|
331
|
+
// <filter
|
|
332
|
+
// id="filter0_d_14_634"
|
|
333
|
+
// x="0.0397091"
|
|
334
|
+
// y="0.30863"
|
|
335
|
+
// width="100.135"
|
|
336
|
+
// height="147.785"
|
|
337
|
+
// filterUnits="userSpaceOnUse"
|
|
338
|
+
// colorInterpolationFilters="sRGB"
|
|
339
|
+
// >
|
|
340
|
+
// <feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
341
|
+
// <feColorMatrix
|
|
342
|
+
// in="SourceAlpha"
|
|
343
|
+
// type="matrix"
|
|
344
|
+
// values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
345
|
+
// result="hardAlpha"
|
|
346
|
+
// />
|
|
347
|
+
// <feOffset />
|
|
348
|
+
// <feGaussianBlur stdDeviation="10.7185" />
|
|
349
|
+
// <feComposite in2="hardAlpha" operator="out" />
|
|
350
|
+
// <feColorMatrix
|
|
351
|
+
// type="matrix"
|
|
352
|
+
// values="0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"
|
|
353
|
+
// />
|
|
354
|
+
// <feBlend
|
|
355
|
+
// mode="normal"
|
|
356
|
+
// in2="BackgroundImageFix"
|
|
357
|
+
// result="effect1_dropShadow_14_634"
|
|
358
|
+
// />
|
|
359
|
+
// <feBlend
|
|
360
|
+
// mode="normal"
|
|
361
|
+
// in="SourceGraphic"
|
|
362
|
+
// in2="effect1_dropShadow_14_634"
|
|
363
|
+
// result="shape"
|
|
364
|
+
// />
|
|
365
|
+
// </filter>
|
|
366
|
+
// <filter
|
|
367
|
+
// id="filter1_i_14_634"
|
|
368
|
+
// x="40.2966"
|
|
369
|
+
// y="94.6229"
|
|
370
|
+
// width="19.2205"
|
|
371
|
+
// height="19.2204"
|
|
372
|
+
// filterUnits="userSpaceOnUse"
|
|
373
|
+
// colorInterpolationFilters="sRGB"
|
|
374
|
+
// >
|
|
375
|
+
// <feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
376
|
+
// <feBlend
|
|
377
|
+
// mode="normal"
|
|
378
|
+
// in="SourceGraphic"
|
|
379
|
+
// in2="BackgroundImageFix"
|
|
380
|
+
// result="shape"
|
|
381
|
+
// />
|
|
382
|
+
// <feColorMatrix
|
|
383
|
+
// in="SourceAlpha"
|
|
384
|
+
// type="matrix"
|
|
385
|
+
// values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
386
|
+
// result="hardAlpha"
|
|
387
|
+
// />
|
|
388
|
+
// <feOffset />
|
|
389
|
+
// <feGaussianBlur stdDeviation="2.40254" />
|
|
390
|
+
// <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
|
|
391
|
+
// <feColorMatrix
|
|
392
|
+
// type="matrix"
|
|
393
|
+
// values="0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"
|
|
394
|
+
// />
|
|
395
|
+
// <feBlend
|
|
396
|
+
// mode="normal"
|
|
397
|
+
// in2="shape"
|
|
398
|
+
// result="effect1_innerShadow_14_634"
|
|
399
|
+
// />
|
|
400
|
+
// </filter>
|
|
401
|
+
// </defs>
|
|
402
|
+
// </svg>
|
|
403
|
+
// );
|
|
404
|
+
// }
|
|
405
|
+
|
|
406
|
+
function Clock(_ref) {
|
|
407
|
+
var className = _ref.className,
|
|
408
|
+
size = _ref.size;
|
|
409
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
410
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
411
|
+
width: size,
|
|
412
|
+
height: size,
|
|
413
|
+
viewBox: "0 0 24 24",
|
|
414
|
+
fill: "none",
|
|
415
|
+
stroke: "currentColor",
|
|
416
|
+
strokeWidth: "2",
|
|
417
|
+
strokeLinecap: "round",
|
|
418
|
+
strokeLinejoin: "round",
|
|
419
|
+
className: "lucide lucide-clock " + className,
|
|
420
|
+
children: [/*#__PURE__*/jsx("circle", {
|
|
421
|
+
cx: "12",
|
|
422
|
+
cy: "12",
|
|
423
|
+
r: "10"
|
|
424
|
+
}), /*#__PURE__*/jsx("polyline", {
|
|
425
|
+
points: "12 6 12 12 16 14"
|
|
426
|
+
})]
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export { ValNextProvider };
|