@uploadcare/file-uploader 1.24.1 → 1.24.2
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/dist/env.js +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +145 -28
- package/dist/index.ssr.js +1 -3
- package/package.json +1 -1
- package/web/file-uploader.iife.min.d.ts +9 -6
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.d.ts +9 -6
- package/web/file-uploader.min.js +4 -4
- package/web/uc-cloud-image-editor.min.d.ts +9 -4
- package/web/uc-cloud-image-editor.min.js +4 -4
- package/web/uc-file-uploader-inline.min.d.ts +9 -6
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.d.ts +9 -6
- package/web/uc-file-uploader-minimal.min.js +4 -4
- package/web/uc-file-uploader-regular.min.d.ts +9 -6
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/web/uc-img.min.js +1 -1
package/dist/env.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -104,12 +104,13 @@ declare class ModalManager {
|
|
|
104
104
|
destroy(): void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
type CommonEventType = InternalEventKey | EventKey;
|
|
107
108
|
type TelemetryState = TelemetryRequest & {
|
|
108
109
|
eventTimestamp: number;
|
|
109
110
|
};
|
|
110
111
|
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
111
112
|
modalId?: string;
|
|
112
|
-
eventType?:
|
|
113
|
+
eventType?: CommonEventType;
|
|
113
114
|
};
|
|
114
115
|
declare class TelemetryManager {
|
|
115
116
|
private readonly _sessionId;
|
|
@@ -181,9 +182,13 @@ declare class Block extends BaseComponent<any> {
|
|
|
181
182
|
static reg(name?: string): void;
|
|
182
183
|
}
|
|
183
184
|
|
|
184
|
-
declare const
|
|
185
|
+
declare const InternalEventType: Readonly<{
|
|
185
186
|
readonly INIT_SOLUTION: "init-solution";
|
|
186
187
|
readonly CHANGE_CONFIG: "change-config";
|
|
188
|
+
readonly ACTION_EVENT: "action-event";
|
|
189
|
+
readonly ERROR_EVENT: "error-event";
|
|
190
|
+
}>;
|
|
191
|
+
declare const EventType: Readonly<{
|
|
187
192
|
readonly FILE_ADDED: "file-added";
|
|
188
193
|
readonly FILE_REMOVED: "file-removed";
|
|
189
194
|
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
@@ -204,6 +209,7 @@ declare const EventType: Readonly<{
|
|
|
204
209
|
readonly GROUP_CREATED: "group-created";
|
|
205
210
|
}>;
|
|
206
211
|
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
212
|
+
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
207
213
|
type EventPayload = {
|
|
208
214
|
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
209
215
|
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
@@ -230,8 +236,6 @@ type EventPayload = {
|
|
|
230
236
|
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
231
237
|
[EventType.CHANGE]: OutputCollectionState;
|
|
232
238
|
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
233
|
-
[EventType.INIT_SOLUTION]: void;
|
|
234
|
-
[EventType.CHANGE_CONFIG]: void;
|
|
235
239
|
};
|
|
236
240
|
declare class EventEmitter {
|
|
237
241
|
private _timeoutStore;
|
|
@@ -527,6 +531,7 @@ declare class Config extends Block {
|
|
|
527
531
|
_assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
|
|
528
532
|
initCallback(): void;
|
|
529
533
|
attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
|
|
534
|
+
get computationControllers(): any;
|
|
530
535
|
}
|
|
531
536
|
interface Config extends ConfigType {
|
|
532
537
|
}
|
|
@@ -1959,8 +1964,6 @@ type EventListenerMap = {
|
|
|
1959
1964
|
declare class UploadCtxProvider extends UploaderBlock {
|
|
1960
1965
|
static styleAttrs: string[];
|
|
1961
1966
|
static EventType: Readonly<{
|
|
1962
|
-
readonly INIT_SOLUTION: "init-solution";
|
|
1963
|
-
readonly CHANGE_CONFIG: "change-config";
|
|
1964
1967
|
readonly FILE_ADDED: "file-added";
|
|
1965
1968
|
readonly FILE_REMOVED: "file-removed";
|
|
1966
1969
|
readonly FILE_UPLOAD_START: "file-upload-start";
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,9 @@ import { BaseComponent as BaseComponent4, Data as Data8, UID as UID4 } from "@sy
|
|
|
31
31
|
var DEFAULT_DEBOUNCE_TIMEOUT = 20;
|
|
32
32
|
var InternalEventType = Object.freeze({
|
|
33
33
|
INIT_SOLUTION: "init-solution",
|
|
34
|
-
CHANGE_CONFIG: "change-config"
|
|
34
|
+
CHANGE_CONFIG: "change-config",
|
|
35
|
+
ACTION_EVENT: "action-event",
|
|
36
|
+
ERROR_EVENT: "error-event"
|
|
35
37
|
});
|
|
36
38
|
var EventType = Object.freeze({
|
|
37
39
|
FILE_ADDED: "file-added",
|
|
@@ -51,8 +53,7 @@ var EventType = Object.freeze({
|
|
|
51
53
|
COMMON_UPLOAD_SUCCESS: "common-upload-success",
|
|
52
54
|
COMMON_UPLOAD_FAILED: "common-upload-failed",
|
|
53
55
|
CHANGE: "change",
|
|
54
|
-
GROUP_CREATED: "group-created"
|
|
55
|
-
...InternalEventType
|
|
56
|
+
GROUP_CREATED: "group-created"
|
|
56
57
|
});
|
|
57
58
|
var EventEmitter = class {
|
|
58
59
|
_timeoutStore = /* @__PURE__ */ new Map();
|
|
@@ -1216,7 +1217,7 @@ import { TelemetryAPIService } from "@uploadcare/quality-insights";
|
|
|
1216
1217
|
import { Queue as Queue2 } from "@uploadcare/upload-client";
|
|
1217
1218
|
|
|
1218
1219
|
// package.json
|
|
1219
|
-
var version = "1.24.
|
|
1220
|
+
var version = "1.24.2";
|
|
1220
1221
|
|
|
1221
1222
|
// src/env.ts
|
|
1222
1223
|
var PACKAGE_NAME = "blocks";
|
|
@@ -1238,14 +1239,16 @@ var TelemetryManager = class {
|
|
|
1238
1239
|
for (const key of Object.keys(this._config)) {
|
|
1239
1240
|
this._block.subConfigValue(key, (value) => {
|
|
1240
1241
|
if (this._initialized && this._config[key] !== value) {
|
|
1241
|
-
this.
|
|
1242
|
+
this.sendEvent({
|
|
1243
|
+
eventType: InternalEventType.CHANGE_CONFIG
|
|
1244
|
+
});
|
|
1242
1245
|
}
|
|
1243
1246
|
this._setConfig(key, value);
|
|
1244
1247
|
});
|
|
1245
1248
|
}
|
|
1246
1249
|
}
|
|
1247
1250
|
_init(type) {
|
|
1248
|
-
if (type ===
|
|
1251
|
+
if (type === InternalEventType.INIT_SOLUTION && !this._initialized) {
|
|
1249
1252
|
this._initialized = true;
|
|
1250
1253
|
}
|
|
1251
1254
|
}
|
|
@@ -1261,7 +1264,7 @@ var TelemetryManager = class {
|
|
|
1261
1264
|
payload.activity = void 0;
|
|
1262
1265
|
}
|
|
1263
1266
|
const result = { ...body };
|
|
1264
|
-
if (body.eventType ===
|
|
1267
|
+
if (body.eventType === InternalEventType.INIT_SOLUTION || body.eventType === InternalEventType.CHANGE_CONFIG) {
|
|
1265
1268
|
result.config = this._config;
|
|
1266
1269
|
}
|
|
1267
1270
|
return {
|
|
@@ -1289,9 +1292,7 @@ var TelemetryManager = class {
|
|
|
1289
1292
|
EventType.FILE_UPLOAD_START,
|
|
1290
1293
|
EventType.FILE_UPLOAD_PROGRESS,
|
|
1291
1294
|
EventType.FILE_UPLOAD_SUCCESS,
|
|
1292
|
-
EventType.FILE_UPLOAD_FAILED
|
|
1293
|
-
EventType.FILE_URL_CHANGED,
|
|
1294
|
-
EventType.GROUP_CREATED
|
|
1295
|
+
EventType.FILE_UPLOAD_FAILED
|
|
1295
1296
|
].includes(type)) {
|
|
1296
1297
|
return true;
|
|
1297
1298
|
}
|
|
@@ -1319,6 +1320,7 @@ var TelemetryManager = class {
|
|
|
1319
1320
|
}
|
|
1320
1321
|
sendEventError(error, context = "unknown") {
|
|
1321
1322
|
this.sendEvent({
|
|
1323
|
+
eventType: InternalEventType.ERROR_EVENT,
|
|
1322
1324
|
payload: {
|
|
1323
1325
|
metadata: {
|
|
1324
1326
|
event: "error",
|
|
@@ -1333,6 +1335,7 @@ var TelemetryManager = class {
|
|
|
1333
1335
|
*/
|
|
1334
1336
|
sendEventCloudImageEditor(e, tabId, options = {}) {
|
|
1335
1337
|
this.sendEvent({
|
|
1338
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
1336
1339
|
payload: {
|
|
1337
1340
|
metadata: {
|
|
1338
1341
|
tabId,
|
|
@@ -4369,16 +4372,64 @@ var CameraSource = class extends UploaderBlock {
|
|
|
4369
4372
|
onCancel: () => {
|
|
4370
4373
|
this.historyBack();
|
|
4371
4374
|
},
|
|
4372
|
-
onShot: () =>
|
|
4375
|
+
onShot: () => {
|
|
4376
|
+
this.telemetryManager.sendEvent({
|
|
4377
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4378
|
+
payload: {
|
|
4379
|
+
metadata: {
|
|
4380
|
+
event: "shot-camera",
|
|
4381
|
+
node: this.tagName,
|
|
4382
|
+
tabId: this._activeTab
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
});
|
|
4386
|
+
this._shot();
|
|
4387
|
+
},
|
|
4373
4388
|
onRequestPermissions: () => this._capture(),
|
|
4374
4389
|
/** General method for photo and video capture */
|
|
4375
|
-
onStartCamera: () =>
|
|
4390
|
+
onStartCamera: () => {
|
|
4391
|
+
this.telemetryManager.sendEvent({
|
|
4392
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4393
|
+
payload: {
|
|
4394
|
+
metadata: {
|
|
4395
|
+
event: "start-camera",
|
|
4396
|
+
node: this.tagName,
|
|
4397
|
+
tabId: this._activeTab
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
});
|
|
4401
|
+
this._chooseActionWithCamera();
|
|
4402
|
+
},
|
|
4376
4403
|
onStartRecording: () => this._startRecording(),
|
|
4377
4404
|
onStopRecording: () => this._stopRecording(),
|
|
4378
4405
|
onToggleRecording: () => this._toggleRecording(),
|
|
4379
4406
|
onToggleAudio: () => this._toggleEnableAudio(),
|
|
4380
|
-
onRetake: () =>
|
|
4381
|
-
|
|
4407
|
+
onRetake: () => {
|
|
4408
|
+
this.telemetryManager.sendEvent({
|
|
4409
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4410
|
+
payload: {
|
|
4411
|
+
metadata: {
|
|
4412
|
+
event: "retake-camera",
|
|
4413
|
+
node: this.tagName,
|
|
4414
|
+
tabId: this._activeTab
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
});
|
|
4418
|
+
this._retake();
|
|
4419
|
+
},
|
|
4420
|
+
onAccept: () => {
|
|
4421
|
+
this.telemetryManager.sendEvent({
|
|
4422
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4423
|
+
payload: {
|
|
4424
|
+
metadata: {
|
|
4425
|
+
event: "accept-camera",
|
|
4426
|
+
node: this.tagName,
|
|
4427
|
+
tabId: this._activeTab
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
});
|
|
4431
|
+
this._accept();
|
|
4432
|
+
},
|
|
4382
4433
|
onClickTab: (event) => {
|
|
4383
4434
|
const target = event.currentTarget;
|
|
4384
4435
|
const id = target?.getAttribute("data-id");
|
|
@@ -4490,6 +4541,16 @@ var CameraSource = class extends UploaderBlock {
|
|
|
4490
4541
|
});
|
|
4491
4542
|
this._mediaRecorder?.stop();
|
|
4492
4543
|
this.classList.remove("uc-recording");
|
|
4544
|
+
this.telemetryManager.sendEvent({
|
|
4545
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4546
|
+
payload: {
|
|
4547
|
+
metadata: {
|
|
4548
|
+
event: "stop-camera",
|
|
4549
|
+
node: this.tagName,
|
|
4550
|
+
tabId: this._activeTab
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
});
|
|
4493
4554
|
};
|
|
4494
4555
|
/** This method is used to toggle recording pause/resume */
|
|
4495
4556
|
_toggleRecording = () => {
|
|
@@ -4671,6 +4732,16 @@ var CameraSource = class extends UploaderBlock {
|
|
|
4671
4732
|
audioToggleMicrophoneHidden: !this.cfg.enableAudioRecording
|
|
4672
4733
|
});
|
|
4673
4734
|
}
|
|
4735
|
+
this.telemetryManager.sendEvent({
|
|
4736
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
4737
|
+
payload: {
|
|
4738
|
+
metadata: {
|
|
4739
|
+
event: "camera-tab-switch",
|
|
4740
|
+
node: this.tagName,
|
|
4741
|
+
tabId
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
});
|
|
4674
4745
|
this._activeTab = tabId;
|
|
4675
4746
|
};
|
|
4676
4747
|
_createFile = (type, ext, format, blob) => {
|
|
@@ -8235,8 +8306,12 @@ var COMPUTED_PROPERTIES = [
|
|
|
8235
8306
|
}
|
|
8236
8307
|
})
|
|
8237
8308
|
];
|
|
8238
|
-
var
|
|
8239
|
-
|
|
8309
|
+
var computeProperty = ({
|
|
8310
|
+
key,
|
|
8311
|
+
setValue,
|
|
8312
|
+
getValue,
|
|
8313
|
+
computationControllers
|
|
8314
|
+
}) => {
|
|
8240
8315
|
for (const computed of COMPUTED_PROPERTIES) {
|
|
8241
8316
|
if (computed.deps.includes(key)) {
|
|
8242
8317
|
const args = {
|
|
@@ -8246,16 +8321,16 @@ var computeProperty = ({ key, setValue, getValue }) => {
|
|
|
8246
8321
|
args[dep] = getValue(dep);
|
|
8247
8322
|
}
|
|
8248
8323
|
const abortController = new AbortController();
|
|
8249
|
-
|
|
8250
|
-
|
|
8324
|
+
computationControllers.get(computed.key)?.abort();
|
|
8325
|
+
computationControllers.set(computed.key, abortController);
|
|
8251
8326
|
let result;
|
|
8252
8327
|
try {
|
|
8253
8328
|
result = computed.fn(args, {
|
|
8254
8329
|
signal: abortController.signal
|
|
8255
8330
|
});
|
|
8256
8331
|
} catch (error) {
|
|
8257
|
-
if (
|
|
8258
|
-
|
|
8332
|
+
if (computationControllers.get(computed.key) === abortController) {
|
|
8333
|
+
computationControllers.delete(computed.key);
|
|
8259
8334
|
}
|
|
8260
8335
|
console.error(`Failed to compute value for "${computed.key}"`, error);
|
|
8261
8336
|
return;
|
|
@@ -8272,8 +8347,8 @@ var computeProperty = ({ key, setValue, getValue }) => {
|
|
|
8272
8347
|
}
|
|
8273
8348
|
console.error(`Failed to compute value for "${computed.key}"`, error);
|
|
8274
8349
|
}).finally(() => {
|
|
8275
|
-
if (
|
|
8276
|
-
|
|
8350
|
+
if (computationControllers.get(computed.key) === abortController) {
|
|
8351
|
+
computationControllers.delete(computed.key);
|
|
8277
8352
|
}
|
|
8278
8353
|
});
|
|
8279
8354
|
} else {
|
|
@@ -8476,7 +8551,8 @@ var Config = class extends Block {
|
|
|
8476
8551
|
...this.init$,
|
|
8477
8552
|
...Object.fromEntries(
|
|
8478
8553
|
Object.entries(initialConfig).map(([key, value]) => [sharedConfigKey(key), value])
|
|
8479
|
-
)
|
|
8554
|
+
),
|
|
8555
|
+
computationControllers: /* @__PURE__ */ new Map()
|
|
8480
8556
|
};
|
|
8481
8557
|
}
|
|
8482
8558
|
_flushValueToAttribute(key, value) {
|
|
@@ -8562,7 +8638,8 @@ var Config = class extends Block {
|
|
|
8562
8638
|
computeProperty({
|
|
8563
8639
|
key,
|
|
8564
8640
|
setValue: this._setValue.bind(this),
|
|
8565
|
-
getValue: this._getValue.bind(this)
|
|
8641
|
+
getValue: this._getValue.bind(this),
|
|
8642
|
+
computationControllers: this.computationControllers
|
|
8566
8643
|
});
|
|
8567
8644
|
});
|
|
8568
8645
|
}
|
|
@@ -8575,6 +8652,9 @@ var Config = class extends Block {
|
|
|
8575
8652
|
anyThis[key] = newVal;
|
|
8576
8653
|
}
|
|
8577
8654
|
}
|
|
8655
|
+
get computationControllers() {
|
|
8656
|
+
return this.$.computationControllers;
|
|
8657
|
+
}
|
|
8578
8658
|
};
|
|
8579
8659
|
Config.bindAttributes(attrStateMapping);
|
|
8580
8660
|
for (const key of allConfigKeys) {
|
|
@@ -9541,6 +9621,7 @@ var FileItem = class _FileItem extends FileItemConfig {
|
|
|
9541
9621
|
ariaLabelStatusFile: "",
|
|
9542
9622
|
onEdit: this._withEntry((entry) => {
|
|
9543
9623
|
this.telemetryManager.sendEvent({
|
|
9624
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
9544
9625
|
payload: {
|
|
9545
9626
|
metadata: {
|
|
9546
9627
|
event: "edit-file",
|
|
@@ -9556,6 +9637,7 @@ var FileItem = class _FileItem extends FileItemConfig {
|
|
|
9556
9637
|
}),
|
|
9557
9638
|
onRemove: () => {
|
|
9558
9639
|
this.telemetryManager.sendEvent({
|
|
9640
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
9559
9641
|
payload: {
|
|
9560
9642
|
metadata: {
|
|
9561
9643
|
event: "remove-file",
|
|
@@ -11265,6 +11347,15 @@ var UploadList = class extends UploaderBlock {
|
|
|
11265
11347
|
commonErrorMessage: "",
|
|
11266
11348
|
hasFiles: false,
|
|
11267
11349
|
onAdd: () => {
|
|
11350
|
+
this.telemetryManager.sendEvent({
|
|
11351
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
11352
|
+
payload: {
|
|
11353
|
+
metadata: {
|
|
11354
|
+
event: "add-more",
|
|
11355
|
+
node: this.tagName
|
|
11356
|
+
}
|
|
11357
|
+
}
|
|
11358
|
+
});
|
|
11268
11359
|
this.api.initFlow(true);
|
|
11269
11360
|
},
|
|
11270
11361
|
onUpload: () => {
|
|
@@ -11277,6 +11368,15 @@ var UploadList = class extends UploaderBlock {
|
|
|
11277
11368
|
this.api.doneFlow();
|
|
11278
11369
|
},
|
|
11279
11370
|
onCancel: () => {
|
|
11371
|
+
this.telemetryManager.sendEvent({
|
|
11372
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
11373
|
+
payload: {
|
|
11374
|
+
metadata: {
|
|
11375
|
+
event: "clear-all",
|
|
11376
|
+
node: this.tagName
|
|
11377
|
+
}
|
|
11378
|
+
}
|
|
11379
|
+
});
|
|
11280
11380
|
this.uploadCollection.clearAll();
|
|
11281
11381
|
}
|
|
11282
11382
|
};
|
|
@@ -11463,6 +11563,15 @@ var UrlSource = class extends UploaderBlock {
|
|
|
11463
11563
|
importDisabled: true,
|
|
11464
11564
|
onUpload: (event) => {
|
|
11465
11565
|
event.preventDefault();
|
|
11566
|
+
this.telemetryManager.sendEvent({
|
|
11567
|
+
eventType: InternalEventType.ACTION_EVENT,
|
|
11568
|
+
payload: {
|
|
11569
|
+
metadata: {
|
|
11570
|
+
event: "upload-from-url",
|
|
11571
|
+
node: this.tagName
|
|
11572
|
+
}
|
|
11573
|
+
}
|
|
11574
|
+
});
|
|
11466
11575
|
const url = this.ref.input["value"];
|
|
11467
11576
|
this.api.addFileFromUrl(url, { source: UploadSource.URL });
|
|
11468
11577
|
this.modalManager?.open(ActivityBlock.activities.UPLOAD_LIST);
|
|
@@ -11532,7 +11641,9 @@ var CloudImageEditor = class extends CloudImageEditorBlock {
|
|
|
11532
11641
|
}
|
|
11533
11642
|
initCallback() {
|
|
11534
11643
|
super.initCallback();
|
|
11535
|
-
this.
|
|
11644
|
+
this.telemetryManager.sendEvent({
|
|
11645
|
+
eventType: InternalEventType.INIT_SOLUTION
|
|
11646
|
+
});
|
|
11536
11647
|
this.a11y?.registerBlock(this);
|
|
11537
11648
|
}
|
|
11538
11649
|
};
|
|
@@ -11571,7 +11682,9 @@ var FileUploaderInline = class extends SolutionBlock {
|
|
|
11571
11682
|
}
|
|
11572
11683
|
initCallback() {
|
|
11573
11684
|
super.initCallback();
|
|
11574
|
-
this.
|
|
11685
|
+
this.telemetryManager.sendEvent({
|
|
11686
|
+
eventType: InternalEventType.INIT_SOLUTION
|
|
11687
|
+
});
|
|
11575
11688
|
const uBlock = this.ref.uBlock;
|
|
11576
11689
|
if (!uBlock) {
|
|
11577
11690
|
return;
|
|
@@ -11661,7 +11774,9 @@ var FileUploaderMinimal = class extends SolutionBlock {
|
|
|
11661
11774
|
}
|
|
11662
11775
|
initCallback() {
|
|
11663
11776
|
super.initCallback();
|
|
11664
|
-
this.
|
|
11777
|
+
this.telemetryManager.sendEvent({
|
|
11778
|
+
eventType: InternalEventType.INIT_SOLUTION
|
|
11779
|
+
});
|
|
11665
11780
|
const uBlock = this.ref.uBlock;
|
|
11666
11781
|
if (!uBlock) {
|
|
11667
11782
|
return;
|
|
@@ -11771,7 +11886,9 @@ var FileUploaderRegular = class extends SolutionBlock {
|
|
|
11771
11886
|
}
|
|
11772
11887
|
initCallback() {
|
|
11773
11888
|
super.initCallback();
|
|
11774
|
-
this.
|
|
11889
|
+
this.telemetryManager.sendEvent({
|
|
11890
|
+
eventType: InternalEventType.INIT_SOLUTION
|
|
11891
|
+
});
|
|
11775
11892
|
this.defineAccessor("headless", (value) => {
|
|
11776
11893
|
this.set$({ isHidden: asBoolean2(value) });
|
|
11777
11894
|
});
|
package/dist/index.ssr.js
CHANGED
|
@@ -1132,7 +1132,7 @@ export const ModalEvents = {
|
|
|
1132
1132
|
DESTROY: "modal:destroy",
|
|
1133
1133
|
};
|
|
1134
1134
|
export const PACKAGE_NAME = `blocks`;
|
|
1135
|
-
export const PACKAGE_VERSION = `1.24.
|
|
1135
|
+
export const PACKAGE_VERSION = `1.24.2`;
|
|
1136
1136
|
export const PresenceToggle = class {
|
|
1137
1137
|
static template = `<slot></slot> `;
|
|
1138
1138
|
static reg = () => {};
|
|
@@ -1461,8 +1461,6 @@ export const UploadCtxProvider = class {
|
|
|
1461
1461
|
COMMON_UPLOAD_FAILED: "common-upload-failed",
|
|
1462
1462
|
CHANGE: "change",
|
|
1463
1463
|
GROUP_CREATED: "group-created",
|
|
1464
|
-
INIT_SOLUTION: "init-solution",
|
|
1465
|
-
CHANGE_CONFIG: "change-config",
|
|
1466
1464
|
};
|
|
1467
1465
|
static extSrcList = {
|
|
1468
1466
|
FACEBOOK: "facebook",
|
package/package.json
CHANGED
|
@@ -102,12 +102,13 @@ declare class ModalManager {
|
|
|
102
102
|
destroy(): void;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
type CommonEventType = InternalEventKey | EventKey;
|
|
105
106
|
type TelemetryState = TelemetryRequest & {
|
|
106
107
|
eventTimestamp: number;
|
|
107
108
|
};
|
|
108
109
|
type TelemetryEventBody = Partial<Pick<TelemetryState, 'payload' | 'config'>> & {
|
|
109
110
|
modalId?: string;
|
|
110
|
-
eventType?:
|
|
111
|
+
eventType?: CommonEventType;
|
|
111
112
|
};
|
|
112
113
|
declare class TelemetryManager {
|
|
113
114
|
private readonly _sessionId;
|
|
@@ -179,9 +180,13 @@ declare class Block extends BaseComponent<any> {
|
|
|
179
180
|
static reg(name?: string): void;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
declare const
|
|
183
|
+
declare const InternalEventType: Readonly<{
|
|
183
184
|
readonly INIT_SOLUTION: "init-solution";
|
|
184
185
|
readonly CHANGE_CONFIG: "change-config";
|
|
186
|
+
readonly ACTION_EVENT: "action-event";
|
|
187
|
+
readonly ERROR_EVENT: "error-event";
|
|
188
|
+
}>;
|
|
189
|
+
declare const EventType: Readonly<{
|
|
185
190
|
readonly FILE_ADDED: "file-added";
|
|
186
191
|
readonly FILE_REMOVED: "file-removed";
|
|
187
192
|
readonly FILE_UPLOAD_START: "file-upload-start";
|
|
@@ -202,6 +207,7 @@ declare const EventType: Readonly<{
|
|
|
202
207
|
readonly GROUP_CREATED: "group-created";
|
|
203
208
|
}>;
|
|
204
209
|
type EventKey = (typeof EventType)[keyof typeof EventType];
|
|
210
|
+
type InternalEventKey = (typeof InternalEventType)[keyof typeof InternalEventType];
|
|
205
211
|
type EventPayload = {
|
|
206
212
|
[EventType.FILE_ADDED]: OutputFileEntry<'idle'>;
|
|
207
213
|
[EventType.FILE_REMOVED]: OutputFileEntry<'removed'>;
|
|
@@ -228,8 +234,6 @@ type EventPayload = {
|
|
|
228
234
|
[EventType.COMMON_UPLOAD_FAILED]: OutputCollectionState<'failed'>;
|
|
229
235
|
[EventType.CHANGE]: OutputCollectionState;
|
|
230
236
|
[EventType.GROUP_CREATED]: OutputCollectionState<'success', 'has-group'>;
|
|
231
|
-
[EventType.INIT_SOLUTION]: void;
|
|
232
|
-
[EventType.CHANGE_CONFIG]: void;
|
|
233
237
|
};
|
|
234
238
|
declare class EventEmitter {
|
|
235
239
|
private _timeoutStore;
|
|
@@ -525,6 +529,7 @@ declare class Config extends Block {
|
|
|
525
529
|
_assertSameValueDifferentReference(key: string, previousValue: unknown, nextValue: unknown): void;
|
|
526
530
|
initCallback(): void;
|
|
527
531
|
attributeChangedCallback(name: keyof typeof attrStateMapping, oldVal: string, newVal: string): void;
|
|
532
|
+
get computationControllers(): any;
|
|
528
533
|
}
|
|
529
534
|
interface Config extends ConfigType {
|
|
530
535
|
}
|
|
@@ -1970,8 +1975,6 @@ type EventListenerMap = {
|
|
|
1970
1975
|
declare class UploadCtxProvider extends UploaderBlock {
|
|
1971
1976
|
static styleAttrs: string[];
|
|
1972
1977
|
static EventType: Readonly<{
|
|
1973
|
-
readonly INIT_SOLUTION: "init-solution";
|
|
1974
|
-
readonly CHANGE_CONFIG: "change-config";
|
|
1975
1978
|
readonly FILE_ADDED: "file-added";
|
|
1976
1979
|
readonly FILE_REMOVED: "file-removed";
|
|
1977
1980
|
readonly FILE_UPLOAD_START: "file-upload-start";
|