@valbuild/react 0.148.5 → 0.148.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/declarations/src/stega/attrs.d.ts +11 -0
- package/dist/{raw-cd78aea7.browser.esm.js → raw-27e587b6.browser.esm.js} +31 -7
- package/dist/{raw-c2b82a01.cjs.dev.js → raw-400c4eba.cjs.dev.js} +31 -7
- package/dist/{raw-de29c973.cjs.prod.js → raw-4870e29f.cjs.prod.js} +31 -7
- package/dist/{raw-d156d004.worker.esm.js → raw-7d65198e.worker.esm.js} +31 -7
- package/dist/{raw-d43ba7b8.esm.js → raw-f1b35392.esm.js} +31 -7
- package/internal/dist/valbuild-react-internal.browser.esm.js +2 -2
- package/internal/dist/valbuild-react-internal.cjs.dev.js +2 -2
- package/internal/dist/valbuild-react-internal.cjs.prod.js +2 -2
- package/internal/dist/valbuild-react-internal.esm.js +2 -2
- package/internal/dist/valbuild-react-internal.worker.esm.js +2 -2
- package/package.json +4 -4
- package/stega/dist/valbuild-react-stega.browser.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.cjs.dev.js +1 -1
- package/stega/dist/valbuild-react-stega.cjs.prod.js +1 -1
- package/stega/dist/valbuild-react-stega.esm.js +2 -2
- package/stega/dist/valbuild-react-stega.worker.esm.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @valbuild/react
|
|
2
2
|
|
|
3
|
+
## 0.148.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#906](https://github.com/valbuild/val/pull/906) [`fb2eed8`](https://github.com/valbuild/val/commit/fb2eed8b51092cc2ad5c812bdf88b528913c824a) Thanks [@freekh](https://github.com/freekh)! - `val.attrs(post, "author")` tags an element with one field of what it shows. Use it for a value Val never encodes, like an `s.keyOf` key, a date or a colour. A byline that shows the author a post points at can carry the post's `author` field, so clicking it in the Studio opens the choice of author.
|
|
8
|
+
|
|
9
|
+
On a phone, a tour step about Pages, Media, Data or Settings points at the menu button, which is where they are when the rail is not drawn.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`fb2eed8`](https://github.com/valbuild/val/commit/fb2eed8b51092cc2ad5c812bdf88b528913c824a), [`1a5ad65`](https://github.com/valbuild/val/commit/1a5ad65205ff65b54e9c5f2a7b41e24cca9fd68c)]:
|
|
12
|
+
- @valbuild/core@0.148.7
|
|
13
|
+
- @valbuild/ui@0.148.7
|
|
14
|
+
- @valbuild/shared@0.148.7
|
|
15
|
+
|
|
16
|
+
## 0.148.6
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`b580292`](https://github.com/valbuild/val/commit/b580292ac3c335b055f5ed5f18d6a12d075169c7)]:
|
|
21
|
+
- @valbuild/ui@0.148.6
|
|
22
|
+
- @valbuild/shared@0.148.6
|
|
23
|
+
|
|
3
24
|
## 0.148.5
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export type ValAttrs = {
|
|
2
2
|
"data-val-path"?: string;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
6
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
7
|
+
*
|
|
8
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
9
|
+
* one field: for an element that shows a value that is not text -- a
|
|
10
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
11
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
12
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
13
|
+
*/
|
|
4
14
|
export declare function attrs(target: unknown): ValAttrs;
|
|
15
|
+
export declare function attrs<T extends object>(target: T, field: keyof T & string): ValAttrs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _typeof } from './typeof-9915e135.browser.esm.js';
|
|
2
1
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-c0be3691.browser.esm.js';
|
|
2
|
+
import { _ as _typeof } from './typeof-9915e135.browser.esm.js';
|
|
3
3
|
import { Internal, isValViewSource } from '@valbuild/core';
|
|
4
4
|
import { vercelStegaDecodeAll, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
|
|
5
5
|
import { _ as _slicedToArray } from './slicedToArray-8f9b0d84.browser.esm.js';
|
|
@@ -438,6 +438,13 @@ function stegaEncode(input, opts) {
|
|
|
438
438
|
schema: isRecordSchema(recOpts.schema) ? recOpts.schema.item : isObjectSchema(recOpts.schema) ? recOpts.schema.items[_key] : unknownSchema(recOpts.schema)
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
+
// Where an object was read from, for `attrs`: an object has no text
|
|
442
|
+
// to carry its path in, and a field Val does not encode (a key, a
|
|
443
|
+
// date) is named from its object's. Not in production, where nothing
|
|
444
|
+
// else is tagged either.
|
|
445
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.path && !opts.disabled) {
|
|
446
|
+
Internal.setValPath(res, recOpts.path);
|
|
447
|
+
}
|
|
441
448
|
return res;
|
|
442
449
|
}
|
|
443
450
|
Internal.log.error("Could not transform source selector: ".concat(_typeof(sourceOrSelector), " (array: ").concat(Array.isArray(sourceOrSelector), ")"), sourceOrSelector);
|
|
@@ -645,7 +652,24 @@ function getModuleIds(input) {
|
|
|
645
652
|
return moduleIds;
|
|
646
653
|
}
|
|
647
654
|
|
|
648
|
-
|
|
655
|
+
/**
|
|
656
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
657
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
658
|
+
*
|
|
659
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
660
|
+
* one field: for an element that shows a value that is not text -- a
|
|
661
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
662
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
663
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
664
|
+
*/
|
|
665
|
+
|
|
666
|
+
function attrs(target, field) {
|
|
667
|
+
if (field !== undefined) {
|
|
668
|
+
var path = _typeof(target) === "object" && target !== null ? Internal.createValPathOfItem(Internal.getValPath(target), field) : undefined;
|
|
669
|
+
return path ? {
|
|
670
|
+
"data-val-path": path
|
|
671
|
+
} : {};
|
|
672
|
+
}
|
|
649
673
|
var allPaths = new Set();
|
|
650
674
|
function addPath(target) {
|
|
651
675
|
if (typeof target === "string") {
|
|
@@ -655,8 +679,8 @@ function attrs(target) {
|
|
|
655
679
|
_step;
|
|
656
680
|
try {
|
|
657
681
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
658
|
-
var
|
|
659
|
-
allPaths.add(
|
|
682
|
+
var _path = _step.value;
|
|
683
|
+
allPaths.add(_path);
|
|
660
684
|
}
|
|
661
685
|
} catch (err) {
|
|
662
686
|
_iterator.e(err);
|
|
@@ -666,9 +690,9 @@ function attrs(target) {
|
|
|
666
690
|
}
|
|
667
691
|
}
|
|
668
692
|
if (_typeof(target) === "object" && target !== null) {
|
|
669
|
-
var
|
|
670
|
-
if (
|
|
671
|
-
allPaths.add(
|
|
693
|
+
var _path2 = Internal.getValPath(target);
|
|
694
|
+
if (_path2) {
|
|
695
|
+
allPaths.add(_path2);
|
|
672
696
|
}
|
|
673
697
|
Object.values(target).forEach(addPath);
|
|
674
698
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _typeof = require('./typeof-b568f48f.cjs.dev.js');
|
|
4
3
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-8a871dc3.cjs.dev.js');
|
|
4
|
+
var _typeof = require('./typeof-b568f48f.cjs.dev.js');
|
|
5
5
|
var core = require('@valbuild/core');
|
|
6
6
|
var stega = require('@vercel/stega');
|
|
7
7
|
var slicedToArray = require('./slicedToArray-387314c6.cjs.dev.js');
|
|
@@ -440,6 +440,13 @@ function stegaEncode(input, opts) {
|
|
|
440
440
|
schema: isRecordSchema(recOpts.schema) ? recOpts.schema.item : isObjectSchema(recOpts.schema) ? recOpts.schema.items[_key] : unknownSchema(recOpts.schema)
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
+
// Where an object was read from, for `attrs`: an object has no text
|
|
444
|
+
// to carry its path in, and a field Val does not encode (a key, a
|
|
445
|
+
// date) is named from its object's. Not in production, where nothing
|
|
446
|
+
// else is tagged either.
|
|
447
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.path && !opts.disabled) {
|
|
448
|
+
core.Internal.setValPath(res, recOpts.path);
|
|
449
|
+
}
|
|
443
450
|
return res;
|
|
444
451
|
}
|
|
445
452
|
core.Internal.log.error("Could not transform source selector: ".concat(_typeof._typeof(sourceOrSelector), " (array: ").concat(Array.isArray(sourceOrSelector), ")"), sourceOrSelector);
|
|
@@ -647,7 +654,24 @@ function getModuleIds(input) {
|
|
|
647
654
|
return moduleIds;
|
|
648
655
|
}
|
|
649
656
|
|
|
650
|
-
|
|
657
|
+
/**
|
|
658
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
659
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
660
|
+
*
|
|
661
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
662
|
+
* one field: for an element that shows a value that is not text -- a
|
|
663
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
664
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
665
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
666
|
+
*/
|
|
667
|
+
|
|
668
|
+
function attrs(target, field) {
|
|
669
|
+
if (field !== undefined) {
|
|
670
|
+
var path = _typeof._typeof(target) === "object" && target !== null ? core.Internal.createValPathOfItem(core.Internal.getValPath(target), field) : undefined;
|
|
671
|
+
return path ? {
|
|
672
|
+
"data-val-path": path
|
|
673
|
+
} : {};
|
|
674
|
+
}
|
|
651
675
|
var allPaths = new Set();
|
|
652
676
|
function addPath(target) {
|
|
653
677
|
if (typeof target === "string") {
|
|
@@ -657,8 +681,8 @@ function attrs(target) {
|
|
|
657
681
|
_step;
|
|
658
682
|
try {
|
|
659
683
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
660
|
-
var
|
|
661
|
-
allPaths.add(
|
|
684
|
+
var _path = _step.value;
|
|
685
|
+
allPaths.add(_path);
|
|
662
686
|
}
|
|
663
687
|
} catch (err) {
|
|
664
688
|
_iterator.e(err);
|
|
@@ -668,9 +692,9 @@ function attrs(target) {
|
|
|
668
692
|
}
|
|
669
693
|
}
|
|
670
694
|
if (_typeof._typeof(target) === "object" && target !== null) {
|
|
671
|
-
var
|
|
672
|
-
if (
|
|
673
|
-
allPaths.add(
|
|
695
|
+
var _path2 = core.Internal.getValPath(target);
|
|
696
|
+
if (_path2) {
|
|
697
|
+
allPaths.add(_path2);
|
|
674
698
|
}
|
|
675
699
|
Object.values(target).forEach(addPath);
|
|
676
700
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _typeof = require('./typeof-16428c61.cjs.prod.js');
|
|
4
3
|
var createForOfIteratorHelper = require('./createForOfIteratorHelper-6f9dc6fa.cjs.prod.js');
|
|
4
|
+
var _typeof = require('./typeof-16428c61.cjs.prod.js');
|
|
5
5
|
var core = require('@valbuild/core');
|
|
6
6
|
var stega = require('@vercel/stega');
|
|
7
7
|
var slicedToArray = require('./slicedToArray-64c83d56.cjs.prod.js');
|
|
@@ -440,6 +440,13 @@ function stegaEncode(input, opts) {
|
|
|
440
440
|
schema: isRecordSchema(recOpts.schema) ? recOpts.schema.item : isObjectSchema(recOpts.schema) ? recOpts.schema.items[_key] : unknownSchema(recOpts.schema)
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
+
// Where an object was read from, for `attrs`: an object has no text
|
|
444
|
+
// to carry its path in, and a field Val does not encode (a key, a
|
|
445
|
+
// date) is named from its object's. Not in production, where nothing
|
|
446
|
+
// else is tagged either.
|
|
447
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.path && !opts.disabled) {
|
|
448
|
+
core.Internal.setValPath(res, recOpts.path);
|
|
449
|
+
}
|
|
443
450
|
return res;
|
|
444
451
|
}
|
|
445
452
|
core.Internal.log.error("Could not transform source selector: ".concat(_typeof._typeof(sourceOrSelector), " (array: ").concat(Array.isArray(sourceOrSelector), ")"), sourceOrSelector);
|
|
@@ -647,7 +654,24 @@ function getModuleIds(input) {
|
|
|
647
654
|
return moduleIds;
|
|
648
655
|
}
|
|
649
656
|
|
|
650
|
-
|
|
657
|
+
/**
|
|
658
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
659
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
660
|
+
*
|
|
661
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
662
|
+
* one field: for an element that shows a value that is not text -- a
|
|
663
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
664
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
665
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
666
|
+
*/
|
|
667
|
+
|
|
668
|
+
function attrs(target, field) {
|
|
669
|
+
if (field !== undefined) {
|
|
670
|
+
var path = _typeof._typeof(target) === "object" && target !== null ? core.Internal.createValPathOfItem(core.Internal.getValPath(target), field) : undefined;
|
|
671
|
+
return path ? {
|
|
672
|
+
"data-val-path": path
|
|
673
|
+
} : {};
|
|
674
|
+
}
|
|
651
675
|
var allPaths = new Set();
|
|
652
676
|
function addPath(target) {
|
|
653
677
|
if (typeof target === "string") {
|
|
@@ -657,8 +681,8 @@ function attrs(target) {
|
|
|
657
681
|
_step;
|
|
658
682
|
try {
|
|
659
683
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
660
|
-
var
|
|
661
|
-
allPaths.add(
|
|
684
|
+
var _path = _step.value;
|
|
685
|
+
allPaths.add(_path);
|
|
662
686
|
}
|
|
663
687
|
} catch (err) {
|
|
664
688
|
_iterator.e(err);
|
|
@@ -668,9 +692,9 @@ function attrs(target) {
|
|
|
668
692
|
}
|
|
669
693
|
}
|
|
670
694
|
if (_typeof._typeof(target) === "object" && target !== null) {
|
|
671
|
-
var
|
|
672
|
-
if (
|
|
673
|
-
allPaths.add(
|
|
695
|
+
var _path2 = core.Internal.getValPath(target);
|
|
696
|
+
if (_path2) {
|
|
697
|
+
allPaths.add(_path2);
|
|
674
698
|
}
|
|
675
699
|
Object.values(target).forEach(addPath);
|
|
676
700
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _typeof } from './typeof-e0c837cc.worker.esm.js';
|
|
2
1
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-73fe9a1a.worker.esm.js';
|
|
2
|
+
import { _ as _typeof } from './typeof-e0c837cc.worker.esm.js';
|
|
3
3
|
import { Internal, isValViewSource } from '@valbuild/core';
|
|
4
4
|
import { vercelStegaDecodeAll, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
|
|
5
5
|
import { _ as _slicedToArray } from './slicedToArray-8b1a55e5.worker.esm.js';
|
|
@@ -438,6 +438,13 @@ function stegaEncode(input, opts) {
|
|
|
438
438
|
schema: isRecordSchema(recOpts.schema) ? recOpts.schema.item : isObjectSchema(recOpts.schema) ? recOpts.schema.items[_key] : unknownSchema(recOpts.schema)
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
+
// Where an object was read from, for `attrs`: an object has no text
|
|
442
|
+
// to carry its path in, and a field Val does not encode (a key, a
|
|
443
|
+
// date) is named from its object's. Not in production, where nothing
|
|
444
|
+
// else is tagged either.
|
|
445
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.path && !opts.disabled) {
|
|
446
|
+
Internal.setValPath(res, recOpts.path);
|
|
447
|
+
}
|
|
441
448
|
return res;
|
|
442
449
|
}
|
|
443
450
|
Internal.log.error("Could not transform source selector: ".concat(_typeof(sourceOrSelector), " (array: ").concat(Array.isArray(sourceOrSelector), ")"), sourceOrSelector);
|
|
@@ -645,7 +652,24 @@ function getModuleIds(input) {
|
|
|
645
652
|
return moduleIds;
|
|
646
653
|
}
|
|
647
654
|
|
|
648
|
-
|
|
655
|
+
/**
|
|
656
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
657
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
658
|
+
*
|
|
659
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
660
|
+
* one field: for an element that shows a value that is not text -- a
|
|
661
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
662
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
663
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
664
|
+
*/
|
|
665
|
+
|
|
666
|
+
function attrs(target, field) {
|
|
667
|
+
if (field !== undefined) {
|
|
668
|
+
var path = _typeof(target) === "object" && target !== null ? Internal.createValPathOfItem(Internal.getValPath(target), field) : undefined;
|
|
669
|
+
return path ? {
|
|
670
|
+
"data-val-path": path
|
|
671
|
+
} : {};
|
|
672
|
+
}
|
|
649
673
|
var allPaths = new Set();
|
|
650
674
|
function addPath(target) {
|
|
651
675
|
if (typeof target === "string") {
|
|
@@ -655,8 +679,8 @@ function attrs(target) {
|
|
|
655
679
|
_step;
|
|
656
680
|
try {
|
|
657
681
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
658
|
-
var
|
|
659
|
-
allPaths.add(
|
|
682
|
+
var _path = _step.value;
|
|
683
|
+
allPaths.add(_path);
|
|
660
684
|
}
|
|
661
685
|
} catch (err) {
|
|
662
686
|
_iterator.e(err);
|
|
@@ -666,9 +690,9 @@ function attrs(target) {
|
|
|
666
690
|
}
|
|
667
691
|
}
|
|
668
692
|
if (_typeof(target) === "object" && target !== null) {
|
|
669
|
-
var
|
|
670
|
-
if (
|
|
671
|
-
allPaths.add(
|
|
693
|
+
var _path2 = Internal.getValPath(target);
|
|
694
|
+
if (_path2) {
|
|
695
|
+
allPaths.add(_path2);
|
|
672
696
|
}
|
|
673
697
|
Object.values(target).forEach(addPath);
|
|
674
698
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _typeof } from './typeof-a1531d8f.esm.js';
|
|
2
1
|
import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-69c4a419.esm.js';
|
|
2
|
+
import { _ as _typeof } from './typeof-a1531d8f.esm.js';
|
|
3
3
|
import { Internal, isValViewSource } from '@valbuild/core';
|
|
4
4
|
import { vercelStegaDecodeAll, vercelStegaSplit, vercelStegaCombine } from '@vercel/stega';
|
|
5
5
|
import { _ as _slicedToArray } from './slicedToArray-3d4c6640.esm.js';
|
|
@@ -438,6 +438,13 @@ function stegaEncode(input, opts) {
|
|
|
438
438
|
schema: isRecordSchema(recOpts.schema) ? recOpts.schema.item : isObjectSchema(recOpts.schema) ? recOpts.schema.items[_key] : unknownSchema(recOpts.schema)
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
+
// Where an object was read from, for `attrs`: an object has no text
|
|
442
|
+
// to carry its path in, and a field Val does not encode (a key, a
|
|
443
|
+
// date) is named from its object's. Not in production, where nothing
|
|
444
|
+
// else is tagged either.
|
|
445
|
+
if (recOpts !== null && recOpts !== void 0 && recOpts.path && !opts.disabled) {
|
|
446
|
+
Internal.setValPath(res, recOpts.path);
|
|
447
|
+
}
|
|
441
448
|
return res;
|
|
442
449
|
}
|
|
443
450
|
Internal.log.error("Could not transform source selector: ".concat(_typeof(sourceOrSelector), " (array: ").concat(Array.isArray(sourceOrSelector), ")"), sourceOrSelector);
|
|
@@ -645,7 +652,24 @@ function getModuleIds(input) {
|
|
|
645
652
|
return moduleIds;
|
|
646
653
|
}
|
|
647
654
|
|
|
648
|
-
|
|
655
|
+
/**
|
|
656
|
+
* The `data-val-path` an element needs so the Studio can find, outline and
|
|
657
|
+
* open what it shows -- for an element Val does not tag by itself.
|
|
658
|
+
*
|
|
659
|
+
* `attrs(page)` is every path inside `page`. `attrs(post, "author")` is the
|
|
660
|
+
* one field: for an element that shows a value that is not text -- a
|
|
661
|
+
* `s.keyOf` key, a date, a colour -- which is never stega encoded, so nothing
|
|
662
|
+
* on the page says where it came from. A byline that shows the author a post
|
|
663
|
+
* points at is the post's `author` field, and a click on it should open that.
|
|
664
|
+
*/
|
|
665
|
+
|
|
666
|
+
function attrs(target, field) {
|
|
667
|
+
if (field !== undefined) {
|
|
668
|
+
var path = _typeof(target) === "object" && target !== null ? Internal.createValPathOfItem(Internal.getValPath(target), field) : undefined;
|
|
669
|
+
return path ? {
|
|
670
|
+
"data-val-path": path
|
|
671
|
+
} : {};
|
|
672
|
+
}
|
|
649
673
|
var allPaths = new Set();
|
|
650
674
|
function addPath(target) {
|
|
651
675
|
if (typeof target === "string") {
|
|
@@ -655,8 +679,8 @@ function attrs(target) {
|
|
|
655
679
|
_step;
|
|
656
680
|
try {
|
|
657
681
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
658
|
-
var
|
|
659
|
-
allPaths.add(
|
|
682
|
+
var _path = _step.value;
|
|
683
|
+
allPaths.add(_path);
|
|
660
684
|
}
|
|
661
685
|
} catch (err) {
|
|
662
686
|
_iterator.e(err);
|
|
@@ -666,9 +690,9 @@ function attrs(target) {
|
|
|
666
690
|
}
|
|
667
691
|
}
|
|
668
692
|
if (_typeof(target) === "object" && target !== null) {
|
|
669
|
-
var
|
|
670
|
-
if (
|
|
671
|
-
allPaths.add(
|
|
693
|
+
var _path2 = Internal.getValPath(target);
|
|
694
|
+
if (_path2) {
|
|
695
|
+
allPaths.add(_path2);
|
|
672
696
|
}
|
|
673
697
|
Object.values(target).forEach(addPath);
|
|
674
698
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-991f680f.browser.esm.js';
|
|
2
|
-
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-27e587b6.browser.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '../../dist/slicedToArray-8f9b0d84.browser.esm.js';
|
|
6
|
-
import '../../dist/typeof-9915e135.browser.esm.js';
|
|
7
6
|
import '../../dist/createForOfIteratorHelper-c0be3691.browser.esm.js';
|
|
7
|
+
import '../../dist/typeof-9915e135.browser.esm.js';
|
|
8
8
|
import '@valbuild/core';
|
|
9
9
|
import '@vercel/stega';
|
|
10
10
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var toConsumableArray = require('../../dist/toConsumableArray-d7cf1601.cjs.dev.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-400c4eba.cjs.dev.js');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
9
9
|
require('../../dist/slicedToArray-387314c6.cjs.dev.js');
|
|
10
|
-
require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
11
10
|
require('../../dist/createForOfIteratorHelper-8a871dc3.cjs.dev.js');
|
|
11
|
+
require('../../dist/typeof-b568f48f.cjs.dev.js');
|
|
12
12
|
require('@valbuild/core');
|
|
13
13
|
require('@vercel/stega');
|
|
14
14
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var toConsumableArray = require('../../dist/toConsumableArray-203e636a.cjs.prod.js');
|
|
6
|
-
var raw = require('../../dist/raw-
|
|
6
|
+
var raw = require('../../dist/raw-4870e29f.cjs.prod.js');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
|
9
9
|
require('../../dist/slicedToArray-64c83d56.cjs.prod.js');
|
|
10
|
-
require('../../dist/typeof-16428c61.cjs.prod.js');
|
|
11
10
|
require('../../dist/createForOfIteratorHelper-6f9dc6fa.cjs.prod.js');
|
|
11
|
+
require('../../dist/typeof-16428c61.cjs.prod.js');
|
|
12
12
|
require('@valbuild/core');
|
|
13
13
|
require('@vercel/stega');
|
|
14
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-c950e394.esm.js';
|
|
2
|
-
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-f1b35392.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '../../dist/slicedToArray-3d4c6640.esm.js';
|
|
6
|
-
import '../../dist/typeof-a1531d8f.esm.js';
|
|
7
6
|
import '../../dist/createForOfIteratorHelper-69c4a419.esm.js';
|
|
7
|
+
import '../../dist/typeof-a1531d8f.esm.js';
|
|
8
8
|
import '@valbuild/core';
|
|
9
9
|
import '@vercel/stega';
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-5335b4b0.worker.esm.js';
|
|
2
|
-
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-
|
|
2
|
+
import { _ as _objectSpread2, r as raw, c as attrs } from '../../dist/raw-7d65198e.worker.esm.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '../../dist/slicedToArray-8b1a55e5.worker.esm.js';
|
|
6
|
-
import '../../dist/typeof-e0c837cc.worker.esm.js';
|
|
7
6
|
import '../../dist/createForOfIteratorHelper-73fe9a1a.worker.esm.js';
|
|
7
|
+
import '../../dist/typeof-e0c837cc.worker.esm.js';
|
|
8
8
|
import '@valbuild/core';
|
|
9
9
|
import '@vercel/stega';
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/react",
|
|
3
|
-
"version": "0.148.
|
|
3
|
+
"version": "0.148.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Val - React internal helpers",
|
|
6
6
|
"repository": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@vercel/stega": "^1.1.0",
|
|
13
13
|
"base64-arraybuffer": "^1.0.2",
|
|
14
|
-
"@valbuild/core": "0.148.
|
|
15
|
-
"@valbuild/shared": "0.148.
|
|
16
|
-
"@valbuild/ui": "0.148.
|
|
14
|
+
"@valbuild/core": "0.148.7",
|
|
15
|
+
"@valbuild/shared": "0.148.7",
|
|
16
|
+
"@valbuild/ui": "0.148.7"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@testing-library/react": "^16.3.3",
|
|
@@ -6,8 +6,8 @@ import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
|
6
6
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { VERCEL_STEGA_REGEX, vercelStegaSplit } from '@vercel/stega';
|
|
9
|
-
import { s as stegaDecodeStrings } from '../../dist/raw-
|
|
10
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
9
|
+
import { s as stegaDecodeStrings } from '../../dist/raw-27e587b6.browser.esm.js';
|
|
10
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-27e587b6.browser.esm.js';
|
|
11
11
|
|
|
12
12
|
var isIntrinsicElement = function isIntrinsicElement(type) {
|
|
13
13
|
// TODO: think this is not correct, but good enough for now?
|
|
@@ -10,7 +10,7 @@ var ReactJSXRuntime = require('react/jsx-runtime');
|
|
|
10
10
|
var jsxRuntimeDev = require('react/jsx-dev-runtime');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var stega = require('@vercel/stega');
|
|
13
|
-
var raw = require('../../dist/raw-
|
|
13
|
+
var raw = require('../../dist/raw-400c4eba.cjs.dev.js');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
16
16
|
|
|
@@ -10,7 +10,7 @@ var ReactJSXRuntime = require('react/jsx-runtime');
|
|
|
10
10
|
var jsxRuntimeDev = require('react/jsx-dev-runtime');
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var stega = require('@vercel/stega');
|
|
13
|
-
var raw = require('../../dist/raw-
|
|
13
|
+
var raw = require('../../dist/raw-4870e29f.cjs.prod.js');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
16
16
|
|
|
@@ -6,8 +6,8 @@ import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
|
6
6
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { VERCEL_STEGA_REGEX, vercelStegaSplit } from '@vercel/stega';
|
|
9
|
-
import { s as stegaDecodeStrings } from '../../dist/raw-
|
|
10
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
9
|
+
import { s as stegaDecodeStrings } from '../../dist/raw-f1b35392.esm.js';
|
|
10
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-f1b35392.esm.js';
|
|
11
11
|
|
|
12
12
|
var isIntrinsicElement = function isIntrinsicElement(type) {
|
|
13
13
|
// TODO: think this is not correct, but good enough for now?
|
|
@@ -6,8 +6,8 @@ import ReactJSXRuntime__default from 'react/jsx-runtime';
|
|
|
6
6
|
import jsxRuntimeDev__default from 'react/jsx-dev-runtime';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { VERCEL_STEGA_REGEX, vercelStegaSplit } from '@vercel/stega';
|
|
9
|
-
import { s as stegaDecodeStrings } from '../../dist/raw-
|
|
10
|
-
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-
|
|
9
|
+
import { s as stegaDecodeStrings } from '../../dist/raw-7d65198e.worker.esm.js';
|
|
10
|
+
export { c as attrs, g as getModuleIds, r as raw, b as stegaClean, s as stegaDecodeStrings, a as stegaEncode } from '../../dist/raw-7d65198e.worker.esm.js';
|
|
11
11
|
|
|
12
12
|
var isIntrinsicElement = function isIntrinsicElement(type) {
|
|
13
13
|
// TODO: think this is not correct, but good enough for now?
|