@orangelogic/orange-dam-content-browser-sdk 2.4.12 → 2.4.13
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/README.md +24 -0
- package/build/OrangeDAMContentBrowserSDK.min.js +377 -365
- package/build/api/asset/asset.d.ts +14 -1
- package/build/api/asset/asset.types.d.ts +3 -0
- package/build/components/content-browser/content-browser.d.ts +1 -1
- package/build/components/content-browser-format-dialog/content-browser-format-dialog.d.ts +11 -0
- package/build/content-browser.mjs +9769 -9699
- package/build/events/cx-content-browser-asset-link-error.d.ts +9 -0
- package/build/events/index.d.ts +1 -0
- package/build/index.d.ts +4 -1
- package/build/index.mjs +1925 -1849
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetAssetsRequest } from '../../types/asset';
|
|
2
2
|
import { type TitleFallback } from '../../types/content-browser';
|
|
3
|
-
import { GetAssetLinksRequest, GetAssetLinksResponse, GetAssetsByIDsRequest, GetAssetsByIDsResponse, GetAssetsResponse, GetAssetVersionHistoryResponse, GetAvailableExtensionsResponse, GetAvailableProxiesResponse } from './asset.types';
|
|
3
|
+
import { CortexErrorResponse, GetAssetLinksRequest, GetAssetLinksResponse, GetAssetsByIDsRequest, GetAssetsByIDsResponse, GetAssetsResponse, GetAssetVersionHistoryResponse, GetAvailableExtensionsResponse, GetAvailableProxiesResponse } from './asset.types';
|
|
4
4
|
export declare const DEFAULT_VIEW_SIZE = "CoreField.LargeSizePreview";
|
|
5
5
|
export declare const FIELD_ALLOW_ATS_LINK = "AllowATSLink";
|
|
6
6
|
export declare const FIELD_CORTEX_PATH = "Document.CortexPath";
|
|
@@ -37,6 +37,19 @@ export declare function resolveAssetExtraFilters(selectedFacets?: Record<string,
|
|
|
37
37
|
SubtypeCriteria?: string[];
|
|
38
38
|
FacetFilters?: Record<string, string[]>;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* A GetAssetLink failure. `errorCode` and `serverMessage` are set only when Cortex sent an error body.
|
|
42
|
+
*/
|
|
43
|
+
export declare class AssetLinkError extends Error {
|
|
44
|
+
readonly errorCode?: CortexErrorResponse['ErrorCode'];
|
|
45
|
+
readonly serverMessage?: string;
|
|
46
|
+
constructor(message: string, { errorCode, serverMessage }?: {
|
|
47
|
+
errorCode?: CortexErrorResponse['ErrorCode'];
|
|
48
|
+
serverMessage?: string;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Convert any GetAssetLink failure to an AssetLinkError, and keep the Cortex error body when there is one. */
|
|
52
|
+
export declare function toAssetLinkError(error: unknown): AssetLinkError;
|
|
40
53
|
export declare function apiGetAssetLinks({ assets, extension, extraFields, parameters, permanentLink, proxyPreference, skipLinkGeneration, transformations, useSession, }: GetAssetLinksRequest): Promise<GetAssetLinksResponse>;
|
|
41
54
|
export declare function apiGetAssetsByIDs({ extraFields, recordIds, }: GetAssetsByIDsRequest): Promise<GetAssetsByIDsResponse>;
|
|
42
55
|
export declare const ASSET_LIST_FIELDS: string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AssetLinkError } from './asset';
|
|
1
2
|
import { Asset, AssetVersion, AvailableProxy, MediaType, TrackingParameter } from '../../types/asset';
|
|
2
3
|
import { Facet, Transformation } from '../../types/content-browser';
|
|
3
4
|
export type CortexErrorResponse = {
|
|
@@ -36,6 +37,8 @@ export type GetAssetLinkResponse = {
|
|
|
36
37
|
};
|
|
37
38
|
export type GetAssetLinksResponse = {
|
|
38
39
|
data: GetAssetLinkResponse[];
|
|
40
|
+
/** The first failure, in asset order. Set only when `isError` is true. */
|
|
41
|
+
error?: AssetLinkError;
|
|
39
42
|
isError: boolean;
|
|
40
43
|
};
|
|
41
44
|
export type GetContentResponse = {
|
|
@@ -225,7 +225,7 @@ export default class CxContentBrowser extends CortexElement {
|
|
|
225
225
|
*/
|
|
226
226
|
private handlePinAssetChange;
|
|
227
227
|
private handleProxyConfirm;
|
|
228
|
-
private
|
|
228
|
+
private reportConfirmFailure;
|
|
229
229
|
private handleFormatConfirm;
|
|
230
230
|
private handleFormatDialogClose;
|
|
231
231
|
private handleSelectedAsset;
|
|
@@ -2,10 +2,12 @@ import { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
2
2
|
import CortexElement from '../../base/element';
|
|
3
3
|
import { GetAvailableExtensionsResponse } from '../../api/asset/asset.types';
|
|
4
4
|
import { Asset, AssetVersion, AvailableProxy } from '../../types/asset';
|
|
5
|
+
import CxAlert from '@orangelogic/design-system/components/alert';
|
|
5
6
|
import CxAssetLinkFormat from '@orangelogic/design-system/components/asset-link-format';
|
|
6
7
|
import CxCropper from '@orangelogic/design-system/components/cropper';
|
|
7
8
|
import CxDialog from '@orangelogic/design-system/components/dialog';
|
|
8
9
|
import CxDrawer from '@orangelogic/design-system/components/drawer';
|
|
10
|
+
import CxIcon from '@orangelogic/design-system/components/icon';
|
|
9
11
|
import CxIconButton from '@orangelogic/design-system/components/icon-button';
|
|
10
12
|
import CxLineClamp from '@orangelogic/design-system/components/line-clamp';
|
|
11
13
|
import CxSpace from '@orangelogic/design-system/components/space';
|
|
@@ -19,6 +21,7 @@ import { type Parameter, type Transformation, type CtaTextTransform, type AutoSe
|
|
|
19
21
|
export default class CxContentBrowserFormatDialog extends CortexElement {
|
|
20
22
|
static readonly styles: CSSResultGroup;
|
|
21
23
|
static readonly dependencies: {
|
|
24
|
+
'cx-alert': typeof CxAlert;
|
|
22
25
|
'cx-asset-link-format': typeof CxAssetLinkFormat;
|
|
23
26
|
'cx-cropper': typeof CxCropper;
|
|
24
27
|
'cx-content-browser-asset-preview': typeof CxContentBrowserAssetPreview;
|
|
@@ -26,6 +29,7 @@ export default class CxContentBrowserFormatDialog extends CortexElement {
|
|
|
26
29
|
'cx-content-browser-asset-version-history': typeof CxContentBrowserAssetVersionHistory;
|
|
27
30
|
'cx-dialog': typeof CxDialog;
|
|
28
31
|
'cx-drawer': typeof CxDrawer;
|
|
32
|
+
'cx-icon': typeof CxIcon;
|
|
29
33
|
'cx-icon-button': typeof CxIconButton;
|
|
30
34
|
'cx-line-clamp': typeof CxLineClamp;
|
|
31
35
|
'cx-space': typeof CxSpace;
|
|
@@ -95,6 +99,8 @@ export default class CxContentBrowserFormatDialog extends CortexElement {
|
|
|
95
99
|
extension?: string | null;
|
|
96
100
|
} | undefined;
|
|
97
101
|
loadingConfirm: boolean;
|
|
102
|
+
/** Set when the last confirm failed. An empty string shows the generic error text. */
|
|
103
|
+
confirmError: string | undefined;
|
|
98
104
|
enabledTracking: boolean;
|
|
99
105
|
trackingParameters: Parameter[];
|
|
100
106
|
private get shouldAppendAutoExtension();
|
|
@@ -138,6 +144,11 @@ export default class CxContentBrowserFormatDialog extends CortexElement {
|
|
|
138
144
|
setIsFavorite(isFavorite: boolean): void;
|
|
139
145
|
setIsAssetPinned(isAssetPinned: boolean): void;
|
|
140
146
|
setLoadingConfirm(loadingConfirm: boolean): void;
|
|
147
|
+
/**
|
|
148
|
+
* Show why the last confirm failed, and make the confirm button usable again for a retry.
|
|
149
|
+
* Without a message, the dialog shows a generic error text.
|
|
150
|
+
*/
|
|
151
|
+
showConfirmError(message?: string): void;
|
|
141
152
|
mapFormatConfirmPayload(asset: Asset, selectedProxy?: AvailableProxy): {
|
|
142
153
|
asset: Asset;
|
|
143
154
|
extension: string;
|