@valbuild/react 0.154.1 → 0.154.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/CHANGELOG.md +36 -0
- package/analytics/dist/valbuild-react-analytics.browser.esm.js +2 -1
- package/analytics/dist/valbuild-react-analytics.cjs.dev.js +6 -5
- package/analytics/dist/valbuild-react-analytics.cjs.prod.js +6 -5
- package/analytics/dist/valbuild-react-analytics.esm.js +2 -1
- package/analytics/dist/valbuild-react-analytics.worker.esm.js +2 -1
- package/dist/ValComponentEditorChrome-440d086a.cjs.dev.js +966 -0
- package/dist/ValComponentEditorChrome-4ac9dc79.worker.esm.js +952 -0
- package/dist/ValComponentEditorChrome-93321513.esm.js +952 -0
- package/dist/ValComponentEditorChrome-bf2fefc6.browser.esm.js +952 -0
- package/dist/ValComponentEditorChrome-c0b30556.cjs.js +7 -0
- package/dist/ValComponentEditorChrome-c0b30556.cjs.prod.js +966 -0
- package/dist/ValPreviewBridgeCore-00015d00.esm.js +157 -0
- package/dist/ValPreviewBridgeCore-023ffffb.browser.esm.js +157 -0
- package/dist/ValPreviewBridgeCore-9b984cb0.cjs.js +7 -0
- package/dist/ValPreviewBridgeCore-9b984cb0.cjs.prod.js +161 -0
- package/dist/ValPreviewBridgeCore-bbedf957.cjs.dev.js +161 -0
- package/dist/ValPreviewBridgeCore-e0d5a840.worker.esm.js +157 -0
- package/dist/{createForOfIteratorHelper-598a2f85.cjs.prod.js → createForOfIteratorHelper-6f9dc6fa.cjs.prod.js} +0 -17
- package/dist/{createForOfIteratorHelper-522d616d.cjs.dev.js → createForOfIteratorHelper-8a871dc3.cjs.dev.js} +0 -17
- package/dist/{createForOfIteratorHelper-595d57b7.esm.js → createForOfIteratorHelper-8bd0009a.browser.esm.js} +2 -18
- package/dist/{createForOfIteratorHelper-548f1578.worker.esm.js → createForOfIteratorHelper-93215c75.worker.esm.js} +2 -18
- package/dist/{createForOfIteratorHelper-3316a633.browser.esm.js → createForOfIteratorHelper-9b22d0cd.esm.js} +2 -18
- package/dist/declarations/src/internal/ValComponentEditor.d.ts +54 -0
- package/dist/declarations/src/internal/ValPreviewBridgeCore.d.ts +22 -0
- package/dist/declarations/src/internal/componentPreview.d.ts +39 -0
- package/dist/declarations/src/internal/index.d.ts +3 -0
- package/dist/declarations/src/read/jsonValues.d.ts +2 -0
- package/dist/declarations/src/stega/stegaEncode.d.ts +9 -218
- package/dist/objectSpread2-3c87fb4f.cjs.prod.js +52 -0
- package/dist/objectSpread2-69569a13.worker.esm.js +48 -0
- package/dist/objectSpread2-792eb2c2.cjs.dev.js +52 -0
- package/dist/objectSpread2-af6b2a44.browser.esm.js +48 -0
- package/dist/objectSpread2-be6bfc61.esm.js +48 -0
- package/dist/{raw-15ce77ae.browser.esm.js → raw-0561be8e.browser.esm.js} +81 -90
- package/dist/{raw-d504f4fd.cjs.prod.js → raw-a69a8d13.cjs.prod.js} +80 -92
- package/dist/{raw-534fcde0.esm.js → raw-aa7a3ac4.esm.js} +81 -90
- package/dist/{raw-67d24dd6.cjs.dev.js → raw-de032c12.cjs.dev.js} +80 -92
- package/dist/{raw-645a854a.worker.esm.js → raw-f32dca84.worker.esm.js} +81 -90
- package/dist/toConsumableArray-203e636a.cjs.prod.js +21 -0
- package/dist/toConsumableArray-257d6741.esm.js +19 -0
- package/dist/toConsumableArray-2fc46f85.browser.esm.js +19 -0
- package/dist/toConsumableArray-d7cf1601.cjs.dev.js +21 -0
- package/dist/toConsumableArray-e4f48095.worker.esm.js +19 -0
- package/internal/dist/valbuild-react-internal.browser.esm.js +405 -7
- package/internal/dist/valbuild-react-internal.cjs.dev.js +430 -24
- package/internal/dist/valbuild-react-internal.cjs.prod.js +430 -24
- package/internal/dist/valbuild-react-internal.esm.js +405 -7
- package/internal/dist/valbuild-react-internal.worker.esm.js +405 -7
- package/package.json +4 -4
- package/stega/dist/valbuild-react-stega.browser.esm.js +5 -3
- package/stega/dist/valbuild-react-stega.cjs.dev.js +11 -9
- package/stega/dist/valbuild-react-stega.cjs.prod.js +11 -9
- package/stega/dist/valbuild-react-stega.esm.js +5 -3
- package/stega/dist/valbuild-react-stega.worker.esm.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @valbuild/react
|
|
2
2
|
|
|
3
|
+
## 0.154.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1049](https://github.com/valbuild/val/pull/1049) [`d90b9e2`](https://github.com/valbuild/val/commit/d90b9e2f856d4023821698cd22b4fbbab046c2ff) Thanks [@freekh](https://github.com/freekh)! - Experimental: link an object to the component that renders it, and let Val render and arrange it
|
|
8
|
+
|
|
9
|
+
`s.object(...).component(() => import("./Hero"))` links an object schema to a component. The link is type checked against the component's own props: when the object's fields are the props nothing else is needed, and for any other component a `props` function says how to make them.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
export const heroFields = s.object({
|
|
13
|
+
type: s.literal("hero"),
|
|
14
|
+
title: s.string(),
|
|
15
|
+
});
|
|
16
|
+
export const hero = heroFields.component(() => import("../components/Hero"));
|
|
17
|
+
|
|
18
|
+
export const note = s
|
|
19
|
+
.object({ type: s.literal("note"), title: s.string(), urgent: s.boolean() })
|
|
20
|
+
.component(() => import("../components/Callout"), {
|
|
21
|
+
props: (note) => ({
|
|
22
|
+
heading: note.title,
|
|
23
|
+
tone: note.urgent ? "warning" : "info",
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`<ValComponentEditor value={page.sections} />`, from `@valbuild/tanstack` and `@valbuild/next`, renders a list of linked objects (or a single one) with their components, with no map from a `type` to a component to keep. It only accepts values that are linked: a list with a variant that has no component is a type error. It is optional, and a component can use it for a list of components of its own.
|
|
29
|
+
|
|
30
|
+
In Val Studio, a list rendered this way can be arranged on the page itself: drag a section to another place, add one between two others, or remove one.
|
|
31
|
+
|
|
32
|
+
This replaces the experimental `.render({ as: "component", component })` on objects. Move its `component` to the first argument of `.component()` and the rest of its options to the second.
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [[`d90b9e2`](https://github.com/valbuild/val/commit/d90b9e2f856d4023821698cd22b4fbbab046c2ff), [`a52c184`](https://github.com/valbuild/val/commit/a52c184687849ba9c2c2a4929871b60502a6ee55), [`6c26409`](https://github.com/valbuild/val/commit/6c2640966779e20931672dc78ff6e3c0d19e4183), [`d90b9e2`](https://github.com/valbuild/val/commit/d90b9e2f856d4023821698cd22b4fbbab046c2ff)]:
|
|
35
|
+
- @valbuild/core@0.154.2
|
|
36
|
+
- @valbuild/shared@0.154.2
|
|
37
|
+
- @valbuild/ui@0.154.2
|
|
38
|
+
|
|
3
39
|
## 0.154.1
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _ as _slicedToArray } from '../../dist/slicedToArray-b66ff800.browser.esm.js';
|
|
2
|
-
import { _ as _toConsumableArray
|
|
2
|
+
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-2fc46f85.browser.esm.js';
|
|
3
|
+
import { _ as _createForOfIteratorHelper } from '../../dist/createForOfIteratorHelper-8bd0009a.browser.esm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The analytics wire format, version 1: what the browser sends to
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-387314c6.cjs.dev.js');
|
|
6
|
-
var
|
|
6
|
+
var toConsumableArray = require('../../dist/toConsumableArray-d7cf1601.cjs.dev.js');
|
|
7
|
+
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-8a871dc3.cjs.dev.js');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* The analytics wire format, version 1: what the browser sends to
|
|
@@ -131,9 +132,9 @@ function buildBeacons(args) {
|
|
|
131
132
|
modulePath: modulePath
|
|
132
133
|
}];
|
|
133
134
|
};
|
|
134
|
-
var all = [].concat(
|
|
135
|
+
var all = [].concat(toConsumableArray._toConsumableArray(args.rendered.flatMap(function (path) {
|
|
135
136
|
return counted("rendered", path);
|
|
136
|
-
})),
|
|
137
|
+
})), toConsumableArray._toConsumableArray(args.viewed.flatMap(function (path) {
|
|
137
138
|
return counted("viewed", path);
|
|
138
139
|
})));
|
|
139
140
|
if (all.length === 0 && !args.view) {
|
|
@@ -595,7 +596,7 @@ function startNow(options) {
|
|
|
595
596
|
if (carried.size === 0) {
|
|
596
597
|
return;
|
|
597
598
|
}
|
|
598
|
-
var kept =
|
|
599
|
+
var kept = toConsumableArray._toConsumableArray(carried);
|
|
599
600
|
carried.clear();
|
|
600
601
|
var _iterator6 = createForOfIteratorHelper._createForOfIteratorHelper(kept),
|
|
601
602
|
_step6;
|
|
@@ -754,7 +755,7 @@ function startNow(options) {
|
|
|
754
755
|
clearViewTimers();
|
|
755
756
|
// Observe everything afresh, so what is already on screen reports itself
|
|
756
757
|
// to the new page view.
|
|
757
|
-
for (var _i2 = 0, _arr =
|
|
758
|
+
for (var _i2 = 0, _arr = toConsumableArray._toConsumableArray(observed); _i2 < _arr.length; _i2++) {
|
|
758
759
|
var element = _arr[_i2];
|
|
759
760
|
forget(element);
|
|
760
761
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var slicedToArray = require('../../dist/slicedToArray-64c83d56.cjs.prod.js');
|
|
6
|
-
var
|
|
6
|
+
var toConsumableArray = require('../../dist/toConsumableArray-203e636a.cjs.prod.js');
|
|
7
|
+
var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-6f9dc6fa.cjs.prod.js');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* The analytics wire format, version 1: what the browser sends to
|
|
@@ -131,9 +132,9 @@ function buildBeacons(args) {
|
|
|
131
132
|
modulePath: modulePath
|
|
132
133
|
}];
|
|
133
134
|
};
|
|
134
|
-
var all = [].concat(
|
|
135
|
+
var all = [].concat(toConsumableArray._toConsumableArray(args.rendered.flatMap(function (path) {
|
|
135
136
|
return counted("rendered", path);
|
|
136
|
-
})),
|
|
137
|
+
})), toConsumableArray._toConsumableArray(args.viewed.flatMap(function (path) {
|
|
137
138
|
return counted("viewed", path);
|
|
138
139
|
})));
|
|
139
140
|
if (all.length === 0 && !args.view) {
|
|
@@ -595,7 +596,7 @@ function startNow(options) {
|
|
|
595
596
|
if (carried.size === 0) {
|
|
596
597
|
return;
|
|
597
598
|
}
|
|
598
|
-
var kept =
|
|
599
|
+
var kept = toConsumableArray._toConsumableArray(carried);
|
|
599
600
|
carried.clear();
|
|
600
601
|
var _iterator6 = createForOfIteratorHelper._createForOfIteratorHelper(kept),
|
|
601
602
|
_step6;
|
|
@@ -754,7 +755,7 @@ function startNow(options) {
|
|
|
754
755
|
clearViewTimers();
|
|
755
756
|
// Observe everything afresh, so what is already on screen reports itself
|
|
756
757
|
// to the new page view.
|
|
757
|
-
for (var _i2 = 0, _arr =
|
|
758
|
+
for (var _i2 = 0, _arr = toConsumableArray._toConsumableArray(observed); _i2 < _arr.length; _i2++) {
|
|
758
759
|
var element = _arr[_i2];
|
|
759
760
|
forget(element);
|
|
760
761
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _ as _slicedToArray } from '../../dist/slicedToArray-70ecb9da.esm.js';
|
|
2
|
-
import { _ as _toConsumableArray
|
|
2
|
+
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-257d6741.esm.js';
|
|
3
|
+
import { _ as _createForOfIteratorHelper } from '../../dist/createForOfIteratorHelper-9b22d0cd.esm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The analytics wire format, version 1: what the browser sends to
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { _ as _toConsumableArray
|
|
1
|
+
import { _ as _toConsumableArray } from '../../dist/toConsumableArray-e4f48095.worker.esm.js';
|
|
2
2
|
import { _ as _slicedToArray } from '../../dist/slicedToArray-106ca5f3.worker.esm.js';
|
|
3
|
+
import { _ as _createForOfIteratorHelper } from '../../dist/createForOfIteratorHelper-93215c75.worker.esm.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* The analytics wire format, version 1: what the browser sends to
|