@uploadcare/file-uploader 1.6.0 → 1.8.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 +37 -62
- package/blocks/CloudImageEditor/src/CropFrame.d.ts +16 -11
- package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/CropFrame.js +42 -34
- package/blocks/CloudImageEditor/src/css/common.css +33 -9
- package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +1 -1
- package/blocks/CloudImageEditor/src/types.d.ts +56 -0
- package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
- package/blocks/CloudImageEditor/src/types.js +11 -0
- package/blocks/DropArea/drop-area.css +22 -11
- package/blocks/FileItem/file-item.css +5 -1
- package/blocks/Modal/modal.css +4 -0
- package/blocks/SourceBtn/source-btn.css +9 -1
- package/blocks/themes/uc-basic/common.css +4 -0
- package/blocks/themes/uc-basic/theme.css +27 -10
- package/env.d.ts +1 -1
- package/env.js +1 -1
- package/index.ssr.d.ts +1 -1
- package/index.ssr.js +1 -1
- package/package.json +2 -1
- package/solutions/file-uploader/minimal/index.css +4 -0
- package/web/file-uploader.iife.min.js +2 -2
- package/web/file-uploader.min.js +1 -1
- 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 +4 -4
- package/web/uc-file-uploader-inline.min.css +1 -1
- package/web/uc-file-uploader-inline.min.js +1 -1
- package/web/uc-file-uploader-minimal.min.css +1 -1
- package/web/uc-file-uploader-minimal.min.js +1 -1
- package/web/uc-file-uploader-regular.min.css +1 -1
- package/web/uc-file-uploader-regular.min.js +1 -1
- package/web/uc-img.min.js +1 -1
package/README.md
CHANGED
|
@@ -8,66 +8,57 @@
|
|
|
8
8
|
</a>
|
|
9
9
|
</p>
|
|
10
10
|
<p align="center">
|
|
11
|
-
<a href="https://uploadcare.com
|
|
12
|
-
<a href="https://uploadcare.com/docs/
|
|
13
|
-
<a href="https://uploadcare.com/docs?ref=github-readme">Docs</a> •
|
|
11
|
+
<a href="https://uploadcare.com/?ref=github-readme">Website</a> •
|
|
12
|
+
<a href="https://uploadcare.com/docs/file-uploader?ref=github-readme">Docs</a> •
|
|
14
13
|
<a href="https://uploadcare.com/blog?ref=github-readme">Blog</a> •
|
|
15
14
|
<a href="https://discord.gg/mKWRgRsVz8?ref=github-readme">Discord</a> •
|
|
16
15
|
<a href="https://twitter.com/Uploadcare?ref=github-readme">Twitter</a>
|
|
17
16
|
</p>
|
|
18
17
|
|
|
19
|
-
#
|
|
18
|
+
# Uploadcare File Uploader
|
|
20
19
|
|
|
21
20
|
[](https://www.npmjs.com/package/@uploadcare/file-uploader)
|
|
22
21
|
[](https://github.com/uploadcare/blocks/actions?query=workflow%3ABuild+branch%3Amaster)
|
|
23
22
|
[](https://opensource.org/licenses/MIT)
|
|
23
|
+
[](https://bundlephobia.com/package/@uploadcare/file-uploader@latest)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
It includes various interactive and customizable UI components to enhance users' file uploading
|
|
27
|
-
and processing experience. As a bonus, you receive all the
|
|
28
|
-
[Uploadcare's](https://uploadcare.com/?ref=github-readme) versatile file-handling capabilities,
|
|
29
|
-
including [smart CDN](https://uploadcare.com/docs/delivery/cdn/#content-delivery-network/?ref=github-readme),
|
|
30
|
-
[MIME-type filtering](https://uploadcare.com/docs/moderation/#file-types/?ref=github-readme),
|
|
31
|
-
[signed uploads](https://uploadcare.com/docs/security/secure-uploads/?ref=github-readme),
|
|
32
|
-
and [even more](<(https://uploadcare.com/features/?ref=github-readme)>).
|
|
25
|
+
Add file uploads to your app and configure behavior and appearance as needed. Process and transform files before and after uploading. Compatible with any framework or environment.
|
|
33
26
|
|
|
34
|
-
|
|
27
|
+
<img alt="Uploadcare File Uploader examples" src="https://ucarecdn.com/916a1054-ca44-4c4a-9f7b-99fa499043d9/-/preview/">
|
|
35
28
|
|
|
36
|
-
|
|
29
|
+
## Features
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
- **Multiple upload sources:** Drop files, select from the filesystem, use a link, camera, Dropbox, Google Drive, add them via the upload API, and more.
|
|
32
|
+
- **Large file handling:** Upload faster with chunking, retries, and resumable uploads.
|
|
33
|
+
- **Customizable appearance:** Use pre-built themes or modify styles with CSS to fit your project.
|
|
34
|
+
- **Responsive and cross-browser:** Fits any device; supports the latest desktop and mobile versions of Chrome, Edge, Firefox, Opera, and Safari.
|
|
35
|
+
- **Fully accessible:** A11Y options, including keyboard navigation, screen reader support, and color contrast settings.
|
|
36
|
+
- **Advanced image editing:** Optimize images and apply smart transformations like cropping, resizing, or color filters via the built-in image editor, REST, or URL API.
|
|
37
|
+
- **Secure uploads:** Protect your app by automatically detecting inappropriate content, malicious files, or unauthorized uploads.
|
|
38
|
+
- **Typescript support:** Full Typescript support with autocompletion, type checking, and more for a better developer experience.
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
<!-- - [Advanced Customization](/blocks/) — create unique file-uploading interfaces by reorganizing pre-built components and styles with custom based on your needs. -->
|
|
42
|
-
- [Adaptive Images](https://uploadcare.com/docs/adaptive-image/?ref=github-readme) — build responsive user interfaces that adapt to various screen sizes and devices, ensuring a performant experience across platforms.
|
|
43
|
-
- [Cloud Image Editor](https://uploadcare.com/docs/file-uploader/image-editor/?ref=github-readme) — edit, transform, and process images right from a browser on-the-fly.
|
|
44
|
-
- [Uploadcare power and features](https://uploadcare.com/features/?ref=github-readme) — upload, process, deliver, and manage images without building custom infrastructure.
|
|
45
|
-
|
|
46
|
-
* **Coming soon!** Web Components for any media content management like audio, video, image galleries, and more.
|
|
47
|
-
|
|
48
|
-
## Why Uploadcare File Uploader?
|
|
49
|
-
|
|
50
|
-
### Rapid integration
|
|
51
|
-
|
|
52
|
-
We provide a ready-to-use set of UI components for file handling. It saves you valuable development time and effort, allowing you to focus on other core aspects of your application. You even don't need to build a stage while developing — just run the code directly from the browser.
|
|
53
|
-
|
|
54
|
-
### Cross-platform compatibility
|
|
40
|
+
## Framework support
|
|
55
41
|
|
|
56
|
-
Uploadcare File Uploader
|
|
42
|
+
Uploadcare File Uploader is built with [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), meaning you can integrate it into any environment—no adapters required.
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
For hands-on examples, visit our live sandboxes:
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
- [React](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/react-uploader)
|
|
47
|
+
- [Next.js](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/next-uploader)
|
|
48
|
+
- [JavaScript](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/js-uploader)
|
|
49
|
+
- [Angular](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/angular-uploader)
|
|
50
|
+
- [Vue](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/vue-uploader)
|
|
51
|
+
- [Svelte](https://github.com/uploadcare/file-uploader-examples/tree/main/examples/svelte-uploader)
|
|
61
52
|
|
|
62
|
-
|
|
53
|
+
Check out the [documentation](https://uploadcare.com/docs/integrations/?ref=github-readme) for quickstart guides tailored to your framework or tool.
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
Explore more tutorials in our [blog](https://uploadcare.com/blog/category/uploading/?ref=github-readme).
|
|
65
56
|
|
|
66
|
-
##
|
|
57
|
+
## Quick Start
|
|
67
58
|
|
|
68
59
|
### From CDN
|
|
69
60
|
|
|
70
|
-
1. Connect
|
|
61
|
+
1. Connect File Uploader directly from your document:
|
|
71
62
|
|
|
72
63
|
```html
|
|
73
64
|
<script type="module">
|
|
@@ -77,7 +68,7 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int
|
|
|
77
68
|
</script>
|
|
78
69
|
```
|
|
79
70
|
|
|
80
|
-
2.
|
|
71
|
+
2. Add File Uploader in your application markup:
|
|
81
72
|
|
|
82
73
|
```html
|
|
83
74
|
<link
|
|
@@ -88,12 +79,12 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int
|
|
|
88
79
|
<uc-file-uploader-regular ctx-name="my-uploader"> </uc-file-uploader-regular>
|
|
89
80
|
```
|
|
90
81
|
|
|
91
|
-
3. Configure
|
|
82
|
+
3. Configure File Uploader and add your personal public key to the project. [Learn more](#configuration).
|
|
92
83
|
|
|
93
84
|
### From NPM
|
|
94
85
|
|
|
95
|
-
1. Install
|
|
96
|
-
2. Connect
|
|
86
|
+
1. Install the package: `npm i @uploadcare/file-uploader`
|
|
87
|
+
2. Connect File Uploader from your script file:
|
|
97
88
|
|
|
98
89
|
```js
|
|
99
90
|
import * as UC from '@uploadcare/file-uploader';
|
|
@@ -101,7 +92,7 @@ import * as UC from '@uploadcare/file-uploader';
|
|
|
101
92
|
UC.defineComponents(UC);
|
|
102
93
|
```
|
|
103
94
|
|
|
104
|
-
3.
|
|
95
|
+
3. Add File Uploader in your application markup:
|
|
105
96
|
|
|
106
97
|
```html
|
|
107
98
|
<link
|
|
@@ -112,11 +103,11 @@ UC.defineComponents(UC);
|
|
|
112
103
|
<uc-file-uploader-inline ctx-name="my-uploader"> </uc-file-uploader-inline>
|
|
113
104
|
```
|
|
114
105
|
|
|
115
|
-
4. Configure
|
|
106
|
+
4. Configure File Uploader and add your personal public key to the project. [Learn more](#configuration).
|
|
116
107
|
|
|
117
108
|
### Configuration
|
|
118
109
|
|
|
119
|
-
All configurations in
|
|
110
|
+
All configurations in File Uploader are managed from `uc-config` block.
|
|
120
111
|
|
|
121
112
|
1. Sign up to [Uploadcare](https://app.uploadcare.com/accounts/signup/?ref=github-readme).
|
|
122
113
|
2. Get a Public API key in [Uploadcare project's dashboard](https://app.uploadcare.com/projects/-/api-keys/?ref=github-readme).
|
|
@@ -126,13 +117,9 @@ All configurations in Uploadcare File Uploader are managed from `uc-config` bloc
|
|
|
126
117
|
<uc-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY"></uc-config>
|
|
127
118
|
```
|
|
128
119
|
|
|
129
|
-
4. Make sure that your config
|
|
130
|
-
|
|
131
|
-
Discover more about Uploadcare File Uploader configuration in [our documentation](https://uploadcare.com/docs/file-uploader/configuration/?ref=github-readme).
|
|
120
|
+
4. Make sure that your config uses the same `ctx-name` attribute value as your solution block.
|
|
132
121
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Follow our [step-by-step installation guide](https://uploadcare.com/docs/file-uploader/installation/?ref=github-readme) to launch Uploadcare File Uploader in a few minutes and set it up based on your needs.
|
|
122
|
+
Discover more about configuration options in [our documentation](https://uploadcare.com/docs/file-uploader/configuration/?ref=github-readme).
|
|
136
123
|
|
|
137
124
|
## Browser support
|
|
138
125
|
|
|
@@ -140,18 +127,6 @@ Latest desktop and mobile stable versions of Chrome, Edge, Firefox, Opera, and S
|
|
|
140
127
|
|
|
141
128
|
Internet Explorer is outdated and [not supported anymore](https://uploadcare.com/blog/uploadcare-stops-internet-explorer-support/?ref=github-readme).
|
|
142
129
|
|
|
143
|
-
## Framework support
|
|
144
|
-
|
|
145
|
-
_Uploadcare File Uploader_ is a framework-agnostic solution, so you can use it with **any** runtime you like. Discover the integration examples:
|
|
146
|
-
<br/>
|
|
147
|
-
|
|
148
|
-
- [React](https://github.com/uploadcare/uc-blocks-examples/tree/main/examples/react-uploader)
|
|
149
|
-
- [Vue](https://github.com/uploadcare/uc-blocks-examples/tree/main/examples/vue-uploader)
|
|
150
|
-
- [Angular](https://github.com/uploadcare/uc-blocks-examples/tree/main/examples/angular-uploader)
|
|
151
|
-
- [Svelte](https://github.com/uploadcare/uc-blocks-examples/tree/main/examples/svelte-uploader)
|
|
152
|
-
|
|
153
|
-
All the source code is accessible and works in raw mode. Use _developer tools_ to dive into details.
|
|
154
|
-
|
|
155
130
|
## Contribution
|
|
156
131
|
|
|
157
132
|
You’re always welcome to contribute:
|
|
@@ -26,6 +26,11 @@ export class CropFrame extends Block {
|
|
|
26
26
|
private _updateBackdrop;
|
|
27
27
|
/** @private */
|
|
28
28
|
private _updateFrame;
|
|
29
|
+
/**
|
|
30
|
+
* @param {import('./types.js').FrameThumbs} frameThumbs
|
|
31
|
+
* @param {import('./types.js').Direction} direction
|
|
32
|
+
*/
|
|
33
|
+
_createThumb(frameThumbs: import('./types.js').FrameThumbs, direction: import('./types.js').Direction): void;
|
|
29
34
|
/** @private */
|
|
30
35
|
private _createThumbs;
|
|
31
36
|
/** @private */
|
|
@@ -34,55 +39,55 @@ export class CropFrame extends Block {
|
|
|
34
39
|
private _createFrame;
|
|
35
40
|
_frameThumbs: Partial<{
|
|
36
41
|
"": {
|
|
37
|
-
direction: import(
|
|
42
|
+
direction: import("./types.js").Direction;
|
|
38
43
|
pathNode: SVGElement;
|
|
39
44
|
interactionNode: SVGElement;
|
|
40
45
|
groupNode: SVGElement;
|
|
41
46
|
};
|
|
42
47
|
n: {
|
|
43
|
-
direction: import(
|
|
48
|
+
direction: import("./types.js").Direction;
|
|
44
49
|
pathNode: SVGElement;
|
|
45
50
|
interactionNode: SVGElement;
|
|
46
51
|
groupNode: SVGElement;
|
|
47
52
|
};
|
|
48
53
|
s: {
|
|
49
|
-
direction: import(
|
|
54
|
+
direction: import("./types.js").Direction;
|
|
50
55
|
pathNode: SVGElement;
|
|
51
56
|
interactionNode: SVGElement;
|
|
52
57
|
groupNode: SVGElement;
|
|
53
58
|
};
|
|
54
59
|
e: {
|
|
55
|
-
direction: import(
|
|
60
|
+
direction: import("./types.js").Direction;
|
|
56
61
|
pathNode: SVGElement;
|
|
57
62
|
interactionNode: SVGElement;
|
|
58
63
|
groupNode: SVGElement;
|
|
59
64
|
};
|
|
60
65
|
w: {
|
|
61
|
-
direction: import(
|
|
66
|
+
direction: import("./types.js").Direction;
|
|
62
67
|
pathNode: SVGElement;
|
|
63
68
|
interactionNode: SVGElement;
|
|
64
69
|
groupNode: SVGElement;
|
|
65
70
|
};
|
|
66
71
|
ne: {
|
|
67
|
-
direction: import(
|
|
72
|
+
direction: import("./types.js").Direction;
|
|
68
73
|
pathNode: SVGElement;
|
|
69
74
|
interactionNode: SVGElement;
|
|
70
75
|
groupNode: SVGElement;
|
|
71
76
|
};
|
|
72
77
|
nw: {
|
|
73
|
-
direction: import(
|
|
78
|
+
direction: import("./types.js").Direction;
|
|
74
79
|
pathNode: SVGElement;
|
|
75
80
|
interactionNode: SVGElement;
|
|
76
81
|
groupNode: SVGElement;
|
|
77
82
|
};
|
|
78
83
|
se: {
|
|
79
|
-
direction: import(
|
|
84
|
+
direction: import("./types.js").Direction;
|
|
80
85
|
pathNode: SVGElement;
|
|
81
86
|
interactionNode: SVGElement;
|
|
82
87
|
groupNode: SVGElement;
|
|
83
88
|
};
|
|
84
89
|
sw: {
|
|
85
|
-
direction: import(
|
|
90
|
+
direction: import("./types.js").Direction;
|
|
86
91
|
pathNode: SVGElement;
|
|
87
92
|
interactionNode: SVGElement;
|
|
88
93
|
groupNode: SVGElement;
|
|
@@ -96,7 +101,7 @@ export class CropFrame extends Block {
|
|
|
96
101
|
*/
|
|
97
102
|
private _handlePointerDown;
|
|
98
103
|
_draggingThumb: {
|
|
99
|
-
direction: import(
|
|
104
|
+
direction: import("./types.js").Direction;
|
|
100
105
|
pathNode: SVGElement;
|
|
101
106
|
interactionNode: SVGElement;
|
|
102
107
|
groupNode: SVGElement;
|
|
@@ -126,7 +131,7 @@ export class CropFrame extends Block {
|
|
|
126
131
|
*/
|
|
127
132
|
private _handleSvgPointerMove_;
|
|
128
133
|
_hoverThumb: {
|
|
129
|
-
direction: import(
|
|
134
|
+
direction: import("./types.js").Direction;
|
|
130
135
|
pathNode: SVGElement;
|
|
131
136
|
interactionNode: SVGElement;
|
|
132
137
|
groupNode: SVGElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CropFrame.d.ts","sourceRoot":"","sources":["CropFrame.js"],"names":[],"mappings":"AA2BA;IAII;;MAGC;IAED,eAAe;IACf,yBAAyD;IAEzD,eAAe;IACf,2BAA6D;IAE7D,eAAe;IACf,8BAAmE;IAGrE;;;OAGG;IACH,+BAaC;IAED,eAAe;IACf,wBAyCC;IAFC,sCAAyB;IACzB,2CAAuC;IAGzC;;;OAGG;IACH,wBAUC;IAED,eAAe;IACf,wBASC;IAED,eAAe;IACf,qBAgEC;IAED
|
|
1
|
+
{"version":3,"file":"CropFrame.d.ts","sourceRoot":"","sources":["CropFrame.js"],"names":[],"mappings":"AA2BA;IAII;;MAGC;IAED,eAAe;IACf,yBAAyD;IAEzD,eAAe;IACf,2BAA6D;IAE7D,eAAe;IACf,8BAAmE;IAGrE;;;OAGG;IACH,+BAaC;IAED,eAAe;IACf,wBAyCC;IAFC,sCAAyB;IACzB,2CAAuC;IAGzC;;;OAGG;IACH,wBAUC;IAED,eAAe;IACf,wBASC;IAED,eAAe;IACf,qBAgEC;IAED;;;OAGG;IACH,0BAHW,OAAO,YAAY,EAAE,WAAW,aAChC,OAAO,YAAY,EAAE,SAAS,QA4BxC;IAED,eAAe;IACf,sBAiBC;IAED,eAAe;IACf,sBA4CC;IAED,eAAe;IACf,qBAeC;IAFC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA+B;IAC/B,qCAA+B;IAGjC;;;;OAIG;IACH,2BAiBC;IAJC;;;;;kBAA2B;IAC3B,sCAA6B;IAC7B,6CAA6C;IAC7C,2DAAoC;IAGtC;;;OAGG;IACH,0BAUC;IAED;;;OAGG;IACH,4BAmBC;IAED;;;;OAIG;IACH,qBAsBC;IAED;;;OAGG;IACH,+BAqBC;IAFC;;;;;kBAA6B;IAI/B,eAAe;IACf,sBAGC;IAED,eAAe;IACf,gBAGC;IAED,+BAA+B;IAC/B,sBADY,OAAO,QAclB;IAmBG,mCAAsF;CA6B3F;;;;sBAngBqB,4BAA4B"}
|
|
@@ -151,10 +151,10 @@ export class CropFrame extends Block {
|
|
|
151
151
|
|
|
152
152
|
if (isCenter) {
|
|
153
153
|
const moveThumbRect = {
|
|
154
|
-
x
|
|
155
|
-
y
|
|
156
|
-
width
|
|
157
|
-
height
|
|
154
|
+
x,
|
|
155
|
+
y,
|
|
156
|
+
width,
|
|
157
|
+
height,
|
|
158
158
|
};
|
|
159
159
|
setSvgNodeAttrs(interactionNode, moveThumbRect);
|
|
160
160
|
} else {
|
|
@@ -202,47 +202,55 @@ export class CropFrame extends Block {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* @param {import('./types.js').FrameThumbs} frameThumbs
|
|
207
|
+
* @param {import('./types.js').Direction} direction
|
|
208
|
+
*/
|
|
209
|
+
_createThumb(frameThumbs, direction) {
|
|
210
|
+
let groupNode = createSvgNode('g');
|
|
211
|
+
groupNode.classList.add('uc-thumb');
|
|
212
|
+
groupNode.setAttribute('with-effects', '');
|
|
213
|
+
let interactionNode = createSvgNode('rect', {
|
|
214
|
+
fill: 'transparent',
|
|
215
|
+
});
|
|
216
|
+
let pathNode = createSvgNode('path', {
|
|
217
|
+
stroke: 'currentColor',
|
|
218
|
+
fill: 'none',
|
|
219
|
+
'stroke-width': THUMB_STROKE_WIDTH,
|
|
220
|
+
});
|
|
221
|
+
groupNode.appendChild(pathNode);
|
|
222
|
+
groupNode.appendChild(interactionNode);
|
|
223
|
+
frameThumbs[direction] = {
|
|
224
|
+
direction,
|
|
225
|
+
pathNode,
|
|
226
|
+
interactionNode,
|
|
227
|
+
groupNode,
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
if (direction === '') {
|
|
231
|
+
groupNode.style.cursor = 'move';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interactionNode.addEventListener('pointerdown', this._handlePointerDown.bind(this, direction));
|
|
235
|
+
}
|
|
236
|
+
|
|
205
237
|
/** @private */
|
|
206
238
|
_createThumbs() {
|
|
207
|
-
/**
|
|
208
|
-
* @type {Partial<{
|
|
209
|
-
* [K in import('./types.js').Direction]: {
|
|
210
|
-
* direction: import('./types.js').Direction;
|
|
211
|
-
* pathNode: SVGElement;
|
|
212
|
-
* interactionNode: SVGElement;
|
|
213
|
-
* groupNode: SVGElement;
|
|
214
|
-
* };
|
|
215
|
-
* }>}
|
|
216
|
-
*/
|
|
239
|
+
/** @type {import('./types.js').FrameThumbs} */
|
|
217
240
|
const frameThumbs = {};
|
|
218
241
|
|
|
219
242
|
for (let i = 0; i < 3; i++) {
|
|
220
243
|
for (let j = 0; j < 3; j++) {
|
|
221
244
|
let direction = /** @type {import('./types.js').Direction} */ (`${['n', '', 's'][i]}${['w', '', 'e'][j]}`);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
let interactionNode = createSvgNode('rect', {
|
|
226
|
-
fill: 'transparent',
|
|
227
|
-
});
|
|
228
|
-
let pathNode = createSvgNode('path', {
|
|
229
|
-
stroke: 'currentColor',
|
|
230
|
-
fill: 'none',
|
|
231
|
-
'stroke-width': THUMB_STROKE_WIDTH,
|
|
232
|
-
});
|
|
233
|
-
groupNode.appendChild(pathNode);
|
|
234
|
-
groupNode.appendChild(interactionNode);
|
|
235
|
-
frameThumbs[direction] = {
|
|
236
|
-
direction,
|
|
237
|
-
pathNode,
|
|
238
|
-
interactionNode,
|
|
239
|
-
groupNode,
|
|
240
|
-
};
|
|
245
|
+
if (direction === '') {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
241
248
|
|
|
242
|
-
|
|
249
|
+
this._createThumb(frameThumbs, direction);
|
|
243
250
|
}
|
|
244
251
|
}
|
|
245
252
|
|
|
253
|
+
this._createThumb(frameThumbs, '');
|
|
246
254
|
return frameThumbs;
|
|
247
255
|
}
|
|
248
256
|
|
|
@@ -348,6 +348,8 @@ uc-editor-operation-control {
|
|
|
348
348
|
--down-opacity: 1;
|
|
349
349
|
--down-filter: 0.6;
|
|
350
350
|
--down-background: var(--uc-secondary);
|
|
351
|
+
|
|
352
|
+
border-radius: var(--uc-radius);
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
uc-editor-button-control > button,
|
|
@@ -384,11 +386,11 @@ uc-editor-button-control.uc-active,
|
|
|
384
386
|
uc-editor-operation-control.uc-active,
|
|
385
387
|
uc-editor-crop-button-control.uc-active,
|
|
386
388
|
uc-editor-filter-control.uc-active {
|
|
387
|
-
--idle-color-rgb: var(--uc-primary);
|
|
388
|
-
--idle-background: var(--uc-primary
|
|
389
|
-
--idle-opacity:
|
|
390
|
-
--hover-color-rgb: var(--uc-primary);
|
|
391
|
-
--hover-background: var(--uc-primary
|
|
389
|
+
--idle-color-rgb: var(--uc-primary-foreground);
|
|
390
|
+
--idle-background: var(--uc-primary);
|
|
391
|
+
--idle-opacity: 1;
|
|
392
|
+
--hover-color-rgb: var(--uc-primary-foreground);
|
|
393
|
+
--hover-background: var(--uc-primary);
|
|
392
394
|
--hover-opacity: 1;
|
|
393
395
|
}
|
|
394
396
|
|
|
@@ -407,6 +409,17 @@ uc-editor-filter-control.uc-not_active {
|
|
|
407
409
|
--idle-color-rgb: var(--uc-secondary-foreground);
|
|
408
410
|
}
|
|
409
411
|
|
|
412
|
+
:where(.uc-contrast) uc-editor-button-control.uc-not_active,
|
|
413
|
+
:where(.uc-contrast) uc-editor-operation-control.uc-not_active,
|
|
414
|
+
:where(.uc-contrast) uc-editor-crop-button-control.uc-not_active,
|
|
415
|
+
:where(.uc-contrast) uc-editor-filter-control.uc-not_active {
|
|
416
|
+
--idle-background: transparent;
|
|
417
|
+
--hover-background: var(--uc-secondary);
|
|
418
|
+
|
|
419
|
+
outline: 1px solid var(--uc-border);
|
|
420
|
+
outline-offset: -1px;
|
|
421
|
+
}
|
|
422
|
+
|
|
410
423
|
uc-editor-button-control > button::before,
|
|
411
424
|
uc-editor-operation-control > button::before,
|
|
412
425
|
uc-editor-crop-button-control > button::before,
|
|
@@ -973,6 +986,10 @@ uc-btn-ui.uc-secondary > button {
|
|
|
973
986
|
--active-background: transparent;
|
|
974
987
|
}
|
|
975
988
|
|
|
989
|
+
:where(.uc-contrast) uc-btn-ui.uc-secondary > button {
|
|
990
|
+
border: 1px solid var(--uc-border);
|
|
991
|
+
}
|
|
992
|
+
|
|
976
993
|
uc-btn-ui.uc-secondary-icon > button {
|
|
977
994
|
--idle-color-rgb: var(--uc-secondary-foreground);
|
|
978
995
|
--idle-brightness: 1;
|
|
@@ -1036,6 +1053,13 @@ uc-btn-ui.uc-default > button {
|
|
|
1036
1053
|
--active-background: var(--uc-primary-transparent);
|
|
1037
1054
|
}
|
|
1038
1055
|
|
|
1056
|
+
:where(.uc-contrast) uc-btn-ui.uc-default > button {
|
|
1057
|
+
--idle-background: transparent;
|
|
1058
|
+
--hover-background: var(--uc-secondary);
|
|
1059
|
+
--active-background: var(--uc-foreground);
|
|
1060
|
+
--active-color-rgb: var(--uc-background);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1039
1063
|
uc-line-loader-ui {
|
|
1040
1064
|
position: absolute;
|
|
1041
1065
|
top: 0px;
|
|
@@ -1107,16 +1131,16 @@ uc-slider-ui .uc-steps {
|
|
|
1107
1131
|
uc-slider-ui .uc-border-step {
|
|
1108
1132
|
width: 0px;
|
|
1109
1133
|
height: 10px;
|
|
1110
|
-
border-right: 1px solid var(--
|
|
1111
|
-
opacity:
|
|
1134
|
+
border-right: 1px solid var(--uc-foreground);
|
|
1135
|
+
opacity: 1;
|
|
1112
1136
|
transition: border-color var(--transition-duration-2);
|
|
1113
1137
|
}
|
|
1114
1138
|
|
|
1115
1139
|
uc-slider-ui .uc-minor-step {
|
|
1116
1140
|
width: 0px;
|
|
1117
1141
|
height: 4px;
|
|
1118
|
-
border-right: 1px solid var(--
|
|
1119
|
-
opacity: 0.
|
|
1142
|
+
border-right: 1px solid var(--uc-foreground);
|
|
1143
|
+
opacity: 0.6;
|
|
1120
1144
|
transition: border-color var(--transition-duration-2);
|
|
1121
1145
|
}
|
|
1122
1146
|
|
|
@@ -114,7 +114,7 @@ export class SliderUi extends Block {
|
|
|
114
114
|
if (value === this._zero) {
|
|
115
115
|
this._zeroDotEl.style.opacity = '0';
|
|
116
116
|
} else {
|
|
117
|
-
this._zeroDotEl.style.opacity = '
|
|
117
|
+
this._zeroDotEl.style.opacity = '1';
|
|
118
118
|
}
|
|
119
119
|
let { width } = this.getBoundingClientRect();
|
|
120
120
|
let slope = 100 / (this.$.max - this.$.min);
|
|
@@ -54,5 +54,61 @@ export type CropAspectRatio = {
|
|
|
54
54
|
height: number;
|
|
55
55
|
};
|
|
56
56
|
export type CropPresetList = CropAspectRatio[];
|
|
57
|
+
export type FrameThumbs = {
|
|
58
|
+
""?: {
|
|
59
|
+
direction: Direction;
|
|
60
|
+
pathNode: SVGElement;
|
|
61
|
+
interactionNode: SVGElement;
|
|
62
|
+
groupNode: SVGElement;
|
|
63
|
+
} | undefined;
|
|
64
|
+
n?: {
|
|
65
|
+
direction: Direction;
|
|
66
|
+
pathNode: SVGElement;
|
|
67
|
+
interactionNode: SVGElement;
|
|
68
|
+
groupNode: SVGElement;
|
|
69
|
+
} | undefined;
|
|
70
|
+
s?: {
|
|
71
|
+
direction: Direction;
|
|
72
|
+
pathNode: SVGElement;
|
|
73
|
+
interactionNode: SVGElement;
|
|
74
|
+
groupNode: SVGElement;
|
|
75
|
+
} | undefined;
|
|
76
|
+
e?: {
|
|
77
|
+
direction: Direction;
|
|
78
|
+
pathNode: SVGElement;
|
|
79
|
+
interactionNode: SVGElement;
|
|
80
|
+
groupNode: SVGElement;
|
|
81
|
+
} | undefined;
|
|
82
|
+
w?: {
|
|
83
|
+
direction: Direction;
|
|
84
|
+
pathNode: SVGElement;
|
|
85
|
+
interactionNode: SVGElement;
|
|
86
|
+
groupNode: SVGElement;
|
|
87
|
+
} | undefined;
|
|
88
|
+
ne?: {
|
|
89
|
+
direction: Direction;
|
|
90
|
+
pathNode: SVGElement;
|
|
91
|
+
interactionNode: SVGElement;
|
|
92
|
+
groupNode: SVGElement;
|
|
93
|
+
} | undefined;
|
|
94
|
+
nw?: {
|
|
95
|
+
direction: Direction;
|
|
96
|
+
pathNode: SVGElement;
|
|
97
|
+
interactionNode: SVGElement;
|
|
98
|
+
groupNode: SVGElement;
|
|
99
|
+
} | undefined;
|
|
100
|
+
se?: {
|
|
101
|
+
direction: Direction;
|
|
102
|
+
pathNode: SVGElement;
|
|
103
|
+
interactionNode: SVGElement;
|
|
104
|
+
groupNode: SVGElement;
|
|
105
|
+
} | undefined;
|
|
106
|
+
sw?: {
|
|
107
|
+
direction: Direction;
|
|
108
|
+
pathNode: SVGElement;
|
|
109
|
+
interactionNode: SVGElement;
|
|
110
|
+
groupNode: SVGElement;
|
|
111
|
+
} | undefined;
|
|
112
|
+
};
|
|
57
113
|
export type Direction = '' | 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
|
58
114
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;gCAGa,YAAY,YAAY,OAAO,CAAC,CAAC;;;;wBAMjC;IAAE,KAAK,SAAS;IAAC,MAAM,SAAQ;CAAE;;;;;;;8BAYjC;IACZ,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAU,CAAC,EAAE;QAAE,MAAM,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,IAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CACnE;;iBAKU,MAAM;qBACN,MAAM;YACN,MAAM;qBACN,eAAe;;;iBAKf,MAAM;qBACN,MAAM;YACN,MAAM;qBACN,eAAe;;8BAGf;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;6BAEvD,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;gCAGa,YAAY,YAAY,OAAO,CAAC,CAAC;;;;wBAMjC;IAAE,KAAK,SAAS;IAAC,MAAM,SAAQ;CAAE;;;;;;;8BAYjC;IACZ,OAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAU,CAAC,EAAE;QAAE,MAAM,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,IAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CACnE;;iBAKU,MAAM;qBACN,MAAM;YACN,MAAM;qBACN,eAAe;;;iBAKf,MAAM;qBACN,MAAM;YACN,MAAM;qBACN,eAAe;;8BAGf;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;6BAEvD,eAAe,EAAE;;;mBAKb,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;mBAHV,SAAS;kBACV,UAAU;yBACH,UAAU;mBAChB,UAAU;;;wBAKd,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI"}
|
|
@@ -56,6 +56,17 @@
|
|
|
56
56
|
|
|
57
57
|
/** @typedef {CropAspectRatio[]} CropPresetList */
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @typedef {Partial<{
|
|
61
|
+
* [K in Direction]: {
|
|
62
|
+
* direction: Direction;
|
|
63
|
+
* pathNode: SVGElement;
|
|
64
|
+
* interactionNode: SVGElement;
|
|
65
|
+
* groupNode: SVGElement;
|
|
66
|
+
* };
|
|
67
|
+
* }>} FrameThumbs
|
|
68
|
+
*/
|
|
69
|
+
|
|
59
70
|
/** @typedef {'' | 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw'} Direction */
|
|
60
71
|
|
|
61
72
|
export {};
|
|
@@ -32,18 +32,19 @@
|
|
|
32
32
|
background: var(--uc-background);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
:where([uc-drop-area])[with-icon]
|
|
36
|
-
> .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
|
|
37
|
-
:is(.uc-text, .uc-icon-container) {
|
|
38
|
-
color: var(--uc-primary);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
35
|
:where([uc-drop-area]):is([drag-state='active'], [drag-state='near'], [drag-state='over'], :hover) {
|
|
42
|
-
color: var(--uc-primary);
|
|
43
36
|
background: var(--uc-primary-transparent);
|
|
44
37
|
border-color: var(--uc-primary-transparent);
|
|
45
38
|
}
|
|
46
39
|
|
|
40
|
+
:where(.uc-contrast) :where([uc-drop-area]):is([drag-state='active'], [drag-state='near'], [drag-state='over'], :hover) {
|
|
41
|
+
color: var(--uc-foreground);
|
|
42
|
+
background: transparent;
|
|
43
|
+
border-color: var(--uc-foreground);
|
|
44
|
+
border-width: 2px;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
}
|
|
47
|
+
|
|
47
48
|
:where([uc-drop-area]):is([drag-state='active'], [drag-state='near']) {
|
|
48
49
|
opacity: 1;
|
|
49
50
|
}
|
|
@@ -95,15 +96,19 @@
|
|
|
95
96
|
transform: translateY(48px);
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
:where([uc-drop-area])[with-icon]:hover .uc-icon-container,
|
|
99
|
-
:where([uc-drop-area])[with-icon]:hover .uc-text {
|
|
100
|
-
color: var(--uc-
|
|
99
|
+
:where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-icon-container,
|
|
100
|
+
:where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-text {
|
|
101
|
+
color: var(--uc-foreground);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
:where([uc-drop-area])[with-icon]:hover .uc-icon-container {
|
|
104
105
|
background-color: var(--uc-primary-transparent);
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
:where(.uc-contrast) :where([uc-drop-area])[with-icon]:hover .uc-icon-container {
|
|
109
|
+
background-color: var(--uc-muted);
|
|
110
|
+
}
|
|
111
|
+
|
|
107
112
|
:where([uc-drop-area])[with-icon]
|
|
108
113
|
> .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
|
|
109
114
|
.uc-icon-container {
|
|
@@ -114,7 +119,13 @@
|
|
|
114
119
|
:where([uc-drop-area])[with-icon]
|
|
115
120
|
> .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
|
|
116
121
|
.uc-text {
|
|
117
|
-
color: var(--uc-
|
|
122
|
+
color: var(--uc-foreground);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:where(.uc-contrast) :where([uc-drop-area])[with-icon]
|
|
126
|
+
> .uc-content-wrapper:is([drag-state='active'], [drag-state='near'], [drag-state='over'])
|
|
127
|
+
.uc-text {
|
|
128
|
+
color: var(--uc-foreground);
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
:where([uc-drop-area])[with-icon]
|
|
@@ -127,11 +127,15 @@ uc-file-item .uc-badge uc-icon svg {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
uc-file-item .uc-progress-bar {
|
|
130
|
-
opacity: 0.
|
|
130
|
+
opacity: 0.7;
|
|
131
131
|
top: calc(100% - 2px);
|
|
132
132
|
height: 2px;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
:where(.uc-contrast) uc-file-item .uc-progress-bar {
|
|
136
|
+
opacity: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
uc-file-item .uc-file-actions {
|
|
136
140
|
display: flex;
|
|
137
141
|
gap: 2px;
|