@orangelogic/design-system 2.96.0 → 2.97.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.B3vySOI-.js +431 -0
- package/library/chunks/{asset.types.6DCzTOQm.js → asset.types.KXRZEtBr.js} +127 -126
- package/library/chunks/{button.BZjbVq8t.js → button.CAa1kvwe.js} +2 -2
- package/library/chunks/{color-swatch-group.CKHEL4hJ.js → color-swatch-group.ChcPlkPU.js} +5 -5
- package/library/chunks/{color-swatch.CbL_TpRZ.js → color-swatch.DJ1kUnBQ.js} +1 -1
- package/library/chunks/{confirm-popover.bBo9aPlX.js → confirm-popover.D4x0nO5g.js} +3 -3
- package/library/chunks/content-builder.CcgZciZN.js +58 -0
- package/library/chunks/{cropper.uKGcvnPk.js → cropper.Bib8Abm3.js} +4937 -4932
- package/library/chunks/{dialog.DRW8iwh-.js → dialog.BLaxLMSc.js} +2 -2
- package/library/chunks/{dom.DURaLV1d.js → dom.0RpWet6y.js} +1 -1
- package/library/chunks/{dot-pagination.CvUr6R4S.js → dot-pagination.-nDdQxJN.js} +1 -1
- package/library/chunks/{file-on-demand.KQlA1JFF.js → file-on-demand.AzwoUvwB.js} +10 -10
- package/library/chunks/{folder-select.DxBOSyvo.js → folder-select.XpkOFzAW.js} +5 -5
- package/library/chunks/{form.nRqYei4e.js → form.Ch1cwYzO.js} +1 -1
- package/library/chunks/{header.ClxEkQPZ.js → header.BZxyeLPK.js} +1 -1
- package/library/chunks/{i18n.W6czbRms.js → i18n.BABe9hN4.js} +6 -0
- package/library/chunks/{icon-button.MqA-pNw8.js → icon-button.C2s3pHG4.js} +1 -1
- package/library/chunks/{iframe.PcSPtm_O.js → iframe.DPccxsnE.js} +1 -1
- package/library/chunks/{image.Dtdklw5q.js → image.9qwbjGNb.js} +1 -1
- package/library/chunks/{image.C-Covc0H.js → image.Cc4V85ID.js} +354 -311
- package/library/chunks/{list-editor.De7nc_Wd.js → list-editor.pVYc_70c.js} +183 -153
- package/library/chunks/{number.CCF6IxpN.js → number.B4PQLJIg.js} +32 -32
- package/library/chunks/{option.Cx54zrJq.js → option.DGXQzdtb.js} +1 -1
- package/library/chunks/{pagination.CG5odPWi.js → pagination.DZqKSA86.js} +4 -4
- package/library/chunks/{responsive.D9TUCX5p.js → responsive.Oz9HWjyQ.js} +1 -1
- package/library/chunks/{string.DfV21HEI.js → string.DUgD4c9f.js} +41 -34
- package/library/chunks/{tab-group.BLZ-qEpp.js → tab-group.BhCf9Smq.js} +4 -4
- package/library/chunks/{table.Cr0s-nqe.js → table.V5PGGTfO.js} +11 -10
- package/library/chunks/{time.BNrE47-8.js → time.BiQnh9wt.js} +1 -1
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.Cqz3hPaQ.js +144 -0
- package/library/chunks/{tree.CKi63r95.js → tree.DZa7k-4E.js} +1 -1
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +767 -862
- package/library/components/atoms.js +12 -12
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +3 -3
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +6 -6
- package/library/components/color-swatch.js +2 -2
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +1 -1
- package/library/components/details.js +4 -4
- package/library/components/dialog.js +3 -3
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +1 -1
- 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 +11 -11
- 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 +2 -2
- package/library/components/header.js +2 -2
- 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 +2 -2
- package/library/components/input.js +4 -7
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +6 -6
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +5 -5
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +5 -5
- 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/radio-group.js +1 -1
- package/library/components/range.js +2 -2
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +3 -3
- package/library/components/share-option-list.js +2 -2
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +2 -2
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/table.js +5 -5
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- 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 +31066 -29848
- package/library/components/video.js +554 -545
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +15 -1
- package/library/packages/atoms/src/components/input/input.d.ts +1 -2
- package/library/packages/atoms/src/components/video/video.d.ts +3 -1
- package/library/packages/events/src/cx-asset-format-picker-delete.d.ts +6 -0
- package/library/packages/events/src/cx-asset-format-picker-select.d.ts +8 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
- package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
- package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
- package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
- package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
- package/library/packages/events/src/cx-timeline-data-resolved.d.ts +10 -0
- package/library/packages/events/src/cx-video-thumbnail-resolved.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +12 -1
- package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +56 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.styles.d.ts +2 -0
- package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +7 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
- package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +5 -1
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/timeline/timeline.d.ts +18 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +12 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +102 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
- package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +3 -1
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +2 -2
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
- package/library/packages/organisms/src/content-builder/styleController.d.ts +26 -1
- package/library/packages/organisms/src/index.d.ts +2 -0
- package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
- package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
- package/library/packages/services/src/api/asset/asset.d.ts +2 -2
- package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
- package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +19 -5
- package/library/packages/types/src/asset-click-action.d.ts +3 -1
- package/library/packages/types/src/asset-format-picker.d.ts +11 -0
- package/library/packages/types/src/bento-grid.d.ts +37 -0
- package/library/packages/types/src/content-builder.d.ts +37 -1
- package/library/packages/types/src/gallery.d.ts +0 -6
- package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
- package/library/packages/utils/src/index.d.ts +1 -0
- package/library/packages/utils/src/string/string.d.ts +1 -0
- package/library/packages/utils/src/transformation/index.d.ts +1 -0
- package/library/react-web-component.d.ts +236 -8
- package/library/utils.js +517 -192
- package/package.json +1 -1
- package/library/chunks/asset.Duzr3O3z.js +0 -370
- package/library/chunks/index.BgXEXk4m.js +0 -398
- package/library/chunks/toast.Bc4wpYJ1.js +0 -150
- /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
package/library/package.json
CHANGED
|
@@ -29,7 +29,7 @@ import { default as CxSpace } from '../space/space';
|
|
|
29
29
|
* @cssproperty --border - The border of the image.
|
|
30
30
|
*
|
|
31
31
|
* @event cx-load - Emitted when the image has loaded.
|
|
32
|
-
* @event cx-error - Emitted when the image has failed to load.
|
|
32
|
+
* @event cx-error - Emitted when the image has failed to load (after all retry attempts when `retry-on-error` is enabled).
|
|
33
33
|
* @event cx-image-zoom-open - Emitted when the image zoom is opened.
|
|
34
34
|
* @event cx-image-zoom-close - Emitted when the image zoom is closed.
|
|
35
35
|
*
|
|
@@ -49,8 +49,12 @@ export default class CxImage extends ResizableElement {
|
|
|
49
49
|
imageElement?: HTMLImageElement;
|
|
50
50
|
zoomImageElement: HTMLImageElement;
|
|
51
51
|
highlighterElement: HTMLDivElement;
|
|
52
|
+
private _retryCount;
|
|
53
|
+
private _retryTimer;
|
|
52
54
|
isLoaded: boolean;
|
|
53
55
|
isError: boolean;
|
|
56
|
+
/** Incremented on each retry attempt to force the img element to remount via keyed(). */
|
|
57
|
+
private _retryIndex;
|
|
54
58
|
/**
|
|
55
59
|
* The path to the image to load.
|
|
56
60
|
*/
|
|
@@ -97,6 +101,14 @@ export default class CxImage extends ResizableElement {
|
|
|
97
101
|
* - manual: The click handler is manually handled by the parent element.
|
|
98
102
|
*/
|
|
99
103
|
clickHandlerType: ClickHandlerType;
|
|
104
|
+
/**
|
|
105
|
+
* When true, automatically retries loading the image on error before showing the fallback.
|
|
106
|
+
*/
|
|
107
|
+
retryOnError: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Maximum number of retry attempts when `retry-on-error` is enabled.
|
|
110
|
+
*/
|
|
111
|
+
maxRetries: number;
|
|
100
112
|
/**
|
|
101
113
|
* Indicates whether the image is currently zoomed.
|
|
102
114
|
*/
|
|
@@ -145,6 +157,8 @@ export default class CxImage extends ResizableElement {
|
|
|
145
157
|
handleCanZoomChange(): Promise<void>;
|
|
146
158
|
handleObjectFitChange(): Promise<void>;
|
|
147
159
|
handleSrcChange(): void;
|
|
160
|
+
private clearRetryTimer;
|
|
161
|
+
private scheduleRetry;
|
|
148
162
|
private initZoom;
|
|
149
163
|
protected handleLoad(event: Event): void;
|
|
150
164
|
protected handleError(): void;
|
|
@@ -205,8 +205,7 @@ export default class CxInput extends CortexElement implements CortexFormControl
|
|
|
205
205
|
/** Gets the validation message */
|
|
206
206
|
get validationMessage(): string;
|
|
207
207
|
constructor();
|
|
208
|
-
|
|
209
|
-
runFirstUpdated(): void;
|
|
208
|
+
connectedUpdatedCallback(): void;
|
|
210
209
|
disconnectedCallback(): void;
|
|
211
210
|
initMaskInstance(): Promise<void>;
|
|
212
211
|
private handleBlur;
|
|
@@ -96,6 +96,7 @@ export default class CxVideo extends ResizableElement {
|
|
|
96
96
|
videoHeight: number;
|
|
97
97
|
protected autoPlayTimeout: number | null;
|
|
98
98
|
parsedName: string;
|
|
99
|
+
formattedPoster: string;
|
|
99
100
|
/**
|
|
100
101
|
* The current time of the video.
|
|
101
102
|
*/
|
|
@@ -130,7 +131,7 @@ export default class CxVideo extends ResizableElement {
|
|
|
130
131
|
protected addVideoEventListeners(): void;
|
|
131
132
|
protected removeVideoEventListeners(): void;
|
|
132
133
|
attachSeekbar(): void;
|
|
133
|
-
protected setupVideoJsPlayer(): void
|
|
134
|
+
protected setupVideoJsPlayer(src?: string): Promise<void>;
|
|
134
135
|
handleLoopChange(): Promise<void>;
|
|
135
136
|
handleMutedChange(): Promise<void>;
|
|
136
137
|
handleControlsChange(): Promise<void>;
|
|
@@ -138,6 +139,7 @@ export default class CxVideo extends ResizableElement {
|
|
|
138
139
|
handleDisableRemotePlaybackChange(): Promise<void>;
|
|
139
140
|
handleDisableVolumePanelChange(): Promise<void>;
|
|
140
141
|
handlePosterChange(): Promise<void>;
|
|
142
|
+
handleFormattedPosterChange(): Promise<void>;
|
|
141
143
|
handleSrcChange(): Promise<void>;
|
|
142
144
|
handleParsedNameChange(): Promise<void>;
|
|
143
145
|
private handleSizeChange;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AssetFormatValue } from '../../types/src/asset-format-picker';
|
|
2
|
+
|
|
3
|
+
export type CxAssetFormatPickerSelectEvent = CustomEvent<AssetFormatValue>;
|
|
4
|
+
declare global {
|
|
5
|
+
interface GlobalEventHandlersEventMap {
|
|
6
|
+
'cx-asset-format-select': CxAssetFormatPickerSelectEvent;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Transformation } from '../../types/src/asset-link-format';
|
|
2
|
+
|
|
3
|
+
export type CxAssetTransformationDialogConfirmEvent = CustomEvent<{
|
|
4
|
+
format: string;
|
|
5
|
+
transformations: Transformation[];
|
|
6
|
+
}>;
|
|
7
|
+
declare global {
|
|
8
|
+
interface GlobalEventHandlersEventMap {
|
|
9
|
+
'cx-asset-transformation-dialog-confirm': CxAssetTransformationDialogConfirmEvent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Image } from '../../types/src/gallery-config';
|
|
2
|
+
|
|
3
|
+
export type CxContentBuilderGalleryFetchedEvent = CustomEvent<{
|
|
4
|
+
data: Image[];
|
|
5
|
+
}>;
|
|
6
|
+
declare global {
|
|
7
|
+
interface GlobalEventHandlersEventMap {
|
|
8
|
+
'cx-content-builder-gallery-fetched': CxContentBuilderGalleryFetchedEvent;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GalleryItem } from '../../types/src/gallery-item';
|
|
2
|
+
|
|
3
|
+
export type CxLightboxDownloadEvent = CustomEvent<{
|
|
4
|
+
index: number;
|
|
5
|
+
item: GalleryItem;
|
|
6
|
+
}>;
|
|
7
|
+
declare global {
|
|
8
|
+
interface GlobalEventHandlersEventMap {
|
|
9
|
+
'cx-lightbox-download': CxLightboxDownloadEvent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TimelineItem } from '../../types/src/timeline';
|
|
2
|
+
|
|
3
|
+
export type CxTimelineDataResolvedEvent = CustomEvent<{
|
|
4
|
+
data: TimelineItem[];
|
|
5
|
+
}>;
|
|
6
|
+
declare global {
|
|
7
|
+
interface GlobalEventHandlersEventMap {
|
|
8
|
+
'cx-timeline-data-resolved': CxTimelineDataResolvedEvent;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -14,6 +14,10 @@ export * from './cx-asset-data-display-slot-change';
|
|
|
14
14
|
export * from './cx-asset-picker-delete';
|
|
15
15
|
export * from './cx-asset-picker-select';
|
|
16
16
|
export * from './cx-asset-request-status';
|
|
17
|
+
export * from './cx-asset-transformation-dialog-cancel';
|
|
18
|
+
export * from './cx-asset-transformation-dialog-confirm';
|
|
19
|
+
export * from './cx-asset-transformation-dialog-delete';
|
|
20
|
+
export * from './cx-bento-range-change';
|
|
17
21
|
export * from './cx-bento-resize';
|
|
18
22
|
export * from './cx-bicolor-picker-change';
|
|
19
23
|
export * from './cx-blur';
|
|
@@ -21,8 +25,8 @@ export * from './cx-border-input-group-change';
|
|
|
21
25
|
export * from './cx-cancel';
|
|
22
26
|
export * from './cx-cancel-connection';
|
|
23
27
|
export * from './cx-cancel-upload';
|
|
24
|
-
export * from './cx-chart-plan-change';
|
|
25
28
|
export * from './cx-change';
|
|
29
|
+
export * from './cx-chart-plan-change';
|
|
26
30
|
export * from './cx-clear';
|
|
27
31
|
export * from './cx-clear-cache';
|
|
28
32
|
export * from './cx-clear-upload';
|
|
@@ -39,6 +43,7 @@ export * from './cx-comment-mention-select';
|
|
|
39
43
|
export * from './cx-connect';
|
|
40
44
|
export * from './cx-connected';
|
|
41
45
|
export * from './cx-content-builder-gallery-change';
|
|
46
|
+
export * from './cx-content-builder-gallery-fetched';
|
|
42
47
|
export * from './cx-content-builder-page-change';
|
|
43
48
|
export * from './cx-content-builder-page-delete';
|
|
44
49
|
export * from './cx-content-builder-translatable-value-change';
|
|
@@ -53,6 +58,8 @@ export * from './cx-dot-status-click';
|
|
|
53
58
|
export * from './cx-download-format-picker-delete';
|
|
54
59
|
export * from './cx-download-format-picker-select';
|
|
55
60
|
export * from './cx-download-format-request-status';
|
|
61
|
+
export * from './cx-asset-format-picker-delete';
|
|
62
|
+
export * from './cx-asset-format-picker-select';
|
|
56
63
|
export * from './cx-drag-end';
|
|
57
64
|
export * from './cx-drag-start';
|
|
58
65
|
export * from './cx-e-chart-drill-down';
|
|
@@ -90,6 +97,8 @@ export * from './cx-invoked';
|
|
|
90
97
|
export * from './cx-keydown';
|
|
91
98
|
export * from './cx-lazy-change';
|
|
92
99
|
export * from './cx-lazy-load';
|
|
100
|
+
export * from './cx-lightbox-close';
|
|
101
|
+
export * from './cx-lightbox-download';
|
|
93
102
|
export * from './cx-link-request';
|
|
94
103
|
export * from './cx-list-editor-change';
|
|
95
104
|
export * from './cx-load';
|
|
@@ -137,6 +146,7 @@ export * from './cx-rich-text-video-save';
|
|
|
137
146
|
export * from './cx-save';
|
|
138
147
|
export * from './cx-save-settings';
|
|
139
148
|
export * from './cx-sb-button-click';
|
|
149
|
+
export * from './cx-video-thumbnail-resolved';
|
|
140
150
|
export * from './cx-search';
|
|
141
151
|
export * from './cx-select';
|
|
142
152
|
export * from './cx-selected-change';
|
|
@@ -156,6 +166,7 @@ export * from './cx-table-export';
|
|
|
156
166
|
export * from './cx-table-row-action-click';
|
|
157
167
|
export * from './cx-table-save-search-select';
|
|
158
168
|
export * from './cx-time-based-change';
|
|
169
|
+
export * from './cx-timeline-data-resolved';
|
|
159
170
|
export * from './cx-time-update';
|
|
160
171
|
export * from './cx-tiptap-code-block-doc-request';
|
|
161
172
|
export * from './cx-tiptap-image-doc-request';
|
|
@@ -29,6 +29,7 @@ export default class CxAssetDataDisplay extends CortexElement {
|
|
|
29
29
|
overlay: boolean;
|
|
30
30
|
position: AssetDataDisplayPosition;
|
|
31
31
|
fetchMode: AssetDataDisplayFetchMode;
|
|
32
|
+
token: string;
|
|
32
33
|
recordId: string;
|
|
33
34
|
headerSourceField: string;
|
|
34
35
|
detailsSourceField: string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { default as CxButton } from '../../../atoms/src/components/button/button.ts';
|
|
2
|
+
import { default as CxIconButton } from '../../../atoms/src/components/icon-button/icon-button.ts';
|
|
3
|
+
import { default as CxInput } from '../../../atoms/src/components/input/input.ts';
|
|
4
|
+
import { default as CxSpace } from '../../../atoms/src/components/space/space.ts';
|
|
5
|
+
import { default as CxTypography } from '../../../atoms/src/components/typography/typography.ts';
|
|
6
|
+
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
|
|
7
|
+
import { AssetFormatValue } from '../../../types/src/asset-format-picker';
|
|
8
|
+
import { CSSResultGroup } from 'lit';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @summary The `cx-asset-format-picker` component lets users choose and clear an asset display format.
|
|
12
|
+
* Works for any asset type (video, audio, etc.) based on the callback provided.
|
|
13
|
+
*
|
|
14
|
+
* @event cx-asset-format-select - Emitted when a format is selected. Detail is an `AssetFormatValue`.
|
|
15
|
+
* @event cx-asset-format-delete - Emitted when the selected format is cleared.
|
|
16
|
+
* @event cx-asset-request-status - Emitted when the format request status changes.
|
|
17
|
+
*/
|
|
18
|
+
export default class CxAssetFormatPicker extends CortexElement {
|
|
19
|
+
static readonly styles: CSSResultGroup;
|
|
20
|
+
static readonly dependencies: {
|
|
21
|
+
'cx-button': typeof CxButton;
|
|
22
|
+
'cx-icon-button': typeof CxIconButton;
|
|
23
|
+
'cx-input': typeof CxInput;
|
|
24
|
+
'cx-space': typeof CxSpace;
|
|
25
|
+
'cx-typography': typeof CxTypography;
|
|
26
|
+
};
|
|
27
|
+
private readonly localize;
|
|
28
|
+
inputEl?: CxInput;
|
|
29
|
+
/** The currently selected asset format value. */
|
|
30
|
+
value: AssetFormatValue | undefined;
|
|
31
|
+
/** Form field name. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** The encrypted asset ID to request formats for. */
|
|
34
|
+
assetId: string;
|
|
35
|
+
/** Whether a value is required. */
|
|
36
|
+
required: boolean;
|
|
37
|
+
/** Disables the picker. */
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* A callback invoked when the user requests to select an asset format.
|
|
41
|
+
* It receives the asset ID and the current value, and should return a
|
|
42
|
+
* promise that resolves to an `AssetFormatValue` or null when cancelled.
|
|
43
|
+
*/
|
|
44
|
+
onRequestAssetFormat: ((assetId: string, value?: AssetFormatValue) => Promise<AssetFormatValue | null | undefined>) | undefined;
|
|
45
|
+
private get hasValue();
|
|
46
|
+
private handleRequestFormatClick;
|
|
47
|
+
private handleDeleteClick;
|
|
48
|
+
handleValueChange(): Promise<void>;
|
|
49
|
+
private renderFormatDisplay;
|
|
50
|
+
render(): import('lit').TemplateResult<1>;
|
|
51
|
+
}
|
|
52
|
+
declare global {
|
|
53
|
+
interface HTMLElementTagNameMap {
|
|
54
|
+
'cx-asset-format-picker': CxAssetFormatPicker;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -55,10 +55,17 @@ export default class CxAssetPicker extends CortexElement {
|
|
|
55
55
|
* It should return a promise that resolves to an Asset object.
|
|
56
56
|
*/
|
|
57
57
|
onRequestAsset: ((type: AssetTypeString, multiple?: boolean, accepts?: string[]) => Promise<Asset | Record<string, Asset>>) | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* An optional record ID used to fetch a clean preview image, bypassing any
|
|
60
|
+
* stored URL that may have transformations applied.
|
|
61
|
+
*/
|
|
62
|
+
recordId: string;
|
|
63
|
+
private previewSrc;
|
|
58
64
|
/** Kept as an instance field so tests can stub this API call. */
|
|
59
65
|
private apiGetAssets;
|
|
60
66
|
private handleRequestAssetClick;
|
|
61
67
|
handleValueChange(): Promise<void>;
|
|
68
|
+
handleRecordIdChange(): Promise<void>;
|
|
62
69
|
private handleDeleteClick;
|
|
63
70
|
/** True when the picker accepts this asset type. */
|
|
64
71
|
private acceptsType;
|
|
@@ -39,6 +39,10 @@ export default class CxDownloadFormatPicker extends CortexElement {
|
|
|
39
39
|
* The ids of the assets to fetch formats for.
|
|
40
40
|
*/
|
|
41
41
|
assetIds: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Restricts the format picker to only show tabs for the specified doc types.
|
|
44
|
+
*/
|
|
45
|
+
allowDocTypes: string[];
|
|
42
46
|
/**
|
|
43
47
|
* Whether the download format picker is disabled.
|
|
44
48
|
*/
|
|
@@ -47,7 +51,7 @@ export default class CxDownloadFormatPicker extends CortexElement {
|
|
|
47
51
|
* A callback function that is called when the user requests to select a format.
|
|
48
52
|
* It should return a promise that resolves to a DownloadFormatValue object.
|
|
49
53
|
*/
|
|
50
|
-
onRequestDownloadFormat: ((assetIds: string[], formats?: Record<string, string[]
|
|
54
|
+
onRequestDownloadFormat: ((assetIds: string[], formats?: Record<string, string[]>, allowDocTypes?: string[]) => Promise<Record<string, string[]>>) | undefined;
|
|
51
55
|
/**
|
|
52
56
|
* Map of format codes to their display labels.
|
|
53
57
|
* Populated by fetching available format codes from the API.
|
|
@@ -34,4 +34,5 @@ export { default as CxStepperWizard } from './stepper-wizard/stepper-wizard';
|
|
|
34
34
|
export { default as CxStorybook } from './storybook/storybook';
|
|
35
35
|
export { default as CxTimeline } from './timeline/timeline';
|
|
36
36
|
export { default as CxTypeface } from './typeface/typeface';
|
|
37
|
+
export { default as CxAssetFormatPicker } from './asset-format-picker/asset-format-picker';
|
|
37
38
|
export { default as CxViewAndSort } from './view-and-sort/view-and-sort';
|
|
@@ -4,6 +4,7 @@ import { default as CxTab } from '../../../atoms/src/components/tab/tab.ts';
|
|
|
4
4
|
import { default as CxTabGroup } from '../../../atoms/src/components/tab-group/tab-group.ts';
|
|
5
5
|
import { default as CxTabPanel } from '../../../atoms/src/components/tab-panel/tab-panel.ts';
|
|
6
6
|
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
|
|
7
|
+
import { Transformation } from '../../../types/src/asset-link-format';
|
|
7
8
|
import { TimelineItem } from '../../../types/src/timeline';
|
|
8
9
|
import { CSSResultGroup } from 'lit';
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ import { CSSResultGroup } from 'lit';
|
|
|
11
12
|
* @summary CxTimeline
|
|
12
13
|
*/
|
|
13
14
|
export default class CxTimeline extends CortexElement {
|
|
15
|
+
#private;
|
|
14
16
|
static readonly styles: CSSResultGroup;
|
|
15
17
|
static readonly dependencies: {
|
|
16
18
|
'cx-icon-button': typeof CxIconButton;
|
|
@@ -20,6 +22,10 @@ export default class CxTimeline extends CortexElement {
|
|
|
20
22
|
'cx-tab-panel': typeof CxTabPanel;
|
|
21
23
|
};
|
|
22
24
|
private readonly localize;
|
|
25
|
+
private apiSearchAssets;
|
|
26
|
+
private readonly searchToken;
|
|
27
|
+
private thumbnailRequestVersion;
|
|
28
|
+
private get isInEditMode();
|
|
23
29
|
tabGroup?: CxTabGroup;
|
|
24
30
|
data: TimelineItem[];
|
|
25
31
|
/**
|
|
@@ -42,6 +48,18 @@ export default class CxTimeline extends CortexElement {
|
|
|
42
48
|
* The minimum width of the tab.
|
|
43
49
|
*/
|
|
44
50
|
minTabWidth: number;
|
|
51
|
+
/**
|
|
52
|
+
* Asset transformation proxy format key.
|
|
53
|
+
*/
|
|
54
|
+
format: string;
|
|
55
|
+
/**
|
|
56
|
+
* Asset transformations applied to the image.
|
|
57
|
+
*/
|
|
58
|
+
transformations: Transformation[];
|
|
59
|
+
/** Proxy URLs resolved from apiSearchAssets, keyed by item.id. */
|
|
60
|
+
private resolvedThumbnails;
|
|
61
|
+
handleDataChange(): Promise<void>;
|
|
62
|
+
private persistResolvedThumbnailsToData;
|
|
45
63
|
private handlePreviousClick;
|
|
46
64
|
private handleNextClick;
|
|
47
65
|
render(): import('lit').TemplateResult<1>;
|
|
@@ -93,11 +93,17 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
93
93
|
*/
|
|
94
94
|
selectedProxy: string;
|
|
95
95
|
useCustomExtension: boolean;
|
|
96
|
+
noMetadata: boolean;
|
|
97
|
+
noCrop: boolean;
|
|
98
|
+
noResize: boolean;
|
|
99
|
+
noRotate: boolean;
|
|
96
100
|
lastImageSize: {
|
|
97
101
|
height: number;
|
|
98
102
|
width: number;
|
|
99
103
|
};
|
|
100
104
|
hideHeader: boolean;
|
|
105
|
+
/** Show a Reset button in the header that clears all transformations. Supports one Undo step after reset. */
|
|
106
|
+
canReset: boolean;
|
|
101
107
|
queryElement: HTMLElement | null;
|
|
102
108
|
/**
|
|
103
109
|
* The currently active setting in the asset link format component.
|
|
@@ -166,6 +172,10 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
166
172
|
*/
|
|
167
173
|
private lastAction;
|
|
168
174
|
private frozenIndex;
|
|
175
|
+
/** Snapshot saved on Reset to allow one Undo step back to the pre-reset state. */
|
|
176
|
+
private preResetTransformations;
|
|
177
|
+
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
178
|
+
private get hasUnfrozenTransformations();
|
|
169
179
|
private apiGetTransformAssetLink;
|
|
170
180
|
private apiGetCropFocusMode;
|
|
171
181
|
/**
|
|
@@ -280,7 +290,9 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
280
290
|
private onQualityChange;
|
|
281
291
|
private onMetadataChange;
|
|
282
292
|
private onExtensionChange;
|
|
293
|
+
private syncQuality;
|
|
283
294
|
private handleUndo;
|
|
295
|
+
private handleReset;
|
|
284
296
|
render(): TemplateResult;
|
|
285
297
|
}
|
|
286
298
|
declare global {
|
|
@@ -41,21 +41,21 @@ export default class CxAssetLinkFormatRotation extends CortexElement {
|
|
|
41
41
|
/**
|
|
42
42
|
* The value of the defined quality.
|
|
43
43
|
* This value represents the quality of the asset link format, ranging from 1 to 100.
|
|
44
|
-
* @default
|
|
44
|
+
* @default 0
|
|
45
45
|
*/
|
|
46
46
|
value: number;
|
|
47
|
+
/**
|
|
48
|
+
* The value of the defined quality.
|
|
49
|
+
* This value represents the quality of the asset link format, ranging from 1 to 100.
|
|
50
|
+
* @default 0
|
|
51
|
+
*/
|
|
52
|
+
defaultValue: number;
|
|
47
53
|
/**
|
|
48
54
|
* The loading state of the component.
|
|
49
55
|
* This is used to indicate that an operation is in progress, such as applying a new rotation value.
|
|
50
56
|
* @default false
|
|
51
57
|
*/
|
|
52
58
|
loading: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* The invalid value state of the component.
|
|
55
|
-
* This is used to indicate that the input value is invalid, such as when it is not a number or out of range.
|
|
56
|
-
* @default false
|
|
57
|
-
*/
|
|
58
|
-
invalidValue: boolean;
|
|
59
59
|
handleOpenChange(): void;
|
|
60
60
|
private handleRotationChange;
|
|
61
61
|
private handleButtonClick;
|
package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { default as CxButton } from '../../../atoms/src/components/button/button.ts';
|
|
2
|
+
import { default as CxDialog } from '../../../atoms/src/components/dialog/dialog.ts';
|
|
3
|
+
import { default as CxIconButton } from '../../../atoms/src/components/icon-button/icon-button.ts';
|
|
4
|
+
import { default as CxSpace } from '../../../atoms/src/components/space/space.ts';
|
|
5
|
+
import { default as CxSpinner } from '../../../atoms/src/components/spinner/spinner.ts';
|
|
6
|
+
import { default as CxTypography } from '../../../atoms/src/components/typography/typography.ts';
|
|
7
|
+
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
|
|
8
|
+
import { default as CxCropper } from '../../../molecules/src/cropper/cropper.ts';
|
|
9
|
+
import { Transformation } from '../../../types/src/asset-link-format';
|
|
10
|
+
import { default as CxAssetLinkFormat } from '../asset-link-format/asset-link-format';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @summary Dialog that wraps `cx-cropper` and `cx-asset-link-format` side by side,
|
|
14
|
+
* allowing users to preview and apply image transformations.
|
|
15
|
+
*
|
|
16
|
+
* @slot trigger - Opens the dialog on click or keyboard activation. Typically a `cx-button` or
|
|
17
|
+
* `cx-icon-button`. Automatically disabled when `asset-id` is not set.
|
|
18
|
+
*
|
|
19
|
+
* @event cx-asset-transformation-dialog-cancel - Emitted when the user closes or cancels the dialog.
|
|
20
|
+
* @event {{ detail: { format: string; transformations: Transformation[] } }} cx-asset-transformation-dialog-confirm - Emitted when the user saves, with the selected proxy id and transformation array.
|
|
21
|
+
* @event cx-asset-transformation-dialog-delete - Emitted when the user clears the saved transformations via the delete button.
|
|
22
|
+
*/
|
|
23
|
+
export default class CxAssetTransformationDialog extends CortexElement {
|
|
24
|
+
static readonly styles: import('lit').CSSResult[];
|
|
25
|
+
static readonly dependencies: {
|
|
26
|
+
'cx-asset-link-format': typeof CxAssetLinkFormat;
|
|
27
|
+
'cx-button': typeof CxButton;
|
|
28
|
+
'cx-cropper': typeof CxCropper;
|
|
29
|
+
'cx-dialog': typeof CxDialog;
|
|
30
|
+
'cx-icon-button': typeof CxIconButton;
|
|
31
|
+
'cx-space': typeof CxSpace;
|
|
32
|
+
'cx-spinner': typeof CxSpinner;
|
|
33
|
+
'cx-typography': typeof CxTypography;
|
|
34
|
+
};
|
|
35
|
+
private readonly localize;
|
|
36
|
+
private readonly fetchAssetController;
|
|
37
|
+
private readonly hasSlotController;
|
|
38
|
+
private apiGetAvailableProxies;
|
|
39
|
+
/** Stores the accessible trigger element for focus return and ARIA updates. */
|
|
40
|
+
private accessibleTrigger;
|
|
41
|
+
private readonly triggerSlot;
|
|
42
|
+
private readonly assetLinkFormat;
|
|
43
|
+
private readonly cropperEl;
|
|
44
|
+
/** Asset ID used to fetch asset data when the dialog opens. */
|
|
45
|
+
assetId: string;
|
|
46
|
+
/** Controls dialog open/close state. */
|
|
47
|
+
open: boolean;
|
|
48
|
+
/** Boundary element for cx-dialog positioning. */
|
|
49
|
+
boundary: HTMLElement;
|
|
50
|
+
baseUrl: string;
|
|
51
|
+
/** Authentication token passed to the asset service. */
|
|
52
|
+
token: string;
|
|
53
|
+
/** Currently selected proxy format, passed back into cx-asset-link-format on reopen. */
|
|
54
|
+
format: string;
|
|
55
|
+
/** The default format to fall back to if the asset has no transformations or selected proxy. */
|
|
56
|
+
defaultFormat: string;
|
|
57
|
+
/** Optional label rendered as the dialog title. Falls back to the localized "Asset format" term. */
|
|
58
|
+
dialogLabel: string;
|
|
59
|
+
/** The transformations applied when the user last saved, passed back into cx-asset-link-format on reopen. */
|
|
60
|
+
transformations: Transformation[];
|
|
61
|
+
/** Show stack of layers indicating the transformations will be applied to multiple assets. */
|
|
62
|
+
multiple: boolean;
|
|
63
|
+
/** Hide the crop panel inside cx-asset-link-format. */
|
|
64
|
+
noCrop: boolean;
|
|
65
|
+
/** Hide the resize panel inside cx-asset-link-format. */
|
|
66
|
+
noResize: boolean;
|
|
67
|
+
/** Hide the rotate panel inside cx-asset-link-format. */
|
|
68
|
+
noRotate: boolean;
|
|
69
|
+
/** Show a Reset button inside cx-asset-link-format that clears all transformations. */
|
|
70
|
+
canReset: boolean;
|
|
71
|
+
/** Asset data fetched on cx-show. */
|
|
72
|
+
private asset;
|
|
73
|
+
/** Available proxy formats fetched alongside the asset. */
|
|
74
|
+
private proxies;
|
|
75
|
+
private get hasTransformations();
|
|
76
|
+
handleAssetIdChange(): Promise<void>;
|
|
77
|
+
handleOpenChange(): void;
|
|
78
|
+
/** Syncs disabled state and ARIA attributes on the slotted trigger element.
|
|
79
|
+
* For cx-button/cx-icon-button, ARIA is set on the inner <button> so screen readers
|
|
80
|
+
* announce the correct role/state rather than the custom-element host. */
|
|
81
|
+
private updateAccessibleTrigger;
|
|
82
|
+
/** Fetches the asset and its available proxies when the dialog opens.
|
|
83
|
+
* Guards on `result.id` because `fetchAssetByID` returns `{}` on network error. */
|
|
84
|
+
private handleDialogShow;
|
|
85
|
+
private handleTriggerClick;
|
|
86
|
+
private handleTriggerKeyDown;
|
|
87
|
+
/** Prevents the default scroll action for Space on keyup (some browsers fire scroll on keyup). */
|
|
88
|
+
private handleTriggerKeyUp;
|
|
89
|
+
private handleTriggerSlotChange;
|
|
90
|
+
private handleClose;
|
|
91
|
+
private handleDeleteClick;
|
|
92
|
+
private handleRequestClose;
|
|
93
|
+
private handleSave;
|
|
94
|
+
private handleCancel;
|
|
95
|
+
private handleAssetLinkFormatShow;
|
|
96
|
+
render(): import('lit').TemplateResult<1>;
|
|
97
|
+
}
|
|
98
|
+
declare global {
|
|
99
|
+
interface HTMLElementTagNameMap {
|
|
100
|
+
'cx-asset-transformation-dialog': CxAssetTransformationDialog;
|
|
101
|
+
}
|
|
102
|
+
}
|