@orangelogic/design-system 2.95.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.Q8ybVS0A.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.BnHKqD0O.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.CYxWpvAC.js → table.V5PGGTfO.js} +13 -11
- 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 +2 -2
- 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
|
@@ -4,26 +4,41 @@ import { default as CxGalleryItem } from '../../../molecules/src/gallery-item/ga
|
|
|
4
4
|
import { Easing } from '../../../types/src/index.ts';
|
|
5
5
|
import { Filler, FillerMode } from '../../../types/src/bento-grid';
|
|
6
6
|
import { GalleryItem, GalleryItemContentPosition, GalleryItemContentVariant, GalleryItemEffect, GalleryItemShowContentType, GalleryItemTextRevealStyle, GalleryItemZoomStyle } from '../../../types/src/gallery-item';
|
|
7
|
-
import { CSSResultGroup } from 'lit';
|
|
7
|
+
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
8
8
|
import { StaticValue } from 'lit/static-html.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @summary CxBentoGrid - A responsive bento grid component with fixed cell height & responsive breakpoints
|
|
11
|
+
* @summary CxBentoGrid - A responsive bento grid component with fixed cell height & responsive breakpoints.
|
|
12
|
+
* Renders only the items visible in the viewport (scroll-based virtualization).
|
|
12
13
|
*
|
|
13
14
|
* @cssproperty [--item-height=200px] - The height of each grid item.
|
|
14
15
|
*
|
|
15
16
|
* @csspart base - The bento grid container
|
|
16
17
|
* @csspart item - The item part of the bento grid
|
|
17
18
|
*
|
|
18
|
-
* @event {{ currentColumnCount }} cx-bento-resize - Emitted when the grid layout recalculates
|
|
19
|
+
* @event {{ currentColumnCount: number }} cx-bento-resize - Emitted when the grid layout recalculates
|
|
20
|
+
* @event {{ first: number; last: number }} cx-bento-range-change - Emitted when the visible item range changes due to scroll or layout update
|
|
19
21
|
*/
|
|
20
22
|
export default class CxBentoGrid extends CortexElement {
|
|
21
23
|
static readonly styles: CSSResultGroup;
|
|
24
|
+
/** Minimum scroll delta (px) required to trigger a virtual range update. */
|
|
25
|
+
private static readonly SCROLL_THRESHOLD;
|
|
22
26
|
static readonly dependencies: {
|
|
23
27
|
'cx-gallery-item': typeof CxGalleryItem;
|
|
24
28
|
'cx-tooltip': typeof CxTooltip;
|
|
25
29
|
};
|
|
26
30
|
private readonly localize;
|
|
31
|
+
/** Pure layout calculator — computes absolute pixel positions. */
|
|
32
|
+
private readonly bentoLayout;
|
|
33
|
+
/** RAF gate for scroll handler to avoid layout thrash. */
|
|
34
|
+
private _scrollRaf;
|
|
35
|
+
/** Cached viewport height — updated on resize only, not on every scroll. */
|
|
36
|
+
private _viewportHeight;
|
|
37
|
+
/** Watches the host element for size changes so the grid reflows when its container resizes. */
|
|
38
|
+
private _resizeObserver;
|
|
39
|
+
/** Tracks the last emitted range to avoid firing cx-bento-range-change when the range hasn't changed. */
|
|
40
|
+
private _lastEmittedFirst;
|
|
41
|
+
private _lastEmittedLast;
|
|
27
42
|
/**
|
|
28
43
|
* References the main container element of the bento grid.
|
|
29
44
|
* This element is used to calculate the grid width and apply
|
|
@@ -76,6 +91,13 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
76
91
|
* The maximum number of rows to show.
|
|
77
92
|
*/
|
|
78
93
|
maxRows: number;
|
|
94
|
+
/**
|
|
95
|
+
* Total number of items in the dataset, including those not yet loaded.
|
|
96
|
+
* When set, the scroll container height is extended to reflect the full dataset
|
|
97
|
+
* size so the scrollbar is accurate from the first render.
|
|
98
|
+
* Unloaded slots are approximated as 1×1 items.
|
|
99
|
+
*/
|
|
100
|
+
totalItems: number;
|
|
79
101
|
/**
|
|
80
102
|
* The show content type.
|
|
81
103
|
*/
|
|
@@ -140,14 +162,8 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
140
162
|
* Specifies the easing function to use when changing slides.
|
|
141
163
|
*/
|
|
142
164
|
easing: Easing;
|
|
143
|
-
/**
|
|
144
|
-
* Internal state that holds the computed CSS styles for the grid container.
|
|
145
|
-
*/
|
|
165
|
+
/** CSS styles applied to the grid container element. */
|
|
146
166
|
private containerStyles;
|
|
147
|
-
/**
|
|
148
|
-
* Tracks the computed styles for the grid container.
|
|
149
|
-
*/
|
|
150
|
-
private computedStyles;
|
|
151
167
|
/**
|
|
152
168
|
* Tracks the previous column count to detect when the grid layout recalculates
|
|
153
169
|
* prevents unnecessary grid updates when the column count hasn't changed.
|
|
@@ -158,6 +174,14 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
158
174
|
* Tracks the currently hovered item.
|
|
159
175
|
*/
|
|
160
176
|
private hoveredItemId;
|
|
177
|
+
/** Total scroll height in px — drives the container height for an accurate scrollbar. */
|
|
178
|
+
private scrollSize;
|
|
179
|
+
/** Current scroll offset in pixels from the top of the container. */
|
|
180
|
+
private scrollOffset;
|
|
181
|
+
/** Inclusive index of the first item in the rendered virtual window. */
|
|
182
|
+
private virtualFirst;
|
|
183
|
+
/** Inclusive index of the last item in the rendered virtual window. */
|
|
184
|
+
private virtualLast;
|
|
161
185
|
private isTooltipShown;
|
|
162
186
|
protected galleryItemTag: string;
|
|
163
187
|
/**
|
|
@@ -177,6 +201,16 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
177
201
|
constructor();
|
|
178
202
|
runConnectedCallback(): void;
|
|
179
203
|
disconnectedCallback(): void;
|
|
204
|
+
runFirstUpdated(): void;
|
|
205
|
+
/**
|
|
206
|
+
* Returns the visible viewport height for virtualization.
|
|
207
|
+
*
|
|
208
|
+
* `containerEl.clientHeight` is unsafe here because, once `containerStyles.height`
|
|
209
|
+
* is set to the laid-out `scrollSize`, the container height equals the entire
|
|
210
|
+
* grid. We walk up to the nearest scrollable ancestor (or fall back to the
|
|
211
|
+
* window) to keep `getActiveRange()` honest.
|
|
212
|
+
*/
|
|
213
|
+
private measureViewportHeight;
|
|
180
214
|
private showTooltip;
|
|
181
215
|
private hideTooltip;
|
|
182
216
|
/**
|
|
@@ -190,23 +224,26 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
190
224
|
private getItemSize;
|
|
191
225
|
/**
|
|
192
226
|
* Determines the number of columns for the grid based on the current
|
|
193
|
-
* container width and breakpoints.
|
|
227
|
+
* container width and breakpoints. Also builds filledData when filler is active.
|
|
194
228
|
*/
|
|
195
229
|
private setupGrid;
|
|
196
230
|
/**
|
|
197
|
-
*
|
|
198
|
-
* @internal Pass calculated total columns and styles values to avoid recalculating in resize and watches
|
|
231
|
+
* Runs BentoLayout.compute() then updates scrollSize and active virtual range.
|
|
199
232
|
*/
|
|
200
|
-
private
|
|
233
|
+
private computeLayout;
|
|
234
|
+
/** Recalculates which items fall within the current scroll viewport. */
|
|
235
|
+
private updateActiveRange;
|
|
201
236
|
/**
|
|
202
|
-
*
|
|
237
|
+
* Returns the index of the last item whose rowStart is within maxRows.
|
|
203
238
|
*/
|
|
204
|
-
private
|
|
239
|
+
private maxRowsLastIndex;
|
|
205
240
|
/**
|
|
206
|
-
*
|
|
241
|
+
* Debounced event handler that responds to container resize events.
|
|
207
242
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
243
|
+
private handleResize;
|
|
244
|
+
/** RAF-gated scroll handler — updates scroll offset and rerenders visible range. */
|
|
245
|
+
private handleScroll;
|
|
246
|
+
willUpdate(changed: PropertyValues): void;
|
|
210
247
|
/**
|
|
211
248
|
* Get content position based on the size of the item.
|
|
212
249
|
*/
|
|
@@ -222,13 +259,7 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
222
259
|
private handleBlur;
|
|
223
260
|
private computeBentoItemEffectStyles;
|
|
224
261
|
renderGalleryItem(galleryItem: {
|
|
225
|
-
|
|
226
|
-
gridColumnEnd: number;
|
|
227
|
-
gridColumnStart: number;
|
|
228
|
-
gridRowEnd: number;
|
|
229
|
-
gridRowStart: number;
|
|
230
|
-
height: string;
|
|
231
|
-
} | undefined;
|
|
262
|
+
actualIndex: number;
|
|
232
263
|
index: number;
|
|
233
264
|
item: GalleryItem;
|
|
234
265
|
}): import('lit').TemplateResult;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BentoActiveRange, BentoItemPosition, BentoLayoutParams } from '../../../types/src/bento-grid';
|
|
2
|
+
import { GalleryItem } from '../../../types/src/gallery-item';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pure layout calculator for a bento grid.
|
|
6
|
+
* Computes absolute pixel positions for items that can span multiple
|
|
7
|
+
* columns and rows. Call `compute()` after data or layout config changes,
|
|
8
|
+
* then `getActiveRange()` on every scroll event to know which items to render.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BentoLayout {
|
|
11
|
+
private _positions;
|
|
12
|
+
/**
|
|
13
|
+
* Sorted array of each item's `top` pixel value (index matches item index).
|
|
14
|
+
* Non-strictly increasing (items in the same row share the same `top`).
|
|
15
|
+
* Used for O(log N) binary search inside getActiveRange().
|
|
16
|
+
*/
|
|
17
|
+
private _topPositions;
|
|
18
|
+
private _scrollSize;
|
|
19
|
+
/** Total scrollable height in pixels after the last compute() call. */
|
|
20
|
+
get scrollSize(): number;
|
|
21
|
+
/** Returns the pixel position for item at `idx`, or undefined if not yet computed. */
|
|
22
|
+
getPosition(idx: number): BentoItemPosition | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Runs the bin-packing algorithm and populates pixel positions for all items.
|
|
25
|
+
* Synchronous — completes in < 1 ms for typical datasets (≤ 10 000 items).
|
|
26
|
+
*/
|
|
27
|
+
compute(items: GalleryItem[], params: BentoLayoutParams): void;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the inclusive [first, last] item index range that overlaps the
|
|
30
|
+
* visible window [scrollTop − overhang, scrollTop + viewportHeight + overhang].
|
|
31
|
+
* O(log N) via binary search on the sorted _topPositions array.
|
|
32
|
+
*/
|
|
33
|
+
getActiveRange(scrollTop: number, viewportHeight: number, overhang?: number): BentoActiveRange;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the smallest index i such that _topPositions[i] >= value.
|
|
36
|
+
* Returns n if all values are < value.
|
|
37
|
+
*/
|
|
38
|
+
private lowerBound;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the smallest index i such that _topPositions[i] > value.
|
|
41
|
+
* Returns n if all values are <= value.
|
|
42
|
+
*/
|
|
43
|
+
private upperBound;
|
|
44
|
+
}
|
|
@@ -239,6 +239,8 @@ export default class CxCarousel extends CortexElement {
|
|
|
239
239
|
private readonly localize;
|
|
240
240
|
private readonly instantScrollGap;
|
|
241
241
|
private isTooltipShown;
|
|
242
|
+
/** Stores the requested index when goToSlide returns early due to an out-of-chunk request, so it can be retried after the chunk loads. */
|
|
243
|
+
private pendingNavigationIndex;
|
|
242
244
|
protected isProgrammaticFocus: boolean;
|
|
243
245
|
private mutationObserver;
|
|
244
246
|
get easeCSSVariable(): string;
|
|
@@ -318,7 +320,7 @@ export default class CxCarousel extends CortexElement {
|
|
|
318
320
|
handleOrientationChange(): void;
|
|
319
321
|
handleAutoplayChange(): void;
|
|
320
322
|
handleDataChanges(): Promise<void>;
|
|
321
|
-
handleChunkChange(): void
|
|
323
|
+
handleChunkChange(): Promise<void>;
|
|
322
324
|
handleChunkLoopChange(): Promise<void>;
|
|
323
325
|
/**
|
|
324
326
|
* Move the carousel backward by `slides-per-move` slides.
|
package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts
CHANGED
|
@@ -98,6 +98,13 @@ export default class CxBlockPicker extends CortexElement {
|
|
|
98
98
|
forceSelectingTemplate: boolean;
|
|
99
99
|
limitedBlocks: string[];
|
|
100
100
|
addIndex: number | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Whether to expose asset format / transformation / download-format /
|
|
103
|
+
* asset-format-picker controls for image, video, gallery, carousel,
|
|
104
|
+
* and timeline blocks. Forwarded from `cx-content-builder`.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
enableAssetFormatControls: boolean;
|
|
101
108
|
selectedComponent: Component | undefined;
|
|
102
109
|
/**
|
|
103
110
|
* The boundary property of the confirm popover's dropdown/dialog popup.
|
|
@@ -6,8 +6,12 @@ import { TabType } from './config-form';
|
|
|
6
6
|
export declare class ConfigFormController implements ReactiveController {
|
|
7
7
|
host: ReactiveControllerHost & CxConfigForm;
|
|
8
8
|
private readonly localize;
|
|
9
|
+
private apiSearchAssets;
|
|
10
|
+
private readonly searchToken;
|
|
11
|
+
private readonly pendingGalleryPickerSaves;
|
|
9
12
|
constructor(host: ReactiveControllerHost & CxConfigForm);
|
|
10
13
|
hostConnected(): void;
|
|
14
|
+
private resolveAssetFormatSrc;
|
|
11
15
|
private handleStyleChange;
|
|
12
16
|
private handleAttributeChange;
|
|
13
17
|
private handlePropertyChange;
|
package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { default as CxTypography } from '../../../../../atoms/src/components/typ
|
|
|
28
28
|
import { default as CxVisuallyHidden } from '../../../../../atoms/src/components/visually-hidden/visually-hidden.ts';
|
|
29
29
|
import { default as CortexElement } from '../../../../../base/src/cortex-element.ts';
|
|
30
30
|
import { CxIconPicker } from '../../../../../molecules/src/index.ts';
|
|
31
|
+
import { default as CxAssetFormatPicker } from '../../../../../molecules/src/asset-format-picker/asset-format-picker.ts';
|
|
31
32
|
import { default as CxAssetPicker } from '../../../../../molecules/src/asset-picker/asset-picker.ts';
|
|
32
33
|
import { default as CxBicolorPicker } from '../../../../../molecules/src/bicolor-picker/bicolor-picker.ts';
|
|
33
34
|
import { default as CxBorderInputGroup } from '../../../../../molecules/src/border-input-group/border-input-group.ts';
|
|
@@ -40,6 +41,8 @@ import { default as CxPaddingInputGroup } from '../../../../../molecules/src/pad
|
|
|
40
41
|
import { default as CxPositionPicker } from '../../../../../molecules/src/position-picker/position-picker.ts';
|
|
41
42
|
import { default as CxShadowInputGroup } from '../../../../../molecules/src/shadow-input-group/shadow-input-group.ts';
|
|
42
43
|
import { default as CxSizeInputGroup } from '../../../../../molecules/src/size-input-group/size-input-group.ts';
|
|
44
|
+
import { default as CxAssetTransformationDialog } from '../../../asset-transformation-dialog/asset-transformation-dialog.ts';
|
|
45
|
+
import { AssetFormatValue } from '../../../../../types/src/asset-format-picker';
|
|
43
46
|
import { Asset, AssetTypeString, EditorMode, PropertyConfig } from '../../../../../types/src/content-builder';
|
|
44
47
|
import { StyleProps } from 'grapesjs';
|
|
45
48
|
import { CxColorSwatchPicker } from '../color-swatch-picker';
|
|
@@ -72,7 +75,9 @@ export declare enum TabType {
|
|
|
72
75
|
export default class CxConfigForm extends CortexElement {
|
|
73
76
|
static readonly styles: import('lit').CSSResult[];
|
|
74
77
|
static readonly dependencies: {
|
|
78
|
+
'cx-asset-format-picker': typeof CxAssetFormatPicker;
|
|
75
79
|
'cx-asset-picker': typeof CxAssetPicker;
|
|
80
|
+
'cx-asset-transformation-dialog': typeof CxAssetTransformationDialog;
|
|
76
81
|
'cx-bicolor-picker': typeof CxBicolorPicker;
|
|
77
82
|
'cx-border-input-group': typeof CxBorderInputGroup;
|
|
78
83
|
'cx-button': typeof CxButton;
|
|
@@ -192,6 +197,10 @@ export default class CxConfigForm extends CortexElement {
|
|
|
192
197
|
* @returns A promise that resolves to an Asset object.
|
|
193
198
|
* @default undefined
|
|
194
199
|
*/
|
|
200
|
+
/** Base URL passed through to cx-asset-transformation-dialog for asset fetching. */
|
|
201
|
+
baseUrl: string;
|
|
202
|
+
/** Auth token passed through to cx-asset-transformation-dialog for asset fetching. */
|
|
203
|
+
token: string;
|
|
195
204
|
onRequestAsset: ((type: AssetTypeString, multiple?: boolean, accepts?: string[]) => Promise<Asset | Record<string, Asset>>) | undefined;
|
|
196
205
|
/**
|
|
197
206
|
* Function to request a download format.
|
|
@@ -202,6 +211,8 @@ export default class CxConfigForm extends CortexElement {
|
|
|
202
211
|
* @default undefined
|
|
203
212
|
*/
|
|
204
213
|
onRequestDownloadFormat: ((assetIds: string[], formats?: Record<string, string[]>) => Promise<Record<string, string[]>>) | undefined;
|
|
214
|
+
/** Callback invoked when an asset format needs to be selected via an external popup. */
|
|
215
|
+
onRequestAssetFormat: ((assetId: string, value?: AssetFormatValue) => Promise<AssetFormatValue | null | undefined>) | undefined;
|
|
205
216
|
/**
|
|
206
217
|
* The attributes of the component.
|
|
207
218
|
* This is used to store the attributes of the block being configured.
|
package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as CxTypography } from '../../../../../atoms/src/components/typography/typography.ts';
|
|
2
2
|
import { default as CortexElement } from '../../../../../base/src/cortex-element.ts';
|
|
3
|
+
import { AssetFormatValue } from '../../../../../types/src/asset-format-picker';
|
|
3
4
|
import { Asset, AssetTypeString, EditorMode, PropertyConfig } from '../../../../../types/src/content-builder';
|
|
4
5
|
import { Component, DataRecord, StyleProps } from 'grapesjs';
|
|
5
6
|
import { CxConfigForm } from '../config-form';
|
|
@@ -53,6 +54,13 @@ export default class CxConfigManager extends CortexElement {
|
|
|
53
54
|
* @default EditorMode.Template
|
|
54
55
|
*/
|
|
55
56
|
mode: EditorMode;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to expose asset format / transformation / download-format /
|
|
59
|
+
* asset-format-picker controls for image, video, gallery, carousel,
|
|
60
|
+
* and timeline blocks.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
enableAssetFormatControls: boolean;
|
|
56
64
|
/**
|
|
57
65
|
* A list of properties that are not shown in the configuration manager if mode is EditorMode.Content.
|
|
58
66
|
* @default []
|
|
@@ -100,6 +108,8 @@ export default class CxConfigManager extends CortexElement {
|
|
|
100
108
|
* @default undefined
|
|
101
109
|
*/
|
|
102
110
|
onRequestDownloadFormat: ((assetIds: string[]) => Promise<Asset[]>) | undefined;
|
|
111
|
+
/** Callback forwarded to `cx-config-form` → `cx-asset-format-picker` for asset format selection. */
|
|
112
|
+
onRequestAssetFormat: ((assetId: string, value?: AssetFormatValue) => Promise<AssetFormatValue | null | undefined>) | undefined;
|
|
103
113
|
/**
|
|
104
114
|
* The attributes of the component.
|
|
105
115
|
* This is used to store the attributes of the block being configured.
|
package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ export default class CxGalleryPicker extends CortexElement implements CortexForm
|
|
|
51
51
|
* Specifies the id of the src of the carousel. This is only used when the variant is set to 'api'.
|
|
52
52
|
*/
|
|
53
53
|
src: string;
|
|
54
|
+
/**
|
|
55
|
+
* The asset format code used to resolve image src URLs when fetching records by ID.
|
|
56
|
+
*/
|
|
57
|
+
format: string;
|
|
54
58
|
/**
|
|
55
59
|
* The boundary property of the confirm popover's dropdown/dialog popup.
|
|
56
60
|
*/
|
|
@@ -115,6 +119,8 @@ export default class CxGalleryPicker extends CortexElement implements CortexForm
|
|
|
115
119
|
fetchImagesInFolderBySlide(): Promise<void>;
|
|
116
120
|
handleSourceVariantChange(): void;
|
|
117
121
|
fetchImagesByIDs(oldValue: unknown, newValue: unknown): Promise<void>;
|
|
122
|
+
handleFormatChange(): Promise<void>;
|
|
123
|
+
private doFetchByIds;
|
|
118
124
|
private get maxMasonryHeight();
|
|
119
125
|
private get hasMore();
|
|
120
126
|
private handleAddItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Easing, TransitionType } from '../../../../types/src/index.ts';
|
|
2
|
-
import { PropertyConfig } from '../../../../types/src/content-builder';
|
|
2
|
+
import { ConfigsOptions, PropertyConfig } from '../../../../types/src/content-builder';
|
|
3
3
|
import { ContentType, SourceVariant } from '../../../../types/src/gallery';
|
|
4
4
|
import { GalleryItemCardType, GalleryItemContentPosition, GalleryItemContentVariant, GalleryItemEffect, GalleryItemTextRevealStyle, GalleryItemZoomStyle } from '../../../../types/src/gallery-item';
|
|
5
5
|
import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
@@ -17,8 +17,10 @@ type Attributes = {
|
|
|
17
17
|
'content-variant': GalleryItemContentVariant;
|
|
18
18
|
'data-constraints': boolean;
|
|
19
19
|
'details-source-field': string;
|
|
20
|
+
'download-format': string;
|
|
20
21
|
easing: Easing;
|
|
21
22
|
effect: GalleryItemEffect;
|
|
23
|
+
format: string;
|
|
22
24
|
'header-source-field': string;
|
|
23
25
|
'highlight-border': boolean;
|
|
24
26
|
'highlight-color-overlay': boolean;
|
|
@@ -34,12 +36,14 @@ type Attributes = {
|
|
|
34
36
|
'source-variant': SourceVariant;
|
|
35
37
|
src: string;
|
|
36
38
|
'text-reveal-style': GalleryItemTextRevealStyle;
|
|
39
|
+
'transformation-record-id': string;
|
|
40
|
+
transformations: string;
|
|
37
41
|
'transition-type': TransitionType;
|
|
38
42
|
variant: string;
|
|
39
43
|
'zoom-style': GalleryItemZoomStyle;
|
|
40
44
|
};
|
|
41
45
|
declare const _default: {
|
|
42
|
-
configs: (localize: LocalizeController) => Array<PropertyConfig<Attributes>>;
|
|
46
|
+
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attributes>>;
|
|
43
47
|
defaultValue: Partial<Attributes>;
|
|
44
48
|
stylable: string[];
|
|
45
49
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Easing, Orientation } from '../../../../types/src/index.ts';
|
|
2
|
-
import { PropertyConfig } from '../../../../types/src/content-builder';
|
|
2
|
+
import { ConfigsOptions, PropertyConfig } from '../../../../types/src/content-builder';
|
|
3
3
|
import { ContentType, GalleryVariant, OverflowBehavior, SourceVariant } from '../../../../types/src/gallery';
|
|
4
4
|
import { GalleryItemCardType, GalleryItemContentPosition, GalleryItemContentVariant, GalleryItemEffect, GalleryItemShowContentType, GalleryItemTextRevealStyle, GalleryItemZoomStyle } from '../../../../types/src/gallery-item';
|
|
5
5
|
import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
@@ -17,8 +17,10 @@ type Attribute = {
|
|
|
17
17
|
'content-type': ContentType;
|
|
18
18
|
'content-variant': GalleryItemContentVariant;
|
|
19
19
|
'details-source-field': string;
|
|
20
|
+
'download-format': string;
|
|
20
21
|
easing: Easing;
|
|
21
22
|
effect: GalleryItemEffect;
|
|
23
|
+
format: string;
|
|
22
24
|
'header-source-field': string;
|
|
23
25
|
'highlight-background': boolean;
|
|
24
26
|
'highlight-border': boolean;
|
|
@@ -40,11 +42,13 @@ type Attribute = {
|
|
|
40
42
|
'source-variant': SourceVariant;
|
|
41
43
|
src: string;
|
|
42
44
|
'text-reveal-style': GalleryItemTextRevealStyle;
|
|
45
|
+
'transformation-record-id': string;
|
|
46
|
+
transformations: string;
|
|
43
47
|
variant: GalleryVariant;
|
|
44
48
|
'zoom-style': GalleryItemZoomStyle;
|
|
45
49
|
};
|
|
46
50
|
declare const _default: {
|
|
47
|
-
configs: (localize: LocalizeController) => Array<PropertyConfig<Attribute>>;
|
|
51
|
+
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attribute>>;
|
|
48
52
|
defaultValue: Partial<Attribute>;
|
|
49
53
|
stylable: string[];
|
|
50
54
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropertyConfig } from '../../../../types/src/content-builder';
|
|
1
|
+
import { ConfigsOptions, PropertyConfig } from '../../../../types/src/content-builder';
|
|
2
2
|
import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
3
3
|
import { default as CxImage } from '../blocks/image/image';
|
|
4
4
|
|
|
@@ -21,8 +21,10 @@ type Attribute = {
|
|
|
21
21
|
'download-id'?: CxImage['downloadId'];
|
|
22
22
|
'download-names'?: CxImage['downloadNames'];
|
|
23
23
|
'download-src'?: CxImage['downloadSrc'];
|
|
24
|
-
easing
|
|
25
|
-
effect
|
|
24
|
+
easing: CxImage['easing'];
|
|
25
|
+
effect: CxImage['effect'];
|
|
26
|
+
format: CxImage['format'];
|
|
27
|
+
'format-dark-mode': CxImage['formatDarkMode'];
|
|
26
28
|
'header-source-field': CxImage['headerSourceField'];
|
|
27
29
|
height: CxImage['height'];
|
|
28
30
|
'height-mode': CxImage['heightMode'];
|
|
@@ -41,12 +43,13 @@ type Attribute = {
|
|
|
41
43
|
src: CxImage['src'];
|
|
42
44
|
'src-dark-mode': CxImage['srcDarkMode'];
|
|
43
45
|
'text-reveal-style'?: CxImage['textRevealStyle'];
|
|
46
|
+
transformations: string;
|
|
44
47
|
'transition-type'?: string;
|
|
45
48
|
width: CxImage['width'];
|
|
46
49
|
'zoom-style'?: CxImage['zoomStyle'];
|
|
47
50
|
};
|
|
48
51
|
declare const _default: {
|
|
49
|
-
configs: (localize: LocalizeController) => Array<PropertyConfig<Attribute>>;
|
|
52
|
+
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attribute>>;
|
|
50
53
|
defaultValue: Attribute;
|
|
51
54
|
stylable: string[];
|
|
52
55
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { PropertyConfig } from '../../../../types/src/content-builder';
|
|
1
|
+
import { ConfigsOptions, PropertyConfig } from '../../../../types/src/content-builder';
|
|
2
2
|
import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
3
3
|
|
|
4
4
|
type Attributes = {
|
|
5
5
|
data: string;
|
|
6
|
+
format: string;
|
|
6
7
|
'min-tab-width': string;
|
|
7
8
|
'multi-language': boolean;
|
|
8
9
|
'navigation-arrows': boolean;
|
|
9
10
|
'show-thumbnails': boolean;
|
|
10
11
|
'tabs-per-page': number;
|
|
12
|
+
'transformation-record-id': string;
|
|
13
|
+
transformations: string;
|
|
11
14
|
};
|
|
12
15
|
declare const _default: {
|
|
13
|
-
configs: (localize: LocalizeController) => Array<PropertyConfig<Attributes>>;
|
|
16
|
+
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attributes>>;
|
|
14
17
|
defaultValue: Attributes;
|
|
15
18
|
stylable: string[];
|
|
16
19
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ClickAction } from '../../../../types/src/asset-click-action';
|
|
2
|
-
import {
|
|
2
|
+
import { AssetVersion } from '../../../../types/src/asset-format-picker';
|
|
3
|
+
import { ConfigsOptions, PropertyConfig } from '../../../../types/src/content-builder';
|
|
3
4
|
import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
4
5
|
import { default as CxVideo } from '../blocks/video/video';
|
|
5
6
|
|
|
6
7
|
type Attribute = {
|
|
7
8
|
'additional-fields': string;
|
|
9
|
+
'asset-version': AssetVersion;
|
|
8
10
|
autoplay: CxVideo['autoplay'];
|
|
9
11
|
'click-action': ClickAction;
|
|
10
12
|
'click-link'?: CxVideo['clickLink'];
|
|
@@ -22,6 +24,9 @@ type Attribute = {
|
|
|
22
24
|
'download-id'?: CxVideo['downloadId'];
|
|
23
25
|
'download-names'?: CxVideo['downloadNames'];
|
|
24
26
|
'download-src'?: CxVideo['downloadSrc'];
|
|
27
|
+
'format': string;
|
|
28
|
+
'format-label'?: string;
|
|
29
|
+
'format-src': string;
|
|
25
30
|
'header-source-field': CxVideo['headerSourceField'];
|
|
26
31
|
height: CxVideo['height'];
|
|
27
32
|
'height-mode': CxVideo['heightMode'];
|
|
@@ -38,10 +43,14 @@ type Attribute = {
|
|
|
38
43
|
'share-src'?: CxVideo['shareSrc'];
|
|
39
44
|
'show-controls': CxVideo['showControls'];
|
|
40
45
|
src: CxVideo['src'];
|
|
46
|
+
'thumbnail-format'?: string;
|
|
47
|
+
'thumbnail-record-id'?: string;
|
|
48
|
+
'thumbnail-transformations'?: string;
|
|
49
|
+
'version-label'?: string;
|
|
41
50
|
width: CxVideo['width'];
|
|
42
51
|
};
|
|
43
52
|
declare const _default: {
|
|
44
|
-
configs: (localize: LocalizeController) => Array<PropertyConfig<Attribute>>;
|
|
53
|
+
configs: (localize: LocalizeController, options?: ConfigsOptions) => Array<PropertyConfig<Attribute>>;
|
|
45
54
|
defaultValue: Partial<Attribute>;
|
|
46
55
|
stylable: string[];
|
|
47
56
|
};
|