@valbuild/next 0.91.1 → 0.91.2
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 -2
- package/client/dist/valbuild-next-client.cjs.prod.js +1 -2
- package/client/dist/valbuild-next-client.esm.js +1 -2
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +1 -1
- package/dist/declarations/src/initVal.d.ts +2 -2
- package/dist/{routeFromVal-248c62f1.esm.js → routeFromVal-7d9046e9.esm.js} +10 -1
- package/dist/{routeFromVal-a317debc.cjs.prod.js → routeFromVal-7d9ac291.cjs.prod.js} +14 -5
- package/dist/{routeFromVal-a3987ae3.cjs.dev.js → routeFromVal-c46c1288.cjs.dev.js} +14 -5
- package/dist/valbuild-next.cjs.dev.js +5 -64
- package/dist/valbuild-next.cjs.prod.js +5 -64
- package/dist/valbuild-next.esm.js +2 -61
- package/package.json +6 -6
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +1 -2
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +1 -2
- package/rsc/dist/valbuild-next-rsc.esm.js +1 -2
- package/dist/declarations/src/attrs.d.ts +0 -4
- package/dist/declarations/src/raw.d.ts +0 -8
- package/dist/typeof-16428c61.cjs.prod.js +0 -13
- package/dist/typeof-a1531d8f.esm.js +0 -11
- package/dist/typeof-b568f48f.cjs.dev.js +0 -13
|
@@ -7,12 +7,11 @@ var core = require('@valbuild/core');
|
|
|
7
7
|
var stega = require('@valbuild/react/stega');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var ValOverlayContext = require('../../dist/ValOverlayContext-c82a4507.cjs.dev.js');
|
|
10
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
10
|
+
var routeFromVal = require('../../dist/routeFromVal-c46c1288.cjs.dev.js');
|
|
11
11
|
require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
12
12
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
13
13
|
require('../../dist/objectSpread2-792eb2c2.cjs.dev.js');
|
|
14
14
|
require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
15
|
-
require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
16
15
|
require('@valbuild/shared/internal');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -7,12 +7,11 @@ var core = require('@valbuild/core');
|
|
|
7
7
|
var stega = require('@valbuild/react/stega');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var ValOverlayContext = require('../../dist/ValOverlayContext-942f1294.cjs.prod.js');
|
|
10
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
10
|
+
var routeFromVal = require('../../dist/routeFromVal-7d9ac291.cjs.prod.js');
|
|
11
11
|
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
12
12
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
13
13
|
require('../../dist/objectSpread2-3c87fb4f.cjs.prod.js');
|
|
14
14
|
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
15
|
-
require('../../dist/typeof-16428c61.cjs.prod.js');
|
|
16
15
|
require('@valbuild/shared/internal');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -3,12 +3,11 @@ import { Internal } from '@valbuild/core';
|
|
|
3
3
|
import { getModuleIds, stegaEncode } from '@valbuild/react/stega';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useValOverlayContext } from '../../dist/ValOverlayContext-6635a4d7.esm.js';
|
|
6
|
-
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-
|
|
6
|
+
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-7d9046e9.esm.js';
|
|
7
7
|
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
8
8
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
9
9
|
import '../../dist/objectSpread2-c1340c1c.esm.js';
|
|
10
10
|
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
11
|
-
import '../../dist/typeof-a1531d8f.esm.js';
|
|
12
11
|
import '@valbuild/shared/internal';
|
|
13
12
|
|
|
14
13
|
function useValStega(selector) {
|
|
@@ -19,7 +19,7 @@ export { ValProvider } from "./ValProvider.js";
|
|
|
19
19
|
export { ValImage, type ValImageProps } from "./ValImage.js";
|
|
20
20
|
export { ValApp } from "./ValApp.js";
|
|
21
21
|
export type * as t from "./ValTypes.js";
|
|
22
|
-
export type { DecodeVal } from "
|
|
22
|
+
export type { DecodeVal } from "@valbuild/react/stega";
|
|
23
23
|
export declare const Internal: {
|
|
24
24
|
VERSION: {
|
|
25
25
|
next: string | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ValConfig, type InitVal, type ValConstructor, ValRouter } from "@valbuild/core";
|
|
2
|
-
import { raw } from "
|
|
2
|
+
import { raw } from "@valbuild/react/stega";
|
|
3
3
|
import { getUnpatchedUnencodedVal } from "./getUnpatchedUnencodedVal.js";
|
|
4
4
|
import { decodeValPathsOfString } from "./decodeValPathsOfString.js";
|
|
5
|
-
import { attrs } from "
|
|
5
|
+
import { attrs } from "@valbuild/react/stega";
|
|
6
6
|
declare const nextAppRouter: ValRouter;
|
|
7
7
|
export declare const initVal: (config?: ValConfig) => InitVal & {
|
|
8
8
|
val: ValConstructor & {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
2
2
|
import { _ as _objectSpread2 } from './objectSpread2-c1340c1c.esm.js';
|
|
3
3
|
import { _ as _slicedToArray } from './slicedToArray-aa291011.esm.js';
|
|
4
|
-
import { _ as _typeof } from './typeof-a1531d8f.esm.js';
|
|
5
4
|
import { RecordSchema, Internal } from '@valbuild/core';
|
|
6
5
|
import { getNextAppRouterSourceFolder, getPatternFromModuleFilePath, parseRoutePattern } from '@valbuild/shared/internal';
|
|
7
6
|
|
|
7
|
+
function _typeof(o) {
|
|
8
|
+
"@babel/helpers - typeof";
|
|
9
|
+
|
|
10
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
11
|
+
return typeof o;
|
|
12
|
+
} : function (o) {
|
|
13
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
+
}, _typeof(o);
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
function getValRouteUrlFromVal(resolvedParams, methodName,
|
|
9
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
19
|
path,
|
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
4
4
|
var objectSpread2 = require('./objectSpread2-3c87fb4f.cjs.prod.js');
|
|
5
5
|
var slicedToArray = require('./slicedToArray-ce613de6.cjs.prod.js');
|
|
6
|
-
var _typeof = require('./typeof-16428c61.cjs.prod.js');
|
|
7
6
|
var core = require('@valbuild/core');
|
|
8
7
|
var internal = require('@valbuild/shared/internal');
|
|
9
8
|
|
|
9
|
+
function _typeof(o) {
|
|
10
|
+
"@babel/helpers - typeof";
|
|
11
|
+
|
|
12
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
13
|
+
return typeof o;
|
|
14
|
+
} : function (o) {
|
|
15
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
16
|
+
}, _typeof(o);
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
function getValRouteUrlFromVal(resolvedParams, methodName,
|
|
11
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
21
|
path,
|
|
@@ -21,8 +30,8 @@ val) {
|
|
|
21
30
|
if (val === null) {
|
|
22
31
|
return null;
|
|
23
32
|
}
|
|
24
|
-
if (_typeof
|
|
25
|
-
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof
|
|
33
|
+
if (_typeof(val) !== "object") {
|
|
34
|
+
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof(val), " instead)."));
|
|
26
35
|
return null;
|
|
27
36
|
}
|
|
28
37
|
if (Array.isArray(val)) {
|
|
@@ -41,7 +50,7 @@ val) {
|
|
|
41
50
|
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the Next.js App Router)."));
|
|
42
51
|
return null;
|
|
43
52
|
}
|
|
44
|
-
if (_typeof
|
|
53
|
+
if (_typeof(resolvedParams) !== "object") {
|
|
45
54
|
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
|
|
46
55
|
return null;
|
|
47
56
|
}
|
|
@@ -61,7 +70,7 @@ val) {
|
|
|
61
70
|
var parsedPattern = internal.parseRoutePattern(pattern);
|
|
62
71
|
var missingPatterns = [];
|
|
63
72
|
var fullPathParts = [];
|
|
64
|
-
var missingParamKeys = _typeof
|
|
73
|
+
var missingParamKeys = _typeof(resolvedParams) === "object" && resolvedParams !== null && !Array.isArray(resolvedParams) ? objectSpread2._objectSpread2({}, resolvedParams) : {};
|
|
65
74
|
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(parsedPattern !== null && parsedPattern !== void 0 ? parsedPattern : []),
|
|
66
75
|
_step;
|
|
67
76
|
try {
|
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
4
4
|
var objectSpread2 = require('./objectSpread2-792eb2c2.cjs.dev.js');
|
|
5
5
|
var slicedToArray = require('./slicedToArray-44036a76.cjs.dev.js');
|
|
6
|
-
var _typeof = require('./typeof-b568f48f.cjs.dev.js');
|
|
7
6
|
var core = require('@valbuild/core');
|
|
8
7
|
var internal = require('@valbuild/shared/internal');
|
|
9
8
|
|
|
9
|
+
function _typeof(o) {
|
|
10
|
+
"@babel/helpers - typeof";
|
|
11
|
+
|
|
12
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
13
|
+
return typeof o;
|
|
14
|
+
} : function (o) {
|
|
15
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
16
|
+
}, _typeof(o);
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
function getValRouteUrlFromVal(resolvedParams, methodName,
|
|
11
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
21
|
path,
|
|
@@ -21,8 +30,8 @@ val) {
|
|
|
21
30
|
if (val === null) {
|
|
22
31
|
return null;
|
|
23
32
|
}
|
|
24
|
-
if (_typeof
|
|
25
|
-
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof
|
|
33
|
+
if (_typeof(val) !== "object") {
|
|
34
|
+
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: expected type object, found ").concat(_typeof(val), " instead)."));
|
|
26
35
|
return null;
|
|
27
36
|
}
|
|
28
37
|
if (Array.isArray(val)) {
|
|
@@ -41,7 +50,7 @@ val) {
|
|
|
41
50
|
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: router is not the Next.js App Router)."));
|
|
42
51
|
return null;
|
|
43
52
|
}
|
|
44
|
-
if (_typeof
|
|
53
|
+
if (_typeof(resolvedParams) !== "object") {
|
|
45
54
|
console.error("Val: ".concat(methodName, " must be used with a Val Module that is a s.record().router(...) (details: params is not an object)."));
|
|
46
55
|
return null;
|
|
47
56
|
}
|
|
@@ -61,7 +70,7 @@ val) {
|
|
|
61
70
|
var parsedPattern = internal.parseRoutePattern(pattern);
|
|
62
71
|
var missingPatterns = [];
|
|
63
72
|
var fullPathParts = [];
|
|
64
|
-
var missingParamKeys = _typeof
|
|
73
|
+
var missingParamKeys = _typeof(resolvedParams) === "object" && resolvedParams !== null && !Array.isArray(resolvedParams) ? objectSpread2._objectSpread2({}, resolvedParams) : {};
|
|
65
74
|
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(parsedPattern !== null && parsedPattern !== void 0 ? parsedPattern : []),
|
|
66
75
|
_step;
|
|
67
76
|
try {
|
|
@@ -4,15 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var objectSpread2 = require('./objectSpread2-792eb2c2.cjs.dev.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
|
-
var _typeof = require('./typeof-b568f48f.cjs.dev.js');
|
|
8
7
|
var stega = require('@valbuild/react/stega');
|
|
9
|
-
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
10
8
|
var internal = require('@valbuild/react/internal');
|
|
11
9
|
var ValNextProvider = require('./ValNextProvider-145cfd3a.cjs.dev.js');
|
|
12
10
|
var NextImage = require('next/image');
|
|
13
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
12
|
var ValApp = require('./ValApp-3df36e0d.cjs.dev.js');
|
|
15
13
|
var version = require('./version-82faa1d0.cjs.dev.js');
|
|
14
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
16
15
|
require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -38,27 +37,6 @@ function _interopNamespace(e) {
|
|
|
38
37
|
var core__namespace = /*#__PURE__*/_interopNamespace(core);
|
|
39
38
|
var NextImage__default = /*#__PURE__*/_interopDefault(NextImage);
|
|
40
39
|
|
|
41
|
-
function raw(val) {
|
|
42
|
-
if (typeof val === "string") {
|
|
43
|
-
return stega.stegaClean(val);
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(val)) {
|
|
46
|
-
return val.map(function (item) {
|
|
47
|
-
return raw(item);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (_typeof._typeof(val) === "object" && val !== null) {
|
|
51
|
-
var result = {};
|
|
52
|
-
for (var _key in val) {
|
|
53
|
-
if (Object.prototype.hasOwnProperty.call(val, _key)) {
|
|
54
|
-
result[_key] = raw(val[_key]);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
return val;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
40
|
function getUnpatchedUnencodedVal(selector) {
|
|
63
41
|
// It is weird to use stega encode here since we never actually should stega encode,
|
|
64
42
|
// however, this is a workaround, since if it is disabled, it will behave as we want
|
|
@@ -71,43 +49,6 @@ function decodeValPathsOfString(encodedString) {
|
|
|
71
49
|
return stega.stegaDecodeStrings(encodedString);
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
function attrs(target) {
|
|
75
|
-
var allPaths = new Set();
|
|
76
|
-
function addPath(target) {
|
|
77
|
-
if (typeof target === "string") {
|
|
78
|
-
var paths = decodeValPathsOfString(target);
|
|
79
|
-
if (paths) {
|
|
80
|
-
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(paths),
|
|
81
|
-
_step;
|
|
82
|
-
try {
|
|
83
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
84
|
-
var path = _step.value;
|
|
85
|
-
allPaths.add(path);
|
|
86
|
-
}
|
|
87
|
-
} catch (err) {
|
|
88
|
-
_iterator.e(err);
|
|
89
|
-
} finally {
|
|
90
|
-
_iterator.f();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (_typeof._typeof(target) === "object" && target !== null) {
|
|
95
|
-
var _path = core.Internal.getValPath(target);
|
|
96
|
-
if (_path) {
|
|
97
|
-
allPaths.add(_path);
|
|
98
|
-
}
|
|
99
|
-
Object.values(target).forEach(addPath);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
addPath(target);
|
|
103
|
-
if (allPaths.size === 0) {
|
|
104
|
-
return {};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
"data-val-path": Array.from(allPaths).join(",")
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
52
|
var nextAppRouter = core.Internal.nextAppRouter;
|
|
112
53
|
var initVal = function initVal(config) {
|
|
113
54
|
var _createValSystem = core.initVal(config),
|
|
@@ -121,9 +62,9 @@ var initVal = function initVal(config) {
|
|
|
121
62
|
c: c,
|
|
122
63
|
nextAppRouter: nextAppRouter,
|
|
123
64
|
val: objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, val), {}, {
|
|
124
|
-
attrs: attrs,
|
|
65
|
+
attrs: stega.attrs,
|
|
125
66
|
unstable_decodeValPathsOfString: decodeValPathsOfString,
|
|
126
|
-
raw: raw,
|
|
67
|
+
raw: stega.raw,
|
|
127
68
|
unstable_getUnpatchedUnencodedVal: getUnpatchedUnencodedVal
|
|
128
69
|
}),
|
|
129
70
|
config: currentConfig
|
|
@@ -194,12 +135,12 @@ function ValImage(props) {
|
|
|
194
135
|
lazyBoundary: undefined,
|
|
195
136
|
lazyRoot: undefined
|
|
196
137
|
})), {}, {
|
|
197
|
-
src: valPathsOfUrl && valPathsOfUrl.length > 0 ? raw(src === null || src === void 0 ? void 0 : src.url) : src === null || src === void 0 ? void 0 : src.url,
|
|
138
|
+
src: valPathsOfUrl && valPathsOfUrl.length > 0 ? stega.raw(src === null || src === void 0 ? void 0 : src.url) : src === null || src === void 0 ? void 0 : src.url,
|
|
198
139
|
"data-val-path": valPaths.join(","),
|
|
199
140
|
"data-val-attr-alt": maybeValPathOfAlt,
|
|
200
141
|
"data-val-attr-src": valPathsOfUrl && valPathsOfUrl.length > 0 ? valPathsOfUrl.join(",") : undefined,
|
|
201
142
|
style: imageStyle,
|
|
202
|
-
alt: alt ? raw(alt) : src !== null && src !== void 0 && (_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.alt ? raw(src === null || src === void 0 || (_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.alt) : "",
|
|
143
|
+
alt: alt ? stega.raw(alt) : src !== null && src !== void 0 && (_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.alt ? stega.raw(src === null || src === void 0 || (_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.alt) : "",
|
|
203
144
|
fill: rest.fill,
|
|
204
145
|
width: preferMetadataDims ? src === null || src === void 0 || (_src$metadata5 = src.metadata) === null || _src$metadata5 === void 0 ? void 0 : _src$metadata5.width : width,
|
|
205
146
|
height: preferMetadataDims ? src === null || src === void 0 || (_src$metadata6 = src.metadata) === null || _src$metadata6 === void 0 ? void 0 : _src$metadata6.height : height,
|
|
@@ -4,15 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var objectSpread2 = require('./objectSpread2-3c87fb4f.cjs.prod.js');
|
|
6
6
|
var core = require('@valbuild/core');
|
|
7
|
-
var _typeof = require('./typeof-16428c61.cjs.prod.js');
|
|
8
7
|
var stega = require('@valbuild/react/stega');
|
|
9
|
-
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
10
8
|
var internal = require('@valbuild/react/internal');
|
|
11
9
|
var ValNextProvider = require('./ValNextProvider-96d1c795.cjs.prod.js');
|
|
12
10
|
var NextImage = require('next/image');
|
|
13
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
12
|
var ValApp = require('./ValApp-22147086.cjs.prod.js');
|
|
15
13
|
var version = require('./version-a9a6a619.cjs.prod.js');
|
|
14
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
16
15
|
require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -38,27 +37,6 @@ function _interopNamespace(e) {
|
|
|
38
37
|
var core__namespace = /*#__PURE__*/_interopNamespace(core);
|
|
39
38
|
var NextImage__default = /*#__PURE__*/_interopDefault(NextImage);
|
|
40
39
|
|
|
41
|
-
function raw(val) {
|
|
42
|
-
if (typeof val === "string") {
|
|
43
|
-
return stega.stegaClean(val);
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(val)) {
|
|
46
|
-
return val.map(function (item) {
|
|
47
|
-
return raw(item);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (_typeof._typeof(val) === "object" && val !== null) {
|
|
51
|
-
var result = {};
|
|
52
|
-
for (var _key in val) {
|
|
53
|
-
if (Object.prototype.hasOwnProperty.call(val, _key)) {
|
|
54
|
-
result[_key] = raw(val[_key]);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
return val;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
40
|
function getUnpatchedUnencodedVal(selector) {
|
|
63
41
|
// It is weird to use stega encode here since we never actually should stega encode,
|
|
64
42
|
// however, this is a workaround, since if it is disabled, it will behave as we want
|
|
@@ -71,43 +49,6 @@ function decodeValPathsOfString(encodedString) {
|
|
|
71
49
|
return stega.stegaDecodeStrings(encodedString);
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
function attrs(target) {
|
|
75
|
-
var allPaths = new Set();
|
|
76
|
-
function addPath(target) {
|
|
77
|
-
if (typeof target === "string") {
|
|
78
|
-
var paths = decodeValPathsOfString(target);
|
|
79
|
-
if (paths) {
|
|
80
|
-
var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(paths),
|
|
81
|
-
_step;
|
|
82
|
-
try {
|
|
83
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
84
|
-
var path = _step.value;
|
|
85
|
-
allPaths.add(path);
|
|
86
|
-
}
|
|
87
|
-
} catch (err) {
|
|
88
|
-
_iterator.e(err);
|
|
89
|
-
} finally {
|
|
90
|
-
_iterator.f();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (_typeof._typeof(target) === "object" && target !== null) {
|
|
95
|
-
var _path = core.Internal.getValPath(target);
|
|
96
|
-
if (_path) {
|
|
97
|
-
allPaths.add(_path);
|
|
98
|
-
}
|
|
99
|
-
Object.values(target).forEach(addPath);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
addPath(target);
|
|
103
|
-
if (allPaths.size === 0) {
|
|
104
|
-
return {};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
"data-val-path": Array.from(allPaths).join(",")
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
52
|
var nextAppRouter = core.Internal.nextAppRouter;
|
|
112
53
|
var initVal = function initVal(config) {
|
|
113
54
|
var _createValSystem = core.initVal(config),
|
|
@@ -121,9 +62,9 @@ var initVal = function initVal(config) {
|
|
|
121
62
|
c: c,
|
|
122
63
|
nextAppRouter: nextAppRouter,
|
|
123
64
|
val: objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, val), {}, {
|
|
124
|
-
attrs: attrs,
|
|
65
|
+
attrs: stega.attrs,
|
|
125
66
|
unstable_decodeValPathsOfString: decodeValPathsOfString,
|
|
126
|
-
raw: raw,
|
|
67
|
+
raw: stega.raw,
|
|
127
68
|
unstable_getUnpatchedUnencodedVal: getUnpatchedUnencodedVal
|
|
128
69
|
}),
|
|
129
70
|
config: currentConfig
|
|
@@ -194,12 +135,12 @@ function ValImage(props) {
|
|
|
194
135
|
lazyBoundary: undefined,
|
|
195
136
|
lazyRoot: undefined
|
|
196
137
|
})), {}, {
|
|
197
|
-
src: valPathsOfUrl && valPathsOfUrl.length > 0 ? raw(src === null || src === void 0 ? void 0 : src.url) : src === null || src === void 0 ? void 0 : src.url,
|
|
138
|
+
src: valPathsOfUrl && valPathsOfUrl.length > 0 ? stega.raw(src === null || src === void 0 ? void 0 : src.url) : src === null || src === void 0 ? void 0 : src.url,
|
|
198
139
|
"data-val-path": valPaths.join(","),
|
|
199
140
|
"data-val-attr-alt": maybeValPathOfAlt,
|
|
200
141
|
"data-val-attr-src": valPathsOfUrl && valPathsOfUrl.length > 0 ? valPathsOfUrl.join(",") : undefined,
|
|
201
142
|
style: imageStyle,
|
|
202
|
-
alt: alt ? raw(alt) : src !== null && src !== void 0 && (_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.alt ? raw(src === null || src === void 0 || (_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.alt) : "",
|
|
143
|
+
alt: alt ? stega.raw(alt) : src !== null && src !== void 0 && (_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.alt ? stega.raw(src === null || src === void 0 || (_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.alt) : "",
|
|
203
144
|
fill: rest.fill,
|
|
204
145
|
width: preferMetadataDims ? src === null || src === void 0 || (_src$metadata5 = src.metadata) === null || _src$metadata5 === void 0 ? void 0 : _src$metadata5.width : width,
|
|
205
146
|
height: preferMetadataDims ? src === null || src === void 0 || (_src$metadata6 = src.metadata) === null || _src$metadata6 === void 0 ? void 0 : _src$metadata6.height : height,
|
|
@@ -3,38 +3,16 @@ import { Internal as Internal$1, initVal as initVal$1 } from '@valbuild/core';
|
|
|
3
3
|
import * as core from '@valbuild/core';
|
|
4
4
|
export { core as expr };
|
|
5
5
|
export { FILE_REF_PROP, GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
|
|
6
|
-
import {
|
|
7
|
-
import { stegaClean, stegaEncode, stegaDecodeStrings, autoTagJSX } from '@valbuild/react/stega';
|
|
8
|
-
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
6
|
+
import { stegaEncode, stegaDecodeStrings, attrs, raw, autoTagJSX } from '@valbuild/react/stega';
|
|
9
7
|
export { ValRichText } from '@valbuild/react/internal';
|
|
10
8
|
import { ValNextProvider } from './ValNextProvider-25a03cab.esm.js';
|
|
11
9
|
import NextImage from 'next/image';
|
|
12
10
|
import { jsx } from 'react/jsx-runtime';
|
|
13
11
|
export { ValApp } from './ValApp-e2e1dfed.esm.js';
|
|
14
12
|
import { V as VERSION } from './version-98ec5c7a.esm.js';
|
|
13
|
+
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
|
|
15
14
|
import './unsupportedIterableToArray-5baabfdc.esm.js';
|
|
16
15
|
|
|
17
|
-
function raw(val) {
|
|
18
|
-
if (typeof val === "string") {
|
|
19
|
-
return stegaClean(val);
|
|
20
|
-
}
|
|
21
|
-
if (Array.isArray(val)) {
|
|
22
|
-
return val.map(function (item) {
|
|
23
|
-
return raw(item);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
if (_typeof(val) === "object" && val !== null) {
|
|
27
|
-
var result = {};
|
|
28
|
-
for (var _key in val) {
|
|
29
|
-
if (Object.prototype.hasOwnProperty.call(val, _key)) {
|
|
30
|
-
result[_key] = raw(val[_key]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
return val;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
16
|
function getUnpatchedUnencodedVal(selector) {
|
|
39
17
|
// It is weird to use stega encode here since we never actually should stega encode,
|
|
40
18
|
// however, this is a workaround, since if it is disabled, it will behave as we want
|
|
@@ -47,43 +25,6 @@ function decodeValPathsOfString(encodedString) {
|
|
|
47
25
|
return stegaDecodeStrings(encodedString);
|
|
48
26
|
}
|
|
49
27
|
|
|
50
|
-
function attrs(target) {
|
|
51
|
-
var allPaths = new Set();
|
|
52
|
-
function addPath(target) {
|
|
53
|
-
if (typeof target === "string") {
|
|
54
|
-
var paths = decodeValPathsOfString(target);
|
|
55
|
-
if (paths) {
|
|
56
|
-
var _iterator = _createForOfIteratorHelper(paths),
|
|
57
|
-
_step;
|
|
58
|
-
try {
|
|
59
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
60
|
-
var path = _step.value;
|
|
61
|
-
allPaths.add(path);
|
|
62
|
-
}
|
|
63
|
-
} catch (err) {
|
|
64
|
-
_iterator.e(err);
|
|
65
|
-
} finally {
|
|
66
|
-
_iterator.f();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (_typeof(target) === "object" && target !== null) {
|
|
71
|
-
var _path = Internal$1.getValPath(target);
|
|
72
|
-
if (_path) {
|
|
73
|
-
allPaths.add(_path);
|
|
74
|
-
}
|
|
75
|
-
Object.values(target).forEach(addPath);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
addPath(target);
|
|
79
|
-
if (allPaths.size === 0) {
|
|
80
|
-
return {};
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
"data-val-path": Array.from(allPaths).join(",")
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
28
|
var nextAppRouter = Internal$1.nextAppRouter;
|
|
88
29
|
var initVal = function initVal(config) {
|
|
89
30
|
var _createValSystem = initVal$1(config),
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"next",
|
|
13
13
|
"react"
|
|
14
14
|
],
|
|
15
|
-
"version": "0.91.
|
|
15
|
+
"version": "0.91.2",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"test": "jest"
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"exports": true
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@valbuild/core": "~0.91.
|
|
53
|
-
"@valbuild/react": "~0.91.
|
|
54
|
-
"@valbuild/server": "~0.91.
|
|
55
|
-
"@valbuild/shared": "~0.91.
|
|
56
|
-
"@valbuild/ui": "~0.91.
|
|
52
|
+
"@valbuild/core": "~0.91.2",
|
|
53
|
+
"@valbuild/react": "~0.91.2",
|
|
54
|
+
"@valbuild/server": "~0.91.2",
|
|
55
|
+
"@valbuild/shared": "~0.91.2",
|
|
56
|
+
"@valbuild/ui": "~0.91.2",
|
|
57
57
|
"client-only": "^0.0.1",
|
|
58
58
|
"server-only": "^0.0.1"
|
|
59
59
|
},
|
|
@@ -10,11 +10,10 @@ var core = require('@valbuild/core');
|
|
|
10
10
|
var internal = require('@valbuild/shared/internal');
|
|
11
11
|
var server = require('@valbuild/server');
|
|
12
12
|
var version = require('../../dist/version-82faa1d0.cjs.dev.js');
|
|
13
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
13
|
+
var routeFromVal = require('../../dist/routeFromVal-c46c1288.cjs.dev.js');
|
|
14
14
|
require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
|
|
15
15
|
require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
|
|
16
16
|
require('../../dist/slicedToArray-44036a76.cjs.dev.js');
|
|
17
|
-
require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
18
17
|
|
|
19
18
|
stega.SET_RSC(true);
|
|
20
19
|
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
@@ -10,11 +10,10 @@ var core = require('@valbuild/core');
|
|
|
10
10
|
var internal = require('@valbuild/shared/internal');
|
|
11
11
|
var server = require('@valbuild/server');
|
|
12
12
|
var version = require('../../dist/version-a9a6a619.cjs.prod.js');
|
|
13
|
-
var routeFromVal = require('../../dist/routeFromVal-
|
|
13
|
+
var routeFromVal = require('../../dist/routeFromVal-7d9ac291.cjs.prod.js');
|
|
14
14
|
require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
|
|
15
15
|
require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
|
|
16
16
|
require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
|
|
17
|
-
require('../../dist/typeof-16428c61.cjs.prod.js');
|
|
18
17
|
|
|
19
18
|
stega.SET_RSC(true);
|
|
20
19
|
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
@@ -6,11 +6,10 @@ import { Internal } from '@valbuild/core';
|
|
|
6
6
|
import { VAL_SESSION_COOKIE } from '@valbuild/shared/internal';
|
|
7
7
|
import { createValServer } from '@valbuild/server';
|
|
8
8
|
import { V as VERSION } from '../../dist/version-98ec5c7a.esm.js';
|
|
9
|
-
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-
|
|
9
|
+
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-7d9046e9.esm.js';
|
|
10
10
|
import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
|
|
12
12
|
import '../../dist/slicedToArray-aa291011.esm.js';
|
|
13
|
-
import '../../dist/typeof-a1531d8f.esm.js';
|
|
14
13
|
|
|
15
14
|
SET_RSC(true);
|
|
16
15
|
var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type RichTextSource, type RawString } from "@valbuild/core";
|
|
2
|
-
import { type RichText, type StegaOfRichTextSource, type ValEncodedString } from "@valbuild/react/stega";
|
|
3
|
-
export type DecodeVal<T> = T extends ValEncodedString | RawString ? string : T extends RichText<infer Options> ? StegaOfRichTextSource<RichTextSource<Options>> : T extends (a: infer A) => infer R ? (a: DecodeVal<A>) => DecodeVal<R> : T extends (a: infer A, b: infer B) => infer R ? (a: DecodeVal<A>, b: DecodeVal<B>) => DecodeVal<R> : T extends (a: infer A, b: infer B, c: infer C) => infer R ? (a: DecodeVal<A>, b: DecodeVal<B>, c: DecodeVal<C>) => DecodeVal<R> : T extends (a: infer A, b: infer B, c: infer C, d: infer D) => infer R ? (a: DecodeVal<A>, b: DecodeVal<B>, c: DecodeVal<C>, d: DecodeVal<D>) => DecodeVal<R> : T extends (a: infer A, b: infer B, c: infer C, d: infer D, e: infer E) => infer R ? (a: DecodeVal<A>, b: DecodeVal<B>, c: DecodeVal<C>, d: DecodeVal<D>, e: DecodeVal<E>) => DecodeVal<R> : T extends (...args: infer P) => infer R ? (...args: DecodeVal<P>) => DecodeVal<R> : T extends {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
} ? {
|
|
6
|
-
[K in keyof T]: DecodeVal<T[K]>;
|
|
7
|
-
} : T extends Array<infer U> ? DecodeVal<U>[] : T;
|
|
8
|
-
export declare function raw<T>(val: T): DecodeVal<T>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _typeof(o) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
|
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
-
return typeof o;
|
|
8
|
-
} : function (o) {
|
|
9
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
-
}, _typeof(o);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports._typeof = _typeof;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function _typeof(o) {
|
|
2
|
-
"@babel/helpers - typeof";
|
|
3
|
-
|
|
4
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
5
|
-
return typeof o;
|
|
6
|
-
} : function (o) {
|
|
7
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
-
}, _typeof(o);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { _typeof as _ };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _typeof(o) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
|
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
-
return typeof o;
|
|
8
|
-
} : function (o) {
|
|
9
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
-
}, _typeof(o);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports._typeof = _typeof;
|