@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
package/README.md
CHANGED
|
@@ -108,6 +108,30 @@ setting is simply ignored. Because no GetAssetLink request is made, only the com
|
|
|
108
108
|
`extraFields` (`ScrubUrl` and `AllowATSLink`) are returned in this mode -- request any
|
|
109
109
|
other field with `simplePick` off.
|
|
110
110
|
|
|
111
|
+
## Errors on Confirm (`onError`)
|
|
112
|
+
|
|
113
|
+
When the asset link request of a confirm fails, the SDK does not call `onAssetSelected`.
|
|
114
|
+
The dialog stays open and shows the error, and its confirm button becomes usable again.
|
|
115
|
+
The SDK also calls `onError(errorMessage, error)`:
|
|
116
|
+
|
|
117
|
+
```html
|
|
118
|
+
<script>
|
|
119
|
+
OrangeDAMContentBrowser.open({
|
|
120
|
+
containerId: 'asset-picker',
|
|
121
|
+
onAssetSelected: (assets) => console.log(assets),
|
|
122
|
+
onError: (errorMessage, error) => {
|
|
123
|
+
// error.errorCode is the Cortex error code, for example 'OL_ERR_002_NOTALLOWED'.
|
|
124
|
+
console.error(errorMessage, error?.errorCode);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
</script>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`error` is an `AssetLinkError`. When Cortex sends an error body, `errorCode` and
|
|
131
|
+
`serverMessage` hold its `ErrorCode` and `Message`. For a network failure they are empty.
|
|
132
|
+
A successful response with no link is not an error: the asset goes to `onAssetSelected`
|
|
133
|
+
with its preview URL as `imageUrl`.
|
|
134
|
+
|
|
111
135
|
## Select Without an Asset Link (`skipLinkGeneration`)
|
|
112
136
|
|
|
113
137
|
Set `skipLinkGeneration: true` when the host needs the selected asset's fields, not a
|