@orangelogic/design-system 2.192.0 → 2.194.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.CDd4iPA2.js → asset-link-format.CODyaNDa.js} +937 -916
- package/library/chunks/{color-swatch-group.NOcRP-23.js → color-swatch-group.D1p1ayBo.js} +1 -1
- package/library/chunks/{document-viewer.CRluR-_W.js → document-viewer.DnowPH70.js} +2 -2
- package/library/chunks/{image.CiQwSDfe.js → image.BSvc6eti.js} +10 -6
- package/library/chunks/transformation.JkkMVin_.js +334 -0
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +2 -2
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/document-viewer.js +2 -2
- package/library/components/image.js +1 -1
- package/library/components/masonry.js +119 -111
- package/library/components/organisms.js +2 -2
- package/library/components/types.js +15193 -15150
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +2 -0
- package/library/packages/molecules/src/masonry/masonry.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +8 -0
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +5 -5
- package/library/packages/services/src/api/asset/asset.d.ts +11 -3
- package/library/packages/types/src/gallery-item.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +2 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +55 -11
- package/library/react-web-component.d.ts +4 -4
- package/library/utils.js +89 -86
- package/package.json +1 -1
- package/library/chunks/transformation.BfIEi4p4.js +0 -300
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as kd, a as Sa, b as Be, c as Je } from "../chunks/inheritsLoose.BuSn_CvZ.js";
|
|
2
2
|
import { c as ps, a as Bn } from "../chunks/_commonjsHelpers.DQNKXVTB.js";
|
|
3
3
|
import { r as Sb } from "../chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js";
|
|
4
|
-
import { C as Cb } from "../chunks/image.
|
|
4
|
+
import { C as Cb } from "../chunks/image.BSvc6eti.js";
|
|
5
5
|
import Mb from "./resize-observer.js";
|
|
6
6
|
import { r as Db, R as Pb, a as Rp, b as Lb } from "../chunks/resizable-component.styles.CAfXABBc.js";
|
|
7
7
|
import { c as Rb } from "../chunks/component.styles.CRO4Odto.js";
|
package/library/package.json
CHANGED
|
@@ -174,6 +174,8 @@ export default class CxImage extends ResizableElement {
|
|
|
174
174
|
};
|
|
175
175
|
/** The crossorigin value for the `<img>`; `undefined` (attribute omitted) when `noCrossorigin` is set. */
|
|
176
176
|
get crossorigin(): string | undefined;
|
|
177
|
+
/** Whether there is nothing to display: no source and no placeholder to stand in for one. */
|
|
178
|
+
protected get isEmpty(): boolean;
|
|
177
179
|
/**
|
|
178
180
|
* Whether to hold the box with a skeleton rather than the loaded image.
|
|
179
181
|
*
|
|
@@ -103,7 +103,7 @@ export default class CxMasonry extends CortexElement {
|
|
|
103
103
|
* the default `100vw`.
|
|
104
104
|
*/
|
|
105
105
|
private get itemSizes();
|
|
106
|
-
/** The format one item is served under: the configured one, or derived from
|
|
106
|
+
/** The format one item is served under: the configured one, or derived from the item. */
|
|
107
107
|
private resolveItemFormat;
|
|
108
108
|
handleItemClick(event: MouseEvent, item: MasonryItem): void;
|
|
109
109
|
handleSortableUpdate(event: Sortable.SortableEvent): void;
|
|
@@ -176,6 +176,14 @@ export default class CxSbImage extends CxImage {
|
|
|
176
176
|
* server-side resize would flatten to a still frame.
|
|
177
177
|
*/
|
|
178
178
|
private assetExtension;
|
|
179
|
+
/** Width of the proxy currently displayed; caps `srcset` so it never asks to upscale. */
|
|
180
|
+
private assetProxyWidth;
|
|
181
|
+
/**
|
|
182
|
+
* The asset's file size, which is what `Auto` uses to choose between the original-file
|
|
183
|
+
* proxy and the transcoded one. Empty until the asset fetch reports back, which
|
|
184
|
+
* `resolveAutoFormat` reads as "within the limit".
|
|
185
|
+
*/
|
|
186
|
+
private assetFileSize;
|
|
179
187
|
/**
|
|
180
188
|
* Whether an asset fetch has reported back for the current record.
|
|
181
189
|
*
|
|
@@ -6,11 +6,11 @@ import { default as CortexLightElement } from '../../../base/src/cortex-light-el
|
|
|
6
6
|
*
|
|
7
7
|
* @description Scans its light-DOM children for record-id blocks (`cx-sb-image`,
|
|
8
8
|
* `cx-sb-video`, `cx-sb-audio`) and batch-fetches their asset metadata in one Search
|
|
9
|
-
* call, and for blocks
|
|
10
|
-
* `cx-sb-video`
|
|
11
|
-
*
|
|
12
|
-
* `
|
|
13
|
-
* authorised. Renders no UI. Blocks skip their own fetch whenever an ancestor supplies
|
|
9
|
+
* call, and for blocks needing the team-space list (`cx-sb-button`, `cx-sb-image`,
|
|
10
|
+
* `cx-sb-video` linking to a space, and `cx-gallery` showing space cards), fetching
|
|
11
|
+
* the space list once and assigning it as `spaces`. It also distributes its
|
|
12
|
+
* `securityBypassToken` to every record-id child (including `cx-timeline`, for
|
|
13
|
+
* expired-URL recovery only) so their own runtime Search calls are authorised. Renders no UI. Blocks skip their own fetch whenever an ancestor supplies
|
|
14
14
|
* it, so they must sit inside this element for that to apply — in the editor that means
|
|
15
15
|
* inside the canvas document.
|
|
16
16
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetAllFormatCodesResponse, GetAssetsInFolderRequest, GetAssetsInFolderResponse, GetAssetsRequest, GetAssetsResponse, GetAuthorizedObjectsRequest, GetAuthorizedObjectsResponse, GetAvailableProxiesResponse, GetCropZoneSuggestionRequest, GetCropZoneSuggestionResponse, GetTransformAssetLinkResponse, SearchAssetsParams, SearchAssetsResponse } from './asset.types';
|
|
1
|
+
import { GetAllFormatCodesResponse, GetAssetsInFolderRequest, GetAssetsInFolderResponse, GetAssetsRequest, GetAssetsResponse, GetAuthorizedObjectsRequest, GetAuthorizedObjectsResponse, GetAvailableProxiesResponse, GetCropZoneSuggestionRequest, GetCropZoneSuggestionResponse, GetTransformAssetLinkResponse, SearchAssetsItem, SearchAssetsParams, SearchAssetsResponse } from './asset.types';
|
|
2
2
|
|
|
3
3
|
export declare const DEFAULT_VIEW_SIZE = "CoreField.LargeSizePreview";
|
|
4
4
|
export declare const FIELD_CORTEX_PATH = "Document.CortexPath";
|
|
@@ -8,7 +8,6 @@ export declare const FIELD_DOC_CAPTION_LONG = "Document.CaptionLong";
|
|
|
8
8
|
export declare const FIELD_EXTENSION = "Document.FileExtension";
|
|
9
9
|
export declare const FIELD_FILE_SIZE = "CoreField.FileSize";
|
|
10
10
|
export declare const FIELD_IDENTIFIER = "CoreField.Identifier";
|
|
11
|
-
export declare const FIELD_KEYWORDS = "CoreField.Keywords";
|
|
12
11
|
export declare const FIELD_MAX_HEIGHT = "CoreField.MaxHeight";
|
|
13
12
|
export declare const FIELD_MAX_WIDTH = "CoreField.MaxWidth";
|
|
14
13
|
export declare const FIELD_RECORD_ID = "Document.RecordID";
|
|
@@ -19,6 +18,8 @@ export declare const FIELD_ORIGINAL_FILE_NAME = "CoreField.OriginalFileName";
|
|
|
19
18
|
export declare const FIELD_UPDATED_FILE_NAME = "CoreField.UpdatedFileName";
|
|
20
19
|
export declare const FIELD_LARGE_SIZE_PREVIEW_ID = "Document.DocumentDirectRepresentativeRID";
|
|
21
20
|
export declare const LIBRARY_NAME = "Library";
|
|
21
|
+
/** Appended to a `path_*` key to carry that proxy's rendered width alongside its URI. */
|
|
22
|
+
export declare const MEDIA_FIELD_WIDTH_SUFFIX = "__width";
|
|
22
23
|
export declare const MESSAGE_NEW_LINE = "\n";
|
|
23
24
|
export declare const ORIGINAL_VIEW_SIZE = "CoreField.OriginalPreview";
|
|
24
25
|
export declare const FIELD_DOC_SUBTYPE = "Document.DocSubType";
|
|
@@ -41,7 +42,14 @@ export declare function apiGetTransformAssetLink({ assetId, extension, format, s
|
|
|
41
42
|
useSession?: string;
|
|
42
43
|
}): Promise<GetTransformAssetLinkResponse | null>;
|
|
43
44
|
export declare function apiGetAssets({ extraFields, getPermanentAssetsPaths, isSiteBuilder, recordIds, securityByPassToken, token, }: GetAssetsRequest): Promise<GetAssetsResponse>;
|
|
44
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Reads the pixel width a `path_*` proxy field actually has.
|
|
47
|
+
*
|
|
48
|
+
* Each proxy is rendered at its own size, so this is the ceiling for resizing that URL —
|
|
49
|
+
* distinct from `CoreField.MaximumWidth`, which describes the original file.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readSearchAssetItemWidth(item: SearchAssetsItem, field: string): number | undefined;
|
|
52
|
+
export declare function apiGetAssetsInFolder({ countPerPage, directParentFolderIdentifier, excludedDocTypes, extraFields, getPermanentAssetsPaths, isSiteBuilder, limitedDocTypes, pageNumber, parentFolderIdentifier, searchTerm, securityByPassToken, sortOrder, token, }: GetAssetsInFolderRequest): Promise<GetAssetsInFolderResponse>;
|
|
45
53
|
export declare function apiGetCropFocusMode({ autoCropMode, cropHeight, cropWidth, imageUrl, useSession, }: GetCropZoneSuggestionRequest): Promise<GetCropZoneSuggestionResponse | null>;
|
|
46
54
|
export declare function apiGetAvailableProxies({ assetRecordId, isSiteBuilder, siteUrl, token, useSession, }: {
|
|
47
55
|
assetRecordId: string;
|
|
@@ -67,30 +67,74 @@ export declare const AUTO_ORIGINAL_FORMAT_MAX_BYTES: number;
|
|
|
67
67
|
* reported" apart from "genuinely empty file" — the two lead to different decisions.
|
|
68
68
|
*/
|
|
69
69
|
export declare function parseFileSizeToBytes(size: string | number | null | undefined): number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The largest width `Auto` may request for an item.
|
|
72
|
+
*
|
|
73
|
+
* Each proxy is rendered at a fixed size (a `TR1` may be 1200px where its `TRX` is 7360px),
|
|
74
|
+
* so resizing past it only asks the backend to upscale. Returns `undefined` under a manual
|
|
75
|
+
* format — the author's choice is left alone — and when the proxy reported no width.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveAutoMaxWidth(manualFormat: boolean, proxyWidth: string | number | null | undefined): number | undefined;
|
|
70
78
|
/**
|
|
71
79
|
* Picks the proxy format an asset should be served under when the author chose `Auto`
|
|
72
80
|
* instead of naming a format.
|
|
73
81
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
82
|
+
* Two things have to hold before the original file is served untouched:
|
|
83
|
+
*
|
|
84
|
+
* 1. The source is itself a displayable image (`IMAGE_ORIGINAL_EXTENSIONS`). For a
|
|
85
|
+
* document source the original-file proxy is a PDF, which cannot be transformed or
|
|
86
|
+
* displayed as an image, so those always take the transcoded raster proxy.
|
|
87
|
+
* 2. It is no larger than `AUTO_ORIGINAL_FORMAT_MAX_BYTES` — past that, delivering the
|
|
88
|
+
* original costs the viewer more than the fidelity it preserves.
|
|
77
89
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
90
|
+
* The delivery URL still carries the `AUTO_FORMAT_EXTENSION` marker (see
|
|
91
|
+
* `applyAutoFormatToAssetUrl`) so the backend picks the exact rendition; this only decides
|
|
92
|
+
* which proxy to ask for in the first place.
|
|
80
93
|
*
|
|
81
|
-
* An unknown
|
|
82
|
-
*
|
|
94
|
+
* An unknown or missing extension resolves to the raster proxy — the safe default, since
|
|
95
|
+
* it is a real image whatever the source turns out to be. An unknown *size* does not: a
|
|
96
|
+
* size the API did not report is treated as within the limit, so a missing field never
|
|
97
|
+
* silently downgrades an image away from its original.
|
|
83
98
|
*/
|
|
84
99
|
export declare function resolveAutoFormat(extension: string | null | undefined, size?: string | number | null): string;
|
|
100
|
+
/**
|
|
101
|
+
* Extension marker that asks the backend to serve whichever rendition suits the asset,
|
|
102
|
+
* rather than the exact file the delivery URL names.
|
|
103
|
+
*/
|
|
104
|
+
export declare const AUTO_FORMAT_EXTENSION = ".auto";
|
|
105
|
+
/**
|
|
106
|
+
* Appends the `.auto` marker to an asset-link URL, letting the backend pick a rendition
|
|
107
|
+
* suited to the source instead of returning the file exactly as named.
|
|
108
|
+
*
|
|
109
|
+
* The existing extension is kept (`photo.jpg` becomes `photo.jpg.auto`): the URL names a
|
|
110
|
+
* real proxy file, and rewriting that name is the backend's business, not ours. Only the
|
|
111
|
+
* final path segment is touched, so the access key and any `/t/` transform segment are
|
|
112
|
+
* preserved and a configured crop or resize still applies.
|
|
113
|
+
*
|
|
114
|
+
* An animated GIF served as the original file is left alone: whatever rendition the
|
|
115
|
+
* backend picked instead would be a still frame, so the marker would cost the animation.
|
|
116
|
+
* A GIF under any other format is already a rendered still, so it has nothing left to
|
|
117
|
+
* lose and takes the marker like anything else — the same distinction `buildAssetSrcset`
|
|
118
|
+
* draws before it resizes.
|
|
119
|
+
*
|
|
120
|
+
* Returns the URL unchanged when it is not an asset link (arbitrary external sources are
|
|
121
|
+
* never rewritten), when there is no final segment to append to, or when the marker is
|
|
122
|
+
* already present, so the call is safe to repeat.
|
|
123
|
+
*/
|
|
124
|
+
export declare function applyAutoFormatToAssetUrl(url: string, options?: {
|
|
125
|
+
extension?: string | null;
|
|
126
|
+
format?: string;
|
|
127
|
+
}): string;
|
|
85
128
|
/**
|
|
86
129
|
* Builds a `srcset` value for an asset-link URL by emitting one width-only resize
|
|
87
130
|
* candidate per ladder entry, letting the browser fetch and decode only the pixels
|
|
88
131
|
* the layout actually needs.
|
|
89
132
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
133
|
+
* When `maxWidth` is known the list is bounded by the asset itself: rungs above it are
|
|
134
|
+
* dropped so the backend is never asked to upscale, rungs within
|
|
135
|
+
* `ORIGINAL_INSTEAD_OF_RESIZE_MARGIN` of it are dropped as near-duplicates, and the
|
|
136
|
+
* untransformed URL closes the list at its real width. That last candidate costs no
|
|
137
|
+
* render and is the only one that can serve the image sharp at full size.
|
|
94
138
|
*
|
|
95
139
|
* Returns an empty string when the URL is not an asset link, when it already carries
|
|
96
140
|
* a transformation (the width was configured upstream), or when it is an animated GIF
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
export type CxGraphViewNodeAction = { controlType: 'default' | 'switch'; icon: string; id: string; name: string; showDivider: boolean; style: { color: string; }; };
|
|
23
23
|
export type CxGraphViewRecord = any;
|
|
24
24
|
export type CxGraphViewSummary = { icon: string; texts: string[]; };
|
|
25
|
-
export type CxMasonryMasonryItem = { alt: string; extension: string; hasError: boolean; id: string; loading: boolean; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; src: string; };
|
|
25
|
+
export type CxMasonryMasonryItem = { alt: string; extension: string; hasError: boolean; id: string; loading: boolean; maxWidth: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; size: string; src: string; };
|
|
26
26
|
export type CxMasonryMasonryItemAction = { color: string; event: string; icon: string; src: string; tooltip: string; };
|
|
27
27
|
export type CxMentionsAutocompleteItem = { id: string; label: string; name: string; suffixContent: string; suffixIcon: string; suffixTooltip: string; suffixType: 'badge'; title: string; type: string; };
|
|
28
28
|
export type CxMultiSelectColumnData = { id: string; items: { disabled: boolean; group: string; id: string; index: string; text: string; tooltip: string; type: string; }[]; sort: boolean; title: string; };
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
export type CxAssetLinkFormatFocusMode = { auto: boolean; label: string; value: string; };
|
|
34
34
|
export type CxAssetLinkFormatProxy = { cdnName: string; extension: string; formatHeight: number; formatWidth: number; height: number; id: string; permanentLink: string; proxyLabel: string; proxyName: string; width: number; };
|
|
35
35
|
export type CxAssetLinkFormatTransformation = { key: 'Crop' | 'Metadata' | 'Proxy' | 'Quality' | 'Resize' | 'Rotate'; value: { disabledSize: boolean; focusMode: string; height: number; isFocusModeAuto: boolean; keepMetadata: boolean; mode: string; position: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'center-center' | 'center-left' | 'center-right' | 'top-center' | 'top-left' | 'top-right'; quality: number; ratioHeight: number; ratioWidth: number; rotation: number; unit: '%' | 'px'; width: number; x: number; y: number; }; };
|
|
36
|
-
export type CxBentoGridGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; docType: '' | 'Album' | 'Audio' | 'Audio segment' | 'Image' | 'Multimedia' | 'ProjectDocument' | 'Story' | 'Video' | 'Widget'; extension: string; filler: boolean; header: string; id: string; isClone: boolean; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
37
|
-
export type CxCarouselGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; docType: '' | 'Album' | 'Audio' | 'Audio segment' | 'Image' | 'Multimedia' | 'ProjectDocument' | 'Story' | 'Video' | 'Widget'; extension: string; filler: boolean; header: string; id: string; isClone: boolean; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
36
|
+
export type CxBentoGridGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; docType: '' | 'Album' | 'Audio' | 'Audio segment' | 'Image' | 'Multimedia' | 'ProjectDocument' | 'Story' | 'Video' | 'Widget'; extension: string; filler: boolean; header: string; id: string; isClone: boolean; maxWidth: string; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
37
|
+
export type CxCarouselGalleryItem = { additions: string[]; alt: string; cardType: 'asset' | 'folder' | 'link' | 'page' | 'space'; className: string; details: string; docType: '' | 'Album' | 'Audio' | 'Audio segment' | 'Image' | 'Multimedia' | 'ProjectDocument' | 'Story' | 'Video' | 'Widget'; extension: string; filler: boolean; header: string; id: string; isClone: boolean; maxWidth: string; name: string; objectFit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; openInNewTab: boolean; pageId: string; rawId: string; size: string; src: string; url: string; };
|
|
38
38
|
export type CxChatbotChatbotEvent = { event: string; excludedFromPurposes: string[]; label: string; };
|
|
39
39
|
export type CxTableTimeFormatterParams = { color: string; fontSize: string; fontWeight: string; inputUnit: string; locale: string; placeholder: string; style: dictionary; unitsFormat: string; displayStyle: string; paramsMapField: string; paramsMap: dictionary; };
|
|
40
40
|
export type CxTableTextFormatParams = { colorMap: dictionary; color: string; };
|
|
@@ -6762,7 +6762,7 @@
|
|
|
6762
6762
|
/**
|
|
6763
6763
|
* The key to use for the id of the items in the masonry layout.
|
|
6764
6764
|
*/
|
|
6765
|
-
idKey?: 'src' | 'extension' | 'loading' | 'alt' | 'hasError' | 'id' | 'objectFit';
|
|
6765
|
+
idKey?: 'src' | 'extension' | 'loading' | 'maxWidth' | 'size' | 'alt' | 'hasError' | 'id' | 'objectFit';
|
|
6766
6766
|
/**
|
|
6767
6767
|
* The proxy format the item images were resolved with. <br/> Only used to decide whether a `srcset` may be generated: an original-file format paired with an animated source must be delivered untouched.
|
|
6768
6768
|
*/
|