@useupup/vanilla 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/chunk-KDBNQMVZ.js +4416 -0
- package/dist/chunk-ZIGB2IKB.cjs +4418 -0
- package/dist/element.cjs +74 -0
- package/dist/element.d.cts +20 -0
- package/dist/element.d.ts +20 -0
- package/dist/element.js +72 -0
- package/dist/index.cjs +23 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +2 -0
- package/dist/styles.d.ts +4 -0
- package/dist/tailwind-prefixed.css +2464 -0
- package/dist/types-412b3393.d.cts +336 -0
- package/dist/types-412b3393.d.ts +336 -0
- package/package.json +102 -0
package/dist/element.cjs
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkZIGB2IKB_cjs = require('./chunk-ZIGB2IKB.cjs');
|
|
4
|
+
|
|
5
|
+
// src/element.ts
|
|
6
|
+
var FORWARDED_EVENTS = [
|
|
7
|
+
["files-added", "upup:files-added"],
|
|
8
|
+
["file-removed", "upup:file-removed"],
|
|
9
|
+
["upload-progress", "upup:upload-progress"],
|
|
10
|
+
["upload-all-complete", "upup:upload-complete"],
|
|
11
|
+
// The public `upup:error` DOM event now sources the single upload-failure channel
|
|
12
|
+
// (upload-error), so it fires for every upload failure — not the resume-only path.
|
|
13
|
+
["upload-error", "upup:error"]
|
|
14
|
+
];
|
|
15
|
+
var UpupUploaderElement = class extends HTMLElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this._instance = null;
|
|
19
|
+
this._config = {};
|
|
20
|
+
this.forwardUnsubs = [];
|
|
21
|
+
}
|
|
22
|
+
/** Read-only access to the underlying imperative instance (null while disconnected). */
|
|
23
|
+
get instance() {
|
|
24
|
+
return this._instance;
|
|
25
|
+
}
|
|
26
|
+
set config(value) {
|
|
27
|
+
this._config = value != null ? value : {};
|
|
28
|
+
if (this.isConnected) this.remount();
|
|
29
|
+
}
|
|
30
|
+
get config() {
|
|
31
|
+
return this._config;
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
this.mount();
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
this.unmount();
|
|
38
|
+
}
|
|
39
|
+
mount() {
|
|
40
|
+
if (this._instance) return;
|
|
41
|
+
this._instance = chunkZIGB2IKB_cjs.createUploader(this, this._config);
|
|
42
|
+
for (const [coreEvent, domEvent] of FORWARDED_EVENTS) {
|
|
43
|
+
this.forwardUnsubs.push(
|
|
44
|
+
this._instance.on(coreEvent, (...args) => {
|
|
45
|
+
this.dispatchEvent(
|
|
46
|
+
new CustomEvent(domEvent, {
|
|
47
|
+
detail: args.length === 1 ? args[0] : args,
|
|
48
|
+
bubbles: true,
|
|
49
|
+
composed: true
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
unmount() {
|
|
57
|
+
var _a;
|
|
58
|
+
this.forwardUnsubs.forEach((u) => {
|
|
59
|
+
u();
|
|
60
|
+
});
|
|
61
|
+
this.forwardUnsubs = [];
|
|
62
|
+
(_a = this._instance) == null ? void 0 : _a.destroy();
|
|
63
|
+
this._instance = null;
|
|
64
|
+
}
|
|
65
|
+
remount() {
|
|
66
|
+
this.unmount();
|
|
67
|
+
this.mount();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
if (typeof customElements !== "undefined" && !customElements.get("upup-uploader")) {
|
|
71
|
+
customElements.define("upup-uploader", UpupUploaderElement);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.UpupUploaderElement = UpupUploaderElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { U as UpupInstance, C as CreateUploaderOptions } from './types-412b3393.cjs';
|
|
2
|
+
import '@useupup/core';
|
|
3
|
+
import '@useupup/core/internal';
|
|
4
|
+
|
|
5
|
+
declare class UpupUploaderElement extends HTMLElement {
|
|
6
|
+
private _instance;
|
|
7
|
+
private _config;
|
|
8
|
+
private forwardUnsubs;
|
|
9
|
+
/** Read-only access to the underlying imperative instance (null while disconnected). */
|
|
10
|
+
get instance(): UpupInstance | null;
|
|
11
|
+
set config(value: CreateUploaderOptions | null | undefined);
|
|
12
|
+
get config(): CreateUploaderOptions;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private mount;
|
|
16
|
+
private unmount;
|
|
17
|
+
private remount;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { UpupUploaderElement };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { U as UpupInstance, C as CreateUploaderOptions } from './types-412b3393.js';
|
|
2
|
+
import '@useupup/core';
|
|
3
|
+
import '@useupup/core/internal';
|
|
4
|
+
|
|
5
|
+
declare class UpupUploaderElement extends HTMLElement {
|
|
6
|
+
private _instance;
|
|
7
|
+
private _config;
|
|
8
|
+
private forwardUnsubs;
|
|
9
|
+
/** Read-only access to the underlying imperative instance (null while disconnected). */
|
|
10
|
+
get instance(): UpupInstance | null;
|
|
11
|
+
set config(value: CreateUploaderOptions | null | undefined);
|
|
12
|
+
get config(): CreateUploaderOptions;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private mount;
|
|
16
|
+
private unmount;
|
|
17
|
+
private remount;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { UpupUploaderElement };
|
package/dist/element.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createUploader } from './chunk-KDBNQMVZ.js';
|
|
2
|
+
|
|
3
|
+
// src/element.ts
|
|
4
|
+
var FORWARDED_EVENTS = [
|
|
5
|
+
["files-added", "upup:files-added"],
|
|
6
|
+
["file-removed", "upup:file-removed"],
|
|
7
|
+
["upload-progress", "upup:upload-progress"],
|
|
8
|
+
["upload-all-complete", "upup:upload-complete"],
|
|
9
|
+
// The public `upup:error` DOM event now sources the single upload-failure channel
|
|
10
|
+
// (upload-error), so it fires for every upload failure — not the resume-only path.
|
|
11
|
+
["upload-error", "upup:error"]
|
|
12
|
+
];
|
|
13
|
+
var UpupUploaderElement = class extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this._instance = null;
|
|
17
|
+
this._config = {};
|
|
18
|
+
this.forwardUnsubs = [];
|
|
19
|
+
}
|
|
20
|
+
/** Read-only access to the underlying imperative instance (null while disconnected). */
|
|
21
|
+
get instance() {
|
|
22
|
+
return this._instance;
|
|
23
|
+
}
|
|
24
|
+
set config(value) {
|
|
25
|
+
this._config = value != null ? value : {};
|
|
26
|
+
if (this.isConnected) this.remount();
|
|
27
|
+
}
|
|
28
|
+
get config() {
|
|
29
|
+
return this._config;
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
this.mount();
|
|
33
|
+
}
|
|
34
|
+
disconnectedCallback() {
|
|
35
|
+
this.unmount();
|
|
36
|
+
}
|
|
37
|
+
mount() {
|
|
38
|
+
if (this._instance) return;
|
|
39
|
+
this._instance = createUploader(this, this._config);
|
|
40
|
+
for (const [coreEvent, domEvent] of FORWARDED_EVENTS) {
|
|
41
|
+
this.forwardUnsubs.push(
|
|
42
|
+
this._instance.on(coreEvent, (...args) => {
|
|
43
|
+
this.dispatchEvent(
|
|
44
|
+
new CustomEvent(domEvent, {
|
|
45
|
+
detail: args.length === 1 ? args[0] : args,
|
|
46
|
+
bubbles: true,
|
|
47
|
+
composed: true
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
unmount() {
|
|
55
|
+
var _a;
|
|
56
|
+
this.forwardUnsubs.forEach((u) => {
|
|
57
|
+
u();
|
|
58
|
+
});
|
|
59
|
+
this.forwardUnsubs = [];
|
|
60
|
+
(_a = this._instance) == null ? void 0 : _a.destroy();
|
|
61
|
+
this._instance = null;
|
|
62
|
+
}
|
|
63
|
+
remount() {
|
|
64
|
+
this.unmount();
|
|
65
|
+
this.mount();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (typeof customElements !== "undefined" && !customElements.get("upup-uploader")) {
|
|
69
|
+
customElements.define("upup-uploader", UpupUploaderElement);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { UpupUploaderElement };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkZIGB2IKB_cjs = require('./chunk-ZIGB2IKB.cjs');
|
|
4
|
+
var core = require('@useupup/core');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, 'createUploader', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkZIGB2IKB_cjs.createUploader; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'FileSource', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return core.FileSource; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, 'StorageProvider', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return core.StorageProvider; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, 'UploadStatus', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return core.UploadStatus; }
|
|
23
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { C as CreateUploaderOptions, U as UpupInstance } from './types-412b3393.cjs';
|
|
2
|
+
export { b as UploaderContext, a as UploaderSnapshot } from './types-412b3393.cjs';
|
|
3
|
+
export { CoreOptions, FileSource, ImageEditorOptions, ResolvedImageEditorOptions, StorageProvider, UploadFile, UploadProvider, UploadSource, UploadStatus } from '@useupup/core';
|
|
4
|
+
import '@useupup/core/internal';
|
|
5
|
+
|
|
6
|
+
declare function createUploader(target: string | HTMLElement, options?: CreateUploaderOptions): UpupInstance;
|
|
7
|
+
|
|
8
|
+
export { CreateUploaderOptions, UpupInstance, createUploader };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { C as CreateUploaderOptions, U as UpupInstance } from './types-412b3393.js';
|
|
2
|
+
export { b as UploaderContext, a as UploaderSnapshot } from './types-412b3393.js';
|
|
3
|
+
export { CoreOptions, FileSource, ImageEditorOptions, ResolvedImageEditorOptions, StorageProvider, UploadFile, UploadProvider, UploadSource, UploadStatus } from '@useupup/core';
|
|
4
|
+
import '@useupup/core/internal';
|
|
5
|
+
|
|
6
|
+
declare function createUploader(target: string | HTMLElement, options?: CreateUploaderOptions): UpupInstance;
|
|
7
|
+
|
|
8
|
+
export { CreateUploaderOptions, UpupInstance, createUploader };
|
package/dist/index.js
ADDED
package/dist/styles.d.ts
ADDED