@aglyn/plugins-mui 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +22 -0
- package/package.json +47 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/accordion.d.ts +96 -0
- package/src/lib/components/accordion.js +392 -0
- package/src/lib/components/accordion.js.map +1 -0
- package/src/lib/components/app-bar.d.ts +32 -0
- package/src/lib/components/app-bar.js +86 -0
- package/src/lib/components/app-bar.js.map +1 -0
- package/src/lib/components/blocks.d.ts +46 -0
- package/src/lib/components/blocks.js +1007 -0
- package/src/lib/components/blocks.js.map +1 -0
- package/src/lib/components/box.d.ts +47 -0
- package/src/lib/components/box.js +125 -0
- package/src/lib/components/box.js.map +1 -0
- package/src/lib/components/breadcrumbs.d.ts +44 -0
- package/src/lib/components/breadcrumbs.js +172 -0
- package/src/lib/components/breadcrumbs.js.map +1 -0
- package/src/lib/components/button.d.ts +89 -0
- package/src/lib/components/button.js +272 -0
- package/src/lib/components/button.js.map +1 -0
- package/src/lib/components/card.d.ts +61 -0
- package/src/lib/components/card.js +336 -0
- package/src/lib/components/card.js.map +1 -0
- package/src/lib/components/collection.d.ts +514 -0
- package/src/lib/components/collection.js +2999 -0
- package/src/lib/components/collection.js.map +1 -0
- package/src/lib/components/container.d.ts +42 -0
- package/src/lib/components/container.js +169 -0
- package/src/lib/components/container.js.map +1 -0
- package/src/lib/components/custom-html.d.ts +78 -0
- package/src/lib/components/custom-html.js +219 -0
- package/src/lib/components/custom-html.js.map +1 -0
- package/src/lib/components/data-table.d.ts +57 -0
- package/src/lib/components/data-table.js +216 -0
- package/src/lib/components/data-table.js.map +1 -0
- package/src/lib/components/document-root.d.ts +77 -0
- package/src/lib/components/document-root.js +118 -0
- package/src/lib/components/document-root.js.map +1 -0
- package/src/lib/components/drawer.d.ts +93 -0
- package/src/lib/components/drawer.js +566 -0
- package/src/lib/components/drawer.js.map +1 -0
- package/src/lib/components/function-controls.d.ts +66 -0
- package/src/lib/components/function-controls.js +207 -0
- package/src/lib/components/function-controls.js.map +1 -0
- package/src/lib/components/function-scope.d.ts +110 -0
- package/src/lib/components/function-scope.js +478 -0
- package/src/lib/components/function-scope.js.map +1 -0
- package/src/lib/components/function-widget.d.ts +75 -0
- package/src/lib/components/function-widget.js +307 -0
- package/src/lib/components/function-widget.js.map +1 -0
- package/src/lib/components/grid.d.ts +91 -0
- package/src/lib/components/grid.js +322 -0
- package/src/lib/components/grid.js.map +1 -0
- package/src/lib/components/icon.d.ts +54 -0
- package/src/lib/components/icon.js +163 -0
- package/src/lib/components/icon.js.map +1 -0
- package/src/lib/components/image-list.d.ts +58 -0
- package/src/lib/components/image-list.js +336 -0
- package/src/lib/components/image-list.js.map +1 -0
- package/src/lib/components/image.d.ts +154 -0
- package/src/lib/components/image.js +451 -0
- package/src/lib/components/image.js.map +1 -0
- package/src/lib/components/inline-text.d.ts +74 -0
- package/src/lib/components/inline-text.js +407 -0
- package/src/lib/components/inline-text.js.map +1 -0
- package/src/lib/components/language-switcher.d.ts +35 -0
- package/src/lib/components/language-switcher.js +179 -0
- package/src/lib/components/language-switcher.js.map +1 -0
- package/src/lib/components/layout-slot.d.ts +68 -0
- package/src/lib/components/layout-slot.js +192 -0
- package/src/lib/components/layout-slot.js.map +1 -0
- package/src/lib/components/link-box-accessible-name.d.ts +79 -0
- package/src/lib/components/link-box-accessible-name.js +158 -0
- package/src/lib/components/link-box-accessible-name.js.map +1 -0
- package/src/lib/components/link-box.d.ts +66 -0
- package/src/lib/components/link-box.js +212 -0
- package/src/lib/components/link-box.js.map +1 -0
- package/src/lib/components/list-item-text.d.ts +22 -0
- package/src/lib/components/list-item-text.js +86 -0
- package/src/lib/components/list-item-text.js.map +1 -0
- package/src/lib/components/list-item.d.ts +32 -0
- package/src/lib/components/list-item.js +127 -0
- package/src/lib/components/list-item.js.map +1 -0
- package/src/lib/components/list.d.ts +34 -0
- package/src/lib/components/list.js +108 -0
- package/src/lib/components/list.js.map +1 -0
- package/src/lib/components/markdown.d.ts +129 -0
- package/src/lib/components/markdown.js +853 -0
- package/src/lib/components/markdown.js.map +1 -0
- package/src/lib/components/nav-menu.d.ts +68 -0
- package/src/lib/components/nav-menu.js +683 -0
- package/src/lib/components/nav-menu.js.map +1 -0
- package/src/lib/components/pagination.d.ts +59 -0
- package/src/lib/components/pagination.js +243 -0
- package/src/lib/components/pagination.js.map +1 -0
- package/src/lib/components/paper.d.ts +47 -0
- package/src/lib/components/paper.js +202 -0
- package/src/lib/components/paper.js.map +1 -0
- package/src/lib/components/plugin-frame.d.ts +64 -0
- package/src/lib/components/plugin-frame.js +335 -0
- package/src/lib/components/plugin-frame.js.map +1 -0
- package/src/lib/components/plugin.d.ts +95 -0
- package/src/lib/components/plugin.js +304 -0
- package/src/lib/components/plugin.js.map +1 -0
- package/src/lib/components/product.d.ts +40 -0
- package/src/lib/components/product.js +287 -0
- package/src/lib/components/product.js.map +1 -0
- package/src/lib/components/reusable-instance.d.ts +57 -0
- package/src/lib/components/reusable-instance.js +126 -0
- package/src/lib/components/reusable-instance.js.map +1 -0
- package/src/lib/components/screen-link.d.ts +85 -0
- package/src/lib/components/screen-link.js +324 -0
- package/src/lib/components/screen-link.js.map +1 -0
- package/src/lib/components/search-box.d.ts +41 -0
- package/src/lib/components/search-box.js +125 -0
- package/src/lib/components/search-box.js.map +1 -0
- package/src/lib/components/section.d.ts +56 -0
- package/src/lib/components/section.js +132 -0
- package/src/lib/components/section.js.map +1 -0
- package/src/lib/components/stack.d.ts +55 -0
- package/src/lib/components/stack.js +309 -0
- package/src/lib/components/stack.js.map +1 -0
- package/src/lib/components/tabs.d.ts +288 -0
- package/src/lib/components/tabs.js +788 -0
- package/src/lib/components/tabs.js.map +1 -0
- package/src/lib/components/theme-mode-switcher.d.ts +38 -0
- package/src/lib/components/theme-mode-switcher.js +168 -0
- package/src/lib/components/theme-mode-switcher.js.map +1 -0
- package/src/lib/components/toolbar.d.ts +37 -0
- package/src/lib/components/toolbar.js +117 -0
- package/src/lib/components/toolbar.js.map +1 -0
- package/src/lib/components/typography.d.ts +33 -0
- package/src/lib/components/typography.js +433 -0
- package/src/lib/components/typography.js.map +1 -0
- package/src/lib/components/video-lightbox-controls.d.ts +131 -0
- package/src/lib/components/video-lightbox-controls.js +536 -0
- package/src/lib/components/video-lightbox-controls.js.map +1 -0
- package/src/lib/components/video-lightbox.d.ts +60 -0
- package/src/lib/components/video-lightbox.js +247 -0
- package/src/lib/components/video-lightbox.js.map +1 -0
- package/src/lib/components/video-playback-beacon.d.ts +80 -0
- package/src/lib/components/video-playback-beacon.js +128 -0
- package/src/lib/components/video-playback-beacon.js.map +1 -0
- package/src/lib/components/video-player-frame.d.ts +58 -0
- package/src/lib/components/video-player-frame.js +51 -0
- package/src/lib/components/video-player-frame.js.map +1 -0
- package/src/lib/components/video.d.ts +220 -0
- package/src/lib/components/video.js +874 -0
- package/src/lib/components/video.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +17 -0
- package/src/lib/constants/bundle-common.js +18 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/field-presets.d.ts +93 -0
- package/src/lib/constants/field-presets.js +248 -0
- package/src/lib/constants/field-presets.js.map +1 -0
- package/src/lib/plugin.d.ts +80 -0
- package/src/lib/plugin.js +599 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/utils/author-html-label.d.ts +73 -0
- package/src/lib/utils/author-html-label.js +89 -0
- package/src/lib/utils/author-html-label.js.map +1 -0
- package/src/lib/utils/drop-cleared-props.d.ts +18 -0
- package/src/lib/utils/drop-cleared-props.js +74 -0
- package/src/lib/utils/drop-cleared-props.js.map +1 -0
- package/src/lib/utils/element-picker.d.ts +99 -0
- package/src/lib/utils/element-picker.js +140 -0
- package/src/lib/utils/element-picker.js.map +1 -0
- package/src/lib/utils/generate-preset-id.d.ts +19 -0
- package/src/lib/utils/generate-preset-id.js +25 -0
- package/src/lib/utils/generate-preset-id.js.map +1 -0
- package/src/lib/utils/link-target-props.d.ts +53 -0
- package/src/lib/utils/link-target-props.js +53 -0
- package/src/lib/utils/link-target-props.js.map +1 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2026 Aglyn LLC
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/ import { useCallback } from "react";
|
|
19
|
+
/** What the frame is called when the author gave the video no title. */ const FALLBACK_TITLE = 'Video player';
|
|
20
|
+
/** The shape assumed for a film nobody measured. */ const DEFAULT_ASPECT_RATIO = '16 / 9';
|
|
21
|
+
export function VideoPlayerFrame(props) {
|
|
22
|
+
const { src, title, aspectRatio, height, radius, focusOnMount, style } = props;
|
|
23
|
+
const takeFocus = useCallback((node)=>{
|
|
24
|
+
node == null ? void 0 : node.focus();
|
|
25
|
+
}, []);
|
|
26
|
+
return /*#__PURE__*/ _jsx("iframe", {
|
|
27
|
+
ref: focusOnMount ? takeFocus : undefined,
|
|
28
|
+
src: src,
|
|
29
|
+
title: title || FALLBACK_TITLE,
|
|
30
|
+
// `autoplay` is delegated because the press happened in this document
|
|
31
|
+
// and the film plays in another one: without the grant a browser may
|
|
32
|
+
// refuse to start the film the visitor just asked for.
|
|
33
|
+
allow: "autoplay; fullscreen; picture-in-picture",
|
|
34
|
+
allowFullScreen: true,
|
|
35
|
+
// The Video embed block's sandbox: the player runs its own scripts on
|
|
36
|
+
// its own origin and may open a link in a new tab, and it may not
|
|
37
|
+
// navigate this page or submit a form from it.
|
|
38
|
+
sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups",
|
|
39
|
+
style: _extends({
|
|
40
|
+
display: 'block',
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: height || undefined,
|
|
43
|
+
aspectRatio: height ? undefined : aspectRatio || DEFAULT_ASPECT_RATIO,
|
|
44
|
+
border: 0,
|
|
45
|
+
borderRadius: radius != null ? `${radius}px` : undefined
|
|
46
|
+
}, style)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
VideoPlayerFrame.displayName = 'VideoPlayerFrame';
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=video-player-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/video-player-frame.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type CSSProperties, useCallback } from 'react'\n\n/**\n * The frame a hosted player plays in (AGL-2826).\n *\n * Shared by the Video element, which puts it where the poster was, and by the\n * lightbox, which opens it in a dialog, so the two cannot disagree about what\n * the frame may do. Nothing renders this before a press, except the player an\n * element loads with the page (AGL-2962), and that only for a visitor whose\n * analytics consent is on record. Otherwise the element's poster is a button\n * until the press, which is what keeps the player's origin off the wire for a\n * visitor who only looks at the page.\n */\nexport interface VideoPlayerFrameProps {\n /** The player's address, rebuilt by the caller from a parsed media id. */\n src: string\n /** Names the frame for assistive technology. */\n title?: string\n /** `width / height`; 16:9 when nothing measured the film. */\n aspectRatio?: string\n /** A CSS height the author pinned, which replaces the ratio. */\n height?: string\n /** Corner radius in px, matching the poster it replaced. */\n radius?: number\n /**\n * Move focus into the player as it mounts. For the in-place player only,\n * where the button that was pressed has just left the page and focus would\n * otherwise fall back to the body.\n *\n * ⛔ Never inside the lightbox. A cross-origin frame keeps every key pressed\n * while it has focus, so `Escape` never reaches the dialog. Measured on\n * 2026-09-10: with focus moved into the Wistia frame, `Escape` left the\n * dialog open and the film playing. Left on the dialog, `Escape` closes it,\n * and `Tab` still reaches the player.\n */\n focusOnMount?: boolean\n /** Layout the placement adds, such as the lightbox's flex, applied last. */\n style?: CSSProperties\n}\n\n/** What the frame is called when the author gave the video no title. */\nconst FALLBACK_TITLE = 'Video player'\n\n/** The shape assumed for a film nobody measured. */\nconst DEFAULT_ASPECT_RATIO = '16 / 9'\n\nexport function VideoPlayerFrame(props: VideoPlayerFrameProps) {\n const { src, title, aspectRatio, height, radius, focusOnMount, style } = props\n const takeFocus = useCallback((node: HTMLIFrameElement | null) => {\n node?.focus()\n }, [])\n return (\n <iframe\n ref={focusOnMount ? takeFocus : undefined}\n src={src}\n title={title || FALLBACK_TITLE}\n // `autoplay` is delegated because the press happened in this document\n // and the film plays in another one: without the grant a browser may\n // refuse to start the film the visitor just asked for.\n allow=\"autoplay; fullscreen; picture-in-picture\"\n allowFullScreen\n // The Video embed block's sandbox: the player runs its own scripts on\n // its own origin and may open a link in a new tab, and it may not\n // navigate this page or submit a form from it.\n sandbox=\"allow-scripts allow-same-origin allow-presentation allow-popups\"\n style={{\n display: 'block',\n width: '100%',\n height: height || undefined,\n aspectRatio: height ? undefined : aspectRatio || DEFAULT_ASPECT_RATIO,\n border: 0,\n borderRadius: radius != null ? `${radius}px` : undefined,\n ...style,\n }}\n />\n )\n}\nVideoPlayerFrame.displayName = 'VideoPlayerFrame'\n"],"names":["useCallback","FALLBACK_TITLE","DEFAULT_ASPECT_RATIO","VideoPlayerFrame","props","src","title","aspectRatio","height","radius","focusOnMount","style","takeFocus","node","focus","iframe","ref","undefined","allow","allowFullScreen","sandbox","display","width","border","borderRadius","displayName"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAA6BA,WAAW,QAAQ,QAAO;AAwCvD,sEAAsE,GACtE,MAAMC,iBAAiB;AAEvB,kDAAkD,GAClD,MAAMC,uBAAuB;AAE7B,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAEC,WAAW,EAAEC,MAAM,EAAEC,MAAM,EAAEC,YAAY,EAAEC,KAAK,EAAE,GAAGP;IACzE,MAAMQ,YAAYZ,YAAY,CAACa;QAC7BA,wBAAAA,KAAMC,KAAK;IACb,GAAG,EAAE;IACL,qBACE,KAACC;QACCC,KAAKN,eAAeE,YAAYK;QAChCZ,KAAKA;QACLC,OAAOA,SAASL;QAChB,sEAAsE;QACtE,qEAAqE;QACrE,uDAAuD;QACvDiB,OAAM;QACNC,eAAe;QACf,sEAAsE;QACtE,kEAAkE;QAClE,+CAA+C;QAC/CC,SAAQ;QACRT,OAAO;YACLU,SAAS;YACTC,OAAO;YACPd,QAAQA,UAAUS;YAClBV,aAAaC,SAASS,YAAYV,eAAeL;YACjDqB,QAAQ;YACRC,cAAcf,UAAU,OAAO,GAAGA,OAAO,EAAE,CAAC,GAAGQ;WAC5CN;;AAIX;AACAR,iBAAiBsB,WAAW,GAAG"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import * as Aglyn from '@aglyn/aglyn';
|
|
18
|
+
import type { SxProps } from '@mui/material/styles';
|
|
19
|
+
import { type ReactNode } from 'react';
|
|
20
|
+
export declare const ID: Aglyn.ComponentId;
|
|
21
|
+
/** How much of a video the browser may fetch before anyone asks for it. */
|
|
22
|
+
export type VideoPreload = 'none' | 'metadata' | 'auto';
|
|
23
|
+
/**
|
|
24
|
+
* What `preload` an unset field resolves to, given the rest of the node.
|
|
25
|
+
*
|
|
26
|
+
* Exported for the spec, because the whole point of this element is what it
|
|
27
|
+
* does NOT download and a rule that is only asserted through rendered markup
|
|
28
|
+
* is a rule three refactors from being an accident.
|
|
29
|
+
*
|
|
30
|
+
* * **Autoplay wins first.** A video that starts on its own needs its bytes
|
|
31
|
+
* by definition; `none` there is a hint every browser overrides anyway, and
|
|
32
|
+
* stating it would only mislead the next reader.
|
|
33
|
+
* * **A poster buys `none`.** This is the saving the element exists for — the
|
|
34
|
+
* poster carries the first paint at image cost, and not one byte of video
|
|
35
|
+
* is fetched until a visitor presses play.
|
|
36
|
+
* * **No poster keeps `metadata`.** With neither a poster nor metadata a
|
|
37
|
+
* `<video>` paints a black rectangle, so deferring an unpostered video
|
|
38
|
+
* trades a real transfer for a real regression. `metadata` is also what
|
|
39
|
+
* every document authored before this rendered, which is what makes the
|
|
40
|
+
* change safe for sites already published.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveVideoPreload(options: {
|
|
43
|
+
preload?: unknown;
|
|
44
|
+
poster?: unknown;
|
|
45
|
+
autoPlay?: unknown;
|
|
46
|
+
}): VideoPreload;
|
|
47
|
+
export interface VideoProps {
|
|
48
|
+
/**
|
|
49
|
+
* Where the video comes from. Either a **media reference** —
|
|
50
|
+
* `media:{scope}/{mediaId}`, what "Browse media" stores (AGL-1215) — or any
|
|
51
|
+
* URL. `resolveMediaSrc` decides, exactly as it does for an image.
|
|
52
|
+
*
|
|
53
|
+
* A Wistia link is read differently (AGL-2826): the element keeps only the
|
|
54
|
+
* media id and plays Wistia's own player, which loads when a visitor
|
|
55
|
+
* presses play and never before, unless {@link loadPlayer} loads it with the
|
|
56
|
+
* page. See `wistia-embed.ts`.
|
|
57
|
+
*/
|
|
58
|
+
src?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The still shown before playback, and the element's entire first paint
|
|
61
|
+
* once `preload` is `none`. A media reference or a URL, like `src`.
|
|
62
|
+
*
|
|
63
|
+
* Optional even for a poster-first placement: when the DAM captured a frame
|
|
64
|
+
* at upload, {@link posterFromSource} says so and the element derives the
|
|
65
|
+
* poster from the video's own reference.
|
|
66
|
+
*/
|
|
67
|
+
poster?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The chosen asset has a poster the DAM generated (AGL-2749), served at
|
|
70
|
+
* `?poster=1` on the video's own reference.
|
|
71
|
+
*
|
|
72
|
+
* Written by the pick, never by an author, and it is a flag rather than a
|
|
73
|
+
* url on purpose: the url can be derived from `src` by anybody, but only
|
|
74
|
+
* the media document knows whether it resolves to anything. A video
|
|
75
|
+
* uploaded before AGL-2742 answers 404, and this is what keeps that 404 out
|
|
76
|
+
* of an `<img>` and out of the page's `thumbnailUrl`.
|
|
77
|
+
*/
|
|
78
|
+
posterFromSource?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The video's title (AGL-2741). Serves three jobs at once and is deliberate
|
|
81
|
+
* about it: the `<video>`'s tooltip, the accessible name a screen reader
|
|
82
|
+
* announces for the player, and `VideoObject.name` in the page's structured
|
|
83
|
+
* data. One sentence an author writes once.
|
|
84
|
+
*/
|
|
85
|
+
title?: string;
|
|
86
|
+
/**
|
|
87
|
+
* What the video is about — `VideoObject.description`, which Google
|
|
88
|
+
* recommends for a video rich result but does not require, so a blank one
|
|
89
|
+
* drops only this field from the structured data. Never rendered as
|
|
90
|
+
* visible text; the element is a player, not a caption.
|
|
91
|
+
*/
|
|
92
|
+
description?: string;
|
|
93
|
+
/**
|
|
94
|
+
* When the video was first published, as `YYYY-MM-DD`. Google requires it
|
|
95
|
+
* beside the title and the poster, and it is the one nothing else on the
|
|
96
|
+
* page can supply: a screen's own publish date is when the PAGE went up,
|
|
97
|
+
* which for a film embedded months later is simply a different fact.
|
|
98
|
+
*
|
|
99
|
+
* The day is what an author types; the page's `VideoObject` publishes it as
|
|
100
|
+
* that day at noon UTC, because Google reads `uploadDate` as a date-time
|
|
101
|
+
* with a zone (`uploadDateTime` in the VideoObject builder).
|
|
102
|
+
*/
|
|
103
|
+
uploadDate?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Running time in seconds. Copied off the media document when the DAM's
|
|
106
|
+
* video pipeline publishes one (`Aglyn.videoMediaProps`) and read from the
|
|
107
|
+
* asset again when the page is composed, so a replace reaches it
|
|
108
|
+
* (AGL-2807); typed by the author otherwise, and omitted from the schema
|
|
109
|
+
* when neither happened.
|
|
110
|
+
*/
|
|
111
|
+
durationSeconds?: number;
|
|
112
|
+
/**
|
|
113
|
+
* Show the poster as a play button and open the film in a dialog
|
|
114
|
+
* (AGL-2744).
|
|
115
|
+
*
|
|
116
|
+
* Default OFF, so every document published before this keeps rendering the
|
|
117
|
+
* inline player it was authored against. Requires a poster — there is
|
|
118
|
+
* nothing to click without one — and falls back to inline playback when
|
|
119
|
+
* there is none, rather than rendering a button with no face.
|
|
120
|
+
*
|
|
121
|
+
* A Wistia poster waits for a press whether this is on or off; the switch
|
|
122
|
+
* decides only where its player opens, in the dialog or in place of the
|
|
123
|
+
* poster. A Wistia player that {@link loadPlayer} put in the page stays in
|
|
124
|
+
* the page either way.
|
|
125
|
+
*/
|
|
126
|
+
lightbox?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Load a Wistia video's player with the page (AGL-2962), in place of the
|
|
129
|
+
* poster and without autoplay, for a visitor whose stored consent grants
|
|
130
|
+
* analytics.
|
|
131
|
+
*
|
|
132
|
+
* For a page built to show this one film. A search engine lists a video
|
|
133
|
+
* only from a page whose main content it is, and it can only find a player
|
|
134
|
+
* that is in the page once the page has loaded; a poster that must be
|
|
135
|
+
* pressed first is the case Search Console reports as "Cannot determine
|
|
136
|
+
* video position and size".
|
|
137
|
+
*
|
|
138
|
+
* Default OFF, so every document published before this renders the poster
|
|
139
|
+
* it was authored against. No effect on any other source: a library film or
|
|
140
|
+
* a video URL already renders its `<video>` into the page's HTML. The
|
|
141
|
+
* page-load state below says who gets the player and when.
|
|
142
|
+
*/
|
|
143
|
+
loadPlayer?: boolean;
|
|
144
|
+
/** Captions file — a WebVTT (`.vtt`) URL or media reference. */
|
|
145
|
+
captionsSrc?: string;
|
|
146
|
+
/** What the captions track is called in the player's menu. */
|
|
147
|
+
captionsLabel?: string;
|
|
148
|
+
/** BCP-47 language tag for the captions, e.g. `en`. */
|
|
149
|
+
captionsLang?: string;
|
|
150
|
+
autoPlay?: boolean;
|
|
151
|
+
loop?: boolean;
|
|
152
|
+
muted?: boolean;
|
|
153
|
+
controls?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Play inline on a phone rather than taking over the screen. Defaults ON,
|
|
156
|
+
* which is what this element has always rendered — it is a control now
|
|
157
|
+
* because a full-screen takeover is a legitimate choice for a film and
|
|
158
|
+
* there was no way to ask for it.
|
|
159
|
+
*/
|
|
160
|
+
playsInline?: boolean;
|
|
161
|
+
/** See {@link resolveVideoPreload}; unset is decided from the node. */
|
|
162
|
+
preload?: VideoPreload;
|
|
163
|
+
/** CSS width (e.g. "100%", "640px"); defaults to 100%. */
|
|
164
|
+
width?: string;
|
|
165
|
+
/** CSS height (e.g. "360px"); defaults to auto. */
|
|
166
|
+
height?: string;
|
|
167
|
+
/**
|
|
168
|
+
* The asset's own pixel dimensions, copied off the media document when the
|
|
169
|
+
* video was picked (AGL-2741) — the same pair, by the same route and for
|
|
170
|
+
* the same reason, as `image.tsx` — and read from the asset again when the
|
|
171
|
+
* page is composed, so a replace with a different shape resizes the player
|
|
172
|
+
* (AGL-2807).
|
|
173
|
+
*
|
|
174
|
+
* NOT author controls, which is why neither appears in the schema below.
|
|
175
|
+
* They describe the file; the CSS `width`/`height` above describe the
|
|
176
|
+
* placement. Here they become a CSS `aspect-ratio` rather than the HTML
|
|
177
|
+
* attribute pair an `<img>` gets, because a `<video>`'s `width`/`height`
|
|
178
|
+
* content attributes are used dimensions, not a ratio — writing them would
|
|
179
|
+
* pin the element to the file's pixel size instead of reserving its shape.
|
|
180
|
+
*
|
|
181
|
+
* The stake is higher than it is for an image. An `<img>` with no ratio is
|
|
182
|
+
* zero-height until its bytes decode; a `<video preload="none">` with no
|
|
183
|
+
* ratio is zero-height until somebody presses play, which on most pages is
|
|
184
|
+
* never.
|
|
185
|
+
*/
|
|
186
|
+
intrinsicWidth?: number;
|
|
187
|
+
/** See `intrinsicWidth` — the two are only ever used as a pair. */
|
|
188
|
+
intrinsicHeight?: number;
|
|
189
|
+
/** Border radius in px. */
|
|
190
|
+
radius?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Authored node styles, handed over by the renderer rather than typed
|
|
193
|
+
* into an attribute — recomposed below so the Styles panel's values are
|
|
194
|
+
* merged rather than replaced (AGL-1284).
|
|
195
|
+
*/
|
|
196
|
+
sx?: SxProps;
|
|
197
|
+
/**
|
|
198
|
+
* Accepted and dropped. The element is `selfClosing`, so the besigner never
|
|
199
|
+
* gives it children; the `<track>` below is the renderer's own child and
|
|
200
|
+
* anything arriving through the tree would land beside it.
|
|
201
|
+
*/
|
|
202
|
+
children?: ReactNode;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Video element (AGL-162, AGL-2741): plays a media-library upload, any URL or
|
|
206
|
+
* a Wistia video (AGL-2826), poster first.
|
|
207
|
+
*
|
|
208
|
+
* The default is now to download NOTHING until a visitor asks. A poster is an
|
|
209
|
+
* image — a few tens of kilobytes through the DAM's WebP variants, edge-cached
|
|
210
|
+
* — while the video behind it is not edge-cacheable at all and is measured in
|
|
211
|
+
* megabytes. `preload` decides which of those a page pays for on first paint,
|
|
212
|
+
* and {@link resolveVideoPreload} explains what an unset field resolves to.
|
|
213
|
+
*
|
|
214
|
+
* An empty src shows a labeled placeholder so the element stays selectable in
|
|
215
|
+
* the editor.
|
|
216
|
+
*/
|
|
217
|
+
declare const Video: import("react").ForwardRefExoticComponent<VideoProps & import("react").RefAttributes<HTMLElement>>;
|
|
218
|
+
export declare const schema: Aglyn.ComponentSchema<VideoProps>;
|
|
219
|
+
export declare const presets: Aglyn.PresetSchema[];
|
|
220
|
+
export default Video;
|