@orangelogic/design-system 2.183.0 → 2.185.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/library/chunks/{asset-link-format.H5j0gJtQ.js → asset-link-format.D--xQVgR.js} +505 -493
- package/library/chunks/{button.Dc8L4hcg.js → button.BnkkUqiI.js} +1 -1
- package/library/chunks/{color-swatch-group.DqP6pp2u.js → color-swatch-group.BmtcN7Kp.js} +31 -21
- package/library/chunks/{confirm-popover.DlIPMgF1.js → confirm-popover.CrQKEChc.js} +2 -2
- package/library/chunks/{dialog.BD012ZUN.js → dialog.CWGtufDA.js} +1 -1
- package/library/chunks/{document-viewer.DbA73wGD.js → document-viewer.C90j1Xrr.js} +5 -5
- package/library/chunks/file_on_demand.BVnxByUA.js +80 -0
- package/library/chunks/{folder-select.C4JVju2L.js → folder-select.CIqVGGFl.js} +4 -4
- package/library/chunks/{icon-button.CBZkhhs8.js → icon-button.CVrxJcZq.js} +1 -1
- package/library/chunks/{icon.BTuMIrIm.js → icon.CpHbi8tH.js} +2 -1
- package/library/chunks/{image.CCDdKXjt.js → image.CTMzUqCC.js} +2 -2
- package/library/chunks/{input.B5AHlTl-.js → input.33UmFGqR.js} +1 -1
- package/library/chunks/{markdown.rDppL64E.js → markdown.DOHru2Rz.js} +1 -1
- package/library/chunks/{option.zUMZKPFe.js → option.B6odSlS2.js} +1 -1
- package/library/chunks/{pagination.CqJwMe9w.js → pagination.mzolTIpF.js} +4 -4
- package/library/chunks/{tab-group.BUj0CO1c.js → tab-group.CjISeeMB.js} +2 -2
- package/library/chunks/{tree.CgBxt5my.js → tree.CmEdKtzK.js} +1 -1
- package/library/chunks/{url.B17OsCqV.js → url.CGdWC06g.js} +2 -2
- package/library/components/alert.js +1 -1
- package/library/components/animated-image.js +1 -1
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +13 -13
- package/library/components/audio.js +1 -1
- package/library/components/avatar.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/confirm-popover.js +3 -3
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +2 -2
- package/library/components/document-viewer.js +3 -3
- package/library/components/drawer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +3 -3
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +10 -10
- package/library/components/folder-select.js +4 -4
- package/library/components/icon-button.js +2 -2
- package/library/components/icon.js +1 -1
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +3 -3
- package/library/components/input.js +2 -2
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +2 -2
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +87 -78
- package/library/components/molecules.js +2 -2
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +5 -5
- package/library/components/radio.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/select.js +2 -2
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +2 -2
- package/library/components/size-input-group.js +2 -2
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/tab-group.js +3 -3
- package/library/components/tab.js +1 -1
- package/library/components/tag.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +1 -1
- package/library/components/typeface.js +1 -1
- package/library/components/types.js +33193 -32123
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/icon/custom-icons/file_on_demand.d.ts +4 -0
- package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +5 -1
- package/library/packages/hybrid/table-core/src/tabulator-tables/core/RowManager.d.ts +4 -0
- package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +20 -3
- package/library/packages/organisms/src/content-builder/blocks/audio/audio.d.ts +54 -0
- package/library/packages/organisms/src/content-builder/blocks/audio/audio.styles.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +255 -0
- package/library/packages/organisms/src/content-builder/blocks/video/video.d.ts +223 -0
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +34 -10
- package/library/packages/services/src/api/asset/asset.d.ts +1 -1
- package/library/packages/types/src/menu-item.d.ts +8 -0
- package/library/react-web-component.d.ts +9 -1
- package/library/utils.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as kd, a as Sa, b as Be, c as Je } from "../chunks/inheritsLoose.BuSn_CvZ.js";
|
|
2
2
|
import { c as ps, a as Bn } from "../chunks/_commonjsHelpers.DQNKXVTB.js";
|
|
3
3
|
import { r as Sb } from "../chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js";
|
|
4
|
-
import { C as Cb } from "../chunks/image.
|
|
4
|
+
import { C as Cb } from "../chunks/image.CTMzUqCC.js";
|
|
5
5
|
import Mb from "./resize-observer.js";
|
|
6
6
|
import { r as Db, R as Pb, a as Rp, b as Lb } from "../chunks/resizable-component.styles.CAfXABBc.js";
|
|
7
7
|
import { c as Rb } from "../chunks/component.styles.CRO4Odto.js";
|
package/library/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
|
|
2
|
-
import { MenuItemCheckPlacement } from '../../../../types/src/menu-item';
|
|
2
|
+
import { AriaCurrentValue, MenuItemCheckPlacement } from '../../../../types/src/menu-item';
|
|
3
3
|
import { CSSResultGroup, TemplateResult } from 'lit';
|
|
4
4
|
import { default as CxIcon } from '../icon/icon';
|
|
5
5
|
import { default as CxPopup } from '../popup/popup';
|
|
@@ -19,6 +19,7 @@ import { default as CxSpinner } from '../spinner/spinner';
|
|
|
19
19
|
* @attr {boolean} no-uncheck - When `type` is `checkbox`, activating the item does not clear `checked` when it is already checked. Parent `cx-menu` may set `no-uncheck` to apply the same behavior to every checkbox item in that menu.
|
|
20
20
|
* @attr {string} submenu-placement - The placement of the submenu relative to the menu item. When not set, uses RTL-aware positioning ('left-start' in RTL, 'right-start' in LTR).
|
|
21
21
|
* @attr {'prefix' | 'suffix'} check-placement - Placement of the built-in checked icon relative to the label. Defaults to `suffix`. When set to `suffix` on an item that also has a submenu, the check icon renders after the submenu chevron.
|
|
22
|
+
* @attr {'page' | 'step' | 'location' | 'date' | 'time'} current - Marks this item as the current page/step/location/date/time within a set of related items. Reflected as `aria-current` for assistive technology.
|
|
22
23
|
*
|
|
23
24
|
* @csspart base - The component's base wrapper.
|
|
24
25
|
* @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.
|
|
@@ -77,6 +78,8 @@ export default class CxMenuItem extends CortexElement {
|
|
|
77
78
|
disabled: boolean;
|
|
78
79
|
/** Draws the menu item in an active - selected state. */
|
|
79
80
|
active: boolean;
|
|
81
|
+
/** Reflects as the item's `aria-current` attribute. */
|
|
82
|
+
current: AriaCurrentValue | undefined;
|
|
80
83
|
/** Makes the menu item readonly */
|
|
81
84
|
readonly: boolean;
|
|
82
85
|
/** The flip boundary for the submenu. */
|
|
@@ -107,6 +110,7 @@ export default class CxMenuItem extends CortexElement {
|
|
|
107
110
|
private handleAnchorClick;
|
|
108
111
|
handleCheckedChange(): void;
|
|
109
112
|
handleDisabledChange(): void;
|
|
113
|
+
handleCurrentChange(): void;
|
|
110
114
|
handleTypeChange(): void;
|
|
111
115
|
/** Returns a text label based on the contents of the menu item's default slot. */
|
|
112
116
|
getTextLabel(): string;
|
|
@@ -26,6 +26,8 @@ export default class RowManager extends CoreFeature implements IRowManager {
|
|
|
26
26
|
heightFixer: HTMLElement;
|
|
27
27
|
placeholder: HTMLElement | null;
|
|
28
28
|
placeholderContents: HTMLElement | null;
|
|
29
|
+
private headerWidthObserver;
|
|
30
|
+
private headerWidthSyncFrame;
|
|
29
31
|
firstRender: boolean;
|
|
30
32
|
renderMode?: RenderMode;
|
|
31
33
|
/**
|
|
@@ -136,6 +138,8 @@ export default class RowManager extends CoreFeature implements IRowManager {
|
|
|
136
138
|
shouldShowPlaceholder(): boolean;
|
|
137
139
|
syncColumnVisibilityState(): void;
|
|
138
140
|
_showPlaceholder(): void;
|
|
141
|
+
private observeHeaderWidth;
|
|
142
|
+
private disconnectHeaderWidthObserver;
|
|
139
143
|
/**
|
|
140
144
|
* While the table is not yet initialized, still show placeholder element so that
|
|
141
145
|
* table's height is not 0 (header-only), but hide the placeholder text
|
|
@@ -37,9 +37,26 @@ export default class CxAssetDataDisplay extends CortexElement {
|
|
|
37
37
|
detailsSourceField: string;
|
|
38
38
|
additionalFields: string[];
|
|
39
39
|
requestedFields: string[];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Header text to render in the overlay. Populated automatically from
|
|
42
|
+
* `headerSourceField` when fetching, or settable directly by a consumer
|
|
43
|
+
* that fetches asset data itself (e.g. `cx-content-builder-viewer`) and
|
|
44
|
+
* sets `fetchMode="manual"`.
|
|
45
|
+
*/
|
|
46
|
+
header: string;
|
|
47
|
+
/**
|
|
48
|
+
* Details text to render in the overlay. Populated automatically from
|
|
49
|
+
* `detailsSourceField` when fetching, or settable directly by a consumer
|
|
50
|
+
* that fetches asset data itself and sets `fetchMode="manual"`.
|
|
51
|
+
*/
|
|
52
|
+
details: string;
|
|
53
|
+
/**
|
|
54
|
+
* Additional content lines to render in the overlay. Populated
|
|
55
|
+
* automatically from `additionalFields` when fetching, or settable
|
|
56
|
+
* directly by a consumer that fetches asset data itself and sets
|
|
57
|
+
* `fetchMode="manual"`.
|
|
58
|
+
*/
|
|
59
|
+
additionalContent: string[];
|
|
43
60
|
private showDefaultSlot;
|
|
44
61
|
private showHeaderSlot;
|
|
45
62
|
private showDetailsSlot;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { default as CxAudio } from '../../../../../atoms/src/components/audio/audio.ts';
|
|
2
|
+
import { AssetVersion } from '../../../../../types/src/asset-format-picker';
|
|
3
|
+
import { CSSResultGroup } from 'lit';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @summary Content-builder subclass of cx-audio for use in the GrapeJS editor.
|
|
7
|
+
*/
|
|
8
|
+
export default class CxSbAudio extends CxAudio {
|
|
9
|
+
#private;
|
|
10
|
+
static readonly styles: CSSResultGroup;
|
|
11
|
+
private fetchAssetController?;
|
|
12
|
+
/**
|
|
13
|
+
* CMS5 only. Asset proxy format key (e.g. "WebHigh", "WebLow").
|
|
14
|
+
*/
|
|
15
|
+
format: string;
|
|
16
|
+
/**
|
|
17
|
+
* CMS5 only. Which asset version to serve: "current" (indexed/published) or "latest" (most recent upload).
|
|
18
|
+
*/
|
|
19
|
+
assetVersion: AssetVersion;
|
|
20
|
+
/**
|
|
21
|
+
* CMS5 only. Pre-resolved playback URL for the asset, stored at editor pick time.
|
|
22
|
+
* When set, takes priority over `src` for playback.
|
|
23
|
+
*/
|
|
24
|
+
formatSrc: string;
|
|
25
|
+
/** CMS5 only. Asset record id used to fetch the display name. */
|
|
26
|
+
recordId: string;
|
|
27
|
+
/** CMS5 only. Security-bypass token injected by read mode for server-rendered pages. */
|
|
28
|
+
siteBuilderToken: string;
|
|
29
|
+
/**
|
|
30
|
+
* CMS5 only. Record ID of the parent asset. When set, additional metadata fields
|
|
31
|
+
* (DocSubType, InPoint, OutPoint) are fetched and stored in state.
|
|
32
|
+
*/
|
|
33
|
+
parentRecordId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Pre-fetched asset metadata supplied by a read-mode consumer (e.g.
|
|
36
|
+
* `cx-content-builder-viewer`) that has already batch-fetched asset data
|
|
37
|
+
* for the page. When set outside edit mode, the block stops fetching its
|
|
38
|
+
* own asset metadata and maps this data into state instead.
|
|
39
|
+
*/
|
|
40
|
+
fetchedAssetData: Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Support CMS5 edit mode for the audio.
|
|
43
|
+
*/
|
|
44
|
+
get isInEditMode(): boolean;
|
|
45
|
+
handleSrcChange(): Promise<void>;
|
|
46
|
+
handleRecordIdChange(): Promise<void>;
|
|
47
|
+
handleFetchedAssetDataChange(): void;
|
|
48
|
+
private applyAssetData;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
'cx-sb-audio': CxSbAudio;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { default as CxImage } from '../../../../../atoms/src/components/image/image.ts';
|
|
2
|
+
import { default as CxAssetDataDisplay } from '../../../../../molecules/src/asset-data-display/asset-data-display.ts';
|
|
3
|
+
import { ClickAction } from '../../../../../types/src/asset-click-action';
|
|
4
|
+
import { Transformation } from '../../../../../types/src/asset-link-format';
|
|
5
|
+
import { TeamSpace } from '../../../../../types/src/content-builder';
|
|
6
|
+
import { ContentType } from '../../../../../types/src/gallery';
|
|
7
|
+
import { HighlightableElementContentPosition } from '../../../../../types/src/highlightable-element';
|
|
8
|
+
import { TemplateResult } from 'lit';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @summary Images are wrappers for img elements with built-in lazy loading, skeleton, and fallback support.
|
|
12
|
+
* The cx-image component is a simple way to display images in your application.
|
|
13
|
+
*
|
|
14
|
+
* @csspart image - The `img` element.
|
|
15
|
+
* @csspart skeleton - The skeleton element, will be shown while the image is loading and the `skeleton` property is set.
|
|
16
|
+
* @csspart fallback - The fallback element, will be shown if the image fails to load and the `fallback` property is set.
|
|
17
|
+
* @csspart base - The component’s outer wrapper.
|
|
18
|
+
* @csspart fallback-icon - The icon rendered inside the fallback slot.
|
|
19
|
+
*
|
|
20
|
+
* @cssproperty [--padding=0] - The padding of the image.
|
|
21
|
+
* @cssproperty --padding-top - The padding-top of the image (this will override the `--padding` property).
|
|
22
|
+
* @cssproperty --padding-left - The padding-left of the image (this will override the `--padding` property).
|
|
23
|
+
* @cssproperty --padding-right - The padding-right of the image (this will override the `--padding` property).
|
|
24
|
+
* @cssproperty --padding-bottom - The padding-bottom of the image (this will override the `--padding` property).
|
|
25
|
+
* @cssproperty --border-radius - The border-radius of the image.
|
|
26
|
+
* @cssproperty --border - The border of the image.
|
|
27
|
+
*
|
|
28
|
+
* @event cx-load - Emitted when the image has loaded.
|
|
29
|
+
* @event cx-error - Emitted when the image has failed to load.
|
|
30
|
+
* @event cx-image-zoom-open - Emitted when the image zoom is opened.
|
|
31
|
+
* @event cx-image-zoom-close - Emitted when the image zoom is closed.
|
|
32
|
+
*
|
|
33
|
+
* @slot skeleton - The skeleton element, will be shown while the image is loading and the `skeleton` property is set.
|
|
34
|
+
* @slot fallback - The fallback element, will be shown if the image fails to load and the `fallback` property is set.
|
|
35
|
+
*/
|
|
36
|
+
export default class CxSbImage extends CxImage {
|
|
37
|
+
static readonly dependencies: {
|
|
38
|
+
'cx-asset-data-display': typeof CxAssetDataDisplay;
|
|
39
|
+
'cx-icon': typeof import('../../../../../atoms/src/index.ts').CxIcon;
|
|
40
|
+
'cx-popup': typeof import('../../../../../atoms/src/index.ts').CxPopup;
|
|
41
|
+
'cx-resize-observer': typeof import('../../../../../atoms/src/index.ts').CxResizeObserver;
|
|
42
|
+
'cx-skeleton': typeof import('../../../../../atoms/src/index.ts').CxSkeleton;
|
|
43
|
+
'cx-space': typeof import('../../../../../atoms/src/index.ts').CxSpace;
|
|
44
|
+
'cx-spinner': typeof import('../../../../../atoms/src/index.ts').CxSpinner;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Override the default behavior of retrying to load the image when it fails to load.
|
|
48
|
+
*/
|
|
49
|
+
retryOnError: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The path to the image to load in dark mode.
|
|
52
|
+
*/
|
|
53
|
+
srcDarkMode: string;
|
|
54
|
+
/**
|
|
55
|
+
* CMS5 Only. The asset id of the image in light mode.
|
|
56
|
+
*/
|
|
57
|
+
recordId: string;
|
|
58
|
+
/**
|
|
59
|
+
* CMS5 Only. The asset id of the image in dark mode.
|
|
60
|
+
*/
|
|
61
|
+
recordIdDarkMode: string;
|
|
62
|
+
/**
|
|
63
|
+
* CMS5 Only.
|
|
64
|
+
* The share source of the image's asset.
|
|
65
|
+
* Bind with record-id and record-name attribute.
|
|
66
|
+
*/
|
|
67
|
+
shareSrc: string;
|
|
68
|
+
shareId: string;
|
|
69
|
+
shareName: string;
|
|
70
|
+
/**
|
|
71
|
+
* CMS5 Only.
|
|
72
|
+
* The source of download assets.
|
|
73
|
+
* Bind with download-id attribute.
|
|
74
|
+
*/
|
|
75
|
+
downloadSrc: string[];
|
|
76
|
+
downloadId: string[];
|
|
77
|
+
downloadNames: string[];
|
|
78
|
+
/**
|
|
79
|
+
* Assets download format
|
|
80
|
+
*/
|
|
81
|
+
downloadFormat: Record<string, string[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Asset transformation proxy format key.
|
|
84
|
+
*/
|
|
85
|
+
format: string;
|
|
86
|
+
/**
|
|
87
|
+
* Asset transformation proxy format key for dark mode.
|
|
88
|
+
*/
|
|
89
|
+
formatDarkMode: string;
|
|
90
|
+
/**
|
|
91
|
+
* Asset transformations applied to the image.
|
|
92
|
+
*/
|
|
93
|
+
transformations: Transformation[];
|
|
94
|
+
/**
|
|
95
|
+
* Asset transformations applied to the image in dark mode.
|
|
96
|
+
*/
|
|
97
|
+
transformationsDarkMode: Transformation[];
|
|
98
|
+
/**
|
|
99
|
+
* A description of the image used by assistive devices in dark mode.
|
|
100
|
+
*/
|
|
101
|
+
altDarkMode: string;
|
|
102
|
+
altSourceField: string;
|
|
103
|
+
/**
|
|
104
|
+
* CMS5 only. Click action for the image.
|
|
105
|
+
* Undefined for old click behavior. (different from ClickAction.DoNothing)
|
|
106
|
+
*/
|
|
107
|
+
clickAction: ClickAction | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* The URL to open when the click action is set to OpenLink.
|
|
110
|
+
*/
|
|
111
|
+
clickLink: string;
|
|
112
|
+
/**
|
|
113
|
+
* The page URL to open when the click action is set to OpenPage.
|
|
114
|
+
*/
|
|
115
|
+
clickPage: string;
|
|
116
|
+
/**
|
|
117
|
+
* The space URL to open when the click action is set to OpenSpace.
|
|
118
|
+
*/
|
|
119
|
+
clickSpace: string;
|
|
120
|
+
/**
|
|
121
|
+
* The page URL to open when the click action is set to OpenPage.
|
|
122
|
+
*/
|
|
123
|
+
pageUrl: string;
|
|
124
|
+
/**
|
|
125
|
+
* Whether to open the link/page/space in a new tab.
|
|
126
|
+
*/
|
|
127
|
+
openInNewTab: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* The position of the content compared to the image.
|
|
130
|
+
*/
|
|
131
|
+
contentPosition: HighlightableElementContentPosition;
|
|
132
|
+
contentType: ContentType;
|
|
133
|
+
headerSourceField: string;
|
|
134
|
+
detailsSourceField: string;
|
|
135
|
+
/**
|
|
136
|
+
* Only for automatic layout - Defined the additional fields from fetched data.
|
|
137
|
+
*/
|
|
138
|
+
additionalFields: string[];
|
|
139
|
+
siteBuilderToken: string;
|
|
140
|
+
/**
|
|
141
|
+
* Pre-fetched asset metadata supplied by a read-mode consumer (e.g.
|
|
142
|
+
* `cx-content-builder-viewer`) that has already batch-fetched asset data
|
|
143
|
+
* for the page. When set outside edit mode, the block stops its child
|
|
144
|
+
* `cx-asset-data-display` from fetching on its own and maps this data into
|
|
145
|
+
* alt text and overlay content instead.
|
|
146
|
+
*/
|
|
147
|
+
fetchedAssetData: Record<string, unknown>;
|
|
148
|
+
/**
|
|
149
|
+
* Indicates whether the image is currently zoomed.
|
|
150
|
+
*/
|
|
151
|
+
isZoomed: boolean;
|
|
152
|
+
imageRatio: number;
|
|
153
|
+
parsedAlt: string;
|
|
154
|
+
parsedAltDarkMode: string;
|
|
155
|
+
/** Header text forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
156
|
+
private overlayHeader;
|
|
157
|
+
/** Details text forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
158
|
+
private overlayDetails;
|
|
159
|
+
/** Additional content forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
160
|
+
private overlayAdditionalContent;
|
|
161
|
+
/** Fresh URL re-resolved when the stored `src` has expired. */
|
|
162
|
+
private resolvedSrc;
|
|
163
|
+
/** Fresh URL re-resolved when the stored `srcDarkMode` has expired. */
|
|
164
|
+
private resolvedSrcDarkMode;
|
|
165
|
+
/**
|
|
166
|
+
* Space list supplied by `cx-content-builder-viewer`, which fetches it once per
|
|
167
|
+
* surface. The only source — this block never fetches the list itself.
|
|
168
|
+
*/
|
|
169
|
+
spaces?: TeamSpace[];
|
|
170
|
+
/** Space URL re-resolved when the stored one points at a space that moved. */
|
|
171
|
+
private resolvedClickSpace;
|
|
172
|
+
/** Lazily created; recovers a fresh signed URL when a stored one expires. */
|
|
173
|
+
private fetchAssetController?;
|
|
174
|
+
/** Monotonic token to drop out-of-order expired-URL recovery responses. */
|
|
175
|
+
private srcResolveVersion;
|
|
176
|
+
/**
|
|
177
|
+
* Support CMS5 edit mode for the image.
|
|
178
|
+
*/
|
|
179
|
+
get isInEditMode(): boolean;
|
|
180
|
+
get isDarkMode(): boolean;
|
|
181
|
+
noCrossorigin: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Whether the rendered asset is the dark-mode variant.
|
|
184
|
+
*
|
|
185
|
+
* True when in dark mode AND a dark variant is actually available — either via
|
|
186
|
+
* the `srcDarkMode` path or the record/format pair that produces it. All `current*`
|
|
187
|
+
* getters key off this single predicate so alt, recordId, transformations and
|
|
188
|
+
* click handlers stay aligned with whichever image is actually being displayed.
|
|
189
|
+
*/
|
|
190
|
+
private get useDarkVariant();
|
|
191
|
+
get currentAltValue(): string;
|
|
192
|
+
get currentRecordId(): string;
|
|
193
|
+
get currentSrc(): string;
|
|
194
|
+
get currentTransformations(): Transformation[];
|
|
195
|
+
get highlighterTabindex(): "0" | undefined;
|
|
196
|
+
get highlighterRole(): "button" | "img";
|
|
197
|
+
get highlighterClass(): {
|
|
198
|
+
[x: string]: boolean;
|
|
199
|
+
'highlightable-item--has-action': boolean;
|
|
200
|
+
'highlightable-item': boolean;
|
|
201
|
+
'highlightable-item--effect-text-reveal': boolean;
|
|
202
|
+
};
|
|
203
|
+
get imageClass(): {
|
|
204
|
+
'image--can-zoom': boolean;
|
|
205
|
+
'image--has-action': boolean;
|
|
206
|
+
image: boolean;
|
|
207
|
+
'image--hidden': boolean;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Whether the image have zoom action.
|
|
211
|
+
*/
|
|
212
|
+
protected get hasZoomAction(): boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Whether the image has an click action.
|
|
215
|
+
*/
|
|
216
|
+
private get hasClickAction();
|
|
217
|
+
handleClickActionChange(): Promise<void>;
|
|
218
|
+
handleClickSpaceChange(): void;
|
|
219
|
+
handleObjectFitChange(): Promise<void>;
|
|
220
|
+
handleSrcChange(): void;
|
|
221
|
+
handleFetchedAssetDataChange(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Support CMS5 click action for the image.
|
|
224
|
+
*/
|
|
225
|
+
protected handleClickAction(event: MouseEvent): void;
|
|
226
|
+
private handleAssetDataDisplayFetchSuccess;
|
|
227
|
+
private applyAltFromAssetData;
|
|
228
|
+
/**
|
|
229
|
+
* Maps asset data supplied by a read-mode consumer (instead of the block's
|
|
230
|
+
* own `cx-asset-data-display` fetch) into alt text and overlay content.
|
|
231
|
+
*/
|
|
232
|
+
private applyFetchedAssetData;
|
|
233
|
+
/**
|
|
234
|
+
* A stored space URL breaks once the space moves domain, so the link target is
|
|
235
|
+
* re-resolved against the list the viewer supplies. Without that list the stored
|
|
236
|
+
* URL stands.
|
|
237
|
+
*/
|
|
238
|
+
private resolveClickSpace;
|
|
239
|
+
/**
|
|
240
|
+
* When a stored URL has expired, re-resolve a fresh one from the block's
|
|
241
|
+
* `record-id` + `format` (light and dark variants independently). Fires on every
|
|
242
|
+
* `src` / `srcDarkMode` change and no-ops for non-expired URLs, so working paths
|
|
243
|
+
* are untouched. On failure it leaves the stored URL in place and lets the
|
|
244
|
+
* existing `@error` / fallback path handle it.
|
|
245
|
+
*/
|
|
246
|
+
private recoverExpiredSources;
|
|
247
|
+
private recoverExpiredSource;
|
|
248
|
+
protected renderContent(): TemplateResult;
|
|
249
|
+
render(): TemplateResult;
|
|
250
|
+
}
|
|
251
|
+
declare global {
|
|
252
|
+
interface HTMLElementTagNameMap {
|
|
253
|
+
'cx-sb-image': CxSbImage;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { default as CxVideo } from '../../../../../atoms/src/components/video/video.ts';
|
|
2
|
+
import { default as CxAssetDataDisplay } from '../../../../../molecules/src/asset-data-display/asset-data-display.ts';
|
|
3
|
+
import { ClickAction } from '../../../../../types/src/asset-click-action.js';
|
|
4
|
+
import { AssetVersion } from '../../../../../types/src/asset-format-picker';
|
|
5
|
+
import { Transformation } from '../../../../../types/src/asset-link-format';
|
|
6
|
+
import { TeamSpace } from '../../../../../types/src/content-builder';
|
|
7
|
+
import { ContentType } from '../../../../../types/src/gallery.js';
|
|
8
|
+
import { HighlightableElementContentPosition } from '../../../../../types/src/highlightable-element.js';
|
|
9
|
+
import { TemplateResult } from 'lit';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @summary Video are wrappers for video elements with videoJS support. This component is used to display videos in your application.
|
|
13
|
+
*
|
|
14
|
+
* @csspart video-js-container - The video-js-container element, the main container of the video.
|
|
15
|
+
* @csspart placeholder - The placeholder element.
|
|
16
|
+
*
|
|
17
|
+
* @cssproperty [--padding=0] - The padding of the image.
|
|
18
|
+
* @cssproperty --border-radius - The border-radius of the video container.
|
|
19
|
+
* @cssproperty --border - The border of the video container.
|
|
20
|
+
*
|
|
21
|
+
* @event cx-play - Emitted when playback starts.
|
|
22
|
+
* @event cx-pause - Emitted when playback pauses.
|
|
23
|
+
* @event cx-time-update - Emitted while the playback position changes.
|
|
24
|
+
* @event cx-ended - Emitted when playback reaches the end.
|
|
25
|
+
* @event cx-seeked - Emitted after a seek operation.
|
|
26
|
+
* @event cx-loaded-metadata - Emitted when metadata is loaded.
|
|
27
|
+
* @event cx-error - Emitted when the video fails to load.
|
|
28
|
+
*
|
|
29
|
+
* @slot placeholder - The placeholder element, shown while the `src` is not set.
|
|
30
|
+
*/
|
|
31
|
+
export default class CxSbVideo extends CxVideo {
|
|
32
|
+
#private;
|
|
33
|
+
static readonly dependencies: {
|
|
34
|
+
'cx-asset-data-display': typeof CxAssetDataDisplay;
|
|
35
|
+
'cx-image': typeof import('../../../../../atoms/src/index.ts').CxImage;
|
|
36
|
+
'cx-resize-observer': typeof import('../../../../../atoms/src/index.ts').CxResizeObserver;
|
|
37
|
+
};
|
|
38
|
+
videoJsContainer: HTMLDivElement;
|
|
39
|
+
seekbar: HTMLDivElement;
|
|
40
|
+
resizeContainer: HTMLDivElement;
|
|
41
|
+
videoJsContainerAsync: Promise<HTMLDivElement>;
|
|
42
|
+
videoElement: HTMLVideoElement;
|
|
43
|
+
progressBarContainer: HTMLDivElement;
|
|
44
|
+
videoJsContainerElement: HTMLDivElement;
|
|
45
|
+
/**
|
|
46
|
+
* The share source of the image's asset.
|
|
47
|
+
* Bind with record-id and record-name attribute.
|
|
48
|
+
*/
|
|
49
|
+
shareSrc: string;
|
|
50
|
+
shareId: string;
|
|
51
|
+
shareName: string;
|
|
52
|
+
/**
|
|
53
|
+
* The source of download assets.
|
|
54
|
+
* Bind with download-id attribute.
|
|
55
|
+
*/
|
|
56
|
+
downloadSrc: string[];
|
|
57
|
+
downloadId: string[];
|
|
58
|
+
downloadNames: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Assets download format
|
|
61
|
+
*/
|
|
62
|
+
downloadFormat: Record<string, string[]>;
|
|
63
|
+
/**
|
|
64
|
+
* CMS5 Only. The asset id of the video.
|
|
65
|
+
*/
|
|
66
|
+
recordId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Asset id of the thumbnail image, used to fetch a format-specific URL.
|
|
69
|
+
*/
|
|
70
|
+
thumbnailRecordId: string;
|
|
71
|
+
/**
|
|
72
|
+
* Thumbnail proxy format key (e.g. "webp", "jpg").
|
|
73
|
+
*/
|
|
74
|
+
thumbnailFormat: string;
|
|
75
|
+
/**
|
|
76
|
+
* Transformations applied to the thumbnail image.
|
|
77
|
+
*/
|
|
78
|
+
thumbnailTransformations: Transformation[];
|
|
79
|
+
/**
|
|
80
|
+
* CMS5 Only. Asset proxy format key (e.g. "WebHigh", "WebLow").
|
|
81
|
+
*/
|
|
82
|
+
format: string;
|
|
83
|
+
/**
|
|
84
|
+
* CMS5 Only. Which asset version to serve: "current" (indexed/published) or "latest" (most recent upload).
|
|
85
|
+
* "current" links are frozen at editor pick time and stored in format-src.
|
|
86
|
+
*/
|
|
87
|
+
assetVersion: AssetVersion;
|
|
88
|
+
/**
|
|
89
|
+
* CMS5 Only. Pre-resolved playback URL for asset, stored at editor pick time.
|
|
90
|
+
*/
|
|
91
|
+
formatSrc: string;
|
|
92
|
+
/**
|
|
93
|
+
* CMS5 Only. Click action for the video.
|
|
94
|
+
* Undefined for old click behavior. (different from ClickAction.DoNothing)
|
|
95
|
+
*/
|
|
96
|
+
clickAction: ClickAction | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* The URL to open when the click action is set to OpenLink.
|
|
99
|
+
*/
|
|
100
|
+
clickLink: string;
|
|
101
|
+
/**
|
|
102
|
+
* The page URL to open when the click action is set to OpenPage.
|
|
103
|
+
*/
|
|
104
|
+
clickPage: string;
|
|
105
|
+
/**
|
|
106
|
+
* The space URL to open when the click action is set to OpenSpace.
|
|
107
|
+
*/
|
|
108
|
+
clickSpace: string;
|
|
109
|
+
/**
|
|
110
|
+
* The page URL to open when the click action is set to OpenPage.
|
|
111
|
+
*/
|
|
112
|
+
pageUrl: string;
|
|
113
|
+
/**
|
|
114
|
+
* Whether to open the link/page/space in a new tab.
|
|
115
|
+
*/
|
|
116
|
+
openInNewTab: boolean;
|
|
117
|
+
contentPosition: HighlightableElementContentPosition;
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the content type of the video.
|
|
120
|
+
*/
|
|
121
|
+
contentType: ContentType;
|
|
122
|
+
headerSourceField: string;
|
|
123
|
+
detailsSourceField: string;
|
|
124
|
+
/**
|
|
125
|
+
* Only for automatic layout - Defined the additional fields from fetched data.
|
|
126
|
+
*/
|
|
127
|
+
additionalFields: string[];
|
|
128
|
+
siteBuilderToken: string;
|
|
129
|
+
/**
|
|
130
|
+
* Pre-fetched asset metadata supplied by a read-mode consumer (e.g.
|
|
131
|
+
* `cx-content-builder-viewer`) that has already batch-fetched asset data
|
|
132
|
+
* for the page. When set outside edit mode, the block stops its child
|
|
133
|
+
* `cx-asset-data-display` from fetching on its own and maps this data into
|
|
134
|
+
* the name and overlay content instead.
|
|
135
|
+
*/
|
|
136
|
+
fetchedAssetData: Record<string, unknown>;
|
|
137
|
+
/** Header text forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
138
|
+
private overlayHeader;
|
|
139
|
+
/** Details text forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
140
|
+
private overlayDetails;
|
|
141
|
+
/** Additional content forwarded to the child `cx-asset-data-display` when data was pre-fetched. */
|
|
142
|
+
private overlayAdditionalContent;
|
|
143
|
+
/**
|
|
144
|
+
* Space list supplied by `cx-content-builder-viewer`, which fetches it once per
|
|
145
|
+
* surface. The only source — this block never fetches the list itself.
|
|
146
|
+
*/
|
|
147
|
+
spaces?: TeamSpace[];
|
|
148
|
+
/** Space URL re-resolved when the stored one points at a space that moved. */
|
|
149
|
+
private resolvedClickSpace;
|
|
150
|
+
/** Lazily created; recovers a fresh signed URL when the stored one expires. */
|
|
151
|
+
private fetchAssetController?;
|
|
152
|
+
/**
|
|
153
|
+
* Support CMS5 edit mode for the video.
|
|
154
|
+
*/
|
|
155
|
+
get isInEditMode(): boolean;
|
|
156
|
+
get containerClassMap(): {
|
|
157
|
+
'container--has-action': boolean;
|
|
158
|
+
container: boolean;
|
|
159
|
+
'container--empty': boolean;
|
|
160
|
+
'container--error': boolean;
|
|
161
|
+
'container--resizing': boolean;
|
|
162
|
+
};
|
|
163
|
+
constructor();
|
|
164
|
+
runConnectedCallback(): void;
|
|
165
|
+
disconnectedCallback(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the video has an click action.
|
|
168
|
+
*/
|
|
169
|
+
private hasClickAction;
|
|
170
|
+
protected onFullscreenChange(): void;
|
|
171
|
+
/**
|
|
172
|
+
* Since we block the event inside the videojs container here
|
|
173
|
+
* so we need to emit a click again in edit mode to perform selecting action.
|
|
174
|
+
*/
|
|
175
|
+
private handleClick;
|
|
176
|
+
/**
|
|
177
|
+
* Block video clicks when there is a click action.
|
|
178
|
+
* Not using setupVideoJsPlayer to block clicks
|
|
179
|
+
* because we still need to enable all actions in fullscreen mode.
|
|
180
|
+
*/
|
|
181
|
+
private blockVideoClicks;
|
|
182
|
+
handleClickActionChange(prev?: ClickAction, next?: ClickAction): void;
|
|
183
|
+
handleClickSpaceChange(): void;
|
|
184
|
+
/**
|
|
185
|
+
* A stored space URL breaks once the space moves domain, so the link target is
|
|
186
|
+
* re-resolved against the list the viewer supplies. Without that list the stored
|
|
187
|
+
* URL stands.
|
|
188
|
+
*/
|
|
189
|
+
private resolveClickSpace;
|
|
190
|
+
handleThumbnailChange(): void;
|
|
191
|
+
handleFetchedAssetDataChange(): void;
|
|
192
|
+
handleSrcChange(): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the URL to hand to the player
|
|
195
|
+
*/
|
|
196
|
+
private recoverExpiredSrc;
|
|
197
|
+
/**
|
|
198
|
+
* Re-resolves a fresh playback URL from `record-id` + `format` when the stored
|
|
199
|
+
* `format-src` has expired. Mirrors the pick-time `path_<format>.URI` resolution;
|
|
200
|
+
* on failure the caller falls back to the stored URL.
|
|
201
|
+
*/
|
|
202
|
+
private resolveFreshFormatSrc;
|
|
203
|
+
applySrc(src: string): Promise<void>;
|
|
204
|
+
private requestVideoFullscreen;
|
|
205
|
+
private handleAssetDataDisplayFetchSuccess;
|
|
206
|
+
private applyNameFromAssetData;
|
|
207
|
+
/**
|
|
208
|
+
* Maps asset data supplied by a read-mode consumer (instead of the block's
|
|
209
|
+
* own `cx-asset-data-display` fetch) into name and overlay content.
|
|
210
|
+
*/
|
|
211
|
+
private applyFetchedAssetData;
|
|
212
|
+
/**
|
|
213
|
+
* Support CMS5 click action for the video.
|
|
214
|
+
*/
|
|
215
|
+
private handleClickAction;
|
|
216
|
+
protected renderContent(): TemplateResult;
|
|
217
|
+
render(): TemplateResult;
|
|
218
|
+
}
|
|
219
|
+
declare global {
|
|
220
|
+
interface HTMLElementTagNameMap {
|
|
221
|
+
'cx-sb-video': CxSbVideo;
|
|
222
|
+
}
|
|
223
|
+
}
|