@orangelogic/design-system 4.3.0 → 4.5.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.C5Ue4EGP.js → asset-link-format.DTLA2CFh.js} +407 -388
- package/library/chunks/{button.DbAUlIXG.js → button.cbDkxJHn.js} +1 -1
- package/library/chunks/{color-swatch-group.B10yWbVM.js → color-swatch-group.6ls-5ziB.js} +646 -646
- package/library/chunks/{confirm-popover.Cd4HM5-B.js → confirm-popover.Dvgoz-oA.js} +3 -3
- package/library/chunks/{dialog.CXphbq8N.js → dialog.BvSMV36r.js} +2 -2
- package/library/chunks/{document-viewer.B_ESlazf.js → document-viewer.BLdEjbza.js} +7 -7
- package/library/chunks/{dot-pagination.CzT-MZmt.js → dot-pagination.CukHxNBk.js} +1 -1
- package/library/chunks/{folder-select.BWeanVkA.js → folder-select.DAZQRdLq.js} +4 -4
- package/library/chunks/{header.Dy57RuQW.js → header.DWE-WJaC.js} +51 -43
- package/library/chunks/{i18n.Q5_2aVLU.js → i18n.BSPmBQ73.js} +1 -0
- package/library/chunks/{icon-button.BjAbCuH8.js → icon-button.DV5Fks8j.js} +1 -1
- package/library/chunks/{iframe.CdktjPCB.js → iframe.ddX2kGu3.js} +1 -1
- package/library/chunks/{image.CCo__54F.js → image.BM7bPTub.js} +174 -143
- package/library/chunks/{index.DiZGZkHv.js → index.D8XR8JuY.js} +70 -66
- package/library/chunks/{input.ftEf4GS6.js → input.7pumTpdu.js} +1 -1
- package/library/chunks/{markdown.RljldBNb.js → markdown.LHSzm035.js} +2 -2
- package/library/chunks/{menu-item.BNs1Ji48.js → menu-item.CqPvDGeN.js} +1 -1
- package/library/chunks/{option.C8IEnv5Q.js → option.dBUWN4sF.js} +1 -1
- package/library/chunks/{pagination.Bke9vgl4.js → pagination.C2f8lUVb.js} +5 -5
- package/library/chunks/{resizable-component.styles.CAfXABBc.js → resizable-component.styles.kMFDlGgv.js} +2 -2
- package/library/chunks/{responsive.BmBJSzC4.js → responsive.DqF_v1XY.js} +9 -7
- package/library/chunks/{tab-group.DZ32f41G.js → tab-group.DOnaT12G.js} +4 -4
- package/library/chunks/{tree.Umn7TAkc.js → tree.CHQ1WjZV.js} +1 -1
- package/library/chunks/{types.BW36Gr9c.js → types.DVqUSJlF.js} +2522 -2414
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +3 -3
- package/library/components/atoms.js +15 -15
- package/library/components/audio.js +3 -3
- package/library/components/border-input-group.js +2 -2
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +2 -2
- package/library/components/color-picker.js +6 -6
- package/library/components/color-swatch-group.js +3 -3
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +3 -3
- package/library/components/document-viewer.js +4 -4
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +9 -9
- package/library/components/folder-select.js +4 -4
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +5 -4
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- 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 +3 -3
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +2 -2
- 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 +6 -6
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.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 +1 -1
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/tag.js +2 -2
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +128 -127
- package/library/components/video.js +1341 -1294
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/header/header.d.ts +2 -0
- package/library/packages/atoms/src/components/image/image.d.ts +16 -0
- package/library/packages/atoms/src/components/video/video.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +5 -6
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +6 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +5 -1
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +10 -3
- package/library/packages/organisms/src/content-builder/configs/header.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.d.ts +6 -0
- package/library/packages/types/src/content-builder.d.ts +6 -2
- package/library/packages/utils/src/custom-element/i18n.d.ts +1 -0
- package/library/packages/utils/src/responsive/responsive.d.ts +1 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +54 -53
- package/package.json +1 -1
package/library/package.json
CHANGED
|
@@ -91,6 +91,8 @@ export default class CxHeader extends CortexElement {
|
|
|
91
91
|
*/
|
|
92
92
|
handleCMS5PageReady(): void;
|
|
93
93
|
private handleWindowResize;
|
|
94
|
+
/** Reads the current breakpoints from CSS and derives the active device. */
|
|
95
|
+
private syncDeviceType;
|
|
94
96
|
private handleClick;
|
|
95
97
|
getAnchorID(): string;
|
|
96
98
|
/**
|
|
@@ -69,6 +69,10 @@ export default class CxImage extends ResizableElement {
|
|
|
69
69
|
* The path to the image to load.
|
|
70
70
|
*/
|
|
71
71
|
src: string;
|
|
72
|
+
/** Intrinsic width / height used to reserve space while loading with Height Auto.
|
|
73
|
+
* @defaultValue 0
|
|
74
|
+
*/
|
|
75
|
+
aspectRatio: number;
|
|
72
76
|
/**
|
|
73
77
|
* Candidate sources for the underlying `<img>`, as a standard `srcset` value
|
|
74
78
|
* (e.g. `"…/re_w_400/img.jpg 400w, …/re_w_800/img.jpg 800w"`).
|
|
@@ -179,6 +183,18 @@ export default class CxImage extends ResizableElement {
|
|
|
179
183
|
'highlightable-item': boolean;
|
|
180
184
|
'highlightable-item--effect-text-reveal': boolean;
|
|
181
185
|
};
|
|
186
|
+
protected get currentAspectRatio(): number;
|
|
187
|
+
private get loadingAspectRatio();
|
|
188
|
+
getHighlighterClass(isError?: boolean): {
|
|
189
|
+
'highlighter--loading-ratio': boolean;
|
|
190
|
+
highlighter: boolean;
|
|
191
|
+
'highlighter--background': boolean;
|
|
192
|
+
'highlighter--border': boolean;
|
|
193
|
+
'highlighter--centered': boolean;
|
|
194
|
+
'highlighter--color-overlay': boolean;
|
|
195
|
+
'highlighter--drop-shadow': boolean;
|
|
196
|
+
'highlighter--opacity': boolean;
|
|
197
|
+
};
|
|
182
198
|
get imageClass(): {
|
|
183
199
|
[x: string]: boolean;
|
|
184
200
|
image: boolean;
|
|
@@ -155,6 +155,11 @@ export default class CxVideo extends ResizableElement {
|
|
|
155
155
|
protected removeVideoEventListeners(): void;
|
|
156
156
|
attachSeekbar(): void;
|
|
157
157
|
private applyBigPlayButtonVisibility;
|
|
158
|
+
/**
|
|
159
|
+
* Keeps the big play button centered in the visible video content rather than
|
|
160
|
+
* the full player when object-fit leaves empty space around the video.
|
|
161
|
+
*/
|
|
162
|
+
private updateBigPlayButtonPosition;
|
|
158
163
|
protected setupVideoJsPlayer(src?: string): Promise<void>;
|
|
159
164
|
handleLoopChange(): Promise<void>;
|
|
160
165
|
handleMutedChange(): Promise<void>;
|
|
@@ -163,6 +168,7 @@ export default class CxVideo extends ResizableElement {
|
|
|
163
168
|
handleDisableRemotePlaybackChange(): Promise<void>;
|
|
164
169
|
handleDisableVolumePanelChange(): Promise<void>;
|
|
165
170
|
handleHideBigPlayButtonChange(): Promise<void>;
|
|
171
|
+
handleVideoPlacementChange(): void;
|
|
166
172
|
handlePosterChange(): Promise<void>;
|
|
167
173
|
handleFormattedPosterChange(): Promise<void>;
|
|
168
174
|
handleSrcChange(): Promise<void>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Transformation } from '../../types/src/asset-link-format';
|
|
2
2
|
|
|
3
3
|
export type CxAssetTransformationDialogConfirmEvent = CustomEvent<{
|
|
4
|
+
/** Width / height from the applied transformation response, when available. */
|
|
5
|
+
aspectRatio?: number;
|
|
4
6
|
format: string;
|
|
5
7
|
/** False when the format follows the asset's file extension instead of an explicit pick. */
|
|
6
8
|
manualFormat: boolean;
|
|
@@ -175,14 +175,13 @@ export default class CxIconPicker extends CortexElement {
|
|
|
175
175
|
* re-focuses on a timer), so a focus-driven load would re-fire long after
|
|
176
176
|
* the dropdown closed.
|
|
177
177
|
*
|
|
178
|
-
* The
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* listeners armed — which intermittently closed the dropdown right after
|
|
183
|
-
* it appeared.
|
|
178
|
+
* The virtualizer waits for the first catalog request to settle before it
|
|
179
|
+
* mounts. Mounting it with an empty item set can leave its visible range
|
|
180
|
+
* empty until the user scrolls. The open-state guard also prevents a late
|
|
181
|
+
* request from mounting the list after the control has already closed.
|
|
184
182
|
*/
|
|
185
183
|
private ensureIconsData;
|
|
184
|
+
private showVirtualizerWhenReady;
|
|
186
185
|
private handleSelectShow;
|
|
187
186
|
private handleSelectHide;
|
|
188
187
|
private handleDropdownShow;
|
|
@@ -212,6 +212,7 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
212
212
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
213
213
|
private get hasUnfrozenTransformations();
|
|
214
214
|
private apiGetTransformAssetLink;
|
|
215
|
+
private transformRequest?;
|
|
215
216
|
private apiGetCropFocusMode;
|
|
216
217
|
/**
|
|
217
218
|
* The unit of the last applied crop transformation, for the no-asset case only. Reflects
|
|
@@ -327,6 +328,11 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
327
328
|
x: number;
|
|
328
329
|
y: number;
|
|
329
330
|
};
|
|
331
|
+
/** Captures the current request synchronously; later edits cannot change Save's ratio. */
|
|
332
|
+
getAppliedAspectRatio(): Promise<number | undefined>;
|
|
333
|
+
private get transformRequestOptions();
|
|
334
|
+
private getTransformRequest;
|
|
335
|
+
private requestTransformAsset;
|
|
330
336
|
setActiveSetting(activeSetting: string): void;
|
|
331
337
|
private freezeTransformations;
|
|
332
338
|
private upsertTransformation;
|
package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { default as CxAssetLinkFormat } from '../asset-link-format/asset-link-fo
|
|
|
20
20
|
* `cx-icon-button`. Automatically disabled when `asset-id` is not set.
|
|
21
21
|
*
|
|
22
22
|
* @event cx-asset-transformation-dialog-cancel - Emitted when the user closes or cancels the dialog.
|
|
23
|
-
* @event {{ detail: { format: string; manualFormat: boolean; transformations: Transformation[] } }} cx-asset-transformation-dialog-confirm - Emitted when the user saves, with the resolved proxy id, whether that id was picked by hand
|
|
23
|
+
* @event {{ detail: { aspectRatio?: number; format: string; manualFormat: boolean; transformations: Transformation[] } }} cx-asset-transformation-dialog-confirm - Emitted when the user saves, with the applied image ratio, resolved proxy id, whether that id was picked by hand, and the transformation array.
|
|
24
24
|
* @event cx-asset-transformation-dialog-delete - Emitted when the user resets the format to its default and clears the saved transformations via the reset button.
|
|
25
25
|
*/
|
|
26
26
|
export default class CxAssetTransformationDialog extends CortexElement {
|
|
@@ -91,6 +91,10 @@ export default class CxAssetTransformationDialog extends CortexElement {
|
|
|
91
91
|
private proxies;
|
|
92
92
|
/** False while the authorization check is in flight or after it confirms no access. */
|
|
93
93
|
private canAccess;
|
|
94
|
+
private saving;
|
|
95
|
+
/** Seeds one editing session; subsequent Apply changes belong to the child. */
|
|
96
|
+
private initialDraft;
|
|
97
|
+
private editSession;
|
|
94
98
|
/**
|
|
95
99
|
* Whether the author changed anything away from the block's defaults, which is what the
|
|
96
100
|
* Reset control acts on.
|
|
@@ -5,7 +5,7 @@ import { Transformation } from '../../../../../types/src/asset-link-format';
|
|
|
5
5
|
import { TeamSpace } from '../../../../../types/src/content-builder';
|
|
6
6
|
import { ContentType } from '../../../../../types/src/gallery';
|
|
7
7
|
import { HighlightableElementContentPosition } from '../../../../../types/src/highlightable-element';
|
|
8
|
-
import { TemplateResult } from 'lit';
|
|
8
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @summary Images are wrappers for img elements with built-in lazy loading, skeleton, and fallback support.
|
|
@@ -25,7 +25,7 @@ import { TemplateResult } from 'lit';
|
|
|
25
25
|
* @cssproperty --border-radius - The border-radius of the image.
|
|
26
26
|
* @cssproperty --border - The border of the image.
|
|
27
27
|
*
|
|
28
|
-
* @event cx-load - Emitted
|
|
28
|
+
* @event cx-load - Emitted on each successful image load, including subsequent srcset candidate loads. May fire multiple times for the same block.
|
|
29
29
|
* @event cx-error - Emitted when the image has failed to load.
|
|
30
30
|
* @event cx-image-zoom-open - Emitted when the image zoom is opened.
|
|
31
31
|
* @event cx-image-zoom-close - Emitted when the image zoom is closed.
|
|
@@ -96,6 +96,8 @@ export default class CxSbImage extends CxImage {
|
|
|
96
96
|
manualFormat: boolean;
|
|
97
97
|
/** Whether `formatDarkMode` was picked by hand. See `manualFormat`. */
|
|
98
98
|
manualFormatDarkMode: boolean;
|
|
99
|
+
/** Saved intrinsic width / height for the dark image. */
|
|
100
|
+
aspectRatioDarkMode: number;
|
|
99
101
|
/**
|
|
100
102
|
* Asset transformations applied to the image.
|
|
101
103
|
*/
|
|
@@ -155,6 +157,7 @@ export default class CxSbImage extends CxImage {
|
|
|
155
157
|
* delivery URL from the `path_*` fields here rather than searching for one.
|
|
156
158
|
*/
|
|
157
159
|
fetchedAssetData: Record<string, unknown>;
|
|
160
|
+
private renderedImageSrc;
|
|
158
161
|
/**
|
|
159
162
|
* Indicates whether the image is currently zoomed.
|
|
160
163
|
*/
|
|
@@ -221,7 +224,7 @@ export default class CxSbImage extends CxImage {
|
|
|
221
224
|
* getters key off this single predicate so alt, recordId, transformations and
|
|
222
225
|
* click handlers stay aligned with whichever image is actually being displayed.
|
|
223
226
|
*/
|
|
224
|
-
|
|
227
|
+
get useDarkVariant(): boolean;
|
|
225
228
|
get currentAltValue(): string;
|
|
226
229
|
get currentRecordId(): string;
|
|
227
230
|
get currentSrc(): string;
|
|
@@ -274,6 +277,7 @@ export default class CxSbImage extends CxImage {
|
|
|
274
277
|
image: boolean;
|
|
275
278
|
'image--hidden': boolean;
|
|
276
279
|
};
|
|
280
|
+
protected get currentAspectRatio(): number;
|
|
277
281
|
/**
|
|
278
282
|
* Whether the image have zoom action.
|
|
279
283
|
*/
|
|
@@ -302,6 +306,8 @@ export default class CxSbImage extends CxImage {
|
|
|
302
306
|
*/
|
|
303
307
|
handleRecordIdChangeForExtension(): void;
|
|
304
308
|
handleFetchedAssetDataChange(): void;
|
|
309
|
+
protected update(changedProps: PropertyValues): void;
|
|
310
|
+
protected handleLoad(event: Event): void;
|
|
305
311
|
/**
|
|
306
312
|
* Support CMS5 click action for the image.
|
|
307
313
|
*/
|
|
@@ -356,6 +362,7 @@ export default class CxSbImage extends CxImage {
|
|
|
356
362
|
*/
|
|
357
363
|
private recoverExpiredSources;
|
|
358
364
|
private recoverExpiredSource;
|
|
365
|
+
private get renderedSrc();
|
|
359
366
|
protected renderContent(): TemplateResult;
|
|
360
367
|
render(): TemplateResult;
|
|
361
368
|
}
|
|
@@ -16,7 +16,7 @@ type Attribute = {
|
|
|
16
16
|
};
|
|
17
17
|
declare const _default: {
|
|
18
18
|
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attribute>>;
|
|
19
|
-
defaultValue: Attribute
|
|
19
|
+
defaultValue: Partial<Attribute>;
|
|
20
20
|
stylable: string[];
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -5,6 +5,8 @@ import { default as CxImage } from '../blocks/image/image';
|
|
|
5
5
|
type Attribute = {
|
|
6
6
|
'additional-fields': string;
|
|
7
7
|
'alt-source-field': CxImage['altSourceField'];
|
|
8
|
+
'aspect-ratio': CxImage['aspectRatio'];
|
|
9
|
+
'aspect-ratio-dark-mode': CxImage['aspectRatioDarkMode'];
|
|
8
10
|
'click-action': CxImage['clickAction'];
|
|
9
11
|
'click-link'?: CxImage['clickLink'];
|
|
10
12
|
'click-page'?: CxImage['clickPage'];
|
|
@@ -310,6 +310,8 @@ export default class ConfigsController {
|
|
|
310
310
|
}>[] | import('../../../types/src/content-builder').PropertyConfig<{
|
|
311
311
|
'additional-fields': string;
|
|
312
312
|
'alt-source-field': import('./blocks/image/image').default["altSourceField"];
|
|
313
|
+
'aspect-ratio': import('./blocks/image/image').default["aspectRatio"];
|
|
314
|
+
'aspect-ratio-dark-mode': import('./blocks/image/image').default["aspectRatioDarkMode"];
|
|
313
315
|
'click-action': import('./blocks/image/image').default["clickAction"];
|
|
314
316
|
'click-link'?: import('./blocks/image/image').default["clickLink"];
|
|
315
317
|
'click-page'?: import('./blocks/image/image').default["clickPage"];
|
|
@@ -704,6 +706,17 @@ export default class ConfigsController {
|
|
|
704
706
|
variant: import('../../../types/src/gallery').GalleryVariant;
|
|
705
707
|
width: string;
|
|
706
708
|
'zoom-style': import('../../../types/src/highlightable-element').HighlightableElementZoomStyle;
|
|
709
|
+
}> | Partial<{
|
|
710
|
+
alignment: import('../../../types/src/header').Alignment;
|
|
711
|
+
'custom-line-height': boolean;
|
|
712
|
+
'data-constraints': boolean;
|
|
713
|
+
'disabled-copy-button': boolean;
|
|
714
|
+
'font-size': string;
|
|
715
|
+
'font-size-desktop': string;
|
|
716
|
+
'font-size-tablet': string;
|
|
717
|
+
'has-anchor-link': boolean;
|
|
718
|
+
role: string;
|
|
719
|
+
variant: import('../../../types/src/header').Variant;
|
|
707
720
|
}> | {
|
|
708
721
|
name: string;
|
|
709
722
|
'page-id': string;
|
|
@@ -55,6 +55,7 @@ export default class StyleController {
|
|
|
55
55
|
versionLabelKey?: string;
|
|
56
56
|
};
|
|
57
57
|
assetTransformationConfigs?: {
|
|
58
|
+
aspectRatioKey?: string;
|
|
58
59
|
assetIdKey?: string;
|
|
59
60
|
defaultFormat?: string;
|
|
60
61
|
dialogLabel?: string;
|
|
@@ -144,6 +145,7 @@ export default class StyleController {
|
|
|
144
145
|
multiple?: boolean;
|
|
145
146
|
pickerConfigs?: {
|
|
146
147
|
accepts?: string[];
|
|
148
|
+
aspectRatioKey?: string;
|
|
147
149
|
defaultFormat?: string;
|
|
148
150
|
multiple?: boolean;
|
|
149
151
|
nameKey?: string;
|
|
@@ -157,6 +157,12 @@ export declare class ControlRenderer {
|
|
|
157
157
|
* `cx-asset-transformation-dialog`.
|
|
158
158
|
*/
|
|
159
159
|
private resolveAssetFormatSrc;
|
|
160
|
+
/** Resolves the URL and intrinsic ratio from the same selected media field. */
|
|
161
|
+
resolveAssetFormat(recordId: string, format: string): Promise<{
|
|
162
|
+
aspectRatio: number;
|
|
163
|
+
src: string;
|
|
164
|
+
}>;
|
|
165
|
+
private getResolvedImage;
|
|
160
166
|
renderControl({ blockAttributes, container, currentValue, disabled, handleChange, key, label, trait, }: {
|
|
161
167
|
blockAttributes: Record<string, any>;
|
|
162
168
|
container?: Ref<HTMLElement>;
|
|
@@ -65,6 +65,8 @@ export type PropertyConfig<T = Record<string, any>> = Omit<TraitProperties, 'opt
|
|
|
65
65
|
versionLabelKey?: string;
|
|
66
66
|
};
|
|
67
67
|
assetTransformationConfigs?: {
|
|
68
|
+
/** Attribute that stores the transformed image's width / height. */
|
|
69
|
+
aspectRatioKey?: string;
|
|
68
70
|
assetIdKey?: string;
|
|
69
71
|
defaultFormat?: string;
|
|
70
72
|
dialogLabel?: string;
|
|
@@ -185,6 +187,8 @@ export type PropertyConfig<T = Record<string, any>> = Omit<TraitProperties, 'opt
|
|
|
185
187
|
options?: Option[];
|
|
186
188
|
pickerConfigs?: {
|
|
187
189
|
accepts?: string[];
|
|
190
|
+
/** Attribute that stores the selected image's width / height. */
|
|
191
|
+
aspectRatioKey?: string;
|
|
188
192
|
/** The format code used to resolve a preview src immediately after picking an image (before the user configures a format). */
|
|
189
193
|
defaultFormat?: string;
|
|
190
194
|
multiple?: boolean;
|
|
@@ -400,8 +404,6 @@ export declare enum DataSourceId {
|
|
|
400
404
|
TranslatableTexts = "TRANSLATABLE_TEXTS"
|
|
401
405
|
}
|
|
402
406
|
export type ConfigsOptions = {
|
|
403
|
-
enableAssetFormatControls?: boolean;
|
|
404
|
-
enableFontFamilyControls?: boolean;
|
|
405
407
|
/**
|
|
406
408
|
* Variants of the font the block's container resolves for it — a font kit's
|
|
407
409
|
* rows. Present means the block sits inside such a container, so its font
|
|
@@ -409,6 +411,8 @@ export type ConfigsOptions = {
|
|
|
409
411
|
* styles, and writes every other option explicitly.
|
|
410
412
|
*/
|
|
411
413
|
containerFontVariants?: FontFamily[];
|
|
414
|
+
enableAssetFormatControls?: boolean;
|
|
415
|
+
enableFontFamilyControls?: boolean;
|
|
412
416
|
};
|
|
413
417
|
/**
|
|
414
418
|
* Well-known editable sections of a content-builder canvas. The page content is the implicit
|
|
@@ -1038,6 +1038,7 @@ export interface Translation extends DefaultTranslation {
|
|
|
1038
1038
|
specialCharacters: string;
|
|
1039
1039
|
specialCharactersEmpty: string;
|
|
1040
1040
|
specificWidthInPixelsOrPercentage: string;
|
|
1041
|
+
specifiedWidthAsPercentageOfContainer: string;
|
|
1041
1042
|
specifiedWidthInPixels: string;
|
|
1042
1043
|
speed: string;
|
|
1043
1044
|
spellcheck: string;
|
|
@@ -2914,6 +2914,10 @@
|
|
|
2914
2914
|
* The path to the image to load.
|
|
2915
2915
|
*/
|
|
2916
2916
|
src?: string;
|
|
2917
|
+
/**
|
|
2918
|
+
* Intrinsic width / height used to reserve space while loading with Height Auto. <br/>@defaultValue 0
|
|
2919
|
+
*/
|
|
2920
|
+
aspectRatio?: number;
|
|
2917
2921
|
/**
|
|
2918
2922
|
* Candidate sources for the underlying `img`, as a standard `srcset` value (e.g. `"…/re_w_400/img.jpg 400w, …/re_w_800/img.jpg 800w"`). <br/> Lets the browser fetch and decode only the pixels the layout needs, which is what bounds memory on image-heavy pages — a large original decodes to `naturalWidth × naturalHeight × 4` bytes regardless of its display size. Pair with `sizes`; without it the browser assumes the image is `100vw` wide.
|
|
2919
2923
|
*/
|
package/library/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ import { R as Et, f as It, g as Lt, h as Ft, U as Rt, a as Ot, d as vt, c as bt,
|
|
|
3
3
|
import { e as Yt, f as Pt, g as Wt, c as Xt, i as Ht, a as Bt, d as Gt, m as $t, b as zt, r as qt, t as Qt } from "./chunks/toast.D3AW3RWv.js";
|
|
4
4
|
import { e as Zt, a as Jt, f as Kt, g as te, d as ee, b as re, c as ae, i as se, p as oe, s as ne } from "./chunks/browser.BHOCIF_A.js";
|
|
5
5
|
import { k as le, e as ce, m as ue, H as fe, R as me, d as he, o as ge, g as de, f as pe, n as De, h as Te, l as Se, i as we, p as Me, j as ye } from "./chunks/color.CIHdfM_a.js";
|
|
6
|
-
import { a as
|
|
6
|
+
import { a as Ce, g as xe } from "./chunks/active-elements.jTVWtBDp.js";
|
|
7
7
|
import { a as Ie, p as Le, c as Fe, b as Re, s as Oe, w as ve } from "./chunks/event.BeKOsirN.js";
|
|
8
8
|
import { t as Ve } from "./chunks/converters.DkDtLstb.js";
|
|
9
9
|
import { c as ke } from "./chunks/custom-element.L4WJXn1j.js";
|
|
@@ -13,12 +13,12 @@ import { d as Xe } from "./chunks/drag.DenOh3AE.js";
|
|
|
13
13
|
import { f as Be } from "./chunks/focus-when-visible.jWSw9ks0.js";
|
|
14
14
|
import { f as U } from "./chunks/form.LpappO1d.js";
|
|
15
15
|
import { F as $e, c as ze, g as qe, v as Qe, a as je } from "./chunks/form.LpappO1d.js";
|
|
16
|
-
import { L as Je, r as Ke } from "./chunks/i18n.
|
|
16
|
+
import { L as Je, r as Ke } from "./chunks/i18n.BSPmBQ73.js";
|
|
17
17
|
import { c as er, q as rr } from "./chunks/math.DuKzLacZ.js";
|
|
18
18
|
import { g as sr } from "./chunks/modal.Ct0bJBSe.js";
|
|
19
19
|
import { g as nr, l as ir, s as lr, u as cr } from "./chunks/scroll.xtO5yojm.js";
|
|
20
|
-
import { k as
|
|
21
|
-
import { c as fr, d as mr, h as hr, m as gr, a as dr, g as pr, j as Dr, b as Tr, f as Sr, i as wr, e as Mr, l as yr, r as
|
|
20
|
+
import { k as A } from "./chunks/dom.D0lSUoEI.js";
|
|
21
|
+
import { c as fr, d as mr, h as hr, m as gr, a as dr, g as pr, j as Dr, b as Tr, f as Sr, i as wr, e as Mr, l as yr, r as Ar, s as Cr } from "./chunks/dom.D0lSUoEI.js";
|
|
22
22
|
import { H as Er, a as Ir, g as Lr } from "./chunks/slot.j5oheLJC.js";
|
|
23
23
|
import { a as Rr, g as Or } from "./chunks/tabbable.BwnZBHrm.js";
|
|
24
24
|
import { i as br } from "./chunks/user-agent.D9aPuOyL.js";
|
|
@@ -27,20 +27,20 @@ import { C as Nr } from "./chunks/calendar-grid.BWjcZL5W.js";
|
|
|
27
27
|
import { b as Yr, c as Pr, f as Wr, h as Xr, g as Hr, a as Br, i as Gr, d as $r, n as zr, e as qr, p as Qr, t as jr } from "./chunks/date.iWq_pkIk.js";
|
|
28
28
|
import { f as c, a as u, D as f } from "./chunks/date-picker.BGHn6qg8.js";
|
|
29
29
|
import { A as Jr, g as Kr, j as ta, O as ea, S as ra, a as aa, h as sa, b as oa, e as na, d as ia, f as la, i as ca, k as ua, p as fa, r as ma, c as ha } from "./chunks/transformation.Dm-pK2ft.js";
|
|
30
|
-
import { M as da, c as pa, e as Da, i as Ta, n as Sa, p as wa, b as Ma, s as ya, d as
|
|
30
|
+
import { M as da, c as pa, e as Da, i as Ta, n as Sa, p as wa, b as Ma, s as ya, d as Aa } from "./chunks/gradient.CIzq8fOU.js";
|
|
31
31
|
import { c as xa, f as Ea, e as Ia, b as La, g as Fa, d as Ra, i as Oa, r as va, a as ba } from "./chunks/image.Y5c_hFx8.js";
|
|
32
32
|
import { b as _a, e as ka } from "./chunks/waveform.1U9U_0rd.js";
|
|
33
33
|
import { c as Ua, b as Ya, a as Pa, e as Wa, d as Xa, f as Ha, g as Ba, r as Ga, s as $a } from "./chunks/number.Cx2ncfJJ.js";
|
|
34
34
|
import { s as qa } from "./chunks/parse.Cu5nBDTb.js";
|
|
35
|
-
import {
|
|
36
|
-
import { b as
|
|
37
|
-
import { g as
|
|
38
|
-
import { c as
|
|
35
|
+
import { D as ja, g as Za, a as Ja } from "./chunks/responsive.DqF_v1XY.js";
|
|
36
|
+
import { b as ts, n as es, d as rs, e as as, f as ss, y as os, o as ns, g as is, h as ls, l as cs, p as us, z as fs, x as ms, a as hs, c as gs, s as ds, w as ps, r as Ds, t as Ts, q as Ss, v as ws, i as Ms, m as ys, u as As } from "./chunks/string.CfI2ejyR.js";
|
|
37
|
+
import { g as xs, a as Es } from "./chunks/template.ClovJacp.js";
|
|
38
|
+
import { c as Ls, f as Fs, a as Rs, g as Os } from "./chunks/time.DYWuX2id.js";
|
|
39
39
|
function n(t) {
|
|
40
40
|
const e = t.getFullYear(), r = String(t.getMonth() + 1).padStart(2, "0"), a = String(t.getDate()).padStart(2, "0");
|
|
41
41
|
return `${e}-${r}-${a}`;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function C(t) {
|
|
44
44
|
const e = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), a = String(t.getSeconds()).padStart(2, "0");
|
|
45
45
|
return `${e}:${r}:${a}`;
|
|
46
46
|
}
|
|
@@ -88,9 +88,9 @@ class Z {
|
|
|
88
88
|
const s = new Date(r.getTime() - 18e5);
|
|
89
89
|
return {
|
|
90
90
|
fromDate: n(s),
|
|
91
|
-
fromTime:
|
|
91
|
+
fromTime: C(s),
|
|
92
92
|
toDate: a,
|
|
93
|
-
toTime:
|
|
93
|
+
toTime: C(r)
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
case c.today:
|
|
@@ -291,14 +291,14 @@ function at(t, e) {
|
|
|
291
291
|
}
|
|
292
292
|
class st {
|
|
293
293
|
constructor(e) {
|
|
294
|
-
this.currentZIndex =
|
|
294
|
+
this.currentZIndex = A(), (this.host = e).addController(this);
|
|
295
295
|
}
|
|
296
296
|
hostConnected() {
|
|
297
297
|
}
|
|
298
298
|
hostDisconnected() {
|
|
299
299
|
}
|
|
300
300
|
async activatePopup() {
|
|
301
|
-
this.currentZIndex =
|
|
301
|
+
this.currentZIndex = A();
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
class ot {
|
|
@@ -587,7 +587,7 @@ async function* yt({
|
|
|
587
587
|
} catch {
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function At({
|
|
591
591
|
duration: t,
|
|
592
592
|
frameWidth: e,
|
|
593
593
|
playbackSpeed: r,
|
|
@@ -604,6 +604,7 @@ export {
|
|
|
604
604
|
Nr as CalendarGrid,
|
|
605
605
|
ce as ColorType,
|
|
606
606
|
st as CortexPopupController,
|
|
607
|
+
ja as DEFAULT_BREAKPOINTS,
|
|
607
608
|
Z as DateRangePresets,
|
|
608
609
|
ot as DragScroll,
|
|
609
610
|
$e as FormControlController,
|
|
@@ -623,7 +624,7 @@ export {
|
|
|
623
624
|
Lt as URL_INTRANET_DOMAIN_VALIDATION_REGEX,
|
|
624
625
|
Ft as URL_PROTOCOL_VALIDATION_REGEX,
|
|
625
626
|
Rt as URL_VALIDATION_REGEX,
|
|
626
|
-
|
|
627
|
+
Ce as activeElements,
|
|
627
628
|
Yr as addMonths,
|
|
628
629
|
Yt as adjustRelativeValues,
|
|
629
630
|
Ie as animateTo,
|
|
@@ -638,7 +639,7 @@ export {
|
|
|
638
639
|
xa as calculateAspectRatioFit,
|
|
639
640
|
er as clamp,
|
|
640
641
|
Ea as cleanImageFileName,
|
|
641
|
-
|
|
642
|
+
Ls as clearZeroDurationParts,
|
|
642
643
|
he as convertColor,
|
|
643
644
|
Ua as convertDataUnits,
|
|
644
645
|
Ya as convertDurationToMilliseconds,
|
|
@@ -653,12 +654,12 @@ export {
|
|
|
653
654
|
Pe as defaultValue,
|
|
654
655
|
at as downloadAsset,
|
|
655
656
|
Xe as drag,
|
|
656
|
-
|
|
657
|
-
|
|
657
|
+
ts as emptyToSpace,
|
|
658
|
+
es as escapeXML,
|
|
658
659
|
ge as extractColor,
|
|
659
|
-
|
|
660
|
+
rs as extractExtension,
|
|
660
661
|
yt as extractFrames,
|
|
661
|
-
|
|
662
|
+
as as extractRootData,
|
|
662
663
|
Wa as extractValueAndUnit,
|
|
663
664
|
ka as extractWaveformPeaks,
|
|
664
665
|
la as fetchCortexApi,
|
|
@@ -671,47 +672,47 @@ export {
|
|
|
671
672
|
U as formCollections,
|
|
672
673
|
Xa as formatAspectRatioString,
|
|
673
674
|
de as formatColorCodeSeparator,
|
|
674
|
-
|
|
675
|
+
Fs as formatDurationPartsManually,
|
|
675
676
|
pe as formatHexCode,
|
|
676
677
|
Pr as formatIsoToDisplay,
|
|
677
678
|
Wr as formatMonthYearLabel,
|
|
678
679
|
Ha as formatNumberWithGrouping,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
680
|
+
ss as formatSecondsToTime,
|
|
681
|
+
os as formatTimeToSeconds,
|
|
682
|
+
Rs as formatWithIntlDurationFormat,
|
|
682
683
|
Ba as gcd,
|
|
683
684
|
mr as getActiveElement,
|
|
684
685
|
sr as getActiveModals,
|
|
685
686
|
qe as getAssociatedForm,
|
|
686
687
|
hr as getAttributes,
|
|
687
|
-
|
|
688
|
-
|
|
688
|
+
ns as getAttributesString,
|
|
689
|
+
Za as getBreakpointsFromCSS,
|
|
689
690
|
ut as getBrowserFontVariants,
|
|
690
691
|
De as getColorType,
|
|
691
692
|
Fa as getContainedImageSize,
|
|
692
693
|
gr as getCortexPopupLayer,
|
|
693
|
-
|
|
694
|
+
A as getCurrentZIndex,
|
|
694
695
|
Xr as getDateMask,
|
|
695
696
|
xe as getDeepestActiveElement,
|
|
696
|
-
|
|
697
|
-
|
|
697
|
+
Ja as getDeviceType,
|
|
698
|
+
Os as getDurationPartsByUnitsFormat,
|
|
698
699
|
dr as getElementFromHTMLString,
|
|
699
700
|
pr as getElementFromTemplate,
|
|
700
701
|
Hr as getFirstDayOfWeek,
|
|
701
702
|
lt as getFontFamilyOptionValue,
|
|
702
703
|
ft as getFontFamilyVariants,
|
|
703
704
|
X as getFormControls,
|
|
704
|
-
|
|
705
|
-
|
|
705
|
+
xs as getHighlightedTitle,
|
|
706
|
+
Es as getHighlightedTitleHtml,
|
|
706
707
|
Ir as getInnerHTML,
|
|
707
|
-
|
|
708
|
+
At as getInterval,
|
|
708
709
|
Te as getLightDarkCssString,
|
|
709
710
|
Ra as getNaturalWidthHeight,
|
|
710
711
|
Dr as getNeededPaddingForBoxShadow,
|
|
711
712
|
te as getNextAncestor,
|
|
712
713
|
nr as getOffset,
|
|
713
714
|
Tr as getRelativeClickPercentage,
|
|
714
|
-
|
|
715
|
+
is as getRootIDString,
|
|
715
716
|
Rr as getTabbableBoundary,
|
|
716
717
|
Or as getTabbableElements,
|
|
717
718
|
Lr as getTextContent,
|
|
@@ -719,7 +720,7 @@ export {
|
|
|
719
720
|
it as getTypefaceOptionValue,
|
|
720
721
|
Wt as groupBy,
|
|
721
722
|
ca as hasTransformSegment,
|
|
722
|
-
|
|
723
|
+
ls as htmlToPlainText,
|
|
723
724
|
Xt as insertAtIndex,
|
|
724
725
|
Mt as insertFrameToCache,
|
|
725
726
|
Ht as insertMultipleAtIndex,
|
|
@@ -732,7 +733,7 @@ export {
|
|
|
732
733
|
re as isFirefox,
|
|
733
734
|
ct as isFontFamilyAvailable,
|
|
734
735
|
ht as isFormInteracted,
|
|
735
|
-
|
|
736
|
+
cs as isGalleryItemCardType,
|
|
736
737
|
Ta as isGradientString,
|
|
737
738
|
ae as isIOS,
|
|
738
739
|
Mr as isInElement,
|
|
@@ -756,8 +757,8 @@ export {
|
|
|
756
757
|
K as openAssetOverview,
|
|
757
758
|
tt as openFolderOverview,
|
|
758
759
|
et as openLink,
|
|
759
|
-
|
|
760
|
-
|
|
760
|
+
us as padPath,
|
|
761
|
+
fs as parseBooleanString,
|
|
761
762
|
we as parseBorder,
|
|
762
763
|
qr as parseDisplayToIso,
|
|
763
764
|
Le as parseDuration,
|
|
@@ -775,8 +776,8 @@ export {
|
|
|
775
776
|
rr as quantizeLargestRemainder,
|
|
776
777
|
Y as quoteFontFamily,
|
|
777
778
|
St as readLocalStorageValue,
|
|
778
|
-
|
|
779
|
-
|
|
779
|
+
Ar as readSearchConsistency,
|
|
780
|
+
ms as reducePathToDirectChild,
|
|
780
781
|
Ke as registerTranslation,
|
|
781
782
|
zt as removeAtIndex,
|
|
782
783
|
qt as removeMultipleAtIndex,
|
|
@@ -786,38 +787,38 @@ export {
|
|
|
786
787
|
_t as resolveSpaceUrl,
|
|
787
788
|
Ga as rotateBox,
|
|
788
789
|
ba as rotateImage,
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
hs as safeExtension,
|
|
791
|
+
gs as safeString,
|
|
792
|
+
ds as sanitizeHTML,
|
|
792
793
|
$a as sanitizeRotation,
|
|
793
794
|
lr as scrollIntoView,
|
|
794
795
|
mt as serialize,
|
|
795
796
|
Ma as serializeGradient,
|
|
796
797
|
rt as shareAsset,
|
|
797
798
|
Re as shimKeyframesHeightAuto,
|
|
798
|
-
|
|
799
|
+
Cr as sortByTopPosition,
|
|
799
800
|
ya as sortStops,
|
|
800
801
|
_ as sortTypefaceVariants,
|
|
801
802
|
qa as splitBoxValues,
|
|
802
|
-
|
|
803
|
-
|
|
803
|
+
ps as splitCamelCaseFormatted,
|
|
804
|
+
Aa as splitTopLevel,
|
|
804
805
|
Oe as stopAnimations,
|
|
805
806
|
ne as supportHLS,
|
|
806
807
|
V as testFontAvailability,
|
|
807
808
|
Ve as timecodeConverter,
|
|
808
|
-
|
|
809
|
+
Ds as toCamelCase,
|
|
809
810
|
jr as toIsoDate,
|
|
810
|
-
|
|
811
|
-
|
|
811
|
+
Ts as toKebabCase,
|
|
812
|
+
Ss as toPascalCase,
|
|
812
813
|
kt as toRelativeUrl,
|
|
813
|
-
|
|
814
|
+
ws as toTitleCase,
|
|
814
815
|
Nt as toUrlPathKey,
|
|
815
816
|
Qt as toast,
|
|
816
|
-
|
|
817
|
-
|
|
817
|
+
Ms as truncateTextMiddle,
|
|
818
|
+
ys as unescapeXML,
|
|
818
819
|
cr as unlockBodyScrolling,
|
|
819
820
|
P as unquoteFontFamily,
|
|
820
|
-
|
|
821
|
+
As as upperFirst,
|
|
821
822
|
Qe as validValidityState,
|
|
822
823
|
je as valueMissingValidityState,
|
|
823
824
|
ve as waitForEvent,
|