@valbuild/next 0.83.0 → 0.84.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/client/dist/valbuild-next-client.cjs.dev.js +26 -2
- package/client/dist/valbuild-next-client.cjs.prod.js +26 -2
- package/client/dist/valbuild-next-client.esm.js +26 -2
- 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/client/initValClient.d.ts +4 -1
- 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/initValRouteFromVal-12bdc5f5.cjs.dev.js +116 -0
- package/dist/initValRouteFromVal-b9806908.cjs.prod.js +116 -0
- package/dist/initValRouteFromVal-d84b3563.esm.js +114 -0
- 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 +119 -36
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +119 -36
- package/rsc/dist/valbuild-next-rsc.esm.js +119 -36
- package/dist/ValNextProvider-9ff1bb92.cjs.js +0 -7
- package/dist/ValOverlayContext-811e9be9.cjs.js +0 -7
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('client-only');
|
|
6
|
+
var core = require('@valbuild/core');
|
|
6
7
|
var stega = require('@valbuild/react/stega');
|
|
7
8
|
var React = require('react');
|
|
8
|
-
var ValOverlayContext = require('../../dist/ValOverlayContext-
|
|
9
|
+
var ValOverlayContext = require('../../dist/ValOverlayContext-c82a4507.cjs.dev.js');
|
|
10
|
+
var initValRouteFromVal = require('../../dist/initValRouteFromVal-12bdc5f5.cjs.dev.js');
|
|
11
|
+
require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
12
|
+
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
13
|
+
require('../../dist/objectSpread2-792eb2c2.cjs.dev.js');
|
|
14
|
+
require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
15
|
+
require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
16
|
+
require('@valbuild/shared/internal');
|
|
9
17
|
|
|
10
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
11
19
|
|
|
@@ -33,11 +41,27 @@ function useValStega(selector) {
|
|
|
33
41
|
}
|
|
34
42
|
});
|
|
35
43
|
}
|
|
44
|
+
function useValRouteStega(selector, params) {
|
|
45
|
+
var val = useValStega(selector);
|
|
46
|
+
var resolvedParams = "then" in params ? undefined : params;
|
|
47
|
+
if ("then" in params) {
|
|
48
|
+
if ("use" in React__default["default"]) {
|
|
49
|
+
// This feels fairly safe: use should be possible to use inside if (?) and the if should most likely
|
|
50
|
+
resolvedParams = React__default["default"].use(params);
|
|
51
|
+
} else {
|
|
52
|
+
console.error("Val: useValRoute params argument was promise, but the React.use hook is available. Please resolve the promise before passing it to useValRoute (or upgrade to React 19+).");
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var route = initValRouteFromVal.initValRouteFromVal(resolvedParams || {}, "useValRoute", selector && core.Internal.getValPath(selector), selector && core.Internal.getSchema(selector), val);
|
|
57
|
+
return route;
|
|
58
|
+
}
|
|
36
59
|
|
|
37
60
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
61
|
function initValClient(config) {
|
|
39
62
|
return {
|
|
40
|
-
useValStega: useValStega
|
|
63
|
+
useValStega: useValStega,
|
|
64
|
+
useValRouteStega: useValRouteStega
|
|
41
65
|
};
|
|
42
66
|
}
|
|
43
67
|
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('client-only');
|
|
6
|
+
var core = require('@valbuild/core');
|
|
6
7
|
var stega = require('@valbuild/react/stega');
|
|
7
8
|
var React = require('react');
|
|
8
|
-
var ValOverlayContext = require('../../dist/ValOverlayContext-
|
|
9
|
+
var ValOverlayContext = require('../../dist/ValOverlayContext-942f1294.cjs.prod.js');
|
|
10
|
+
var initValRouteFromVal = require('../../dist/initValRouteFromVal-b9806908.cjs.prod.js');
|
|
11
|
+
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
12
|
+
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
13
|
+
require('../../dist/objectSpread2-3c87fb4f.cjs.prod.js');
|
|
14
|
+
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
15
|
+
require('../../dist/typeof-16428c61.cjs.prod.js');
|
|
16
|
+
require('@valbuild/shared/internal');
|
|
9
17
|
|
|
10
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
11
19
|
|
|
@@ -33,11 +41,27 @@ function useValStega(selector) {
|
|
|
33
41
|
}
|
|
34
42
|
});
|
|
35
43
|
}
|
|
44
|
+
function useValRouteStega(selector, params) {
|
|
45
|
+
var val = useValStega(selector);
|
|
46
|
+
var resolvedParams = "then" in params ? undefined : params;
|
|
47
|
+
if ("then" in params) {
|
|
48
|
+
if ("use" in React__default["default"]) {
|
|
49
|
+
// This feels fairly safe: use should be possible to use inside if (?) and the if should most likely
|
|
50
|
+
resolvedParams = React__default["default"].use(params);
|
|
51
|
+
} else {
|
|
52
|
+
console.error("Val: useValRoute params argument was promise, but the React.use hook is available. Please resolve the promise before passing it to useValRoute (or upgrade to React 19+).");
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var route = initValRouteFromVal.initValRouteFromVal(resolvedParams || {}, "useValRoute", selector && core.Internal.getValPath(selector), selector && core.Internal.getSchema(selector), val);
|
|
57
|
+
return route;
|
|
58
|
+
}
|
|
36
59
|
|
|
37
60
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
61
|
function initValClient(config) {
|
|
39
62
|
return {
|
|
40
|
-
useValStega: useValStega
|
|
63
|
+
useValStega: useValStega,
|
|
64
|
+
useValRouteStega: useValRouteStega
|
|
41
65
|
};
|
|
42
66
|
}
|
|
43
67
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import 'client-only';
|
|
2
|
+
import { Internal } from '@valbuild/core';
|
|
2
3
|
import { getModuleIds, stegaEncode } from '@valbuild/react/stega';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { useValOverlayContext } from '../../dist/ValOverlayContext-
|
|
5
|
+
import { useValOverlayContext } from '../../dist/ValOverlayContext-6635a4d7.esm.js';
|
|
6
|
+
import { i as initValRouteFromVal } from '../../dist/initValRouteFromVal-d84b3563.esm.js';
|
|
7
|
+
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
8
|
+
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
9
|
+
import '../../dist/objectSpread2-c1340c1c.esm.js';
|
|
10
|
+
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
11
|
+
import '../../dist/typeof-a1531d8f.esm.js';
|
|
12
|
+
import '@valbuild/shared/internal';
|
|
5
13
|
|
|
6
14
|
function useValStega(selector) {
|
|
7
15
|
var valOverlayContext = useValOverlayContext();
|
|
@@ -25,11 +33,27 @@ function useValStega(selector) {
|
|
|
25
33
|
}
|
|
26
34
|
});
|
|
27
35
|
}
|
|
36
|
+
function useValRouteStega(selector, params) {
|
|
37
|
+
var val = useValStega(selector);
|
|
38
|
+
var resolvedParams = "then" in params ? undefined : params;
|
|
39
|
+
if ("then" in params) {
|
|
40
|
+
if ("use" in React) {
|
|
41
|
+
// This feels fairly safe: use should be possible to use inside if (?) and the if should most likely
|
|
42
|
+
resolvedParams = React.use(params);
|
|
43
|
+
} else {
|
|
44
|
+
console.error("Val: useValRoute params argument was promise, but the React.use hook is available. Please resolve the promise before passing it to useValRoute (or upgrade to React 19+).");
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var route = initValRouteFromVal(resolvedParams || {}, "useValRoute", selector && Internal.getValPath(selector), selector && Internal.getSchema(selector), val);
|
|
49
|
+
return route;
|
|
50
|
+
}
|
|
28
51
|
|
|
29
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
53
|
function initValClient(config) {
|
|
31
54
|
return {
|
|
32
|
-
useValStega: useValStega
|
|
55
|
+
useValStega: useValStega,
|
|
56
|
+
useValRouteStega: useValRouteStega
|
|
33
57
|
};
|
|
34
58
|
}
|
|
35
59
|
|
|
@@ -6,7 +6,7 @@ import { VERSION, VAL_APP_PATH, VAL_OVERLAY_ID } from '@valbuild/ui';
|
|
|
6
6
|
import { useRouter } from 'next/navigation';
|
|
7
7
|
import Script from 'next/script';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { ValExternalStore, ValOverlayProvider } from './ValOverlayContext-
|
|
9
|
+
import { ValExternalStore, ValOverlayProvider } from './ValOverlayContext-6635a4d7.esm.js';
|
|
10
10
|
import { SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
11
11
|
import { createValClient } from '@valbuild/shared/internal';
|
|
12
12
|
import { u as useRemoteConfigSender } from './useRemoteConfigSender-02451801.esm.js';
|
|
@@ -256,7 +256,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
256
256
|
}), /*#__PURE__*/jsx("div", {
|
|
257
257
|
className: getPositionClassName(dropZone) + " p-4",
|
|
258
258
|
children: /*#__PURE__*/jsx("div", {
|
|
259
|
-
className: "flex
|
|
259
|
+
className: "flex justify-center items-center p-2 text-white bg-black rounded backdrop-blur",
|
|
260
260
|
children: /*#__PURE__*/jsx(Clock, {
|
|
261
261
|
className: "animate-spin",
|
|
262
262
|
size: 16
|
|
@@ -10,7 +10,7 @@ var ui = require('@valbuild/ui');
|
|
|
10
10
|
var navigation = require('next/navigation');
|
|
11
11
|
var Script = require('next/script');
|
|
12
12
|
var React = require('react');
|
|
13
|
-
var ValOverlayContext = require('./ValOverlayContext-
|
|
13
|
+
var ValOverlayContext = require('./ValOverlayContext-942f1294.cjs.prod.js');
|
|
14
14
|
var stega = require('@valbuild/react/stega');
|
|
15
15
|
var internal = require('@valbuild/shared/internal');
|
|
16
16
|
var useRemoteConfigSender = require('./useRemoteConfigSender-3ea2fe91.cjs.prod.js');
|
|
@@ -265,7 +265,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
265
265
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
266
266
|
className: getPositionClassName(dropZone) + " p-4",
|
|
267
267
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
268
|
-
className: "flex
|
|
268
|
+
className: "flex justify-center items-center p-2 text-white bg-black rounded backdrop-blur",
|
|
269
269
|
children: /*#__PURE__*/jsxRuntime.jsx(Clock, {
|
|
270
270
|
className: "animate-spin",
|
|
271
271
|
size: 16
|
|
@@ -10,7 +10,7 @@ var ui = require('@valbuild/ui');
|
|
|
10
10
|
var navigation = require('next/navigation');
|
|
11
11
|
var Script = require('next/script');
|
|
12
12
|
var React = require('react');
|
|
13
|
-
var ValOverlayContext = require('./ValOverlayContext-
|
|
13
|
+
var ValOverlayContext = require('./ValOverlayContext-c82a4507.cjs.dev.js');
|
|
14
14
|
var stega = require('@valbuild/react/stega');
|
|
15
15
|
var internal = require('@valbuild/shared/internal');
|
|
16
16
|
var useRemoteConfigSender = require('./useRemoteConfigSender-c78b81c5.cjs.dev.js');
|
|
@@ -265,7 +265,7 @@ var ValNextProvider = function ValNextProvider(props) {
|
|
|
265
265
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
266
266
|
className: getPositionClassName(dropZone) + " p-4",
|
|
267
267
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
268
|
-
className: "flex
|
|
268
|
+
className: "flex justify-center items-center p-2 text-white bg-black rounded backdrop-blur",
|
|
269
269
|
children: /*#__PURE__*/jsxRuntime.jsx(Clock, {
|
|
270
270
|
className: "animate-spin",
|
|
271
271
|
size: 16
|
|
@@ -1,57 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { _ as
|
|
2
|
+
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
3
3
|
import { b as _toPropertyKey, _ as _objectSpread2, a as _defineProperty } from './objectSpread2-c1340c1c.esm.js';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function _createForOfIteratorHelper(r, e) {
|
|
8
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
9
|
-
if (!t) {
|
|
10
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
11
|
-
t && (r = t);
|
|
12
|
-
var n = 0,
|
|
13
|
-
F = function () {};
|
|
14
|
-
return {
|
|
15
|
-
s: F,
|
|
16
|
-
n: function () {
|
|
17
|
-
return n >= r.length ? {
|
|
18
|
-
done: !0
|
|
19
|
-
} : {
|
|
20
|
-
done: !1,
|
|
21
|
-
value: r[n++]
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
e: function (r) {
|
|
25
|
-
throw r;
|
|
26
|
-
},
|
|
27
|
-
f: F
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
31
|
-
}
|
|
32
|
-
var o,
|
|
33
|
-
a = !0,
|
|
34
|
-
u = !1;
|
|
35
|
-
return {
|
|
36
|
-
s: function () {
|
|
37
|
-
t = t.call(r);
|
|
38
|
-
},
|
|
39
|
-
n: function () {
|
|
40
|
-
var r = t.next();
|
|
41
|
-
return a = r.done, r;
|
|
42
|
-
},
|
|
43
|
-
e: function (r) {
|
|
44
|
-
u = !0, o = r;
|
|
45
|
-
},
|
|
46
|
-
f: function () {
|
|
47
|
-
try {
|
|
48
|
-
a || null == t.return || t.return();
|
|
49
|
-
} finally {
|
|
50
|
-
if (u) throw o;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
6
|
+
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
55
7
|
|
|
56
8
|
function _classCallCheck(a, n) {
|
|
57
9
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
package/dist/{ValOverlayContext-811e9be9.cjs.prod.js → ValOverlayContext-942f1294.cjs.prod.js}
RENAMED
|
@@ -3,64 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
7
7
|
var objectSpread2 = require('./objectSpread2-3c87fb4f.cjs.prod.js');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
10
11
|
|
|
11
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
12
13
|
|
|
13
14
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
15
|
|
|
15
|
-
function _createForOfIteratorHelper(r, e) {
|
|
16
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17
|
-
if (!t) {
|
|
18
|
-
if (Array.isArray(r) || (t = unsupportedIterableToArray._unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
19
|
-
t && (r = t);
|
|
20
|
-
var n = 0,
|
|
21
|
-
F = function () {};
|
|
22
|
-
return {
|
|
23
|
-
s: F,
|
|
24
|
-
n: function () {
|
|
25
|
-
return n >= r.length ? {
|
|
26
|
-
done: !0
|
|
27
|
-
} : {
|
|
28
|
-
done: !1,
|
|
29
|
-
value: r[n++]
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
e: function (r) {
|
|
33
|
-
throw r;
|
|
34
|
-
},
|
|
35
|
-
f: F
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
39
|
-
}
|
|
40
|
-
var o,
|
|
41
|
-
a = !0,
|
|
42
|
-
u = !1;
|
|
43
|
-
return {
|
|
44
|
-
s: function () {
|
|
45
|
-
t = t.call(r);
|
|
46
|
-
},
|
|
47
|
-
n: function () {
|
|
48
|
-
var r = t.next();
|
|
49
|
-
return a = r.done, r;
|
|
50
|
-
},
|
|
51
|
-
e: function (r) {
|
|
52
|
-
u = !0, o = r;
|
|
53
|
-
},
|
|
54
|
-
f: function () {
|
|
55
|
-
try {
|
|
56
|
-
a || null == t.return || t.return();
|
|
57
|
-
} finally {
|
|
58
|
-
if (u) throw o;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
16
|
function _classCallCheck(a, n) {
|
|
65
17
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
66
18
|
}
|
|
@@ -129,7 +81,7 @@ var ValExternalStore = /*#__PURE__*/function () {
|
|
|
129
81
|
}, {
|
|
130
82
|
key: "emitChange",
|
|
131
83
|
value: function emitChange(subscriberId) {
|
|
132
|
-
var _iterator = _createForOfIteratorHelper(this.listeners[subscriberId]),
|
|
84
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(this.listeners[subscriberId]),
|
|
133
85
|
_step;
|
|
134
86
|
try {
|
|
135
87
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
package/dist/{ValOverlayContext-55dae3ea.cjs.dev.js → ValOverlayContext-c82a4507.cjs.dev.js}
RENAMED
|
@@ -3,64 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
7
7
|
var objectSpread2 = require('./objectSpread2-792eb2c2.cjs.dev.js');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
10
11
|
|
|
11
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
12
13
|
|
|
13
14
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
15
|
|
|
15
|
-
function _createForOfIteratorHelper(r, e) {
|
|
16
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17
|
-
if (!t) {
|
|
18
|
-
if (Array.isArray(r) || (t = unsupportedIterableToArray._unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
19
|
-
t && (r = t);
|
|
20
|
-
var n = 0,
|
|
21
|
-
F = function () {};
|
|
22
|
-
return {
|
|
23
|
-
s: F,
|
|
24
|
-
n: function () {
|
|
25
|
-
return n >= r.length ? {
|
|
26
|
-
done: !0
|
|
27
|
-
} : {
|
|
28
|
-
done: !1,
|
|
29
|
-
value: r[n++]
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
e: function (r) {
|
|
33
|
-
throw r;
|
|
34
|
-
},
|
|
35
|
-
f: F
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
39
|
-
}
|
|
40
|
-
var o,
|
|
41
|
-
a = !0,
|
|
42
|
-
u = !1;
|
|
43
|
-
return {
|
|
44
|
-
s: function () {
|
|
45
|
-
t = t.call(r);
|
|
46
|
-
},
|
|
47
|
-
n: function () {
|
|
48
|
-
var r = t.next();
|
|
49
|
-
return a = r.done, r;
|
|
50
|
-
},
|
|
51
|
-
e: function (r) {
|
|
52
|
-
u = !0, o = r;
|
|
53
|
-
},
|
|
54
|
-
f: function () {
|
|
55
|
-
try {
|
|
56
|
-
a || null == t.return || t.return();
|
|
57
|
-
} finally {
|
|
58
|
-
if (u) throw o;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
16
|
function _classCallCheck(a, n) {
|
|
65
17
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
66
18
|
}
|
|
@@ -129,7 +81,7 @@ var ValExternalStore = /*#__PURE__*/function () {
|
|
|
129
81
|
}, {
|
|
130
82
|
key: "emitChange",
|
|
131
83
|
value: function emitChange(subscriberId) {
|
|
132
|
-
var _iterator = _createForOfIteratorHelper(this.listeners[subscriberId]),
|
|
84
|
+
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(this.listeners[subscriberId]),
|
|
133
85
|
_step;
|
|
134
86
|
try {
|
|
135
87
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var unsupportedIterableToArray = require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
4
|
+
|
|
5
|
+
function _createForOfIteratorHelper(r, e) {
|
|
6
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7
|
+
if (!t) {
|
|
8
|
+
if (Array.isArray(r) || (t = unsupportedIterableToArray._unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
9
|
+
t && (r = t);
|
|
10
|
+
var n = 0,
|
|
11
|
+
F = function () {};
|
|
12
|
+
return {
|
|
13
|
+
s: F,
|
|
14
|
+
n: function () {
|
|
15
|
+
return n >= r.length ? {
|
|
16
|
+
done: !0
|
|
17
|
+
} : {
|
|
18
|
+
done: !1,
|
|
19
|
+
value: r[n++]
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
e: function (r) {
|
|
23
|
+
throw r;
|
|
24
|
+
},
|
|
25
|
+
f: F
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
29
|
+
}
|
|
30
|
+
var o,
|
|
31
|
+
a = !0,
|
|
32
|
+
u = !1;
|
|
33
|
+
return {
|
|
34
|
+
s: function () {
|
|
35
|
+
t = t.call(r);
|
|
36
|
+
},
|
|
37
|
+
n: function () {
|
|
38
|
+
var r = t.next();
|
|
39
|
+
return a = r.done, r;
|
|
40
|
+
},
|
|
41
|
+
e: function (r) {
|
|
42
|
+
u = !0, o = r;
|
|
43
|
+
},
|
|
44
|
+
f: function () {
|
|
45
|
+
try {
|
|
46
|
+
a || null == t.return || t.return();
|
|
47
|
+
} finally {
|
|
48
|
+
if (u) throw o;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports._createForOfIteratorHelper = _createForOfIteratorHelper;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
2
|
+
|
|
3
|
+
function _createForOfIteratorHelper(r, e) {
|
|
4
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
5
|
+
if (!t) {
|
|
6
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
7
|
+
t && (r = t);
|
|
8
|
+
var n = 0,
|
|
9
|
+
F = function () {};
|
|
10
|
+
return {
|
|
11
|
+
s: F,
|
|
12
|
+
n: function () {
|
|
13
|
+
return n >= r.length ? {
|
|
14
|
+
done: !0
|
|
15
|
+
} : {
|
|
16
|
+
done: !1,
|
|
17
|
+
value: r[n++]
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
e: function (r) {
|
|
21
|
+
throw r;
|
|
22
|
+
},
|
|
23
|
+
f: F
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
27
|
+
}
|
|
28
|
+
var o,
|
|
29
|
+
a = !0,
|
|
30
|
+
u = !1;
|
|
31
|
+
return {
|
|
32
|
+
s: function () {
|
|
33
|
+
t = t.call(r);
|
|
34
|
+
},
|
|
35
|
+
n: function () {
|
|
36
|
+
var r = t.next();
|
|
37
|
+
return a = r.done, r;
|
|
38
|
+
},
|
|
39
|
+
e: function (r) {
|
|
40
|
+
u = !0, o = r;
|
|
41
|
+
},
|
|
42
|
+
f: function () {
|
|
43
|
+
try {
|
|
44
|
+
a || null == t.return || t.return();
|
|
45
|
+
} finally {
|
|
46
|
+
if (u) throw o;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { _createForOfIteratorHelper as _ };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var unsupportedIterableToArray = require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
4
|
+
|
|
5
|
+
function _createForOfIteratorHelper(r, e) {
|
|
6
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7
|
+
if (!t) {
|
|
8
|
+
if (Array.isArray(r) || (t = unsupportedIterableToArray._unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
9
|
+
t && (r = t);
|
|
10
|
+
var n = 0,
|
|
11
|
+
F = function () {};
|
|
12
|
+
return {
|
|
13
|
+
s: F,
|
|
14
|
+
n: function () {
|
|
15
|
+
return n >= r.length ? {
|
|
16
|
+
done: !0
|
|
17
|
+
} : {
|
|
18
|
+
done: !1,
|
|
19
|
+
value: r[n++]
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
e: function (r) {
|
|
23
|
+
throw r;
|
|
24
|
+
},
|
|
25
|
+
f: F
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
29
|
+
}
|
|
30
|
+
var o,
|
|
31
|
+
a = !0,
|
|
32
|
+
u = !1;
|
|
33
|
+
return {
|
|
34
|
+
s: function () {
|
|
35
|
+
t = t.call(r);
|
|
36
|
+
},
|
|
37
|
+
n: function () {
|
|
38
|
+
var r = t.next();
|
|
39
|
+
return a = r.done, r;
|
|
40
|
+
},
|
|
41
|
+
e: function (r) {
|
|
42
|
+
u = !0, o = r;
|
|
43
|
+
},
|
|
44
|
+
f: function () {
|
|
45
|
+
try {
|
|
46
|
+
a || null == t.return || t.return();
|
|
47
|
+
} finally {
|
|
48
|
+
if (u) throw o;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports._createForOfIteratorHelper = _createForOfIteratorHelper;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { GenericSelector, SelectorOf, SelectorSource } from "@valbuild/core";
|
|
1
|
+
import { GenericSelector, SelectorOf, SelectorSource, SourceObject, ValModule } from "@valbuild/core";
|
|
2
2
|
import { StegaOfSource } from "@valbuild/react/stega";
|
|
3
3
|
import { ValConfig } from "@valbuild/core";
|
|
4
4
|
export type UseValType<T extends SelectorSource> = SelectorOf<T> extends GenericSelector<infer S> ? StegaOfSource<S> : never;
|
|
5
5
|
declare function useValStega<T extends SelectorSource>(selector: T): UseValType<T>;
|
|
6
|
+
type UseValRouteReturnType<T extends ValModule<GenericSelector<SourceObject>>> = T extends ValModule<infer S> ? S extends SourceObject ? StegaOfSource<NonNullable<S>[string]> | null : never : never;
|
|
7
|
+
declare function useValRouteStega<T extends ValModule<GenericSelector<SourceObject>>>(selector: T, params: Record<string, string | string[]> | Promise<Record<string, string | string[]>>): UseValRouteReturnType<T>;
|
|
6
8
|
export declare function initValClient(config: ValConfig): {
|
|
7
9
|
useValStega: typeof useValStega;
|
|
10
|
+
useValRouteStega: typeof useValRouteStega;
|
|
8
11
|
};
|
|
9
12
|
export {};
|
|
@@ -34,6 +34,7 @@ export declare const Internal: {
|
|
|
34
34
|
safeResolvePath: typeof import("@valbuild/core/dist/declarations/src/module").safeResolvePath;
|
|
35
35
|
splitModuleFilePathAndModulePath: typeof import("@valbuild/core/dist/declarations/src/module").splitModuleFilePathAndModulePath;
|
|
36
36
|
joinModuleFilePathAndModulePath: typeof import("@valbuild/core/dist/declarations/src/module").joinModuleFilePathAndModulePath;
|
|
37
|
+
nextAppRouter: import("@valbuild/core").ValRouter;
|
|
37
38
|
remote: {
|
|
38
39
|
createRemoteRef: typeof import("@valbuild/core/dist/declarations/src/source/remote").createRemoteRef;
|
|
39
40
|
getValidationBasis: typeof import("@valbuild/core/dist/declarations/src/remote/validationBasis").getValidationBasis;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type ValConfig, type InitVal, type ValConstructor, ValModule, SelectorSource, Json } from "@valbuild/core";
|
|
1
|
+
import { type ValConfig, type InitVal, type ValConstructor, ValModule, SelectorSource, Json, ValRouter } from "@valbuild/core";
|
|
2
2
|
import { raw } from "./raw.js";
|
|
3
3
|
import { getUnpatchedUnencodedVal } from "./getUnpatchedUnencodedVal.js";
|
|
4
4
|
import { decodeValPathOfString } from "./decodeValPathOfString.js";
|
|
5
5
|
type ValAttrs = {
|
|
6
6
|
"data-val-path"?: string;
|
|
7
7
|
};
|
|
8
|
+
declare const nextAppRouter: ValRouter;
|
|
8
9
|
export declare const initVal: (config?: ValConfig) => InitVal & {
|
|
9
10
|
val: ValConstructor & {
|
|
10
11
|
/**
|
|
@@ -24,5 +25,6 @@ export declare const initVal: (config?: ValConfig) => InitVal & {
|
|
|
24
25
|
attrs: <T extends ValModule<SelectorSource> | Json>(target: T) => ValAttrs;
|
|
25
26
|
unstable_decodeValPathOfString: typeof decodeValPathOfString;
|
|
26
27
|
};
|
|
28
|
+
nextAppRouter: ValRouter;
|
|
27
29
|
};
|
|
28
30
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StegaOfSource } from "@valbuild/react/stega";
|
|
2
|
-
import { SelectorSource, SelectorOf, GenericSelector, ValConfig, ValModules } from "@valbuild/core";
|
|
2
|
+
import { SelectorSource, SelectorOf, GenericSelector, ValConfig, ValModules, ValModule, SourceObject } from "@valbuild/core";
|
|
3
3
|
import { cookies, draftMode, headers } from "next/headers";
|
|
4
4
|
import { ValServer } from "@valbuild/server";
|
|
5
5
|
declare const initFetchValStega: (config: ValConfig, valApiEndpoints: string, valServerPromise: Promise<ValServer>, isEnabled: () => Promise<boolean>, getHeaders: () => Promise<{
|
|
@@ -10,6 +10,15 @@ declare const initFetchValStega: (config: ValConfig, valApiEndpoints: string, va
|
|
|
10
10
|
value: string;
|
|
11
11
|
} | undefined;
|
|
12
12
|
}>) => <T extends SelectorSource>(selector: T) => Promise<SelectorOf<T> extends GenericSelector<infer S extends import("@valbuild/core").Source, undefined> ? StegaOfSource<S> : never>;
|
|
13
|
+
type FetchValRouteReturnType<T extends ValModule<GenericSelector<SourceObject>>> = T extends ValModule<infer S> ? S extends SourceObject ? StegaOfSource<NonNullable<S>[string]> | null : never : never;
|
|
14
|
+
declare const initFetchValRouteStega: (config: ValConfig, valApiEndpoints: string, valServerPromise: Promise<ValServer>, isEnabled: () => Promise<boolean>, getHeaders: () => Promise<{
|
|
15
|
+
get(name: string): string | null;
|
|
16
|
+
}>, getCookies: () => Promise<{
|
|
17
|
+
get(name: string): {
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}>) => <T extends ValModule<GenericSelector<SourceObject, undefined>>>(selector: T, params: Promise<Record<string, string | string[]>> | Record<string, string | string[]>) => Promise<FetchValRouteReturnType<T>>;
|
|
13
22
|
type ValNextRscConfig = {
|
|
14
23
|
draftMode: typeof draftMode;
|
|
15
24
|
headers: typeof headers;
|
|
@@ -17,5 +26,6 @@ type ValNextRscConfig = {
|
|
|
17
26
|
};
|
|
18
27
|
export declare function initValRsc(config: ValConfig, valModules: ValModules, rscNextConfig: ValNextRscConfig): {
|
|
19
28
|
fetchValStega: ReturnType<typeof initFetchValStega>;
|
|
29
|
+
fetchValRouteStega: ReturnType<typeof initFetchValRouteStega>;
|
|
20
30
|
};
|
|
21
31
|
export {};
|