@valbuild/next 0.83.0 → 0.84.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/client/dist/valbuild-next-client.cjs.dev.js +1 -1
- package/client/dist/valbuild-next-client.cjs.prod.js +1 -1
- package/client/dist/valbuild-next-client.esm.js +1 -1
- package/dist/{ValNextProvider-5f8b7338.esm.js → ValNextProvider-25f1f5c9.esm.js} +2 -2
- package/dist/ValNextProvider-a618d775.cjs.js +7 -0
- package/dist/{ValNextProvider-9ff1bb92.cjs.prod.js → ValNextProvider-a618d775.cjs.prod.js} +2 -2
- package/dist/{ValNextProvider-99b4552f.cjs.dev.js → ValNextProvider-c7952bdc.cjs.dev.js} +2 -2
- package/dist/{ValOverlayContext-a2fdbce0.esm.js → ValOverlayContext-6635a4d7.esm.js} +2 -50
- package/dist/ValOverlayContext-942f1294.cjs.js +7 -0
- package/dist/{ValOverlayContext-811e9be9.cjs.prod.js → ValOverlayContext-942f1294.cjs.prod.js} +3 -51
- package/dist/{ValOverlayContext-55dae3ea.cjs.dev.js → ValOverlayContext-c82a4507.cjs.dev.js} +3 -51
- package/dist/createForOfIteratorHelper-0445603c.cjs.dev.js +54 -0
- package/dist/createForOfIteratorHelper-5758a730.esm.js +52 -0
- package/dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js +54 -0
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +1 -0
- package/dist/declarations/src/initVal.d.ts +3 -1
- package/dist/declarations/src/rsc/initValRsc.d.ts +11 -1
- package/dist/typeof-16428c61.cjs.prod.js +13 -0
- package/dist/typeof-a1531d8f.esm.js +11 -0
- package/dist/typeof-b568f48f.cjs.dev.js +13 -0
- package/dist/valbuild-next.cjs.dev.js +6 -13
- package/dist/valbuild-next.cjs.prod.js +6 -13
- package/dist/valbuild-next.esm.js +5 -12
- package/package.json +6 -6
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +248 -36
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +248 -36
- package/rsc/dist/valbuild-next-rsc.esm.js +250 -38
- package/dist/ValNextProvider-9ff1bb92.cjs.js +0 -7
- package/dist/ValOverlayContext-811e9be9.cjs.js +0 -7
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _typeof = require('./typeof-16428c61.cjs.prod.js');
|
|
5
6
|
var objectSpread2 = require('./objectSpread2-3c87fb4f.cjs.prod.js');
|
|
6
7
|
var core = require('@valbuild/core');
|
|
7
8
|
var stega = require('@valbuild/react/stega');
|
|
8
9
|
var internal = require('@valbuild/react/internal');
|
|
9
|
-
var ValNextProvider = require('./ValNextProvider-
|
|
10
|
+
var ValNextProvider = require('./ValNextProvider-a618d775.cjs.prod.js');
|
|
10
11
|
var NextImage = require('next/image');
|
|
11
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
13
|
var ValApp = require('./ValApp-a808cf89.cjs.prod.js');
|
|
@@ -35,16 +36,6 @@ function _interopNamespace(e) {
|
|
|
35
36
|
var core__namespace = /*#__PURE__*/_interopNamespace(core);
|
|
36
37
|
var NextImage__default = /*#__PURE__*/_interopDefault(NextImage);
|
|
37
38
|
|
|
38
|
-
function _typeof(o) {
|
|
39
|
-
"@babel/helpers - typeof";
|
|
40
|
-
|
|
41
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
42
|
-
return typeof o;
|
|
43
|
-
} : function (o) {
|
|
44
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
45
|
-
}, _typeof(o);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
39
|
function raw(val) {
|
|
49
40
|
if (typeof val === "string") {
|
|
50
41
|
return stega.stegaClean(val);
|
|
@@ -54,7 +45,7 @@ function raw(val) {
|
|
|
54
45
|
return raw(item);
|
|
55
46
|
});
|
|
56
47
|
}
|
|
57
|
-
if (_typeof(val) === "object" && val !== null) {
|
|
48
|
+
if (_typeof._typeof(val) === "object" && val !== null) {
|
|
58
49
|
var result = {};
|
|
59
50
|
for (var _key in val) {
|
|
60
51
|
if (Object.prototype.hasOwnProperty.call(val, _key)) {
|
|
@@ -78,6 +69,7 @@ function decodeValPathOfString(encodedString) {
|
|
|
78
69
|
return stega.stegaDecodeString(encodedString);
|
|
79
70
|
}
|
|
80
71
|
|
|
72
|
+
var nextAppRouter = core.Internal.nextAppRouter;
|
|
81
73
|
var initVal = function initVal(config) {
|
|
82
74
|
var _createValSystem = core.initVal(config),
|
|
83
75
|
s = _createValSystem.s,
|
|
@@ -88,6 +80,7 @@ var initVal = function initVal(config) {
|
|
|
88
80
|
return {
|
|
89
81
|
s: s,
|
|
90
82
|
c: c,
|
|
83
|
+
nextAppRouter: nextAppRouter,
|
|
91
84
|
val: objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, val), {}, {
|
|
92
85
|
attrs: function attrs(target) {
|
|
93
86
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -97,7 +90,7 @@ var initVal = function initVal(config) {
|
|
|
97
90
|
return {};
|
|
98
91
|
}
|
|
99
92
|
path = core.Internal.getValPath(anyTarget);
|
|
100
|
-
if (!path && _typeof(anyTarget) === "object") {
|
|
93
|
+
if (!path && _typeof._typeof(anyTarget) === "object") {
|
|
101
94
|
path = anyTarget["valPath"];
|
|
102
95
|
}
|
|
103
96
|
if (typeof anyTarget === "string") {
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
+
import { _ as _typeof } from './typeof-a1531d8f.esm.js';
|
|
1
2
|
import { _ as _objectSpread2 } from './objectSpread2-c1340c1c.esm.js';
|
|
2
|
-
import {
|
|
3
|
+
import { Internal as Internal$1, initVal as initVal$1 } from '@valbuild/core';
|
|
3
4
|
import * as core from '@valbuild/core';
|
|
4
5
|
export { core as expr };
|
|
5
6
|
export { FILE_REF_PROP, GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
|
|
6
7
|
import { stegaClean, stegaEncode, stegaDecodeString, autoTagJSX } from '@valbuild/react/stega';
|
|
7
8
|
export { ValRichText } from '@valbuild/react/internal';
|
|
8
|
-
import { ValNextProvider } from './ValNextProvider-
|
|
9
|
+
import { ValNextProvider } from './ValNextProvider-25f1f5c9.esm.js';
|
|
9
10
|
import NextImage from 'next/image';
|
|
10
11
|
import { jsx } from 'react/jsx-runtime';
|
|
11
12
|
export { ValApp } from './ValApp-3ab62a2b.esm.js';
|
|
12
13
|
import { V as VERSION } from './version-98ec5c7a.esm.js';
|
|
13
14
|
|
|
14
|
-
function _typeof(o) {
|
|
15
|
-
"@babel/helpers - typeof";
|
|
16
|
-
|
|
17
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
18
|
-
return typeof o;
|
|
19
|
-
} : function (o) {
|
|
20
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
21
|
-
}, _typeof(o);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
function raw(val) {
|
|
25
16
|
if (typeof val === "string") {
|
|
26
17
|
return stegaClean(val);
|
|
@@ -54,6 +45,7 @@ function decodeValPathOfString(encodedString) {
|
|
|
54
45
|
return stegaDecodeString(encodedString);
|
|
55
46
|
}
|
|
56
47
|
|
|
48
|
+
var nextAppRouter = Internal$1.nextAppRouter;
|
|
57
49
|
var initVal = function initVal(config) {
|
|
58
50
|
var _createValSystem = initVal$1(config),
|
|
59
51
|
s = _createValSystem.s,
|
|
@@ -64,6 +56,7 @@ var initVal = function initVal(config) {
|
|
|
64
56
|
return {
|
|
65
57
|
s: s,
|
|
66
58
|
c: c,
|
|
59
|
+
nextAppRouter: nextAppRouter,
|
|
67
60
|
val: _objectSpread2(_objectSpread2({}, val), {}, {
|
|
68
61
|
attrs: function attrs(target) {
|
|
69
62
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"next",
|
|
9
9
|
"react"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.84.0",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
14
|
"test": "jest"
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"exports": true
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@valbuild/core": "~0.
|
|
49
|
-
"@valbuild/react": "~0.
|
|
50
|
-
"@valbuild/server": "~0.
|
|
51
|
-
"@valbuild/shared": "~0.
|
|
52
|
-
"@valbuild/ui": "~0.
|
|
48
|
+
"@valbuild/core": "~0.84.0",
|
|
49
|
+
"@valbuild/react": "~0.84.0",
|
|
50
|
+
"@valbuild/server": "~0.84.0",
|
|
51
|
+
"@valbuild/shared": "~0.84.0",
|
|
52
|
+
"@valbuild/ui": "~0.84.0",
|
|
53
53
|
"client-only": "^0.0.1",
|
|
54
54
|
"server-only": "^0.0.1"
|
|
55
55
|
},
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('server-only');
|
|
6
|
+
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
6
7
|
var objectSpread2 = require('../../dist/objectSpread2-792eb2c2.cjs.dev.js');
|
|
8
|
+
var slicedToArray = require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
9
|
+
var _typeof = require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
7
10
|
var asyncToGenerator = require('../../dist/asyncToGenerator-6ba61221.cjs.dev.js');
|
|
8
11
|
var stega = require('@valbuild/react/stega');
|
|
9
12
|
var core = require('@valbuild/core');
|
|
10
13
|
var internal = require('@valbuild/shared/internal');
|
|
11
14
|
var server = require('@valbuild/server');
|
|
12
15
|
var version = require('../../dist/version-82faa1d0.cjs.dev.js');
|
|
16
|
+
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
13
17
|
|
|
14
18
|
stega.SET_RSC(true);
|
|
15
19
|
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
@@ -175,6 +179,174 @@ function getHost(headers) {
|
|
|
175
179
|
// }
|
|
176
180
|
// }
|
|
177
181
|
|
|
182
|
+
var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
183
|
+
return /*#__PURE__*/function () {
|
|
184
|
+
var _ref2 = asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee2(selector, params) {
|
|
185
|
+
var fetchVal, path, val, schema, resolvedParams, _Internal$splitModule, _Internal$splitModule2, moduleFilePath, srcFolder, pattern, parsedPattern, missingPatterns, fullPathParts, missingParamKeys, _iterator, _step, part, value, errorMessageParams, fullPath, actualRoute;
|
|
186
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
187
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
188
|
+
case 0:
|
|
189
|
+
fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
|
|
190
|
+
path = selector && core.Internal.getValPath(selector);
|
|
191
|
+
if (path) {
|
|
192
|
+
_context2.next = 5;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
console.error("Val: fetchValRoute can only be used with a Val module (details: no Val path found).");
|
|
196
|
+
return _context2.abrupt("return", null);
|
|
197
|
+
case 5:
|
|
198
|
+
_context2.next = 7;
|
|
199
|
+
return fetchVal(selector);
|
|
200
|
+
case 7:
|
|
201
|
+
val = _context2.sent;
|
|
202
|
+
if (!(val === null)) {
|
|
203
|
+
_context2.next = 10;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
return _context2.abrupt("return", null);
|
|
207
|
+
case 10:
|
|
208
|
+
if (!(_typeof._typeof(val) !== "object")) {
|
|
209
|
+
_context2.next = 13;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ".concat(_typeof._typeof(val), " instead)."));
|
|
213
|
+
return _context2.abrupt("return", null);
|
|
214
|
+
case 13:
|
|
215
|
+
if (!Array.isArray(val)) {
|
|
216
|
+
_context2.next = 16;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: expected type object, found array instead).");
|
|
220
|
+
return _context2.abrupt("return", null);
|
|
221
|
+
case 16:
|
|
222
|
+
schema = core.Internal.getSchema(selector);
|
|
223
|
+
if (schema) {
|
|
224
|
+
_context2.next = 20;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: no schema found).");
|
|
228
|
+
return _context2.abrupt("return", null);
|
|
229
|
+
case 20:
|
|
230
|
+
if (schema instanceof core.RecordSchema) {
|
|
231
|
+
_context2.next = 24;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: schema is not a record).");
|
|
235
|
+
_context2.next = 31;
|
|
236
|
+
break;
|
|
237
|
+
case 24:
|
|
238
|
+
if (schema["currentRouter"]) {
|
|
239
|
+
_context2.next = 28;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: router is not set).");
|
|
243
|
+
_context2.next = 31;
|
|
244
|
+
break;
|
|
245
|
+
case 28:
|
|
246
|
+
if (!(schema["currentRouter"].getRouterId() !== core.Internal.nextAppRouter.getRouterId())) {
|
|
247
|
+
_context2.next = 31;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: router is not the Next.js App Router).");
|
|
251
|
+
return _context2.abrupt("return", null);
|
|
252
|
+
case 31:
|
|
253
|
+
_context2.next = 33;
|
|
254
|
+
return Promise.resolve(params);
|
|
255
|
+
case 33:
|
|
256
|
+
resolvedParams = _context2.sent;
|
|
257
|
+
if (!(_typeof._typeof(resolvedParams) !== "object")) {
|
|
258
|
+
_context2.next = 37;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
console.error("Val: fetchValRoute must be used with a Val Module that is a s.record().router(...) (details: params is not an object).");
|
|
262
|
+
return _context2.abrupt("return", null);
|
|
263
|
+
case 37:
|
|
264
|
+
_Internal$splitModule = core.Internal.splitModuleFilePathAndModulePath(path), _Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 1), moduleFilePath = _Internal$splitModule2[0];
|
|
265
|
+
if (moduleFilePath.endsWith("page.val.ts") || moduleFilePath.endsWith("page.val.js")) {
|
|
266
|
+
_context2.next = 41;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
console.error("Val: fetchValRoute is used with a Val module that does not have a page.val.ts or page.val.js file. Make sure the Val module is in the same directory as your page.tsx or page.js file.");
|
|
270
|
+
return _context2.abrupt("return", null);
|
|
271
|
+
case 41:
|
|
272
|
+
srcFolder = internal.getNextAppRouterSourceFolder(moduleFilePath);
|
|
273
|
+
if (srcFolder) {
|
|
274
|
+
_context2.next = 45;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
console.error("Val: fetchValRoute was used with a Val module that is not in the /app or /src/app folder");
|
|
278
|
+
return _context2.abrupt("return", null);
|
|
279
|
+
case 45:
|
|
280
|
+
pattern = internal.getPatternFromModuleFilePath(moduleFilePath, srcFolder);
|
|
281
|
+
parsedPattern = internal.parseRoutePattern(pattern);
|
|
282
|
+
missingPatterns = [];
|
|
283
|
+
fullPathParts = [];
|
|
284
|
+
missingParamKeys = objectSpread2._objectSpread2({}, resolvedParams);
|
|
285
|
+
_iterator = createForOfIteratorHelper._createForOfIteratorHelper(parsedPattern !== null && parsedPattern !== void 0 ? parsedPattern : []);
|
|
286
|
+
try {
|
|
287
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
288
|
+
part = _step.value;
|
|
289
|
+
if (part.type === "literal") {
|
|
290
|
+
fullPathParts.push(part.name);
|
|
291
|
+
} else if (part.type === "array-param" || part.type === "string-param") {
|
|
292
|
+
value = resolvedParams[part.paramName];
|
|
293
|
+
if (typeof value !== "string" && !Array.isArray(value)) {
|
|
294
|
+
missingPatterns.push(part);
|
|
295
|
+
} else if (Array.isArray(value)) {
|
|
296
|
+
delete missingParamKeys[part.paramName];
|
|
297
|
+
fullPathParts.push(value.join("/"));
|
|
298
|
+
} else {
|
|
299
|
+
delete missingParamKeys[part.paramName];
|
|
300
|
+
fullPathParts.push(value);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} catch (err) {
|
|
305
|
+
_iterator.e(err);
|
|
306
|
+
} finally {
|
|
307
|
+
_iterator.f();
|
|
308
|
+
}
|
|
309
|
+
if (!(missingPatterns.length > 0)) {
|
|
310
|
+
_context2.next = 56;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
errorMessageParams = missingPatterns.map(function (part) {
|
|
314
|
+
if (part.type === "literal") {
|
|
315
|
+
return part.name;
|
|
316
|
+
} else if (part.type === "string-param") {
|
|
317
|
+
return "[".concat(part.paramName, "]");
|
|
318
|
+
} else if (part.type === "array-param") {
|
|
319
|
+
return "[...".concat(part.paramName, "]");
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
console.error("Val: fetchValRoute could not find route since parameters: ".concat(errorMessageParams.join(", "), " where not provided. Make sure the Val module is in the same directory as your page.tsx or page.js file and that the Val module filename is called page.val.ts or page.val.js."));
|
|
323
|
+
return _context2.abrupt("return", null);
|
|
324
|
+
case 56:
|
|
325
|
+
if (Object.keys(missingParamKeys).length > 0) {
|
|
326
|
+
console.error("Val: fetchValRoute could not find route since parameters: ".concat(Object.keys(missingParamKeys).join(", "), " where not found in the path of: ").concat(moduleFilePath, ". Make sure ").concat(moduleFilePath, " in the same directory as your page.tsx or page.js file."));
|
|
327
|
+
// We do not return null here since we found a route that matches the path
|
|
328
|
+
// though chances are that there's something wrong in the way fetchValRoute is used
|
|
329
|
+
}
|
|
330
|
+
fullPath = fullPathParts.join("/");
|
|
331
|
+
actualRoute = val["/".concat(fullPath)];
|
|
332
|
+
if (actualRoute) {
|
|
333
|
+
_context2.next = 61;
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
return _context2.abrupt("return", null);
|
|
337
|
+
case 61:
|
|
338
|
+
return _context2.abrupt("return", actualRoute);
|
|
339
|
+
case 62:
|
|
340
|
+
case "end":
|
|
341
|
+
return _context2.stop();
|
|
342
|
+
}
|
|
343
|
+
}, _callee2);
|
|
344
|
+
}));
|
|
345
|
+
return function (_x, _x2) {
|
|
346
|
+
return _ref2.apply(this, arguments);
|
|
347
|
+
};
|
|
348
|
+
}();
|
|
349
|
+
};
|
|
178
350
|
var valApiEndpoints = "/api/val";
|
|
179
351
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
180
352
|
function initValRsc(config, valModules, rscNextConfig) {
|
|
@@ -193,22 +365,6 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
193
365
|
}
|
|
194
366
|
}, config), config, {
|
|
195
367
|
isEnabled: function isEnabled() {
|
|
196
|
-
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee2() {
|
|
197
|
-
return asyncToGenerator._regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
198
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
199
|
-
case 0:
|
|
200
|
-
_context2.next = 2;
|
|
201
|
-
return rscNextConfig.draftMode();
|
|
202
|
-
case 2:
|
|
203
|
-
return _context2.abrupt("return", _context2.sent.isEnabled);
|
|
204
|
-
case 3:
|
|
205
|
-
case "end":
|
|
206
|
-
return _context2.stop();
|
|
207
|
-
}
|
|
208
|
-
}, _callee2);
|
|
209
|
-
}))();
|
|
210
|
-
},
|
|
211
|
-
onEnable: function onEnable() {
|
|
212
368
|
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee3() {
|
|
213
369
|
return asyncToGenerator._regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
214
370
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -216,7 +372,7 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
216
372
|
_context3.next = 2;
|
|
217
373
|
return rscNextConfig.draftMode();
|
|
218
374
|
case 2:
|
|
219
|
-
_context3.sent.
|
|
375
|
+
return _context3.abrupt("return", _context3.sent.isEnabled);
|
|
220
376
|
case 3:
|
|
221
377
|
case "end":
|
|
222
378
|
return _context3.stop();
|
|
@@ -224,7 +380,7 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
224
380
|
}, _callee3);
|
|
225
381
|
}))();
|
|
226
382
|
},
|
|
227
|
-
|
|
383
|
+
onEnable: function onEnable() {
|
|
228
384
|
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee4() {
|
|
229
385
|
return asyncToGenerator._regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
230
386
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -232,39 +388,42 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
232
388
|
_context4.next = 2;
|
|
233
389
|
return rscNextConfig.draftMode();
|
|
234
390
|
case 2:
|
|
235
|
-
_context4.sent.
|
|
391
|
+
_context4.sent.enable();
|
|
236
392
|
case 3:
|
|
237
393
|
case "end":
|
|
238
394
|
return _context4.stop();
|
|
239
395
|
}
|
|
240
396
|
}, _callee4);
|
|
241
397
|
}))();
|
|
398
|
+
},
|
|
399
|
+
onDisable: function onDisable() {
|
|
400
|
+
return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee5() {
|
|
401
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
402
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
403
|
+
case 0:
|
|
404
|
+
_context5.next = 2;
|
|
405
|
+
return rscNextConfig.draftMode();
|
|
406
|
+
case 2:
|
|
407
|
+
_context5.sent.disable();
|
|
408
|
+
case 3:
|
|
409
|
+
case "end":
|
|
410
|
+
return _context5.stop();
|
|
411
|
+
}
|
|
412
|
+
}, _callee5);
|
|
413
|
+
}))();
|
|
242
414
|
}
|
|
243
415
|
});
|
|
244
416
|
return {
|
|
245
417
|
fetchValStega: initFetchValStega(config, valApiEndpoints,
|
|
246
418
|
// TODO: get from config
|
|
247
|
-
valServerPromise, /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function
|
|
248
|
-
return asyncToGenerator._regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
249
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
250
|
-
case 0:
|
|
251
|
-
_context5.next = 2;
|
|
252
|
-
return rscNextConfig.draftMode();
|
|
253
|
-
case 2:
|
|
254
|
-
return _context5.abrupt("return", _context5.sent.isEnabled);
|
|
255
|
-
case 3:
|
|
256
|
-
case "end":
|
|
257
|
-
return _context5.stop();
|
|
258
|
-
}
|
|
259
|
-
}, _callee5);
|
|
260
|
-
})), /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee6() {
|
|
419
|
+
valServerPromise, /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee6() {
|
|
261
420
|
return asyncToGenerator._regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
262
421
|
while (1) switch (_context6.prev = _context6.next) {
|
|
263
422
|
case 0:
|
|
264
423
|
_context6.next = 2;
|
|
265
|
-
return rscNextConfig.
|
|
424
|
+
return rscNextConfig.draftMode();
|
|
266
425
|
case 2:
|
|
267
|
-
return _context6.abrupt("return", _context6.sent);
|
|
426
|
+
return _context6.abrupt("return", _context6.sent.isEnabled);
|
|
268
427
|
case 3:
|
|
269
428
|
case "end":
|
|
270
429
|
return _context6.stop();
|
|
@@ -275,7 +434,7 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
275
434
|
while (1) switch (_context7.prev = _context7.next) {
|
|
276
435
|
case 0:
|
|
277
436
|
_context7.next = 2;
|
|
278
|
-
return rscNextConfig.
|
|
437
|
+
return rscNextConfig.headers();
|
|
279
438
|
case 2:
|
|
280
439
|
return _context7.abrupt("return", _context7.sent);
|
|
281
440
|
case 3:
|
|
@@ -283,6 +442,59 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
283
442
|
return _context7.stop();
|
|
284
443
|
}
|
|
285
444
|
}, _callee7);
|
|
445
|
+
})), /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee8() {
|
|
446
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
447
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
448
|
+
case 0:
|
|
449
|
+
_context8.next = 2;
|
|
450
|
+
return rscNextConfig.cookies();
|
|
451
|
+
case 2:
|
|
452
|
+
return _context8.abrupt("return", _context8.sent);
|
|
453
|
+
case 3:
|
|
454
|
+
case "end":
|
|
455
|
+
return _context8.stop();
|
|
456
|
+
}
|
|
457
|
+
}, _callee8);
|
|
458
|
+
}))),
|
|
459
|
+
fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee9() {
|
|
460
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
461
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
462
|
+
case 0:
|
|
463
|
+
_context9.next = 2;
|
|
464
|
+
return rscNextConfig.draftMode();
|
|
465
|
+
case 2:
|
|
466
|
+
return _context9.abrupt("return", _context9.sent.isEnabled);
|
|
467
|
+
case 3:
|
|
468
|
+
case "end":
|
|
469
|
+
return _context9.stop();
|
|
470
|
+
}
|
|
471
|
+
}, _callee9);
|
|
472
|
+
})), /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee10() {
|
|
473
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
474
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
475
|
+
case 0:
|
|
476
|
+
_context10.next = 2;
|
|
477
|
+
return rscNextConfig.headers();
|
|
478
|
+
case 2:
|
|
479
|
+
return _context10.abrupt("return", _context10.sent);
|
|
480
|
+
case 3:
|
|
481
|
+
case "end":
|
|
482
|
+
return _context10.stop();
|
|
483
|
+
}
|
|
484
|
+
}, _callee10);
|
|
485
|
+
})), /*#__PURE__*/asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee11() {
|
|
486
|
+
return asyncToGenerator._regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
487
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
488
|
+
case 0:
|
|
489
|
+
_context11.next = 2;
|
|
490
|
+
return rscNextConfig.cookies();
|
|
491
|
+
case 2:
|
|
492
|
+
return _context11.abrupt("return", _context11.sent);
|
|
493
|
+
case 3:
|
|
494
|
+
case "end":
|
|
495
|
+
return _context11.stop();
|
|
496
|
+
}
|
|
497
|
+
}, _callee11);
|
|
286
498
|
})))
|
|
287
499
|
};
|
|
288
500
|
}
|