@valbuild/next 0.140.0 → 0.141.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/{ValCanvasBridge-32019a44.cjs.dev.js → ValCanvasBridge-39f6f408.cjs.dev.js} +13 -1
  3. package/dist/ValCanvasBridge-c790b144.cjs.js +7 -0
  4. package/dist/{ValCanvasBridge-5e9c64d6.cjs.prod.js → ValCanvasBridge-c790b144.cjs.prod.js} +13 -1
  5. package/dist/{ValCanvasBridge-04ac50e6.esm.js → ValCanvasBridge-df3d3df2.esm.js} +13 -1
  6. package/dist/ValNextProvider-062a8dc9.cjs.dev.js +1 -1
  7. package/dist/ValNextProvider-3d2cd7e4.esm.js +1 -1
  8. package/dist/ValNextProvider-da189afe.cjs.prod.js +1 -1
  9. package/dist/ValVideo-19f2ab05.esm.js +150 -0
  10. package/dist/ValVideo-94e5aa28.cjs.js +7 -0
  11. package/dist/ValVideo-94e5aa28.cjs.prod.js +154 -0
  12. package/dist/ValVideo-b8130c1b.cjs.dev.js +154 -0
  13. package/dist/declarations/src/ValVideo.d.ts +50 -0
  14. package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +3 -2
  15. package/dist/objectWithoutProperties-107dcb46.cjs.prod.js +32 -0
  16. package/dist/objectWithoutProperties-2daec22c.esm.js +29 -0
  17. package/dist/objectWithoutProperties-8f93848f.cjs.dev.js +32 -0
  18. package/dist/valbuild-next.cjs.dev.js +11 -31
  19. package/dist/valbuild-next.cjs.prod.js +11 -31
  20. package/dist/valbuild-next.esm.js +4 -28
  21. package/dist/{version-08273b57.cjs.prod.js → version-98e6df51.cjs.prod.js} +1 -1
  22. package/dist/{version-f6392077.cjs.dev.js → version-c3305b8b.cjs.dev.js} +1 -1
  23. package/dist/{version-7433b2e3.esm.js → version-d2b7a21e.esm.js} +1 -1
  24. package/package.json +8 -8
  25. package/rsc/dist/valbuild-next-rsc.cjs.dev.js +1 -1
  26. package/rsc/dist/valbuild-next-rsc.cjs.prod.js +1 -1
  27. package/rsc/dist/valbuild-next-rsc.esm.js +1 -1
  28. package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
  29. package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
  30. package/server/dist/valbuild-next-server.esm.js +1 -1
  31. package/dist/ValCanvasBridge-5e9c64d6.cjs.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # @valbuild/next
2
2
 
3
+ ## 0.141.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#779](https://github.com/valbuild/val/pull/779) [`ba3f330`](https://github.com/valbuild/val/commit/ba3f3300a3dd8649e154097cdfca3b64db209d89) Thanks [@freekh](https://github.com/freekh)! - New: `s.video()`, for mp4/WebM files and HLS streams.
8
+
9
+ ```ts
10
+ const schema = s.object({
11
+ intro: s.video({ stream: { type: "hls" } }),
12
+ });
13
+ ```
14
+
15
+ - **Upload and play in the Studio.** A video field shows a player, the file's size and length, and progress while it uploads.
16
+ - **HLS streaming without a video service.** With `stream: { type: "hls" }`, the Studio converts an upload to an HLS stream in the editor's browser before it uploads it. It makes one H.264 rendition per height (1080p, 720p and 480p by default, and never larger than the upload) and stores them as a folder of files next to your other uploads. Nothing is installed in your app for this: the converter ships inside the Studio and is only downloaded when someone uploads to a streaming field. A browser that can't convert (no WebCodecs, or a non-https address) uploads the original file and says so.
17
+ - **Poster:** pause on a frame and choose "Use current frame". The frame is saved as an image, and `posterTime` records where it was taken.
18
+ - **Start and end:** play part of a video without cutting the file.
19
+ - **Focal point:** marks what must stay in frame when the page crops the video.
20
+ - **Description:** text for people who can't see the video.
21
+ - **Captions:** one WebVTT file per language. `.srt` files are converted on upload.
22
+ - **`<ValVideo>`** in `@valbuild/next` and `@valbuild/tanstack` renders all of the above and is click-to-edit. For HLS in browsers that can't play it natively, pass `hls={() => import("hls.js")}`. It is only loaded when it's needed.
23
+ - **Rename** a video in the Studio. An HLS stream is renamed as a whole: every playlist and segment moves to the new folder.
24
+ - `npx val validate --fix` fills in `mimeType`, `width`, `height` and `duration` for a hand-written `.mp4`, `.mov`, `.webm`, `.mkv` or HLS video, on disk or on Val Remote. A remote video is not downloaded: only its headers are read, usually in one to three small requests.
25
+ - `.remote()` works for videos. `npx val validate --fix` moves a video to Val Remote, or back into the project, together with its poster, captions and every file of an HLS stream.
26
+
27
+ A video value always has a `mimeType`: it is how a page knows whether it has an `.mp4` or an `.m3u8`.
28
+
29
+ New: `s.videoset()`, a collection of videos, like `s.imageset()` for images.
30
+
31
+ ```ts
32
+ const videosVal = c.define(
33
+ "/content/videos.val.ts",
34
+ s.videoset({ dir: "/public/val/videos", stream: { type: "hls" } }),
35
+ {},
36
+ );
37
+ const schema = s.object({ intro: s.video(videosVal) });
38
+ ```
39
+
40
+ - **Upload once, set it up once, use anywhere.** A set's entry holds what is true of the file (its type, size and length) and, as defaults, a description, poster, start and end, focal point and captions. A field that picks from the set (`s.video(videosVal)`) gets all of those, and can override any of them on its own. For example, the same clip can open one page at 0:02 and every other page where the set says.
41
+ - **Media in the Studio.** A set is listed under Media and opens as a gallery of videos, with each video's poster as its thumbnail. Hovering a video previews it, and the selected video plays in a real player (HLS streams too) beside the poster, times, focal point and captions you edit for it. You can upload into the set (with `stream`, uploads become HLS streams, and each upload gets a poster), rename a video, and delete a video that nothing uses. Renaming a video updates every field that uses it. An HLS stream is one entry, and renaming or deleting it moves or removes all of its files.
42
+ - **Picking.** A set-backed field picks from the set, or uploads into it. Each value the set provides is marked "From gallery · Override", and once overridden, "Overridden · Use gallery's".
43
+ - `useVal` and `fetchVal` fill in what the set holds (`mimeType`, `width`, `height`, `duration`, and every default the field does not override), so `<ValVideo>` works the same either way.
44
+ - `.remote()` works for sets. `npx val validate --fix` fills in missing metadata for an entry, adds untracked videos found in the set's directory, and moves a set's videos to Val Remote.
45
+
46
+ Image and file galleries use the same new gallery layout: a grid or list of entries, with the selected one open in a panel beside it.
47
+
48
+ - An `s.imageset()` entry can hold a default focal point, as well as its description. An `s.image(galleryVal)` field shows both, and can override either.
49
+ - Fixed: outside draft mode, `useVal` and `fetchVal` now fill a gallery-backed image or file from its gallery (dimensions, mime type, description). Before, a published page got only the `path`.
50
+
51
+ ### Patch Changes
52
+
53
+ - [#801](https://github.com/valbuild/val/pull/801) [`9cbe428`](https://github.com/valbuild/val/commit/9cbe42895d006d55c3d993dc27f0779808b85306) Thanks [@freekh](https://github.com/freekh)! - Emptying a field in the preview's "On this page" list no longer removes it from the list while you are editing it.
54
+
55
+ The list shows what the page renders, and a field you empty often renders nothing: an empty rich text, an image set to none, or a link whose label was cleared. The row you were typing in used to vanish, taking your cursor with it, and clearing a link's label also removed its URL from the list. Now a field you have worked on stays where it was, marked "Not on page", until you reload the page with the canvas's reload button or go to another page. A field you delete from the content, such as a removed list item, still goes away at once.
56
+
57
+ - Updated dependencies [[`199e214`](https://github.com/valbuild/val/commit/199e21471d98806fb34c579cb876560078c928b9), [`9cbe428`](https://github.com/valbuild/val/commit/9cbe42895d006d55c3d993dc27f0779808b85306), [`fb5f097`](https://github.com/valbuild/val/commit/fb5f09721ac07f4d90b8502fdbee3fb3884d9688), [`6473a2e`](https://github.com/valbuild/val/commit/6473a2efe874f1749b27ed6f8ac4e0d19805edb1), [`ba3f330`](https://github.com/valbuild/val/commit/ba3f3300a3dd8649e154097cdfca3b64db209d89)]:
58
+ - @valbuild/core@0.141.0
59
+ - @valbuild/server@0.141.0
60
+ - @valbuild/shared@0.141.0
61
+ - @valbuild/ui@0.141.0
62
+ - @valbuild/language-server@0.141.0
63
+ - @valbuild/react@0.141.0
64
+ - @valbuild/mcp@0.141.0
65
+
66
+ ## 0.140.2
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [[`df1e5f5`](https://github.com/valbuild/val/commit/df1e5f5f94391f25c71839cc476a51198b90db4d)]:
71
+ - @valbuild/ui@0.140.2
72
+ - @valbuild/server@0.140.2
73
+ - @valbuild/shared@0.140.2
74
+ - @valbuild/react@0.140.2
75
+ - @valbuild/language-server@0.140.2
76
+ - @valbuild/mcp@0.140.2
77
+
3
78
  ## 0.140.0
4
79
 
5
80
  ### Patch Changes
@@ -107,8 +107,20 @@ function ValCanvasBridge(_ref) {
107
107
  measured = parent;
108
108
  }
109
109
  }
110
+ /**
111
+ * Skipped only when it has no box at all — `display: none`, or inside
112
+ * something that is — and NOT when the box is merely empty.
113
+ *
114
+ * A field emptied in the Studio is still on the page: an inline element
115
+ * whose only text is the invisible edit tag measures 0×0, and it is the
116
+ * field being edited. Dropping it took the field out of the Studio's
117
+ * "On this page" column mid-edit, and with it every other path on the
118
+ * same element: clearing a link's label also removed its `href`. What the
119
+ * column needs to know is whether the content is on the page, and an
120
+ * empty box answers yes.
121
+ */
122
+ if (measured.getClientRects().length === 0) return;
110
123
  var rect = measured.getBoundingClientRect();
111
- if (rect.width === 0 && rect.height === 0) return;
112
124
  elements.push({
113
125
  // Split by the same helper the rest of Val uses, so the studio gets
114
126
  // the paths back in exactly the form it holds them in.
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./ValCanvasBridge-c790b144.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./ValCanvasBridge-c790b144.cjs.dev.js");
7
+ }
@@ -107,8 +107,20 @@ function ValCanvasBridge(_ref) {
107
107
  measured = parent;
108
108
  }
109
109
  }
110
+ /**
111
+ * Skipped only when it has no box at all — `display: none`, or inside
112
+ * something that is — and NOT when the box is merely empty.
113
+ *
114
+ * A field emptied in the Studio is still on the page: an inline element
115
+ * whose only text is the invisible edit tag measures 0×0, and it is the
116
+ * field being edited. Dropping it took the field out of the Studio's
117
+ * "On this page" column mid-edit, and with it every other path on the
118
+ * same element: clearing a link's label also removed its `href`. What the
119
+ * column needs to know is whether the content is on the page, and an
120
+ * empty box answers yes.
121
+ */
122
+ if (measured.getClientRects().length === 0) return;
110
123
  var rect = measured.getBoundingClientRect();
111
- if (rect.width === 0 && rect.height === 0) return;
112
124
  elements.push({
113
125
  // Split by the same helper the rest of Val uses, so the studio gets
114
126
  // the paths back in exactly the form it holds them in.
@@ -99,8 +99,20 @@ function ValCanvasBridge(_ref) {
99
99
  measured = parent;
100
100
  }
101
101
  }
102
+ /**
103
+ * Skipped only when it has no box at all — `display: none`, or inside
104
+ * something that is — and NOT when the box is merely empty.
105
+ *
106
+ * A field emptied in the Studio is still on the page: an inline element
107
+ * whose only text is the invisible edit tag measures 0×0, and it is the
108
+ * field being edited. Dropping it took the field out of the Studio's
109
+ * "On this page" column mid-edit, and with it every other path on the
110
+ * same element: clearing a link's label also removed its `href`. What the
111
+ * column needs to know is whether the content is on the page, and an
112
+ * empty box answers yes.
113
+ */
114
+ if (measured.getClientRects().length === 0) return;
102
115
  var rect = measured.getBoundingClientRect();
103
- if (rect.width === 0 && rect.height === 0) return;
104
116
  elements.push({
105
117
  // Split by the same helper the rest of Val uses, so the studio gets
106
118
  // the paths back in exactly the form it holds them in.
@@ -16,7 +16,7 @@ var stega = require('@valbuild/react/stega');
16
16
  var fallbackColors = require('./fallbackColors-080c1bbc.cjs.dev.js');
17
17
  var client = require('@valbuild/shared/client');
18
18
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
19
- var ValCanvasBridge = require('./ValCanvasBridge-32019a44.cjs.dev.js');
19
+ var ValCanvasBridge = require('./ValCanvasBridge-39f6f408.cjs.dev.js');
20
20
  var jsxRuntime = require('react/jsx-runtime');
21
21
  require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
22
22
  require('./defineProperty-f90345d7.cjs.dev.js');
@@ -12,7 +12,7 @@ import { SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
12
12
  import { p as prefixStyles, u as useConfigStorageSave, f as floatDarkBg, d as floatLightBg, v as valPrefixedClass, c as cn } from './fallbackColors-149dfbc9.esm.js';
13
13
  import { VAL_THEME_SESSION_STORAGE_KEY, isValCanvasFrame } from '@valbuild/shared/client';
14
14
  import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
15
- import { ValCanvasBridge } from './ValCanvasBridge-04ac50e6.esm.js';
15
+ import { ValCanvasBridge } from './ValCanvasBridge-df3d3df2.esm.js';
16
16
  import { jsxs, jsx } from 'react/jsx-runtime';
17
17
  import './unsupportedIterableToArray-5baabfdc.esm.js';
18
18
  import './defineProperty-cca5affa.esm.js';
@@ -16,7 +16,7 @@ var stega = require('@valbuild/react/stega');
16
16
  var fallbackColors = require('./fallbackColors-e1d73b36.cjs.prod.js');
17
17
  var client = require('@valbuild/shared/client');
18
18
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
19
- var ValCanvasBridge = require('./ValCanvasBridge-5e9c64d6.cjs.prod.js');
19
+ var ValCanvasBridge = require('./ValCanvasBridge-c790b144.cjs.prod.js');
20
20
  var jsxRuntime = require('react/jsx-runtime');
21
21
  require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
22
22
  require('./defineProperty-8951f469.cjs.prod.js');
@@ -0,0 +1,150 @@
1
+ 'use client';
2
+ import { _ as _objectSpread2 } from './objectSpread2-60d1bd93.esm.js';
3
+ import { _ as _objectWithoutProperties, d as decodeValPathsOfString } from './objectWithoutProperties-2daec22c.esm.js';
4
+ import { useRef, useEffect } from 'react';
5
+ import { raw } from '@valbuild/react/stega';
6
+ import { jsx } from 'react/jsx-runtime';
7
+ import './defineProperty-cca5affa.esm.js';
8
+
9
+ var _excluded = ["src", "hls", "disableHotspot", "disableCaptions", "style", "width", "height"];
10
+ /**
11
+ * A `<video>` for a Val video, with everything the Studio lets an editor set:
12
+ * the poster, the caption tracks, the start and end time, and the focal point
13
+ * as `object-position`. Like `ValImage`, the edit tag on `src.url` is moved to
14
+ * `data-val-path`, so the video is click-to-edit and the URL the browser
15
+ * fetches is clean.
16
+ *
17
+ * Start and end are applied by the player rather than by cutting the file: it
18
+ * seeks to `startTime` when the video loads and pauses at `endTime`. For a
19
+ * progressive file the `#t=` media fragment says the same thing to the
20
+ * browser before any script runs.
21
+ */
22
+ function ValVideo(props) {
23
+ var _src$mimeType, _src$poster, _rest$ariaLabel, _src$captions;
24
+ var src = props.src,
25
+ hls = props.hls,
26
+ disableHotspot = props.disableHotspot,
27
+ disableCaptions = props.disableCaptions,
28
+ style = props.style,
29
+ width = props.width,
30
+ height = props.height,
31
+ rest = _objectWithoutProperties(props, _excluded);
32
+ var ref = useRef(null);
33
+ /** The latest loader, read when a stream is attached; see the effect below. */
34
+ var hlsRef = useRef(hls);
35
+ useEffect(function () {
36
+ hlsRef.current = hls;
37
+ }, [hls]);
38
+ var hasHls = hls !== undefined;
39
+ var valPathsOfUrl = src !== null && src !== void 0 && src.url ? decodeValPathsOfString(src.url) : undefined;
40
+ var url = src !== null && src !== void 0 && src.url ? valPathsOfUrl && valPathsOfUrl.length > 0 ? raw(src.url) : src.url : undefined;
41
+ var isHls = (src === null || src === void 0 ? void 0 : src.mimeType) === "application/vnd.apple.mpegurl" || (src === null || src === void 0 || (_src$mimeType = src.mimeType) === null || _src$mimeType === void 0 ? void 0 : _src$mimeType.toLowerCase()) === "application/x-mpegurl";
42
+ var startTime = src === null || src === void 0 ? void 0 : src.startTime;
43
+ var endTime = src === null || src === void 0 ? void 0 : src.endTime;
44
+ useEffect(function () {
45
+ var video = ref.current;
46
+ if (!video || !url) {
47
+ return;
48
+ }
49
+ if (!isHls || video.canPlayType("application/vnd.apple.mpegurl") !== "") {
50
+ video.src = !isHls && (startTime !== undefined || endTime !== undefined) ? "".concat(url, "#t=").concat(startTime !== null && startTime !== void 0 ? startTime : 0).concat(endTime !== undefined ? ",".concat(endTime) : "") : url;
51
+ return function () {
52
+ video.removeAttribute("src");
53
+ video.load();
54
+ };
55
+ }
56
+ var loadHls = hlsRef.current;
57
+ if (!loadHls) {
58
+ console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
59
+ return;
60
+ }
61
+ var destroyed = false;
62
+ var instance = null;
63
+ loadHls().then(function (_ref) {
64
+ var Hls = _ref["default"];
65
+ if (destroyed || !Hls.isSupported()) {
66
+ return;
67
+ }
68
+ instance = new Hls();
69
+ instance.loadSource(url);
70
+ instance.attachMedia(video);
71
+ });
72
+ return function () {
73
+ var _instance;
74
+ destroyed = true;
75
+ (_instance = instance) === null || _instance === void 0 || _instance.destroy();
76
+ };
77
+ // `hasHls`, not `hls`: the loader is passed inline (`hls={() => import(…)}`),
78
+ // so its identity changes on every render of the parent, and depending on
79
+ // it tore playback down and started it again for a render that changed
80
+ // nothing about the video.
81
+ }, [url, isHls, hasHls, startTime, endTime]);
82
+ useEffect(function () {
83
+ var video = ref.current;
84
+ if (!video || startTime === undefined && endTime === undefined) {
85
+ return;
86
+ }
87
+ var onLoaded = function onLoaded() {
88
+ if (startTime !== undefined && video.currentTime < startTime) {
89
+ video.currentTime = startTime;
90
+ }
91
+ };
92
+ var onTimeUpdate = function onTimeUpdate() {
93
+ if (endTime !== undefined && video.currentTime >= endTime) {
94
+ if (video.loop) {
95
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
96
+ } else {
97
+ video.pause();
98
+ }
99
+ }
100
+ };
101
+ // Play pressed at the end (or before the start): from the start again.
102
+ // Without this a video stopped at its end could not be played again —
103
+ // every play landed past the end and was paused on the next tick.
104
+ var onPlay = function onPlay() {
105
+ if (endTime !== undefined && video.currentTime >= endTime || startTime !== undefined && video.currentTime < startTime) {
106
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
107
+ }
108
+ };
109
+ video.addEventListener("loadedmetadata", onLoaded);
110
+ video.addEventListener("timeupdate", onTimeUpdate);
111
+ video.addEventListener("play", onPlay);
112
+ return function () {
113
+ video.removeEventListener("loadedmetadata", onLoaded);
114
+ video.removeEventListener("timeupdate", onTimeUpdate);
115
+ video.removeEventListener("play", onPlay);
116
+ };
117
+ }, [startTime, endTime]);
118
+ var hotspot = src === null || src === void 0 ? void 0 : src.hotspot;
119
+ var videoStyle = hotspot && !disableHotspot ? _objectSpread2(_objectSpread2({}, style), {}, {
120
+ objectPosition: "".concat(hotspot.x * 100, "% ").concat(hotspot.y * 100, "%")
121
+ }) : style;
122
+ // As for `ValImage`: the file's own size reserves the space, unless the
123
+ // caller is sizing the element.
124
+ var preferMetadataDims = ((src === null || src === void 0 ? void 0 : src.width) !== undefined || (src === null || src === void 0 ? void 0 : src.height) !== undefined) && !width && !height;
125
+ return /*#__PURE__*/jsx("video", _objectSpread2(_objectSpread2({
126
+ playsInline: true,
127
+ preload: "metadata"
128
+ }, rest), {}, {
129
+ ref: ref,
130
+ poster: src === null || src === void 0 || (_src$poster = src.poster) === null || _src$poster === void 0 ? void 0 : _src$poster.url,
131
+ "aria-label": (_rest$ariaLabel = rest["aria-label"]) !== null && _rest$ariaLabel !== void 0 ? _rest$ariaLabel : src !== null && src !== void 0 && src.alt ? raw(src.alt) : undefined,
132
+ "data-val-path": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
133
+ "data-val-attr-src": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
134
+ style: videoStyle,
135
+ width: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.width : width,
136
+ height: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.height : height,
137
+ children: !disableCaptions && (src === null || src === void 0 || (_src$captions = src.captions) === null || _src$captions === void 0 ? void 0 : _src$captions.map(function (track) {
138
+ var _track$kind;
139
+ return /*#__PURE__*/jsx("track", {
140
+ src: track.url,
141
+ srcLang: track.srclang,
142
+ label: track.label ? raw(track.label) : track.srclang,
143
+ kind: (_track$kind = track.kind) !== null && _track$kind !== void 0 ? _track$kind : "subtitles",
144
+ "default": track["default"]
145
+ }, track.url);
146
+ }))
147
+ }));
148
+ }
149
+
150
+ export { ValVideo };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./ValVideo-94e5aa28.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./ValVideo-94e5aa28.cjs.dev.js");
7
+ }
@@ -0,0 +1,154 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var objectSpread2 = require('./objectSpread2-13f847a9.cjs.prod.js');
7
+ var objectWithoutProperties = require('./objectWithoutProperties-107dcb46.cjs.prod.js');
8
+ var React = require('react');
9
+ var stega = require('@valbuild/react/stega');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ require('./defineProperty-8951f469.cjs.prod.js');
12
+
13
+ var _excluded = ["src", "hls", "disableHotspot", "disableCaptions", "style", "width", "height"];
14
+ /**
15
+ * A `<video>` for a Val video, with everything the Studio lets an editor set:
16
+ * the poster, the caption tracks, the start and end time, and the focal point
17
+ * as `object-position`. Like `ValImage`, the edit tag on `src.url` is moved to
18
+ * `data-val-path`, so the video is click-to-edit and the URL the browser
19
+ * fetches is clean.
20
+ *
21
+ * Start and end are applied by the player rather than by cutting the file: it
22
+ * seeks to `startTime` when the video loads and pauses at `endTime`. For a
23
+ * progressive file the `#t=` media fragment says the same thing to the
24
+ * browser before any script runs.
25
+ */
26
+ function ValVideo(props) {
27
+ var _src$mimeType, _src$poster, _rest$ariaLabel, _src$captions;
28
+ var src = props.src,
29
+ hls = props.hls,
30
+ disableHotspot = props.disableHotspot,
31
+ disableCaptions = props.disableCaptions,
32
+ style = props.style,
33
+ width = props.width,
34
+ height = props.height,
35
+ rest = objectWithoutProperties._objectWithoutProperties(props, _excluded);
36
+ var ref = React.useRef(null);
37
+ /** The latest loader, read when a stream is attached; see the effect below. */
38
+ var hlsRef = React.useRef(hls);
39
+ React.useEffect(function () {
40
+ hlsRef.current = hls;
41
+ }, [hls]);
42
+ var hasHls = hls !== undefined;
43
+ var valPathsOfUrl = src !== null && src !== void 0 && src.url ? objectWithoutProperties.decodeValPathsOfString(src.url) : undefined;
44
+ var url = src !== null && src !== void 0 && src.url ? valPathsOfUrl && valPathsOfUrl.length > 0 ? stega.raw(src.url) : src.url : undefined;
45
+ var isHls = (src === null || src === void 0 ? void 0 : src.mimeType) === "application/vnd.apple.mpegurl" || (src === null || src === void 0 || (_src$mimeType = src.mimeType) === null || _src$mimeType === void 0 ? void 0 : _src$mimeType.toLowerCase()) === "application/x-mpegurl";
46
+ var startTime = src === null || src === void 0 ? void 0 : src.startTime;
47
+ var endTime = src === null || src === void 0 ? void 0 : src.endTime;
48
+ React.useEffect(function () {
49
+ var video = ref.current;
50
+ if (!video || !url) {
51
+ return;
52
+ }
53
+ if (!isHls || video.canPlayType("application/vnd.apple.mpegurl") !== "") {
54
+ video.src = !isHls && (startTime !== undefined || endTime !== undefined) ? "".concat(url, "#t=").concat(startTime !== null && startTime !== void 0 ? startTime : 0).concat(endTime !== undefined ? ",".concat(endTime) : "") : url;
55
+ return function () {
56
+ video.removeAttribute("src");
57
+ video.load();
58
+ };
59
+ }
60
+ var loadHls = hlsRef.current;
61
+ if (!loadHls) {
62
+ console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
63
+ return;
64
+ }
65
+ var destroyed = false;
66
+ var instance = null;
67
+ loadHls().then(function (_ref) {
68
+ var Hls = _ref["default"];
69
+ if (destroyed || !Hls.isSupported()) {
70
+ return;
71
+ }
72
+ instance = new Hls();
73
+ instance.loadSource(url);
74
+ instance.attachMedia(video);
75
+ });
76
+ return function () {
77
+ var _instance;
78
+ destroyed = true;
79
+ (_instance = instance) === null || _instance === void 0 || _instance.destroy();
80
+ };
81
+ // `hasHls`, not `hls`: the loader is passed inline (`hls={() => import(…)}`),
82
+ // so its identity changes on every render of the parent, and depending on
83
+ // it tore playback down and started it again for a render that changed
84
+ // nothing about the video.
85
+ }, [url, isHls, hasHls, startTime, endTime]);
86
+ React.useEffect(function () {
87
+ var video = ref.current;
88
+ if (!video || startTime === undefined && endTime === undefined) {
89
+ return;
90
+ }
91
+ var onLoaded = function onLoaded() {
92
+ if (startTime !== undefined && video.currentTime < startTime) {
93
+ video.currentTime = startTime;
94
+ }
95
+ };
96
+ var onTimeUpdate = function onTimeUpdate() {
97
+ if (endTime !== undefined && video.currentTime >= endTime) {
98
+ if (video.loop) {
99
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
100
+ } else {
101
+ video.pause();
102
+ }
103
+ }
104
+ };
105
+ // Play pressed at the end (or before the start): from the start again.
106
+ // Without this a video stopped at its end could not be played again —
107
+ // every play landed past the end and was paused on the next tick.
108
+ var onPlay = function onPlay() {
109
+ if (endTime !== undefined && video.currentTime >= endTime || startTime !== undefined && video.currentTime < startTime) {
110
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
111
+ }
112
+ };
113
+ video.addEventListener("loadedmetadata", onLoaded);
114
+ video.addEventListener("timeupdate", onTimeUpdate);
115
+ video.addEventListener("play", onPlay);
116
+ return function () {
117
+ video.removeEventListener("loadedmetadata", onLoaded);
118
+ video.removeEventListener("timeupdate", onTimeUpdate);
119
+ video.removeEventListener("play", onPlay);
120
+ };
121
+ }, [startTime, endTime]);
122
+ var hotspot = src === null || src === void 0 ? void 0 : src.hotspot;
123
+ var videoStyle = hotspot && !disableHotspot ? objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, style), {}, {
124
+ objectPosition: "".concat(hotspot.x * 100, "% ").concat(hotspot.y * 100, "%")
125
+ }) : style;
126
+ // As for `ValImage`: the file's own size reserves the space, unless the
127
+ // caller is sizing the element.
128
+ var preferMetadataDims = ((src === null || src === void 0 ? void 0 : src.width) !== undefined || (src === null || src === void 0 ? void 0 : src.height) !== undefined) && !width && !height;
129
+ return /*#__PURE__*/jsxRuntime.jsx("video", objectSpread2._objectSpread2(objectSpread2._objectSpread2({
130
+ playsInline: true,
131
+ preload: "metadata"
132
+ }, rest), {}, {
133
+ ref: ref,
134
+ poster: src === null || src === void 0 || (_src$poster = src.poster) === null || _src$poster === void 0 ? void 0 : _src$poster.url,
135
+ "aria-label": (_rest$ariaLabel = rest["aria-label"]) !== null && _rest$ariaLabel !== void 0 ? _rest$ariaLabel : src !== null && src !== void 0 && src.alt ? stega.raw(src.alt) : undefined,
136
+ "data-val-path": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
137
+ "data-val-attr-src": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
138
+ style: videoStyle,
139
+ width: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.width : width,
140
+ height: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.height : height,
141
+ children: !disableCaptions && (src === null || src === void 0 || (_src$captions = src.captions) === null || _src$captions === void 0 ? void 0 : _src$captions.map(function (track) {
142
+ var _track$kind;
143
+ return /*#__PURE__*/jsxRuntime.jsx("track", {
144
+ src: track.url,
145
+ srcLang: track.srclang,
146
+ label: track.label ? stega.raw(track.label) : track.srclang,
147
+ kind: (_track$kind = track.kind) !== null && _track$kind !== void 0 ? _track$kind : "subtitles",
148
+ "default": track["default"]
149
+ }, track.url);
150
+ }))
151
+ }));
152
+ }
153
+
154
+ exports.ValVideo = ValVideo;
@@ -0,0 +1,154 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var objectSpread2 = require('./objectSpread2-58024783.cjs.dev.js');
7
+ var objectWithoutProperties = require('./objectWithoutProperties-8f93848f.cjs.dev.js');
8
+ var React = require('react');
9
+ var stega = require('@valbuild/react/stega');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ require('./defineProperty-f90345d7.cjs.dev.js');
12
+
13
+ var _excluded = ["src", "hls", "disableHotspot", "disableCaptions", "style", "width", "height"];
14
+ /**
15
+ * A `<video>` for a Val video, with everything the Studio lets an editor set:
16
+ * the poster, the caption tracks, the start and end time, and the focal point
17
+ * as `object-position`. Like `ValImage`, the edit tag on `src.url` is moved to
18
+ * `data-val-path`, so the video is click-to-edit and the URL the browser
19
+ * fetches is clean.
20
+ *
21
+ * Start and end are applied by the player rather than by cutting the file: it
22
+ * seeks to `startTime` when the video loads and pauses at `endTime`. For a
23
+ * progressive file the `#t=` media fragment says the same thing to the
24
+ * browser before any script runs.
25
+ */
26
+ function ValVideo(props) {
27
+ var _src$mimeType, _src$poster, _rest$ariaLabel, _src$captions;
28
+ var src = props.src,
29
+ hls = props.hls,
30
+ disableHotspot = props.disableHotspot,
31
+ disableCaptions = props.disableCaptions,
32
+ style = props.style,
33
+ width = props.width,
34
+ height = props.height,
35
+ rest = objectWithoutProperties._objectWithoutProperties(props, _excluded);
36
+ var ref = React.useRef(null);
37
+ /** The latest loader, read when a stream is attached; see the effect below. */
38
+ var hlsRef = React.useRef(hls);
39
+ React.useEffect(function () {
40
+ hlsRef.current = hls;
41
+ }, [hls]);
42
+ var hasHls = hls !== undefined;
43
+ var valPathsOfUrl = src !== null && src !== void 0 && src.url ? objectWithoutProperties.decodeValPathsOfString(src.url) : undefined;
44
+ var url = src !== null && src !== void 0 && src.url ? valPathsOfUrl && valPathsOfUrl.length > 0 ? stega.raw(src.url) : src.url : undefined;
45
+ var isHls = (src === null || src === void 0 ? void 0 : src.mimeType) === "application/vnd.apple.mpegurl" || (src === null || src === void 0 || (_src$mimeType = src.mimeType) === null || _src$mimeType === void 0 ? void 0 : _src$mimeType.toLowerCase()) === "application/x-mpegurl";
46
+ var startTime = src === null || src === void 0 ? void 0 : src.startTime;
47
+ var endTime = src === null || src === void 0 ? void 0 : src.endTime;
48
+ React.useEffect(function () {
49
+ var video = ref.current;
50
+ if (!video || !url) {
51
+ return;
52
+ }
53
+ if (!isHls || video.canPlayType("application/vnd.apple.mpegurl") !== "") {
54
+ video.src = !isHls && (startTime !== undefined || endTime !== undefined) ? "".concat(url, "#t=").concat(startTime !== null && startTime !== void 0 ? startTime : 0).concat(endTime !== undefined ? ",".concat(endTime) : "") : url;
55
+ return function () {
56
+ video.removeAttribute("src");
57
+ video.load();
58
+ };
59
+ }
60
+ var loadHls = hlsRef.current;
61
+ if (!loadHls) {
62
+ console.warn('Val: this browser cannot play HLS streams on its own. Pass `hls={() => import("hls.js")}` to ValVideo.');
63
+ return;
64
+ }
65
+ var destroyed = false;
66
+ var instance = null;
67
+ loadHls().then(function (_ref) {
68
+ var Hls = _ref["default"];
69
+ if (destroyed || !Hls.isSupported()) {
70
+ return;
71
+ }
72
+ instance = new Hls();
73
+ instance.loadSource(url);
74
+ instance.attachMedia(video);
75
+ });
76
+ return function () {
77
+ var _instance;
78
+ destroyed = true;
79
+ (_instance = instance) === null || _instance === void 0 || _instance.destroy();
80
+ };
81
+ // `hasHls`, not `hls`: the loader is passed inline (`hls={() => import(…)}`),
82
+ // so its identity changes on every render of the parent, and depending on
83
+ // it tore playback down and started it again for a render that changed
84
+ // nothing about the video.
85
+ }, [url, isHls, hasHls, startTime, endTime]);
86
+ React.useEffect(function () {
87
+ var video = ref.current;
88
+ if (!video || startTime === undefined && endTime === undefined) {
89
+ return;
90
+ }
91
+ var onLoaded = function onLoaded() {
92
+ if (startTime !== undefined && video.currentTime < startTime) {
93
+ video.currentTime = startTime;
94
+ }
95
+ };
96
+ var onTimeUpdate = function onTimeUpdate() {
97
+ if (endTime !== undefined && video.currentTime >= endTime) {
98
+ if (video.loop) {
99
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
100
+ } else {
101
+ video.pause();
102
+ }
103
+ }
104
+ };
105
+ // Play pressed at the end (or before the start): from the start again.
106
+ // Without this a video stopped at its end could not be played again —
107
+ // every play landed past the end and was paused on the next tick.
108
+ var onPlay = function onPlay() {
109
+ if (endTime !== undefined && video.currentTime >= endTime || startTime !== undefined && video.currentTime < startTime) {
110
+ video.currentTime = startTime !== null && startTime !== void 0 ? startTime : 0;
111
+ }
112
+ };
113
+ video.addEventListener("loadedmetadata", onLoaded);
114
+ video.addEventListener("timeupdate", onTimeUpdate);
115
+ video.addEventListener("play", onPlay);
116
+ return function () {
117
+ video.removeEventListener("loadedmetadata", onLoaded);
118
+ video.removeEventListener("timeupdate", onTimeUpdate);
119
+ video.removeEventListener("play", onPlay);
120
+ };
121
+ }, [startTime, endTime]);
122
+ var hotspot = src === null || src === void 0 ? void 0 : src.hotspot;
123
+ var videoStyle = hotspot && !disableHotspot ? objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, style), {}, {
124
+ objectPosition: "".concat(hotspot.x * 100, "% ").concat(hotspot.y * 100, "%")
125
+ }) : style;
126
+ // As for `ValImage`: the file's own size reserves the space, unless the
127
+ // caller is sizing the element.
128
+ var preferMetadataDims = ((src === null || src === void 0 ? void 0 : src.width) !== undefined || (src === null || src === void 0 ? void 0 : src.height) !== undefined) && !width && !height;
129
+ return /*#__PURE__*/jsxRuntime.jsx("video", objectSpread2._objectSpread2(objectSpread2._objectSpread2({
130
+ playsInline: true,
131
+ preload: "metadata"
132
+ }, rest), {}, {
133
+ ref: ref,
134
+ poster: src === null || src === void 0 || (_src$poster = src.poster) === null || _src$poster === void 0 ? void 0 : _src$poster.url,
135
+ "aria-label": (_rest$ariaLabel = rest["aria-label"]) !== null && _rest$ariaLabel !== void 0 ? _rest$ariaLabel : src !== null && src !== void 0 && src.alt ? stega.raw(src.alt) : undefined,
136
+ "data-val-path": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
137
+ "data-val-attr-src": valPathsOfUrl === null || valPathsOfUrl === void 0 ? void 0 : valPathsOfUrl.join(","),
138
+ style: videoStyle,
139
+ width: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.width : width,
140
+ height: preferMetadataDims ? src === null || src === void 0 ? void 0 : src.height : height,
141
+ children: !disableCaptions && (src === null || src === void 0 || (_src$captions = src.captions) === null || _src$captions === void 0 ? void 0 : _src$captions.map(function (track) {
142
+ var _track$kind;
143
+ return /*#__PURE__*/jsxRuntime.jsx("track", {
144
+ src: track.url,
145
+ srcLang: track.srclang,
146
+ label: track.label ? stega.raw(track.label) : track.srclang,
147
+ kind: (_track$kind = track.kind) !== null && _track$kind !== void 0 ? _track$kind : "subtitles",
148
+ "default": track["default"]
149
+ }, track.url);
150
+ }))
151
+ }));
152
+ }
153
+
154
+ exports.ValVideo = ValVideo;
@@ -0,0 +1,50 @@
1
+ import { Video } from "@valbuild/react/stega";
2
+ /**
3
+ * What `ValVideo` needs from hls.js — written out rather than imported, so
4
+ * this package typechecks in an app that has never installed it.
5
+ */
6
+ type HlsLike = {
7
+ loadSource(url: string): void;
8
+ attachMedia(media: HTMLMediaElement): void;
9
+ destroy(): void;
10
+ };
11
+ type HlsConstructorLike = {
12
+ new (): HlsLike;
13
+ isSupported(): boolean;
14
+ };
15
+ export type ValVideoProps = Omit<React.ComponentProps<"video">, "src" | "poster" | "children"> & {
16
+ src: Video;
17
+ /**
18
+ * How to play an HLS stream in a browser that cannot play one itself, which
19
+ * is every browser but Safari (and recent Chrome). Pass a loader for hls.js:
20
+ *
21
+ * ```tsx
22
+ * <ValVideo src={page.intro} hls={() => import("hls.js")} />
23
+ * ```
24
+ *
25
+ * It is called only when the video IS a stream and the browser needs it, so
26
+ * a page of plain mp4s never downloads it. Without it, such a browser shows
27
+ * the poster and an unplayable player.
28
+ */
29
+ hls?: () => Promise<{
30
+ default: HlsConstructorLike;
31
+ }>;
32
+ /** Ignore the video's hotspot instead of applying it as object-position. */
33
+ disableHotspot?: boolean;
34
+ /** Leave out the caption tracks. */
35
+ disableCaptions?: boolean;
36
+ };
37
+ /**
38
+ * A `<video>` for a Val video, with everything the Studio lets an editor set:
39
+ * the poster, the caption tracks, the start and end time, and the focal point
40
+ * as `object-position`. Like `ValImage`, the edit tag on `src.url` is moved to
41
+ * `data-val-path`, so the video is click-to-edit and the URL the browser
42
+ * fetches is clean.
43
+ *
44
+ * Start and end are applied by the player rather than by cutting the file: it
45
+ * seeks to `startTime` when the video loads and pauses at `endTime`. For a
46
+ * progressive file the `#t=` media fragment says the same thing to the
47
+ * browser before any script runs.
48
+ */
49
+ export declare function ValVideo(props: ValVideoProps): import("react").JSX.Element;
50
+ export {};
@@ -1,7 +1,7 @@
1
1
  export { Schema, type SerializedSchema } from "@valbuild/core";
2
2
  export type { SourceObject, SourcePrimitive, Source } from "@valbuild/core";
3
3
  export type { ValModule, SerializedModule } from "@valbuild/core";
4
- export type { FileSource, ImageSource, MediaSource } from "@valbuild/core";
4
+ export type { FileSource, ImageSource, MediaSource, VideoSource, } from "@valbuild/core";
5
5
  export type { RichTextSource } from "@valbuild/core";
6
6
  export { type Val, type SerializedVal, type ModuleFilePath, type ModulePath, type SourcePath, type JsonOfSource, } from "@valbuild/core";
7
7
  export { modules, type ValModules } from "@valbuild/core";
@@ -13,9 +13,10 @@ export { VAL_EXTENSION, type SourceArray } from "@valbuild/core";
13
13
  export { derefPatch } from "@valbuild/core";
14
14
  export { type SelectorSource, type SelectorOf, GenericSelector, } from "@valbuild/core";
15
15
  export { ValRichText } from "@valbuild/react/internal";
16
- export { type ValEncodedString, type File, type Image, type RichText, } from "@valbuild/react/stega";
16
+ export { type ValEncodedString, type File, type Image, type Video, type RichText, } from "@valbuild/react/stega";
17
17
  export { ValProvider } from "./ValProvider.js";
18
18
  export { ValImage, type ValImageProps } from "./ValImage.js";
19
+ export { ValVideo, type ValVideoProps } from "./ValVideo.js";
19
20
  export { ValApp } from "./ValApp.js";
20
21
  export { ValModulesClient, useRegisterValModules } from "./ValModulesClient.js";
21
22
  import { Internal as InternalCore } from "@valbuild/core";
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ var stega = require('@valbuild/react/stega');
4
+
5
+ function decodeValPathsOfString(encodedString) {
6
+ return stega.stegaDecodeStrings(encodedString);
7
+ }
8
+
9
+ function _objectWithoutPropertiesLoose(r, e) {
10
+ if (null == r) return {};
11
+ var t = {};
12
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
13
+ if (-1 !== e.indexOf(n)) continue;
14
+ t[n] = r[n];
15
+ }
16
+ return t;
17
+ }
18
+
19
+ function _objectWithoutProperties(e, t) {
20
+ if (null == e) return {};
21
+ var o,
22
+ r,
23
+ i = _objectWithoutPropertiesLoose(e, t);
24
+ if (Object.getOwnPropertySymbols) {
25
+ var n = Object.getOwnPropertySymbols(e);
26
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
27
+ }
28
+ return i;
29
+ }
30
+
31
+ exports._objectWithoutProperties = _objectWithoutProperties;
32
+ exports.decodeValPathsOfString = decodeValPathsOfString;
@@ -0,0 +1,29 @@
1
+ import { stegaDecodeStrings } from '@valbuild/react/stega';
2
+
3
+ function decodeValPathsOfString(encodedString) {
4
+ return stegaDecodeStrings(encodedString);
5
+ }
6
+
7
+ function _objectWithoutPropertiesLoose(r, e) {
8
+ if (null == r) return {};
9
+ var t = {};
10
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
11
+ if (-1 !== e.indexOf(n)) continue;
12
+ t[n] = r[n];
13
+ }
14
+ return t;
15
+ }
16
+
17
+ function _objectWithoutProperties(e, t) {
18
+ if (null == e) return {};
19
+ var o,
20
+ r,
21
+ i = _objectWithoutPropertiesLoose(e, t);
22
+ if (Object.getOwnPropertySymbols) {
23
+ var n = Object.getOwnPropertySymbols(e);
24
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
25
+ }
26
+ return i;
27
+ }
28
+
29
+ export { _objectWithoutProperties as _, decodeValPathsOfString as d };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ var stega = require('@valbuild/react/stega');
4
+
5
+ function decodeValPathsOfString(encodedString) {
6
+ return stega.stegaDecodeStrings(encodedString);
7
+ }
8
+
9
+ function _objectWithoutPropertiesLoose(r, e) {
10
+ if (null == r) return {};
11
+ var t = {};
12
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
13
+ if (-1 !== e.indexOf(n)) continue;
14
+ t[n] = r[n];
15
+ }
16
+ return t;
17
+ }
18
+
19
+ function _objectWithoutProperties(e, t) {
20
+ if (null == e) return {};
21
+ var o,
22
+ r,
23
+ i = _objectWithoutPropertiesLoose(e, t);
24
+ if (Object.getOwnPropertySymbols) {
25
+ var n = Object.getOwnPropertySymbols(e);
26
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
27
+ }
28
+ return i;
29
+ }
30
+
31
+ exports._objectWithoutProperties = _objectWithoutProperties;
32
+ exports.decodeValPathsOfString = decodeValPathsOfString;
@@ -6,13 +6,15 @@ var asyncToGenerator = require('./asyncToGenerator-c3823d62.cjs.dev.js');
6
6
  var objectSpread2 = require('./objectSpread2-58024783.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
+ var objectWithoutProperties = require('./objectWithoutProperties-8f93848f.cjs.dev.js');
9
10
  var internal = require('@valbuild/react/internal');
10
11
  var ValNextProvider = require('./ValNextProvider-062a8dc9.cjs.dev.js');
11
12
  var NextImage = require('next/image');
12
13
  var jsxRuntime = require('react/jsx-runtime');
14
+ var ValVideo = require('./ValVideo-b8130c1b.cjs.dev.js');
13
15
  var ValApp = require('./ValApp-294e5b53.cjs.dev.js');
14
16
  var ValModulesClient = require('./ValModulesClient-4ecabf99.cjs.dev.js');
15
- var version = require('./version-f6392077.cjs.dev.js');
17
+ var version = require('./version-c3305b8b.cjs.dev.js');
16
18
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-0445603c.cjs.dev.js');
17
19
  require('./defineProperty-f90345d7.cjs.dev.js');
18
20
  require('./unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
@@ -48,10 +50,6 @@ function getUnpatchedUnencodedVal(selector) {
48
50
  });
49
51
  }
50
52
 
51
- function decodeValPathsOfString(encodedString) {
52
- return stega.stegaDecodeStrings(encodedString);
53
- }
54
-
55
53
  var nextAppRouter = core.Internal.nextAppRouter;
56
54
  var externalPageRouter = core.Internal.externalPageRouter;
57
55
 
@@ -110,7 +108,7 @@ var initVal = function initVal(config) {
110
108
  externalPageRouter: externalPageRouter,
111
109
  val: objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, val), {}, {
112
110
  attrs: stega.attrs,
113
- unstable_decodeValPathsOfString: decodeValPathsOfString,
111
+ unstable_decodeValPathsOfString: objectWithoutProperties.decodeValPathsOfString,
114
112
  raw: stega.raw,
115
113
  unstable_getUnpatchedUnencodedVal: getUnpatchedUnencodedVal
116
114
  }),
@@ -120,28 +118,6 @@ var initVal = function initVal(config) {
120
118
 
121
119
  var ValProvider = ValNextProvider.ValNextProvider;
122
120
 
123
- function _objectWithoutPropertiesLoose(r, e) {
124
- if (null == r) return {};
125
- var t = {};
126
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
127
- if (-1 !== e.indexOf(n)) continue;
128
- t[n] = r[n];
129
- }
130
- return t;
131
- }
132
-
133
- function _objectWithoutProperties(e, t) {
134
- if (null == e) return {};
135
- var o,
136
- r,
137
- i = _objectWithoutPropertiesLoose(e, t);
138
- if (Object.getOwnPropertySymbols) {
139
- var n = Object.getOwnPropertySymbols(e);
140
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
141
- }
142
- return i;
143
- }
144
-
145
121
  var _excluded = ["src", "alt", "style", "width", "disableHotspot", "height"];
146
122
  function ValImage(props) {
147
123
  var src = props.src,
@@ -150,10 +126,10 @@ function ValImage(props) {
150
126
  width = props.width,
151
127
  disableHotspot = props.disableHotspot,
152
128
  height = props.height,
153
- rest = _objectWithoutProperties(props, _excluded);
154
- var valPathsOfUrl = src !== null && src !== void 0 && src.url ? decodeValPathsOfString(src.url) : undefined;
129
+ rest = objectWithoutProperties._objectWithoutProperties(props, _excluded);
130
+ var valPathsOfUrl = src !== null && src !== void 0 && src.url ? objectWithoutProperties.decodeValPathsOfString(src.url) : undefined;
155
131
  var valPaths = valPathsOfUrl ? valPathsOfUrl : [];
156
- var maybeValPathOfAlt = alt ? decodeValPathsOfString(alt) : undefined;
132
+ var maybeValPathOfAlt = alt ? objectWithoutProperties.decodeValPathsOfString(alt) : undefined;
157
133
  if (maybeValPathOfAlt) {
158
134
  var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(maybeValPathOfAlt),
159
135
  _step;
@@ -242,6 +218,10 @@ Object.defineProperty(exports, 'ValRichText', {
242
218
  enumerable: true,
243
219
  get: function () { return internal.ValRichText; }
244
220
  });
221
+ Object.defineProperty(exports, 'ValVideo', {
222
+ enumerable: true,
223
+ get: function () { return ValVideo.ValVideo; }
224
+ });
245
225
  Object.defineProperty(exports, 'ValApp', {
246
226
  enumerable: true,
247
227
  get: function () { return ValApp.ValApp; }
@@ -6,13 +6,15 @@ var asyncToGenerator = require('./asyncToGenerator-8e5c36c8.cjs.prod.js');
6
6
  var objectSpread2 = require('./objectSpread2-13f847a9.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
9
+ var objectWithoutProperties = require('./objectWithoutProperties-107dcb46.cjs.prod.js');
9
10
  var internal = require('@valbuild/react/internal');
10
11
  var ValNextProvider = require('./ValNextProvider-da189afe.cjs.prod.js');
11
12
  var NextImage = require('next/image');
12
13
  var jsxRuntime = require('react/jsx-runtime');
14
+ var ValVideo = require('./ValVideo-94e5aa28.cjs.prod.js');
13
15
  var ValApp = require('./ValApp-ab8a96fd.cjs.prod.js');
14
16
  var ValModulesClient = require('./ValModulesClient-10c0721c.cjs.prod.js');
15
- var version = require('./version-08273b57.cjs.prod.js');
17
+ var version = require('./version-98e6df51.cjs.prod.js');
16
18
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-d4afcad8.cjs.prod.js');
17
19
  require('./defineProperty-8951f469.cjs.prod.js');
18
20
  require('./unsupportedIterableToArray-0d2087a2.cjs.prod.js');
@@ -48,10 +50,6 @@ function getUnpatchedUnencodedVal(selector) {
48
50
  });
49
51
  }
50
52
 
51
- function decodeValPathsOfString(encodedString) {
52
- return stega.stegaDecodeStrings(encodedString);
53
- }
54
-
55
53
  var nextAppRouter = core.Internal.nextAppRouter;
56
54
  var externalPageRouter = core.Internal.externalPageRouter;
57
55
 
@@ -110,7 +108,7 @@ var initVal = function initVal(config) {
110
108
  externalPageRouter: externalPageRouter,
111
109
  val: objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, val), {}, {
112
110
  attrs: stega.attrs,
113
- unstable_decodeValPathsOfString: decodeValPathsOfString,
111
+ unstable_decodeValPathsOfString: objectWithoutProperties.decodeValPathsOfString,
114
112
  raw: stega.raw,
115
113
  unstable_getUnpatchedUnencodedVal: getUnpatchedUnencodedVal
116
114
  }),
@@ -120,28 +118,6 @@ var initVal = function initVal(config) {
120
118
 
121
119
  var ValProvider = ValNextProvider.ValNextProvider;
122
120
 
123
- function _objectWithoutPropertiesLoose(r, e) {
124
- if (null == r) return {};
125
- var t = {};
126
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
127
- if (-1 !== e.indexOf(n)) continue;
128
- t[n] = r[n];
129
- }
130
- return t;
131
- }
132
-
133
- function _objectWithoutProperties(e, t) {
134
- if (null == e) return {};
135
- var o,
136
- r,
137
- i = _objectWithoutPropertiesLoose(e, t);
138
- if (Object.getOwnPropertySymbols) {
139
- var n = Object.getOwnPropertySymbols(e);
140
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
141
- }
142
- return i;
143
- }
144
-
145
121
  var _excluded = ["src", "alt", "style", "width", "disableHotspot", "height"];
146
122
  function ValImage(props) {
147
123
  var src = props.src,
@@ -150,10 +126,10 @@ function ValImage(props) {
150
126
  width = props.width,
151
127
  disableHotspot = props.disableHotspot,
152
128
  height = props.height,
153
- rest = _objectWithoutProperties(props, _excluded);
154
- var valPathsOfUrl = src !== null && src !== void 0 && src.url ? decodeValPathsOfString(src.url) : undefined;
129
+ rest = objectWithoutProperties._objectWithoutProperties(props, _excluded);
130
+ var valPathsOfUrl = src !== null && src !== void 0 && src.url ? objectWithoutProperties.decodeValPathsOfString(src.url) : undefined;
155
131
  var valPaths = valPathsOfUrl ? valPathsOfUrl : [];
156
- var maybeValPathOfAlt = alt ? decodeValPathsOfString(alt) : undefined;
132
+ var maybeValPathOfAlt = alt ? objectWithoutProperties.decodeValPathsOfString(alt) : undefined;
157
133
  if (maybeValPathOfAlt) {
158
134
  var _iterator = createForOfIteratorHelper._createForOfIteratorHelper(maybeValPathOfAlt),
159
135
  _step;
@@ -242,6 +218,10 @@ Object.defineProperty(exports, 'ValRichText', {
242
218
  enumerable: true,
243
219
  get: function () { return internal.ValRichText; }
244
220
  });
221
+ Object.defineProperty(exports, 'ValVideo', {
222
+ enumerable: true,
223
+ get: function () { return ValVideo.ValVideo; }
224
+ });
245
225
  Object.defineProperty(exports, 'ValApp', {
246
226
  enumerable: true,
247
227
  get: function () { return ValApp.ValApp; }
@@ -4,14 +4,16 @@ import { Internal as Internal$1, initVal as initVal$1 } from '@valbuild/core';
4
4
  import * as core from '@valbuild/core';
5
5
  export { core as expr };
6
6
  export { GenericSelector, Schema, VAL_EXTENSION, derefPatch, modules } from '@valbuild/core';
7
- import { stegaEncode, stegaDecodeStrings, attrs, raw, autoTagJSX } from '@valbuild/react/stega';
7
+ import { stegaEncode, attrs, raw, autoTagJSX } from '@valbuild/react/stega';
8
+ import { d as decodeValPathsOfString, _ as _objectWithoutProperties } from './objectWithoutProperties-2daec22c.esm.js';
8
9
  export { ValRichText } from '@valbuild/react/internal';
9
10
  import { ValNextProvider } from './ValNextProvider-3d2cd7e4.esm.js';
10
11
  import NextImage from 'next/image';
11
12
  import { jsx } from 'react/jsx-runtime';
13
+ export { ValVideo } from './ValVideo-19f2ab05.esm.js';
12
14
  export { ValApp } from './ValApp-3a70afe1.esm.js';
13
15
  export { ValModulesClient, useRegisterValModules } from './ValModulesClient-0dd601a1.esm.js';
14
- import { V as VERSION } from './version-7433b2e3.esm.js';
16
+ import { V as VERSION } from './version-d2b7a21e.esm.js';
15
17
  import { _ as _createForOfIteratorHelper } from './createForOfIteratorHelper-5758a730.esm.js';
16
18
  import './defineProperty-cca5affa.esm.js';
17
19
  import './unsupportedIterableToArray-5baabfdc.esm.js';
@@ -24,10 +26,6 @@ function getUnpatchedUnencodedVal(selector) {
24
26
  });
25
27
  }
26
28
 
27
- function decodeValPathsOfString(encodedString) {
28
- return stegaDecodeStrings(encodedString);
29
- }
30
-
31
29
  var nextAppRouter = Internal$1.nextAppRouter;
32
30
  var externalPageRouter = Internal$1.externalPageRouter;
33
31
 
@@ -96,28 +94,6 @@ var initVal = function initVal(config) {
96
94
 
97
95
  var ValProvider = ValNextProvider;
98
96
 
99
- function _objectWithoutPropertiesLoose(r, e) {
100
- if (null == r) return {};
101
- var t = {};
102
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
103
- if (-1 !== e.indexOf(n)) continue;
104
- t[n] = r[n];
105
- }
106
- return t;
107
- }
108
-
109
- function _objectWithoutProperties(e, t) {
110
- if (null == e) return {};
111
- var o,
112
- r,
113
- i = _objectWithoutPropertiesLoose(e, t);
114
- if (Object.getOwnPropertySymbols) {
115
- var n = Object.getOwnPropertySymbols(e);
116
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
117
- }
118
- return i;
119
- }
120
-
121
97
  var _excluded = ["src", "alt", "style", "width", "disableHotspot", "height"];
122
98
  function ValImage(props) {
123
99
  var src = props.src,
@@ -14,7 +14,7 @@ var packageJson = {
14
14
  "next",
15
15
  "react"
16
16
  ],
17
- version: "0.140.0",
17
+ version: "0.141.0",
18
18
  scripts: {
19
19
  typecheck: "tsc --noEmit",
20
20
  test: "jest"
@@ -14,7 +14,7 @@ var packageJson = {
14
14
  "next",
15
15
  "react"
16
16
  ],
17
- version: "0.140.0",
17
+ version: "0.141.0",
18
18
  scripts: {
19
19
  typecheck: "tsc --noEmit",
20
20
  test: "jest"
@@ -12,7 +12,7 @@ var packageJson = {
12
12
  "next",
13
13
  "react"
14
14
  ],
15
- version: "0.140.0",
15
+ version: "0.141.0",
16
16
  scripts: {
17
17
  typecheck: "tsc --noEmit",
18
18
  test: "jest"
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "next",
13
13
  "react"
14
14
  ],
15
- "version": "0.140.0",
15
+ "version": "0.141.0",
16
16
  "main": "dist/valbuild-next.cjs.js",
17
17
  "module": "dist/valbuild-next.esm.js",
18
18
  "exports": {
@@ -47,13 +47,13 @@
47
47
  "dependencies": {
48
48
  "client-only": "^0.0.1",
49
49
  "server-only": "^0.0.1",
50
- "@valbuild/language-server": "0.140.0",
51
- "@valbuild/mcp": "0.140.0",
52
- "@valbuild/react": "0.140.0",
53
- "@valbuild/core": "0.139.1",
54
- "@valbuild/server": "0.140.0",
55
- "@valbuild/shared": "0.140.0",
56
- "@valbuild/ui": "0.140.0"
50
+ "@valbuild/core": "0.141.0",
51
+ "@valbuild/language-server": "0.141.0",
52
+ "@valbuild/mcp": "0.141.0",
53
+ "@valbuild/react": "0.141.0",
54
+ "@valbuild/server": "0.141.0",
55
+ "@valbuild/shared": "0.141.0",
56
+ "@valbuild/ui": "0.141.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@testing-library/react": "^16.3.3",
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
12
12
  var React = require('react');
13
13
  var internal = require('@valbuild/shared/internal');
14
14
  var server = require('@valbuild/server');
15
- var version = require('../../dist/version-f6392077.cjs.dev.js');
15
+ var version = require('../../dist/version-c3305b8b.cjs.dev.js');
16
16
  require('../../dist/createForOfIteratorHelper-0445603c.cjs.dev.js');
17
17
  require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
18
18
  require('../../dist/slicedToArray-44036a76.cjs.dev.js');
@@ -12,7 +12,7 @@ var core = require('@valbuild/core');
12
12
  var React = require('react');
13
13
  var internal = require('@valbuild/shared/internal');
14
14
  var server = require('@valbuild/server');
15
- var version = require('../../dist/version-08273b57.cjs.prod.js');
15
+ var version = require('../../dist/version-98e6df51.cjs.prod.js');
16
16
  require('../../dist/createForOfIteratorHelper-d4afcad8.cjs.prod.js');
17
17
  require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
18
18
  require('../../dist/slicedToArray-ce613de6.cjs.prod.js');
@@ -8,7 +8,7 @@ import { Internal } from '@valbuild/core';
8
8
  import { cache } from 'react';
9
9
  import { VAL_SESSION_COOKIE, memoizePerRequest } from '@valbuild/shared/internal';
10
10
  import { createValServer } from '@valbuild/server';
11
- import { V as VERSION } from '../../dist/version-7433b2e3.esm.js';
11
+ import { V as VERSION } from '../../dist/version-d2b7a21e.esm.js';
12
12
  import '../../dist/createForOfIteratorHelper-5758a730.esm.js';
13
13
  import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
14
14
  import '../../dist/slicedToArray-aa291011.esm.js';
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58024783.cjs.dev.js');
9
9
  var core = require('@valbuild/core');
10
10
  var server = require('@valbuild/server');
11
11
  var server$1 = require('next/server');
12
- var version = require('../../dist/version-f6392077.cjs.dev.js');
12
+ var version = require('../../dist/version-c3305b8b.cjs.dev.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('../../dist/unsupportedIterableToArray-c8ab77c9.cjs.dev.js');
15
15
  require('../../dist/defineProperty-f90345d7.cjs.dev.js');
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-13f847a9.cjs.prod.js');
9
9
  var core = require('@valbuild/core');
10
10
  var server = require('@valbuild/server');
11
11
  var server$1 = require('next/server');
12
- var version = require('../../dist/version-08273b57.cjs.prod.js');
12
+ var version = require('../../dist/version-98e6df51.cjs.prod.js');
13
13
  var mcp = require('@valbuild/mcp');
14
14
  require('../../dist/unsupportedIterableToArray-0d2087a2.cjs.prod.js');
15
15
  require('../../dist/defineProperty-8951f469.cjs.prod.js');
@@ -6,7 +6,7 @@ import { Internal } from '@valbuild/core';
6
6
  import { createValApiRouter, createValServer } from '@valbuild/server';
7
7
  export { createPrettierFormatter } from '@valbuild/server';
8
8
  import { NextResponse } from 'next/server';
9
- import { V as VERSION } from '../../dist/version-7433b2e3.esm.js';
9
+ import { V as VERSION } from '../../dist/version-d2b7a21e.esm.js';
10
10
  import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
11
11
  import '../../dist/unsupportedIterableToArray-5baabfdc.esm.js';
12
12
  import '../../dist/defineProperty-cca5affa.esm.js';
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./ValCanvasBridge-5e9c64d6.cjs.prod.js");
5
- } else {
6
- module.exports = require("./ValCanvasBridge-5e9c64d6.cjs.dev.js");
7
- }