@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/build/index.mjs
CHANGED
|
@@ -135,6 +135,7 @@ import CxSwitch from "@orangelogic/design-system/components/switch";
|
|
|
135
135
|
import CxTag from "@orangelogic/design-system/components/tag";
|
|
136
136
|
import CxTree from "@orangelogic/design-system/components/tree";
|
|
137
137
|
import CxTreeItem from "@orangelogic/design-system/components/tree-item";
|
|
138
|
+
import CxAlert from "@orangelogic/design-system/components/alert";
|
|
138
139
|
import CxAssetLinkFormat from "@orangelogic/design-system/components/asset-link-format";
|
|
139
140
|
import CxCropper from "@orangelogic/design-system/components/cropper";
|
|
140
141
|
import CxDialog from "@orangelogic/design-system/components/dialog";
|
|
@@ -1223,212 +1224,6 @@ var camelCase = createCompounder(function(result, word, index) {
|
|
|
1223
1224
|
word = word.toLowerCase();
|
|
1224
1225
|
return result + (index ? capitalize(word) : word);
|
|
1225
1226
|
});
|
|
1226
|
-
var __defProp$i = Object.defineProperty;
|
|
1227
|
-
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
1228
|
-
var result = void 0;
|
|
1229
|
-
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
1230
|
-
if (decorator = decorators[i4])
|
|
1231
|
-
result = decorator(target, key, result) || result;
|
|
1232
|
-
if (result) __defProp$i(target, key, result);
|
|
1233
|
-
return result;
|
|
1234
|
-
};
|
|
1235
|
-
const _CortexElement = class _CortexElement extends i$4 {
|
|
1236
|
-
constructor() {
|
|
1237
|
-
super();
|
|
1238
|
-
this.theme = "light";
|
|
1239
|
-
this.preRender = false;
|
|
1240
|
-
Object.entries(
|
|
1241
|
-
this.constructor.dependencies
|
|
1242
|
-
).forEach(([name, component]) => {
|
|
1243
|
-
this.constructor.define(name, component);
|
|
1244
|
-
});
|
|
1245
|
-
this.handleThemeChange = this.handleThemeChange.bind(this);
|
|
1246
|
-
}
|
|
1247
|
-
emit(name, options) {
|
|
1248
|
-
const event = new CustomEvent(name, __spreadValues({
|
|
1249
|
-
bubbles: true,
|
|
1250
|
-
cancelable: false,
|
|
1251
|
-
composed: true,
|
|
1252
|
-
detail: {}
|
|
1253
|
-
}, options));
|
|
1254
|
-
this.dispatchEvent(event);
|
|
1255
|
-
return event;
|
|
1256
|
-
}
|
|
1257
|
-
static define(name, elementConstructor = this, options = {}) {
|
|
1258
|
-
const currentlyRegisteredConstructor = customElements.get(name);
|
|
1259
|
-
if (!currentlyRegisteredConstructor) {
|
|
1260
|
-
try {
|
|
1261
|
-
customElements.define(name, elementConstructor, options);
|
|
1262
|
-
} catch (error) {
|
|
1263
|
-
customElements.define(
|
|
1264
|
-
name,
|
|
1265
|
-
class extends elementConstructor {
|
|
1266
|
-
},
|
|
1267
|
-
options
|
|
1268
|
-
);
|
|
1269
|
-
}
|
|
1270
|
-
return;
|
|
1271
|
-
}
|
|
1272
|
-
let newVersion = " (unknown version)";
|
|
1273
|
-
let existingVersion = newVersion;
|
|
1274
|
-
if ("version" in elementConstructor && elementConstructor.version) {
|
|
1275
|
-
newVersion = " v" + elementConstructor.version;
|
|
1276
|
-
}
|
|
1277
|
-
if ("version" in currentlyRegisteredConstructor && currentlyRegisteredConstructor.version) {
|
|
1278
|
-
existingVersion = " v" + currentlyRegisteredConstructor.version;
|
|
1279
|
-
}
|
|
1280
|
-
if (newVersion && existingVersion && newVersion === existingVersion) {
|
|
1281
|
-
return;
|
|
1282
|
-
}
|
|
1283
|
-
console.warn(
|
|
1284
|
-
`Attempted to register <${name}>${newVersion}, but <${name}>${existingVersion} has already been registered.`
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
static createProperty(name, options) {
|
|
1288
|
-
super.createProperty(name, options);
|
|
1289
|
-
if ((options == null ? void 0 : options.attribute) && typeof options.attribute === "string" && !Object.prototype.hasOwnProperty.call(
|
|
1290
|
-
this.prototype,
|
|
1291
|
-
options.attribute
|
|
1292
|
-
) && Object.prototype.hasOwnProperty.call(this.prototype, name)) {
|
|
1293
|
-
Object.defineProperty(this.prototype, options.attribute, {
|
|
1294
|
-
get() {
|
|
1295
|
-
return this[name];
|
|
1296
|
-
},
|
|
1297
|
-
set(v2) {
|
|
1298
|
-
this[name] = v2;
|
|
1299
|
-
}
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
firstUpdated(_changedProperties) {
|
|
1304
|
-
super.firstUpdated(_changedProperties);
|
|
1305
|
-
if (this.preRender) {
|
|
1306
|
-
return;
|
|
1307
|
-
}
|
|
1308
|
-
this.runFirstUpdated(_changedProperties);
|
|
1309
|
-
}
|
|
1310
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1311
|
-
runFirstUpdated(_changedProperties) {
|
|
1312
|
-
}
|
|
1313
|
-
connectedUpdatedCallback() {
|
|
1314
|
-
}
|
|
1315
|
-
runConnectedCallback() {
|
|
1316
|
-
}
|
|
1317
|
-
adoptedCallback() {
|
|
1318
|
-
rescueElementPrototype(this);
|
|
1319
|
-
}
|
|
1320
|
-
connectedCallback() {
|
|
1321
|
-
super.connectedCallback();
|
|
1322
|
-
if ("addEventListener" in globalThis) {
|
|
1323
|
-
globalThis.addEventListener("cx-theme-change", this.handleThemeChange);
|
|
1324
|
-
}
|
|
1325
|
-
if (this.preRender) {
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
this.runConnectedCallback();
|
|
1329
|
-
this.updateComplete.then(() => {
|
|
1330
|
-
this.connectedUpdatedCallback();
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
disconnectedCallback() {
|
|
1334
|
-
super.disconnectedCallback();
|
|
1335
|
-
if ("removeEventListener" in globalThis) {
|
|
1336
|
-
globalThis.removeEventListener("cx-theme-change", this.handleThemeChange);
|
|
1337
|
-
}
|
|
1338
|
-
rescueElementPrototype(this);
|
|
1339
|
-
}
|
|
1340
|
-
handleThemeChange(event) {
|
|
1341
|
-
this.theme = event.detail.theme;
|
|
1342
|
-
}
|
|
1343
|
-
getTheme() {
|
|
1344
|
-
if ("getComputedStyle" in globalThis) {
|
|
1345
|
-
const computedStyle = getComputedStyle(
|
|
1346
|
-
globalThis.document.documentElement
|
|
1347
|
-
);
|
|
1348
|
-
return (computedStyle == null ? void 0 : computedStyle.colorScheme) === "dark" ? "dark" : "light";
|
|
1349
|
-
}
|
|
1350
|
-
return "light";
|
|
1351
|
-
}
|
|
1352
|
-
getState(key) {
|
|
1353
|
-
return this[key];
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
_CortexElement.version = "1";
|
|
1357
|
-
_CortexElement.dependencies = {};
|
|
1358
|
-
let CortexElement = _CortexElement;
|
|
1359
|
-
__decorateClass$i([
|
|
1360
|
-
n$6()
|
|
1361
|
-
], CortexElement.prototype, "dir");
|
|
1362
|
-
__decorateClass$i([
|
|
1363
|
-
n$6()
|
|
1364
|
-
], CortexElement.prototype, "lang");
|
|
1365
|
-
__decorateClass$i([
|
|
1366
|
-
n$6()
|
|
1367
|
-
], CortexElement.prototype, "theme");
|
|
1368
|
-
__decorateClass$i([
|
|
1369
|
-
n$6({ attribute: "pre-render", type: Boolean })
|
|
1370
|
-
], CortexElement.prototype, "preRender");
|
|
1371
|
-
function rescueElementPrototype(element) {
|
|
1372
|
-
if (element instanceof CortexElement) {
|
|
1373
|
-
return;
|
|
1374
|
-
}
|
|
1375
|
-
const tagName = element.localName || element.tagName;
|
|
1376
|
-
const constructor = customElements.get(tagName.toLowerCase());
|
|
1377
|
-
if (constructor) {
|
|
1378
|
-
Object.setPrototypeOf(element, constructor.prototype);
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
/**
|
|
1382
|
-
* @license
|
|
1383
|
-
* Copyright 2017 Google LLC
|
|
1384
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1385
|
-
*/
|
|
1386
|
-
const t$4 = { ATTRIBUTE: 1, CHILD: 2 }, e$6 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
|
|
1387
|
-
let i$3 = class i2 {
|
|
1388
|
-
constructor(t2) {
|
|
1389
|
-
}
|
|
1390
|
-
get _$AU() {
|
|
1391
|
-
return this._$AM._$AU;
|
|
1392
|
-
}
|
|
1393
|
-
_$AT(t2, e2, i4) {
|
|
1394
|
-
this._$Ct = t2, this._$AM = e2, this._$Ci = i4;
|
|
1395
|
-
}
|
|
1396
|
-
_$AS(t2, e2) {
|
|
1397
|
-
return this.update(t2, e2);
|
|
1398
|
-
}
|
|
1399
|
-
update(t2, e2) {
|
|
1400
|
-
return this.render(...e2);
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
/**
|
|
1404
|
-
* @license
|
|
1405
|
-
* Copyright 2018 Google LLC
|
|
1406
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1407
|
-
*/
|
|
1408
|
-
const e$5 = e$6(class extends i$3 {
|
|
1409
|
-
constructor(t2) {
|
|
1410
|
-
var _a2;
|
|
1411
|
-
if (super(t2), t2.type !== t$4.ATTRIBUTE || "class" !== t2.name || ((_a2 = t2.strings) == null ? void 0 : _a2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
1412
|
-
}
|
|
1413
|
-
render(t2) {
|
|
1414
|
-
return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " ";
|
|
1415
|
-
}
|
|
1416
|
-
update(s2, [i4]) {
|
|
1417
|
-
var _a2, _b2;
|
|
1418
|
-
if (void 0 === this.st) {
|
|
1419
|
-
this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2)));
|
|
1420
|
-
for (const t2 in i4) i4[t2] && !((_a2 = this.nt) == null ? void 0 : _a2.has(t2)) && this.st.add(t2);
|
|
1421
|
-
return this.render(i4);
|
|
1422
|
-
}
|
|
1423
|
-
const r2 = s2.element.classList;
|
|
1424
|
-
for (const t2 of this.st) t2 in i4 || (r2.remove(t2), this.st.delete(t2));
|
|
1425
|
-
for (const t2 in i4) {
|
|
1426
|
-
const s3 = !!i4[t2];
|
|
1427
|
-
s3 === this.st.has(t2) || ((_b2 = this.nt) == null ? void 0 : _b2.has(t2)) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2)));
|
|
1428
|
-
}
|
|
1429
|
-
return E;
|
|
1430
|
-
}
|
|
1431
|
-
});
|
|
1432
1227
|
function bind(fn, thisArg) {
|
|
1433
1228
|
return function wrap() {
|
|
1434
1229
|
return fn.apply(thisArg, arguments);
|
|
@@ -4097,13 +3892,13 @@ const {
|
|
|
4097
3892
|
getAdapter,
|
|
4098
3893
|
mergeConfig
|
|
4099
3894
|
} = axios;
|
|
4100
|
-
var e$
|
|
3895
|
+
var e$6 = Symbol("cache-parser");
|
|
4101
3896
|
function r$5(e2, r2) {
|
|
4102
3897
|
(null == r2 || r2 > e2.length) && (r2 = e2.length);
|
|
4103
3898
|
for (var t2 = 0, a2 = Array(r2); t2 < r2; t2++) a2[t2] = e2[t2];
|
|
4104
3899
|
return a2;
|
|
4105
3900
|
}
|
|
4106
|
-
function t$
|
|
3901
|
+
function t$4(e2) {
|
|
4107
3902
|
return ("string" == typeof e2 || "number" == typeof e2) && (e2 = Number(e2)) >= 0 && e2 < Number.POSITIVE_INFINITY;
|
|
4108
3903
|
}
|
|
4109
3904
|
function a(e2) {
|
|
@@ -4111,7 +3906,7 @@ function a(e2) {
|
|
|
4111
3906
|
}
|
|
4112
3907
|
var n$4 = Number;
|
|
4113
3908
|
function o$4(o2) {
|
|
4114
|
-
var i4 = Object.defineProperty({}, e$
|
|
3909
|
+
var i4 = Object.defineProperty({}, e$6, { enumerable: false, value: 1 });
|
|
4115
3910
|
if (!o2 || "string" != typeof o2) return i4;
|
|
4116
3911
|
var s2 = (function(e2) {
|
|
4117
3912
|
for (var t2, a2 = {}, n3 = (function(e3) {
|
|
@@ -4137,10 +3932,10 @@ function o$4(o2) {
|
|
|
4137
3932
|
}
|
|
4138
3933
|
return a2;
|
|
4139
3934
|
})(o2), u2 = s2["max-age"], l2 = s2["max-stale"], m2 = s2["min-fresh"], p2 = s2["s-maxage"], f3 = s2["stale-if-error"], c2 = s2["stale-while-revalidate"];
|
|
4140
|
-
return a(s2.immutable) && (i4.immutable = true), t$
|
|
3935
|
+
return a(s2.immutable) && (i4.immutable = true), t$4(u2) && (i4.maxAge = n$4(u2)), t$4(l2) && (i4.maxStale = n$4(l2)), t$4(m2) && (i4.minFresh = n$4(m2)), a(s2["must-revalidate"]) && (i4.mustRevalidate = true), a(s2["must-understand"]) && (i4.mustUnderstand = true), a(s2["no-cache"]) && (i4.noCache = true), a(s2["no-store"]) && (i4.noStore = true), a(s2["no-transform"]) && (i4.noTransform = true), a(s2["only-if-cached"]) && (i4.onlyIfCached = true), a(s2.private) && (i4.private = true), a(s2["proxy-revalidate"]) && (i4.proxyRevalidate = true), a(s2.public) && (i4.public = true), t$4(p2) && (i4.sMaxAge = n$4(p2)), t$4(f3) && (i4.staleIfError = n$4(f3)), t$4(c2) && (i4.staleWhileRevalidate = n$4(c2)), i4;
|
|
4141
3936
|
}
|
|
4142
3937
|
var r$4 = Symbol();
|
|
4143
|
-
function e$
|
|
3938
|
+
function e$5() {
|
|
4144
3939
|
var e2, n3, o2 = new Promise(function(r2, o3) {
|
|
4145
3940
|
e2 = r2, n3 = o3;
|
|
4146
3941
|
});
|
|
@@ -4151,7 +3946,7 @@ function r$3(r2, e2) {
|
|
|
4151
3946
|
for (var t2 = 0, n3 = Array(e2); t2 < e2; t2++) n3[t2] = r2[t2];
|
|
4152
3947
|
return n3;
|
|
4153
3948
|
}
|
|
4154
|
-
function e$
|
|
3949
|
+
function e$4(e2, t2) {
|
|
4155
3950
|
var n3 = "undefined" != typeof Symbol && e2[Symbol.iterator] || e2["@@iterator"];
|
|
4156
3951
|
if (n3) return (n3 = n3.call(e2)).next.bind(n3);
|
|
4157
3952
|
if (Array.isArray(e2) || (n3 = (function(e3, t3) {
|
|
@@ -4169,10 +3964,10 @@ function e$2(e2, t2) {
|
|
|
4169
3964
|
}
|
|
4170
3965
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4171
3966
|
}
|
|
4172
|
-
function t$
|
|
3967
|
+
function t$3(r2, t2, n3) {
|
|
4173
3968
|
if ("*" === r2 || null === r2) return false;
|
|
4174
|
-
for (var o2, a2 = Object.keys(t2), i4 = Object.keys(n3), l2 = e$
|
|
4175
|
-
for (var u2, f3 = o2.value, v2 = void 0, d2 = void 0, s2 = e$
|
|
3969
|
+
for (var o2, a2 = Object.keys(t2), i4 = Object.keys(n3), l2 = e$4(r2); !(o2 = l2()).done; ) {
|
|
3970
|
+
for (var u2, f3 = o2.value, v2 = void 0, d2 = void 0, s2 = e$4(a2); !(u2 = s2()).done; ) {
|
|
4176
3971
|
var c2 = u2.value;
|
|
4177
3972
|
if (c2.toLowerCase() === f3) {
|
|
4178
3973
|
var y3;
|
|
@@ -4180,7 +3975,7 @@ function t$2(r2, t2, n3) {
|
|
|
4180
3975
|
break;
|
|
4181
3976
|
}
|
|
4182
3977
|
}
|
|
4183
|
-
for (var b2, m2 = e$
|
|
3978
|
+
for (var b2, m2 = e$4(i4); !(b2 = m2()).done; ) {
|
|
4184
3979
|
var g2 = b2.value;
|
|
4185
3980
|
if (g2.toLowerCase() === f3) {
|
|
4186
3981
|
var h2;
|
|
@@ -4206,34 +4001,34 @@ function o$3(r2, e2) {
|
|
|
4206
4001
|
}
|
|
4207
4002
|
return 0 === t2.size ? null : Array.from(t2);
|
|
4208
4003
|
}
|
|
4209
|
-
function t$
|
|
4004
|
+
function t$2(t2, r2) {
|
|
4210
4005
|
return t2 > r2 ? 1 : -1;
|
|
4211
4006
|
}
|
|
4212
4007
|
function r$2(r2, n3) {
|
|
4213
|
-
return t$
|
|
4008
|
+
return t$2(String(r2[0]), String(n3[0]));
|
|
4214
4009
|
}
|
|
4215
4010
|
function n$2(t2, r2) {
|
|
4216
4011
|
return 33 * t2 ^ r2;
|
|
4217
4012
|
}
|
|
4218
|
-
function e$
|
|
4013
|
+
function e$3(o2, i4) {
|
|
4219
4014
|
var f3 = 5381;
|
|
4220
4015
|
if ("object" == typeof o2 && null !== o2) {
|
|
4221
4016
|
var u2 = "function" == typeof o2.entries, a2 = Object.keys(o2).length > 0;
|
|
4222
4017
|
if (o2.toString === Object.prototype.toString || o2.toString === Array.prototype.toString || u2 && !a2) {
|
|
4223
4018
|
i4 || (i4 = /* @__PURE__ */ new WeakSet()), i4.add(o2);
|
|
4224
|
-
var c2 = u2 && !a2 ? Array.from(o2.entries()) : Object.keys(o2).sort(t$
|
|
4019
|
+
var c2 = u2 && !a2 ? Array.from(o2.entries()) : Object.keys(o2).sort(t$2).map(function(t2) {
|
|
4225
4020
|
return [t2, o2[t2]];
|
|
4226
4021
|
});
|
|
4227
4022
|
u2 && !a2 && c2.sort(r$2);
|
|
4228
4023
|
for (var g2 = 0; g2 < c2.length; g2++) {
|
|
4229
4024
|
var y3 = c2[g2], p2 = y3[1];
|
|
4230
|
-
if (f3 = n$2(f3, e$
|
|
4025
|
+
if (f3 = n$2(f3, e$3(y3[0], i4)), "object" == typeof p2 && null !== p2 && (p2.toString === Object.prototype.toString || p2.toString === Array.prototype.toString)) {
|
|
4231
4026
|
if (i4.has(p2)) continue;
|
|
4232
4027
|
i4.add(p2);
|
|
4233
4028
|
}
|
|
4234
|
-
f3 = n$2(f3, e$
|
|
4029
|
+
f3 = n$2(f3, e$3(p2, i4));
|
|
4235
4030
|
}
|
|
4236
|
-
return n$2(f3, e$
|
|
4031
|
+
return n$2(f3, e$3(o2.constructor, i4));
|
|
4237
4032
|
}
|
|
4238
4033
|
}
|
|
4239
4034
|
for (var S3, b2 = typeof o2, l2 = 0; l2 < b2.length; l2++) f3 = n$2(f3, b2.charCodeAt(l2));
|
|
@@ -4388,7 +4183,7 @@ function defaultRequestInterceptor(axios2) {
|
|
|
4388
4183
|
const overrideCache = config.cache.override;
|
|
4389
4184
|
if (config.cache.vary !== false && ((_b2 = (_a2 = cache.data) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.vary) && cache.data.headers[Header.Vary]) {
|
|
4390
4185
|
const vary = Array.isArray(config.cache.vary) ? config.cache.vary : o$3(cache.data.headers[Header.Vary]);
|
|
4391
|
-
if (vary && vary !== "*" && !t$
|
|
4186
|
+
if (vary && vary !== "*" && !t$3(vary, (_c2 = cache.data.meta) == null ? void 0 : _c2.vary, config.headers)) {
|
|
4392
4187
|
const extractedHeaders = extractHeaders(config.headers, vary);
|
|
4393
4188
|
const newKey = axios2.generateKey(__spreadProps(__spreadValues({}, config), {
|
|
4394
4189
|
id: void 0
|
|
@@ -4404,7 +4199,7 @@ function defaultRequestInterceptor(axios2) {
|
|
|
4404
4199
|
cache = yield axios2.storage.get(config.id, config);
|
|
4405
4200
|
if (cache.state !== "empty" && cache.state !== "must-revalidate") break ignoreAndRequest;
|
|
4406
4201
|
}
|
|
4407
|
-
const def = e$
|
|
4202
|
+
const def = e$5();
|
|
4408
4203
|
axios2.waiting.set(config.id, def);
|
|
4409
4204
|
def.catch(() => void 0);
|
|
4410
4205
|
yield axios2.storage.set(config.id, {
|
|
@@ -4433,7 +4228,7 @@ function defaultRequestInterceptor(axios2) {
|
|
|
4433
4228
|
if (!state.data) return onFulfilled(config);
|
|
4434
4229
|
if (config.cache.vary !== false && ((_h = state.data.meta) == null ? void 0 : _h.vary) && state.data.headers[Header.Vary]) {
|
|
4435
4230
|
const vary = Array.isArray(config.cache.vary) ? config.cache.vary : o$3(state.data.headers[Header.Vary]);
|
|
4436
|
-
if (vary && vary !== "*" && !t$
|
|
4231
|
+
if (vary && vary !== "*" && !t$3(vary, state.data.meta.vary, config.headers)) return onFulfilled(config);
|
|
4437
4232
|
}
|
|
4438
4233
|
cachedResponse = state.data;
|
|
4439
4234
|
} catch (err) {
|
|
@@ -4752,7 +4547,7 @@ function buildKeyGenerator(generator) {
|
|
|
4752
4547
|
if (request.id) return request.id;
|
|
4753
4548
|
const key = generator(request, meta);
|
|
4754
4549
|
if (typeof key === "string" || typeof key === "number") return `${key}`;
|
|
4755
|
-
return `${e$
|
|
4550
|
+
return `${e$3(key)}`;
|
|
4756
4551
|
};
|
|
4757
4552
|
}
|
|
4758
4553
|
const defaultKeyGenerator = buildKeyGenerator(({ baseURL, url, method, params, data }, meta) => {
|
|
@@ -4830,6 +4625,86 @@ instance.interceptors.response.use(
|
|
|
4830
4625
|
}
|
|
4831
4626
|
);
|
|
4832
4627
|
const http = setupCache(instance);
|
|
4628
|
+
var OptionType = /* @__PURE__ */ ((OptionType2) => {
|
|
4629
|
+
OptionType2["FILTER"] = "filter";
|
|
4630
|
+
OptionType2["SORT_DIRECTION"] = "sort-direction";
|
|
4631
|
+
OptionType2["SORT_ORDER"] = "sort-order";
|
|
4632
|
+
return OptionType2;
|
|
4633
|
+
})(OptionType || {});
|
|
4634
|
+
var GridView$1 = /* @__PURE__ */ ((GridView2) => {
|
|
4635
|
+
GridView2["Large"] = "large";
|
|
4636
|
+
GridView2["Medium"] = "medium";
|
|
4637
|
+
GridView2["Small"] = "small";
|
|
4638
|
+
return GridView2;
|
|
4639
|
+
})(GridView$1 || {});
|
|
4640
|
+
const TABLE_VIEW = "table";
|
|
4641
|
+
const ASSET_SIZE = {
|
|
4642
|
+
[
|
|
4643
|
+
"small"
|
|
4644
|
+
/* Small */
|
|
4645
|
+
]: {
|
|
4646
|
+
maxWidth: 178,
|
|
4647
|
+
minWidth: 130
|
|
4648
|
+
},
|
|
4649
|
+
[
|
|
4650
|
+
"medium"
|
|
4651
|
+
/* Medium */
|
|
4652
|
+
]: {
|
|
4653
|
+
maxWidth: 292,
|
|
4654
|
+
minWidth: 190
|
|
4655
|
+
},
|
|
4656
|
+
[
|
|
4657
|
+
"large"
|
|
4658
|
+
/* Large */
|
|
4659
|
+
]: {
|
|
4660
|
+
maxWidth: 456,
|
|
4661
|
+
minWidth: 302
|
|
4662
|
+
}
|
|
4663
|
+
};
|
|
4664
|
+
var TransformationAction = /* @__PURE__ */ ((TransformationAction2) => {
|
|
4665
|
+
TransformationAction2["Crop"] = "Crop";
|
|
4666
|
+
TransformationAction2["Metadata"] = "Metadata";
|
|
4667
|
+
TransformationAction2["Proxy"] = "Proxy";
|
|
4668
|
+
TransformationAction2["Quality"] = "Quality";
|
|
4669
|
+
TransformationAction2["Resize"] = "Resize";
|
|
4670
|
+
TransformationAction2["Rotate"] = "Rotate";
|
|
4671
|
+
return TransformationAction2;
|
|
4672
|
+
})(TransformationAction || {});
|
|
4673
|
+
const autoSelectFormatConverter = {
|
|
4674
|
+
fromAttribute: (value) => {
|
|
4675
|
+
if (value === null) {
|
|
4676
|
+
return false;
|
|
4677
|
+
}
|
|
4678
|
+
const normalized = value.trim();
|
|
4679
|
+
if (normalized === "" || normalized.toLowerCase() === "true") {
|
|
4680
|
+
return true;
|
|
4681
|
+
}
|
|
4682
|
+
if (normalized.toLowerCase() === "false") {
|
|
4683
|
+
return false;
|
|
4684
|
+
}
|
|
4685
|
+
return normalized;
|
|
4686
|
+
},
|
|
4687
|
+
toAttribute: (value) => {
|
|
4688
|
+
return value === false ? null : String(value);
|
|
4689
|
+
}
|
|
4690
|
+
};
|
|
4691
|
+
function isAutoSelectFormatActive(value) {
|
|
4692
|
+
return value === true || typeof value === "string" && value.trim() !== "";
|
|
4693
|
+
}
|
|
4694
|
+
function toTitleFallback(value) {
|
|
4695
|
+
return value === "originalFileName" ? "originalFileName" : "uniqueIdentifier";
|
|
4696
|
+
}
|
|
4697
|
+
function toTableRowActionPosition(value) {
|
|
4698
|
+
return value === "row-end" ? "row-end" : "host-edge";
|
|
4699
|
+
}
|
|
4700
|
+
var ContentBrowserFormatDialogVariant = /* @__PURE__ */ ((ContentBrowserFormatDialogVariant2) => {
|
|
4701
|
+
ContentBrowserFormatDialogVariant2["Dialog"] = "dialog";
|
|
4702
|
+
ContentBrowserFormatDialogVariant2["Drawer"] = "drawer";
|
|
4703
|
+
return ContentBrowserFormatDialogVariant2;
|
|
4704
|
+
})(ContentBrowserFormatDialogVariant || {});
|
|
4705
|
+
function toFieldKey(field) {
|
|
4706
|
+
return field.trim().toLowerCase();
|
|
4707
|
+
}
|
|
4833
4708
|
const FOLDER_API_ENDPOINT = "webapi/extensibility/integrations/gab/assetbrowser/gethierarchy_41e8";
|
|
4834
4709
|
var AssetApiEndpoint = /* @__PURE__ */ ((AssetApiEndpoint2) => {
|
|
4835
4710
|
AssetApiEndpoint2["ADD_ASSET_TO_FAVORITE"] = "webapi/extensibility/integrations/contentBrowserSDK/addtofavorites_2du";
|
|
@@ -4853,183 +4728,432 @@ var MetadataApiEndpoint = /* @__PURE__ */ ((MetadataApiEndpoint2) => {
|
|
|
4853
4728
|
MetadataApiEndpoint2["GET_SORT_ORDERS"] = "webapi/extensibility/integrations/contentBrowserSDK/sortorders_4147";
|
|
4854
4729
|
return MetadataApiEndpoint2;
|
|
4855
4730
|
})(MetadataApiEndpoint || {});
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
const
|
|
4866
|
-
|
|
4867
|
-
|
|
4731
|
+
const appendPathAndQuery = (baseUrl, pathSuffix, extraQueryParams = []) => {
|
|
4732
|
+
const questionMarkIndex = baseUrl.indexOf("?");
|
|
4733
|
+
const hashIndex = baseUrl.indexOf("#");
|
|
4734
|
+
const separatorIndex = [questionMarkIndex, hashIndex].filter((index) => index !== -1).reduce((lowest, index) => lowest === -1 ? index : Math.min(lowest, index), -1);
|
|
4735
|
+
const path = separatorIndex === -1 ? baseUrl : baseUrl.slice(0, separatorIndex);
|
|
4736
|
+
const tail = separatorIndex === -1 ? "" : baseUrl.slice(separatorIndex);
|
|
4737
|
+
const tailHashIndex = tail.indexOf("#");
|
|
4738
|
+
const fragment = tailHashIndex === -1 ? "" : tail.slice(tailHashIndex);
|
|
4739
|
+
const existingQuery = (tailHashIndex === -1 ? tail : tail.slice(0, tailHashIndex)).replace(/^\?/, "");
|
|
4740
|
+
const parameterName = (parameter) => parameter.split("=")[0].toLowerCase();
|
|
4741
|
+
const overriddenNames = new Set(extraQueryParams.map(parameterName));
|
|
4742
|
+
const mergedParams = [
|
|
4743
|
+
...existingQuery.split("&").filter((parameter) => parameter && !overriddenNames.has(parameterName(parameter))),
|
|
4744
|
+
...extraQueryParams
|
|
4745
|
+
];
|
|
4746
|
+
const query = mergedParams.length > 0 ? `?${mergedParams.join("&")}` : "";
|
|
4747
|
+
return `${path}${pathSuffix}${query}${fragment}`;
|
|
4748
|
+
};
|
|
4749
|
+
const DEFAULT_VIEW_SIZE = "CoreField.LargeSizePreview";
|
|
4750
|
+
const FIELD_ALLOW_ATS_LINK = "AllowATSLink";
|
|
4751
|
+
const FIELD_DOC_CAPTION_LONG = "Document.CaptionLong";
|
|
4752
|
+
const FIELD_DOC_TITLE = "Document.Title";
|
|
4753
|
+
const FIELD_DOC_TYPE = "CoreField.DocType";
|
|
4754
|
+
const FIELD_EXTENSION = "Document.FileExtension";
|
|
4755
|
+
const FIELD_FILE_SIZE = "CoreField.FileSize";
|
|
4756
|
+
const FIELD_IDENTIFIER = "CoreField.Identifier";
|
|
4757
|
+
const FIELD_KEYWORDS = "CoreField.Keywords";
|
|
4758
|
+
const FIELD_MAX_HEIGHT = "CoreField.MaxHeight";
|
|
4759
|
+
const FIELD_MAX_WIDTH = "CoreField.MaxWidth";
|
|
4760
|
+
const FIELD_ORIGINAL_FILE_NAME = "CoreField.OriginalFileName";
|
|
4761
|
+
const FIELD_RECORD_ID = "Document.RecordID";
|
|
4762
|
+
const FIELD_SCRUB_URL = "ScrubURL";
|
|
4763
|
+
const FIELD_STORAGE_GROUP = "CoreField.S6_StorageGroup";
|
|
4764
|
+
const FIELD_SUBTYPE = "CoreField.DocSubType";
|
|
4765
|
+
const FIELD_TITLE_WITH_FALLBACK = "CoreField.TitleWithFallback";
|
|
4766
|
+
const FIELD_UPDATED_FILE_NAME = "CoreField.UpdatedFileName";
|
|
4767
|
+
const ORIGINAL_VIEW_SIZE = "CoreField.OriginalPreview";
|
|
4768
|
+
function resolveTitleFallbackField(titleFallback) {
|
|
4769
|
+
return titleFallback === "originalFileName" ? FIELD_ORIGINAL_FILE_NAME : FIELD_IDENTIFIER;
|
|
4770
|
+
}
|
|
4771
|
+
function resolveAssetCaption(fields, titleFallback) {
|
|
4772
|
+
return fields[FIELD_DOC_TITLE] || fields[resolveTitleFallbackField(titleFallback)] || fields[FIELD_IDENTIFIER] || "";
|
|
4773
|
+
}
|
|
4774
|
+
function resolveAssetExtraFilters(selectedFacets) {
|
|
4775
|
+
if (!selectedFacets || Object.keys(selectedFacets).length === 0) {
|
|
4776
|
+
return {};
|
|
4777
|
+
}
|
|
4778
|
+
return Object.entries(selectedFacets).reduce(
|
|
4779
|
+
(acc, [key, values]) => {
|
|
4780
|
+
if (!values || values.length === 0) {
|
|
4781
|
+
return acc;
|
|
4782
|
+
}
|
|
4783
|
+
if (key === "Types") {
|
|
4784
|
+
return __spreadProps(__spreadValues({}, acc), {
|
|
4785
|
+
SubtypeCriteria: values
|
|
4786
|
+
});
|
|
4787
|
+
}
|
|
4788
|
+
return __spreadProps(__spreadValues({}, acc), {
|
|
4789
|
+
FacetFilters: __spreadProps(__spreadValues({}, acc.FacetFilters), {
|
|
4790
|
+
[key]: values
|
|
4791
|
+
})
|
|
4792
|
+
});
|
|
4793
|
+
},
|
|
4794
|
+
{}
|
|
4795
|
+
);
|
|
4796
|
+
}
|
|
4797
|
+
class AssetLinkError extends Error {
|
|
4798
|
+
constructor(message, { errorCode, serverMessage } = {}) {
|
|
4799
|
+
super(message);
|
|
4800
|
+
this.name = "AssetLinkError";
|
|
4801
|
+
this.errorCode = errorCode;
|
|
4802
|
+
this.serverMessage = serverMessage;
|
|
4803
|
+
}
|
|
4804
|
+
}
|
|
4805
|
+
const ASSET_LINK_FAILED_MESSAGE = "Failed to get the asset link";
|
|
4806
|
+
function isCortexErrorResponse(response) {
|
|
4807
|
+
return !!response && typeof response === "object" && "ErrorCode" in response;
|
|
4808
|
+
}
|
|
4809
|
+
function fromCortexErrorResponse(response) {
|
|
4810
|
+
const serverMessage = typeof response.Message === "string" && response.Message.trim() ? response.Message : void 0;
|
|
4811
|
+
return new AssetLinkError(serverMessage != null ? serverMessage : ASSET_LINK_FAILED_MESSAGE, {
|
|
4812
|
+
errorCode: response.ErrorCode,
|
|
4813
|
+
serverMessage
|
|
4814
|
+
});
|
|
4815
|
+
}
|
|
4816
|
+
function toAssetLinkError(error) {
|
|
4817
|
+
var _a2;
|
|
4818
|
+
if (error instanceof AssetLinkError) {
|
|
4819
|
+
return error;
|
|
4820
|
+
}
|
|
4821
|
+
const responseData = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data;
|
|
4822
|
+
if (isCortexErrorResponse(responseData)) {
|
|
4823
|
+
return fromCortexErrorResponse(responseData);
|
|
4824
|
+
}
|
|
4825
|
+
return new AssetLinkError(error instanceof Error && error.message ? error.message : ASSET_LINK_FAILED_MESSAGE);
|
|
4826
|
+
}
|
|
4827
|
+
function isSearchFacet(facet) {
|
|
4828
|
+
const details = facet == null ? void 0 : facet.facetDetails;
|
|
4829
|
+
return !!facet && !!details && typeof details === "object" && !Array.isArray(details) && typeof details.facetFieldName === "string" && typeof details.displayName === "string" && Array.isArray(facet.values) && facet.values.every((facetValue) => !!facetValue && typeof facetValue.value === "string");
|
|
4830
|
+
}
|
|
4831
|
+
function isSearchResponse(response) {
|
|
4832
|
+
if (!response || typeof response !== "object" || Array.isArray(response)) {
|
|
4833
|
+
return false;
|
|
4834
|
+
}
|
|
4835
|
+
const { contentItems, facets, totalCount } = response;
|
|
4836
|
+
return Array.isArray(facets) && facets.every(isSearchFacet) && Number.isFinite(totalCount) && (contentItems === void 0 || Array.isArray(contentItems));
|
|
4837
|
+
}
|
|
4838
|
+
const POST_UNSUPPORTED_STATUSES = /* @__PURE__ */ new Set([405, 501]);
|
|
4839
|
+
const postUnsupportedOrigins = /* @__PURE__ */ new Set();
|
|
4840
|
+
function createId() {
|
|
4841
|
+
const cryptoApi = globalThis.crypto;
|
|
4842
|
+
if (cryptoApi == null ? void 0 : cryptoApi.randomUUID) {
|
|
4843
|
+
return cryptoApi.randomUUID();
|
|
4844
|
+
}
|
|
4845
|
+
if (cryptoApi == null ? void 0 : cryptoApi.getRandomValues) {
|
|
4846
|
+
const bytes = cryptoApi.getRandomValues(new Uint8Array(16));
|
|
4847
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
4848
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
4849
|
+
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
|
4850
|
+
return [
|
|
4851
|
+
hex.slice(0, 4).join(""),
|
|
4852
|
+
hex.slice(4, 6).join(""),
|
|
4853
|
+
hex.slice(6, 8).join(""),
|
|
4854
|
+
hex.slice(8, 10).join(""),
|
|
4855
|
+
hex.slice(10).join("")
|
|
4856
|
+
].join("-");
|
|
4857
|
+
}
|
|
4858
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
4859
|
+
}
|
|
4860
|
+
function buildAssetLinkImageUrl({
|
|
4861
|
+
asset,
|
|
4862
|
+
extension,
|
|
4863
|
+
parameters,
|
|
4864
|
+
permanentLink,
|
|
4865
|
+
rawResponse,
|
|
4866
|
+
transformations,
|
|
4867
|
+
useSession
|
|
4868
4868
|
}) {
|
|
4869
|
-
|
|
4870
|
-
|
|
4869
|
+
let baseImageUrl = permanentLink || rawResponse.imageUrl;
|
|
4870
|
+
let transformationPath = "";
|
|
4871
|
+
if (transformations && transformations.length > 0) {
|
|
4872
|
+
transformationPath += "/t/";
|
|
4871
4873
|
}
|
|
4872
|
-
|
|
4874
|
+
transformations == null ? void 0 : transformations.forEach(({ key, value }) => {
|
|
4875
|
+
if (key === TransformationAction.Resize) {
|
|
4876
|
+
const validTransformations = [
|
|
4877
|
+
...[
|
|
4878
|
+
{
|
|
4879
|
+
key: "re_w_",
|
|
4880
|
+
value: value.width
|
|
4881
|
+
},
|
|
4882
|
+
{
|
|
4883
|
+
key: "re_h_",
|
|
4884
|
+
value: value.height
|
|
4885
|
+
}
|
|
4886
|
+
].filter((item) => item.value !== void 0).map((item) => ({
|
|
4887
|
+
key: item.key,
|
|
4888
|
+
value: Math.round(Number(item.value))
|
|
4889
|
+
})),
|
|
4890
|
+
{
|
|
4891
|
+
key: "re_rm_",
|
|
4892
|
+
value: "stretch"
|
|
4893
|
+
}
|
|
4894
|
+
];
|
|
4895
|
+
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
4896
|
+
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
4897
|
+
});
|
|
4898
|
+
transformationPath += "/";
|
|
4899
|
+
}
|
|
4900
|
+
if (key === TransformationAction.Crop) {
|
|
4901
|
+
const validTransformations = [
|
|
4902
|
+
...[
|
|
4903
|
+
{
|
|
4904
|
+
key: "c_w_",
|
|
4905
|
+
value: value.width
|
|
4906
|
+
},
|
|
4907
|
+
{
|
|
4908
|
+
key: "c_h_",
|
|
4909
|
+
value: value.height
|
|
4910
|
+
},
|
|
4911
|
+
{
|
|
4912
|
+
key: "c_x_",
|
|
4913
|
+
value: value.x
|
|
4914
|
+
},
|
|
4915
|
+
{
|
|
4916
|
+
key: "c_y_",
|
|
4917
|
+
value: value.y
|
|
4918
|
+
}
|
|
4919
|
+
].filter((item) => item.value !== void 0).map((item) => ({
|
|
4920
|
+
key: item.key,
|
|
4921
|
+
value: Math.round(Number(item.value))
|
|
4922
|
+
})),
|
|
4923
|
+
{
|
|
4924
|
+
key: "c_whu_",
|
|
4925
|
+
value: "pixel"
|
|
4926
|
+
}
|
|
4927
|
+
];
|
|
4928
|
+
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
4929
|
+
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
4930
|
+
});
|
|
4931
|
+
transformationPath += "/";
|
|
4932
|
+
}
|
|
4933
|
+
if (key === TransformationAction.Rotate) {
|
|
4934
|
+
const validTransformations = [{
|
|
4935
|
+
key: "r_a_",
|
|
4936
|
+
value: value.rotation
|
|
4937
|
+
}].filter((item) => item.value !== void 0).map((item) => ({ key: item.key, value: Math.round(Number(item.value)) }));
|
|
4938
|
+
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
4939
|
+
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
4940
|
+
});
|
|
4941
|
+
transformationPath += "/";
|
|
4942
|
+
}
|
|
4943
|
+
if (key === TransformationAction.Quality) {
|
|
4944
|
+
const validTransformations = [{
|
|
4945
|
+
key: "q_level_",
|
|
4946
|
+
value: value.quality
|
|
4947
|
+
}].filter((item) => item.value !== void 0).map((item) => ({ key: item.key, value: Math.round(Number(item.value)) }));
|
|
4948
|
+
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
4949
|
+
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
4950
|
+
});
|
|
4951
|
+
transformationPath += "/";
|
|
4952
|
+
}
|
|
4953
|
+
if (key === TransformationAction.Metadata) {
|
|
4954
|
+
if (value.keepMetadata === true) {
|
|
4955
|
+
transformationPath += "fl_keep_metadata/";
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
});
|
|
4959
|
+
const hasTransformations = Boolean(transformations && transformations.length > 0);
|
|
4960
|
+
if (hasTransformations) {
|
|
4961
|
+
transformationPath += `${asset.identifier}`;
|
|
4962
|
+
}
|
|
4963
|
+
const assetExtension = extension != null ? extension : asset.extension;
|
|
4964
|
+
if (!permanentLink && assetExtension) {
|
|
4965
|
+
const normalizedExtension = assetExtension.startsWith(".") ? assetExtension : `.${assetExtension}`;
|
|
4966
|
+
if (hasTransformations) {
|
|
4967
|
+
transformationPath += normalizedExtension;
|
|
4968
|
+
} else {
|
|
4969
|
+
const [basePath, baseTail] = baseImageUrl.split(/([?#].*)$/, 2);
|
|
4970
|
+
baseImageUrl = basePath.replace(/\.[^./]+$/, "") + normalizedExtension + (baseTail != null ? baseTail : "");
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
const queryParams = [];
|
|
4974
|
+
parameters == null ? void 0 : parameters.forEach(({ key, value }) => {
|
|
4975
|
+
queryParams.push(`${encodeURIComponent(key.trim())}=${encodeURIComponent(value.trim())}`);
|
|
4976
|
+
});
|
|
4977
|
+
if (useSession) {
|
|
4978
|
+
queryParams.push(`UseSession=${encodeURIComponent(useSession)}`);
|
|
4979
|
+
}
|
|
4980
|
+
return appendPathAndQuery(baseImageUrl, transformationPath, queryParams);
|
|
4873
4981
|
}
|
|
4874
|
-
function
|
|
4982
|
+
function apiGetAssetLinks(_0) {
|
|
4875
4983
|
return __async(this, arguments, function* ({
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
self: self2,
|
|
4886
|
-
start = 0,
|
|
4887
|
-
token: token2
|
|
4984
|
+
assets,
|
|
4985
|
+
extension,
|
|
4986
|
+
extraFields,
|
|
4987
|
+
parameters,
|
|
4988
|
+
permanentLink,
|
|
4989
|
+
proxyPreference,
|
|
4990
|
+
skipLinkGeneration,
|
|
4991
|
+
transformations,
|
|
4992
|
+
useSession
|
|
4888
4993
|
}) {
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
objectRecordIDs = allowedFolders;
|
|
4893
|
-
self2 = true;
|
|
4894
|
-
includesDirectChildren = false;
|
|
4895
|
-
} else if (folderId) {
|
|
4896
|
-
objectRecordIDs = [folderId];
|
|
4897
|
-
}
|
|
4994
|
+
var _a2;
|
|
4995
|
+
const failures = [];
|
|
4996
|
+
const origin2 = (_a2 = http.defaults.baseURL) != null ? _a2 : window.location.origin;
|
|
4898
4997
|
try {
|
|
4899
|
-
const
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
hasMore: false,
|
|
4929
|
-
totalCount: 0
|
|
4930
|
-
};
|
|
4931
|
-
}
|
|
4932
|
-
if (!rawResponse || typeof rawResponse !== "object") {
|
|
4933
|
-
throw new Error("Invalid response format");
|
|
4998
|
+
const settled = yield Promise.allSettled(assets.map((asset, index) => __async(null, null, function* () {
|
|
4999
|
+
var _a3;
|
|
5000
|
+
const requestBody = {
|
|
5001
|
+
GenerateAssetUrl: !permanentLink && !skipLinkGeneration,
|
|
5002
|
+
Parameters: parameters,
|
|
5003
|
+
Proxy: proxyPreference,
|
|
5004
|
+
RecordId: asset.recordId
|
|
5005
|
+
};
|
|
5006
|
+
if (extraFields == null ? void 0 : extraFields.length) {
|
|
5007
|
+
requestBody.ExtraFields = extraFields;
|
|
5008
|
+
}
|
|
5009
|
+
const useSessionParams = useSession ? { UseSession: useSession } : void 0;
|
|
5010
|
+
const attemptPost = !postUnsupportedOrigins.has(origin2);
|
|
5011
|
+
let rawResponse;
|
|
5012
|
+
let rawStatus = 200;
|
|
5013
|
+
if (attemptPost) {
|
|
5014
|
+
try {
|
|
5015
|
+
const postResult = yield http.request({
|
|
5016
|
+
data: requestBody,
|
|
5017
|
+
method: "POST",
|
|
5018
|
+
params: useSessionParams,
|
|
5019
|
+
url: AssetApiEndpoint.GET_ASSET_LINK,
|
|
5020
|
+
validateStatus: () => true
|
|
5021
|
+
});
|
|
5022
|
+
if (POST_UNSUPPORTED_STATUSES.has(postResult.status)) {
|
|
5023
|
+
postUnsupportedOrigins.add(origin2);
|
|
5024
|
+
} else {
|
|
5025
|
+
rawResponse = postResult.data;
|
|
5026
|
+
rawStatus = postResult.status;
|
|
4934
5027
|
}
|
|
4935
|
-
|
|
4936
|
-
return {
|
|
4937
|
-
data: (_d2 = (_c2 = rawResponse.contentItems) == null ? void 0 : _c2.map((item) => {
|
|
4938
|
-
var _a3, _b3, _c3, _d3;
|
|
4939
|
-
return {
|
|
4940
|
-
docType: (_a3 = item.fields[FolderField.DocType]) != null ? _a3 : "",
|
|
4941
|
-
fullPath: (_b3 = item.fields[FolderField.CortexPath]) != null ? _b3 : "",
|
|
4942
|
-
hasChildren: item.fields[FolderField.HasBrowserChildren] === "1",
|
|
4943
|
-
id: item.recordID,
|
|
4944
|
-
isShared: item.fields[FolderField.rawDocSubtype] === "DO_OR1ND000001913488",
|
|
4945
|
-
representativeAssetId: (_c3 = item.fields[FolderField.RepresentativeAssetId]) != null ? _c3 : "",
|
|
4946
|
-
title: (_d3 = item.fields[FolderField.TitleWithFallback]) != null ? _d3 : ""
|
|
4947
|
-
};
|
|
4948
|
-
})) != null ? _d2 : [],
|
|
4949
|
-
hasMore: start + length2 < rawResponse.totalCount,
|
|
4950
|
-
totalCount: rawResponse.totalCount
|
|
4951
|
-
};
|
|
5028
|
+
} catch (e2) {
|
|
4952
5029
|
}
|
|
4953
|
-
|
|
4954
|
-
|
|
5030
|
+
}
|
|
5031
|
+
if (rawResponse === void 0) {
|
|
5032
|
+
const getResult = yield http.request({
|
|
5033
|
+
method: "GET",
|
|
5034
|
+
params: __spreadProps(__spreadValues({}, requestBody), {
|
|
5035
|
+
UseSession: useSession || void 0
|
|
5036
|
+
}),
|
|
5037
|
+
paramsSerializer: {
|
|
5038
|
+
indexes: null
|
|
5039
|
+
},
|
|
5040
|
+
url: AssetApiEndpoint.GET_ASSET_LINK
|
|
5041
|
+
});
|
|
5042
|
+
rawResponse = getResult.data;
|
|
5043
|
+
}
|
|
5044
|
+
const isResponseObject = !!rawResponse && typeof rawResponse === "object";
|
|
5045
|
+
if (isCortexErrorResponse(rawResponse) || !isResponseObject || rawStatus < 200 || rawStatus >= 300) {
|
|
5046
|
+
failures[index] = isCortexErrorResponse(rawResponse) ? fromCortexErrorResponse(rawResponse) : new AssetLinkError(`${ASSET_LINK_FAILED_MESSAGE} (HTTP ${rawStatus})`);
|
|
5047
|
+
return {
|
|
5048
|
+
imageUrl: asset.imageUrl
|
|
5049
|
+
};
|
|
5050
|
+
}
|
|
5051
|
+
const linkResponse = rawResponse;
|
|
5052
|
+
if (skipLinkGeneration) {
|
|
5053
|
+
return __spreadProps(__spreadValues({}, linkResponse), {
|
|
5054
|
+
imageUrl: (_a3 = asset.imageUrl) != null ? _a3 : ""
|
|
5055
|
+
});
|
|
5056
|
+
}
|
|
5057
|
+
if (!permanentLink && (linkResponse.imageUrl === null || linkResponse.imageUrl === void 0)) {
|
|
5058
|
+
return __spreadProps(__spreadValues({}, linkResponse), {
|
|
5059
|
+
imageUrl: asset.imageUrl
|
|
5060
|
+
});
|
|
5061
|
+
}
|
|
5062
|
+
const imageUrl = buildAssetLinkImageUrl({
|
|
5063
|
+
asset,
|
|
5064
|
+
extension,
|
|
5065
|
+
parameters,
|
|
5066
|
+
permanentLink,
|
|
5067
|
+
rawResponse: linkResponse,
|
|
5068
|
+
transformations,
|
|
5069
|
+
useSession
|
|
5070
|
+
});
|
|
5071
|
+
return __spreadProps(__spreadValues({}, linkResponse), {
|
|
5072
|
+
imageUrl
|
|
5073
|
+
});
|
|
5074
|
+
})));
|
|
5075
|
+
const data = settled.flatMap((result, index) => {
|
|
5076
|
+
if (result.status === "fulfilled") {
|
|
5077
|
+
return [result.value];
|
|
5078
|
+
}
|
|
5079
|
+
failures[index] = toAssetLinkError(result.reason);
|
|
5080
|
+
return [];
|
|
5081
|
+
});
|
|
5082
|
+
const error = failures.find((failure) => failure !== void 0);
|
|
5083
|
+
return __spreadProps(__spreadValues({
|
|
5084
|
+
data
|
|
5085
|
+
}, error ? { error } : {}), {
|
|
5086
|
+
isError: !!error
|
|
4955
5087
|
});
|
|
4956
|
-
return response.data;
|
|
4957
5088
|
} catch (error) {
|
|
4958
5089
|
return {
|
|
4959
5090
|
data: [],
|
|
4960
|
-
|
|
4961
|
-
|
|
5091
|
+
error: toAssetLinkError(error),
|
|
5092
|
+
isError: true
|
|
4962
5093
|
};
|
|
4963
5094
|
}
|
|
4964
5095
|
});
|
|
4965
5096
|
}
|
|
4966
|
-
function
|
|
5097
|
+
function apiGetAssetsByIDs(_0) {
|
|
4967
5098
|
return __async(this, arguments, function* ({
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
folderId,
|
|
4971
|
-
pageSize = FOLDER_PAGE_SIZE,
|
|
4972
|
-
searchTerm,
|
|
4973
|
-
start = 0,
|
|
4974
|
-
token: token2
|
|
5099
|
+
extraFields,
|
|
5100
|
+
recordIds
|
|
4975
5101
|
}) {
|
|
5102
|
+
var _a2;
|
|
5103
|
+
if (!Array.isArray(recordIds) || recordIds.length === 0) {
|
|
5104
|
+
return { facets: [], items: [], totalCount: 0 };
|
|
5105
|
+
}
|
|
5106
|
+
const validatedExtraFields = (_a2 = extraFields == null ? void 0 : extraFields.filter((field) => field && typeof field === "string")) != null ? _a2 : [];
|
|
4976
5107
|
try {
|
|
4977
|
-
const extraFilters = resolveCollectionsExtraFilters({ searchText: searchTerm });
|
|
4978
5108
|
const response = yield http.request({
|
|
4979
|
-
baseURL: baseUrl,
|
|
4980
|
-
headers: {
|
|
4981
|
-
Authorization: `Bearer ${bearerToken}`
|
|
4982
|
-
},
|
|
4983
5109
|
method: "GET",
|
|
4984
|
-
params:
|
|
5110
|
+
params: {
|
|
5111
|
+
ExtraFilters: `RecordID:${recordIds.join(" OR ")}`,
|
|
4985
5112
|
Fields: [
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
5113
|
+
...validatedExtraFields,
|
|
5114
|
+
ORIGINAL_VIEW_SIZE,
|
|
5115
|
+
FIELD_UPDATED_FILE_NAME,
|
|
5116
|
+
FIELD_ORIGINAL_FILE_NAME,
|
|
5117
|
+
FIELD_DOC_TITLE,
|
|
5118
|
+
FIELD_DOC_CAPTION_LONG
|
|
4989
5119
|
],
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
Start: start,
|
|
4993
|
-
SubtypeCriteria: folderId,
|
|
4994
|
-
Token: token2 || void 0
|
|
4995
|
-
}),
|
|
5120
|
+
SeeThru: true
|
|
5121
|
+
},
|
|
4996
5122
|
paramsSerializer: {
|
|
4997
5123
|
indexes: null
|
|
4998
5124
|
},
|
|
4999
5125
|
responseType: "json",
|
|
5000
5126
|
transformResponse: [
|
|
5001
5127
|
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5002
|
-
(rawResponse
|
|
5003
|
-
var
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
}
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5128
|
+
(rawResponse) => {
|
|
5129
|
+
var _a3, _b2;
|
|
5130
|
+
const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
|
|
5131
|
+
var _a4, _b3, _c2;
|
|
5132
|
+
let name = (_a4 = item.fields[FIELD_UPDATED_FILE_NAME]) != null ? _a4 : "";
|
|
5133
|
+
if (name === "") {
|
|
5134
|
+
name = (_b3 = item.fields[FIELD_ORIGINAL_FILE_NAME]) != null ? _b3 : "";
|
|
5135
|
+
}
|
|
5136
|
+
return __spreadValues({
|
|
5137
|
+
name,
|
|
5138
|
+
originalUrl: (_c2 = item.fields[ORIGINAL_VIEW_SIZE]) != null ? _c2 : "",
|
|
5139
|
+
recordId: item.recordID
|
|
5140
|
+
}, validatedExtraFields.reduce(
|
|
5141
|
+
(acc, field) => {
|
|
5142
|
+
var _a5;
|
|
5143
|
+
acc[field] = (_a5 = item.fields[field]) != null ? _a5 : "";
|
|
5144
|
+
return acc;
|
|
5145
|
+
},
|
|
5146
|
+
{}
|
|
5147
|
+
));
|
|
5148
|
+
})) != null ? _b2 : [];
|
|
5149
|
+
mappedItems.sort((a2, b2) => {
|
|
5150
|
+
const indexA = recordIds.indexOf(a2.recordId);
|
|
5151
|
+
const indexB = recordIds.indexOf(b2.recordId);
|
|
5152
|
+
return indexA - indexB;
|
|
5153
|
+
});
|
|
5019
5154
|
return {
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
return {
|
|
5023
|
-
docType: (_a3 = item.fields[FolderField.DocType]) != null ? _a3 : "",
|
|
5024
|
-
fullPath: (_c3 = (_b3 = item.fields[FolderField.CortexPath]) == null ? void 0 : _b3.replace(/^Root\//i, "")) != null ? _c3 : "",
|
|
5025
|
-
hasChildren: false,
|
|
5026
|
-
id: item.recordID,
|
|
5027
|
-
parents: [],
|
|
5028
|
-
path: [],
|
|
5029
|
-
title: (_d3 = item.fields[FolderField.TitleWithFallback]) != null ? _d3 : ""
|
|
5030
|
-
};
|
|
5031
|
-
})) != null ? _d2 : [],
|
|
5032
|
-
hasMore: start + length2 < rawResponse.totalCount,
|
|
5155
|
+
facets: rawResponse.facets,
|
|
5156
|
+
items: mappedItems,
|
|
5033
5157
|
totalCount: rawResponse.totalCount
|
|
5034
5158
|
};
|
|
5035
5159
|
}
|
|
@@ -5039,18 +5163,751 @@ function apiGetCollections(_0) {
|
|
|
5039
5163
|
return response.data;
|
|
5040
5164
|
} catch (error) {
|
|
5041
5165
|
return {
|
|
5042
|
-
|
|
5043
|
-
|
|
5166
|
+
facets: [],
|
|
5167
|
+
items: [],
|
|
5044
5168
|
totalCount: 0
|
|
5045
5169
|
};
|
|
5046
5170
|
}
|
|
5047
5171
|
});
|
|
5048
5172
|
}
|
|
5049
|
-
const
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5173
|
+
const ASSET_LIST_FIELDS = [
|
|
5174
|
+
DEFAULT_VIEW_SIZE,
|
|
5175
|
+
FIELD_DOC_TITLE,
|
|
5176
|
+
FIELD_DOC_TYPE,
|
|
5177
|
+
FIELD_EXTENSION,
|
|
5178
|
+
FIELD_FILE_SIZE,
|
|
5179
|
+
FIELD_IDENTIFIER,
|
|
5180
|
+
FIELD_KEYWORDS,
|
|
5181
|
+
FIELD_MAX_HEIGHT,
|
|
5182
|
+
FIELD_MAX_WIDTH,
|
|
5183
|
+
FIELD_RECORD_ID,
|
|
5184
|
+
FIELD_SUBTYPE,
|
|
5185
|
+
FIELD_TITLE_WITH_FALLBACK,
|
|
5186
|
+
FIELD_UPDATED_FILE_NAME,
|
|
5187
|
+
FIELD_STORAGE_GROUP,
|
|
5188
|
+
ORIGINAL_VIEW_SIZE
|
|
5189
|
+
];
|
|
5190
|
+
function apiGetAssets(_0) {
|
|
5191
|
+
return __async(this, arguments, function* ({
|
|
5192
|
+
fields,
|
|
5193
|
+
folderId,
|
|
5194
|
+
isSeeThrough,
|
|
5195
|
+
limitedToDocTypes = [],
|
|
5196
|
+
pageSize,
|
|
5197
|
+
searchText,
|
|
5198
|
+
selectedFacets,
|
|
5199
|
+
sortOrder,
|
|
5200
|
+
start,
|
|
5201
|
+
titleFallback,
|
|
5202
|
+
useSession
|
|
5203
|
+
}) {
|
|
5204
|
+
var _a2;
|
|
5205
|
+
const validatedFields = (_a2 = fields == null ? void 0 : fields.filter((field) => field && typeof field === "string")) != null ? _a2 : [];
|
|
5206
|
+
const requestedFields = [
|
|
5207
|
+
...ASSET_LIST_FIELDS,
|
|
5208
|
+
resolveTitleFallbackField(titleFallback),
|
|
5209
|
+
...validatedFields
|
|
5210
|
+
].filter(
|
|
5211
|
+
(field, index, all3) => all3.findIndex((item) => item.toLowerCase() === field.toLowerCase()) === index
|
|
5212
|
+
);
|
|
5213
|
+
try {
|
|
5214
|
+
const response = yield http.request({
|
|
5215
|
+
data: __spreadValues({
|
|
5216
|
+
Fields: requestedFields,
|
|
5217
|
+
Limit: pageSize || void 0,
|
|
5218
|
+
LimitedToDocTypes: limitedToDocTypes,
|
|
5219
|
+
ObjectRecordID: folderId || void 0,
|
|
5220
|
+
OrderBy: sortOrder,
|
|
5221
|
+
SeeThru: isSeeThrough || void 0,
|
|
5222
|
+
SelectedFacets: selectedFacets,
|
|
5223
|
+
Start: start,
|
|
5224
|
+
Text: searchText || void 0,
|
|
5225
|
+
UseSession: useSession || void 0
|
|
5226
|
+
}, resolveAssetExtraFilters(selectedFacets)),
|
|
5227
|
+
method: "POST",
|
|
5228
|
+
transformResponse: [
|
|
5229
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5230
|
+
(rawResponse) => {
|
|
5231
|
+
var _a3, _b2;
|
|
5232
|
+
if (!isSearchResponse(rawResponse)) {
|
|
5233
|
+
return {
|
|
5234
|
+
facets: [],
|
|
5235
|
+
isError: true,
|
|
5236
|
+
items: [],
|
|
5237
|
+
totalCount: 0,
|
|
5238
|
+
unreadableFields: []
|
|
5239
|
+
};
|
|
5240
|
+
}
|
|
5241
|
+
const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
|
|
5242
|
+
var _a4, _b3, _c2, _d2, _e3, _f2, _g, _h, _i, _j, _k, _l;
|
|
5243
|
+
let extension = (_a4 = item.fields[FIELD_EXTENSION]) != null ? _a4 : "";
|
|
5244
|
+
const name = resolveAssetCaption(item.fields, titleFallback);
|
|
5245
|
+
if (extension && !extension.startsWith(".")) {
|
|
5246
|
+
extension = "." + extension;
|
|
5247
|
+
}
|
|
5248
|
+
return __spreadProps(__spreadValues({}, validatedFields.reduce((acc, field) => {
|
|
5249
|
+
var _a5, _b4;
|
|
5250
|
+
const sourceField = (_a5 = requestedFields.find(
|
|
5251
|
+
(requestedField) => requestedField.toLowerCase() === field.toLowerCase()
|
|
5252
|
+
)) != null ? _a5 : field;
|
|
5253
|
+
acc[field] = (_b4 = item.fields[sourceField]) != null ? _b4 : "";
|
|
5254
|
+
return acc;
|
|
5255
|
+
}, {})), {
|
|
5256
|
+
allowATSLink: item.fields[FIELD_ALLOW_ATS_LINK] === "True",
|
|
5257
|
+
docSubType: (_b3 = item.fields[FIELD_SUBTYPE]) != null ? _b3 : "",
|
|
5258
|
+
docType: (_c2 = item.fields[FIELD_DOC_TYPE]) != null ? _c2 : "",
|
|
5259
|
+
extension,
|
|
5260
|
+
height: (_d2 = item.fields[FIELD_MAX_HEIGHT]) != null ? _d2 : "0",
|
|
5261
|
+
id: item.recordID,
|
|
5262
|
+
identifier: (_e3 = item.fields[FIELD_IDENTIFIER]) != null ? _e3 : "",
|
|
5263
|
+
imageUrl: (_f2 = item.fields[DEFAULT_VIEW_SIZE]) != null ? _f2 : "",
|
|
5264
|
+
inColdStorage: item.fields[FIELD_STORAGE_GROUP] === "Cold Storage",
|
|
5265
|
+
name: name != null ? name : "",
|
|
5266
|
+
originalUrl: (_g = item.fields[ORIGINAL_VIEW_SIZE]) != null ? _g : "",
|
|
5267
|
+
recordId: (_h = item.fields[FIELD_RECORD_ID]) != null ? _h : "",
|
|
5268
|
+
scrubUrl: (_i = item.fields[FIELD_SCRUB_URL]) != null ? _i : "",
|
|
5269
|
+
size: (_j = item.fields[FIELD_FILE_SIZE]) != null ? _j : "0 MB",
|
|
5270
|
+
tags: (_k = item.fields[FIELD_KEYWORDS]) != null ? _k : "",
|
|
5271
|
+
width: (_l = item.fields[FIELD_MAX_WIDTH]) != null ? _l : "0"
|
|
5272
|
+
});
|
|
5273
|
+
})) != null ? _b2 : [];
|
|
5274
|
+
return {
|
|
5275
|
+
facets: rawResponse.facets,
|
|
5276
|
+
isError: false,
|
|
5277
|
+
items: mappedItems,
|
|
5278
|
+
totalCount: rawResponse.totalCount,
|
|
5279
|
+
unreadableFields: Array.isArray(rawResponse.unreadableFields) ? rawResponse.unreadableFields.filter((field) => typeof field === "string") : []
|
|
5280
|
+
};
|
|
5281
|
+
}
|
|
5282
|
+
],
|
|
5283
|
+
url: AssetApiEndpoint.GET_CONTENT_V3
|
|
5284
|
+
});
|
|
5285
|
+
return response.data;
|
|
5286
|
+
} catch (error) {
|
|
5287
|
+
return {
|
|
5288
|
+
facets: [],
|
|
5289
|
+
isError: true,
|
|
5290
|
+
items: [],
|
|
5291
|
+
totalCount: 0,
|
|
5292
|
+
unreadableFields: []
|
|
5293
|
+
};
|
|
5294
|
+
}
|
|
5295
|
+
});
|
|
5296
|
+
}
|
|
5297
|
+
function apiGetAvailableProxies(_0) {
|
|
5298
|
+
return __async(this, arguments, function* ({
|
|
5299
|
+
assetRecordId,
|
|
5300
|
+
siteUrl
|
|
5301
|
+
}) {
|
|
5302
|
+
try {
|
|
5303
|
+
const response = yield http.request({
|
|
5304
|
+
baseURL: siteUrl,
|
|
5305
|
+
cache: {
|
|
5306
|
+
// A malformed body arrives with HTTP 200, so the default status check would cache the error and
|
|
5307
|
+
// serve it again after the server recovers.
|
|
5308
|
+
cachePredicate: {
|
|
5309
|
+
responseMatch: ({ data }) => !data.isError
|
|
5310
|
+
}
|
|
5311
|
+
},
|
|
5312
|
+
method: "GET",
|
|
5313
|
+
params: {
|
|
5314
|
+
RecordId: assetRecordId
|
|
5315
|
+
},
|
|
5316
|
+
responseType: "json",
|
|
5317
|
+
transformResponse: [
|
|
5318
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5319
|
+
(rawResponse) => {
|
|
5320
|
+
var _a2;
|
|
5321
|
+
if (!rawResponse || typeof rawResponse !== "object" || !Array.isArray(rawResponse.proxies)) {
|
|
5322
|
+
return {
|
|
5323
|
+
isError: true,
|
|
5324
|
+
previewUrl: "",
|
|
5325
|
+
proxies: []
|
|
5326
|
+
};
|
|
5327
|
+
}
|
|
5328
|
+
return {
|
|
5329
|
+
isError: false,
|
|
5330
|
+
previewUrl: (_a2 = rawResponse.previewUrl) != null ? _a2 : "",
|
|
5331
|
+
proxies: rawResponse.proxies.map((proxy) => ({
|
|
5332
|
+
cdnName: proxy.cdnName,
|
|
5333
|
+
extension: proxy.extension,
|
|
5334
|
+
formatHeight: proxy.formatHeight,
|
|
5335
|
+
formatWidth: proxy.formatWidth,
|
|
5336
|
+
height: proxy.height,
|
|
5337
|
+
id: createId(),
|
|
5338
|
+
permanentLink: proxy.permanentLink,
|
|
5339
|
+
proxyLabel: proxy.proxyLabel,
|
|
5340
|
+
proxyName: proxy.proxyName,
|
|
5341
|
+
width: proxy.width
|
|
5342
|
+
}))
|
|
5343
|
+
};
|
|
5344
|
+
}
|
|
5345
|
+
],
|
|
5346
|
+
url: AssetApiEndpoint.GET_AVAILABLE_PROXIES
|
|
5347
|
+
});
|
|
5348
|
+
return response.data;
|
|
5349
|
+
} catch (error) {
|
|
5350
|
+
return {
|
|
5351
|
+
isError: true,
|
|
5352
|
+
previewUrl: "",
|
|
5353
|
+
proxies: []
|
|
5354
|
+
};
|
|
5355
|
+
}
|
|
5356
|
+
});
|
|
5357
|
+
}
|
|
5358
|
+
function apiGetAvailableExtensions() {
|
|
5359
|
+
return __async(this, null, function* () {
|
|
5360
|
+
try {
|
|
5361
|
+
const response = yield http.request({
|
|
5362
|
+
method: "GET",
|
|
5363
|
+
responseType: "json",
|
|
5364
|
+
transformResponse: [
|
|
5365
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5366
|
+
(rawResponse) => {
|
|
5367
|
+
return rawResponse.extensions;
|
|
5368
|
+
}
|
|
5369
|
+
],
|
|
5370
|
+
url: AssetApiEndpoint.GET_AVAILABLE_EXTENSIONS
|
|
5371
|
+
});
|
|
5372
|
+
return response.data;
|
|
5373
|
+
} catch (error) {
|
|
5374
|
+
return {};
|
|
5375
|
+
}
|
|
5376
|
+
});
|
|
5377
|
+
}
|
|
5378
|
+
function apiGetAssetFavoriteStatus(_0) {
|
|
5379
|
+
return __async(this, arguments, function* ({
|
|
5380
|
+
assetRecordId
|
|
5381
|
+
}) {
|
|
5382
|
+
try {
|
|
5383
|
+
const response = yield http.request({
|
|
5384
|
+
method: "GET",
|
|
5385
|
+
params: {
|
|
5386
|
+
RecordId: assetRecordId
|
|
5387
|
+
},
|
|
5388
|
+
responseType: "json",
|
|
5389
|
+
transformResponse: [
|
|
5390
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5391
|
+
(rawResponse) => {
|
|
5392
|
+
if (!rawResponse.favoriteRecordIds) {
|
|
5393
|
+
return false;
|
|
5394
|
+
}
|
|
5395
|
+
return rawResponse.favoriteRecordIds.includes(assetRecordId);
|
|
5396
|
+
}
|
|
5397
|
+
],
|
|
5398
|
+
url: AssetApiEndpoint.GET_FAVORITE_ASSETS
|
|
5399
|
+
});
|
|
5400
|
+
return response.data;
|
|
5401
|
+
} catch (error) {
|
|
5402
|
+
return false;
|
|
5403
|
+
}
|
|
5404
|
+
});
|
|
5405
|
+
}
|
|
5406
|
+
function apiGetAssetVersionHistory(_0) {
|
|
5407
|
+
return __async(this, arguments, function* ({
|
|
5408
|
+
assetRecordId
|
|
5409
|
+
}) {
|
|
5410
|
+
try {
|
|
5411
|
+
const response = yield http.request({
|
|
5412
|
+
method: "GET",
|
|
5413
|
+
params: {
|
|
5414
|
+
RecordId: assetRecordId
|
|
5415
|
+
},
|
|
5416
|
+
responseType: "json",
|
|
5417
|
+
transformResponse: [
|
|
5418
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5419
|
+
(rawResponse) => {
|
|
5420
|
+
return {
|
|
5421
|
+
count: rawResponse.count,
|
|
5422
|
+
versions: rawResponse.versions.map((version) => ({
|
|
5423
|
+
createByEmail: version.CreateByEmail,
|
|
5424
|
+
fileImportDate: version.FileImportDate,
|
|
5425
|
+
scrubUrl: version.ScrubUrl,
|
|
5426
|
+
versionCreateDate: version.VersionCreateDate,
|
|
5427
|
+
versionFileName: version.UpdatedFileName || version.VersionFileName,
|
|
5428
|
+
versionFileUrl: version.PreviewUrl,
|
|
5429
|
+
versionId: version.VersionID,
|
|
5430
|
+
versionNumber: Number(version.VersionNumber),
|
|
5431
|
+
versionNumberDisplay: version.VersionNumberDisplay
|
|
5432
|
+
}))
|
|
5433
|
+
};
|
|
5434
|
+
}
|
|
5435
|
+
],
|
|
5436
|
+
url: AssetApiEndpoint.GET_ASSET_VERSION_HISTORY
|
|
5437
|
+
});
|
|
5438
|
+
return response.data;
|
|
5439
|
+
} catch (error) {
|
|
5440
|
+
return {
|
|
5441
|
+
count: 0,
|
|
5442
|
+
versions: []
|
|
5443
|
+
};
|
|
5444
|
+
}
|
|
5445
|
+
});
|
|
5446
|
+
}
|
|
5447
|
+
function apiAddAssetToFavorite(_0) {
|
|
5448
|
+
return __async(this, arguments, function* ({
|
|
5449
|
+
assetRecordId,
|
|
5450
|
+
siteUrl
|
|
5451
|
+
}) {
|
|
5452
|
+
try {
|
|
5453
|
+
const response = yield http.request({
|
|
5454
|
+
baseURL: siteUrl,
|
|
5455
|
+
data: {
|
|
5456
|
+
RecordId: assetRecordId
|
|
5457
|
+
},
|
|
5458
|
+
method: "POST",
|
|
5459
|
+
responseType: "json",
|
|
5460
|
+
transformResponse: [
|
|
5461
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5462
|
+
(rawResponse) => {
|
|
5463
|
+
if (rawResponse.success) {
|
|
5464
|
+
return true;
|
|
5465
|
+
}
|
|
5466
|
+
return false;
|
|
5467
|
+
}
|
|
5468
|
+
],
|
|
5469
|
+
url: AssetApiEndpoint.ADD_ASSET_TO_FAVORITE
|
|
5470
|
+
});
|
|
5471
|
+
return response.data;
|
|
5472
|
+
} catch (error) {
|
|
5473
|
+
return false;
|
|
5474
|
+
}
|
|
5475
|
+
});
|
|
5476
|
+
}
|
|
5477
|
+
function apiRemoveAssetFromFavorite(_0) {
|
|
5478
|
+
return __async(this, arguments, function* ({
|
|
5479
|
+
assetRecordId,
|
|
5480
|
+
siteUrl
|
|
5481
|
+
}) {
|
|
5482
|
+
try {
|
|
5483
|
+
const response = yield http.request({
|
|
5484
|
+
baseURL: siteUrl,
|
|
5485
|
+
data: {
|
|
5486
|
+
RecordId: assetRecordId
|
|
5487
|
+
},
|
|
5488
|
+
method: "POST",
|
|
5489
|
+
responseType: "json",
|
|
5490
|
+
transformResponse: [
|
|
5491
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5492
|
+
(rawResponse) => {
|
|
5493
|
+
if (rawResponse.success) {
|
|
5494
|
+
return true;
|
|
5495
|
+
}
|
|
5496
|
+
return false;
|
|
5497
|
+
}
|
|
5498
|
+
],
|
|
5499
|
+
url: AssetApiEndpoint.REMOVE_ASSET_FROM_FAVORITE
|
|
5500
|
+
});
|
|
5501
|
+
return response.data;
|
|
5502
|
+
} catch (error) {
|
|
5503
|
+
return false;
|
|
5504
|
+
}
|
|
5505
|
+
});
|
|
5506
|
+
}
|
|
5507
|
+
var __defProp$i = Object.defineProperty;
|
|
5508
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
5509
|
+
var result = void 0;
|
|
5510
|
+
for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)
|
|
5511
|
+
if (decorator = decorators[i4])
|
|
5512
|
+
result = decorator(target, key, result) || result;
|
|
5513
|
+
if (result) __defProp$i(target, key, result);
|
|
5514
|
+
return result;
|
|
5515
|
+
};
|
|
5516
|
+
const _CortexElement = class _CortexElement extends i$4 {
|
|
5517
|
+
constructor() {
|
|
5518
|
+
super();
|
|
5519
|
+
this.theme = "light";
|
|
5520
|
+
this.preRender = false;
|
|
5521
|
+
Object.entries(
|
|
5522
|
+
this.constructor.dependencies
|
|
5523
|
+
).forEach(([name, component]) => {
|
|
5524
|
+
this.constructor.define(name, component);
|
|
5525
|
+
});
|
|
5526
|
+
this.handleThemeChange = this.handleThemeChange.bind(this);
|
|
5527
|
+
}
|
|
5528
|
+
emit(name, options) {
|
|
5529
|
+
const event = new CustomEvent(name, __spreadValues({
|
|
5530
|
+
bubbles: true,
|
|
5531
|
+
cancelable: false,
|
|
5532
|
+
composed: true,
|
|
5533
|
+
detail: {}
|
|
5534
|
+
}, options));
|
|
5535
|
+
this.dispatchEvent(event);
|
|
5536
|
+
return event;
|
|
5537
|
+
}
|
|
5538
|
+
static define(name, elementConstructor = this, options = {}) {
|
|
5539
|
+
const currentlyRegisteredConstructor = customElements.get(name);
|
|
5540
|
+
if (!currentlyRegisteredConstructor) {
|
|
5541
|
+
try {
|
|
5542
|
+
customElements.define(name, elementConstructor, options);
|
|
5543
|
+
} catch (error) {
|
|
5544
|
+
customElements.define(
|
|
5545
|
+
name,
|
|
5546
|
+
class extends elementConstructor {
|
|
5547
|
+
},
|
|
5548
|
+
options
|
|
5549
|
+
);
|
|
5550
|
+
}
|
|
5551
|
+
return;
|
|
5552
|
+
}
|
|
5553
|
+
let newVersion = " (unknown version)";
|
|
5554
|
+
let existingVersion = newVersion;
|
|
5555
|
+
if ("version" in elementConstructor && elementConstructor.version) {
|
|
5556
|
+
newVersion = " v" + elementConstructor.version;
|
|
5557
|
+
}
|
|
5558
|
+
if ("version" in currentlyRegisteredConstructor && currentlyRegisteredConstructor.version) {
|
|
5559
|
+
existingVersion = " v" + currentlyRegisteredConstructor.version;
|
|
5560
|
+
}
|
|
5561
|
+
if (newVersion && existingVersion && newVersion === existingVersion) {
|
|
5562
|
+
return;
|
|
5563
|
+
}
|
|
5564
|
+
console.warn(
|
|
5565
|
+
`Attempted to register <${name}>${newVersion}, but <${name}>${existingVersion} has already been registered.`
|
|
5566
|
+
);
|
|
5567
|
+
}
|
|
5568
|
+
static createProperty(name, options) {
|
|
5569
|
+
super.createProperty(name, options);
|
|
5570
|
+
if ((options == null ? void 0 : options.attribute) && typeof options.attribute === "string" && !Object.prototype.hasOwnProperty.call(
|
|
5571
|
+
this.prototype,
|
|
5572
|
+
options.attribute
|
|
5573
|
+
) && Object.prototype.hasOwnProperty.call(this.prototype, name)) {
|
|
5574
|
+
Object.defineProperty(this.prototype, options.attribute, {
|
|
5575
|
+
get() {
|
|
5576
|
+
return this[name];
|
|
5577
|
+
},
|
|
5578
|
+
set(v2) {
|
|
5579
|
+
this[name] = v2;
|
|
5580
|
+
}
|
|
5581
|
+
});
|
|
5582
|
+
}
|
|
5583
|
+
}
|
|
5584
|
+
firstUpdated(_changedProperties) {
|
|
5585
|
+
super.firstUpdated(_changedProperties);
|
|
5586
|
+
if (this.preRender) {
|
|
5587
|
+
return;
|
|
5588
|
+
}
|
|
5589
|
+
this.runFirstUpdated(_changedProperties);
|
|
5590
|
+
}
|
|
5591
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5592
|
+
runFirstUpdated(_changedProperties) {
|
|
5593
|
+
}
|
|
5594
|
+
connectedUpdatedCallback() {
|
|
5595
|
+
}
|
|
5596
|
+
runConnectedCallback() {
|
|
5597
|
+
}
|
|
5598
|
+
adoptedCallback() {
|
|
5599
|
+
rescueElementPrototype(this);
|
|
5600
|
+
}
|
|
5601
|
+
connectedCallback() {
|
|
5602
|
+
super.connectedCallback();
|
|
5603
|
+
if ("addEventListener" in globalThis) {
|
|
5604
|
+
globalThis.addEventListener("cx-theme-change", this.handleThemeChange);
|
|
5605
|
+
}
|
|
5606
|
+
if (this.preRender) {
|
|
5607
|
+
return;
|
|
5608
|
+
}
|
|
5609
|
+
this.runConnectedCallback();
|
|
5610
|
+
this.updateComplete.then(() => {
|
|
5611
|
+
this.connectedUpdatedCallback();
|
|
5612
|
+
});
|
|
5613
|
+
}
|
|
5614
|
+
disconnectedCallback() {
|
|
5615
|
+
super.disconnectedCallback();
|
|
5616
|
+
if ("removeEventListener" in globalThis) {
|
|
5617
|
+
globalThis.removeEventListener("cx-theme-change", this.handleThemeChange);
|
|
5618
|
+
}
|
|
5619
|
+
rescueElementPrototype(this);
|
|
5620
|
+
}
|
|
5621
|
+
handleThemeChange(event) {
|
|
5622
|
+
this.theme = event.detail.theme;
|
|
5623
|
+
}
|
|
5624
|
+
getTheme() {
|
|
5625
|
+
if ("getComputedStyle" in globalThis) {
|
|
5626
|
+
const computedStyle = getComputedStyle(
|
|
5627
|
+
globalThis.document.documentElement
|
|
5628
|
+
);
|
|
5629
|
+
return (computedStyle == null ? void 0 : computedStyle.colorScheme) === "dark" ? "dark" : "light";
|
|
5630
|
+
}
|
|
5631
|
+
return "light";
|
|
5632
|
+
}
|
|
5633
|
+
getState(key) {
|
|
5634
|
+
return this[key];
|
|
5635
|
+
}
|
|
5636
|
+
};
|
|
5637
|
+
_CortexElement.version = "1";
|
|
5638
|
+
_CortexElement.dependencies = {};
|
|
5639
|
+
let CortexElement = _CortexElement;
|
|
5640
|
+
__decorateClass$i([
|
|
5641
|
+
n$6()
|
|
5642
|
+
], CortexElement.prototype, "dir");
|
|
5643
|
+
__decorateClass$i([
|
|
5644
|
+
n$6()
|
|
5645
|
+
], CortexElement.prototype, "lang");
|
|
5646
|
+
__decorateClass$i([
|
|
5647
|
+
n$6()
|
|
5648
|
+
], CortexElement.prototype, "theme");
|
|
5649
|
+
__decorateClass$i([
|
|
5650
|
+
n$6({ attribute: "pre-render", type: Boolean })
|
|
5651
|
+
], CortexElement.prototype, "preRender");
|
|
5652
|
+
function rescueElementPrototype(element) {
|
|
5653
|
+
if (element instanceof CortexElement) {
|
|
5654
|
+
return;
|
|
5655
|
+
}
|
|
5656
|
+
const tagName = element.localName || element.tagName;
|
|
5657
|
+
const constructor = customElements.get(tagName.toLowerCase());
|
|
5658
|
+
if (constructor) {
|
|
5659
|
+
Object.setPrototypeOf(element, constructor.prototype);
|
|
5660
|
+
}
|
|
5661
|
+
}
|
|
5662
|
+
/**
|
|
5663
|
+
* @license
|
|
5664
|
+
* Copyright 2017 Google LLC
|
|
5665
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5666
|
+
*/
|
|
5667
|
+
const t$1 = { ATTRIBUTE: 1, CHILD: 2 }, e$2 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
|
|
5668
|
+
let i$3 = class i2 {
|
|
5669
|
+
constructor(t2) {
|
|
5670
|
+
}
|
|
5671
|
+
get _$AU() {
|
|
5672
|
+
return this._$AM._$AU;
|
|
5673
|
+
}
|
|
5674
|
+
_$AT(t2, e2, i4) {
|
|
5675
|
+
this._$Ct = t2, this._$AM = e2, this._$Ci = i4;
|
|
5676
|
+
}
|
|
5677
|
+
_$AS(t2, e2) {
|
|
5678
|
+
return this.update(t2, e2);
|
|
5679
|
+
}
|
|
5680
|
+
update(t2, e2) {
|
|
5681
|
+
return this.render(...e2);
|
|
5682
|
+
}
|
|
5683
|
+
};
|
|
5684
|
+
/**
|
|
5685
|
+
* @license
|
|
5686
|
+
* Copyright 2018 Google LLC
|
|
5687
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5688
|
+
*/
|
|
5689
|
+
const e$1 = e$2(class extends i$3 {
|
|
5690
|
+
constructor(t2) {
|
|
5691
|
+
var _a2;
|
|
5692
|
+
if (super(t2), t2.type !== t$1.ATTRIBUTE || "class" !== t2.name || ((_a2 = t2.strings) == null ? void 0 : _a2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
5693
|
+
}
|
|
5694
|
+
render(t2) {
|
|
5695
|
+
return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " ";
|
|
5696
|
+
}
|
|
5697
|
+
update(s2, [i4]) {
|
|
5698
|
+
var _a2, _b2;
|
|
5699
|
+
if (void 0 === this.st) {
|
|
5700
|
+
this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2)));
|
|
5701
|
+
for (const t2 in i4) i4[t2] && !((_a2 = this.nt) == null ? void 0 : _a2.has(t2)) && this.st.add(t2);
|
|
5702
|
+
return this.render(i4);
|
|
5703
|
+
}
|
|
5704
|
+
const r2 = s2.element.classList;
|
|
5705
|
+
for (const t2 of this.st) t2 in i4 || (r2.remove(t2), this.st.delete(t2));
|
|
5706
|
+
for (const t2 in i4) {
|
|
5707
|
+
const s3 = !!i4[t2];
|
|
5708
|
+
s3 === this.st.has(t2) || ((_b2 = this.nt) == null ? void 0 : _b2.has(t2)) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2)));
|
|
5709
|
+
}
|
|
5710
|
+
return E;
|
|
5711
|
+
}
|
|
5712
|
+
});
|
|
5713
|
+
var FolderField = /* @__PURE__ */ ((FolderField2) => {
|
|
5714
|
+
FolderField2["CortexPath"] = "Document.CortexPath";
|
|
5715
|
+
FolderField2["DocType"] = "CoreField.DocType";
|
|
5716
|
+
FolderField2["HasBrowserChildren"] = "Document.HasBrowserChildren";
|
|
5717
|
+
FolderField2["RepresentativeAssetId"] = "Document.DocumentDirectRepresentativeRID";
|
|
5718
|
+
FolderField2["TitleWithFallback"] = "CoreField.TitleWithFallback";
|
|
5719
|
+
FolderField2["rawDocSubtype"] = "Document.RawDocSubType";
|
|
5720
|
+
return FolderField2;
|
|
5721
|
+
})(FolderField || {});
|
|
5722
|
+
const FOLDER_PAGE_SIZE = 50;
|
|
5723
|
+
function resolveCollectionsExtraFilters({
|
|
5724
|
+
searchText
|
|
5725
|
+
}) {
|
|
5726
|
+
if (!(searchText == null ? void 0 : searchText.trim())) {
|
|
5727
|
+
return "";
|
|
5728
|
+
}
|
|
5729
|
+
return `Story_Title:${searchText}`;
|
|
5730
|
+
}
|
|
5731
|
+
function apiGetFolders(_0) {
|
|
5732
|
+
return __async(this, arguments, function* ({
|
|
5733
|
+
allowedFolders,
|
|
5734
|
+
baseUrl,
|
|
5735
|
+
bearerToken,
|
|
5736
|
+
excludeVirtualFolders,
|
|
5737
|
+
folderId,
|
|
5738
|
+
includeDirectChild,
|
|
5739
|
+
limit = FOLDER_PAGE_SIZE,
|
|
5740
|
+
noCache,
|
|
5741
|
+
searchTerm,
|
|
5742
|
+
self: self2,
|
|
5743
|
+
start = 0,
|
|
5744
|
+
token: token2
|
|
5745
|
+
}) {
|
|
5746
|
+
let objectRecordIDs = [];
|
|
5747
|
+
let includesDirectChildren = includeDirectChild != null ? includeDirectChild : true;
|
|
5748
|
+
if (allowedFolders && allowedFolders.length > 0 && !folderId) {
|
|
5749
|
+
objectRecordIDs = allowedFolders;
|
|
5750
|
+
self2 = true;
|
|
5751
|
+
includesDirectChildren = false;
|
|
5752
|
+
} else if (folderId) {
|
|
5753
|
+
objectRecordIDs = [folderId];
|
|
5754
|
+
}
|
|
5755
|
+
try {
|
|
5756
|
+
const response = yield http.request({
|
|
5757
|
+
baseURL: baseUrl,
|
|
5758
|
+
cache: noCache ? false : void 0,
|
|
5759
|
+
headers: {
|
|
5760
|
+
Authorization: `Bearer ${bearerToken}`
|
|
5761
|
+
},
|
|
5762
|
+
method: "GET",
|
|
5763
|
+
params: {
|
|
5764
|
+
IncludeDirectChild: includesDirectChildren,
|
|
5765
|
+
IncludeVirtualFolders: !excludeVirtualFolders,
|
|
5766
|
+
Limit: limit,
|
|
5767
|
+
ObjectRecordIDs: objectRecordIDs,
|
|
5768
|
+
SeeThru: !!searchTerm,
|
|
5769
|
+
Self: self2,
|
|
5770
|
+
Start: start,
|
|
5771
|
+
Text: searchTerm || void 0,
|
|
5772
|
+
Token: token2 || void 0
|
|
5773
|
+
},
|
|
5774
|
+
paramsSerializer: {
|
|
5775
|
+
indexes: null
|
|
5776
|
+
},
|
|
5777
|
+
responseType: "json",
|
|
5778
|
+
transformResponse: [
|
|
5779
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5780
|
+
(rawResponse, _headers, status) => {
|
|
5781
|
+
var _a2, _b2, _c2, _d2;
|
|
5782
|
+
if (status !== void 0 && (status < 200 || status >= 300)) {
|
|
5783
|
+
return {
|
|
5784
|
+
data: [],
|
|
5785
|
+
hasMore: false,
|
|
5786
|
+
totalCount: 0
|
|
5787
|
+
};
|
|
5788
|
+
}
|
|
5789
|
+
if (!rawResponse || typeof rawResponse !== "object") {
|
|
5790
|
+
throw new Error("Invalid response format");
|
|
5791
|
+
}
|
|
5792
|
+
const length2 = (_b2 = (_a2 = rawResponse.contentItems) == null ? void 0 : _a2.length) != null ? _b2 : 0;
|
|
5793
|
+
return {
|
|
5794
|
+
data: (_d2 = (_c2 = rawResponse.contentItems) == null ? void 0 : _c2.map((item) => {
|
|
5795
|
+
var _a3, _b3, _c3, _d3;
|
|
5796
|
+
return {
|
|
5797
|
+
docType: (_a3 = item.fields[FolderField.DocType]) != null ? _a3 : "",
|
|
5798
|
+
fullPath: (_b3 = item.fields[FolderField.CortexPath]) != null ? _b3 : "",
|
|
5799
|
+
hasChildren: item.fields[FolderField.HasBrowserChildren] === "1",
|
|
5800
|
+
id: item.recordID,
|
|
5801
|
+
isShared: item.fields[FolderField.rawDocSubtype] === "DO_OR1ND000001913488",
|
|
5802
|
+
representativeAssetId: (_c3 = item.fields[FolderField.RepresentativeAssetId]) != null ? _c3 : "",
|
|
5803
|
+
title: (_d3 = item.fields[FolderField.TitleWithFallback]) != null ? _d3 : ""
|
|
5804
|
+
};
|
|
5805
|
+
})) != null ? _d2 : [],
|
|
5806
|
+
hasMore: start + length2 < rawResponse.totalCount,
|
|
5807
|
+
totalCount: rawResponse.totalCount
|
|
5808
|
+
};
|
|
5809
|
+
}
|
|
5810
|
+
],
|
|
5811
|
+
url: FOLDER_API_ENDPOINT
|
|
5812
|
+
});
|
|
5813
|
+
return response.data;
|
|
5814
|
+
} catch (error) {
|
|
5815
|
+
return {
|
|
5816
|
+
data: [],
|
|
5817
|
+
hasMore: false,
|
|
5818
|
+
totalCount: 0
|
|
5819
|
+
};
|
|
5820
|
+
}
|
|
5821
|
+
});
|
|
5822
|
+
}
|
|
5823
|
+
function apiGetCollections(_0) {
|
|
5824
|
+
return __async(this, arguments, function* ({
|
|
5825
|
+
baseUrl,
|
|
5826
|
+
bearerToken,
|
|
5827
|
+
folderId,
|
|
5828
|
+
pageSize = FOLDER_PAGE_SIZE,
|
|
5829
|
+
searchTerm,
|
|
5830
|
+
start = 0,
|
|
5831
|
+
token: token2
|
|
5832
|
+
}) {
|
|
5833
|
+
try {
|
|
5834
|
+
const extraFilters = resolveCollectionsExtraFilters({ searchText: searchTerm });
|
|
5835
|
+
const response = yield http.request({
|
|
5836
|
+
baseURL: baseUrl,
|
|
5837
|
+
headers: {
|
|
5838
|
+
Authorization: `Bearer ${bearerToken}`
|
|
5839
|
+
},
|
|
5840
|
+
method: "GET",
|
|
5841
|
+
params: __spreadProps(__spreadValues({}, extraFilters && { ExtraFilters: extraFilters }), {
|
|
5842
|
+
Fields: [
|
|
5843
|
+
FolderField.CortexPath,
|
|
5844
|
+
FolderField.DocType,
|
|
5845
|
+
FolderField.TitleWithFallback
|
|
5846
|
+
],
|
|
5847
|
+
Limit: pageSize,
|
|
5848
|
+
SeeThru: true,
|
|
5849
|
+
Start: start,
|
|
5850
|
+
SubtypeCriteria: folderId,
|
|
5851
|
+
Token: token2 || void 0
|
|
5852
|
+
}),
|
|
5853
|
+
paramsSerializer: {
|
|
5854
|
+
indexes: null
|
|
5855
|
+
},
|
|
5856
|
+
responseType: "json",
|
|
5857
|
+
transformResponse: [
|
|
5858
|
+
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
5859
|
+
(rawResponse, _headers, status) => {
|
|
5860
|
+
var _a2, _b2, _c2, _d2;
|
|
5861
|
+
if (status !== void 0 && (status < 200 || status >= 300)) {
|
|
5862
|
+
return {
|
|
5863
|
+
data: [],
|
|
5864
|
+
hasMore: false,
|
|
5865
|
+
totalCount: 0
|
|
5866
|
+
};
|
|
5867
|
+
}
|
|
5868
|
+
if (!rawResponse || typeof rawResponse !== "object") {
|
|
5869
|
+
return {
|
|
5870
|
+
data: [],
|
|
5871
|
+
hasMore: false,
|
|
5872
|
+
totalCount: 0
|
|
5873
|
+
};
|
|
5874
|
+
}
|
|
5875
|
+
const length2 = (_b2 = (_a2 = rawResponse.contentItems) == null ? void 0 : _a2.length) != null ? _b2 : 0;
|
|
5876
|
+
return {
|
|
5877
|
+
data: (_d2 = (_c2 = rawResponse.contentItems) == null ? void 0 : _c2.map((item) => {
|
|
5878
|
+
var _a3, _b3, _c3, _d3;
|
|
5879
|
+
return {
|
|
5880
|
+
docType: (_a3 = item.fields[FolderField.DocType]) != null ? _a3 : "",
|
|
5881
|
+
fullPath: (_c3 = (_b3 = item.fields[FolderField.CortexPath]) == null ? void 0 : _b3.replace(/^Root\//i, "")) != null ? _c3 : "",
|
|
5882
|
+
hasChildren: false,
|
|
5883
|
+
id: item.recordID,
|
|
5884
|
+
parents: [],
|
|
5885
|
+
path: [],
|
|
5886
|
+
title: (_d3 = item.fields[FolderField.TitleWithFallback]) != null ? _d3 : ""
|
|
5887
|
+
};
|
|
5888
|
+
})) != null ? _d2 : [],
|
|
5889
|
+
hasMore: start + length2 < rawResponse.totalCount,
|
|
5890
|
+
totalCount: rawResponse.totalCount
|
|
5891
|
+
};
|
|
5892
|
+
}
|
|
5893
|
+
],
|
|
5894
|
+
url: AssetApiEndpoint.GET_CONTENT_V1
|
|
5895
|
+
});
|
|
5896
|
+
return response.data;
|
|
5897
|
+
} catch (error) {
|
|
5898
|
+
return {
|
|
5899
|
+
data: [],
|
|
5900
|
+
hasMore: false,
|
|
5901
|
+
totalCount: 0
|
|
5902
|
+
};
|
|
5903
|
+
}
|
|
5904
|
+
});
|
|
5905
|
+
}
|
|
5906
|
+
const componentStyles = i$7`
|
|
5907
|
+
:host {
|
|
5908
|
+
box-sizing: border-box;
|
|
5909
|
+
}
|
|
5910
|
+
|
|
5054
5911
|
:host *,
|
|
5055
5912
|
:host *::before,
|
|
5056
5913
|
:host *::after {
|
|
@@ -6085,7 +6942,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6085
6942
|
name="trigger"
|
|
6086
6943
|
slot="anchor"
|
|
6087
6944
|
part="trigger"
|
|
6088
|
-
class=${e$
|
|
6945
|
+
class=${e$1({
|
|
6089
6946
|
"drawer-trigger": true,
|
|
6090
6947
|
"drawer-trigger--hidden": this.isPersistent
|
|
6091
6948
|
})}
|
|
@@ -6145,7 +7002,7 @@ let CxContentBrowserBrowser = class extends CortexElement {
|
|
|
6145
7002
|
${n$5(
|
|
6146
7003
|
this.showCollections && this.collectionPath,
|
|
6147
7004
|
() => b`
|
|
6148
|
-
<div class=${e$
|
|
7005
|
+
<div class=${e$1({
|
|
6149
7006
|
browser__collections: true,
|
|
6150
7007
|
"browser__collections--open": this.collectionsOpen
|
|
6151
7008
|
})}>
|
|
@@ -6296,9 +7153,9 @@ const u = (e2, s2, t2) => {
|
|
|
6296
7153
|
const r2 = /* @__PURE__ */ new Map();
|
|
6297
7154
|
for (let l2 = s2; l2 <= t2; l2++) r2.set(e2[l2], l2);
|
|
6298
7155
|
return r2;
|
|
6299
|
-
}, c$1 = e$
|
|
7156
|
+
}, c$1 = e$2(class extends i$3 {
|
|
6300
7157
|
constructor(e2) {
|
|
6301
|
-
if (super(e2), e2.type !== t$
|
|
7158
|
+
if (super(e2), e2.type !== t$1.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
6302
7159
|
}
|
|
6303
7160
|
dt(e2, s2, t2) {
|
|
6304
7161
|
let r2;
|
|
@@ -6348,10 +7205,10 @@ const u = (e2, s2, t2) => {
|
|
|
6348
7205
|
* Copyright 2018 Google LLC
|
|
6349
7206
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6350
7207
|
*/
|
|
6351
|
-
const n$1 = "important", i$1 = " !" + n$1, o$2 = e$
|
|
7208
|
+
const n$1 = "important", i$1 = " !" + n$1, o$2 = e$2(class extends i$3 {
|
|
6352
7209
|
constructor(t2) {
|
|
6353
7210
|
var _a2;
|
|
6354
|
-
if (super(t2), t2.type !== t$
|
|
7211
|
+
if (super(t2), t2.type !== t$1.ATTRIBUTE || "style" !== t2.name || ((_a2 = t2.strings) == null ? void 0 : _a2.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
6355
7212
|
}
|
|
6356
7213
|
render(t2) {
|
|
6357
7214
|
return Object.keys(t2).reduce((e2, r2) => {
|
|
@@ -6374,86 +7231,6 @@ const n$1 = "important", i$1 = " !" + n$1, o$2 = e$6(class extends i$3 {
|
|
|
6374
7231
|
return E;
|
|
6375
7232
|
}
|
|
6376
7233
|
});
|
|
6377
|
-
var OptionType = /* @__PURE__ */ ((OptionType2) => {
|
|
6378
|
-
OptionType2["FILTER"] = "filter";
|
|
6379
|
-
OptionType2["SORT_DIRECTION"] = "sort-direction";
|
|
6380
|
-
OptionType2["SORT_ORDER"] = "sort-order";
|
|
6381
|
-
return OptionType2;
|
|
6382
|
-
})(OptionType || {});
|
|
6383
|
-
var GridView$1 = /* @__PURE__ */ ((GridView2) => {
|
|
6384
|
-
GridView2["Large"] = "large";
|
|
6385
|
-
GridView2["Medium"] = "medium";
|
|
6386
|
-
GridView2["Small"] = "small";
|
|
6387
|
-
return GridView2;
|
|
6388
|
-
})(GridView$1 || {});
|
|
6389
|
-
const TABLE_VIEW = "table";
|
|
6390
|
-
const ASSET_SIZE = {
|
|
6391
|
-
[
|
|
6392
|
-
"small"
|
|
6393
|
-
/* Small */
|
|
6394
|
-
]: {
|
|
6395
|
-
maxWidth: 178,
|
|
6396
|
-
minWidth: 130
|
|
6397
|
-
},
|
|
6398
|
-
[
|
|
6399
|
-
"medium"
|
|
6400
|
-
/* Medium */
|
|
6401
|
-
]: {
|
|
6402
|
-
maxWidth: 292,
|
|
6403
|
-
minWidth: 190
|
|
6404
|
-
},
|
|
6405
|
-
[
|
|
6406
|
-
"large"
|
|
6407
|
-
/* Large */
|
|
6408
|
-
]: {
|
|
6409
|
-
maxWidth: 456,
|
|
6410
|
-
minWidth: 302
|
|
6411
|
-
}
|
|
6412
|
-
};
|
|
6413
|
-
var TransformationAction = /* @__PURE__ */ ((TransformationAction2) => {
|
|
6414
|
-
TransformationAction2["Crop"] = "Crop";
|
|
6415
|
-
TransformationAction2["Metadata"] = "Metadata";
|
|
6416
|
-
TransformationAction2["Proxy"] = "Proxy";
|
|
6417
|
-
TransformationAction2["Quality"] = "Quality";
|
|
6418
|
-
TransformationAction2["Resize"] = "Resize";
|
|
6419
|
-
TransformationAction2["Rotate"] = "Rotate";
|
|
6420
|
-
return TransformationAction2;
|
|
6421
|
-
})(TransformationAction || {});
|
|
6422
|
-
const autoSelectFormatConverter = {
|
|
6423
|
-
fromAttribute: (value) => {
|
|
6424
|
-
if (value === null) {
|
|
6425
|
-
return false;
|
|
6426
|
-
}
|
|
6427
|
-
const normalized = value.trim();
|
|
6428
|
-
if (normalized === "" || normalized.toLowerCase() === "true") {
|
|
6429
|
-
return true;
|
|
6430
|
-
}
|
|
6431
|
-
if (normalized.toLowerCase() === "false") {
|
|
6432
|
-
return false;
|
|
6433
|
-
}
|
|
6434
|
-
return normalized;
|
|
6435
|
-
},
|
|
6436
|
-
toAttribute: (value) => {
|
|
6437
|
-
return value === false ? null : String(value);
|
|
6438
|
-
}
|
|
6439
|
-
};
|
|
6440
|
-
function isAutoSelectFormatActive(value) {
|
|
6441
|
-
return value === true || typeof value === "string" && value.trim() !== "";
|
|
6442
|
-
}
|
|
6443
|
-
function toTitleFallback(value) {
|
|
6444
|
-
return value === "originalFileName" ? "originalFileName" : "uniqueIdentifier";
|
|
6445
|
-
}
|
|
6446
|
-
function toTableRowActionPosition(value) {
|
|
6447
|
-
return value === "row-end" ? "row-end" : "host-edge";
|
|
6448
|
-
}
|
|
6449
|
-
var ContentBrowserFormatDialogVariant = /* @__PURE__ */ ((ContentBrowserFormatDialogVariant2) => {
|
|
6450
|
-
ContentBrowserFormatDialogVariant2["Dialog"] = "dialog";
|
|
6451
|
-
ContentBrowserFormatDialogVariant2["Drawer"] = "drawer";
|
|
6452
|
-
return ContentBrowserFormatDialogVariant2;
|
|
6453
|
-
})(ContentBrowserFormatDialogVariant || {});
|
|
6454
|
-
function toFieldKey(field) {
|
|
6455
|
-
return field.trim().toLowerCase();
|
|
6456
|
-
}
|
|
6457
7234
|
var __defProp$g = Object.defineProperty;
|
|
6458
7235
|
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
6459
7236
|
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
@@ -6754,7 +7531,7 @@ let CxContentBrowserControlFilter = class extends CortexElement {
|
|
|
6754
7531
|
return b`
|
|
6755
7532
|
<cx-details
|
|
6756
7533
|
open
|
|
6757
|
-
class=${e$
|
|
7534
|
+
class=${e$1({
|
|
6758
7535
|
"filter-details": true,
|
|
6759
7536
|
"filter-details--empty": this.appliedFiltersCount === 0
|
|
6760
7537
|
})}
|
|
@@ -7552,7 +8329,7 @@ CxContentBrowserControlBar = __decorateClass$c([
|
|
|
7552
8329
|
* Copyright 2018 Google LLC
|
|
7553
8330
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7554
8331
|
*/
|
|
7555
|
-
const e = {}, i3 = e$
|
|
8332
|
+
const e = {}, i3 = e$2(class extends i$3 {
|
|
7556
8333
|
constructor() {
|
|
7557
8334
|
super(...arguments), this.ot = e;
|
|
7558
8335
|
}
|
|
@@ -7915,7 +8692,7 @@ let CxContentBrowserAssetPreviewVideo = class extends CortexElement {
|
|
|
7915
8692
|
render() {
|
|
7916
8693
|
return b`
|
|
7917
8694
|
<div
|
|
7918
|
-
class=${e$
|
|
8695
|
+
class=${e$1({
|
|
7919
8696
|
"content-browser-asset-preview__representative": true,
|
|
7920
8697
|
[`content-browser-asset-preview__representative--${this.assetDirection}`]: true
|
|
7921
8698
|
})}
|
|
@@ -8229,7 +9006,7 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8229
9006
|
return b`
|
|
8230
9007
|
<div
|
|
8231
9008
|
data-testid="content-browser-asset-preview__thumbnail--cold-storage"
|
|
8232
|
-
class=${e$
|
|
9009
|
+
class=${e$1({
|
|
8233
9010
|
"content-browser-asset-preview__thumbnail": true,
|
|
8234
9011
|
"content-browser-asset-preview__thumbnail--other": true
|
|
8235
9012
|
})}>
|
|
@@ -8251,7 +9028,7 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8251
9028
|
return b`
|
|
8252
9029
|
<div
|
|
8253
9030
|
data-testid="content-browser-asset-preview__thumbnail--other"
|
|
8254
|
-
class=${e$
|
|
9031
|
+
class=${e$1({
|
|
8255
9032
|
"content-browser-asset-preview__thumbnail": true,
|
|
8256
9033
|
"content-browser-asset-preview__thumbnail--other": true
|
|
8257
9034
|
})}
|
|
@@ -8277,7 +9054,7 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8277
9054
|
return b`
|
|
8278
9055
|
<div
|
|
8279
9056
|
data-testid="content-browser-asset-preview__representative-container"
|
|
8280
|
-
class=${e$
|
|
9057
|
+
class=${e$1({
|
|
8281
9058
|
"content-browser-asset-preview__representative-container": true,
|
|
8282
9059
|
"content-browser-asset-preview__representative-container--animated": this.extension === GIF_EXTENSION && this.originalUrl && this.loaded
|
|
8283
9060
|
})}
|
|
@@ -8293,7 +9070,7 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8293
9070
|
this.extension === GIF_EXTENSION && this.originalUrl,
|
|
8294
9071
|
() => b`
|
|
8295
9072
|
<img
|
|
8296
|
-
class=${e$
|
|
9073
|
+
class=${e$1({
|
|
8297
9074
|
"content-browser-asset-preview__representative": true,
|
|
8298
9075
|
"content-browser-asset-preview__representative--animated": true
|
|
8299
9076
|
})}
|
|
@@ -8308,7 +9085,7 @@ let CxContentBrowserAssetPreview = class extends CortexElement {
|
|
|
8308
9085
|
}
|
|
8309
9086
|
render() {
|
|
8310
9087
|
return b`
|
|
8311
|
-
<div class=${e$
|
|
9088
|
+
<div class=${e$1({
|
|
8312
9089
|
"content-browser-asset-preview": true
|
|
8313
9090
|
})}
|
|
8314
9091
|
>
|
|
@@ -8671,7 +9448,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8671
9448
|
(item) => b`
|
|
8672
9449
|
<cx-menu-item
|
|
8673
9450
|
value=${item.id}
|
|
8674
|
-
class=${e$
|
|
9451
|
+
class=${e$1({
|
|
8675
9452
|
"content-browser-asset-proxy-selector__menu-item": true,
|
|
8676
9453
|
"content-browser-asset-proxy-selector__menu-item--disable-hover": !this.disabledSelected && item.id === this.selected
|
|
8677
9454
|
})}
|
|
@@ -8688,7 +9465,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8688
9465
|
<div>
|
|
8689
9466
|
<cx-typography
|
|
8690
9467
|
variant="body3"
|
|
8691
|
-
class=${e$
|
|
9468
|
+
class=${e$1({
|
|
8692
9469
|
"content-browser-asset-proxy-selector__menu-item__name": true,
|
|
8693
9470
|
"content-browser-asset-proxy-selector__menu-item__name--selected": !this.disabledSelected && item.id === this.selected
|
|
8694
9471
|
})}
|
|
@@ -8740,13 +9517,13 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8740
9517
|
() => b`
|
|
8741
9518
|
<cx-menu-item
|
|
8742
9519
|
value=${USE_REPRESENTATIVE_VALUE}
|
|
8743
|
-
class=${e$
|
|
9520
|
+
class=${e$1({
|
|
8744
9521
|
"content-browser-asset-proxy-selector__menu-item": true
|
|
8745
9522
|
})}
|
|
8746
9523
|
>
|
|
8747
9524
|
<cx-typography
|
|
8748
9525
|
variant="body3"
|
|
8749
|
-
class=${e$
|
|
9526
|
+
class=${e$1({
|
|
8750
9527
|
"content-browser-asset-proxy-selector__menu-item__name": true,
|
|
8751
9528
|
"content-browser-asset-proxy-selector__menu-item__name--selected": !this.disabledSelected && this.selected === USE_REPRESENTATIVE_VALUE
|
|
8752
9529
|
})}
|
|
@@ -8771,7 +9548,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8771
9548
|
<cx-menu class="content-browser-asset-proxy-selector__menu">
|
|
8772
9549
|
<cx-menu-item
|
|
8773
9550
|
value=${CUSTOM_FORMAT_VALUE}
|
|
8774
|
-
class=${e$
|
|
9551
|
+
class=${e$1({
|
|
8775
9552
|
"content-browser-asset-proxy-selector__menu-item": true
|
|
8776
9553
|
})}
|
|
8777
9554
|
>
|
|
@@ -8783,7 +9560,7 @@ let CxContentBrowserAssetProxySelector = class extends CortexElement {
|
|
|
8783
9560
|
<div>
|
|
8784
9561
|
<cx-typography
|
|
8785
9562
|
variant="body3"
|
|
8786
|
-
class=${e$
|
|
9563
|
+
class=${e$1({
|
|
8787
9564
|
"content-browser-asset-proxy-selector__menu-item__name": true,
|
|
8788
9565
|
"content-browser-asset-proxy-selector__menu-item__name--selected": !this.disabledSelected && this.selected === CUSTOM_FORMAT_VALUE
|
|
8789
9566
|
})}
|
|
@@ -9189,9 +9966,15 @@ const styles$6 = i$7`
|
|
|
9189
9966
|
|
|
9190
9967
|
.content-browser-format__footer {
|
|
9191
9968
|
display: flex;
|
|
9969
|
+
flex-wrap: wrap;
|
|
9192
9970
|
justify-content: flex-end;
|
|
9193
9971
|
}
|
|
9194
9972
|
|
|
9973
|
+
.content-browser-format__error {
|
|
9974
|
+
flex-basis: 100%;
|
|
9975
|
+
margin-bottom: var(--cx-spacing-small);
|
|
9976
|
+
}
|
|
9977
|
+
|
|
9195
9978
|
.content-browser-format__footer__button cx-button-group {
|
|
9196
9979
|
width: 100%;
|
|
9197
9980
|
}
|
|
@@ -9271,6 +10054,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9271
10054
|
this.confirmedTransformations = [];
|
|
9272
10055
|
this.confirmedFormat = void 0;
|
|
9273
10056
|
this.loadingConfirm = false;
|
|
10057
|
+
this.confirmError = void 0;
|
|
9274
10058
|
this.enabledTracking = false;
|
|
9275
10059
|
this.trackingParameters = DEFAULT_TRACKING_PARAMETERS;
|
|
9276
10060
|
}
|
|
@@ -9352,6 +10136,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9352
10136
|
}) {
|
|
9353
10137
|
var _a2, _b2;
|
|
9354
10138
|
this.asset = asset;
|
|
10139
|
+
this.confirmError = void 0;
|
|
9355
10140
|
this.isFavorite = isFavorite;
|
|
9356
10141
|
this.isAssetPinned = isAssetPinned;
|
|
9357
10142
|
this.proxies = proxies;
|
|
@@ -9410,6 +10195,15 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9410
10195
|
setLoadingConfirm(loadingConfirm) {
|
|
9411
10196
|
this.loadingConfirm = loadingConfirm;
|
|
9412
10197
|
}
|
|
10198
|
+
/**
|
|
10199
|
+
* Show why the last confirm failed, and make the confirm button usable again for a retry.
|
|
10200
|
+
* Without a message, the dialog shows a generic error text.
|
|
10201
|
+
*/
|
|
10202
|
+
showConfirmError(message) {
|
|
10203
|
+
var _a2;
|
|
10204
|
+
this.loadingConfirm = false;
|
|
10205
|
+
this.confirmError = (_a2 = message == null ? void 0 : message.trim()) != null ? _a2 : "";
|
|
10206
|
+
}
|
|
9413
10207
|
mapFormatConfirmPayload(asset, selectedProxy) {
|
|
9414
10208
|
var _a2, _b2, _c2, _d2, _e3, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
9415
10209
|
return {
|
|
@@ -9503,6 +10297,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9503
10297
|
if (!this.asset || !this.canConfirm) {
|
|
9504
10298
|
return;
|
|
9505
10299
|
}
|
|
10300
|
+
this.confirmError = void 0;
|
|
9506
10301
|
if (!this.canUseProxies) {
|
|
9507
10302
|
this.loadingConfirm = true;
|
|
9508
10303
|
this.emit("cx-content-browser-format-dialog-proxy-confirm", {
|
|
@@ -9929,6 +10724,16 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9929
10724
|
}
|
|
9930
10725
|
return b`
|
|
9931
10726
|
<div slot="footer" class="content-browser-format__footer">
|
|
10727
|
+
${n$5(
|
|
10728
|
+
this.confirmError !== void 0,
|
|
10729
|
+
() => b`
|
|
10730
|
+
<cx-alert class="content-browser-format__error" variant="danger" open>
|
|
10731
|
+
<cx-icon slot="icon" name="report"></cx-icon>
|
|
10732
|
+
${this.confirmError || this.localize.term("oopsSomethingWentWrong")}
|
|
10733
|
+
</cx-alert>
|
|
10734
|
+
`,
|
|
10735
|
+
() => A$1
|
|
10736
|
+
)}
|
|
9932
10737
|
${content}
|
|
9933
10738
|
</div>
|
|
9934
10739
|
`;
|
|
@@ -9954,6 +10759,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
9954
10759
|
}
|
|
9955
10760
|
handleClose() {
|
|
9956
10761
|
this.asset = void 0;
|
|
10762
|
+
this.confirmError = void 0;
|
|
9957
10763
|
this.confirmedFormat = void 0;
|
|
9958
10764
|
this.confirmedTransformations = [];
|
|
9959
10765
|
this.isOpen = false;
|
|
@@ -10005,6 +10811,7 @@ let CxContentBrowserFormatDialog = class extends CortexElement {
|
|
|
10005
10811
|
};
|
|
10006
10812
|
CxContentBrowserFormatDialog.styles = [componentStyles, styles$6];
|
|
10007
10813
|
CxContentBrowserFormatDialog.dependencies = {
|
|
10814
|
+
"cx-alert": CxAlert,
|
|
10008
10815
|
"cx-asset-link-format": CxAssetLinkFormat,
|
|
10009
10816
|
"cx-cropper": CxCropper,
|
|
10010
10817
|
"cx-content-browser-asset-preview": CxContentBrowserAssetPreview,
|
|
@@ -10012,6 +10819,7 @@ CxContentBrowserFormatDialog.dependencies = {
|
|
|
10012
10819
|
"cx-content-browser-asset-version-history": CxContentBrowserAssetVersionHistory,
|
|
10013
10820
|
"cx-dialog": CxDialog,
|
|
10014
10821
|
"cx-drawer": CxDrawer,
|
|
10822
|
+
"cx-icon": CxIcon,
|
|
10015
10823
|
"cx-icon-button": CxIconButton,
|
|
10016
10824
|
"cx-line-clamp": CxLineClamp,
|
|
10017
10825
|
"cx-space": CxSpace,
|
|
@@ -10152,6 +10960,9 @@ __decorateClass$6([
|
|
|
10152
10960
|
__decorateClass$6([
|
|
10153
10961
|
r$6()
|
|
10154
10962
|
], CxContentBrowserFormatDialog.prototype, "loadingConfirm", 2);
|
|
10963
|
+
__decorateClass$6([
|
|
10964
|
+
r$6()
|
|
10965
|
+
], CxContentBrowserFormatDialog.prototype, "confirmError", 2);
|
|
10155
10966
|
__decorateClass$6([
|
|
10156
10967
|
r$6()
|
|
10157
10968
|
], CxContentBrowserFormatDialog.prototype, "enabledTracking", 2);
|
|
@@ -10211,7 +11022,7 @@ function n2(i4, t2 = false, e2 = 0) {
|
|
|
10211
11022
|
}
|
|
10212
11023
|
const c = (i4) => {
|
|
10213
11024
|
var _a2, _b2;
|
|
10214
|
-
i4.type == t$
|
|
11025
|
+
i4.type == t$1.CHILD && ((_a2 = i4._$AP) != null ? _a2 : i4._$AP = n2, (_b2 = i4._$AQ) != null ? _b2 : i4._$AQ = h);
|
|
10215
11026
|
};
|
|
10216
11027
|
let f$1 = class f extends i$3 {
|
|
10217
11028
|
constructor() {
|
|
@@ -11046,7 +11857,7 @@ class VirtualizeDirective extends f$1 {
|
|
|
11046
11857
|
this._renderItem = (item, idx) => defaultRenderItem(item, idx + this._first);
|
|
11047
11858
|
this._keyFunction = (item, idx) => defaultKeyFunction(item, idx + this._first);
|
|
11048
11859
|
this._items = [];
|
|
11049
|
-
if (part.type !== t$
|
|
11860
|
+
if (part.type !== t$1.CHILD) {
|
|
11050
11861
|
throw new Error("The virtualize directive can only be used in child expressions");
|
|
11051
11862
|
}
|
|
11052
11863
|
}
|
|
@@ -11121,7 +11932,7 @@ class VirtualizeDirective extends f$1 {
|
|
|
11121
11932
|
(_a2 = this._virtualizer) == null ? void 0 : _a2.connected();
|
|
11122
11933
|
}
|
|
11123
11934
|
}
|
|
11124
|
-
const virtualize = e$
|
|
11935
|
+
const virtualize = e$2(VirtualizeDirective);
|
|
11125
11936
|
/**
|
|
11126
11937
|
* @license
|
|
11127
11938
|
* Copyright 2021 Google LLC
|
|
@@ -12119,7 +12930,7 @@ let CxContentBrowserAssetCard = class extends CortexElement {
|
|
|
12119
12930
|
var _a2, _b2;
|
|
12120
12931
|
return b`
|
|
12121
12932
|
<cx-card
|
|
12122
|
-
class=${e$
|
|
12933
|
+
class=${e$1({
|
|
12123
12934
|
"content-browser-asset-card": true,
|
|
12124
12935
|
[`content-browser-asset-card--${this.view}`]: true,
|
|
12125
12936
|
"content-browser-asset-card--disabled": this.inColdStorage,
|
|
@@ -12145,7 +12956,7 @@ let CxContentBrowserAssetCard = class extends CortexElement {
|
|
|
12145
12956
|
() => b`
|
|
12146
12957
|
<div
|
|
12147
12958
|
slot="image"
|
|
12148
|
-
class=${e$
|
|
12959
|
+
class=${e$1({
|
|
12149
12960
|
"content-browser-asset-card__cta": true,
|
|
12150
12961
|
"content-browser-asset-card__cta--busy": this.busy
|
|
12151
12962
|
})}
|
|
@@ -12230,7 +13041,7 @@ let CxContentBrowserAssetCard = class extends CortexElement {
|
|
|
12230
13041
|
() => b`
|
|
12231
13042
|
<cx-line-clamp
|
|
12232
13043
|
lines="1"
|
|
12233
|
-
class=${e$
|
|
13044
|
+
class=${e$1({
|
|
12234
13045
|
"content-browser-asset-card__name": true,
|
|
12235
13046
|
"content-browser-asset-card__name--right": true
|
|
12236
13047
|
})}
|
|
@@ -13097,7 +13908,7 @@ let CxContentBrowserHeader = class extends CortexElement {
|
|
|
13097
13908
|
"container--bordered": this.bordered
|
|
13098
13909
|
};
|
|
13099
13910
|
return b`
|
|
13100
|
-
<cx-space class=${e$
|
|
13911
|
+
<cx-space class=${e$1(containerClasses)} direction="vertical" spacing="small">
|
|
13101
13912
|
<cx-space class="header" justify-content="space-between" align-items="center">
|
|
13102
13913
|
<div class="header__title">
|
|
13103
13914
|
<cx-space class="header" justify-content="space-between" align-items="center" spacing="x-small">
|
|
@@ -13835,1408 +14646,662 @@ let CxContentBrowserTable = class extends CortexElement {
|
|
|
13835
14646
|
if (measure) {
|
|
13836
14647
|
__privateSet$1(this, _layoutPending, false);
|
|
13837
14648
|
this.layoutAgainWhenFontsLoad();
|
|
13838
|
-
}
|
|
13839
|
-
const hidden = new Set(this.hiddenFields);
|
|
13840
|
-
const keys2 = this.resolveColumnKeys();
|
|
13841
|
-
const shown = this.columns.flatMap((column2, index) => {
|
|
13842
|
-
const tabulatorColumn = hidden.has(column2.field) ? false : tabulator.getColumn(keys2[index]);
|
|
13843
|
-
return tabulatorColumn ? [{ column: column2, key: keys2[index], tabulatorColumn }] : [];
|
|
13844
|
-
});
|
|
13845
|
-
const metrics = this.readColumnMetrics(shown.map(({ tabulatorColumn }) => tabulatorColumn));
|
|
13846
|
-
if (!metrics) {
|
|
13847
|
-
return;
|
|
13848
|
-
}
|
|
13849
|
-
const scrollbar = this.getScrollbarWidth();
|
|
13850
|
-
__privateSet$1(this, _layoutScrollbarWidth, scrollbar);
|
|
13851
|
-
const widths = layoutColumnWidths(shown.map(({ column: column2, key }) => {
|
|
13852
|
-
var _a3;
|
|
13853
|
-
let natural = measure ? void 0 : __privateGet$1(this, _naturalWidths).get(key);
|
|
13854
|
-
if (natural === void 0) {
|
|
13855
|
-
natural = this.measureNaturalWidth(column2, metrics);
|
|
13856
|
-
__privateGet$1(this, _naturalWidths).set(key, natural);
|
|
13857
|
-
}
|
|
13858
|
-
return { natural, saved: (_a3 = __privateGet$1(this, _resizedWidths).get(column2.field.trim())) != null ? _a3 : __privateGet$1(this, _sessionWidths).get(column2.field.trim()) };
|
|
13859
|
-
}), Math.floor(unroundedClientWidth(element) - scrollbar) - RESIZE_BUFFER_WIDTH);
|
|
13860
|
-
shown.forEach(({ key, tabulatorColumn }, index) => {
|
|
13861
|
-
const width = widths[index];
|
|
13862
|
-
void tabulatorColumn.setWidth(width);
|
|
13863
|
-
tabulatorColumn.getDefinition().width = width;
|
|
13864
|
-
const definition = __privateGet$1(this, _columnDefinitions).find(({ field }) => field === key);
|
|
13865
|
-
if (definition) {
|
|
13866
|
-
definition.width = width;
|
|
13867
|
-
}
|
|
13868
|
-
});
|
|
13869
|
-
this.syncTableFrame();
|
|
13870
|
-
}
|
|
13871
|
-
/**
|
|
13872
|
-
* The canvas measures with a fallback font while a web font loads, so measure again once the fonts
|
|
13873
|
-
* are ready. Guarded by one pending wait, and by the connection of the element.
|
|
13874
|
-
*/
|
|
13875
|
-
layoutAgainWhenFontsLoad() {
|
|
13876
|
-
var _a2;
|
|
13877
|
-
if (__privateGet$1(this, _fontsPending) || ((_a2 = document.fonts) == null ? void 0 : _a2.status) !== "loading") {
|
|
13878
|
-
return;
|
|
13879
|
-
}
|
|
13880
|
-
__privateSet$1(this, _fontsPending, true);
|
|
13881
|
-
void document.fonts.ready.then(() => {
|
|
13882
|
-
__privateSet$1(this, _fontsPending, false);
|
|
13883
|
-
if (this.isConnected) {
|
|
13884
|
-
this.applyColumnLayout();
|
|
13885
|
-
}
|
|
13886
|
-
});
|
|
13887
|
-
}
|
|
13888
|
-
/**
|
|
13889
|
-
* `content-browser` hands over the whole list on every page, so a list that only grows by a page
|
|
13890
|
-
* is appended: reassigning it would call `setData`, which scrolls the table back to the top. Any
|
|
13891
|
-
* other list -- a new search, sort, filter or folder, or a refetch that brings the assets the rows
|
|
13892
|
-
* show as new objects -- replaces the rows.
|
|
13893
|
-
*/
|
|
13894
|
-
syncRows(replace2 = false) {
|
|
13895
|
-
return __async(this, null, function* () {
|
|
13896
|
-
const tabulator = this.tabulator;
|
|
13897
|
-
if (!tabulator) {
|
|
13898
|
-
return;
|
|
13899
|
-
}
|
|
13900
|
-
const columnKeys = this.resolveColumnKeys();
|
|
13901
|
-
const synced = __privateGet$1(this, _syncedAssets);
|
|
13902
|
-
const isNextPage = !replace2 && __privateGet$1(this, _pendingReplaces) === 0 && isAppendOf(synced, this.assets);
|
|
13903
|
-
__privateSet$1(this, _syncedAssets, [...this.assets]);
|
|
13904
|
-
if (isNextPage) {
|
|
13905
|
-
__privateSet$1(this, _heldRowKeys, new Set(columnKeys.filter((key) => __privateGet$1(this, _heldRowKeys).has(key))));
|
|
13906
|
-
yield tabulator.addData(this.assets.slice(synced.length).map((asset) => this.toRow(asset, columnKeys)));
|
|
13907
|
-
} else {
|
|
13908
|
-
__privateSet$1(this, _heldRowKeys, new Set(columnKeys));
|
|
13909
|
-
__privateSet$1(this, _pendingReplaces, __privateGet$1(this, _pendingReplaces) + 1);
|
|
13910
|
-
try {
|
|
13911
|
-
yield tabulator.setData(this.assets.map((asset) => this.toRow(asset, columnKeys)));
|
|
13912
|
-
} finally {
|
|
13913
|
-
__privateSet$1(this, _pendingReplaces, __privateGet$1(this, _pendingReplaces) - 1);
|
|
13914
|
-
}
|
|
13915
|
-
this.applyColumnLayout();
|
|
13916
|
-
}
|
|
13917
|
-
this.markCurrentRow(this.selectedAssetId, true);
|
|
13918
|
-
this.observeLastRow();
|
|
13919
|
-
this.reportRestartedRowCount();
|
|
13920
|
-
this.reportHeldRowCount();
|
|
13921
|
-
});
|
|
13922
|
-
}
|
|
13923
|
-
handleTableBuilt(event) {
|
|
13924
|
-
var _a2, _b2;
|
|
13925
|
-
event.stopPropagation();
|
|
13926
|
-
__privateSet$1(this, _builtTable, (_b2 = (_a2 = this.tableEl) == null ? void 0 : _a2.tabulatorInstance) != null ? _b2 : void 0);
|
|
13927
|
-
if (__privateGet$1(this, _builtTable)) {
|
|
13928
|
-
__privateGet$1(this, _builtTable).options.rowFormatter = (row) => this.renderRowAction(row);
|
|
13929
|
-
}
|
|
13930
|
-
this.prepareFrame();
|
|
13931
|
-
__privateSet$1(this, _syncedAssets, []);
|
|
13932
|
-
void this.syncRows();
|
|
13933
|
-
}
|
|
13934
|
-
/**
|
|
13935
|
-
* Gives the frame, the scrollport and the header their styles. Runs as soon as Tabulator lays out its
|
|
13936
|
-
* columns: until then the frame takes the width of its content, which is not the width of the header.
|
|
13937
|
-
*/
|
|
13938
|
-
prepareFrame() {
|
|
13939
|
-
var _a2, _b2, _c2, _d2, _e3, _f2, _g;
|
|
13940
|
-
const scrollport = (_b2 = (_a2 = this.buildingTabulator) == null ? void 0 : _a2.rowManager) == null ? void 0 : _b2.element;
|
|
13941
|
-
const frame = scrollport == null ? void 0 : scrollport.parentElement;
|
|
13942
|
-
frame == null ? void 0 : frame.style.setProperty("width", "100%");
|
|
13943
|
-
frame == null ? void 0 : frame.part.add("content-browser-frame");
|
|
13944
|
-
scrollport == null ? void 0 : scrollport.part.add("content-browser-scrollport");
|
|
13945
|
-
const header = (_d2 = (_c2 = this.tableEl) == null ? void 0 : _c2.shadowRoot) == null ? void 0 : _d2.querySelector(".tabulator-header");
|
|
13946
|
-
const columns = header == null ? void 0 : header.querySelector(".tabulator-headers");
|
|
13947
|
-
header == null ? void 0 : header.part.add("content-browser-header");
|
|
13948
|
-
(_f2 = (_e3 = this.tableEl) == null ? void 0 : _e3.shadowRoot) == null ? void 0 : _f2.addEventListener("dblclick", this.handleResizeHandleDoubleClick, { capture: true });
|
|
13949
|
-
(_g = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _g.disconnect();
|
|
13950
|
-
if (columns) {
|
|
13951
|
-
__privateSet$1(this, _frameWidthObserver, new ResizeObserver(() => this.syncTableFrame()));
|
|
13952
|
-
__privateGet$1(this, _frameWidthObserver).observe(columns);
|
|
13953
|
-
}
|
|
13954
|
-
this.syncTableFrame();
|
|
13955
|
-
}
|
|
13956
|
-
/**
|
|
13957
|
-
* `setData` replaces the rows only once its debounce runs out, and Tabulator emits `dataLoaded` just
|
|
13958
|
-
* before it does. Until then, the old rows stay on the page with their hover and focus.
|
|
13959
|
-
*/
|
|
13960
|
-
handleDataLoaded(event) {
|
|
13961
|
-
event.stopPropagation();
|
|
13962
|
-
__privateSet$1(this, _hoveredRow, void 0);
|
|
13963
|
-
__privateSet$1(this, _focusedCta, void 0);
|
|
13964
|
-
__privateGet$1(this, _renderedCtas).clear();
|
|
13965
|
-
}
|
|
13966
|
-
/**
|
|
13967
|
-
* Every `setColumns` builds the columns again from the definitions: Tabulator calls it as it builds,
|
|
13968
|
-
* before `tableBuilt`. `cx-table` calls it again from its own `tableBuilt` handler, after this
|
|
13969
|
-
* component's has run, and for every new column set.
|
|
13970
|
-
*/
|
|
13971
|
-
handleColumnsLoaded(event) {
|
|
13972
|
-
event.stopPropagation();
|
|
13973
|
-
this.prepareFrame();
|
|
13974
|
-
this.applyColumnLayout();
|
|
13975
|
-
}
|
|
13976
|
-
willUpdate(changedProperties) {
|
|
13977
|
-
super.willUpdate(changedProperties);
|
|
13978
|
-
const signature = columnsSignature(this.columns);
|
|
13979
|
-
const columnsChanged = signature !== __privateGet$1(this, _columnsSignature);
|
|
13980
|
-
const tableRemounts = changedProperties.get("empty") === true && !this.empty;
|
|
13981
|
-
if (columnsChanged) {
|
|
13982
|
-
__privateSet$1(this, _columnsSignature, signature);
|
|
13983
|
-
__privateSet$1(this, _rowsNeedRebuild, this.hasUpdated && this.resolveColumnKeys().some((key) => !__privateGet$1(this, _heldRowKeys).has(key)));
|
|
13984
|
-
}
|
|
13985
|
-
const savedWidthsChanged = changedProperties.has("savedWidths");
|
|
13986
|
-
const widthScopeChanged = changedProperties.has("widthScope");
|
|
13987
|
-
if (widthScopeChanged) {
|
|
13988
|
-
__privateGet$1(this, _sessionWidths).clear();
|
|
13989
|
-
}
|
|
13990
|
-
if (savedWidthsChanged) {
|
|
13991
|
-
this.applySavedWidths();
|
|
13992
|
-
}
|
|
13993
|
-
if (columnsChanged || tableRemounts) {
|
|
13994
|
-
__privateSet$1(this, _columnDefinitions, this.buildColumnDefinitions());
|
|
13995
|
-
} else if (changedProperties.has("hiddenFields")) {
|
|
13996
|
-
this.applyHiddenFields();
|
|
13997
|
-
} else if (savedWidthsChanged || widthScopeChanged) {
|
|
13998
|
-
this.applyColumnLayout();
|
|
13999
|
-
}
|
|
14000
|
-
}
|
|
14001
|
-
/**
|
|
14002
|
-
* The new saved widths replace all the widths in memory: a width that the new map does not hold,
|
|
14003
|
-
* for example one of another site, goes away. Only a positive width counts: a bad entry has no effect.
|
|
14004
|
-
*/
|
|
14005
|
-
applySavedWidths() {
|
|
14006
|
-
var _a2;
|
|
14007
|
-
__privateSet$1(this, _resizedWidths, new Map(Object.entries((_a2 = this.savedWidths) != null ? _a2 : {}).flatMap(([field, width]) => typeof width === "number" && Number.isFinite(width) && width > 0 ? [[field.trim(), Math.round(width)]] : [])));
|
|
14008
|
-
}
|
|
14009
|
-
/**
|
|
14010
|
-
* Through Tabulator's own column visibility: new definitions would reach it through `setColumns`,
|
|
14011
|
-
* and the rows would have to be rebuilt, which scrolls back to the top.
|
|
14012
|
-
*/
|
|
14013
|
-
applyHiddenFields() {
|
|
14014
|
-
const hidden = new Set(this.hiddenFields);
|
|
14015
|
-
const keys2 = this.resolveColumnKeys();
|
|
14016
|
-
const shows = [];
|
|
14017
|
-
__privateGet$1(this, _columnDefinitions).forEach((definition) => {
|
|
14018
|
-
var _a2;
|
|
14019
|
-
const field = String(definition.field);
|
|
14020
|
-
const hostColumn = this.columns[keys2.indexOf(field)];
|
|
14021
|
-
if (!hostColumn) {
|
|
14022
|
-
return;
|
|
14023
|
-
}
|
|
14024
|
-
const isHidden = hidden.has(hostColumn.field);
|
|
14025
|
-
const column2 = (_a2 = this.tabulator) == null ? void 0 : _a2.getColumn(field);
|
|
14026
|
-
definition.hidden = isHidden || void 0;
|
|
14027
|
-
if (column2 && column2.isVisible() === isHidden) {
|
|
14028
|
-
if (isHidden) {
|
|
14029
|
-
column2.hide();
|
|
14030
|
-
} else {
|
|
14031
|
-
shows.push(column2.show());
|
|
14032
|
-
}
|
|
14033
|
-
}
|
|
14034
|
-
});
|
|
14035
|
-
void Promise.all(shows).then(() => this.applyColumnLayout());
|
|
14036
|
-
}
|
|
14037
|
-
updated(changedProperties) {
|
|
14038
|
-
var _a2;
|
|
14039
|
-
super.updated(changedProperties);
|
|
14040
|
-
if (this.empty) {
|
|
14041
|
-
(_a2 = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _a2.disconnect();
|
|
14042
|
-
}
|
|
14043
|
-
if (__privateGet$1(this, _rowsNeedRebuild)) {
|
|
14044
|
-
__privateSet$1(this, _rowsNeedRebuild, false);
|
|
14045
|
-
void this.rebuildRows();
|
|
14046
|
-
}
|
|
14047
|
-
}
|
|
14048
|
-
/** Once `cx-table` has taken the new column definitions. */
|
|
14049
|
-
rebuildRows() {
|
|
14050
|
-
return __async(this, null, function* () {
|
|
14051
|
-
var _a2;
|
|
14052
|
-
yield (_a2 = this.tableEl) == null ? void 0 : _a2.updateComplete;
|
|
14053
|
-
yield this.syncRows(true);
|
|
14054
|
-
});
|
|
14055
|
-
}
|
|
14056
|
-
handleAssetsChange(previous) {
|
|
14057
|
-
const previousAssets = previous != null ? previous : [];
|
|
14058
|
-
if (this.assets.length === previousAssets.length && this.assets.every((asset, index) => asset === previousAssets[index])) {
|
|
14059
|
-
return;
|
|
14060
|
-
}
|
|
14061
|
-
this.assetMap.clear();
|
|
14062
|
-
this.assets.forEach((item) => this.assetMap.set(item.id, item));
|
|
14063
|
-
if (!isAppendOf(previousAssets, this.assets)) {
|
|
14064
|
-
__privateSet$1(this, _lastRowCount, void 0);
|
|
14065
|
-
}
|
|
14066
|
-
void this.syncRows();
|
|
14067
|
-
}
|
|
14068
|
-
handleLoadingChange() {
|
|
14069
|
-
return __async(this, null, function* () {
|
|
14070
|
-
if (this.loading) {
|
|
14071
|
-
return;
|
|
14072
|
-
}
|
|
14073
|
-
yield this.updateComplete;
|
|
14074
|
-
if (__privateGet$1(this, _pendingReplaces) === 0) {
|
|
14075
|
-
this.reportHeldRowCount();
|
|
14076
|
-
}
|
|
14077
|
-
});
|
|
14078
|
-
}
|
|
14079
|
-
handleSelectedAssetIdChange(previous) {
|
|
14080
|
-
this.markCurrentRow(previous, false);
|
|
14081
|
-
this.markCurrentRow(this.selectedAssetId, true);
|
|
14082
|
-
this.paintAssetCta(previous);
|
|
14083
|
-
this.paintAssetCta(this.selectedAssetId);
|
|
14084
|
-
}
|
|
14085
|
-
handleBusyAssetIdChange(previous) {
|
|
14086
|
-
this.paintAssetCta(previous);
|
|
14087
|
-
this.paintAssetCta(this.busyAssetId);
|
|
14088
|
-
}
|
|
14089
|
-
handleCtaTextChange() {
|
|
14090
|
-
var _a2, _b2;
|
|
14091
|
-
(_b2 = ((_a2 = this.tabulator) == null ? void 0 : _a2.getColumn(FILLER_FIELD)) || void 0) == null ? void 0 : _b2.getElement().setAttribute("aria-label", this.ctaLabel);
|
|
14092
|
-
__privateGet$1(this, _renderedCtas).forEach((cta) => this.paintCta(cta));
|
|
14093
|
-
}
|
|
14094
|
-
/** In place, as a relabel is: a CTA built again would drop the keyboard focus the old one held. */
|
|
14095
|
-
setNoHover(noHover) {
|
|
14096
|
-
if (noHover === __privateGet$1(this, _hasNoHover)) {
|
|
14097
|
-
return;
|
|
14098
|
-
}
|
|
14099
|
-
__privateSet$1(this, _hasNoHover, noHover);
|
|
14100
|
-
__privateGet$1(this, _renderedCtas).forEach((cta) => this.paintCta(cta));
|
|
14101
|
-
}
|
|
14102
|
-
connectedCallback() {
|
|
14103
|
-
super.connectedCallback();
|
|
14104
|
-
__privateSet$1(this, _noHoverQueries, NO_HOVER_QUERIES.map((media) => window.matchMedia(media)));
|
|
14105
|
-
__privateGet$1(this, _noHoverQueries).forEach((list) => list.addEventListener("change", this.handleNoHoverChange));
|
|
14106
|
-
this.handleNoHoverChange();
|
|
14107
|
-
if (this.hasUpdated) {
|
|
14108
|
-
__privateSet$1(this, _columnDefinitions, this.buildColumnDefinitions());
|
|
14109
|
-
this.requestUpdate();
|
|
14110
|
-
}
|
|
14111
|
-
}
|
|
14112
|
-
disconnectedCallback() {
|
|
14113
|
-
var _a2, _b2;
|
|
14114
|
-
super.disconnectedCallback();
|
|
14115
|
-
__privateGet$1(this, _noHoverQueries).forEach((list) => list.removeEventListener("change", this.handleNoHoverChange));
|
|
14116
|
-
__privateSet$1(this, _noHoverQueries, []);
|
|
14117
|
-
(_a2 = __privateGet$1(this, _lastRowObserver)) == null ? void 0 : _a2.disconnect();
|
|
14118
|
-
(_b2 = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _b2.disconnect();
|
|
14119
|
-
this.debouncedCalculatePageSize.cancel();
|
|
14120
|
-
this.debouncedHandleScrollEnd.cancel();
|
|
14121
|
-
this.debouncedHandleLastRowVisible.cancel();
|
|
14122
|
-
this.debouncedRedrawTable.cancel();
|
|
14123
|
-
this.debouncedApplyColumnLayout.cancel();
|
|
14124
|
-
}
|
|
14125
|
-
handleResize(event) {
|
|
14126
|
-
event.stopPropagation();
|
|
14127
|
-
const entries = event.detail.entries;
|
|
14128
|
-
if (entries[0].target !== this.containerEl) {
|
|
14129
|
-
return;
|
|
14130
|
-
}
|
|
14131
|
-
const { height, width } = entries[0].contentRect;
|
|
14132
|
-
this.debouncedCalculatePageSize(height);
|
|
14133
|
-
this.refitToContainer(width, height);
|
|
14134
|
-
if (__privateGet$1(this, _layoutPending)) {
|
|
14135
|
-
this.applyColumnLayout();
|
|
14136
|
-
}
|
|
14137
|
-
}
|
|
14138
|
-
/**
|
|
14139
|
-
* A new container width changes the space that the auto-fit shares out, so the columns are laid
|
|
14140
|
-
* out again. `cx-table` renders its rows again for a new container height only until the first drag
|
|
14141
|
-
* of a column divider, so a new height redraws the rows, which leaves no blank area under them.
|
|
14142
|
-
*/
|
|
14143
|
-
refitToContainer(width, height) {
|
|
14144
|
-
const size = { height: Math.round(height), width: Math.round(width) };
|
|
14145
|
-
const previous = __privateGet$1(this, _containerSize);
|
|
14146
|
-
__privateSet$1(this, _containerSize, size);
|
|
14147
|
-
if (previous === void 0) {
|
|
14148
|
-
return;
|
|
14149
|
-
}
|
|
14150
|
-
if (previous.width !== size.width) {
|
|
14151
|
-
this.debouncedApplyColumnLayout();
|
|
14152
|
-
}
|
|
14153
|
-
if (previous.height !== size.height) {
|
|
14154
|
-
this.debouncedRedrawTable();
|
|
14155
|
-
}
|
|
14156
|
-
}
|
|
14157
|
-
calculatePageSize(height) {
|
|
14158
|
-
if (Math.abs(__privateGet$1(this, _lastHeight) - height) < 10) {
|
|
14159
|
-
return;
|
|
14160
|
-
}
|
|
14161
|
-
__privateSet$1(this, _lastHeight, height);
|
|
14162
|
-
this.reportRowCount();
|
|
14163
|
-
}
|
|
14164
|
-
/** Counts the rows the last measured height shows, and tells the host when the count changes. */
|
|
14165
|
-
reportRowCount() {
|
|
14166
|
-
const rowCount = Math.ceil(this.resolveVisibleHeight(__privateGet$1(this, _lastHeight)) / ROW_HEIGHT);
|
|
14167
|
-
__privateSet$1(this, _rowCountHeld, this.loading && this.assets.length > 0);
|
|
14168
|
-
if (rowCount === __privateGet$1(this, _lastRowCount) || __privateGet$1(this, _rowCountHeld)) {
|
|
14169
|
-
return;
|
|
14170
|
-
}
|
|
14171
|
-
__privateSet$1(this, _lastRowCount, rowCount);
|
|
14172
|
-
this.emit("cx-content-browser-grid-resize", {
|
|
14173
|
-
detail: {
|
|
14174
|
-
columnCount: 1,
|
|
14175
|
-
rowCount
|
|
14176
|
-
}
|
|
14177
|
-
});
|
|
14178
|
-
}
|
|
14179
|
-
/**
|
|
14180
|
-
* Only once the restarted rows are in: the host asks for the next page at once, and a page that
|
|
14181
|
-
* lands while `setData` waits replaces the rows again and holds them back for another half second.
|
|
14182
|
-
* A measurement still in its debounce reports in the same count, because a second count inside the
|
|
14183
|
-
* host's 200 ms fetch debounce cancels the page the first count asked for.
|
|
14184
|
-
*/
|
|
14185
|
-
reportRestartedRowCount() {
|
|
14186
|
-
if (!this.isConnected || __privateGet$1(this, _lastRowCount) !== void 0 || __privateGet$1(this, _lastHeight) === 0) {
|
|
14187
|
-
return;
|
|
14188
|
-
}
|
|
14189
|
-
this.debouncedCalculatePageSize.flush();
|
|
14190
|
-
this.reportRowCount();
|
|
14191
|
-
}
|
|
14192
|
-
/**
|
|
14193
|
-
* Once the load ends and any rows it brings are in, the count measured meanwhile can ask for the
|
|
14194
|
-
* page after it. A table that is not built yet reports it at once.
|
|
14195
|
-
*/
|
|
14196
|
-
reportHeldRowCount() {
|
|
14197
|
-
if (!__privateGet$1(this, _rowCountHeld) || !this.isConnected) {
|
|
14198
|
-
return;
|
|
14199
|
-
}
|
|
14200
|
-
this.debouncedCalculatePageSize.flush();
|
|
14201
|
-
this.reportRowCount();
|
|
14202
|
-
}
|
|
14203
|
-
/**
|
|
14204
|
-
* The rows never size the container (see the styles), so this is the height the host gives the
|
|
14205
|
-
* picker, and it can run past the viewport. No scrollport shows more rows than the viewport, so
|
|
14206
|
-
* while the rows do not overflow the scrollport the count stops there, and the page scrolls to the
|
|
14207
|
-
* rest, where the last row coming into view asks for more (`observeLastRow`). One that overflows,
|
|
14208
|
-
* or holds no rows yet, measures the space its container gives it and is used as is.
|
|
14209
|
-
*/
|
|
14210
|
-
resolveVisibleHeight(height) {
|
|
14211
|
-
return this.isSizedByRows() ? Math.min(height, window.innerHeight) : height;
|
|
14212
|
-
}
|
|
14213
|
-
isSizedByRows() {
|
|
14214
|
-
var _a2, _b2;
|
|
14215
|
-
const scrollport = this.scrollport;
|
|
14216
|
-
return ((_b2 = (_a2 = this.tabulator) == null ? void 0 : _a2.getDataCount()) != null ? _b2 : 0) > 0 && scrollport !== void 0 && scrollport.scrollHeight <= scrollport.clientHeight + 1;
|
|
14217
|
-
}
|
|
14218
|
-
/**
|
|
14219
|
-
* A scrollport that holds its rows without overflowing never scrolls, so its own scroll never
|
|
14220
|
-
* reaches the end: the page scrolls instead. Once the table is taller than the viewport its count
|
|
14221
|
-
* is capped and stops fetching, which leaves the last row coming into view as the only sign the
|
|
14222
|
-
* user wants more.
|
|
14223
|
-
*/
|
|
14224
|
-
observeLastRow() {
|
|
14225
|
-
var _a2, _b2, _c2, _d2;
|
|
14226
|
-
(_a2 = __privateGet$1(this, _lastRowObserver)) == null ? void 0 : _a2.disconnect();
|
|
14227
|
-
const rows = (_c2 = (_b2 = this.tabulator) == null ? void 0 : _b2.getRows()) != null ? _c2 : [];
|
|
14228
|
-
const lastRow = rows[rows.length - 1];
|
|
14229
|
-
if (!lastRow) {
|
|
14230
|
-
return;
|
|
14231
|
-
}
|
|
14232
|
-
(_d2 = __privateGet$1(this, _lastRowObserver)) != null ? _d2 : __privateSet$1(this, _lastRowObserver, new IntersectionObserver((entries) => {
|
|
14233
|
-
if (entries.some((entry) => entry.isIntersecting)) {
|
|
14234
|
-
this.debouncedHandleLastRowVisible();
|
|
14235
|
-
}
|
|
14236
|
-
}));
|
|
14237
|
-
__privateGet$1(this, _lastRowObserver).observe(lastRow.getElement());
|
|
14238
|
-
}
|
|
14239
|
-
handleLastRowVisible() {
|
|
14240
|
-
if (this.isSizedByRows() && this.containerEl.clientHeight > window.innerHeight) {
|
|
14241
|
-
this.handleScrollEnd();
|
|
14242
|
-
}
|
|
14243
|
-
}
|
|
14244
|
-
insertAsset(assetId) {
|
|
14245
|
-
var _a2;
|
|
14246
|
-
if (!assetId || ((_a2 = this.assetMap.get(assetId)) == null ? void 0 : _a2.inColdStorage)) {
|
|
14649
|
+
}
|
|
14650
|
+
const hidden = new Set(this.hiddenFields);
|
|
14651
|
+
const keys2 = this.resolveColumnKeys();
|
|
14652
|
+
const shown = this.columns.flatMap((column2, index) => {
|
|
14653
|
+
const tabulatorColumn = hidden.has(column2.field) ? false : tabulator.getColumn(keys2[index]);
|
|
14654
|
+
return tabulatorColumn ? [{ column: column2, key: keys2[index], tabulatorColumn }] : [];
|
|
14655
|
+
});
|
|
14656
|
+
const metrics = this.readColumnMetrics(shown.map(({ tabulatorColumn }) => tabulatorColumn));
|
|
14657
|
+
if (!metrics) {
|
|
14247
14658
|
return;
|
|
14248
14659
|
}
|
|
14249
|
-
this.
|
|
14250
|
-
|
|
14251
|
-
|
|
14660
|
+
const scrollbar = this.getScrollbarWidth();
|
|
14661
|
+
__privateSet$1(this, _layoutScrollbarWidth, scrollbar);
|
|
14662
|
+
const widths = layoutColumnWidths(shown.map(({ column: column2, key }) => {
|
|
14663
|
+
var _a3;
|
|
14664
|
+
let natural = measure ? void 0 : __privateGet$1(this, _naturalWidths).get(key);
|
|
14665
|
+
if (natural === void 0) {
|
|
14666
|
+
natural = this.measureNaturalWidth(column2, metrics);
|
|
14667
|
+
__privateGet$1(this, _naturalWidths).set(key, natural);
|
|
14668
|
+
}
|
|
14669
|
+
return { natural, saved: (_a3 = __privateGet$1(this, _resizedWidths).get(column2.field.trim())) != null ? _a3 : __privateGet$1(this, _sessionWidths).get(column2.field.trim()) };
|
|
14670
|
+
}), Math.floor(unroundedClientWidth(element) - scrollbar) - RESIZE_BUFFER_WIDTH);
|
|
14671
|
+
shown.forEach(({ key, tabulatorColumn }, index) => {
|
|
14672
|
+
const width = widths[index];
|
|
14673
|
+
void tabulatorColumn.setWidth(width);
|
|
14674
|
+
tabulatorColumn.getDefinition().width = width;
|
|
14675
|
+
const definition = __privateGet$1(this, _columnDefinitions).find(({ field }) => field === key);
|
|
14676
|
+
if (definition) {
|
|
14677
|
+
definition.width = width;
|
|
14252
14678
|
}
|
|
14253
14679
|
});
|
|
14680
|
+
this.syncTableFrame();
|
|
14254
14681
|
}
|
|
14255
|
-
/**
|
|
14256
|
-
|
|
14682
|
+
/**
|
|
14683
|
+
* The canvas measures with a fallback font while a web font loads, so measure again once the fonts
|
|
14684
|
+
* are ready. Guarded by one pending wait, and by the connection of the element.
|
|
14685
|
+
*/
|
|
14686
|
+
layoutAgainWhenFontsLoad() {
|
|
14257
14687
|
var _a2;
|
|
14258
|
-
|
|
14259
|
-
}
|
|
14260
|
-
handleColumnResized(event) {
|
|
14261
|
-
event.stopPropagation();
|
|
14262
|
-
const [column2] = event.detail.args;
|
|
14263
|
-
const field = this.fieldOfKey(column2.getField());
|
|
14264
|
-
if (field === void 0) {
|
|
14688
|
+
if (__privateGet$1(this, _fontsPending) || ((_a2 = document.fonts) == null ? void 0 : _a2.status) !== "loading") {
|
|
14265
14689
|
return;
|
|
14266
14690
|
}
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
detail: {
|
|
14273
|
-
field,
|
|
14274
|
-
reset: false,
|
|
14275
|
-
width
|
|
14691
|
+
__privateSet$1(this, _fontsPending, true);
|
|
14692
|
+
void document.fonts.ready.then(() => {
|
|
14693
|
+
__privateSet$1(this, _fontsPending, false);
|
|
14694
|
+
if (this.isConnected) {
|
|
14695
|
+
this.applyColumnLayout();
|
|
14276
14696
|
}
|
|
14277
14697
|
});
|
|
14278
|
-
this.applyColumnLayout();
|
|
14279
14698
|
}
|
|
14280
14699
|
/**
|
|
14281
|
-
*
|
|
14282
|
-
*
|
|
14700
|
+
* `content-browser` hands over the whole list on every page, so a list that only grows by a page
|
|
14701
|
+
* is appended: reassigning it would call `setData`, which scrolls the table back to the top. Any
|
|
14702
|
+
* other list -- a new search, sort, filter or folder, or a refetch that brings the assets the rows
|
|
14703
|
+
* show as new objects -- replaces the rows.
|
|
14283
14704
|
*/
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
var _a2;
|
|
14289
|
-
const field = column2.field.trim();
|
|
14290
|
-
if (field === dragged.trim() || hidden.has(column2.field) || __privateGet$1(this, _resizedWidths).has(field)) {
|
|
14705
|
+
syncRows(replace2 = false) {
|
|
14706
|
+
return __async(this, null, function* () {
|
|
14707
|
+
const tabulator = this.tabulator;
|
|
14708
|
+
if (!tabulator) {
|
|
14291
14709
|
return;
|
|
14292
14710
|
}
|
|
14293
|
-
const
|
|
14294
|
-
const
|
|
14295
|
-
|
|
14296
|
-
|
|
14711
|
+
const columnKeys = this.resolveColumnKeys();
|
|
14712
|
+
const synced = __privateGet$1(this, _syncedAssets);
|
|
14713
|
+
const isNextPage = !replace2 && __privateGet$1(this, _pendingReplaces) === 0 && isAppendOf(synced, this.assets);
|
|
14714
|
+
__privateSet$1(this, _syncedAssets, [...this.assets]);
|
|
14715
|
+
if (isNextPage) {
|
|
14716
|
+
__privateSet$1(this, _heldRowKeys, new Set(columnKeys.filter((key) => __privateGet$1(this, _heldRowKeys).has(key))));
|
|
14717
|
+
yield tabulator.addData(this.assets.slice(synced.length).map((asset) => this.toRow(asset, columnKeys)));
|
|
14718
|
+
} else {
|
|
14719
|
+
__privateSet$1(this, _heldRowKeys, new Set(columnKeys));
|
|
14720
|
+
__privateSet$1(this, _pendingReplaces, __privateGet$1(this, _pendingReplaces) + 1);
|
|
14721
|
+
try {
|
|
14722
|
+
yield tabulator.setData(this.assets.map((asset) => this.toRow(asset, columnKeys)));
|
|
14723
|
+
} finally {
|
|
14724
|
+
__privateSet$1(this, _pendingReplaces, __privateGet$1(this, _pendingReplaces) - 1);
|
|
14725
|
+
}
|
|
14726
|
+
this.applyColumnLayout();
|
|
14297
14727
|
}
|
|
14728
|
+
this.markCurrentRow(this.selectedAssetId, true);
|
|
14729
|
+
this.observeLastRow();
|
|
14730
|
+
this.reportRestartedRowCount();
|
|
14731
|
+
this.reportHeldRowCount();
|
|
14298
14732
|
});
|
|
14299
14733
|
}
|
|
14300
|
-
|
|
14734
|
+
handleTableBuilt(event) {
|
|
14735
|
+
var _a2, _b2;
|
|
14301
14736
|
event.stopPropagation();
|
|
14302
|
-
this.
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
this.debouncedHandleScrollEnd();
|
|
14737
|
+
__privateSet$1(this, _builtTable, (_b2 = (_a2 = this.tableEl) == null ? void 0 : _a2.tabulatorInstance) != null ? _b2 : void 0);
|
|
14738
|
+
if (__privateGet$1(this, _builtTable)) {
|
|
14739
|
+
__privateGet$1(this, _builtTable).options.rowFormatter = (row) => this.renderRowAction(row);
|
|
14306
14740
|
}
|
|
14741
|
+
this.prepareFrame();
|
|
14742
|
+
__privateSet$1(this, _syncedAssets, []);
|
|
14743
|
+
void this.syncRows();
|
|
14307
14744
|
}
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14745
|
+
/**
|
|
14746
|
+
* Gives the frame, the scrollport and the header their styles. Runs as soon as Tabulator lays out its
|
|
14747
|
+
* columns: until then the frame takes the width of its content, which is not the width of the header.
|
|
14748
|
+
*/
|
|
14749
|
+
prepareFrame() {
|
|
14750
|
+
var _a2, _b2, _c2, _d2, _e3, _f2, _g;
|
|
14751
|
+
const scrollport = (_b2 = (_a2 = this.buildingTabulator) == null ? void 0 : _a2.rowManager) == null ? void 0 : _b2.element;
|
|
14752
|
+
const frame = scrollport == null ? void 0 : scrollport.parentElement;
|
|
14753
|
+
frame == null ? void 0 : frame.style.setProperty("width", "100%");
|
|
14754
|
+
frame == null ? void 0 : frame.part.add("content-browser-frame");
|
|
14755
|
+
scrollport == null ? void 0 : scrollport.part.add("content-browser-scrollport");
|
|
14756
|
+
const header = (_d2 = (_c2 = this.tableEl) == null ? void 0 : _c2.shadowRoot) == null ? void 0 : _d2.querySelector(".tabulator-header");
|
|
14757
|
+
const columns = header == null ? void 0 : header.querySelector(".tabulator-headers");
|
|
14758
|
+
header == null ? void 0 : header.part.add("content-browser-header");
|
|
14759
|
+
(_f2 = (_e3 = this.tableEl) == null ? void 0 : _e3.shadowRoot) == null ? void 0 : _f2.addEventListener("dblclick", this.handleResizeHandleDoubleClick, { capture: true });
|
|
14760
|
+
(_g = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _g.disconnect();
|
|
14761
|
+
if (columns) {
|
|
14762
|
+
__privateSet$1(this, _frameWidthObserver, new ResizeObserver(() => this.syncTableFrame()));
|
|
14763
|
+
__privateGet$1(this, _frameWidthObserver).observe(columns);
|
|
14311
14764
|
}
|
|
14765
|
+
this.syncTableFrame();
|
|
14312
14766
|
}
|
|
14313
|
-
|
|
14314
|
-
|
|
14767
|
+
/**
|
|
14768
|
+
* `setData` replaces the rows only once its debounce runs out, and Tabulator emits `dataLoaded` just
|
|
14769
|
+
* before it does. Until then, the old rows stay on the page with their hover and focus.
|
|
14770
|
+
*/
|
|
14771
|
+
handleDataLoaded(event) {
|
|
14772
|
+
event.stopPropagation();
|
|
14773
|
+
__privateSet$1(this, _hoveredRow, void 0);
|
|
14774
|
+
__privateSet$1(this, _focusedCta, void 0);
|
|
14775
|
+
__privateGet$1(this, _renderedCtas).clear();
|
|
14315
14776
|
}
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14777
|
+
/**
|
|
14778
|
+
* Every `setColumns` builds the columns again from the definitions: Tabulator calls it as it builds,
|
|
14779
|
+
* before `tableBuilt`. `cx-table` calls it again from its own `tableBuilt` handler, after this
|
|
14780
|
+
* component's has run, and for every new column set.
|
|
14781
|
+
*/
|
|
14782
|
+
handleColumnsLoaded(event) {
|
|
14783
|
+
event.stopPropagation();
|
|
14784
|
+
this.prepareFrame();
|
|
14785
|
+
this.applyColumnLayout();
|
|
14322
14786
|
}
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
>
|
|
14332
|
-
${this.renderRetry()}
|
|
14333
|
-
</cx-content-browser-no-result>
|
|
14334
|
-
`;
|
|
14787
|
+
willUpdate(changedProperties) {
|
|
14788
|
+
super.willUpdate(changedProperties);
|
|
14789
|
+
const signature = columnsSignature(this.columns);
|
|
14790
|
+
const columnsChanged = signature !== __privateGet$1(this, _columnsSignature);
|
|
14791
|
+
const tableRemounts = changedProperties.get("empty") === true && !this.empty;
|
|
14792
|
+
if (columnsChanged) {
|
|
14793
|
+
__privateSet$1(this, _columnsSignature, signature);
|
|
14794
|
+
__privateSet$1(this, _rowsNeedRebuild, this.hasUpdated && this.resolveColumnKeys().some((key) => !__privateGet$1(this, _heldRowKeys).has(key)));
|
|
14335
14795
|
}
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14796
|
+
const savedWidthsChanged = changedProperties.has("savedWidths");
|
|
14797
|
+
const widthScopeChanged = changedProperties.has("widthScope");
|
|
14798
|
+
if (widthScopeChanged) {
|
|
14799
|
+
__privateGet$1(this, _sessionWidths).clear();
|
|
14800
|
+
}
|
|
14801
|
+
if (savedWidthsChanged) {
|
|
14802
|
+
this.applySavedWidths();
|
|
14803
|
+
}
|
|
14804
|
+
if (columnsChanged || tableRemounts) {
|
|
14805
|
+
__privateSet$1(this, _columnDefinitions, this.buildColumnDefinitions());
|
|
14806
|
+
} else if (changedProperties.has("hiddenFields")) {
|
|
14807
|
+
this.applyHiddenFields();
|
|
14808
|
+
} else if (savedWidthsChanged || widthScopeChanged) {
|
|
14809
|
+
this.applyColumnLayout();
|
|
14344
14810
|
}
|
|
14345
|
-
return b`
|
|
14346
|
-
<cx-table
|
|
14347
|
-
class="content-browser-table__table"
|
|
14348
|
-
layout="fitData"
|
|
14349
|
-
placeholder=""
|
|
14350
|
-
no-selectable
|
|
14351
|
-
no-clipboard
|
|
14352
|
-
.columns=${__privateGet$1(this, _columnDefinitions)}
|
|
14353
|
-
.columnDefaults=${COLUMN_DEFAULTS}
|
|
14354
|
-
.rowHeight=${ROW_HEIGHT}
|
|
14355
|
-
@cx-table.tableBuilt=${this.handleTableBuilt}
|
|
14356
|
-
@cx-table.dataLoaded=${this.handleDataLoaded}
|
|
14357
|
-
@cx-table.columnsLoaded=${this.handleColumnsLoaded}
|
|
14358
|
-
@cx-table.columnResized=${this.handleColumnResized}
|
|
14359
|
-
@cx-table.scrollVertical=${this.handleScrollVertical}
|
|
14360
|
-
@cx-table.renderStarted=${this.handleRenderStarted}
|
|
14361
|
-
@cx-table.renderComplete=${this.handleRenderComplete}
|
|
14362
|
-
></cx-table>
|
|
14363
|
-
`;
|
|
14364
|
-
}
|
|
14365
|
-
render() {
|
|
14366
|
-
return b`
|
|
14367
|
-
<div
|
|
14368
|
-
class="content-browser-table-loading"
|
|
14369
|
-
style=${o$2({
|
|
14370
|
-
opacity: this.loading ? 1 : 0
|
|
14371
|
-
})}
|
|
14372
|
-
>
|
|
14373
|
-
<cx-progress-bar indeterminate></cx-progress-bar>
|
|
14374
|
-
</div>
|
|
14375
|
-
<cx-resize-observer @cx-resize=${this.handleResize}>
|
|
14376
|
-
<div class="content-browser-table">
|
|
14377
|
-
${this.renderContent()}
|
|
14378
|
-
</div>
|
|
14379
|
-
</cx-resize-observer>
|
|
14380
|
-
${n$5(this.error && this.assets.length > 0, () => b`
|
|
14381
|
-
<div class="content-browser-table__page-error" role="alert">
|
|
14382
|
-
<cx-icon name="error_outline"></cx-icon>
|
|
14383
|
-
${this.localize.term("oopsSomethingWentWrong")}
|
|
14384
|
-
${this.renderRetry()}
|
|
14385
|
-
</div>
|
|
14386
|
-
`)}
|
|
14387
|
-
`;
|
|
14388
14811
|
}
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
_resizedWidths =
|
|
14396
|
-
_sessionWidths = /* @__PURE__ */ new WeakMap();
|
|
14397
|
-
_ctas = /* @__PURE__ */ new WeakMap();
|
|
14398
|
-
_renderedCtas = /* @__PURE__ */ new WeakMap();
|
|
14399
|
-
_pointerTrackedRows = /* @__PURE__ */ new WeakMap();
|
|
14400
|
-
_hoveredRow = /* @__PURE__ */ new WeakMap();
|
|
14401
|
-
_focusedCta = /* @__PURE__ */ new WeakMap();
|
|
14402
|
-
_ctaFocusedAtRender = /* @__PURE__ */ new WeakMap();
|
|
14403
|
-
_noHoverQueries = /* @__PURE__ */ new WeakMap();
|
|
14404
|
-
_hasNoHover = /* @__PURE__ */ new WeakMap();
|
|
14405
|
-
_builtTable = /* @__PURE__ */ new WeakMap();
|
|
14406
|
-
_syncedAssets = /* @__PURE__ */ new WeakMap();
|
|
14407
|
-
_pendingReplaces = /* @__PURE__ */ new WeakMap();
|
|
14408
|
-
_lastHeight = /* @__PURE__ */ new WeakMap();
|
|
14409
|
-
_containerSize = /* @__PURE__ */ new WeakMap();
|
|
14410
|
-
_lastRowCount = /* @__PURE__ */ new WeakMap();
|
|
14411
|
-
_rowCountHeld = /* @__PURE__ */ new WeakMap();
|
|
14412
|
-
_lastRowObserver = /* @__PURE__ */ new WeakMap();
|
|
14413
|
-
_layoutScrollbarWidth = /* @__PURE__ */ new WeakMap();
|
|
14414
|
-
_naturalWidths = /* @__PURE__ */ new WeakMap();
|
|
14415
|
-
_layoutPending = /* @__PURE__ */ new WeakMap();
|
|
14416
|
-
_fontsPending = /* @__PURE__ */ new WeakMap();
|
|
14417
|
-
_frameWidthObserver = /* @__PURE__ */ new WeakMap();
|
|
14418
|
-
CxContentBrowserTable.styles = [componentStyles, styles$1];
|
|
14419
|
-
CxContentBrowserTable.dependencies = {
|
|
14420
|
-
"cx-button": CxButton,
|
|
14421
|
-
"cx-content-browser-no-result": CxContentBrowserNoResult,
|
|
14422
|
-
"cx-icon": CxIcon,
|
|
14423
|
-
"cx-line-clamp": CxLineClamp,
|
|
14424
|
-
"cx-progress-bar": CxProgressBar,
|
|
14425
|
-
"cx-resize-observer": CxResizeObserver,
|
|
14426
|
-
"cx-table": CxTable
|
|
14427
|
-
};
|
|
14428
|
-
__decorateClass$1([
|
|
14429
|
-
e$7(".content-browser-table")
|
|
14430
|
-
], CxContentBrowserTable.prototype, "containerEl", 2);
|
|
14431
|
-
__decorateClass$1([
|
|
14432
|
-
e$7("cx-table")
|
|
14433
|
-
], CxContentBrowserTable.prototype, "tableEl", 2);
|
|
14434
|
-
__decorateClass$1([
|
|
14435
|
-
n$6({ attribute: "assets", reflect: false, type: Array })
|
|
14436
|
-
], CxContentBrowserTable.prototype, "assets", 2);
|
|
14437
|
-
__decorateClass$1([
|
|
14438
|
-
n$6({ attribute: "columns", reflect: false, type: Array })
|
|
14439
|
-
], CxContentBrowserTable.prototype, "columns", 2);
|
|
14440
|
-
__decorateClass$1([
|
|
14441
|
-
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
14442
|
-
], CxContentBrowserTable.prototype, "ctaText", 2);
|
|
14443
|
-
__decorateClass$1([
|
|
14444
|
-
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
14445
|
-
], CxContentBrowserTable.prototype, "ctaTextTransform", 2);
|
|
14446
|
-
__decorateClass$1([
|
|
14447
|
-
n$6({ attribute: "empty", reflect: true, type: Boolean })
|
|
14448
|
-
], CxContentBrowserTable.prototype, "empty", 2);
|
|
14449
|
-
__decorateClass$1([
|
|
14450
|
-
n$6({ attribute: "error", reflect: true, type: Boolean })
|
|
14451
|
-
], CxContentBrowserTable.prototype, "error", 2);
|
|
14452
|
-
__decorateClass$1([
|
|
14453
|
-
n$6({ attribute: "has-more", reflect: true, type: Boolean })
|
|
14454
|
-
], CxContentBrowserTable.prototype, "hasMore", 2);
|
|
14455
|
-
__decorateClass$1([
|
|
14456
|
-
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
14457
|
-
], CxContentBrowserTable.prototype, "loading", 2);
|
|
14458
|
-
__decorateClass$1([
|
|
14459
|
-
n$6({ attribute: "selected-asset-id", reflect: true, type: String })
|
|
14460
|
-
], CxContentBrowserTable.prototype, "selectedAssetId", 2);
|
|
14461
|
-
__decorateClass$1([
|
|
14462
|
-
n$6({ attribute: false })
|
|
14463
|
-
], CxContentBrowserTable.prototype, "busyAssetId", 2);
|
|
14464
|
-
__decorateClass$1([
|
|
14465
|
-
n$6({ attribute: false })
|
|
14466
|
-
], CxContentBrowserTable.prototype, "hiddenFields", 2);
|
|
14467
|
-
__decorateClass$1([
|
|
14468
|
-
n$6({ attribute: false })
|
|
14469
|
-
], CxContentBrowserTable.prototype, "savedWidths", 2);
|
|
14470
|
-
__decorateClass$1([
|
|
14471
|
-
n$6({ attribute: false })
|
|
14472
|
-
], CxContentBrowserTable.prototype, "widthScope", 2);
|
|
14473
|
-
__decorateClass$1([
|
|
14474
|
-
n$6({ attribute: "row-action-position", reflect: true })
|
|
14475
|
-
], CxContentBrowserTable.prototype, "rowActionPosition", 2);
|
|
14476
|
-
__decorateClass$1([
|
|
14477
|
-
watch("assets")
|
|
14478
|
-
], CxContentBrowserTable.prototype, "handleAssetsChange", 1);
|
|
14479
|
-
__decorateClass$1([
|
|
14480
|
-
watch("loading", { waitUntilFirstUpdate: true })
|
|
14481
|
-
], CxContentBrowserTable.prototype, "handleLoadingChange", 1);
|
|
14482
|
-
__decorateClass$1([
|
|
14483
|
-
watch("selectedAssetId", { waitUntilFirstUpdate: true })
|
|
14484
|
-
], CxContentBrowserTable.prototype, "handleSelectedAssetIdChange", 1);
|
|
14485
|
-
__decorateClass$1([
|
|
14486
|
-
watch("busyAssetId", { waitUntilFirstUpdate: true })
|
|
14487
|
-
], CxContentBrowserTable.prototype, "handleBusyAssetIdChange", 1);
|
|
14488
|
-
__decorateClass$1([
|
|
14489
|
-
watch(["ctaText", "ctaTextTransform"], { waitUntilFirstUpdate: true })
|
|
14490
|
-
], CxContentBrowserTable.prototype, "handleCtaTextChange", 1);
|
|
14491
|
-
CxContentBrowserTable = __decorateClass$1([
|
|
14492
|
-
customElement("cx-content-browser-table")
|
|
14493
|
-
], CxContentBrowserTable);
|
|
14494
|
-
const appendPathAndQuery = (baseUrl, pathSuffix, extraQueryParams = []) => {
|
|
14495
|
-
const questionMarkIndex = baseUrl.indexOf("?");
|
|
14496
|
-
const hashIndex = baseUrl.indexOf("#");
|
|
14497
|
-
const separatorIndex = [questionMarkIndex, hashIndex].filter((index) => index !== -1).reduce((lowest, index) => lowest === -1 ? index : Math.min(lowest, index), -1);
|
|
14498
|
-
const path = separatorIndex === -1 ? baseUrl : baseUrl.slice(0, separatorIndex);
|
|
14499
|
-
const tail = separatorIndex === -1 ? "" : baseUrl.slice(separatorIndex);
|
|
14500
|
-
const tailHashIndex = tail.indexOf("#");
|
|
14501
|
-
const fragment = tailHashIndex === -1 ? "" : tail.slice(tailHashIndex);
|
|
14502
|
-
const existingQuery = (tailHashIndex === -1 ? tail : tail.slice(0, tailHashIndex)).replace(/^\?/, "");
|
|
14503
|
-
const parameterName = (parameter) => parameter.split("=")[0].toLowerCase();
|
|
14504
|
-
const overriddenNames = new Set(extraQueryParams.map(parameterName));
|
|
14505
|
-
const mergedParams = [
|
|
14506
|
-
...existingQuery.split("&").filter((parameter) => parameter && !overriddenNames.has(parameterName(parameter))),
|
|
14507
|
-
...extraQueryParams
|
|
14508
|
-
];
|
|
14509
|
-
const query = mergedParams.length > 0 ? `?${mergedParams.join("&")}` : "";
|
|
14510
|
-
return `${path}${pathSuffix}${query}${fragment}`;
|
|
14511
|
-
};
|
|
14512
|
-
const DEFAULT_VIEW_SIZE = "CoreField.LargeSizePreview";
|
|
14513
|
-
const FIELD_ALLOW_ATS_LINK = "AllowATSLink";
|
|
14514
|
-
const FIELD_DOC_CAPTION_LONG = "Document.CaptionLong";
|
|
14515
|
-
const FIELD_DOC_TITLE = "Document.Title";
|
|
14516
|
-
const FIELD_DOC_TYPE = "CoreField.DocType";
|
|
14517
|
-
const FIELD_EXTENSION = "Document.FileExtension";
|
|
14518
|
-
const FIELD_FILE_SIZE = "CoreField.FileSize";
|
|
14519
|
-
const FIELD_IDENTIFIER = "CoreField.Identifier";
|
|
14520
|
-
const FIELD_KEYWORDS = "CoreField.Keywords";
|
|
14521
|
-
const FIELD_MAX_HEIGHT = "CoreField.MaxHeight";
|
|
14522
|
-
const FIELD_MAX_WIDTH = "CoreField.MaxWidth";
|
|
14523
|
-
const FIELD_ORIGINAL_FILE_NAME = "CoreField.OriginalFileName";
|
|
14524
|
-
const FIELD_RECORD_ID = "Document.RecordID";
|
|
14525
|
-
const FIELD_SCRUB_URL = "ScrubURL";
|
|
14526
|
-
const FIELD_STORAGE_GROUP = "CoreField.S6_StorageGroup";
|
|
14527
|
-
const FIELD_SUBTYPE = "CoreField.DocSubType";
|
|
14528
|
-
const FIELD_TITLE_WITH_FALLBACK = "CoreField.TitleWithFallback";
|
|
14529
|
-
const FIELD_UPDATED_FILE_NAME = "CoreField.UpdatedFileName";
|
|
14530
|
-
const ORIGINAL_VIEW_SIZE = "CoreField.OriginalPreview";
|
|
14531
|
-
function resolveTitleFallbackField(titleFallback) {
|
|
14532
|
-
return titleFallback === "originalFileName" ? FIELD_ORIGINAL_FILE_NAME : FIELD_IDENTIFIER;
|
|
14533
|
-
}
|
|
14534
|
-
function resolveAssetCaption(fields, titleFallback) {
|
|
14535
|
-
return fields[FIELD_DOC_TITLE] || fields[resolveTitleFallbackField(titleFallback)] || fields[FIELD_IDENTIFIER] || "";
|
|
14536
|
-
}
|
|
14537
|
-
function resolveAssetExtraFilters(selectedFacets) {
|
|
14538
|
-
if (!selectedFacets || Object.keys(selectedFacets).length === 0) {
|
|
14539
|
-
return {};
|
|
14812
|
+
/**
|
|
14813
|
+
* The new saved widths replace all the widths in memory: a width that the new map does not hold,
|
|
14814
|
+
* for example one of another site, goes away. Only a positive width counts: a bad entry has no effect.
|
|
14815
|
+
*/
|
|
14816
|
+
applySavedWidths() {
|
|
14817
|
+
var _a2;
|
|
14818
|
+
__privateSet$1(this, _resizedWidths, new Map(Object.entries((_a2 = this.savedWidths) != null ? _a2 : {}).flatMap(([field, width]) => typeof width === "number" && Number.isFinite(width) && width > 0 ? [[field.trim(), Math.round(width)]] : [])));
|
|
14540
14819
|
}
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14820
|
+
/**
|
|
14821
|
+
* Through Tabulator's own column visibility: new definitions would reach it through `setColumns`,
|
|
14822
|
+
* and the rows would have to be rebuilt, which scrolls back to the top.
|
|
14823
|
+
*/
|
|
14824
|
+
applyHiddenFields() {
|
|
14825
|
+
const hidden = new Set(this.hiddenFields);
|
|
14826
|
+
const keys2 = this.resolveColumnKeys();
|
|
14827
|
+
const shows = [];
|
|
14828
|
+
__privateGet$1(this, _columnDefinitions).forEach((definition) => {
|
|
14829
|
+
var _a2;
|
|
14830
|
+
const field = String(definition.field);
|
|
14831
|
+
const hostColumn = this.columns[keys2.indexOf(field)];
|
|
14832
|
+
if (!hostColumn) {
|
|
14833
|
+
return;
|
|
14550
14834
|
}
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
}
|
|
14560
|
-
function isCortexErrorResponse(response) {
|
|
14561
|
-
return response && typeof response === "object" && "ErrorCode" in response;
|
|
14562
|
-
}
|
|
14563
|
-
function isSearchFacet(facet) {
|
|
14564
|
-
const details = facet == null ? void 0 : facet.facetDetails;
|
|
14565
|
-
return !!facet && !!details && typeof details === "object" && !Array.isArray(details) && typeof details.facetFieldName === "string" && typeof details.displayName === "string" && Array.isArray(facet.values) && facet.values.every((facetValue) => !!facetValue && typeof facetValue.value === "string");
|
|
14566
|
-
}
|
|
14567
|
-
function isSearchResponse(response) {
|
|
14568
|
-
if (!response || typeof response !== "object" || Array.isArray(response)) {
|
|
14569
|
-
return false;
|
|
14570
|
-
}
|
|
14571
|
-
const { contentItems, facets, totalCount } = response;
|
|
14572
|
-
return Array.isArray(facets) && facets.every(isSearchFacet) && Number.isFinite(totalCount) && (contentItems === void 0 || Array.isArray(contentItems));
|
|
14573
|
-
}
|
|
14574
|
-
const POST_UNSUPPORTED_STATUSES = /* @__PURE__ */ new Set([405, 501]);
|
|
14575
|
-
const postUnsupportedOrigins = /* @__PURE__ */ new Set();
|
|
14576
|
-
function createId() {
|
|
14577
|
-
const cryptoApi = globalThis.crypto;
|
|
14578
|
-
if (cryptoApi == null ? void 0 : cryptoApi.randomUUID) {
|
|
14579
|
-
return cryptoApi.randomUUID();
|
|
14580
|
-
}
|
|
14581
|
-
if (cryptoApi == null ? void 0 : cryptoApi.getRandomValues) {
|
|
14582
|
-
const bytes = cryptoApi.getRandomValues(new Uint8Array(16));
|
|
14583
|
-
bytes[6] = bytes[6] & 15 | 64;
|
|
14584
|
-
bytes[8] = bytes[8] & 63 | 128;
|
|
14585
|
-
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
|
14586
|
-
return [
|
|
14587
|
-
hex.slice(0, 4).join(""),
|
|
14588
|
-
hex.slice(4, 6).join(""),
|
|
14589
|
-
hex.slice(6, 8).join(""),
|
|
14590
|
-
hex.slice(8, 10).join(""),
|
|
14591
|
-
hex.slice(10).join("")
|
|
14592
|
-
].join("-");
|
|
14593
|
-
}
|
|
14594
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
14595
|
-
}
|
|
14596
|
-
function buildAssetLinkImageUrl({
|
|
14597
|
-
asset,
|
|
14598
|
-
extension,
|
|
14599
|
-
parameters,
|
|
14600
|
-
permanentLink,
|
|
14601
|
-
rawResponse,
|
|
14602
|
-
transformations,
|
|
14603
|
-
useSession
|
|
14604
|
-
}) {
|
|
14605
|
-
let baseImageUrl = permanentLink || rawResponse.imageUrl;
|
|
14606
|
-
let transformationPath = "";
|
|
14607
|
-
if (transformations && transformations.length > 0) {
|
|
14608
|
-
transformationPath += "/t/";
|
|
14609
|
-
}
|
|
14610
|
-
transformations == null ? void 0 : transformations.forEach(({ key, value }) => {
|
|
14611
|
-
if (key === TransformationAction.Resize) {
|
|
14612
|
-
const validTransformations = [
|
|
14613
|
-
...[
|
|
14614
|
-
{
|
|
14615
|
-
key: "re_w_",
|
|
14616
|
-
value: value.width
|
|
14617
|
-
},
|
|
14618
|
-
{
|
|
14619
|
-
key: "re_h_",
|
|
14620
|
-
value: value.height
|
|
14621
|
-
}
|
|
14622
|
-
].filter((item) => item.value !== void 0).map((item) => ({
|
|
14623
|
-
key: item.key,
|
|
14624
|
-
value: Math.round(Number(item.value))
|
|
14625
|
-
})),
|
|
14626
|
-
{
|
|
14627
|
-
key: "re_rm_",
|
|
14628
|
-
value: "stretch"
|
|
14835
|
+
const isHidden = hidden.has(hostColumn.field);
|
|
14836
|
+
const column2 = (_a2 = this.tabulator) == null ? void 0 : _a2.getColumn(field);
|
|
14837
|
+
definition.hidden = isHidden || void 0;
|
|
14838
|
+
if (column2 && column2.isVisible() === isHidden) {
|
|
14839
|
+
if (isHidden) {
|
|
14840
|
+
column2.hide();
|
|
14841
|
+
} else {
|
|
14842
|
+
shows.push(column2.show());
|
|
14629
14843
|
}
|
|
14630
|
-
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14844
|
+
}
|
|
14845
|
+
});
|
|
14846
|
+
void Promise.all(shows).then(() => this.applyColumnLayout());
|
|
14847
|
+
}
|
|
14848
|
+
updated(changedProperties) {
|
|
14849
|
+
var _a2;
|
|
14850
|
+
super.updated(changedProperties);
|
|
14851
|
+
if (this.empty) {
|
|
14852
|
+
(_a2 = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _a2.disconnect();
|
|
14635
14853
|
}
|
|
14636
|
-
if (
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
{
|
|
14640
|
-
key: "c_w_",
|
|
14641
|
-
value: value.width
|
|
14642
|
-
},
|
|
14643
|
-
{
|
|
14644
|
-
key: "c_h_",
|
|
14645
|
-
value: value.height
|
|
14646
|
-
},
|
|
14647
|
-
{
|
|
14648
|
-
key: "c_x_",
|
|
14649
|
-
value: value.x
|
|
14650
|
-
},
|
|
14651
|
-
{
|
|
14652
|
-
key: "c_y_",
|
|
14653
|
-
value: value.y
|
|
14654
|
-
}
|
|
14655
|
-
].filter((item) => item.value !== void 0).map((item) => ({
|
|
14656
|
-
key: item.key,
|
|
14657
|
-
value: Math.round(Number(item.value))
|
|
14658
|
-
})),
|
|
14659
|
-
{
|
|
14660
|
-
key: "c_whu_",
|
|
14661
|
-
value: "pixel"
|
|
14662
|
-
}
|
|
14663
|
-
];
|
|
14664
|
-
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
14665
|
-
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
14666
|
-
});
|
|
14667
|
-
transformationPath += "/";
|
|
14854
|
+
if (__privateGet$1(this, _rowsNeedRebuild)) {
|
|
14855
|
+
__privateSet$1(this, _rowsNeedRebuild, false);
|
|
14856
|
+
void this.rebuildRows();
|
|
14668
14857
|
}
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
|
|
14674
|
-
|
|
14675
|
-
|
|
14676
|
-
|
|
14677
|
-
|
|
14858
|
+
}
|
|
14859
|
+
/** Once `cx-table` has taken the new column definitions. */
|
|
14860
|
+
rebuildRows() {
|
|
14861
|
+
return __async(this, null, function* () {
|
|
14862
|
+
var _a2;
|
|
14863
|
+
yield (_a2 = this.tableEl) == null ? void 0 : _a2.updateComplete;
|
|
14864
|
+
yield this.syncRows(true);
|
|
14865
|
+
});
|
|
14866
|
+
}
|
|
14867
|
+
handleAssetsChange(previous) {
|
|
14868
|
+
const previousAssets = previous != null ? previous : [];
|
|
14869
|
+
if (this.assets.length === previousAssets.length && this.assets.every((asset, index) => asset === previousAssets[index])) {
|
|
14870
|
+
return;
|
|
14678
14871
|
}
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
}].filter((item) => item.value !== void 0).map((item) => ({ key: item.key, value: Math.round(Number(item.value)) }));
|
|
14684
|
-
validTransformations.forEach(({ key: vKey, value: vValue }, index) => {
|
|
14685
|
-
transformationPath += `${vKey}${vValue}${index < validTransformations.length - 1 ? "," : ""}`;
|
|
14686
|
-
});
|
|
14687
|
-
transformationPath += "/";
|
|
14872
|
+
this.assetMap.clear();
|
|
14873
|
+
this.assets.forEach((item) => this.assetMap.set(item.id, item));
|
|
14874
|
+
if (!isAppendOf(previousAssets, this.assets)) {
|
|
14875
|
+
__privateSet$1(this, _lastRowCount, void 0);
|
|
14688
14876
|
}
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14877
|
+
void this.syncRows();
|
|
14878
|
+
}
|
|
14879
|
+
handleLoadingChange() {
|
|
14880
|
+
return __async(this, null, function* () {
|
|
14881
|
+
if (this.loading) {
|
|
14882
|
+
return;
|
|
14692
14883
|
}
|
|
14884
|
+
yield this.updateComplete;
|
|
14885
|
+
if (__privateGet$1(this, _pendingReplaces) === 0) {
|
|
14886
|
+
this.reportHeldRowCount();
|
|
14887
|
+
}
|
|
14888
|
+
});
|
|
14889
|
+
}
|
|
14890
|
+
handleSelectedAssetIdChange(previous) {
|
|
14891
|
+
this.markCurrentRow(previous, false);
|
|
14892
|
+
this.markCurrentRow(this.selectedAssetId, true);
|
|
14893
|
+
this.paintAssetCta(previous);
|
|
14894
|
+
this.paintAssetCta(this.selectedAssetId);
|
|
14895
|
+
}
|
|
14896
|
+
handleBusyAssetIdChange(previous) {
|
|
14897
|
+
this.paintAssetCta(previous);
|
|
14898
|
+
this.paintAssetCta(this.busyAssetId);
|
|
14899
|
+
}
|
|
14900
|
+
handleCtaTextChange() {
|
|
14901
|
+
var _a2, _b2;
|
|
14902
|
+
(_b2 = ((_a2 = this.tabulator) == null ? void 0 : _a2.getColumn(FILLER_FIELD)) || void 0) == null ? void 0 : _b2.getElement().setAttribute("aria-label", this.ctaLabel);
|
|
14903
|
+
__privateGet$1(this, _renderedCtas).forEach((cta) => this.paintCta(cta));
|
|
14904
|
+
}
|
|
14905
|
+
/** In place, as a relabel is: a CTA built again would drop the keyboard focus the old one held. */
|
|
14906
|
+
setNoHover(noHover) {
|
|
14907
|
+
if (noHover === __privateGet$1(this, _hasNoHover)) {
|
|
14908
|
+
return;
|
|
14693
14909
|
}
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
if (hasTransformations) {
|
|
14697
|
-
transformationPath += `${asset.identifier}`;
|
|
14910
|
+
__privateSet$1(this, _hasNoHover, noHover);
|
|
14911
|
+
__privateGet$1(this, _renderedCtas).forEach((cta) => this.paintCta(cta));
|
|
14698
14912
|
}
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14913
|
+
connectedCallback() {
|
|
14914
|
+
super.connectedCallback();
|
|
14915
|
+
__privateSet$1(this, _noHoverQueries, NO_HOVER_QUERIES.map((media) => window.matchMedia(media)));
|
|
14916
|
+
__privateGet$1(this, _noHoverQueries).forEach((list) => list.addEventListener("change", this.handleNoHoverChange));
|
|
14917
|
+
this.handleNoHoverChange();
|
|
14918
|
+
if (this.hasUpdated) {
|
|
14919
|
+
__privateSet$1(this, _columnDefinitions, this.buildColumnDefinitions());
|
|
14920
|
+
this.requestUpdate();
|
|
14707
14921
|
}
|
|
14708
14922
|
}
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14923
|
+
disconnectedCallback() {
|
|
14924
|
+
var _a2, _b2;
|
|
14925
|
+
super.disconnectedCallback();
|
|
14926
|
+
__privateGet$1(this, _noHoverQueries).forEach((list) => list.removeEventListener("change", this.handleNoHoverChange));
|
|
14927
|
+
__privateSet$1(this, _noHoverQueries, []);
|
|
14928
|
+
(_a2 = __privateGet$1(this, _lastRowObserver)) == null ? void 0 : _a2.disconnect();
|
|
14929
|
+
(_b2 = __privateGet$1(this, _frameWidthObserver)) == null ? void 0 : _b2.disconnect();
|
|
14930
|
+
this.debouncedCalculatePageSize.cancel();
|
|
14931
|
+
this.debouncedHandleScrollEnd.cancel();
|
|
14932
|
+
this.debouncedHandleLastRowVisible.cancel();
|
|
14933
|
+
this.debouncedRedrawTable.cancel();
|
|
14934
|
+
this.debouncedApplyColumnLayout.cancel();
|
|
14715
14935
|
}
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
extension,
|
|
14722
|
-
extraFields,
|
|
14723
|
-
parameters,
|
|
14724
|
-
permanentLink,
|
|
14725
|
-
proxyPreference,
|
|
14726
|
-
skipLinkGeneration,
|
|
14727
|
-
transformations,
|
|
14728
|
-
useSession
|
|
14729
|
-
}) {
|
|
14730
|
-
var _a2;
|
|
14731
|
-
const getAssetLinkErrors = {};
|
|
14732
|
-
const isOnlyOneAssetSelected = assets.length === 1;
|
|
14733
|
-
let hasError = false;
|
|
14734
|
-
const origin2 = (_a2 = http.defaults.baseURL) != null ? _a2 : window.location.origin;
|
|
14735
|
-
try {
|
|
14736
|
-
const settled = yield Promise.allSettled(assets.map((asset) => __async(null, null, function* () {
|
|
14737
|
-
var _a3;
|
|
14738
|
-
const requestBody = {
|
|
14739
|
-
GenerateAssetUrl: !permanentLink && !skipLinkGeneration,
|
|
14740
|
-
Parameters: parameters,
|
|
14741
|
-
Proxy: proxyPreference,
|
|
14742
|
-
RecordId: asset.recordId
|
|
14743
|
-
};
|
|
14744
|
-
if (extraFields == null ? void 0 : extraFields.length) {
|
|
14745
|
-
requestBody.ExtraFields = extraFields;
|
|
14746
|
-
}
|
|
14747
|
-
const useSessionParams = useSession ? { UseSession: useSession } : void 0;
|
|
14748
|
-
const attemptPost = !postUnsupportedOrigins.has(origin2);
|
|
14749
|
-
let rawResponse;
|
|
14750
|
-
if (attemptPost) {
|
|
14751
|
-
try {
|
|
14752
|
-
const postResult = yield http.request({
|
|
14753
|
-
data: requestBody,
|
|
14754
|
-
method: "POST",
|
|
14755
|
-
params: useSessionParams,
|
|
14756
|
-
url: AssetApiEndpoint.GET_ASSET_LINK,
|
|
14757
|
-
validateStatus: () => true
|
|
14758
|
-
});
|
|
14759
|
-
if (POST_UNSUPPORTED_STATUSES.has(postResult.status)) {
|
|
14760
|
-
postUnsupportedOrigins.add(origin2);
|
|
14761
|
-
} else {
|
|
14762
|
-
rawResponse = postResult.data;
|
|
14763
|
-
}
|
|
14764
|
-
} catch (e2) {
|
|
14765
|
-
}
|
|
14766
|
-
}
|
|
14767
|
-
if (rawResponse === void 0) {
|
|
14768
|
-
const getResult = yield http.request({
|
|
14769
|
-
method: "GET",
|
|
14770
|
-
params: __spreadProps(__spreadValues({}, requestBody), {
|
|
14771
|
-
UseSession: useSession || void 0
|
|
14772
|
-
}),
|
|
14773
|
-
paramsSerializer: {
|
|
14774
|
-
indexes: null
|
|
14775
|
-
},
|
|
14776
|
-
url: AssetApiEndpoint.GET_ASSET_LINK
|
|
14777
|
-
});
|
|
14778
|
-
rawResponse = getResult.data;
|
|
14779
|
-
}
|
|
14780
|
-
if (isCortexErrorResponse(rawResponse)) {
|
|
14781
|
-
hasError = true;
|
|
14782
|
-
if (isOnlyOneAssetSelected) {
|
|
14783
|
-
if (getAssetLinkErrors[rawResponse.ErrorCode]) {
|
|
14784
|
-
getAssetLinkErrors[rawResponse.ErrorCode].push(asset);
|
|
14785
|
-
} else {
|
|
14786
|
-
getAssetLinkErrors[rawResponse.ErrorCode] = [asset];
|
|
14787
|
-
}
|
|
14788
|
-
}
|
|
14789
|
-
return {
|
|
14790
|
-
imageUrl: asset.imageUrl
|
|
14791
|
-
};
|
|
14792
|
-
}
|
|
14793
|
-
if (skipLinkGeneration) {
|
|
14794
|
-
return __spreadProps(__spreadValues({}, rawResponse), {
|
|
14795
|
-
imageUrl: (_a3 = asset.imageUrl) != null ? _a3 : ""
|
|
14796
|
-
});
|
|
14797
|
-
}
|
|
14798
|
-
const imageUrl = buildAssetLinkImageUrl({
|
|
14799
|
-
asset,
|
|
14800
|
-
extension,
|
|
14801
|
-
parameters,
|
|
14802
|
-
permanentLink,
|
|
14803
|
-
rawResponse,
|
|
14804
|
-
transformations,
|
|
14805
|
-
useSession
|
|
14806
|
-
});
|
|
14807
|
-
return __spreadProps(__spreadValues({}, rawResponse), {
|
|
14808
|
-
imageUrl
|
|
14809
|
-
});
|
|
14810
|
-
})));
|
|
14811
|
-
const data = settled.flatMap((result) => {
|
|
14812
|
-
if (result.status === "fulfilled") {
|
|
14813
|
-
return [result.value];
|
|
14814
|
-
}
|
|
14815
|
-
hasError = true;
|
|
14816
|
-
return [];
|
|
14817
|
-
});
|
|
14818
|
-
return {
|
|
14819
|
-
data,
|
|
14820
|
-
isError: hasError
|
|
14821
|
-
};
|
|
14822
|
-
} catch (e2) {
|
|
14823
|
-
return {
|
|
14824
|
-
data: [],
|
|
14825
|
-
isError: true
|
|
14826
|
-
};
|
|
14936
|
+
handleResize(event) {
|
|
14937
|
+
event.stopPropagation();
|
|
14938
|
+
const entries = event.detail.entries;
|
|
14939
|
+
if (entries[0].target !== this.containerEl) {
|
|
14940
|
+
return;
|
|
14827
14941
|
}
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
recordIds
|
|
14834
|
-
}) {
|
|
14835
|
-
var _a2;
|
|
14836
|
-
if (!Array.isArray(recordIds) || recordIds.length === 0) {
|
|
14837
|
-
return { facets: [], items: [], totalCount: 0 };
|
|
14942
|
+
const { height, width } = entries[0].contentRect;
|
|
14943
|
+
this.debouncedCalculatePageSize(height);
|
|
14944
|
+
this.refitToContainer(width, height);
|
|
14945
|
+
if (__privateGet$1(this, _layoutPending)) {
|
|
14946
|
+
this.applyColumnLayout();
|
|
14838
14947
|
}
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
FIELD_DOC_CAPTION_LONG
|
|
14852
|
-
],
|
|
14853
|
-
SeeThru: true
|
|
14854
|
-
},
|
|
14855
|
-
paramsSerializer: {
|
|
14856
|
-
indexes: null
|
|
14857
|
-
},
|
|
14858
|
-
responseType: "json",
|
|
14859
|
-
transformResponse: [
|
|
14860
|
-
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
14861
|
-
(rawResponse) => {
|
|
14862
|
-
var _a3, _b2;
|
|
14863
|
-
const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
|
|
14864
|
-
var _a4, _b3, _c2;
|
|
14865
|
-
let name = (_a4 = item.fields[FIELD_UPDATED_FILE_NAME]) != null ? _a4 : "";
|
|
14866
|
-
if (name === "") {
|
|
14867
|
-
name = (_b3 = item.fields[FIELD_ORIGINAL_FILE_NAME]) != null ? _b3 : "";
|
|
14868
|
-
}
|
|
14869
|
-
return __spreadValues({
|
|
14870
|
-
name,
|
|
14871
|
-
originalUrl: (_c2 = item.fields[ORIGINAL_VIEW_SIZE]) != null ? _c2 : "",
|
|
14872
|
-
recordId: item.recordID
|
|
14873
|
-
}, validatedExtraFields.reduce(
|
|
14874
|
-
(acc, field) => {
|
|
14875
|
-
var _a5;
|
|
14876
|
-
acc[field] = (_a5 = item.fields[field]) != null ? _a5 : "";
|
|
14877
|
-
return acc;
|
|
14878
|
-
},
|
|
14879
|
-
{}
|
|
14880
|
-
));
|
|
14881
|
-
})) != null ? _b2 : [];
|
|
14882
|
-
mappedItems.sort((a2, b2) => {
|
|
14883
|
-
const indexA = recordIds.indexOf(a2.recordId);
|
|
14884
|
-
const indexB = recordIds.indexOf(b2.recordId);
|
|
14885
|
-
return indexA - indexB;
|
|
14886
|
-
});
|
|
14887
|
-
return {
|
|
14888
|
-
facets: rawResponse.facets,
|
|
14889
|
-
items: mappedItems,
|
|
14890
|
-
totalCount: rawResponse.totalCount
|
|
14891
|
-
};
|
|
14892
|
-
}
|
|
14893
|
-
],
|
|
14894
|
-
url: AssetApiEndpoint.GET_CONTENT_V1
|
|
14895
|
-
});
|
|
14896
|
-
return response.data;
|
|
14897
|
-
} catch (error) {
|
|
14898
|
-
return {
|
|
14899
|
-
facets: [],
|
|
14900
|
-
items: [],
|
|
14901
|
-
totalCount: 0
|
|
14902
|
-
};
|
|
14948
|
+
}
|
|
14949
|
+
/**
|
|
14950
|
+
* A new container width changes the space that the auto-fit shares out, so the columns are laid
|
|
14951
|
+
* out again. `cx-table` renders its rows again for a new container height only until the first drag
|
|
14952
|
+
* of a column divider, so a new height redraws the rows, which leaves no blank area under them.
|
|
14953
|
+
*/
|
|
14954
|
+
refitToContainer(width, height) {
|
|
14955
|
+
const size = { height: Math.round(height), width: Math.round(width) };
|
|
14956
|
+
const previous = __privateGet$1(this, _containerSize);
|
|
14957
|
+
__privateSet$1(this, _containerSize, size);
|
|
14958
|
+
if (previous === void 0) {
|
|
14959
|
+
return;
|
|
14903
14960
|
}
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
|
|
14926
|
-
|
|
14927
|
-
|
|
14928
|
-
|
|
14929
|
-
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
...validatedFields
|
|
14943
|
-
].filter(
|
|
14944
|
-
(field, index, all3) => all3.findIndex((item) => item.toLowerCase() === field.toLowerCase()) === index
|
|
14945
|
-
);
|
|
14946
|
-
try {
|
|
14947
|
-
const response = yield http.request({
|
|
14948
|
-
data: __spreadValues({
|
|
14949
|
-
Fields: requestedFields,
|
|
14950
|
-
Limit: pageSize || void 0,
|
|
14951
|
-
LimitedToDocTypes: limitedToDocTypes,
|
|
14952
|
-
ObjectRecordID: folderId || void 0,
|
|
14953
|
-
OrderBy: sortOrder,
|
|
14954
|
-
SeeThru: isSeeThrough || void 0,
|
|
14955
|
-
SelectedFacets: selectedFacets,
|
|
14956
|
-
Start: start,
|
|
14957
|
-
Text: searchText || void 0,
|
|
14958
|
-
UseSession: useSession || void 0
|
|
14959
|
-
}, resolveAssetExtraFilters(selectedFacets)),
|
|
14960
|
-
method: "POST",
|
|
14961
|
-
transformResponse: [
|
|
14962
|
-
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
14963
|
-
(rawResponse) => {
|
|
14964
|
-
var _a3, _b2;
|
|
14965
|
-
if (!isSearchResponse(rawResponse)) {
|
|
14966
|
-
return {
|
|
14967
|
-
facets: [],
|
|
14968
|
-
isError: true,
|
|
14969
|
-
items: [],
|
|
14970
|
-
totalCount: 0,
|
|
14971
|
-
unreadableFields: []
|
|
14972
|
-
};
|
|
14973
|
-
}
|
|
14974
|
-
const mappedItems = (_b2 = (_a3 = rawResponse.contentItems) == null ? void 0 : _a3.map((item) => {
|
|
14975
|
-
var _a4, _b3, _c2, _d2, _e3, _f2, _g, _h, _i, _j, _k, _l;
|
|
14976
|
-
let extension = (_a4 = item.fields[FIELD_EXTENSION]) != null ? _a4 : "";
|
|
14977
|
-
const name = resolveAssetCaption(item.fields, titleFallback);
|
|
14978
|
-
if (extension && !extension.startsWith(".")) {
|
|
14979
|
-
extension = "." + extension;
|
|
14980
|
-
}
|
|
14981
|
-
return __spreadProps(__spreadValues({}, validatedFields.reduce((acc, field) => {
|
|
14982
|
-
var _a5, _b4;
|
|
14983
|
-
const sourceField = (_a5 = requestedFields.find(
|
|
14984
|
-
(requestedField) => requestedField.toLowerCase() === field.toLowerCase()
|
|
14985
|
-
)) != null ? _a5 : field;
|
|
14986
|
-
acc[field] = (_b4 = item.fields[sourceField]) != null ? _b4 : "";
|
|
14987
|
-
return acc;
|
|
14988
|
-
}, {})), {
|
|
14989
|
-
allowATSLink: item.fields[FIELD_ALLOW_ATS_LINK] === "True",
|
|
14990
|
-
docSubType: (_b3 = item.fields[FIELD_SUBTYPE]) != null ? _b3 : "",
|
|
14991
|
-
docType: (_c2 = item.fields[FIELD_DOC_TYPE]) != null ? _c2 : "",
|
|
14992
|
-
extension,
|
|
14993
|
-
height: (_d2 = item.fields[FIELD_MAX_HEIGHT]) != null ? _d2 : "0",
|
|
14994
|
-
id: item.recordID,
|
|
14995
|
-
identifier: (_e3 = item.fields[FIELD_IDENTIFIER]) != null ? _e3 : "",
|
|
14996
|
-
imageUrl: (_f2 = item.fields[DEFAULT_VIEW_SIZE]) != null ? _f2 : "",
|
|
14997
|
-
inColdStorage: item.fields[FIELD_STORAGE_GROUP] === "Cold Storage",
|
|
14998
|
-
name: name != null ? name : "",
|
|
14999
|
-
originalUrl: (_g = item.fields[ORIGINAL_VIEW_SIZE]) != null ? _g : "",
|
|
15000
|
-
recordId: (_h = item.fields[FIELD_RECORD_ID]) != null ? _h : "",
|
|
15001
|
-
scrubUrl: (_i = item.fields[FIELD_SCRUB_URL]) != null ? _i : "",
|
|
15002
|
-
size: (_j = item.fields[FIELD_FILE_SIZE]) != null ? _j : "0 MB",
|
|
15003
|
-
tags: (_k = item.fields[FIELD_KEYWORDS]) != null ? _k : "",
|
|
15004
|
-
width: (_l = item.fields[FIELD_MAX_WIDTH]) != null ? _l : "0"
|
|
15005
|
-
});
|
|
15006
|
-
})) != null ? _b2 : [];
|
|
15007
|
-
return {
|
|
15008
|
-
facets: rawResponse.facets,
|
|
15009
|
-
isError: false,
|
|
15010
|
-
items: mappedItems,
|
|
15011
|
-
totalCount: rawResponse.totalCount,
|
|
15012
|
-
unreadableFields: Array.isArray(rawResponse.unreadableFields) ? rawResponse.unreadableFields.filter((field) => typeof field === "string") : []
|
|
15013
|
-
};
|
|
15014
|
-
}
|
|
15015
|
-
],
|
|
15016
|
-
url: AssetApiEndpoint.GET_CONTENT_V3
|
|
15017
|
-
});
|
|
15018
|
-
return response.data;
|
|
15019
|
-
} catch (error) {
|
|
15020
|
-
return {
|
|
15021
|
-
facets: [],
|
|
15022
|
-
isError: true,
|
|
15023
|
-
items: [],
|
|
15024
|
-
totalCount: 0,
|
|
15025
|
-
unreadableFields: []
|
|
15026
|
-
};
|
|
14961
|
+
if (previous.width !== size.width) {
|
|
14962
|
+
this.debouncedApplyColumnLayout();
|
|
14963
|
+
}
|
|
14964
|
+
if (previous.height !== size.height) {
|
|
14965
|
+
this.debouncedRedrawTable();
|
|
14966
|
+
}
|
|
14967
|
+
}
|
|
14968
|
+
calculatePageSize(height) {
|
|
14969
|
+
if (Math.abs(__privateGet$1(this, _lastHeight) - height) < 10) {
|
|
14970
|
+
return;
|
|
14971
|
+
}
|
|
14972
|
+
__privateSet$1(this, _lastHeight, height);
|
|
14973
|
+
this.reportRowCount();
|
|
14974
|
+
}
|
|
14975
|
+
/** Counts the rows the last measured height shows, and tells the host when the count changes. */
|
|
14976
|
+
reportRowCount() {
|
|
14977
|
+
const rowCount = Math.ceil(this.resolveVisibleHeight(__privateGet$1(this, _lastHeight)) / ROW_HEIGHT);
|
|
14978
|
+
__privateSet$1(this, _rowCountHeld, this.loading && this.assets.length > 0);
|
|
14979
|
+
if (rowCount === __privateGet$1(this, _lastRowCount) || __privateGet$1(this, _rowCountHeld)) {
|
|
14980
|
+
return;
|
|
14981
|
+
}
|
|
14982
|
+
__privateSet$1(this, _lastRowCount, rowCount);
|
|
14983
|
+
this.emit("cx-content-browser-grid-resize", {
|
|
14984
|
+
detail: {
|
|
14985
|
+
columnCount: 1,
|
|
14986
|
+
rowCount
|
|
14987
|
+
}
|
|
14988
|
+
});
|
|
14989
|
+
}
|
|
14990
|
+
/**
|
|
14991
|
+
* Only once the restarted rows are in: the host asks for the next page at once, and a page that
|
|
14992
|
+
* lands while `setData` waits replaces the rows again and holds them back for another half second.
|
|
14993
|
+
* A measurement still in its debounce reports in the same count, because a second count inside the
|
|
14994
|
+
* host's 200 ms fetch debounce cancels the page the first count asked for.
|
|
14995
|
+
*/
|
|
14996
|
+
reportRestartedRowCount() {
|
|
14997
|
+
if (!this.isConnected || __privateGet$1(this, _lastRowCount) !== void 0 || __privateGet$1(this, _lastHeight) === 0) {
|
|
14998
|
+
return;
|
|
15027
14999
|
}
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15031
|
-
|
|
15032
|
-
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
cache: {
|
|
15039
|
-
// A malformed body arrives with HTTP 200, so the default status check would cache the error and
|
|
15040
|
-
// serve it again after the server recovers.
|
|
15041
|
-
cachePredicate: {
|
|
15042
|
-
responseMatch: ({ data }) => !data.isError
|
|
15043
|
-
}
|
|
15044
|
-
},
|
|
15045
|
-
method: "GET",
|
|
15046
|
-
params: {
|
|
15047
|
-
RecordId: assetRecordId
|
|
15048
|
-
},
|
|
15049
|
-
responseType: "json",
|
|
15050
|
-
transformResponse: [
|
|
15051
|
-
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
15052
|
-
(rawResponse) => {
|
|
15053
|
-
var _a2;
|
|
15054
|
-
if (!rawResponse || typeof rawResponse !== "object" || !Array.isArray(rawResponse.proxies)) {
|
|
15055
|
-
return {
|
|
15056
|
-
isError: true,
|
|
15057
|
-
previewUrl: "",
|
|
15058
|
-
proxies: []
|
|
15059
|
-
};
|
|
15060
|
-
}
|
|
15061
|
-
return {
|
|
15062
|
-
isError: false,
|
|
15063
|
-
previewUrl: (_a2 = rawResponse.previewUrl) != null ? _a2 : "",
|
|
15064
|
-
proxies: rawResponse.proxies.map((proxy) => ({
|
|
15065
|
-
cdnName: proxy.cdnName,
|
|
15066
|
-
extension: proxy.extension,
|
|
15067
|
-
formatHeight: proxy.formatHeight,
|
|
15068
|
-
formatWidth: proxy.formatWidth,
|
|
15069
|
-
height: proxy.height,
|
|
15070
|
-
id: createId(),
|
|
15071
|
-
permanentLink: proxy.permanentLink,
|
|
15072
|
-
proxyLabel: proxy.proxyLabel,
|
|
15073
|
-
proxyName: proxy.proxyName,
|
|
15074
|
-
width: proxy.width
|
|
15075
|
-
}))
|
|
15076
|
-
};
|
|
15077
|
-
}
|
|
15078
|
-
],
|
|
15079
|
-
url: AssetApiEndpoint.GET_AVAILABLE_PROXIES
|
|
15080
|
-
});
|
|
15081
|
-
return response.data;
|
|
15082
|
-
} catch (error) {
|
|
15083
|
-
return {
|
|
15084
|
-
isError: true,
|
|
15085
|
-
previewUrl: "",
|
|
15086
|
-
proxies: []
|
|
15087
|
-
};
|
|
15000
|
+
this.debouncedCalculatePageSize.flush();
|
|
15001
|
+
this.reportRowCount();
|
|
15002
|
+
}
|
|
15003
|
+
/**
|
|
15004
|
+
* Once the load ends and any rows it brings are in, the count measured meanwhile can ask for the
|
|
15005
|
+
* page after it. A table that is not built yet reports it at once.
|
|
15006
|
+
*/
|
|
15007
|
+
reportHeldRowCount() {
|
|
15008
|
+
if (!__privateGet$1(this, _rowCountHeld) || !this.isConnected) {
|
|
15009
|
+
return;
|
|
15088
15010
|
}
|
|
15089
|
-
|
|
15090
|
-
|
|
15091
|
-
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
|
|
15011
|
+
this.debouncedCalculatePageSize.flush();
|
|
15012
|
+
this.reportRowCount();
|
|
15013
|
+
}
|
|
15014
|
+
/**
|
|
15015
|
+
* The rows never size the container (see the styles), so this is the height the host gives the
|
|
15016
|
+
* picker, and it can run past the viewport. No scrollport shows more rows than the viewport, so
|
|
15017
|
+
* while the rows do not overflow the scrollport the count stops there, and the page scrolls to the
|
|
15018
|
+
* rest, where the last row coming into view asks for more (`observeLastRow`). One that overflows,
|
|
15019
|
+
* or holds no rows yet, measures the space its container gives it and is used as is.
|
|
15020
|
+
*/
|
|
15021
|
+
resolveVisibleHeight(height) {
|
|
15022
|
+
return this.isSizedByRows() ? Math.min(height, window.innerHeight) : height;
|
|
15023
|
+
}
|
|
15024
|
+
isSizedByRows() {
|
|
15025
|
+
var _a2, _b2;
|
|
15026
|
+
const scrollport = this.scrollport;
|
|
15027
|
+
return ((_b2 = (_a2 = this.tabulator) == null ? void 0 : _a2.getDataCount()) != null ? _b2 : 0) > 0 && scrollport !== void 0 && scrollport.scrollHeight <= scrollport.clientHeight + 1;
|
|
15028
|
+
}
|
|
15029
|
+
/**
|
|
15030
|
+
* A scrollport that holds its rows without overflowing never scrolls, so its own scroll never
|
|
15031
|
+
* reaches the end: the page scrolls instead. Once the table is taller than the viewport its count
|
|
15032
|
+
* is capped and stops fetching, which leaves the last row coming into view as the only sign the
|
|
15033
|
+
* user wants more.
|
|
15034
|
+
*/
|
|
15035
|
+
observeLastRow() {
|
|
15036
|
+
var _a2, _b2, _c2, _d2;
|
|
15037
|
+
(_a2 = __privateGet$1(this, _lastRowObserver)) == null ? void 0 : _a2.disconnect();
|
|
15038
|
+
const rows = (_c2 = (_b2 = this.tabulator) == null ? void 0 : _b2.getRows()) != null ? _c2 : [];
|
|
15039
|
+
const lastRow = rows[rows.length - 1];
|
|
15040
|
+
if (!lastRow) {
|
|
15041
|
+
return;
|
|
15108
15042
|
}
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
RecordId: assetRecordId
|
|
15120
|
-
},
|
|
15121
|
-
responseType: "json",
|
|
15122
|
-
transformResponse: [
|
|
15123
|
-
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
15124
|
-
(rawResponse) => {
|
|
15125
|
-
if (!rawResponse.favoriteRecordIds) {
|
|
15126
|
-
return false;
|
|
15127
|
-
}
|
|
15128
|
-
return rawResponse.favoriteRecordIds.includes(assetRecordId);
|
|
15129
|
-
}
|
|
15130
|
-
],
|
|
15131
|
-
url: AssetApiEndpoint.GET_FAVORITE_ASSETS
|
|
15132
|
-
});
|
|
15133
|
-
return response.data;
|
|
15134
|
-
} catch (error) {
|
|
15135
|
-
return false;
|
|
15043
|
+
(_d2 = __privateGet$1(this, _lastRowObserver)) != null ? _d2 : __privateSet$1(this, _lastRowObserver, new IntersectionObserver((entries) => {
|
|
15044
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
15045
|
+
this.debouncedHandleLastRowVisible();
|
|
15046
|
+
}
|
|
15047
|
+
}));
|
|
15048
|
+
__privateGet$1(this, _lastRowObserver).observe(lastRow.getElement());
|
|
15049
|
+
}
|
|
15050
|
+
handleLastRowVisible() {
|
|
15051
|
+
if (this.isSizedByRows() && this.containerEl.clientHeight > window.innerHeight) {
|
|
15052
|
+
this.handleScrollEnd();
|
|
15136
15053
|
}
|
|
15137
|
-
}
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
}) {
|
|
15143
|
-
try {
|
|
15144
|
-
const response = yield http.request({
|
|
15145
|
-
method: "GET",
|
|
15146
|
-
params: {
|
|
15147
|
-
RecordId: assetRecordId
|
|
15148
|
-
},
|
|
15149
|
-
responseType: "json",
|
|
15150
|
-
transformResponse: [
|
|
15151
|
-
...Array.isArray(http.defaults.transformResponse) ? http.defaults.transformResponse : [],
|
|
15152
|
-
(rawResponse) => {
|
|
15153
|
-
return {
|
|
15154
|
-
count: rawResponse.count,
|
|
15155
|
-
versions: rawResponse.versions.map((version) => ({
|
|
15156
|
-
createByEmail: version.CreateByEmail,
|
|
15157
|
-
fileImportDate: version.FileImportDate,
|
|
15158
|
-
scrubUrl: version.ScrubUrl,
|
|
15159
|
-
versionCreateDate: version.VersionCreateDate,
|
|
15160
|
-
versionFileName: version.UpdatedFileName || version.VersionFileName,
|
|
15161
|
-
versionFileUrl: version.PreviewUrl,
|
|
15162
|
-
versionId: version.VersionID,
|
|
15163
|
-
versionNumber: Number(version.VersionNumber),
|
|
15164
|
-
versionNumberDisplay: version.VersionNumberDisplay
|
|
15165
|
-
}))
|
|
15166
|
-
};
|
|
15167
|
-
}
|
|
15168
|
-
],
|
|
15169
|
-
url: AssetApiEndpoint.GET_ASSET_VERSION_HISTORY
|
|
15170
|
-
});
|
|
15171
|
-
return response.data;
|
|
15172
|
-
} catch (error) {
|
|
15173
|
-
return {
|
|
15174
|
-
count: 0,
|
|
15175
|
-
versions: []
|
|
15176
|
-
};
|
|
15054
|
+
}
|
|
15055
|
+
insertAsset(assetId) {
|
|
15056
|
+
var _a2;
|
|
15057
|
+
if (!assetId || ((_a2 = this.assetMap.get(assetId)) == null ? void 0 : _a2.inColdStorage)) {
|
|
15058
|
+
return;
|
|
15177
15059
|
}
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
(rawResponse) => {
|
|
15196
|
-
if (rawResponse.success) {
|
|
15197
|
-
return true;
|
|
15198
|
-
}
|
|
15199
|
-
return false;
|
|
15200
|
-
}
|
|
15201
|
-
],
|
|
15202
|
-
url: AssetApiEndpoint.ADD_ASSET_TO_FAVORITE
|
|
15203
|
-
});
|
|
15204
|
-
return response.data;
|
|
15205
|
-
} catch (error) {
|
|
15206
|
-
return false;
|
|
15060
|
+
this.emit("cx-content-browser-grid-click", {
|
|
15061
|
+
detail: {
|
|
15062
|
+
id: assetId
|
|
15063
|
+
}
|
|
15064
|
+
});
|
|
15065
|
+
}
|
|
15066
|
+
/** The host field of a row key, or `undefined` for the filler. */
|
|
15067
|
+
fieldOfKey(key) {
|
|
15068
|
+
var _a2;
|
|
15069
|
+
return key ? (_a2 = this.columns[this.resolveColumnKeys().indexOf(key)]) == null ? void 0 : _a2.field : void 0;
|
|
15070
|
+
}
|
|
15071
|
+
handleColumnResized(event) {
|
|
15072
|
+
event.stopPropagation();
|
|
15073
|
+
const [column2] = event.detail.args;
|
|
15074
|
+
const field = this.fieldOfKey(column2.getField());
|
|
15075
|
+
if (field === void 0) {
|
|
15076
|
+
return;
|
|
15207
15077
|
}
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
|
|
15211
|
-
|
|
15212
|
-
|
|
15213
|
-
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
|
|
15217
|
-
|
|
15218
|
-
|
|
15219
|
-
|
|
15220
|
-
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
|
|
15233
|
-
}
|
|
15234
|
-
|
|
15235
|
-
|
|
15236
|
-
|
|
15078
|
+
const width = Math.round(column2.getWidth());
|
|
15079
|
+
column2.getDefinition().width = width;
|
|
15080
|
+
__privateGet$1(this, _resizedWidths).set(field.trim(), width);
|
|
15081
|
+
this.holdOtherAutoFitWidths(field);
|
|
15082
|
+
this.emit("cx-content-browser-table-column-resize", {
|
|
15083
|
+
detail: {
|
|
15084
|
+
field,
|
|
15085
|
+
reset: false,
|
|
15086
|
+
width
|
|
15087
|
+
}
|
|
15088
|
+
});
|
|
15089
|
+
this.applyColumnLayout();
|
|
15090
|
+
}
|
|
15091
|
+
/**
|
|
15092
|
+
* Holds each other visible auto-fit column at its width when the drag ends, for the session. A drag
|
|
15093
|
+
* on one column must not change the width of another column (L-42CA9K issue 2).
|
|
15094
|
+
*/
|
|
15095
|
+
holdOtherAutoFitWidths(dragged) {
|
|
15096
|
+
const hidden = new Set(this.hiddenFields);
|
|
15097
|
+
const keys2 = this.resolveColumnKeys();
|
|
15098
|
+
this.columns.forEach((column2, index) => {
|
|
15099
|
+
var _a2;
|
|
15100
|
+
const field = column2.field.trim();
|
|
15101
|
+
if (field === dragged.trim() || hidden.has(column2.field) || __privateGet$1(this, _resizedWidths).has(field)) {
|
|
15102
|
+
return;
|
|
15103
|
+
}
|
|
15104
|
+
const tabulatorColumn = (_a2 = this.tabulator) == null ? void 0 : _a2.getColumn(keys2[index]);
|
|
15105
|
+
const width = tabulatorColumn ? Math.round(tabulatorColumn.getWidth()) : 0;
|
|
15106
|
+
if (width > 0) {
|
|
15107
|
+
__privateGet$1(this, _sessionWidths).set(field, width);
|
|
15108
|
+
}
|
|
15109
|
+
});
|
|
15110
|
+
}
|
|
15111
|
+
handleScrollVertical(event) {
|
|
15112
|
+
event.stopPropagation();
|
|
15113
|
+
this.releaseDetachedCta();
|
|
15114
|
+
const scrollport = this.scrollport;
|
|
15115
|
+
if (scrollport && scrollport.scrollTop + scrollport.clientHeight >= scrollport.scrollHeight - ROW_HEIGHT) {
|
|
15116
|
+
this.debouncedHandleScrollEnd();
|
|
15237
15117
|
}
|
|
15238
|
-
}
|
|
15239
|
-
|
|
15118
|
+
}
|
|
15119
|
+
handleScrollEnd() {
|
|
15120
|
+
if (this.hasMore && !this.loading) {
|
|
15121
|
+
this.emit("cx-content-browser-grid-scroll-end");
|
|
15122
|
+
}
|
|
15123
|
+
}
|
|
15124
|
+
handleRetry() {
|
|
15125
|
+
this.emit("cx-content-browser-grid-retry");
|
|
15126
|
+
}
|
|
15127
|
+
renderRetry() {
|
|
15128
|
+
return b`
|
|
15129
|
+
<cx-button class="content-browser-table__retry" variant="primary" @click=${this.handleRetry}>
|
|
15130
|
+
${this.localize.term("retry")}
|
|
15131
|
+
</cx-button>
|
|
15132
|
+
`;
|
|
15133
|
+
}
|
|
15134
|
+
renderContent() {
|
|
15135
|
+
if (this.error && this.assets.length === 0) {
|
|
15136
|
+
return b`
|
|
15137
|
+
<cx-content-browser-no-result
|
|
15138
|
+
class="content-browser-table__empty"
|
|
15139
|
+
icon="error_outline"
|
|
15140
|
+
message=${this.localize.term("oopsSomethingWentWrong")}
|
|
15141
|
+
role="alert"
|
|
15142
|
+
>
|
|
15143
|
+
${this.renderRetry()}
|
|
15144
|
+
</cx-content-browser-no-result>
|
|
15145
|
+
`;
|
|
15146
|
+
}
|
|
15147
|
+
if (this.empty) {
|
|
15148
|
+
return b`
|
|
15149
|
+
<cx-content-browser-no-result
|
|
15150
|
+
class="content-browser-table__empty"
|
|
15151
|
+
icon="search_off"
|
|
15152
|
+
message=${this.localize.term("noResults")}
|
|
15153
|
+
></cx-content-browser-no-result>
|
|
15154
|
+
`;
|
|
15155
|
+
}
|
|
15156
|
+
return b`
|
|
15157
|
+
<cx-table
|
|
15158
|
+
class="content-browser-table__table"
|
|
15159
|
+
layout="fitData"
|
|
15160
|
+
placeholder=""
|
|
15161
|
+
no-selectable
|
|
15162
|
+
no-clipboard
|
|
15163
|
+
.columns=${__privateGet$1(this, _columnDefinitions)}
|
|
15164
|
+
.columnDefaults=${COLUMN_DEFAULTS}
|
|
15165
|
+
.rowHeight=${ROW_HEIGHT}
|
|
15166
|
+
@cx-table.tableBuilt=${this.handleTableBuilt}
|
|
15167
|
+
@cx-table.dataLoaded=${this.handleDataLoaded}
|
|
15168
|
+
@cx-table.columnsLoaded=${this.handleColumnsLoaded}
|
|
15169
|
+
@cx-table.columnResized=${this.handleColumnResized}
|
|
15170
|
+
@cx-table.scrollVertical=${this.handleScrollVertical}
|
|
15171
|
+
@cx-table.renderStarted=${this.handleRenderStarted}
|
|
15172
|
+
@cx-table.renderComplete=${this.handleRenderComplete}
|
|
15173
|
+
></cx-table>
|
|
15174
|
+
`;
|
|
15175
|
+
}
|
|
15176
|
+
render() {
|
|
15177
|
+
return b`
|
|
15178
|
+
<div
|
|
15179
|
+
class="content-browser-table-loading"
|
|
15180
|
+
style=${o$2({
|
|
15181
|
+
opacity: this.loading ? 1 : 0
|
|
15182
|
+
})}
|
|
15183
|
+
>
|
|
15184
|
+
<cx-progress-bar indeterminate></cx-progress-bar>
|
|
15185
|
+
</div>
|
|
15186
|
+
<cx-resize-observer @cx-resize=${this.handleResize}>
|
|
15187
|
+
<div class="content-browser-table">
|
|
15188
|
+
${this.renderContent()}
|
|
15189
|
+
</div>
|
|
15190
|
+
</cx-resize-observer>
|
|
15191
|
+
${n$5(this.error && this.assets.length > 0, () => b`
|
|
15192
|
+
<div class="content-browser-table__page-error" role="alert">
|
|
15193
|
+
<cx-icon name="error_outline"></cx-icon>
|
|
15194
|
+
${this.localize.term("oopsSomethingWentWrong")}
|
|
15195
|
+
${this.renderRetry()}
|
|
15196
|
+
</div>
|
|
15197
|
+
`)}
|
|
15198
|
+
`;
|
|
15199
|
+
}
|
|
15200
|
+
};
|
|
15201
|
+
_columnDefinitions = /* @__PURE__ */ new WeakMap();
|
|
15202
|
+
_columnsSignature = /* @__PURE__ */ new WeakMap();
|
|
15203
|
+
_columnKeys = /* @__PURE__ */ new WeakMap();
|
|
15204
|
+
_rowsNeedRebuild = /* @__PURE__ */ new WeakMap();
|
|
15205
|
+
_heldRowKeys = /* @__PURE__ */ new WeakMap();
|
|
15206
|
+
_resizedWidths = /* @__PURE__ */ new WeakMap();
|
|
15207
|
+
_sessionWidths = /* @__PURE__ */ new WeakMap();
|
|
15208
|
+
_ctas = /* @__PURE__ */ new WeakMap();
|
|
15209
|
+
_renderedCtas = /* @__PURE__ */ new WeakMap();
|
|
15210
|
+
_pointerTrackedRows = /* @__PURE__ */ new WeakMap();
|
|
15211
|
+
_hoveredRow = /* @__PURE__ */ new WeakMap();
|
|
15212
|
+
_focusedCta = /* @__PURE__ */ new WeakMap();
|
|
15213
|
+
_ctaFocusedAtRender = /* @__PURE__ */ new WeakMap();
|
|
15214
|
+
_noHoverQueries = /* @__PURE__ */ new WeakMap();
|
|
15215
|
+
_hasNoHover = /* @__PURE__ */ new WeakMap();
|
|
15216
|
+
_builtTable = /* @__PURE__ */ new WeakMap();
|
|
15217
|
+
_syncedAssets = /* @__PURE__ */ new WeakMap();
|
|
15218
|
+
_pendingReplaces = /* @__PURE__ */ new WeakMap();
|
|
15219
|
+
_lastHeight = /* @__PURE__ */ new WeakMap();
|
|
15220
|
+
_containerSize = /* @__PURE__ */ new WeakMap();
|
|
15221
|
+
_lastRowCount = /* @__PURE__ */ new WeakMap();
|
|
15222
|
+
_rowCountHeld = /* @__PURE__ */ new WeakMap();
|
|
15223
|
+
_lastRowObserver = /* @__PURE__ */ new WeakMap();
|
|
15224
|
+
_layoutScrollbarWidth = /* @__PURE__ */ new WeakMap();
|
|
15225
|
+
_naturalWidths = /* @__PURE__ */ new WeakMap();
|
|
15226
|
+
_layoutPending = /* @__PURE__ */ new WeakMap();
|
|
15227
|
+
_fontsPending = /* @__PURE__ */ new WeakMap();
|
|
15228
|
+
_frameWidthObserver = /* @__PURE__ */ new WeakMap();
|
|
15229
|
+
CxContentBrowserTable.styles = [componentStyles, styles$1];
|
|
15230
|
+
CxContentBrowserTable.dependencies = {
|
|
15231
|
+
"cx-button": CxButton,
|
|
15232
|
+
"cx-content-browser-no-result": CxContentBrowserNoResult,
|
|
15233
|
+
"cx-icon": CxIcon,
|
|
15234
|
+
"cx-line-clamp": CxLineClamp,
|
|
15235
|
+
"cx-progress-bar": CxProgressBar,
|
|
15236
|
+
"cx-resize-observer": CxResizeObserver,
|
|
15237
|
+
"cx-table": CxTable
|
|
15238
|
+
};
|
|
15239
|
+
__decorateClass$1([
|
|
15240
|
+
e$7(".content-browser-table")
|
|
15241
|
+
], CxContentBrowserTable.prototype, "containerEl", 2);
|
|
15242
|
+
__decorateClass$1([
|
|
15243
|
+
e$7("cx-table")
|
|
15244
|
+
], CxContentBrowserTable.prototype, "tableEl", 2);
|
|
15245
|
+
__decorateClass$1([
|
|
15246
|
+
n$6({ attribute: "assets", reflect: false, type: Array })
|
|
15247
|
+
], CxContentBrowserTable.prototype, "assets", 2);
|
|
15248
|
+
__decorateClass$1([
|
|
15249
|
+
n$6({ attribute: "columns", reflect: false, type: Array })
|
|
15250
|
+
], CxContentBrowserTable.prototype, "columns", 2);
|
|
15251
|
+
__decorateClass$1([
|
|
15252
|
+
n$6({ attribute: "cta-text", reflect: false, type: String })
|
|
15253
|
+
], CxContentBrowserTable.prototype, "ctaText", 2);
|
|
15254
|
+
__decorateClass$1([
|
|
15255
|
+
n$6({ attribute: "cta-text-transform", reflect: false, type: String })
|
|
15256
|
+
], CxContentBrowserTable.prototype, "ctaTextTransform", 2);
|
|
15257
|
+
__decorateClass$1([
|
|
15258
|
+
n$6({ attribute: "empty", reflect: true, type: Boolean })
|
|
15259
|
+
], CxContentBrowserTable.prototype, "empty", 2);
|
|
15260
|
+
__decorateClass$1([
|
|
15261
|
+
n$6({ attribute: "error", reflect: true, type: Boolean })
|
|
15262
|
+
], CxContentBrowserTable.prototype, "error", 2);
|
|
15263
|
+
__decorateClass$1([
|
|
15264
|
+
n$6({ attribute: "has-more", reflect: true, type: Boolean })
|
|
15265
|
+
], CxContentBrowserTable.prototype, "hasMore", 2);
|
|
15266
|
+
__decorateClass$1([
|
|
15267
|
+
n$6({ attribute: "loading", reflect: true, type: Boolean })
|
|
15268
|
+
], CxContentBrowserTable.prototype, "loading", 2);
|
|
15269
|
+
__decorateClass$1([
|
|
15270
|
+
n$6({ attribute: "selected-asset-id", reflect: true, type: String })
|
|
15271
|
+
], CxContentBrowserTable.prototype, "selectedAssetId", 2);
|
|
15272
|
+
__decorateClass$1([
|
|
15273
|
+
n$6({ attribute: false })
|
|
15274
|
+
], CxContentBrowserTable.prototype, "busyAssetId", 2);
|
|
15275
|
+
__decorateClass$1([
|
|
15276
|
+
n$6({ attribute: false })
|
|
15277
|
+
], CxContentBrowserTable.prototype, "hiddenFields", 2);
|
|
15278
|
+
__decorateClass$1([
|
|
15279
|
+
n$6({ attribute: false })
|
|
15280
|
+
], CxContentBrowserTable.prototype, "savedWidths", 2);
|
|
15281
|
+
__decorateClass$1([
|
|
15282
|
+
n$6({ attribute: false })
|
|
15283
|
+
], CxContentBrowserTable.prototype, "widthScope", 2);
|
|
15284
|
+
__decorateClass$1([
|
|
15285
|
+
n$6({ attribute: "row-action-position", reflect: true })
|
|
15286
|
+
], CxContentBrowserTable.prototype, "rowActionPosition", 2);
|
|
15287
|
+
__decorateClass$1([
|
|
15288
|
+
watch("assets")
|
|
15289
|
+
], CxContentBrowserTable.prototype, "handleAssetsChange", 1);
|
|
15290
|
+
__decorateClass$1([
|
|
15291
|
+
watch("loading", { waitUntilFirstUpdate: true })
|
|
15292
|
+
], CxContentBrowserTable.prototype, "handleLoadingChange", 1);
|
|
15293
|
+
__decorateClass$1([
|
|
15294
|
+
watch("selectedAssetId", { waitUntilFirstUpdate: true })
|
|
15295
|
+
], CxContentBrowserTable.prototype, "handleSelectedAssetIdChange", 1);
|
|
15296
|
+
__decorateClass$1([
|
|
15297
|
+
watch("busyAssetId", { waitUntilFirstUpdate: true })
|
|
15298
|
+
], CxContentBrowserTable.prototype, "handleBusyAssetIdChange", 1);
|
|
15299
|
+
__decorateClass$1([
|
|
15300
|
+
watch(["ctaText", "ctaTextTransform"], { waitUntilFirstUpdate: true })
|
|
15301
|
+
], CxContentBrowserTable.prototype, "handleCtaTextChange", 1);
|
|
15302
|
+
CxContentBrowserTable = __decorateClass$1([
|
|
15303
|
+
customElement("cx-content-browser-table")
|
|
15304
|
+
], CxContentBrowserTable);
|
|
15240
15305
|
function apiGetUserInfo() {
|
|
15241
15306
|
return __async(this, null, function* () {
|
|
15242
15307
|
try {
|
|
@@ -17014,7 +17079,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
17014
17079
|
skipLinkGeneration: this.skipLinkGeneration
|
|
17015
17080
|
}));
|
|
17016
17081
|
if (response.isError) {
|
|
17017
|
-
this.
|
|
17082
|
+
this.reportConfirmFailure(response.error);
|
|
17018
17083
|
return;
|
|
17019
17084
|
}
|
|
17020
17085
|
this.handleSelectedAsset({
|
|
@@ -17023,20 +17088,25 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
17023
17088
|
selectedProxyMetadata: event.detail.selectedProxyMetadata
|
|
17024
17089
|
});
|
|
17025
17090
|
this.formatDialog.hide();
|
|
17026
|
-
} catch (
|
|
17027
|
-
this.
|
|
17091
|
+
} catch (error) {
|
|
17092
|
+
this.reportConfirmFailure(error);
|
|
17028
17093
|
} finally {
|
|
17029
17094
|
__privateSet2(this, _insertInFlight, false);
|
|
17030
17095
|
this.busyAssetId = void 0;
|
|
17031
17096
|
}
|
|
17032
17097
|
});
|
|
17033
17098
|
}
|
|
17034
|
-
|
|
17099
|
+
reportConfirmFailure(cause) {
|
|
17100
|
+
const error = toAssetLinkError(cause);
|
|
17101
|
+
if (!this.formatDialog.isDialogOpen) {
|
|
17102
|
+
this.formatDialog.revealAfterAutoConfirm();
|
|
17103
|
+
}
|
|
17035
17104
|
if (this.formatDialog.isDialogOpen) {
|
|
17036
|
-
this.formatDialog.
|
|
17037
|
-
return;
|
|
17105
|
+
this.formatDialog.showConfirmError(error.serverMessage);
|
|
17038
17106
|
}
|
|
17039
|
-
this.
|
|
17107
|
+
this.emit("cx-content-browser-asset-link-error", {
|
|
17108
|
+
detail: { error }
|
|
17109
|
+
});
|
|
17040
17110
|
}
|
|
17041
17111
|
handleFormatConfirm(event) {
|
|
17042
17112
|
return __async(this, null, function* () {
|
|
@@ -17047,7 +17117,7 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
17047
17117
|
extraFields: this.extraFields
|
|
17048
17118
|
}));
|
|
17049
17119
|
if (response.isError) {
|
|
17050
|
-
this.
|
|
17120
|
+
this.reportConfirmFailure(response.error);
|
|
17051
17121
|
return;
|
|
17052
17122
|
}
|
|
17053
17123
|
this.handleSelectedAsset({
|
|
@@ -17057,8 +17127,8 @@ let CxContentBrowser = class extends CortexElement {
|
|
|
17057
17127
|
transformedAssetMetadata: event.detail.transformedAssetMetadata
|
|
17058
17128
|
});
|
|
17059
17129
|
this.formatDialog.hide();
|
|
17060
|
-
} catch (
|
|
17061
|
-
this.
|
|
17130
|
+
} catch (error) {
|
|
17131
|
+
this.reportConfirmFailure(error);
|
|
17062
17132
|
} finally {
|
|
17063
17133
|
__privateSet2(this, _insertInFlight, false);
|
|
17064
17134
|
this.busyAssetId = void 0;
|
|
@@ -34624,6 +34694,10 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
|
|
|
34624
34694
|
}
|
|
34625
34695
|
onClose == null ? void 0 : onClose();
|
|
34626
34696
|
}), [onAssetSelected, onClose, persistMode]);
|
|
34697
|
+
const onAssetLinkError = reactExports.useCallback((event) => {
|
|
34698
|
+
const { error } = event.detail;
|
|
34699
|
+
onError(error.message, error);
|
|
34700
|
+
}, [onError]);
|
|
34627
34701
|
const onFetchAndMergeAssetsSuccess = reactExports.useCallback((event) => {
|
|
34628
34702
|
var _a2;
|
|
34629
34703
|
if (!loadedFromStorage.current) {
|
|
@@ -34814,6 +34888,7 @@ const AssetsPicker = reactExports.forwardRef(function AssetsPicker2({ accessToke
|
|
|
34814
34888
|
"show-title": displayInfo.title,
|
|
34815
34889
|
"multi-select": multiSelect ? "true" : void 0,
|
|
34816
34890
|
"oncx-content-browser-selected-asset": onSelectedAsset,
|
|
34891
|
+
"oncx-content-browser-asset-link-error": onAssetLinkError,
|
|
34817
34892
|
"oncx-content-browser-request-change": onFetchAndMergeAssetsSuccess,
|
|
34818
34893
|
"oncx-content-browser-grid-click": onGridClick,
|
|
34819
34894
|
"oncx-content-browser-pin-asset-lookup": onPinAssetLookup,
|
|
@@ -36099,6 +36174,7 @@ const fonts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
36099
36174
|
__proto__: null
|
|
36100
36175
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
36101
36176
|
export {
|
|
36177
|
+
AssetLinkError,
|
|
36102
36178
|
CxContentBrowser,
|
|
36103
36179
|
ContentBrowser as default
|
|
36104
36180
|
};
|