@openrails/contentkit-ui 0.79.0 → 0.81.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/README.md +82 -54
- package/dist/client/beacons.d.ts +53 -0
- package/dist/client/beacons.js +72 -0
- package/dist/client/beacons.js.map +1 -0
- package/dist/client/catalog.d.ts +2 -2
- package/dist/client/catalog.js +1 -1
- package/dist/client/catalog.js.map +1 -1
- package/dist/client/client.d.ts +24 -11
- package/dist/client/client.js +37 -29
- package/dist/client/client.js.map +1 -1
- package/dist/client/content/comments.d.ts +12 -8
- package/dist/client/content/comments.js +33 -20
- package/dist/client/content/comments.js.map +1 -1
- package/dist/client/content/favorites.d.ts +24 -9
- package/dist/client/content/favorites.js +21 -22
- package/dist/client/content/favorites.js.map +1 -1
- package/dist/client/content/moderation.d.ts +1 -1
- package/dist/client/content/moderation.js.map +1 -1
- package/dist/client/content/reactions.d.ts +11 -6
- package/dist/client/content/reactions.js +23 -18
- package/dist/client/content/reactions.js.map +1 -1
- package/dist/client/content/types.d.ts +40 -21
- package/dist/client/content/types.js +5 -2
- package/dist/client/content/types.js.map +1 -1
- package/dist/client/contents.d.ts +55 -0
- package/dist/client/contents.js +144 -0
- package/dist/client/contents.js.map +1 -0
- package/dist/client/discovery.d.ts +126 -0
- package/dist/client/discovery.js +125 -0
- package/dist/client/discovery.js.map +1 -0
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/error-codes.js +12 -0
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.d.ts +1244 -370
- package/dist/client/generated/routes.js +1870 -554
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +960 -134
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/group-fields.d.ts +25 -0
- package/dist/client/group-fields.js +63 -0
- package/dist/client/group-fields.js.map +1 -0
- package/dist/client/groups.d.ts +58 -0
- package/dist/client/groups.js +119 -0
- package/dist/client/groups.js.map +1 -0
- package/dist/client/http.d.ts +24 -12
- package/dist/client/http.js +20 -24
- package/dist/client/http.js.map +1 -1
- package/dist/client/index.d.ts +11 -6
- package/dist/client/media/api.d.ts +1 -1
- package/dist/client/media/api.js +4 -2
- package/dist/client/media/api.js.map +1 -1
- package/dist/client/media/client.d.ts +8 -9
- package/dist/client/media/client.js +58 -71
- package/dist/client/media/client.js.map +1 -1
- package/dist/client/media/ref.d.ts +30 -0
- package/dist/client/media/ref.js +10 -3
- package/dist/client/media/ref.js.map +1 -1
- package/dist/client/offers.d.ts +41 -0
- package/dist/client/offers.js +66 -0
- package/dist/client/offers.js.map +1 -0
- package/dist/client/route.d.ts +2 -0
- package/dist/client/route.js +2 -1
- package/dist/client/route.js.map +1 -1
- package/dist/client/versions.d.ts +20 -0
- package/dist/client/versions.js +53 -0
- package/dist/client/versions.js.map +1 -0
- package/dist/client.js +35 -30
- package/dist/components/admin/content-manager.d.ts +80 -0
- package/dist/components/admin/content-manager.js +591 -0
- package/dist/components/admin/content-manager.js.map +1 -0
- package/dist/components/admin/group-manager.d.ts +24 -0
- package/dist/components/admin/group-manager.js +244 -0
- package/dist/components/admin/group-manager.js.map +1 -0
- package/dist/components/admin/media-item-panel.js +1 -1
- package/dist/components/admin/media-item-panel.js.map +1 -1
- package/dist/components/content/card.d.ts +44 -0
- package/dist/components/content/card.js +285 -0
- package/dist/components/content/card.js.map +1 -0
- package/dist/components/content/editors.d.ts +40 -0
- package/dist/components/content/editors.js +764 -0
- package/dist/components/content/editors.js.map +1 -0
- package/dist/components/content/filters.d.ts +28 -0
- package/dist/components/content/filters.js +134 -0
- package/dist/components/content/filters.js.map +1 -0
- package/dist/components/content/grid.d.ts +62 -0
- package/dist/components/content/grid.js +233 -0
- package/dist/components/content/grid.js.map +1 -0
- package/dist/components/content/index.d.ts +8 -0
- package/dist/components/content/listing.d.ts +20 -0
- package/dist/components/content/listing.js +150 -0
- package/dist/components/content/listing.js.map +1 -0
- package/dist/components/content/offer-fields.d.ts +8 -0
- package/dist/components/content/offer-fields.js +127 -0
- package/dist/components/content/offer-fields.js.map +1 -0
- package/dist/components/content/paywall.d.ts +53 -0
- package/dist/components/content/paywall.js +221 -0
- package/dist/components/content/paywall.js.map +1 -0
- package/dist/components/content/search.d.ts +27 -0
- package/dist/components/content/search.js +164 -0
- package/dist/components/content/search.js.map +1 -0
- package/dist/components/groups/banner.d.ts +51 -0
- package/dist/components/groups/banner.js +194 -0
- package/dist/components/groups/banner.js.map +1 -0
- package/dist/components/groups/directory.d.ts +37 -0
- package/dist/components/groups/directory.js +117 -0
- package/dist/components/groups/directory.js.map +1 -0
- package/dist/components/groups/editor.d.ts +44 -0
- package/dist/components/groups/editor.js +860 -0
- package/dist/components/groups/editor.js.map +1 -0
- package/dist/components/groups/fields.d.ts +13 -0
- package/dist/components/groups/fields.js +68 -0
- package/dist/components/groups/fields.js.map +1 -0
- package/dist/components/groups/header.d.ts +25 -0
- package/dist/components/groups/header.js +131 -0
- package/dist/components/groups/header.js.map +1 -0
- package/dist/components/groups/index.d.ts +6 -0
- package/dist/components/groups/memberships.d.ts +55 -0
- package/dist/components/groups/memberships.js +527 -0
- package/dist/components/groups/memberships.js.map +1 -0
- package/dist/components/groups/parts.d.ts +49 -0
- package/dist/components/groups/parts.js +172 -0
- package/dist/components/groups/parts.js.map +1 -0
- package/dist/components/media-folder-editor.js +153 -152
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/social/comments.d.ts +7 -5
- package/dist/components/social/comments.js +6 -2
- package/dist/components/social/comments.js.map +1 -1
- package/dist/components/social/engagement.d.ts +4 -3
- package/dist/components/social/engagement.js.map +1 -1
- package/dist/components/social/moderation.d.ts +1 -1
- package/dist/components/social/moderation.js +3 -3
- package/dist/components/social/moderation.js.map +1 -1
- package/dist/editor/rich-text-editor.d.ts +4 -4
- package/dist/editor/rich-text-editor.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +23 -9
- package/dist/locales/admin/de.js +5 -66
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +5 -66
- package/dist/locales/admin/en.js +19 -80
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +5 -66
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +5 -66
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +5 -66
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +5 -66
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/content/de.d.ts +2 -0
- package/dist/locales/content/de.js +98 -0
- package/dist/locales/content/de.js.map +1 -0
- package/dist/locales/content/en.d.ts +93 -0
- package/dist/locales/content/en.js +98 -0
- package/dist/locales/content/en.js.map +1 -0
- package/dist/locales/content/es.d.ts +2 -0
- package/dist/locales/content/es.js +98 -0
- package/dist/locales/content/es.js.map +1 -0
- package/dist/locales/content/ja.d.ts +2 -0
- package/dist/locales/content/ja.js +98 -0
- package/dist/locales/content/ja.js.map +1 -0
- package/dist/locales/content/ko.d.ts +2 -0
- package/dist/locales/content/ko.js +98 -0
- package/dist/locales/content/ko.js.map +1 -0
- package/dist/locales/content/zh.d.ts +2 -0
- package/dist/locales/content/zh.js +98 -0
- package/dist/locales/content/zh.js.map +1 -0
- package/dist/locales/de.js +11 -2
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/discovery/de.d.ts +2 -0
- package/dist/locales/discovery/de.js +68 -0
- package/dist/locales/discovery/de.js.map +1 -0
- package/dist/locales/discovery/en.d.ts +63 -0
- package/dist/locales/discovery/en.js +68 -0
- package/dist/locales/discovery/en.js.map +1 -0
- package/dist/locales/discovery/es.d.ts +2 -0
- package/dist/locales/discovery/es.js +68 -0
- package/dist/locales/discovery/es.js.map +1 -0
- package/dist/locales/discovery/ja.d.ts +2 -0
- package/dist/locales/discovery/ja.js +68 -0
- package/dist/locales/discovery/ja.js.map +1 -0
- package/dist/locales/discovery/ko.d.ts +2 -0
- package/dist/locales/discovery/ko.js +68 -0
- package/dist/locales/discovery/ko.js.map +1 -0
- package/dist/locales/discovery/zh.d.ts +2 -0
- package/dist/locales/discovery/zh.js +68 -0
- package/dist/locales/discovery/zh.js.map +1 -0
- package/dist/locales/en.d.ts +288 -67
- package/dist/locales/en.js +11 -2
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +11 -2
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/groups/de.d.ts +2 -0
- package/dist/locales/groups/de.js +133 -0
- package/dist/locales/groups/de.js.map +1 -0
- package/dist/locales/groups/en.d.ts +128 -0
- package/dist/locales/groups/en.js +133 -0
- package/dist/locales/groups/en.js.map +1 -0
- package/dist/locales/groups/es.d.ts +2 -0
- package/dist/locales/groups/es.js +133 -0
- package/dist/locales/groups/es.js.map +1 -0
- package/dist/locales/groups/ja.d.ts +2 -0
- package/dist/locales/groups/ja.js +133 -0
- package/dist/locales/groups/ja.js.map +1 -0
- package/dist/locales/groups/ko.d.ts +2 -0
- package/dist/locales/groups/ko.js +133 -0
- package/dist/locales/groups/ko.js.map +1 -0
- package/dist/locales/groups/zh.d.ts +2 -0
- package/dist/locales/groups/zh.js +133 -0
- package/dist/locales/groups/zh.js.map +1 -0
- package/dist/locales/ja.js +11 -2
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +11 -2
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/social/de.js +2 -1
- package/dist/locales/social/de.js.map +1 -1
- package/dist/locales/social/en.d.ts +2 -1
- package/dist/locales/social/en.js +2 -1
- package/dist/locales/social/en.js.map +1 -1
- package/dist/locales/social/es.js +2 -1
- package/dist/locales/social/es.js.map +1 -1
- package/dist/locales/social/ja.js +2 -1
- package/dist/locales/social/ja.js.map +1 -1
- package/dist/locales/social/ko.js +2 -1
- package/dist/locales/social/ko.js.map +1 -1
- package/dist/locales/social/zh.js +2 -1
- package/dist/locales/social/zh.js.map +1 -1
- package/dist/locales/zh.js +11 -2
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/admin.d.ts +1 -1
- package/dist/react/admin.js +8 -6
- package/dist/react/admin.js.map +1 -1
- package/dist/react/comments.d.ts +9 -7
- package/dist/react/comments.js +42 -27
- package/dist/react/comments.js.map +1 -1
- package/dist/react/contents.d.ts +57 -0
- package/dist/react/contents.js +214 -0
- package/dist/react/contents.js.map +1 -0
- package/dist/react/context.d.ts +1 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/crop.js +45 -44
- package/dist/react/crop.js.map +1 -1
- package/dist/react/detail.d.ts +30 -0
- package/dist/react/detail.js +42 -0
- package/dist/react/detail.js.map +1 -0
- package/dist/react/discovery.d.ts +138 -0
- package/dist/react/discovery.js +299 -0
- package/dist/react/discovery.js.map +1 -0
- package/dist/react/engagement.d.ts +5 -5
- package/dist/react/engagement.js +55 -41
- package/dist/react/engagement.js.map +1 -1
- package/dist/react/folder.js +54 -53
- package/dist/react/folder.js.map +1 -1
- package/dist/react/groups.d.ts +115 -0
- package/dist/react/groups.js +229 -0
- package/dist/react/groups.js.map +1 -0
- package/dist/react/index.d.ts +5 -1
- package/dist/react/public.d.ts +6 -5
- package/dist/react/public.js +19 -22
- package/dist/react/public.js.map +1 -1
- package/dist/react/read.js +105 -106
- package/dist/react/read.js.map +1 -1
- package/dist/react/resources.d.ts +2 -2
- package/dist/react/resources.js +69 -40
- package/dist/react/resources.js.map +1 -1
- package/dist/react/store.js +41 -39
- package/dist/react/store.js.map +1 -1
- package/dist/react/upload.js +54 -53
- package/dist/react/upload.js.map +1 -1
- package/dist/react/use-resource.d.ts +2 -1
- package/dist/react/use-resource.js +1 -0
- package/dist/react/use-resource.js.map +1 -1
- package/dist/react/versions.d.ts +57 -0
- package/dist/react/versions.js +94 -0
- package/dist/react/versions.js.map +1 -0
- package/dist/react/video.js +87 -86
- package/dist/react/video.js.map +1 -1
- package/dist/react.js +9 -5
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/client/content/posts.d.ts +0 -52
- package/dist/client/content/posts.js +0 -84
- package/dist/client/content/posts.js.map +0 -1
- package/dist/client/taxonomy.d.ts +0 -34
- package/dist/client/taxonomy.js +0 -84
- package/dist/client/taxonomy.js.map +0 -1
- package/dist/components/admin/post-manager.d.ts +0 -45
- package/dist/components/admin/post-manager.js +0 -602
- package/dist/components/admin/post-manager.js.map +0 -1
- package/dist/components/admin/taxonomy-manager.d.ts +0 -54
- package/dist/components/admin/taxonomy-manager.js +0 -976
- package/dist/components/admin/taxonomy-manager.js.map +0 -1
- package/dist/react/posts.d.ts +0 -61
- package/dist/react/posts.js +0 -183
- package/dist/react/posts.js.map +0 -1
package/dist/react/video.js
CHANGED
|
@@ -1,121 +1,122 @@
|
|
|
1
1
|
import { toContentKitError as e } from "../client/errors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { itemKey as t } from "../client/media/ref.js";
|
|
3
|
+
import { samePath as n } from "../client/media/client.js";
|
|
4
|
+
import { useContentKitClient as r } from "./context.js";
|
|
5
|
+
import { withUpload as i } from "./store.js";
|
|
6
|
+
import { useMediaRead as a } from "./read.js";
|
|
7
|
+
import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
7
8
|
//#region src/react/video.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let
|
|
9
|
+
var u = e, d = (e) => t(e);
|
|
10
|
+
function f(e) {
|
|
11
|
+
let t = a(e.ref, {
|
|
11
12
|
editor: !0,
|
|
12
13
|
read: e.read,
|
|
13
14
|
client: e.client
|
|
14
|
-
}),
|
|
15
|
+
}), r = (e) => t.read?.files.find((t) => t.upload && n(t.path, e)) ?? null, s = e.poster ?? "poster", { read: c, set: l } = t, u = o((e) => l(i(c, s, e)), [
|
|
15
16
|
c,
|
|
16
17
|
s,
|
|
17
18
|
l
|
|
18
19
|
]);
|
|
19
20
|
return {
|
|
20
|
-
video:
|
|
21
|
-
poster:
|
|
22
|
-
loading:
|
|
23
|
-
error:
|
|
24
|
-
reload:
|
|
21
|
+
video: r(e.video ?? "source"),
|
|
22
|
+
poster: r(s),
|
|
23
|
+
loading: t.loading,
|
|
24
|
+
error: t.error,
|
|
25
|
+
reload: t.reload,
|
|
25
26
|
set: u
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
let { media: t } =
|
|
29
|
+
function p(e) {
|
|
30
|
+
let { media: t } = r(e.client), n = e.count ?? 8, i = e.width ?? 160, a = e.duration ?? 0, o = `${d(e.ref)}#${e.path ?? ""}#${a}#${n}#${i}`, [f, p] = l({
|
|
30
31
|
key: "",
|
|
31
32
|
frames: []
|
|
32
|
-
}), m =
|
|
33
|
+
}), m = c(e.ref);
|
|
33
34
|
m.current = e.ref;
|
|
34
|
-
let
|
|
35
|
-
return
|
|
35
|
+
let h = c(e.onError);
|
|
36
|
+
return h.current = e.onError, s(() => {
|
|
36
37
|
if (!(a > 0) || !e.path) return;
|
|
37
|
-
let
|
|
38
|
+
let r = e.path, s = new AbortController(), c = !1, l = Array.from({ length: n }, (e, t) => g((t + .5) / n * a)), d = [];
|
|
38
39
|
return p({
|
|
39
|
-
key:
|
|
40
|
-
frames:
|
|
40
|
+
key: o,
|
|
41
|
+
frames: l.map((e) => ({ time: e }))
|
|
41
42
|
}), (async () => {
|
|
42
|
-
for (let [e,
|
|
43
|
-
let a = await t.getFrame(m.current,
|
|
44
|
-
if (
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
key:
|
|
43
|
+
for (let [e, n] of l.entries()) try {
|
|
44
|
+
let a = await t.getFrame(m.current, r, n, i, s.signal);
|
|
45
|
+
if (s.signal.aborted) return;
|
|
46
|
+
let c = URL.createObjectURL(a);
|
|
47
|
+
d.push(c), p((t) => t.key === o ? {
|
|
48
|
+
key: o,
|
|
48
49
|
frames: t.frames.map((t, n) => n === e ? {
|
|
49
50
|
...t,
|
|
50
|
-
url:
|
|
51
|
+
url: c
|
|
51
52
|
} : t)
|
|
52
53
|
} : t);
|
|
53
54
|
} catch (e) {
|
|
54
|
-
if (
|
|
55
|
-
|
|
55
|
+
if (s.signal.aborted) return;
|
|
56
|
+
c || h.current?.(u(e)), c = !0;
|
|
56
57
|
}
|
|
57
58
|
})(), () => {
|
|
58
|
-
|
|
59
|
+
s.abort(), d.forEach((e) => URL.revokeObjectURL(e));
|
|
59
60
|
};
|
|
60
61
|
}, [
|
|
61
62
|
t,
|
|
62
|
-
|
|
63
|
+
o,
|
|
63
64
|
a,
|
|
64
|
-
|
|
65
|
+
n,
|
|
65
66
|
i,
|
|
66
67
|
e.path
|
|
67
|
-
]), f.key ===
|
|
68
|
+
]), f.key === o ? f.frames : [];
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
let { media: t } =
|
|
70
|
+
function m(e) {
|
|
71
|
+
let { media: t } = r(e.client), n = e.width ?? 640, i = e.delay ?? 120, [a, o] = l({ loading: !1 }), f = c(e.ref);
|
|
71
72
|
f.current = e.ref;
|
|
72
|
-
let p =
|
|
73
|
+
let p = c(void 0), m = c(e.onError);
|
|
73
74
|
m.current = e.onError;
|
|
74
|
-
let h =
|
|
75
|
-
return
|
|
75
|
+
let h = d(e.ref);
|
|
76
|
+
return s(() => {
|
|
76
77
|
if (e.time === void 0 || !e.path) return;
|
|
77
|
-
let
|
|
78
|
-
|
|
78
|
+
let r = e.time, a = e.path, s = new AbortController();
|
|
79
|
+
o((e) => ({
|
|
79
80
|
...e,
|
|
80
81
|
loading: !0,
|
|
81
82
|
error: void 0
|
|
82
83
|
}));
|
|
83
|
-
let
|
|
84
|
-
t.getFrame(f.current, a,
|
|
85
|
-
if (
|
|
84
|
+
let c = setTimeout(() => {
|
|
85
|
+
t.getFrame(f.current, a, r, n, s.signal).then((e) => {
|
|
86
|
+
if (s.signal.aborted) return;
|
|
86
87
|
p.current && URL.revokeObjectURL(p.current);
|
|
87
88
|
let t = p.current = URL.createObjectURL(e);
|
|
88
|
-
|
|
89
|
+
o({
|
|
89
90
|
url: t,
|
|
90
|
-
time:
|
|
91
|
+
time: r,
|
|
91
92
|
loading: !1
|
|
92
93
|
});
|
|
93
94
|
}, (e) => {
|
|
94
|
-
|
|
95
|
+
s.signal.aborted || (o((t) => ({
|
|
95
96
|
...t,
|
|
96
97
|
loading: !1,
|
|
97
|
-
error:
|
|
98
|
-
})), m.current?.(
|
|
98
|
+
error: u(e)
|
|
99
|
+
})), m.current?.(u(e)));
|
|
99
100
|
});
|
|
100
101
|
}, i);
|
|
101
102
|
return () => {
|
|
102
|
-
clearTimeout(
|
|
103
|
+
clearTimeout(c), s.abort();
|
|
103
104
|
};
|
|
104
105
|
}, [
|
|
105
106
|
t,
|
|
106
107
|
h,
|
|
107
108
|
e.path,
|
|
108
109
|
e.time,
|
|
109
|
-
|
|
110
|
+
n,
|
|
110
111
|
i
|
|
111
|
-
]),
|
|
112
|
+
]), s(() => () => {
|
|
112
113
|
p.current && URL.revokeObjectURL(p.current);
|
|
113
114
|
}, []), a;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
let { media: t } =
|
|
117
|
-
|
|
118
|
-
let
|
|
116
|
+
function h(e) {
|
|
117
|
+
let { media: t } = r(e.client), [n, i] = l({ status: "idle" }), a = c(e);
|
|
118
|
+
a.current = e;
|
|
119
|
+
let s = o(async (e) => {
|
|
119
120
|
i({ status: "saving" });
|
|
120
121
|
try {
|
|
121
122
|
let t = await e((e) => i({
|
|
@@ -123,17 +124,17 @@ function m(e) {
|
|
|
123
124
|
progress: e,
|
|
124
125
|
rendering: e.phase === "processing"
|
|
125
126
|
}));
|
|
126
|
-
return i({ status: "idle" }),
|
|
127
|
+
return i({ status: "idle" }), a.current.onSaved?.(t), t;
|
|
127
128
|
} catch (e) {
|
|
128
|
-
let t =
|
|
129
|
+
let t = u(e);
|
|
129
130
|
i({
|
|
130
131
|
status: "error",
|
|
131
132
|
error: t
|
|
132
|
-
}),
|
|
133
|
+
}), a.current.onError?.(t);
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
|
-
}, []), d =
|
|
136
|
-
let { ref: r, path: i = "poster", timeout:
|
|
136
|
+
}, []), d = o((e) => s(async (n) => {
|
|
137
|
+
let { ref: r, path: i = "poster", timeout: o } = a.current;
|
|
137
138
|
return await t.commit(r, [{
|
|
138
139
|
op: "frame",
|
|
139
140
|
path: i,
|
|
@@ -142,43 +143,43 @@ function m(e) {
|
|
|
142
143
|
phase: "processing",
|
|
143
144
|
loaded: 0,
|
|
144
145
|
total: 0
|
|
145
|
-
}), t.waitFor(r, i, { timeout:
|
|
146
|
-
}), [t,
|
|
146
|
+
}), t.waitFor(r, i, { timeout: o });
|
|
147
|
+
}), [t, s]);
|
|
147
148
|
return {
|
|
148
|
-
state:
|
|
149
|
-
saveFrame:
|
|
150
|
-
t:
|
|
149
|
+
state: n,
|
|
150
|
+
saveFrame: o((e, t) => d({
|
|
151
|
+
t: g(e),
|
|
151
152
|
...t ? { edit: t } : {}
|
|
152
153
|
}), [d]),
|
|
153
|
-
saveUpload:
|
|
154
|
-
let { ref: r, path: i = "poster", timeout:
|
|
155
|
-
return
|
|
154
|
+
saveUpload: o((e, n) => {
|
|
155
|
+
let { ref: r, path: i = "poster", timeout: o } = a.current;
|
|
156
|
+
return s((a) => t.put(e, {
|
|
156
157
|
ref: r,
|
|
157
158
|
path: i,
|
|
158
159
|
edit: n,
|
|
159
|
-
timeout:
|
|
160
|
-
onProgress:
|
|
160
|
+
timeout: o,
|
|
161
|
+
onProgress: a
|
|
161
162
|
}));
|
|
162
|
-
}, [t,
|
|
163
|
-
saveAuto:
|
|
164
|
-
saveFrameFrom:
|
|
165
|
-
let { ref:
|
|
166
|
-
return
|
|
167
|
-
let
|
|
163
|
+
}, [t, s]),
|
|
164
|
+
saveAuto: o(() => d({ auto: !0 }), [d]),
|
|
165
|
+
saveFrameFrom: o((e, n, r, i) => {
|
|
166
|
+
let { ref: o, path: c = "poster", timeout: l } = a.current;
|
|
167
|
+
return s(async (a) => {
|
|
168
|
+
let s = await t.getFrame(e, n, g(r)), u = new File([s], "frame.jpg", { type: "image/jpeg" });
|
|
168
169
|
return t.put(u, {
|
|
169
|
-
ref:
|
|
170
|
-
path:
|
|
170
|
+
ref: o,
|
|
171
|
+
path: c,
|
|
171
172
|
edit: i,
|
|
172
|
-
timeout:
|
|
173
|
-
onProgress:
|
|
173
|
+
timeout: l,
|
|
174
|
+
onProgress: a
|
|
174
175
|
});
|
|
175
176
|
});
|
|
176
|
-
}, [t,
|
|
177
|
-
reset:
|
|
177
|
+
}, [t, s]),
|
|
178
|
+
reset: o(() => i({ status: "idle" }), [])
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
var
|
|
181
|
+
var g = (e) => Math.round(e * 1e3) / 1e3;
|
|
181
182
|
//#endregion
|
|
182
|
-
export {
|
|
183
|
+
export { g as round3, p as useFrameStrip, m as useVideoFrame, f as useVideoImages, h as useVideoPoster };
|
|
183
184
|
|
|
184
185
|
//# sourceMappingURL=video.js.map
|
package/dist/react/video.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.js","names":[],"sources":["../../src/react/video.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ContentKitClient } from \"../client/client.js\";\nimport { toContentKitError, type ContentKitError } from \"../client/errors.js\";\nimport type { Edit, FileInfo, Op, ReadResult, RefBody } from \"../client/generated/wire.js\";\nimport { samePath, type Progress } from \"../client/media/client.js\";\nimport { useContentKitClient } from \"./context.js\";\nimport { useMediaRead } from \"./read.js\";\nimport { withUpload } from \"./store.js\";\n\nconst asError = toContentKitError;\nconst refKey = (ref: RefBody) => `${ref.kind}/${ref.id}`;\n\nexport interface VideoImagesOptions {\n ref: RefBody;\n /** The video upload path. Default \"source\". */\n video?: string;\n /** The poster upload path, grabbed from the video's frames. Default \"poster\". */\n poster?: string;\n /** An editor read of the item the host already has; skips the fetch. */\n read?: ReadResult | null;\n /** Overrides the provider's client; without one only a supplied read shows. */\n client?: ContentKitClient | null;\n}\n\nexport interface UseVideoImages {\n /** The video upload (its duration and size once probed); null without one. */\n video: FileInfo | null;\n /** The poster upload: a frame ({t} or {auto}) or an uploaded image; null without one. */\n poster: FileInfo | null;\n loading: boolean;\n error?: ContentKitError;\n reload: () => void;\n /** Replaces the poster after a save without refetching. */\n set: (poster: FileInfo) => void;\n}\n\n/** A video item's video and poster uploads (an editor read). */\nexport function useVideoImages(o: VideoImagesOptions): UseVideoImages {\n const r = useMediaRead(o.ref, { editor: true, read: o.read, client: o.client });\n const find = (p: string) => r.read?.files.find((f) => f.upload && samePath(f.path, p)) ?? null;\n const posterPath = o.poster ?? \"poster\";\n const { read, set: update } = r;\n const set = useCallback((poster: FileInfo) => update(withUpload(read, posterPath, poster)), [read, posterPath, update]);\n return { video: find(o.video ?? \"source\"), poster: find(posterPath), loading: r.loading, error: r.error, reload: r.reload, set };\n}\n\nexport interface FrameStripOptions {\n ref: RefBody;\n /** The video upload's path (a read's, with its extension). */\n path?: string;\n /** Seconds; nothing is fetched until it is known. */\n duration?: number;\n /** Frames across the video. Default 8. */\n count?: number;\n /** Pixels. Default 160. */\n width?: number;\n /** The first failed grab (the strip keeps going without it). */\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface StripFrame {\n time: number;\n /** An object URL once fetched. */\n url?: string;\n}\n\n/**\n * Evenly spaced frames for coarse browsing, fetched one at a time (the frame\n * endpoint allows two grabs at once per host), revoked on change or unmount.\n */\nexport function useFrameStrip(o: FrameStripOptions): StripFrame[] {\n const { media } = useContentKitClient(o.client);\n const count = o.count ?? 8;\n const width = o.width ?? 160;\n const duration = o.duration ?? 0;\n const key = `${refKey(o.ref)}#${o.path ?? \"\"}#${duration}#${count}#${width}`;\n const [state, setState] = useState<{ key: string; frames: StripFrame[] }>({ key: \"\", frames: [] });\n const ref = useRef(o.ref);\n ref.current = o.ref;\n const onError = useRef(o.onError);\n onError.current = o.onError;\n useEffect(() => {\n if (!(duration > 0) || !o.path) return;\n const path = o.path;\n const ctl = new AbortController();\n let reported = false;\n const times = Array.from({ length: count }, (_, i) => round3(((i + 0.5) / count) * duration));\n const urls: string[] = [];\n setState({ key, frames: times.map((time) => ({ time })) });\n void (async () => {\n for (const [i, time] of times.entries()) {\n try {\n const blob = await media.getFrame(ref.current, path, time, width, ctl.signal);\n if (ctl.signal.aborted) return;\n const url = URL.createObjectURL(blob);\n urls.push(url);\n setState((s) => (s.key === key ? { key, frames: s.frames.map((f, j) => (j === i ? { ...f, url } : f)) } : s));\n } catch (e) {\n if (ctl.signal.aborted) return;\n if (!reported) onError.current?.(asError(e));\n reported = true;\n }\n }\n })();\n return () => {\n ctl.abort();\n urls.forEach((u) => URL.revokeObjectURL(u));\n };\n }, [media, key, duration, count, width, o.path]);\n return state.key === key ? state.frames : [];\n}\n\nexport interface VideoFrameOptions {\n ref: RefBody;\n /** The video upload's path; nothing is fetched without it. */\n path?: string;\n /** Seconds; undefined fetches nothing. */\n time?: number;\n /** Pixels. Default 640. */\n width?: number;\n /** Debounce while scrubbing, ms. Default 120. */\n delay?: number;\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface UseVideoFrame {\n /** The latest fetched frame; kept while the next one loads. */\n url?: string;\n /** The time url shows. */\n time?: number;\n loading: boolean;\n error?: ContentKitError;\n}\n\n/** The exact frame at time, debounced while it changes. */\nexport function useVideoFrame(o: VideoFrameOptions): UseVideoFrame {\n const { media } = useContentKitClient(o.client);\n const width = o.width ?? 640;\n const delay = o.delay ?? 120;\n const [state, setState] = useState<UseVideoFrame>({ loading: false });\n const ref = useRef(o.ref);\n ref.current = o.ref;\n const last = useRef<string | undefined>(undefined);\n const onError = useRef(o.onError);\n onError.current = o.onError;\n const key = refKey(o.ref);\n useEffect(() => {\n if (o.time === undefined || !o.path) return;\n const time = o.time;\n const path = o.path;\n const ctl = new AbortController();\n setState((s) => ({ ...s, loading: true, error: undefined }));\n const t = setTimeout(() => {\n media.getFrame(ref.current, path, time, width, ctl.signal).then(\n (blob) => {\n if (ctl.signal.aborted) return;\n if (last.current) URL.revokeObjectURL(last.current);\n const url = (last.current = URL.createObjectURL(blob));\n setState({ url, time, loading: false });\n },\n (e) => {\n if (ctl.signal.aborted) return;\n setState((s) => ({ ...s, loading: false, error: asError(e) }));\n onError.current?.(asError(e));\n },\n );\n }, delay);\n return () => {\n clearTimeout(t);\n ctl.abort();\n };\n }, [media, key, o.path, o.time, width, delay]);\n useEffect(\n () => () => {\n if (last.current) URL.revokeObjectURL(last.current);\n },\n [],\n );\n return state;\n}\n\nexport type VideoSaveState =\n | { status: \"idle\" }\n | { status: \"saving\"; progress?: Progress; rendering?: boolean }\n | { status: \"error\"; error: ContentKitError };\n\nexport interface VideoPosterOptions {\n ref: RefBody;\n /** The poster upload path. Default \"poster\". */\n path?: string;\n /** With the processed poster upload after each save. */\n onSaved?: (poster: FileInfo) => void;\n /** Polling limit for the render, ms. Default 120000. */\n timeout?: number;\n /** Every failed save: the request, the render or the wait. */\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface UseVideoPoster {\n state: VideoSaveState;\n /** A frame at time (seconds), cropped by edit in the frame's pixels (the video's w×h). */\n saveFrame: (time: number, edit?: Edit | null) => Promise<FileInfo | undefined>;\n /** An uploaded image, cropped by edit in its own pixels. */\n saveUpload: (image: Blob, edit?: Edit | null) => Promise<FileInfo | undefined>;\n /** The worker's choice of frame. */\n saveAuto: () => Promise<FileInfo | undefined>;\n /**\n * A frame of another item's video upload (at path, time seconds) uploaded\n * as the poster image, cropped by edit in the frame's pixels.\n */\n saveFrameFrom: (video: RefBody, path: string, time: number, edit?: Edit | null) => Promise<FileInfo | undefined>;\n reset: () => void;\n}\n\n/** Headless poster selection: a frame op or an uploaded image, then the wait for the worker to render it. */\nexport function useVideoPoster(o: VideoPosterOptions): UseVideoPoster {\n const { media } = useContentKitClient(o.client);\n const [state, setState] = useState<VideoSaveState>({ status: \"idle\" });\n const opts = useRef(o);\n opts.current = o;\n const run = useCallback(async (save: (onProgress: (p: Progress) => void) => Promise<FileInfo>) => {\n setState({ status: \"saving\" });\n try {\n const f = await save((progress) => setState({ status: \"saving\", progress, rendering: progress.phase === \"processing\" }));\n setState({ status: \"idle\" });\n opts.current.onSaved?.(f);\n return f;\n } catch (e) {\n const error = asError(e);\n setState({ status: \"error\", error });\n opts.current.onError?.(error);\n return undefined;\n }\n }, []);\n const frame = useCallback(\n (op: Omit<Op, \"op\" | \"path\">) =>\n run(async (onProgress) => {\n const { ref, path = \"poster\", timeout } = opts.current;\n await media.commit(ref, [{ op: \"frame\", path, ...op }]);\n onProgress({ phase: \"processing\", loaded: 0, total: 0 });\n return media.waitFor(ref, path, { timeout });\n }),\n [media, run],\n );\n return {\n state,\n saveFrame: useCallback((time, edit) => frame({ t: round3(time), ...(edit ? { edit } : {}) }), [frame]),\n saveUpload: useCallback(\n (image, edit) => {\n const { ref, path = \"poster\", timeout } = opts.current;\n return run((onProgress) => media.put(image, { ref, path, edit, timeout, onProgress }));\n },\n [media, run],\n ),\n saveAuto: useCallback(() => frame({ auto: true }), [frame]),\n saveFrameFrom: useCallback(\n (video, path, time, edit) => {\n const { ref, path: to = \"poster\", timeout } = opts.current;\n return run(async (onProgress) => {\n const still = await media.getFrame(video, path, round3(time));\n // GET /frame answers a JPEG.\n const file = new File([still], \"frame.jpg\", { type: \"image/jpeg\" });\n return media.put(file, { ref, path: to, edit, timeout, onProgress });\n });\n },\n [media, run],\n ),\n reset: useCallback(() => setState({ status: \"idle\" }), []),\n };\n}\n\nexport const round3 = (v: number) => Math.round(v * 1000) / 1000;\n"],"mappings":";;;;;;;AASA,IAAM,IAAU,GACV,KAAU,MAAiB,GAAG,EAAI,KAAK,GAAG,EAAI;AA2BpD,SAAgB,EAAe,GAAuC;CACpE,IAAM,IAAI,EAAa,EAAE,KAAK;EAAE,QAAQ;EAAM,MAAM,EAAE;EAAM,QAAQ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A,CAAC,GAAO,CAAG,CACb;EACA,OAAO,QAAkB,EAAS,EAAE,QAAQ,OAAO,CAAC,GAAG,CAAC,CAAC;CAC3D;AACF;AAEA,IAAa,KAAU,MAAc,KAAK,MAAM,IAAI,GAAI,IAAI"}
|
|
1
|
+
{"version":3,"file":"video.js","names":[],"sources":["../../src/react/video.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { itemKey } from \"../client/media/ref.js\";\nimport type { ContentKitClient } from \"../client/client.js\";\nimport { toContentKitError, type ContentKitError } from \"../client/errors.js\";\nimport type { Edit, FileInfo, Op, ReadResult, RefBody } from \"../client/generated/wire.js\";\nimport { samePath, type Progress } from \"../client/media/client.js\";\nimport { useContentKitClient } from \"./context.js\";\nimport { useMediaRead } from \"./read.js\";\nimport { withUpload } from \"./store.js\";\n\nconst asError = toContentKitError;\nconst refKey = (ref: RefBody) => itemKey(ref);\n\nexport interface VideoImagesOptions {\n ref: RefBody;\n /** The video upload path. Default \"source\". */\n video?: string;\n /** The poster upload path, grabbed from the video's frames. Default \"poster\". */\n poster?: string;\n /** An editor read of the item the host already has; skips the fetch. */\n read?: ReadResult | null;\n /** Overrides the provider's client; without one only a supplied read shows. */\n client?: ContentKitClient | null;\n}\n\nexport interface UseVideoImages {\n /** The video upload (its duration and size once probed); null without one. */\n video: FileInfo | null;\n /** The poster upload: a frame ({t} or {auto}) or an uploaded image; null without one. */\n poster: FileInfo | null;\n loading: boolean;\n error?: ContentKitError;\n reload: () => void;\n /** Replaces the poster after a save without refetching. */\n set: (poster: FileInfo) => void;\n}\n\n/** A video item's video and poster uploads (an editor read). */\nexport function useVideoImages(o: VideoImagesOptions): UseVideoImages {\n const r = useMediaRead(o.ref, { editor: true, read: o.read, client: o.client });\n const find = (p: string) => r.read?.files.find((f) => f.upload && samePath(f.path, p)) ?? null;\n const posterPath = o.poster ?? \"poster\";\n const { read, set: update } = r;\n const set = useCallback((poster: FileInfo) => update(withUpload(read, posterPath, poster)), [read, posterPath, update]);\n return { video: find(o.video ?? \"source\"), poster: find(posterPath), loading: r.loading, error: r.error, reload: r.reload, set };\n}\n\nexport interface FrameStripOptions {\n ref: RefBody;\n /** The video upload's path (a read's, with its extension). */\n path?: string;\n /** Seconds; nothing is fetched until it is known. */\n duration?: number;\n /** Frames across the video. Default 8. */\n count?: number;\n /** Pixels. Default 160. */\n width?: number;\n /** The first failed grab (the strip keeps going without it). */\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface StripFrame {\n time: number;\n /** An object URL once fetched. */\n url?: string;\n}\n\n/**\n * Evenly spaced frames for coarse browsing, fetched one at a time (the frame\n * endpoint allows two grabs at once per host), revoked on change or unmount.\n */\nexport function useFrameStrip(o: FrameStripOptions): StripFrame[] {\n const { media } = useContentKitClient(o.client);\n const count = o.count ?? 8;\n const width = o.width ?? 160;\n const duration = o.duration ?? 0;\n const key = `${refKey(o.ref)}#${o.path ?? \"\"}#${duration}#${count}#${width}`;\n const [state, setState] = useState<{ key: string; frames: StripFrame[] }>({ key: \"\", frames: [] });\n const ref = useRef(o.ref);\n ref.current = o.ref;\n const onError = useRef(o.onError);\n onError.current = o.onError;\n useEffect(() => {\n if (!(duration > 0) || !o.path) return;\n const path = o.path;\n const ctl = new AbortController();\n let reported = false;\n const times = Array.from({ length: count }, (_, i) => round3(((i + 0.5) / count) * duration));\n const urls: string[] = [];\n setState({ key, frames: times.map((time) => ({ time })) });\n void (async () => {\n for (const [i, time] of times.entries()) {\n try {\n const blob = await media.getFrame(ref.current, path, time, width, ctl.signal);\n if (ctl.signal.aborted) return;\n const url = URL.createObjectURL(blob);\n urls.push(url);\n setState((s) => (s.key === key ? { key, frames: s.frames.map((f, j) => (j === i ? { ...f, url } : f)) } : s));\n } catch (e) {\n if (ctl.signal.aborted) return;\n if (!reported) onError.current?.(asError(e));\n reported = true;\n }\n }\n })();\n return () => {\n ctl.abort();\n urls.forEach((u) => URL.revokeObjectURL(u));\n };\n }, [media, key, duration, count, width, o.path]);\n return state.key === key ? state.frames : [];\n}\n\nexport interface VideoFrameOptions {\n ref: RefBody;\n /** The video upload's path; nothing is fetched without it. */\n path?: string;\n /** Seconds; undefined fetches nothing. */\n time?: number;\n /** Pixels. Default 640. */\n width?: number;\n /** Debounce while scrubbing, ms. Default 120. */\n delay?: number;\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface UseVideoFrame {\n /** The latest fetched frame; kept while the next one loads. */\n url?: string;\n /** The time url shows. */\n time?: number;\n loading: boolean;\n error?: ContentKitError;\n}\n\n/** The exact frame at time, debounced while it changes. */\nexport function useVideoFrame(o: VideoFrameOptions): UseVideoFrame {\n const { media } = useContentKitClient(o.client);\n const width = o.width ?? 640;\n const delay = o.delay ?? 120;\n const [state, setState] = useState<UseVideoFrame>({ loading: false });\n const ref = useRef(o.ref);\n ref.current = o.ref;\n const last = useRef<string | undefined>(undefined);\n const onError = useRef(o.onError);\n onError.current = o.onError;\n const key = refKey(o.ref);\n useEffect(() => {\n if (o.time === undefined || !o.path) return;\n const time = o.time;\n const path = o.path;\n const ctl = new AbortController();\n setState((s) => ({ ...s, loading: true, error: undefined }));\n const t = setTimeout(() => {\n media.getFrame(ref.current, path, time, width, ctl.signal).then(\n (blob) => {\n if (ctl.signal.aborted) return;\n if (last.current) URL.revokeObjectURL(last.current);\n const url = (last.current = URL.createObjectURL(blob));\n setState({ url, time, loading: false });\n },\n (e) => {\n if (ctl.signal.aborted) return;\n setState((s) => ({ ...s, loading: false, error: asError(e) }));\n onError.current?.(asError(e));\n },\n );\n }, delay);\n return () => {\n clearTimeout(t);\n ctl.abort();\n };\n }, [media, key, o.path, o.time, width, delay]);\n useEffect(\n () => () => {\n if (last.current) URL.revokeObjectURL(last.current);\n },\n [],\n );\n return state;\n}\n\nexport type VideoSaveState =\n | { status: \"idle\" }\n | { status: \"saving\"; progress?: Progress; rendering?: boolean }\n | { status: \"error\"; error: ContentKitError };\n\nexport interface VideoPosterOptions {\n ref: RefBody;\n /** The poster upload path. Default \"poster\". */\n path?: string;\n /** With the processed poster upload after each save. */\n onSaved?: (poster: FileInfo) => void;\n /** Polling limit for the render, ms. Default 120000. */\n timeout?: number;\n /** Every failed save: the request, the render or the wait. */\n onError?: (e: ContentKitError) => void;\n /** Overrides the provider's client. */\n client?: ContentKitClient;\n}\n\nexport interface UseVideoPoster {\n state: VideoSaveState;\n /** A frame at time (seconds), cropped by edit in the frame's pixels (the video's w×h). */\n saveFrame: (time: number, edit?: Edit | null) => Promise<FileInfo | undefined>;\n /** An uploaded image, cropped by edit in its own pixels. */\n saveUpload: (image: Blob, edit?: Edit | null) => Promise<FileInfo | undefined>;\n /** The worker's choice of frame. */\n saveAuto: () => Promise<FileInfo | undefined>;\n /**\n * A frame of another item's video upload (at path, time seconds) uploaded\n * as the poster image, cropped by edit in the frame's pixels.\n */\n saveFrameFrom: (video: RefBody, path: string, time: number, edit?: Edit | null) => Promise<FileInfo | undefined>;\n reset: () => void;\n}\n\n/** Headless poster selection: a frame op or an uploaded image, then the wait for the worker to render it. */\nexport function useVideoPoster(o: VideoPosterOptions): UseVideoPoster {\n const { media } = useContentKitClient(o.client);\n const [state, setState] = useState<VideoSaveState>({ status: \"idle\" });\n const opts = useRef(o);\n opts.current = o;\n const run = useCallback(async (save: (onProgress: (p: Progress) => void) => Promise<FileInfo>) => {\n setState({ status: \"saving\" });\n try {\n const f = await save((progress) => setState({ status: \"saving\", progress, rendering: progress.phase === \"processing\" }));\n setState({ status: \"idle\" });\n opts.current.onSaved?.(f);\n return f;\n } catch (e) {\n const error = asError(e);\n setState({ status: \"error\", error });\n opts.current.onError?.(error);\n return undefined;\n }\n }, []);\n const frame = useCallback(\n (op: Omit<Op, \"op\" | \"path\">) =>\n run(async (onProgress) => {\n const { ref, path = \"poster\", timeout } = opts.current;\n await media.commit(ref, [{ op: \"frame\", path, ...op }]);\n onProgress({ phase: \"processing\", loaded: 0, total: 0 });\n return media.waitFor(ref, path, { timeout });\n }),\n [media, run],\n );\n return {\n state,\n saveFrame: useCallback((time, edit) => frame({ t: round3(time), ...(edit ? { edit } : {}) }), [frame]),\n saveUpload: useCallback(\n (image, edit) => {\n const { ref, path = \"poster\", timeout } = opts.current;\n return run((onProgress) => media.put(image, { ref, path, edit, timeout, onProgress }));\n },\n [media, run],\n ),\n saveAuto: useCallback(() => frame({ auto: true }), [frame]),\n saveFrameFrom: useCallback(\n (video, path, time, edit) => {\n const { ref, path: to = \"poster\", timeout } = opts.current;\n return run(async (onProgress) => {\n const still = await media.getFrame(video, path, round3(time));\n // GET /frame answers a JPEG.\n const file = new File([still], \"frame.jpg\", { type: \"image/jpeg\" });\n return media.put(file, { ref, path: to, edit, timeout, onProgress });\n });\n },\n [media, run],\n ),\n reset: useCallback(() => setState({ status: \"idle\" }), []),\n };\n}\n\nexport const round3 = (v: number) => Math.round(v * 1000) / 1000;\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAU,GACV,KAAU,MAAiB,EAAQ,CAAG;AA2B5C,SAAgB,EAAe,GAAuC;CACpE,IAAM,IAAI,EAAa,EAAE,KAAK;EAAE,QAAQ;EAAM,MAAM,EAAE;EAAM,QAAQ,EAAE;CAAO,CAAC,GACxE,KAAQ,MAAc,EAAE,MAAM,MAAM,MAAM,MAAM,EAAE,UAAU,EAAS,EAAE,MAAM,CAAC,CAAC,KAAK,MACpF,IAAa,EAAE,UAAU,UACzB,EAAE,SAAM,KAAK,MAAW,GACxB,IAAM,GAAa,MAAqB,EAAO,EAAW,GAAM,GAAY,CAAM,CAAC,GAAG;EAAC;EAAM;EAAY;CAAM,CAAC;CACtH,OAAO;EAAE,OAAO,EAAK,EAAE,SAAS,QAAQ;EAAG,QAAQ,EAAK,CAAU;EAAG,SAAS,EAAE;EAAS,OAAO,EAAE;EAAO,QAAQ,EAAE;EAAQ;CAAI;AACjI;AA4BA,SAAgB,EAAc,GAAoC;CAChE,IAAM,EAAE,aAAU,EAAoB,EAAE,M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AAM;GAAE,GAAG,EAAO,CAAI;GAAG,GAAI,IAAO,EAAE,QAAK,IAAI,CAAC;EAAG,CAAC,GAAG,CAAC,CAAK,CAAC;EACrG,YAAY,GACT,GAAO,MAAS;GACf,IAAM,EAAE,QAAK,UAAO,UAAU,eAAY,EAAK;GAC/C,OAAO,GAAK,MAAe,EAAM,IAAI,GAAO;IAAE;IAAK;IAAM;IAAM;IAAS;GAAW,CAAC,CAAC;EACvF,GACA,CAAC,GAAO,CAAG,CACb;EACA,UAAU,QAAkB,EAAM,EAAE,MAAM,GAAK,CAAC,GAAG,CAAC,CAAK,CAAC;EAC1D,eAAe,GACZ,GAAO,GAAM,GAAM,MAAS;GAC3B,IAAM,EAAE,QAAK,MAAM,IAAK,UAAU,eAAY,EAAK;GACnD,OAAO,EAAI,OAAO,MAAe;IAC/B,IAAM,IAAQ,MAAM,EAAM,SAAS,GAAO,GAAM,EAAO,CAAI,CAAC,GAEtD,IAAO,IAAI,KAAK,CAAC,CAAK,GAAG,aAAa,EAAE,MAAM,aAAa,CAAC;IAClE,OAAO,EAAM,IAAI,GAAM;KAAE;KAAK,MAAM;KAAI;KAAM;KAAS;IAAW,CAAC;GACrE,CAAC;EACH,GACA,CAAC,GAAO,CAAG,CACb;EACA,OAAO,QAAkB,EAAS,EAAE,QAAQ,OAAO,CAAC,GAAG,CAAC,CAAC;CAC3D;AACF;AAEA,IAAa,KAAU,MAAc,KAAK,MAAM,IAAI,GAAI,IAAI"}
|
package/dist/react.js
CHANGED
|
@@ -16,8 +16,12 @@ import { useContentConfig as X } from "./react/config.js";
|
|
|
16
16
|
import { useFavorite as Z, useReaction as Q } from "./react/engagement.js";
|
|
17
17
|
import { usePoll as $, usePollEditor as ee, usePolls as te, withVote as ne } from "./react/polls.js";
|
|
18
18
|
import { useAdminLocation as re, useFlowClient as ie, useStaffAccess as ae } from "./react/admin.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
19
|
+
import { memberId as oe, useContentGroups as se, useGroup as ce, useGroupMembers as le, useGroups as ue, useKinds as de, useMyGroups as fe } from "./react/groups.js";
|
|
20
|
+
import { beaconsFor as pe, useBeacons as me, useContentFilters as he, useContents as ge, useExposure as _e, useHistory as ve, useMyFavorites as ye, useMyReactions as be, useRecentSearches as xe, useRecommendations as Se, useReleaseDates as Ce, useSearch as we, useSimilar as Te, useTypeahead as Ee, useViewSignal as De } from "./react/discovery.js";
|
|
21
|
+
import { useContent as Oe, useManagedContents as ke } from "./react/contents.js";
|
|
22
|
+
import { useNotificationUnread as Ae, useNotifications as je } from "./react/notifications.js";
|
|
23
|
+
import { ContentKitProvider as Me } from "./react/provider.js";
|
|
24
|
+
import { useCanonicalContent as Ne } from "./react/canonical.js";
|
|
25
|
+
import { defaultVersion as Pe, liveVersions as Fe, useContentDetail as Ie } from "./react/detail.js";
|
|
26
|
+
import { nextRelease as Le, useReaderPlan as Re, useSegmentPages as ze, useVersionDownload as Be } from "./react/versions.js";
|
|
27
|
+
export { Me as ContentKitProvider, E as GALLERY_VIEW_KEY, i as GuardContext, e as HOVER_DELAY, t as InlinePreviewContext, D as PLAYER_QUALITY_KEY, L as ResourceStore, pe as beaconsFor, Pe as defaultVersion, v as editOutput, Fe as liveVersions, oe as memberId, N as nameIn, Le as nextRelease, R as resourcesFor, x as round3, P as thumbnailOf, V as useAdminComments, re as useAdminLocation, me as useBeacons, H as useCanComment, Ne as useCanonicalContent, O as useCarousel, U as useCommentBans, W as useCommentReplies, G as useComments, Oe as useContent, X as useContentConfig, Ie as useContentDetail, he as useContentFilters, se as useContentGroups, a as useContentKit, o as useContentKitClient, z as useContentScope, s as useContentURLs, ge as useContents, d as useCrop, M as useEditorCrop, f as useEncodeProgress, c as useErrorReporter, _e as useExposure, Z as useFavorite, ie as useFlowClient, S as useFrameStrip, k as useGalleryView, K as useGlobalCommentBan, ce as useGroup, le as useGroupMembers, ue as useGroups, l as useGuarded, ve as useHistory, A as useHlsPlayer, n as useInlinePreview, de as useKinds, q as useLatestComments, ke as useManagedContents, F as useMediaFolder, h as useMediaRead, J as useModerationQueue, ye as useMyFavorites, fe as useMyGroups, be as useMyReactions, I as useNearViewport, Ae as useNotificationUnread, je as useNotifications, u as useOptionalContentKitClient, B as usePaged, $ as usePoll, ee as usePollEditor, te as usePolls, g as usePresets, _ as usePublicImage, Q as useReaction, Re as useReaderPlan, xe as useRecentSearches, Se as useRecommendations, r as useReducedMotion, j as useRefreshBeforeExpiry, Ce as useReleaseDates, we as useSearch, ze as useSegmentPages, Te as useSimilar, y as useSlotCrop, b as useSlotImage, ae as useStaffAccess, Ee as useTypeahead, p as useUpload, m as useUploadQueue, Be as useVersionDownload, C as useVideoFrame, w as useVideoImages, T as useVideoPoster, De as useViewSignal, Y as withReaction, ne as withVote };
|