@uploadcare/file-uploader 1.9.0 → 1.11.0-alpha.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/blocks/CameraSource/CameraSource.d.ts.map +1 -1
- package/blocks/CameraSource/CameraSource.js +0 -2
- package/blocks/CameraSource/camera-source.css +4 -15
- package/blocks/CloudImageEditorActivity/index.css +3 -3
- package/blocks/Config/initialConfig.d.ts +1 -1
- package/blocks/Config/initialConfig.d.ts.map +1 -1
- package/blocks/Config/initialConfig.js +1 -1
- package/blocks/ExternalSource/ExternalSource.d.ts +20 -50
- package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
- package/blocks/ExternalSource/ExternalSource.js +96 -99
- package/blocks/ExternalSource/MessageBridge.d.ts +20 -0
- package/blocks/ExternalSource/MessageBridge.d.ts.map +1 -0
- package/blocks/ExternalSource/MessageBridge.js +71 -0
- package/blocks/ExternalSource/buildThemeDefinition.d.ts +3 -0
- package/blocks/ExternalSource/buildThemeDefinition.d.ts.map +1 -0
- package/blocks/ExternalSource/buildThemeDefinition.js +47 -0
- package/blocks/ExternalSource/external-source.css +37 -22
- package/blocks/ExternalSource/types.d.ts +113 -0
- package/blocks/ExternalSource/types.d.ts.map +1 -0
- package/blocks/ExternalSource/types.js +143 -0
- package/blocks/Modal/Modal.d.ts.map +1 -1
- package/blocks/Modal/Modal.js +4 -11
- package/blocks/Modal/modal.css +3 -54
- package/blocks/StartFrom/start-from.css +2 -6
- package/blocks/UploadList/upload-list.css +1 -11
- package/blocks/UrlSource/url-source.css +0 -8
- package/blocks/themes/uc-basic/theme.css +3 -3
- package/index.ssr.d.ts.map +1 -1
- package/index.ssr.js +6 -10
- package/locales/file-uploader/en.d.ts +2 -0
- package/locales/file-uploader/en.js +3 -1
- package/package.json +4 -2
- package/web/file-uploader.iife.min.js +4 -4
- package/web/file-uploader.min.js +4 -4
- package/web/uc-basic.min.css +1 -1
- package/web/uc-cloud-image-editor.min.css +1 -1
- package/web/uc-cloud-image-editor.min.js +1 -1
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +4 -4
- package/web/uc-file-uploader-minimal.min.css +1 -1
- package/web/uc-file-uploader-minimal.min.js +2 -2
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +4 -4
- package/blocks/ExternalSource/buildStyles.d.ts +0 -27
- package/blocks/ExternalSource/buildStyles.d.ts.map +0 -1
- package/blocks/ExternalSource/buildStyles.js +0 -133
- package/blocks/ExternalSource/messages.d.ts +0 -3
- package/blocks/ExternalSource/messages.d.ts.map +0 -1
- package/blocks/ExternalSource/messages.js +0 -35
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {{
|
|
3
|
-
* textColor: string;
|
|
4
|
-
* backgroundColor: string;
|
|
5
|
-
* linkColor: string;
|
|
6
|
-
* linkColorHover: string;
|
|
7
|
-
* secondaryColor: string;
|
|
8
|
-
* secondaryHover: string;
|
|
9
|
-
* secondaryForegroundColor: string;
|
|
10
|
-
* fontFamily: string;
|
|
11
|
-
* fontSize: string;
|
|
12
|
-
* radius: string;
|
|
13
|
-
* }} options
|
|
14
|
-
*/
|
|
15
|
-
export function buildStyles({ textColor, backgroundColor, linkColor, linkColorHover, secondaryColor, secondaryHover, secondaryForegroundColor, fontFamily, fontSize, radius, }: {
|
|
16
|
-
textColor: string;
|
|
17
|
-
backgroundColor: string;
|
|
18
|
-
linkColor: string;
|
|
19
|
-
linkColorHover: string;
|
|
20
|
-
secondaryColor: string;
|
|
21
|
-
secondaryHover: string;
|
|
22
|
-
secondaryForegroundColor: string;
|
|
23
|
-
fontFamily: string;
|
|
24
|
-
fontSize: string;
|
|
25
|
-
radius: string;
|
|
26
|
-
}): string;
|
|
27
|
-
//# sourceMappingURL=buildStyles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildStyles.d.ts","sourceRoot":"","sources":["buildStyles.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;GAaG;AACH,gLAbW;IACV,SAAa,EAAE,MAAM,CAAC;IACtB,eAAmB,EAAE,MAAM,CAAC;IAC5B,SAAa,EAAE,MAAM,CAAC;IACtB,cAAkB,EAAE,MAAM,CAAC;IAC3B,cAAkB,EAAE,MAAM,CAAC;IAC3B,cAAkB,EAAE,MAAM,CAAC;IAC3B,wBAA4B,EAAE,MAAM,CAAC;IACrC,UAAc,EAAE,MAAM,CAAC;IACvB,QAAY,EAAE,MAAM,CAAC;IACrB,MAAU,EAAE,MAAM,CAAC;CAChB,UAsGH"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @param {Record<string, Record<string, string>>} style
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
const styleToCss = (style) => {
|
|
8
|
-
const css = Object.keys(style).reduce((acc, selector) => {
|
|
9
|
-
const propertiesObj = style[selector];
|
|
10
|
-
const propertiesStr = Object.keys(propertiesObj).reduce((acc, prop) => {
|
|
11
|
-
const value = propertiesObj[prop];
|
|
12
|
-
return acc + `${prop}: ${value};`;
|
|
13
|
-
}, '');
|
|
14
|
-
return acc + `${selector}{${propertiesStr}}`;
|
|
15
|
-
}, '');
|
|
16
|
-
return css;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {{
|
|
21
|
-
* textColor: string;
|
|
22
|
-
* backgroundColor: string;
|
|
23
|
-
* linkColor: string;
|
|
24
|
-
* linkColorHover: string;
|
|
25
|
-
* secondaryColor: string;
|
|
26
|
-
* secondaryHover: string;
|
|
27
|
-
* secondaryForegroundColor: string;
|
|
28
|
-
* fontFamily: string;
|
|
29
|
-
* fontSize: string;
|
|
30
|
-
* radius: string;
|
|
31
|
-
* }} options
|
|
32
|
-
*/
|
|
33
|
-
export function buildStyles({
|
|
34
|
-
textColor,
|
|
35
|
-
backgroundColor,
|
|
36
|
-
linkColor,
|
|
37
|
-
linkColorHover,
|
|
38
|
-
secondaryColor,
|
|
39
|
-
secondaryHover,
|
|
40
|
-
secondaryForegroundColor,
|
|
41
|
-
fontFamily,
|
|
42
|
-
fontSize,
|
|
43
|
-
radius,
|
|
44
|
-
}) {
|
|
45
|
-
const border = `solid 1px ${secondaryColor}`;
|
|
46
|
-
|
|
47
|
-
// TODO: we need to update source source styles, add css custom properties to control theme
|
|
48
|
-
return styleToCss({
|
|
49
|
-
body: {
|
|
50
|
-
color: textColor,
|
|
51
|
-
'background-color': backgroundColor,
|
|
52
|
-
'font-family': fontFamily,
|
|
53
|
-
'font-size': fontSize,
|
|
54
|
-
},
|
|
55
|
-
'.side-bar': {
|
|
56
|
-
background: 'inherit',
|
|
57
|
-
'border-right': border,
|
|
58
|
-
},
|
|
59
|
-
'.main-content': {
|
|
60
|
-
background: 'inherit',
|
|
61
|
-
},
|
|
62
|
-
'.main-content-header': {
|
|
63
|
-
background: 'inherit',
|
|
64
|
-
},
|
|
65
|
-
'.main-content-footer': {
|
|
66
|
-
background: 'inherit',
|
|
67
|
-
},
|
|
68
|
-
'.list-table-row': {
|
|
69
|
-
color: 'inherit',
|
|
70
|
-
},
|
|
71
|
-
'.list-table-row:hover': {
|
|
72
|
-
background: secondaryColor,
|
|
73
|
-
},
|
|
74
|
-
'.list-table-row .list-table-cell-a, .list-table-row .list-table-cell-b': {
|
|
75
|
-
'border-top': border,
|
|
76
|
-
},
|
|
77
|
-
'.list-table-body .list-items': {
|
|
78
|
-
'border-bottom': border,
|
|
79
|
-
},
|
|
80
|
-
'.bread-crumbs a': {
|
|
81
|
-
color: linkColor,
|
|
82
|
-
},
|
|
83
|
-
'.bread-crumbs a:hover': {
|
|
84
|
-
color: linkColorHover,
|
|
85
|
-
},
|
|
86
|
-
'.main-content.loading': {
|
|
87
|
-
background: `${backgroundColor} url(/static/images/loading_spinner.gif) center no-repeat`,
|
|
88
|
-
'background-size': '25px 25px',
|
|
89
|
-
},
|
|
90
|
-
'.list-icons-item': {
|
|
91
|
-
'background-color': secondaryColor,
|
|
92
|
-
},
|
|
93
|
-
'.source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a': {
|
|
94
|
-
color: linkColor,
|
|
95
|
-
},
|
|
96
|
-
'.source-gdrive .side-bar-menu a, .source-gphotos .side-bar-menu a:hover': {
|
|
97
|
-
color: linkColorHover,
|
|
98
|
-
},
|
|
99
|
-
'.side-bar-menu a': {
|
|
100
|
-
color: linkColor,
|
|
101
|
-
},
|
|
102
|
-
'.side-bar-menu a:hover': {
|
|
103
|
-
color: linkColorHover,
|
|
104
|
-
},
|
|
105
|
-
'.source-gdrive .side-bar-menu .current, .source-gdrive .side-bar-menu a:hover, .source-gphotos .side-bar-menu .current, .source-gphotos .side-bar-menu a:hover':
|
|
106
|
-
{
|
|
107
|
-
color: linkColorHover,
|
|
108
|
-
},
|
|
109
|
-
'.source-vk .side-bar-menu a': {
|
|
110
|
-
color: linkColor,
|
|
111
|
-
},
|
|
112
|
-
'.source-vk .side-bar-menu a:hover': {
|
|
113
|
-
color: linkColorHover,
|
|
114
|
-
background: 'none',
|
|
115
|
-
},
|
|
116
|
-
'input[type=submit], .button, button': {
|
|
117
|
-
color: secondaryForegroundColor,
|
|
118
|
-
background: secondaryColor,
|
|
119
|
-
'box-shadow': 'none',
|
|
120
|
-
border: 'none',
|
|
121
|
-
'border-radius': radius,
|
|
122
|
-
},
|
|
123
|
-
'input[type=submit]:hover, .button:hover, button:hover': {
|
|
124
|
-
background: secondaryHover,
|
|
125
|
-
},
|
|
126
|
-
'.text-field, input[type=search], input[type=text], input[type=url], textarea': {
|
|
127
|
-
color: secondaryForegroundColor,
|
|
128
|
-
'border-radius': radius,
|
|
129
|
-
background: secondaryColor,
|
|
130
|
-
border,
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["messages.js"],"names":[],"mappings":"AAoBA,6EAMC;AAED,gEAIC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
let cbMapping = {};
|
|
2
|
-
|
|
3
|
-
window.addEventListener('message', (e) => {
|
|
4
|
-
let message;
|
|
5
|
-
try {
|
|
6
|
-
message = JSON.parse(e.data);
|
|
7
|
-
} catch (err) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (message?.type in cbMapping) {
|
|
12
|
-
let cbList = cbMapping[message.type];
|
|
13
|
-
for (let [sender, callback] of cbList) {
|
|
14
|
-
if (e.source === sender) {
|
|
15
|
-
callback(message);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const registerMessage = function (type, sender, callback) {
|
|
22
|
-
if (!(type in cbMapping)) {
|
|
23
|
-
cbMapping[type] = [];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
cbMapping[type].push([sender, callback]);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const unregisterMessage = function (type, sender) {
|
|
30
|
-
if (type in cbMapping) {
|
|
31
|
-
cbMapping[type] = cbMapping[type].filter((item) => item[0] !== sender);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export { registerMessage, unregisterMessage };
|