@valbuild/shared 0.140.2 → 0.142.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.
- package/CHANGELOG.md +74 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +196 -120
- package/dist/declarations/src/internal/server/types.d.ts +3 -3
- package/dist/declarations/src/internal/zod/History.d.ts +7 -7
- package/dist/declarations/src/internal/zod/Patch.d.ts +0 -1
- package/dist/declarations/src/internal/zod/SerializedSchema.d.ts +18 -21
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +188 -16
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +188 -16
- package/internal/dist/valbuild-shared-internal.esm.js +186 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.142.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#805](https://github.com/valbuild/val/pull/805) [`3d2b9e8`](https://github.com/valbuild/val/commit/3d2b9e8c11aa6a4449527e2a1bbb363566797a14) Thanks [@freekh](https://github.com/freekh)! - Proposals in the Studio, for projects on the Val platform that have them turned on: a switcher in the top bar to move between the site and its proposals, New proposal, Rename, Close and All proposals (with Reopen), and — inside a proposal — Save where Publish is, in the proposal's colour. Nothing is shown for a project without proposals. At a proposal's address the server now refuses to publish to the site, so a Save there can never start a site build.
|
|
8
|
+
|
|
9
|
+
## 0.141.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#802](https://github.com/valbuild/val/pull/802) [`199e214`](https://github.com/valbuild/val/commit/199e21471d98806fb34c579cb876560078c928b9) Thanks [@freekh](https://github.com/freekh)! - New: `files: { remote: true }` in `val.config.ts` stores every image, file and video on Val's remote content host.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const { s, c, val, config } = initVal({
|
|
17
|
+
project: "myorg/myproject",
|
|
18
|
+
files: { remote: true },
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
With it, `s.image()`, `s.file()`, `s.video()`, `s.imageset()`, `s.fileset()`, `s.videoset()` and `s.richtext({ img: true })` behave as though `.remote()` had been written on them. Images already in the project are reported as `image:upload-remote` until they are uploaded; `npx val validate --fix` does that.
|
|
23
|
+
|
|
24
|
+
**Required in the Val app.** A project running there (`VAL_ENV=app`) refuses to start without it, with an error that says what to add, and `val publish` refuses before it builds.
|
|
25
|
+
|
|
26
|
+
**Breaking:** `files.directory` has been removed from `val.config.ts`. Local files that have no `dir` of their own are stored in `/public/val`, which was the default.
|
|
27
|
+
|
|
28
|
+
- [#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.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const schema = s.object({
|
|
32
|
+
intro: s.video({ stream: { type: "hls" } }),
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- **Upload and play in the Studio.** A video field shows a player, the file's size and length, and progress while it uploads.
|
|
37
|
+
- **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.
|
|
38
|
+
- **Poster:** pause on a frame and choose "Use current frame". The frame is saved as an image, and `posterTime` records where it was taken.
|
|
39
|
+
- **Start and end:** play part of a video without cutting the file.
|
|
40
|
+
- **Focal point:** marks what must stay in frame when the page crops the video.
|
|
41
|
+
- **Description:** text for people who can't see the video.
|
|
42
|
+
- **Captions:** one WebVTT file per language. `.srt` files are converted on upload.
|
|
43
|
+
- **`<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.
|
|
44
|
+
- **Rename** a video in the Studio. An HLS stream is renamed as a whole: every playlist and segment moves to the new folder.
|
|
45
|
+
- `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.
|
|
46
|
+
- `.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.
|
|
47
|
+
|
|
48
|
+
A video value always has a `mimeType`: it is how a page knows whether it has an `.mp4` or an `.m3u8`.
|
|
49
|
+
|
|
50
|
+
New: `s.videoset()`, a collection of videos, like `s.imageset()` for images.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
const videosVal = c.define(
|
|
54
|
+
"/content/videos.val.ts",
|
|
55
|
+
s.videoset({ dir: "/public/val/videos", stream: { type: "hls" } }),
|
|
56
|
+
{},
|
|
57
|
+
);
|
|
58
|
+
const schema = s.object({ intro: s.video(videosVal) });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- **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.
|
|
62
|
+
- **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.
|
|
63
|
+
- **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".
|
|
64
|
+
- `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.
|
|
65
|
+
- `.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.
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
|
+
|
|
69
|
+
- 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.
|
|
70
|
+
- 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`.
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [[`199e214`](https://github.com/valbuild/val/commit/199e21471d98806fb34c579cb876560078c928b9), [`ba3f330`](https://github.com/valbuild/val/commit/ba3f3300a3dd8649e154097cdfca3b64db209d89)]:
|
|
75
|
+
- @valbuild/core@0.141.0
|
|
76
|
+
|
|
3
77
|
## 0.140.2
|
|
4
78
|
|
|
5
79
|
### Patch Changes
|