@cntrl-site/components 1.0.106-alpha.0 → 1.0.107-alpha.1
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/dist/ArchivePopup-DMpGP8r2.js +176 -0
- package/dist/ArchivePopup-X4EtTAyA.mjs +694 -0
- package/dist/ArchivePopupComponent-BTniPIfi.js +1 -0
- package/dist/{PretextComponent-j-OsRZTx.mjs → ArchivePopupComponent-GgAT2Avz.mjs} +954 -479
- package/dist/ClickGallerie-CYQMgrIr.js +36 -0
- package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
- package/dist/Components/ArchivePopup/ArchivePopup.d.ts +154 -0
- package/dist/Components/ArchivePopup/ArchivePopupComponent.d.ts +288 -0
- package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
- package/dist/Components/Helix/Helix.d.ts +4 -1
- package/dist/Components/Hive/Hive.d.ts +4 -1
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
- package/dist/Components/List/List.d.ts +6 -2
- package/dist/Components/Marquee/Marquee.d.ts +6 -2
- package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
- package/dist/Components/Mercury/Mercury.d.ts +4 -1
- package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
- package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
- package/dist/Components/utils/LinkWrapper.d.ts +16 -0
- package/dist/Components/utils/embedMedia.d.ts +40 -0
- package/dist/Components/utils/index.d.ts +6 -0
- package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
- package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
- package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
- package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
- package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
- package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
- package/dist/Grid-CFHTP3mb.js +378 -0
- package/dist/Grid-e-gLfsji.mjs +1590 -0
- package/dist/Helix-BpLo9FD3.js +43 -0
- package/dist/Helix-CidI3ucE.mjs +324 -0
- package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
- package/dist/Hive-D1j6wZpV.js +321 -0
- package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
- package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
- package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
- package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
- package/dist/LinkWrapper-Ca84iPtg.js +1 -0
- package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
- package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
- package/dist/List-DVvpQ24J.js +377 -0
- package/dist/Marquee-DByooiWP.mjs +578 -0
- package/dist/Marquee-DfIP-tIN.js +133 -0
- package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
- package/dist/MarqueeText-DsUiV6Zv.js +132 -0
- package/dist/Mercury-B-s2Kvuq.js +267 -0
- package/dist/Mercury-CCW0Es-s.mjs +1700 -0
- package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
- package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
- package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
- package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
- package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
- package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
- package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
- package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
- package/dist/Waterfall-3kKioKh2.mjs +1432 -0
- package/dist/Waterfall-DII4-WV5.js +288 -0
- package/dist/{components-D2LyuDm-.mjs → components-DKuQ8PUa.mjs} +19 -18
- package/dist/components-SEwSqFrQ.js +1 -0
- package/dist/content/postFieldBindings.d.ts +29 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +22 -21
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +52 -15
- package/dist/sources.js +1331 -233
- package/dist/sources.mjs +1355 -256
- package/dist/types/SchemaV1.d.ts +53 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +30 -20
- package/package.json +1 -1
- package/dist/ClickGallerie-D7g093HX.js +0 -36
- package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
- package/dist/Grid-BBpdl60K.js +0 -374
- package/dist/Grid-DS53S_gA.mjs +0 -1576
- package/dist/Helix-BPn9V1sg.mjs +0 -315
- package/dist/Helix-DcgsCc4D.js +0 -43
- package/dist/Hive-n8Fz-j3o.js +0 -321
- package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
- package/dist/List-C32WImI3.js +0 -377
- package/dist/Marquee-DOIRRCu4.js +0 -133
- package/dist/Marquee-O_PDwlIb.mjs +0 -564
- package/dist/MarqueeText-DkaO2lQ5.js +0 -132
- package/dist/Mercury-C9D10TTT.mjs +0 -1702
- package/dist/Mercury-DynO-NxY.js +0 -267
- package/dist/PretextComponent-BnsS2zJ6.js +0 -1
- package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
- package/dist/Waterfall-DC2WQ3GT.js +0 -287
- package/dist/Waterfall-Yud2VR62.mjs +0 -1404
- package/dist/components-B9Vdjf0w.js +0 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { LayoutTab, SchemaDisplayRule, SchemaProperty } from '../../types/SchemaV1';
|
|
2
|
+
import { applyArchivePopupColumnCountChange, ArchivePopup } from './ArchivePopup';
|
|
3
|
+
export declare const ArchivePopupComponent: {
|
|
4
|
+
element: typeof ArchivePopup;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
category: string;
|
|
8
|
+
normalizeLayoutSettingsUpdate: typeof applyArchivePopupColumnCountChange;
|
|
9
|
+
preview: {
|
|
10
|
+
type: "image";
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
version: number;
|
|
14
|
+
schema: {
|
|
15
|
+
type: "object";
|
|
16
|
+
version: 1;
|
|
17
|
+
content: {
|
|
18
|
+
type: "array";
|
|
19
|
+
settings: {
|
|
20
|
+
addItemWithoutImage: true;
|
|
21
|
+
allowsVideo: true;
|
|
22
|
+
};
|
|
23
|
+
display: {
|
|
24
|
+
type: string;
|
|
25
|
+
rules: SchemaDisplayRule[];
|
|
26
|
+
};
|
|
27
|
+
items: {
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: {
|
|
30
|
+
image: {
|
|
31
|
+
type: "object";
|
|
32
|
+
label: string;
|
|
33
|
+
display: {
|
|
34
|
+
type: string;
|
|
35
|
+
isObjectFitEditable: boolean;
|
|
36
|
+
defaultObjectFit: string;
|
|
37
|
+
};
|
|
38
|
+
properties: {
|
|
39
|
+
assetId: {
|
|
40
|
+
type: "string";
|
|
41
|
+
};
|
|
42
|
+
name: {
|
|
43
|
+
type: "string";
|
|
44
|
+
};
|
|
45
|
+
type: {
|
|
46
|
+
type: "string";
|
|
47
|
+
enum: string[];
|
|
48
|
+
};
|
|
49
|
+
objectFit: {
|
|
50
|
+
type: "string";
|
|
51
|
+
enum: string[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
group: {
|
|
56
|
+
type: "string";
|
|
57
|
+
label: string;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
display: {
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
title: {
|
|
64
|
+
label: string;
|
|
65
|
+
placeholder: string;
|
|
66
|
+
display: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
default: {
|
|
73
|
+
group: string;
|
|
74
|
+
title: {
|
|
75
|
+
type: string;
|
|
76
|
+
children: {
|
|
77
|
+
text: string;
|
|
78
|
+
}[];
|
|
79
|
+
}[];
|
|
80
|
+
image: {
|
|
81
|
+
assetId: string;
|
|
82
|
+
name: string;
|
|
83
|
+
objectFit: "cover";
|
|
84
|
+
};
|
|
85
|
+
}[];
|
|
86
|
+
};
|
|
87
|
+
settings: {
|
|
88
|
+
sizing: string;
|
|
89
|
+
properties: {
|
|
90
|
+
panelPosition: {
|
|
91
|
+
type: "string";
|
|
92
|
+
scope: "layout";
|
|
93
|
+
title: string;
|
|
94
|
+
display: {
|
|
95
|
+
type: string;
|
|
96
|
+
enum: ("center" | "top-center" | "top-right" | "bottom-center" | "left-top" | "left-center" | "right-center" | "left-bottom" | "right-bottom")[];
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
panelWidth: SchemaProperty;
|
|
100
|
+
panelPadding: {
|
|
101
|
+
type: "object";
|
|
102
|
+
scope: "layout";
|
|
103
|
+
title: string;
|
|
104
|
+
display: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
panelRadius: SchemaProperty;
|
|
109
|
+
groupGap: SchemaProperty;
|
|
110
|
+
triggerColor: SchemaProperty;
|
|
111
|
+
triggerHoverColor: SchemaProperty;
|
|
112
|
+
closeColor: SchemaProperty;
|
|
113
|
+
closeHoverColor: SchemaProperty;
|
|
114
|
+
textColor: SchemaProperty;
|
|
115
|
+
textHoverColor: SchemaProperty;
|
|
116
|
+
panelColor: SchemaProperty;
|
|
117
|
+
overlayColor: SchemaProperty;
|
|
118
|
+
type: {
|
|
119
|
+
type: "string";
|
|
120
|
+
scope: "layout";
|
|
121
|
+
title: string;
|
|
122
|
+
display: {
|
|
123
|
+
type: string;
|
|
124
|
+
};
|
|
125
|
+
enum: string[];
|
|
126
|
+
};
|
|
127
|
+
triggerLabel: {
|
|
128
|
+
type: "string";
|
|
129
|
+
scope: "common";
|
|
130
|
+
title: string;
|
|
131
|
+
display: {
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
closeLabel: {
|
|
136
|
+
type: "string";
|
|
137
|
+
scope: "common";
|
|
138
|
+
title: string;
|
|
139
|
+
display: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
columns: {
|
|
144
|
+
type: "number";
|
|
145
|
+
scope: "layout";
|
|
146
|
+
title: string;
|
|
147
|
+
display: {
|
|
148
|
+
type: string;
|
|
149
|
+
};
|
|
150
|
+
min: number;
|
|
151
|
+
max: number;
|
|
152
|
+
};
|
|
153
|
+
columnGap: SchemaProperty;
|
|
154
|
+
};
|
|
155
|
+
defaults: {
|
|
156
|
+
triggerLabel: string;
|
|
157
|
+
closeLabel: string;
|
|
158
|
+
triggerColor: string;
|
|
159
|
+
triggerHoverColor: string;
|
|
160
|
+
closeColor: string;
|
|
161
|
+
closeHoverColor: string;
|
|
162
|
+
panelColor: string;
|
|
163
|
+
textColor: string;
|
|
164
|
+
textHoverColor: string;
|
|
165
|
+
overlayColor: string;
|
|
166
|
+
triggerFontFamily: string;
|
|
167
|
+
triggerFontSettings: {
|
|
168
|
+
fontWeight: number;
|
|
169
|
+
fontStyle: string;
|
|
170
|
+
};
|
|
171
|
+
triggerLetterSpacing: number;
|
|
172
|
+
triggerWordSpacing: number;
|
|
173
|
+
triggerTextAppearance: {
|
|
174
|
+
textTransform: string;
|
|
175
|
+
textDecoration: string;
|
|
176
|
+
fontVariant: string;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
layoutDefaults: {
|
|
180
|
+
m: {
|
|
181
|
+
type: string;
|
|
182
|
+
panelPosition: string;
|
|
183
|
+
columns: number;
|
|
184
|
+
columnGap: number;
|
|
185
|
+
panelWidth: number;
|
|
186
|
+
panelPadding: {
|
|
187
|
+
top: number;
|
|
188
|
+
right: number;
|
|
189
|
+
bottom: number;
|
|
190
|
+
left: number;
|
|
191
|
+
};
|
|
192
|
+
panelRadius: number;
|
|
193
|
+
groupGap: number;
|
|
194
|
+
triggerFontSize: number;
|
|
195
|
+
triggerLineHeight: number;
|
|
196
|
+
} & Partial<Record<"column1Width" | "column2Width" | "column3Width" | "column4Width", number>>;
|
|
197
|
+
t: {
|
|
198
|
+
type: string;
|
|
199
|
+
panelPosition: string;
|
|
200
|
+
columns: number;
|
|
201
|
+
columnGap: number;
|
|
202
|
+
panelWidth: number;
|
|
203
|
+
panelPadding: {
|
|
204
|
+
top: number;
|
|
205
|
+
right: number;
|
|
206
|
+
bottom: number;
|
|
207
|
+
left: number;
|
|
208
|
+
};
|
|
209
|
+
panelRadius: number;
|
|
210
|
+
groupGap: number;
|
|
211
|
+
triggerFontSize: number;
|
|
212
|
+
triggerLineHeight: number;
|
|
213
|
+
} & Partial<Record<"column1Width" | "column2Width" | "column3Width" | "column4Width", number>>;
|
|
214
|
+
d: {
|
|
215
|
+
type: string;
|
|
216
|
+
panelPosition: string;
|
|
217
|
+
columns: number;
|
|
218
|
+
columnGap: number;
|
|
219
|
+
panelWidth: number;
|
|
220
|
+
panelPadding: {
|
|
221
|
+
top: number;
|
|
222
|
+
right: number;
|
|
223
|
+
bottom: number;
|
|
224
|
+
left: number;
|
|
225
|
+
};
|
|
226
|
+
panelRadius: number;
|
|
227
|
+
groupGap: number;
|
|
228
|
+
triggerFontSize: number;
|
|
229
|
+
triggerLineHeight: number;
|
|
230
|
+
} & Partial<Record<"column1Width" | "column2Width" | "column3Width" | "column4Width", number>>;
|
|
231
|
+
};
|
|
232
|
+
displayRules: (SchemaDisplayRule | {
|
|
233
|
+
if: {
|
|
234
|
+
name: string;
|
|
235
|
+
value: string;
|
|
236
|
+
};
|
|
237
|
+
then: {
|
|
238
|
+
name: string;
|
|
239
|
+
value: boolean;
|
|
240
|
+
};
|
|
241
|
+
})[];
|
|
242
|
+
};
|
|
243
|
+
panels: ({
|
|
244
|
+
id: string;
|
|
245
|
+
icon: string;
|
|
246
|
+
title: string;
|
|
247
|
+
tooltip: string;
|
|
248
|
+
layout: (string | {
|
|
249
|
+
type: "row";
|
|
250
|
+
title: string;
|
|
251
|
+
items: string[];
|
|
252
|
+
})[];
|
|
253
|
+
} | {
|
|
254
|
+
id: string;
|
|
255
|
+
icon: string;
|
|
256
|
+
title: string;
|
|
257
|
+
tooltip: string;
|
|
258
|
+
layout: (string | LayoutTab)[];
|
|
259
|
+
})[];
|
|
260
|
+
paletteBookmark: {
|
|
261
|
+
items: ("textColor" | "textHoverColor" | "overlayColor" | "triggerColor" | "triggerHoverColor" | "closeColor" | "closeHoverColor" | "panelColor")[];
|
|
262
|
+
panelIds: string[];
|
|
263
|
+
stateItems: {
|
|
264
|
+
default: string[];
|
|
265
|
+
hover: string[];
|
|
266
|
+
open: string[];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
states: string[];
|
|
270
|
+
statePanels: string[];
|
|
271
|
+
};
|
|
272
|
+
assetsPaths: {
|
|
273
|
+
content: {
|
|
274
|
+
path: string;
|
|
275
|
+
placeholderEnabled: boolean;
|
|
276
|
+
}[];
|
|
277
|
+
parameters: never[];
|
|
278
|
+
};
|
|
279
|
+
fontSettingsPaths: {
|
|
280
|
+
content: never[];
|
|
281
|
+
parameters: {
|
|
282
|
+
path: string;
|
|
283
|
+
}[];
|
|
284
|
+
};
|
|
285
|
+
fontRelations: {
|
|
286
|
+
[k: string]: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
type ClickGallerieItem = {
|
|
3
4
|
image: {
|
|
4
5
|
assetId: string;
|
|
5
6
|
name: string;
|
|
6
7
|
};
|
|
7
|
-
link
|
|
8
|
+
link?: ContentLink;
|
|
8
9
|
};
|
|
9
10
|
type ImageSizeSettings = {
|
|
10
11
|
sizeType: 'custom' | 'as is' | 'random';
|
|
@@ -2,7 +2,10 @@ import { CommonComponentProps } from '../props';
|
|
|
2
2
|
type HelixMedia = {
|
|
3
3
|
assetId?: string;
|
|
4
4
|
name?: string;
|
|
5
|
-
type?: 'image' | 'video';
|
|
5
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
6
|
+
thumbnail?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
6
9
|
};
|
|
7
10
|
export type HelixContentItem = {
|
|
8
11
|
image?: HelixMedia;
|
|
@@ -21,7 +21,10 @@ type HiveMedia = {
|
|
|
21
21
|
assetId: string;
|
|
22
22
|
name?: string;
|
|
23
23
|
objectFit?: 'cover' | 'contain';
|
|
24
|
-
type?: 'image' | 'video';
|
|
24
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
25
|
+
thumbnail?: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
25
28
|
};
|
|
26
29
|
type HiveMediaPair = {
|
|
27
30
|
media: HiveMedia[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContentLink } from '../utils/index';
|
|
1
2
|
interface ImageRevealSliderProps {
|
|
2
3
|
settings: ImageRevealSliderSettings;
|
|
3
4
|
content: ImageRevealSliderItem[];
|
|
@@ -34,7 +35,7 @@ type ImageRevealSliderItem = {
|
|
|
34
35
|
assetId: string;
|
|
35
36
|
name: string;
|
|
36
37
|
};
|
|
37
|
-
link
|
|
38
|
+
link?: ContentLink;
|
|
38
39
|
};
|
|
39
40
|
export declare function ImageRevealSlider({ settings, content, isEditor }: ImageRevealSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
40
41
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
4
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4
5
|
type ListFontSettings = {
|
|
@@ -120,7 +121,10 @@ type ListMedia = {
|
|
|
120
121
|
objectFit?: 'cover' | 'contain';
|
|
121
122
|
assetId: string;
|
|
122
123
|
name: string;
|
|
123
|
-
type?: 'image' | 'video';
|
|
124
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
125
|
+
thumbnail?: string;
|
|
126
|
+
width?: number;
|
|
127
|
+
height?: number;
|
|
124
128
|
};
|
|
125
129
|
type ListContentItem = {
|
|
126
130
|
AColumn?: string;
|
|
@@ -129,7 +133,7 @@ type ListContentItem = {
|
|
|
129
133
|
DColumnWidth?: string;
|
|
130
134
|
EColumnWidth?: string;
|
|
131
135
|
image?: ListMedia;
|
|
132
|
-
link?:
|
|
136
|
+
link?: ContentLink;
|
|
133
137
|
};
|
|
134
138
|
type ListProps = {
|
|
135
139
|
layoutId?: string;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
export declare const Marquee: ({ settings, content, isEditor, isPreviewMode, isEditMode }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export type MarqueeItem = {
|
|
4
5
|
image?: {
|
|
5
6
|
assetId?: string;
|
|
6
7
|
name?: string;
|
|
7
|
-
type?: 'image' | 'video';
|
|
8
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
8
12
|
};
|
|
9
|
-
link?:
|
|
13
|
+
link?: ContentLink;
|
|
10
14
|
};
|
|
11
15
|
export type MarqueeSettings = {
|
|
12
16
|
speed: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
|
+
import { ContentLink } from '../utils/index';
|
|
2
3
|
export declare const MarqueeText: ({ settings, content, isEditor, isPreviewMode }: MarqueeTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export type MarqueeTextItem = {
|
|
4
5
|
text: string;
|
|
@@ -6,7 +7,7 @@ export type MarqueeTextItem = {
|
|
|
6
7
|
assetId?: string;
|
|
7
8
|
name?: string;
|
|
8
9
|
};
|
|
9
|
-
link?:
|
|
10
|
+
link?: ContentLink;
|
|
10
11
|
};
|
|
11
12
|
export type MarqueeTextSettings = {
|
|
12
13
|
speed: number;
|
|
@@ -3,8 +3,11 @@ import { TextStyles } from '../utils/textStylesToCss';
|
|
|
3
3
|
type MercuryMedia = {
|
|
4
4
|
assetId: string;
|
|
5
5
|
name?: string;
|
|
6
|
-
type?: 'image' | 'video';
|
|
6
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
7
7
|
objectFit?: 'cover' | 'contain';
|
|
8
|
+
thumbnail?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
8
11
|
};
|
|
9
12
|
type MercuryMediaPair = {
|
|
10
13
|
media: MercuryMedia[];
|
|
@@ -3,7 +3,10 @@ export type WaterfallMedia = {
|
|
|
3
3
|
assetId: string;
|
|
4
4
|
name?: string;
|
|
5
5
|
objectFit?: 'cover' | 'contain';
|
|
6
|
-
type?: 'image' | 'video';
|
|
6
|
+
type?: 'image' | 'video' | 'vimeo' | 'youtube';
|
|
7
|
+
thumbnail?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
7
10
|
};
|
|
8
11
|
export type WaterfallLightboxContentItem = {
|
|
9
12
|
title?: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { EmbedMediaLike } from './embedMedia';
|
|
3
|
+
export interface EmbedMediaFrameProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
media: EmbedMediaLike;
|
|
5
|
+
/** How the video fills the box, the way an image's object-fit would. */
|
|
6
|
+
fit: 'cover' | 'contain';
|
|
7
|
+
/** Framed only while near the viewport, so a track of copies holds one player per visible card. */
|
|
8
|
+
lazy?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Played at once whatever starts it elsewhere: opening a lightbox, or pointing at what a preview shows for,
|
|
11
|
+
* is already the gesture, and the click is left to the box around it.
|
|
12
|
+
*/
|
|
13
|
+
startsAtOnce?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Played as a silent loop whatever the media says, the click left to the box: a cell that opens a lightbox
|
|
16
|
+
* shows the video there as it was set to play.
|
|
17
|
+
*/
|
|
18
|
+
silentLoop?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A Vimeo or YouTube video in the room of an image or a video: a box the caller sizes and places,
|
|
22
|
+
* showing the stored thumbnail until the player is framed over it, and playing as the media says.
|
|
23
|
+
* A video that waits for a hover or a click is framed only then, and paused and played again after.
|
|
24
|
+
* Its controls, or a click that plays it, take the click, which then opens nothing around it; any
|
|
25
|
+
* other video is clicked like a picture. A box with no height of its own takes the video's aspect.
|
|
26
|
+
*/
|
|
27
|
+
export declare const EmbedMediaFrame: FC<EmbedMediaFrameProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* A content link or a rich text link node: both keep the url in `value` and `blank` or `self`
|
|
5
|
+
* in `target` (`_blank` is taken too).
|
|
6
|
+
*/
|
|
7
|
+
link?: {
|
|
8
|
+
value: string;
|
|
9
|
+
target?: string;
|
|
10
|
+
};
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const LinkWrapper: FC<Props>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type EmbedProvider = 'vimeo' | 'youtube';
|
|
2
|
+
export type EmbedPlayMode = 'auto' | 'on-hover' | 'on-click';
|
|
3
|
+
/**
|
|
4
|
+
* What a media value holds of a Vimeo or YouTube video: its player url, the picture and size the player has
|
|
5
|
+
* none of, and how it plays, as the editor's embed form set it.
|
|
6
|
+
*/
|
|
7
|
+
export type EmbedMediaLike = {
|
|
8
|
+
assetId?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
thumbnail?: string;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
play?: EmbedPlayMode;
|
|
15
|
+
controls?: boolean;
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
muted?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type EmbedPlayback = {
|
|
20
|
+
play: EmbedPlayMode;
|
|
21
|
+
controls: boolean;
|
|
22
|
+
loop: boolean;
|
|
23
|
+
muted: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** The provider whose player a media is framed from, none for a file or a value that only claims to be one. */
|
|
26
|
+
export declare function getEmbedProvider(media: EmbedMediaLike | null | undefined): EmbedProvider | null;
|
|
27
|
+
export declare function isEmbedMedia(media: EmbedMediaLike | null | undefined): boolean;
|
|
28
|
+
/** Width over height of the video, 16:9 when the media does not say. */
|
|
29
|
+
export declare function getEmbedAspect(media: EmbedMediaLike): number;
|
|
30
|
+
/**
|
|
31
|
+
* How the video plays: a media that does not say plays as an uploaded video does, on its own, muted and
|
|
32
|
+
* looping, with no controls. Only a click lets sound play, and YouTube's player, with no loop or sound to
|
|
33
|
+
* set, loops and is muted until clicked.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getEmbedPlayback(media: EmbedMediaLike): EmbedPlayback;
|
|
36
|
+
/** The player url set to play at once the way the media says; a player waiting for a hover or a click is framed only then. */
|
|
37
|
+
export declare function getEmbedPlayerSrc(media: EmbedMediaLike): string;
|
|
38
|
+
export type EmbedCommand = 'listen' | 'play' | 'pause';
|
|
39
|
+
/** Plays or pauses a framed player through the messages its provider's player listens to. */
|
|
40
|
+
export declare function postEmbedCommand(iframe: HTMLIFrameElement, provider: EmbedProvider, command: EmbedCommand): void;
|
|
@@ -10,3 +10,9 @@ export type { CommonComponentProps } from '../props';
|
|
|
10
10
|
export { readTestimonialTextMeasure } from './readTestimonialTextMeasure';
|
|
11
11
|
export { getAvailableStatePanels, getUnavailableStates, isPanelAvailable, } from './panelAvailability';
|
|
12
12
|
export type { PanelAvailabilityContext } from './panelAvailability';
|
|
13
|
+
export { LinkWrapper } from './LinkWrapper';
|
|
14
|
+
export type { ContentLink } from '../../types/SchemaV1';
|
|
15
|
+
export { getEmbedAspect, getEmbedPlayback, getEmbedPlayerSrc, getEmbedProvider, isEmbedMedia, postEmbedCommand } from './embedMedia';
|
|
16
|
+
export type { EmbedCommand, EmbedMediaLike, EmbedPlayback, EmbedPlayMode, EmbedProvider } from './embedMedia';
|
|
17
|
+
export { EmbedMediaFrame } from './EmbedMediaFrame';
|
|
18
|
+
export type { EmbedMediaFrameProps } from './EmbedMediaFrame';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-K90Dd7pt.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-DFlmxAoL.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
|
|
@@ -3,7 +3,7 @@ import { useState as f, useRef as Y, useEffect as O } from "react";
|
|
|
3
3
|
import { S as q, a as K } from "./react-splide.esm-DQqds4PL.mjs";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import c from "classnames";
|
|
6
|
-
import { R as Q } from "./RichTextRenderer-
|
|
6
|
+
import { R as Q } from "./RichTextRenderer-BptwNpbJ.mjs";
|
|
7
7
|
import { s } from "./scalingValue-C9JH5L6O.mjs";
|
|
8
8
|
import { S as N } from "./SvgImage-B5mR9y6q.mjs";
|
|
9
9
|
import { n as Z } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const L=require("react/jsx-runtime"),i=require("react"),K={vimeo:/^player\.vimeo\.com$/i,youtube:/^(?:www\.)?youtube(?:-nocookie)?\.com$/i};function h(e){if(!(e!=null&&e.assetId)||e.type!=="vimeo"&&e.type!=="youtube")return null;try{const t=new URL(e.assetId);return!K[e.type].test(t.hostname)||e.type==="youtube"&&!t.pathname.startsWith("/embed/")?null:e.type}catch{return null}}function M(e){return h(e)!==null}function T(e){const{width:t,height:s}=e;return t&&s&&t>0&&s>0?t/s:16/9}function N(e){const t=e.play??"auto",s=e.controls??!1,r=t==="on-click";return h(e)==="youtube"?{play:t,controls:s,loop:!0,muted:!r}:{play:t,controls:s,loop:e.loop??!0,muted:!r||(e.muted??!0)}}function V(e){const t=h(e);if(!t||!e.assetId)return e.assetId??"";const{play:s,controls:r,loop:l,muted:a}=N(e),c=new URL(e.assetId),n=c.searchParams,u=E=>E?"1":"0";return t==="vimeo"?(s==="auto"&&!r&&l&&a&&n.set("background","1"),n.set("autoplay","1"),n.set("muted",u(a)),n.set("loop",u(l)),n.set("controls",u(r)),n.set("title","0"),n.set("byline","0"),n.set("portrait","0"),n.set("autopause","0")):(n.set("autoplay","1"),n.set("mute",u(a)),n.set("loop","1"),n.set("playlist",c.pathname.slice(7)),n.set("controls",u(r)),n.set("disablekb",u(!r)),n.set("enablejsapi","1"),n.set("iv_load_policy","3"),n.set("playsinline","1"),n.set("rel","0"),n.set("modestbranding","1")),c.toString()}function Q(e,t){return e==="vimeo"?t==="listen"?null:{method:t}:t==="listen"?{event:"listening",id:1,channel:"widget"}:{event:"command",func:t==="play"?"playVideo":"pauseVideo",args:[]}}function D(e,t,s){const r=Q(t,s),l=e.contentWindow;if(!(!r||!l))try{l.postMessage(JSON.stringify(r),new URL(e.src).origin)}catch{}}const X={play:"auto",controls:!1,loop:!0,muted:!0};function Z(e,t,s){const r=e.width/e.height,l=s==="cover"?t<=r:t>=r,a=l?e.width:e.height*t,c=l?e.width/t:e.height;return{width:a,height:c,left:(e.width-a)/2,top:(e.height-c)/2}}const ee=({media:e,fit:t,lazy:s=!0,startsAtOnce:r=!1,silentLoop:l=!1,style:a,onClick:c,onMouseEnter:n,onMouseLeave:u,...E})=>{const R=i.useRef(null),S=i.useRef(null),[b,H]=i.useState(null),[P,_]=i.useState(!s),[x,I]=i.useState(!1),g=i.useRef(!1),k=i.useRef(!1),d=l?{...e,...X}:e,A=T(d),B=h(d),y=N(d),m=r?"auto":y.play,C=!r&&(y.controls||y.play==="on-click");i.useEffect(()=>{const o=R.current;if(!o||typeof ResizeObserver>"u")return;const p=()=>{const{width:$,height:q}=o.getBoundingClientRect();H(v=>v&&v.width===$&&v.height===q?v:{width:$,height:q})};p();const w=new ResizeObserver(p);return w.observe(o),()=>w.disconnect()},[]),i.useEffect(()=>{const o=R.current;if(!s||!o||typeof IntersectionObserver>"u"){_(!0);return}const p=new IntersectionObserver(([w])=>_(w.isIntersecting),{rootMargin:"200px"});return p.observe(o),()=>p.disconnect()},[s]),i.useEffect(()=>{P||(I(!1),g.current=!1)},[P]);const f=b&&b.width>0&&b.height>0?Z(b,A,t):null,O=P&&f!==null&&(m==="auto"||x);i.useEffect(()=>{O||(k.current=!1)},[O]);const j=o=>{S.current&&B&&D(S.current,B,o)},U=()=>{g.current=!0,x?j("play"):I(!0)},W=()=>{g.current=!1,k.current?j("pause"):I(!1)},J=o=>{if(!C){c==null||c(o);return}o.preventDefault(),o.stopPropagation(),m==="on-click"&&(g.current?W():U())},{width:F,...Y}=a??{},z={position:"relative",overflow:"hidden",aspectRatio:`${A}`,width:F===void 0||F==="auto"?"100%":F,...Y,...C&&{cursor:"pointer"}},G={position:"absolute",inset:0,width:"100%",height:"100%",objectFit:t,pointerEvents:"none"};return L.jsxs("div",{ref:R,"data-embed-frame":"",style:z,...E,onClick:J,onMouseEnter:o=>{n==null||n(o),m==="on-hover"&&U()},onMouseLeave:o=>{u==null||u(o),m==="on-hover"&&W()},children:[d.thumbnail&&L.jsx("img",{src:d.thumbnail,alt:d.name??"",draggable:!1,style:G}),O&&f&&L.jsx("iframe",{ref:S,src:V(d),title:d.name||"Embedded video",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,style:{position:"absolute",left:f.left,top:f.top,width:f.width,height:f.height,border:0,pointerEvents:y.controls?"auto":"none"},onLoad:()=>{k.current=!0,j("listen")}})]})};exports.EmbedMediaFrame=ee;exports.getEmbedAspect=T;exports.getEmbedPlayback=N;exports.getEmbedPlayerSrc=V;exports.getEmbedProvider=h;exports.isEmbedMedia=M;exports.postEmbedCommand=D;
|