@uploadcare/file-uploader 1.1.1 → 1.2.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/README.md +3 -3
- package/abstract/defineComponents.d.ts +5 -0
- package/abstract/defineComponents.d.ts.map +1 -0
- package/abstract/{registerBlocks.js → defineComponents.js} +1 -1
- package/abstract/loadFileUploaderFrom.d.ts +8 -0
- package/abstract/loadFileUploaderFrom.d.ts.map +1 -0
- package/abstract/{connectBlocksFrom.js → loadFileUploaderFrom.js} +4 -4
- package/blocks/CloudImageEditorActivity/test.js +1 -1
- package/env.d.ts +1 -1
- package/env.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/index.ssr.d.ts +3 -3
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +3 -3
- package/package.json +2 -2
- package/solutions/cloud-image-editor/index.d.ts +1 -1
- package/solutions/cloud-image-editor/index.js +1 -1
- package/solutions/file-uploader/minimal/index.d.ts +1 -1
- package/solutions/file-uploader/minimal/index.js +1 -1
- package/types/global.d.ts +1 -1
- package/web/{blocks.iife.min.js → file-uploader.iife.min.js} +4 -4
- package/web/{blocks.min.js → file-uploader.min.js} +1 -1
- package/web/uc-cloud-image-editor.min.js +1 -1
- package/web/uc-file-uploader-inline.min.js +1 -1
- package/web/uc-file-uploader-minimal.min.js +1 -1
- package/web/uc-file-uploader-regular.min.js +1 -1
- package/web/uc-img.min.js +1 -1
- package/abstract/connectBlocksFrom.d.ts +0 -8
- package/abstract/connectBlocksFrom.d.ts.map +0 -1
- package/abstract/registerBlocks.d.ts +0 -5
- package/abstract/registerBlocks.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -71,9 +71,9 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int
|
|
|
71
71
|
|
|
72
72
|
```html
|
|
73
73
|
<script type="module">
|
|
74
|
-
import * as UC from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/
|
|
74
|
+
import * as UC from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@1/web/file-uploader.min.js';
|
|
75
75
|
|
|
76
|
-
UC.
|
|
76
|
+
UC.defineComponents(UC);
|
|
77
77
|
</script>
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -98,7 +98,7 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int
|
|
|
98
98
|
```js
|
|
99
99
|
import * as UC from '@uploadcare/file-uploader';
|
|
100
100
|
|
|
101
|
-
UC.
|
|
101
|
+
UC.defineComponents(UC);
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
3. Start using Uploadcare File Uploader in your application markup:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineComponents.d.ts","sourceRoot":"","sources":["defineComponents.js"],"names":[],"mappings":"AAAA,gDAAgD;AAChD;QADmB,MAAM,GAAE,GAAG;SAoB7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @param {Object<string, any>} blockExports */
|
|
2
|
-
export function
|
|
2
|
+
export function defineComponents(blockExports) {
|
|
3
3
|
for (let blockName in blockExports) {
|
|
4
4
|
let tagName = [...blockName].reduce((name, char) => {
|
|
5
5
|
if (char.toUpperCase() === char) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {String} url File Uploader pack url
|
|
3
|
+
* @param {Boolean} [register] Register connected package, if it not registered yet
|
|
4
|
+
* @returns {Promise<import('../index.js')>}
|
|
5
|
+
*/
|
|
6
|
+
export function loadFileUploaderFrom(url: string, register?: boolean | undefined): Promise<typeof import("../index.js")>;
|
|
7
|
+
export const UC_WINDOW_KEY: "UC";
|
|
8
|
+
//# sourceMappingURL=loadFileUploaderFrom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadFileUploaderFrom.d.ts","sourceRoot":"","sources":["loadFileUploaderFrom.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,mFAFa,qCAA8B,CA0B1C;AA/BD,iCAAkC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponents } from './defineComponents.js';
|
|
2
2
|
|
|
3
3
|
export const UC_WINDOW_KEY = 'UC';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @param {String} url
|
|
6
|
+
* @param {String} url File Uploader pack url
|
|
7
7
|
* @param {Boolean} [register] Register connected package, if it not registered yet
|
|
8
8
|
* @returns {Promise<import('../index.js')>}
|
|
9
9
|
*/
|
|
10
|
-
export async function
|
|
10
|
+
export async function loadFileUploaderFrom(url, register = false) {
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
12
|
if (typeof document !== 'object') {
|
|
13
13
|
resolve(null);
|
|
@@ -26,7 +26,7 @@ export async function connectBlocksFrom(url, register = false) {
|
|
|
26
26
|
script.onload = () => {
|
|
27
27
|
/** @type {import('../index.js')} */
|
|
28
28
|
let blocks = window[UC_WINDOW_KEY];
|
|
29
|
-
register &&
|
|
29
|
+
register && defineComponents(blocks);
|
|
30
30
|
resolve(blocks);
|
|
31
31
|
};
|
|
32
32
|
document.head.appendChild(script);
|
|
@@ -2,7 +2,7 @@ import { ifRef } from '../../utils/ifRef.js';
|
|
|
2
2
|
import * as blocks from '../../index.js';
|
|
3
3
|
|
|
4
4
|
ifRef(() => {
|
|
5
|
-
blocks.
|
|
5
|
+
blocks.defineComponents(blocks);
|
|
6
6
|
document.querySelector(blocks.CloudImageEditorBlock.is)?.addEventListener('apply', (e) => {
|
|
7
7
|
console.log(e);
|
|
8
8
|
});
|
package/env.d.ts
CHANGED
package/env.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ export { FileUploaderRegular } from "./solutions/file-uploader/regular/FileUploa
|
|
|
31
31
|
export { FileUploaderMinimal } from "./solutions/file-uploader/minimal/FileUploaderMinimal.js";
|
|
32
32
|
export { FileUploaderInline } from "./solutions/file-uploader/inline/FileUploaderInline.js";
|
|
33
33
|
export { CloudImageEditor } from "./solutions/cloud-image-editor/CloudImageEditor.js";
|
|
34
|
-
export {
|
|
34
|
+
export { defineComponents } from "./abstract/defineComponents.js";
|
|
35
35
|
export { defineLocale } from "./abstract/localeRegistry.js";
|
|
36
|
-
export {
|
|
36
|
+
export { loadFileUploaderFrom } from "./abstract/loadFileUploaderFrom.js";
|
|
37
37
|
export { toKebabCase } from "./utils/toKebabCase.js";
|
|
38
38
|
export { BaseComponent, Data, UID } from "@symbiotejs/symbiote";
|
|
39
39
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -40,9 +40,9 @@ export { FileUploaderInline } from './solutions/file-uploader/inline/FileUploade
|
|
|
40
40
|
export { CloudImageEditor } from './solutions/cloud-image-editor/CloudImageEditor.js';
|
|
41
41
|
|
|
42
42
|
// Utils:
|
|
43
|
-
export {
|
|
43
|
+
export { defineComponents } from './abstract/defineComponents.js';
|
|
44
44
|
export { defineLocale } from './abstract/localeRegistry.js';
|
|
45
|
-
export {
|
|
45
|
+
export { loadFileUploaderFrom } from './abstract/loadFileUploaderFrom.js';
|
|
46
46
|
export { toKebabCase } from './utils/toKebabCase.js';
|
|
47
47
|
|
|
48
48
|
export * from './env.js';
|
package/index.ssr.d.ts
CHANGED
|
@@ -520,7 +520,7 @@ export const Modal: {
|
|
|
520
520
|
bindAttributes: () => void;
|
|
521
521
|
};
|
|
522
522
|
export const PACKAGE_NAME: "blocks";
|
|
523
|
-
export const PACKAGE_VERSION: "1.
|
|
523
|
+
export const PACKAGE_VERSION: "1.2.0";
|
|
524
524
|
export const PresenceToggle: {
|
|
525
525
|
new (): {};
|
|
526
526
|
template: string;
|
|
@@ -954,8 +954,8 @@ export const UrlSource: {
|
|
|
954
954
|
is: string;
|
|
955
955
|
bindAttributes: () => void;
|
|
956
956
|
};
|
|
957
|
-
export function
|
|
957
|
+
export function defineComponents(): void;
|
|
958
958
|
export function defineLocale(): void;
|
|
959
|
-
export function
|
|
959
|
+
export function loadFileUploaderFrom(): void;
|
|
960
960
|
export function toKebabCase(): void;
|
|
961
961
|
//# sourceMappingURL=index.ssr.d.ts.map
|
package/index.ssr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ssr.d.ts","sourceRoot":"","sources":["index.ssr.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;EAIE;AACF;;;;;;EAKE;AACF;;;;;;;;EAYE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFE;AACF;;;;;;;;EAuCE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CE;AACF;;;;;;;;EAuCE;AACF;;;;;;;EA0FE;AACF;;;;;;;EAaE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEE;AACF;;;;;;;EAWE;AACF;;;;;;;EAWE;AACF;;;;;;;EASE;AACF;;;;;;EAKE;AACF;;;;;;;EAWE;AACF;;;;;;;EAME;AACF;;;;;;;EAWE;AACF;;;;;;;EA0IE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CE;AACF;;;;;;;;EAYE;AACF;;;;;;EAwBE;AACF;;;;;;;EAUE;AACF;;;;;;;;EAWE;AACF,oCAAqC;AACrC,sCAAuC;AACvC;;;;;;;EAME;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFE;AACF;;;;;;EAKE;AACF;;;;;;EAKE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CE;AACF;;;;;;;;EAYE;AACF;;;;;;EAwBE;AACF;;;;;;;EAUE;AACF;;;;;;;;EAWE;AACF,oCAAqC;AACrC,sCAAuC;AACvC;;;;;;;EAME;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CE;AACF;;;;;;;EAME;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDE;AACF;;;;;;;EAeE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDE;AACF;;;;;;EAKE;AACF;;;;;;;;;;;;;;;;;EAgBE;AACF;;;;;;;;;;;;EAWE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuFE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoEE;AACK,yCAAiC;AACjC,qCAA6B;AAC7B,6CAAqC;AACrC,oCAA4B"}
|
package/index.ssr.js
CHANGED
|
@@ -950,7 +950,7 @@ export const Modal = class {
|
|
|
950
950
|
static bindAttributes = () => {};
|
|
951
951
|
};
|
|
952
952
|
export const PACKAGE_NAME = `blocks`;
|
|
953
|
-
export const PACKAGE_VERSION = `1.
|
|
953
|
+
export const PACKAGE_VERSION = `1.2.0`;
|
|
954
954
|
export const PresenceToggle = class {
|
|
955
955
|
static template = `<slot></slot> `;
|
|
956
956
|
static reg = () => {};
|
|
@@ -1455,7 +1455,7 @@ export const UrlSource = class {
|
|
|
1455
1455
|
static is = `sym-1`;
|
|
1456
1456
|
static bindAttributes = () => {};
|
|
1457
1457
|
};
|
|
1458
|
-
export const
|
|
1458
|
+
export const defineComponents = () => {};
|
|
1459
1459
|
export const defineLocale = () => {};
|
|
1460
|
-
export const
|
|
1460
|
+
export const loadFileUploaderFrom = () => {};
|
|
1461
1461
|
export const toKebabCase = () => {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/file-uploader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Building blocks for Uploadcare products integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web components",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"browser": "./index.js",
|
|
44
44
|
"default": "./index.js"
|
|
45
45
|
},
|
|
46
|
-
"./abstract/
|
|
46
|
+
"./abstract/loadFileUploaderFrom.js": "./abstract/loadFileUploaderFrom.js",
|
|
47
47
|
"./env": "./env.js",
|
|
48
48
|
"./web/*": "./web/*",
|
|
49
49
|
"./types/*": "./types/*",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "../../blocks/CloudImageEditor/index.js";
|
|
2
2
|
export * from "./CloudImageEditor.js";
|
|
3
3
|
export { Icon } from "../../blocks/Icon/Icon.js";
|
|
4
|
-
export {
|
|
4
|
+
export { defineComponents } from "../../abstract/defineComponents.js";
|
|
5
5
|
export { Config } from "../../blocks/Config/Config.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,5 +7,5 @@ Then we can check whether the dependent tag is registered in the CustomElementRe
|
|
|
7
7
|
If not, register it from default ones or just log the warning */
|
|
8
8
|
|
|
9
9
|
export { Icon } from '../../blocks/Icon/Icon.js';
|
|
10
|
-
export {
|
|
10
|
+
export { defineComponents } from '../../abstract/defineComponents.js';
|
|
11
11
|
export { Config } from '../../blocks/Config/Config.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { defineComponents } from "../../../abstract/defineComponents.js";
|
|
2
2
|
export { defineLocale } from "../../../abstract/localeRegistry.js";
|
|
3
3
|
export { FileUploaderMinimal } from "./FileUploaderMinimal.js";
|
|
4
4
|
export { StartFrom } from "../../../blocks/StartFrom/StartFrom.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { defineComponents } from '../../../abstract/defineComponents.js';
|
|
2
2
|
export { defineLocale } from '../../../abstract/localeRegistry.js';
|
|
3
3
|
export { FileUploaderMinimal } from './FileUploaderMinimal.js';
|
|
4
4
|
export { StartFrom } from '../../../blocks/StartFrom/StartFrom.js';
|
package/types/global.d.ts
CHANGED