@uploadcare/file-uploader 0.50.1-alpha.2 → 0.50.1

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.
Files changed (114) hide show
  1. package/README.md +30 -30
  2. package/abstract/Block.d.ts +4 -2
  3. package/abstract/Block.d.ts.map +1 -1
  4. package/abstract/Block.js +16 -22
  5. package/abstract/SolutionBlock.js +2 -2
  6. package/abstract/UploaderBlock.js +4 -4
  7. package/abstract/connectBlocksFrom.d.ts +1 -1
  8. package/abstract/connectBlocksFrom.js +4 -4
  9. package/abstract/registerBlocks.d.ts.map +1 -1
  10. package/abstract/registerBlocks.js +2 -13
  11. package/blocks/ActivityHeader/activity-header.css +2 -2
  12. package/blocks/CameraSource/CameraSource.js +8 -8
  13. package/blocks/CameraSource/camera-source.css +14 -14
  14. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +2 -2
  15. package/blocks/CloudImageEditor/src/EditorButtonControl.js +1 -1
  16. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +2 -2
  17. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -1
  18. package/blocks/CloudImageEditor/src/EditorFilterControl.js +33 -23
  19. package/blocks/CloudImageEditor/src/EditorImageCropper.js +4 -4
  20. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +5 -5
  21. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
  22. package/blocks/CloudImageEditor/src/EditorImageFader.js +17 -15
  23. package/blocks/CloudImageEditor/src/EditorSlider.js +2 -2
  24. package/blocks/CloudImageEditor/src/EditorToolbar.js +24 -24
  25. package/blocks/CloudImageEditor/src/css/common.css +142 -142
  26. package/blocks/CloudImageEditor/src/css/icons.css +2 -2
  27. package/blocks/CloudImageEditor/src/elements/button/{BtnUi.d.ts → LrBtnUi.d.ts} +3 -3
  28. package/blocks/CloudImageEditor/src/elements/button/LrBtnUi.d.ts.map +1 -0
  29. package/blocks/CloudImageEditor/src/elements/button/{BtnUi.js → LrBtnUi.js} +4 -4
  30. package/blocks/CloudImageEditor/src/index.d.ts +1 -1
  31. package/blocks/CloudImageEditor/src/index.js +1 -1
  32. package/blocks/CloudImageEditor/src/template.js +8 -8
  33. package/blocks/CloudImageEditorActivity/index.css +2 -2
  34. package/blocks/Config/Config.d.ts +1 -1
  35. package/blocks/Config/Config.js +7 -7
  36. package/blocks/Config/config.css +1 -1
  37. package/blocks/Copyright/copyright.css +4 -4
  38. package/blocks/DropArea/DropArea.d.ts +1 -1
  39. package/blocks/DropArea/DropArea.js +4 -4
  40. package/blocks/DropArea/drop-area.css +34 -34
  41. package/blocks/ExternalSource/ExternalSource.js +5 -5
  42. package/blocks/ExternalSource/external-source.css +9 -9
  43. package/blocks/FileItem/FileItem.js +6 -6
  44. package/blocks/FileItem/file-item.css +22 -22
  45. package/blocks/Icon/icon.css +2 -2
  46. package/blocks/Img/ImgConfig.js +1 -1
  47. package/blocks/Img/configurations.d.ts +1 -1
  48. package/blocks/Img/configurations.js +1 -1
  49. package/blocks/Img/test.css +5 -5
  50. package/blocks/Modal/Modal.js +1 -1
  51. package/blocks/Modal/modal.css +15 -15
  52. package/blocks/ProgressBar/progress-bar.css +3 -3
  53. package/blocks/ProgressBarCommon/ProgressBarCommon.js +1 -1
  54. package/blocks/ProgressBarCommon/progress-bar-common.css +2 -2
  55. package/blocks/Range/range.css +8 -8
  56. package/blocks/Select/select.css +2 -2
  57. package/blocks/SimpleBtn/SimpleBtn.js +4 -4
  58. package/blocks/SimpleBtn/simple-btn.css +11 -11
  59. package/blocks/SourceBtn/SourceBtn.js +1 -1
  60. package/blocks/SourceBtn/source-btn.css +5 -5
  61. package/blocks/SourceList/SourceList.js +1 -1
  62. package/blocks/StartFrom/start-from.css +5 -5
  63. package/blocks/UploadList/UploadList.js +6 -6
  64. package/blocks/UploadList/upload-list.css +10 -10
  65. package/blocks/UrlSource/UrlSource.js +5 -5
  66. package/blocks/UrlSource/url-source.css +4 -4
  67. package/blocks/themes/{uc-basic → lr-basic}/common.css +19 -19
  68. package/blocks/themes/{uc-basic → lr-basic}/config.css +1 -1
  69. package/blocks/themes/{uc-basic → lr-basic}/theme.css +7 -7
  70. package/env.d.ts +1 -1
  71. package/env.js +1 -1
  72. package/index.ssr.d.ts +10 -10
  73. package/index.ssr.d.ts.map +1 -1
  74. package/index.ssr.js +108 -108
  75. package/package.json +1 -1
  76. package/solutions/adaptive-image/index.js +1 -1
  77. package/solutions/cloud-image-editor/CloudImageEditor.js +1 -1
  78. package/solutions/cloud-image-editor/index.css +1 -1
  79. package/solutions/file-uploader/inline/FileUploaderInline.js +12 -12
  80. package/solutions/file-uploader/inline/index.css +12 -12
  81. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +6 -6
  82. package/solutions/file-uploader/minimal/index.css +25 -25
  83. package/solutions/file-uploader/regular/FileUploaderRegular.js +15 -15
  84. package/solutions/file-uploader/regular/index.css +1 -1
  85. package/types/exported.d.ts +1 -1
  86. package/types/global.d.ts +2 -2
  87. package/types/jsx.d.ts +37 -37
  88. package/web/blocks.iife.min.js +4 -4
  89. package/web/blocks.min.js +2 -2
  90. package/web/lr-basic.min.css +1 -1
  91. package/web/lr-cloud-image-editor.min.css +1 -1
  92. package/web/lr-cloud-image-editor.min.js +4 -4
  93. package/web/lr-file-uploader-inline.min.css +1 -1
  94. package/web/lr-file-uploader-inline.min.js +2 -2
  95. package/web/lr-file-uploader-minimal.min.css +1 -1
  96. package/web/lr-file-uploader-minimal.min.js +3 -3
  97. package/web/lr-file-uploader-regular.min.css +1 -1
  98. package/web/lr-file-uploader-regular.min.js +2 -2
  99. package/web/lr-img.min.js +2 -2
  100. package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +0 -1
  101. package/web/uc-basic.min.css +0 -1
  102. package/web/uc-cloud-image-editor.min.css +0 -1
  103. package/web/uc-cloud-image-editor.min.js +0 -29
  104. package/web/uc-file-uploader-inline.min.css +0 -1
  105. package/web/uc-file-uploader-inline.min.js +0 -29
  106. package/web/uc-file-uploader-minimal.min.css +0 -1
  107. package/web/uc-file-uploader-minimal.min.js +0 -28
  108. package/web/uc-file-uploader-regular.min.css +0 -1
  109. package/web/uc-file-uploader-regular.min.js +0 -29
  110. package/web/uc-img.min.js +0 -28
  111. /package/blocks/themes/{uc-basic → lr-basic}/index.css +0 -0
  112. /package/blocks/themes/{uc-basic → lr-basic}/svg-sprite.d.ts +0 -0
  113. /package/blocks/themes/{uc-basic → lr-basic}/svg-sprite.d.ts.map +0 -0
  114. /package/blocks/themes/{uc-basic → lr-basic}/svg-sprite.js +0 -0
package/README.md CHANGED
@@ -16,13 +16,13 @@
16
16
  <a href="https://twitter.com/Uploadcare?ref=github-readme">Twitter</a>
17
17
  </p>
18
18
 
19
- # 📦 Uploadcare Blocks: stack-agnostic library for uploading, processing, and editing images on-the-fly
19
+ # 📦 Uploadcare File Uploader: stack-agnostic library for uploading, processing, and editing images on-the-fly
20
20
 
21
- [![npm version](https://badge.fury.io/js/@uploadcare%2Fblocks.svg)](https://www.npmjs.com/package/@uploadcare/blocks)
21
+ [![npm version](https://badge.fury.io/js/@uploadcare%2Fblocks.svg)](https://www.npmjs.com/package/@uploadcare/file-uploader)
22
22
  [![GitHub Actions](https://github.com/uploadcare/blocks/workflows/checks/badge.svg)](https://github.com/uploadcare/blocks/actions?query=workflow%3ABuild+branch%3Amaster)
23
23
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
24
24
 
25
- _Uploadcare Blocks_ is a powerful JavaScript library for creating custom file-handling services.
25
+ _Uploadcare File Uploader_ is a powerful JavaScript library for creating custom file-handling services.
26
26
  It includes various interactive and customizable UI components to enhance users' file uploading
27
27
  and processing experience. As a bonus, you receive all the
28
28
  [Uploadcare's](https://uploadcare.com/?ref=github-readme) versatile file-handling capabilities,
@@ -31,9 +31,9 @@ including [smart CDN](https://uploadcare.com/docs/delivery/cdn/#content-delivery
31
31
  [signed uploads](https://uploadcare.com/docs/security/secure-uploads/?ref=github-readme),
32
32
  and [even more](<(https://uploadcare.com/features/?ref=github-readme)>).
33
33
 
34
- See Uploadcare Blocks [in action](https://codesandbox.io/p/devbox/github/uploadcare/blocks-examples/tree/main/examples/js-uploader)!
34
+ See Uploadcare File Uploader [in action](https://codesandbox.io/p/devbox/github/uploadcare/blocks-examples/tree/main/examples/js-uploader)!
35
35
 
36
- <img alt="Uploadcare Blocks examples" src="https://ucarecdn.com/2883da9f-6962-49db-9947-f91a3e25be2f/-/preview/">
36
+ <img alt="Uploadcare File Uploader examples" src="https://ucarecdn.com/2883da9f-6962-49db-9947-f91a3e25be2f/-/preview/">
37
37
 
38
38
  ## Core features
39
39
 
@@ -45,7 +45,7 @@ See Uploadcare Blocks [in action](https://codesandbox.io/p/devbox/github/uploadc
45
45
 
46
46
  * **Coming soon!** Web Components for any media content management like audio, video, image galleries, and more.
47
47
 
48
- ## Why Uploadcare Blocks?
48
+ ## Why Uploadcare File Uploader?
49
49
 
50
50
  ### Rapid integration
51
51
 
@@ -53,11 +53,11 @@ We provide a ready-to-use set of UI components for file handling. It saves you v
53
53
 
54
54
  ### Cross-platform compatibility
55
55
 
56
- Uploadcare Blocks are designed to work seamlessly across various platforms and frameworks. Whether you're building a web application using React, Vue.js, Angular, Svelte, or other frameworks, you get [integrations and support](https://uploadcare.com/docs/integrations/?ref=github-readme) for various development environments.
56
+ Uploadcare File Uploader are designed to work seamlessly across various platforms and frameworks. Whether you're building a web application using React, Vue.js, Angular, Svelte, or other frameworks, you get [integrations and support](https://uploadcare.com/docs/integrations/?ref=github-readme) for various development environments.
57
57
 
58
58
  ### Developer-friendly
59
59
 
60
- The library comes with modern technologies at your fingertips, like [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), [ESM-level](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) code sharing, and other cutting-edge web standards. _Uploadcare Blocks_ is designed lightweight with minimum external dependencies for a cheap security audit.
60
+ The library comes with modern technologies at your fingertips, like [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components), [ESM-level](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) code sharing, and other cutting-edge web standards. _Uploadcare File Uploader_ is designed lightweight with minimum external dependencies for a cheap security audit.
61
61
 
62
62
  ### Typescript support
63
63
 
@@ -67,72 +67,72 @@ We use [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/int
67
67
 
68
68
  ### From CDN
69
69
 
70
- 1. Connect Uploadcare Blocks directly from your document replacing `{{PACKAGE_VERSION}}` with the [latest version](https://github.com/uploadcare/blocks/releases) of the package:
70
+ 1. Connect Uploadcare File Uploader directly from your document replacing `{{PACKAGE_VERSION}}` with the [latest version](https://github.com/uploadcare/blocks/releases) of the package:
71
71
 
72
72
  ```html
73
73
  <script type="module">
74
- import * as UC from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/blocks.min.js';
74
+ import * as LR from 'https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/blocks.min.js';
75
75
 
76
- UC.registerBlocks(UC);
76
+ LR.registerBlocks(LR);
77
77
  </script>
78
78
  ```
79
79
 
80
- 2. Start using Uploadcare Blocks in your application markup (don't forget to specify `{{PACKAGE_VERSION}}` with the [latest one](https://github.com/uploadcare/file-uploader/releases)):
80
+ 2. Start using Uploadcare File Uploader in your application markup (don't forget to specify `{{PACKAGE_VERSION}}` with the [latest one](https://github.com/uploadcare/blocks/releases)):
81
81
 
82
82
  ```html
83
83
  <link
84
84
  rel="stylesheet"
85
- href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/uc-file-uploader-regular.min.css"
85
+ href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/lr-file-uploader-regular.min.css"
86
86
  />
87
87
 
88
- <uc-file-uploader-regular ctx-name="my-uploader"> </uc-file-uploader-regular>
88
+ <lr-file-uploader-regular ctx-name="my-uploader"> </lr-file-uploader-regular>
89
89
  ```
90
90
 
91
- 3. Configure Uploadcare Blocks and add your personal public key to the project. Discover the instructions in the [following section](#configuration).
91
+ 3. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration).
92
92
 
93
93
  ### From NPM
94
94
 
95
- 1. Install Uploadcare Blocks package: `npm i --save-exact @uploadcare/file-uploader`
95
+ 1. Install Uploadcare File Uploader package: `npm i --save-exact @uploadcare/file-uploader`
96
96
  2. Connect `Blocks` from your script file:
97
97
 
98
98
  ```js
99
- import * as UC from '@uploadcare/file-uploader';
99
+ import * as LR from '@uploadcare/file-uploader';
100
100
 
101
- UC.registerBlocks(UC);
101
+ LR.registerBlocks(LR);
102
102
  ```
103
103
 
104
- 3. Start using Uploadcare Blocks in your application markup and replace `{{PACKAGE_VERSION}}` with the [latest version](https://github.com/uploadcare/file-uploader/releases) of the package:
104
+ 3. Start using Uploadcare File Uploader in your application markup and replace `{{PACKAGE_VERSION}}` with the [latest version](https://github.com/uploadcare/blocks/releases) of the package:
105
105
 
106
106
  ```html
107
107
  <link
108
108
  rel="stylesheet"
109
- href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/uc-file-uploader-regular.min.css"
109
+ href="https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@{{PACKAGE_VERSION}}/web/lr-file-uploader-regular.min.css"
110
110
  />
111
111
 
112
- <uc-file-uploader-inline ctx-name="my-uploader"> </uc-file-uploader-inline>
112
+ <lr-file-uploader-inline ctx-name="my-uploader"> </lr-file-uploader-inline>
113
113
  ```
114
114
 
115
- 4. Configure Uploadcare Blocks and add your personal public key to the project. Discover the instructions in the [following section](#configuration).
115
+ 4. Configure Uploadcare File Uploader and add your personal public key to the project. Discover the instructions in the [following section](#configuration).
116
116
 
117
117
  ### Configuration
118
118
 
119
- All configurations in Uploadcare Blocks are managed from `uc-config` block.
119
+ All configurations in Uploadcare File Uploader are managed from `lr-config` block.
120
120
 
121
121
  1. Sign up to [Uploadcare](https://app.uploadcare.com/accounts/signup/?ref=github-readme).
122
122
  2. Get a Public API key in [Uploadcare project's dashboard](https://app.uploadcare.com/projects/-/api-keys/?ref=github-readme).
123
- 3. Add a `uc-config` block to your markup and replace `YOUR_PUBLIC_KEY` with your own public key:
123
+ 3. Add a `lr-config` block to your markup and replace `YOUR_PUBLIC_KEY` with your own public key:
124
124
 
125
125
  ```html
126
- <uc-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY"></uc-config>
126
+ <lr-config ctx-name="my-uploader" pubkey="YOUR_PUBLIC_KEY"></lr-config>
127
127
  ```
128
128
 
129
129
  4. Make sure that your config block uses the same `ctx-name` attribute value as your solution block.
130
130
 
131
- Discover more about Uploadcare Blocks configuration in [our documentation](https://uploadcare.com/docs/file-uploader/configuration/?ref=github-readme).
131
+ Discover more about Uploadcare File Uploader configuration in [our documentation](https://uploadcare.com/docs/file-uploader/configuration/?ref=github-readme).
132
132
 
133
- ### Deep dive in Uploadcare Blocks 🛠
133
+ ### Deep dive in Uploadcare File Uploader 🛠
134
134
 
135
- Follow our [step-by-step installation guide](https://uploadcare.com/docs/file-uploader/installation/?ref=github-readme) to launch Uploadcare Blocks in a few minutes and set it up based on your needs.
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.
136
136
 
137
137
  ## Browser support
138
138
 
@@ -142,7 +142,7 @@ Internet Explorer is outdated and [not supported anymore](https://uploadcare.com
142
142
 
143
143
  ## Framework support
144
144
 
145
- _Uploadcare Blocks_ is a framework-agnostic solution, so you can use it with **any** runtime you like. Discover the integration examples:
145
+ _Uploadcare File Uploader_ is a framework-agnostic solution, so you can use it with **any** runtime you like. Discover the integration examples:
146
146
  <br/>
147
147
 
148
148
  - [React](https://github.com/uploadcare/uc-blocks-examples/tree/main/examples/react-uploader)
@@ -156,7 +156,7 @@ All the source code is accessible and works in raw mode. Use _developer tools_ t
156
156
 
157
157
  You’re always welcome to contribute:
158
158
 
159
- - Create [issues](https://github.com/uploadcare/file-uploader/issues) every time you feel something is missing or goes wrong.
159
+ - Create [issues](https://github.com/uploadcare/blocks/issues) every time you feel something is missing or goes wrong.
160
160
  - Provide your feedback or drop us a support request at <a href="mailto:hello@uploadcare.com">hello@uploadcare.com</a>.
161
161
  - Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/uploadcare) with "uploadcare" tag if others can have these questions as well.
162
162
  - Fork project, make changes and send it as pull request. For launching the developing mode follow these commands:
@@ -3,6 +3,8 @@ export class Block extends BaseComponent<any> {
3
3
  static StateConsumerScope: string | null;
4
4
  /** @type {string[]} */
5
5
  static styleAttrs: string[];
6
+ /** @param {String} [name] */
7
+ static reg(name?: string | undefined): void;
6
8
  constructor();
7
9
  /** @protected */
8
10
  protected requireCtxName: boolean;
@@ -76,10 +78,10 @@ export class Block extends BaseComponent<any> {
76
78
  protected destroyCtxCallback(): void;
77
79
  /**
78
80
  * @param {String} url
79
- * @returns {String}
81
+ * @returns {Promise<String>}
80
82
  * @protected
81
83
  */
82
- protected proxyUrl(url: string): string;
84
+ protected proxyUrl(url: string): Promise<string>;
83
85
  /** @returns {import('../types').ConfigType} } */
84
86
  get cfg(): import("../types").ConfigType;
85
87
  /** @private */
@@ -1 +1 @@
1
- {"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["Block.js"],"names":[],"mappings":"AAoBA;IACE,4BAA4B;IAC5B,2BADW,MAAM,GAAG,IAAI,CACS;IAEjC,uBAAuB;IACvB,mBADW,MAAM,EAAE,CACI;IAoDvB,cAMC;IAxDD,iBAAiB;IACjB,kCAAuB;IAEvB,wDAAwD;IACxD,cADW,OAAO,oBAAoB,EAAE,YAAY,CAChC;IAEpB,UAAmB;IAEnB;;;;OAIG;IACH;;eAcC;IAED;;;;;OAKG;IACH,kBAIC;IAED;;;;OAIG;IACH,wBAJW,MAAM,YACN,MAAM,IAAI,QAKpB;IAIC,uDAAuD;IACvD,mBADW,IAAI,MAAM,EAAE,IAAI;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC,CACjB;IAKpC;;;;OAIG;IACH,WAJW;;qBAAuF,CAAC,CAAC,YACzF;;qBAAuF,CAAC,CAAC,YACzF;;qBAAuF,CAAC,CAAC,QASnG;IAED;;;OAGG;IACH,gCAHmB,KAAK,KAAK,OAAO,WAUnC;IAED;;;OAGG;IACH,oCAFW,GAAG,QASb;IAkED;;;OAGG;IACH,4BAEC;IAED;;;OAGG;IACH,kCAEC;IAED,yBAAyB;IACzB,iCAEC;IAsBD;;;;OAIG;IACH,qCAKC;IAED;;;;OAIG;IACH,wCAqBC;IAED,iDAAiD;IACjD,yCA8BC;IA3BG,eAAe;IACf,mBAuBE;IAKN;;;;OAIG;IACH,6HAFwD,IAAI,QAQ3D;IAED,8BAA8B;IAC9B,oBADY,OAAO,EAAE,QAWpB;CAmBF;;8BAzVmC,sBAAsB;qBAarC,WAAW"}
1
+ {"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["Block.js"],"names":[],"mappings":"AAmBA;IACE,4BAA4B;IAC5B,2BADW,MAAM,GAAG,IAAI,CACS;IAEjC,uBAAuB;IACvB,mBADW,MAAM,EAAE,CACI;IAoTvB,6BAA6B;IAC7B,4CAMC;IAvQD,cAMC;IAxDD,iBAAiB;IACjB,kCAAuB;IAEvB,wDAAwD;IACxD,cADW,OAAO,oBAAoB,EAAE,YAAY,CAChC;IAEpB,UAAmB;IAEnB;;;;OAIG;IACH;;eAcC;IAED;;;;;OAKG;IACH,kBAIC;IAED;;;;OAIG;IACH,wBAJW,MAAM,YACN,MAAM,IAAI,QAKpB;IAIC,uDAAuD;IACvD,mBADW,IAAI,MAAM,EAAE,IAAI;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC,CACjB;IAKpC;;;;OAIG;IACH,WAJW;;qBAAuF,CAAC,CAAC,YACzF;;qBAAuF,CAAC,CAAC,YACzF;;qBAAuF,CAAC,CAAC,QASnG;IAED;;;OAGG;IACH,gCAHmB,KAAK,KAAK,OAAO,WAUnC;IAED;;;OAGG;IACH,oCAFW,GAAG,QASb;IAkED;;;OAGG;IACH,4BAEC;IAED;;;OAGG;IACH,kCAEC;IAED,yBAAyB;IACzB,iCAEC;IAsBD;;;;OAIG;IACH,qCAIC;IAED;;;;OAIG;IACH,iCAHa,eAAe,CA6B3B;IAED,iDAAiD;IACjD,yCA8BC;IA3BG,eAAe;IACf,mBAuBE;IAKN;;;;OAIG;IACH,6HAFwD,IAAI,QAQ3D;IAED,8BAA8B;IAC9B,oBADY,OAAO,EAAE,QAWpB;CAUF;;8BAnVmC,sBAAsB;qBAarC,WAAW"}
package/abstract/Block.js CHANGED
@@ -14,8 +14,7 @@ import { l10nProcessor } from './l10nProcessor.js';
14
14
  import { sharedConfigKey } from './sharedConfigKey.js';
15
15
  import { A11y } from './a11y.js';
16
16
 
17
- const TAG_PREFIX = 'uc-';
18
- const LEGACY_TAG_PREFIX = 'lr-';
17
+ const TAG_PREFIX = 'lr-';
19
18
 
20
19
  // @ts-ignore TODO: fix this
21
20
  export class Block extends BaseComponent {
@@ -237,26 +236,30 @@ export class Block extends BaseComponent {
237
236
  Data.deleteCtx(this.ctxName);
238
237
 
239
238
  this.localeManager?.destroy();
240
- this.a11y?.destroy();
241
239
  }
242
240
 
243
241
  /**
244
242
  * @param {String} url
245
- * @returns {String}
243
+ * @returns {Promise<String>}
246
244
  * @protected
247
245
  */
248
- proxyUrl(url) {
246
+ async proxyUrl(url) {
249
247
  if (this.cfg.secureDeliveryProxy && this.cfg.secureDeliveryProxyUrlResolver) {
250
248
  console.warn(
251
249
  'Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used.',
252
250
  );
253
251
  }
254
252
  if (this.cfg.secureDeliveryProxyUrlResolver) {
255
- return this.cfg.secureDeliveryProxyUrlResolver(url, {
256
- uuid: extractUuid(url),
257
- cdnUrlModifiers: extractCdnUrlModifiers(url),
258
- fileName: extractFilename(url),
259
- });
253
+ try {
254
+ return await this.cfg.secureDeliveryProxyUrlResolver(url, {
255
+ uuid: extractUuid(url),
256
+ cdnUrlModifiers: extractCdnUrlModifiers(url),
257
+ fileName: extractFilename(url),
258
+ });
259
+ } catch (err) {
260
+ console.error('Failed to resolve secure delivery proxy URL. Falling back to the default URL.', err);
261
+ return url;
262
+ }
260
263
  }
261
264
  if (this.cfg.secureDeliveryProxy) {
262
265
  return applyTemplateData(
@@ -327,22 +330,13 @@ export class Block extends BaseComponent {
327
330
  console.log(`[${this.ctxName}]`, ...consoleArgs);
328
331
  }
329
332
 
330
- /**
331
- * @param {String} [name]
332
- * @param {Boolean} [isAlias]
333
- */
334
- static reg(name, isAlias = false) {
333
+ /** @param {String} [name] */
334
+ static reg(name) {
335
335
  if (!name) {
336
336
  super.reg();
337
337
  return;
338
338
  }
339
- if (name.startsWith(TAG_PREFIX)) {
340
- super.reg(name, isAlias);
341
- }
342
-
343
- if (name.startsWith(LEGACY_TAG_PREFIX)) {
344
- super.reg(name, isAlias);
345
- }
339
+ super.reg(name.startsWith(TAG_PREFIX) ? name : TAG_PREFIX + name);
346
340
  }
347
341
  }
348
342
 
@@ -1,9 +1,9 @@
1
- import svgIconsSprite from '../blocks/themes/uc-basic/svg-sprite.js';
1
+ import svgIconsSprite from '../blocks/themes/lr-basic/svg-sprite.js';
2
2
  import { Block } from './Block.js';
3
3
  import { uploaderBlockCtx } from './CTX.js';
4
4
 
5
5
  export class SolutionBlock extends Block {
6
- static styleAttrs = ['uc-wgt-common'];
6
+ static styleAttrs = ['lr-wgt-common'];
7
7
  requireCtxName = true;
8
8
  init$ = uploaderBlockCtx(this);
9
9
  _template = null;
@@ -281,10 +281,10 @@ export class UploaderBlock extends ActivityBlock {
281
281
  return entry.getValue('errors').length > 0;
282
282
  });
283
283
  if (
284
- uploadCollection.size > 0 &&
285
- errorItems.length === 0 &&
286
- uploadCollection.size === loadedItems.length &&
287
- this.$['*collectionErrors'].length === 0
284
+ uploadCollection.size > 0 &&
285
+ errorItems.length === 0 &&
286
+ uploadCollection.size === loadedItems.length &&
287
+ this.$['*collectionErrors'].length === 0
288
288
  ) {
289
289
  this.emit(
290
290
  EventType.COMMON_UPLOAD_SUCCESS,
@@ -4,5 +4,5 @@
4
4
  * @returns {Promise<import('../index.js')>}
5
5
  */
6
6
  export function connectBlocksFrom(url: string, register?: boolean | undefined): Promise<typeof import("../index.js")>;
7
- export const UC_WINDOW_KEY: "UC";
7
+ export const LR_WINDOW_KEY: "LR";
8
8
  //# sourceMappingURL=connectBlocksFrom.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { registerBlocks } from './registerBlocks.js';
2
2
 
3
- export const UC_WINDOW_KEY = 'UC';
3
+ export const LR_WINDOW_KEY = 'LR';
4
4
 
5
5
  /**
6
6
  * @param {String} url Blocks pack url
@@ -13,8 +13,8 @@ export async function connectBlocksFrom(url, register = false) {
13
13
  resolve(null);
14
14
  return;
15
15
  }
16
- if (typeof window === 'object' && window[UC_WINDOW_KEY]) {
17
- resolve(window[UC_WINDOW_KEY]);
16
+ if (typeof window === 'object' && window[LR_WINDOW_KEY]) {
17
+ resolve(window[LR_WINDOW_KEY]);
18
18
  return;
19
19
  }
20
20
  let script = document.createElement('script');
@@ -25,7 +25,7 @@ export async function connectBlocksFrom(url, register = false) {
25
25
  };
26
26
  script.onload = () => {
27
27
  /** @type {import('../index.js')} */
28
- let blocks = window[UC_WINDOW_KEY];
28
+ let blocks = window[LR_WINDOW_KEY];
29
29
  register && registerBlocks(blocks);
30
30
  resolve(blocks);
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"registerBlocks.d.ts","sourceRoot":"","sources":["registerBlocks.js"],"names":[],"mappings":"AAAA,gDAAgD;AAChD;QADmB,MAAM,GAAE,GAAG;SA4B7B"}
1
+ {"version":3,"file":"registerBlocks.d.ts","sourceRoot":"","sources":["registerBlocks.js"],"names":[],"mappings":"AAAA,gDAAgD;AAChD;QADmB,MAAM,GAAE,GAAG;SAmB7B"}
@@ -10,22 +10,11 @@ export function registerBlocks(blockExports) {
10
10
  if (tagName.startsWith('-')) {
11
11
  tagName = tagName.replace('-', '');
12
12
  }
13
-
14
- let currentTagName = '';
15
- if (!tagName.startsWith('uc-')) {
16
- currentTagName = addPrefix('uc-', tagName);
17
- }
18
-
19
- let legacyTagName = '';
20
13
  if (!tagName.startsWith('lr-')) {
21
- legacyTagName = addPrefix('lr-', tagName);
14
+ tagName = 'lr-' + tagName;
22
15
  }
23
-
24
16
  if (blockExports[blockName].reg) {
25
- blockExports[blockName].reg(currentTagName);
26
- blockExports[blockName].reg(legacyTagName, true);
17
+ blockExports[blockName].reg(tagName);
27
18
  }
28
19
  }
29
20
  }
30
-
31
- const addPrefix = (prefix, name) => prefix + name;
@@ -1,4 +1,4 @@
1
- uc-activity-header {
1
+ lr-activity-header {
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  gap: var(--uc-padding);
@@ -8,7 +8,7 @@ uc-activity-header {
8
8
  font-size: 1em;
9
9
  }
10
10
 
11
- uc-activity-header > * {
11
+ lr-activity-header > * {
12
12
  display: flex;
13
13
  align-items: center;
14
14
  }
@@ -214,23 +214,23 @@ export class CameraSource extends UploaderBlock {
214
214
  }
215
215
 
216
216
  CameraSource.template = /* HTML */ `
217
- <uc-activity-header>
217
+ <lr-activity-header>
218
218
  <button type="button" class="uc-mini-btn" set="onclick: *historyBack">
219
- <uc-icon name="back"></uc-icon>
219
+ <lr-icon name="back"></lr-icon>
220
220
  </button>
221
221
  <div set="@hidden: !cameraSelectHidden">
222
- <uc-icon name="camera"></uc-icon>
222
+ <lr-icon name="camera"></lr-icon>
223
223
  <span l10n="caption-camera"></span>
224
224
  </div>
225
- <uc-select
225
+ <lr-select
226
226
  class="uc-camera-select"
227
227
  set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange"
228
228
  >
229
- </uc-select>
229
+ </lr-select>
230
230
  <button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal">
231
- <uc-icon name="close"></uc-icon>
231
+ <lr-icon name="close"></lr-icon>
232
232
  </button>
233
- </uc-activity-header>
233
+ </lr-activity-header>
234
234
  <div class="uc-content">
235
235
  <video
236
236
  autoplay
@@ -247,7 +247,7 @@ CameraSource.template = /* HTML */ `
247
247
  ></button>
248
248
  </div>
249
249
  <button type="button" class="uc-shot-btn" set="onclick: onShot; @disabled: shotBtnDisabled">
250
- <uc-icon name="camera"></uc-icon>
250
+ <lr-icon name="camera"></lr-icon>
251
251
  </button>
252
252
  </div>
253
253
  `;
@@ -1,4 +1,4 @@
1
- uc-camera-source {
1
+ lr-camera-source {
2
2
  position: relative;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -10,24 +10,24 @@ uc-camera-source {
10
10
  border-radius: var(--uc-radius);
11
11
  }
12
12
 
13
- [uc-modal] uc-camera-source {
13
+ [lr-modal] lr-camera-source {
14
14
  width: min(calc(var(--uc-dialog-max-width) - var(--uc-padding) * 2), calc(100vw - var(--uc-padding) * 2));
15
15
  height: 100vh;
16
16
  max-height: var(--modal-max-content-height);
17
17
  }
18
18
 
19
- uc-camera-source.uc-initialized {
19
+ lr-camera-source.uc-initialized {
20
20
  height: max-content;
21
21
  }
22
22
 
23
23
  @media only screen and (max-width: 430px) {
24
- uc-camera-source {
24
+ lr-camera-source {
25
25
  width: calc(100vw - var(--uc-padding) * 2);
26
26
  height: var(--modal-content-height-fill, 100%);
27
27
  }
28
28
  }
29
29
 
30
- uc-camera-source video {
30
+ lr-camera-source video {
31
31
  display: block;
32
32
  width: 100%;
33
33
  max-height: 100%;
@@ -37,7 +37,7 @@ uc-camera-source video {
37
37
  border-radius: var(--uc-radius);
38
38
  }
39
39
 
40
- uc-camera-source .uc-toolbar {
40
+ lr-camera-source .uc-toolbar {
41
41
  position: absolute;
42
42
  bottom: 0;
43
43
  display: flex;
@@ -47,7 +47,7 @@ uc-camera-source .uc-toolbar {
47
47
  background-color: var(--uc-background);
48
48
  }
49
49
 
50
- uc-camera-source .uc-content {
50
+ lr-camera-source .uc-content {
51
51
  display: flex;
52
52
  flex: 1;
53
53
  justify-content: center;
@@ -57,7 +57,7 @@ uc-camera-source .uc-content {
57
57
  overflow: hidden;
58
58
  }
59
59
 
60
- uc-camera-source .uc-message-box {
60
+ lr-camera-source .uc-message-box {
61
61
  display: flex;
62
62
  flex-direction: column;
63
63
  grid-gap: 40px;
@@ -67,12 +67,12 @@ uc-camera-source .uc-message-box {
67
67
  color: var(--uc-foreground);
68
68
  }
69
69
 
70
- uc-camera-source .uc-message-box button {
70
+ lr-camera-source .uc-message-box button {
71
71
  color: var(--uc-primary-foreground);
72
72
  background-color: var(--uc-primary);
73
73
  }
74
74
 
75
- uc-camera-source .uc-shot-btn {
75
+ lr-camera-source .uc-shot-btn {
76
76
  position: absolute;
77
77
  bottom: 20px;
78
78
  width: 58px;
@@ -87,21 +87,21 @@ uc-camera-source .uc-shot-btn {
87
87
  transform var(--uc-transition);
88
88
  }
89
89
 
90
- uc-camera-source .uc-shot-btn:hover {
90
+ lr-camera-source .uc-shot-btn:hover {
91
91
  transform: scale(1.05);
92
92
  opacity: 1;
93
93
  }
94
94
 
95
- uc-camera-source .uc-shot-btn:active {
95
+ lr-camera-source .uc-shot-btn:active {
96
96
  transform: scale(1);
97
97
  opacity: 1;
98
98
  }
99
99
 
100
- uc-camera-source .uc-shot-btn[disabled] {
100
+ lr-camera-source .uc-shot-btn[disabled] {
101
101
  bottom: -80px;
102
102
  }
103
103
 
104
- uc-camera-source .uc-shot-btn uc-icon svg {
104
+ lr-camera-source .uc-shot-btn lr-icon svg {
105
105
  width: 20px;
106
106
  height: 20px;
107
107
  }
@@ -19,7 +19,7 @@ import { TabId } from './toolbar-constants.js';
19
19
 
20
20
  export class CloudImageEditorBlock extends Block {
21
21
  ctxOwner = true;
22
- static styleAttrs = ['uc-cloud-image-editor'];
22
+ static styleAttrs = ['lr-cloud-image-editor'];
23
23
 
24
24
  constructor() {
25
25
  super();
@@ -108,7 +108,7 @@ export class CloudImageEditorBlock extends Block {
108
108
  }
109
109
 
110
110
  try {
111
- const cdnUrl = createCdnUrl(this.$['*originalUrl'], createCdnUrlModifiers('json'));
111
+ const cdnUrl = await this.proxyUrl(createCdnUrl(this.$['*originalUrl'], createCdnUrlModifiers('json')));
112
112
  const json = await fetch(cdnUrl).then((response) => response.json());
113
113
 
114
114
  const { width, height } = /** @type {{ width: number; height: number }} */ (json);
@@ -38,7 +38,7 @@ export class EditorButtonControl extends Block {
38
38
 
39
39
  EditorButtonControl.template = /* HTML */ `
40
40
  <button type="button" role="option">
41
- <uc-icon set="@name: icon;"></uc-icon>
41
+ <lr-icon set="@name: icon;"></lr-icon>
42
42
  <div class="uc-title" ref="title-el">{{title}}</div>
43
43
  </button>
44
44
  `;
@@ -4,10 +4,10 @@ export class EditorFilterControl extends EditorButtonControl {
4
4
  * @param {IntersectionObserverEntry[]} entries
5
5
  * @param {IntersectionObserver} observer
6
6
  */
7
- _observerCallback(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
7
+ _observerCallback(entries: IntersectionObserverEntry[], observer: IntersectionObserver): Promise<void>;
8
8
  _cancelPreload: (() => void) | undefined;
9
9
  _operation: string | undefined;
10
- _filter: any;
10
+ _filter: string | undefined;
11
11
  _observer: IntersectionObserver | undefined;
12
12
  _originalUrl: any;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EditorFilterControl.d.ts","sourceRoot":"","sources":["EditorFilterControl.js"],"names":[],"mappings":"AAMA;IAWE,sBA0BC;IAED;;;OAGG;IACH,2BAHW,yBAAyB,EAAE,YAC3B,oBAAoB,QAuB9B;IAfG,yCAA4B;IAiC5B,+BAA0B;IAC1B,aAAqB;IAKvB,4CAEE;IAGF,kBAA+B;CAgDlC;;;;oCAlJmC,0BAA0B"}
1
+ {"version":3,"file":"EditorFilterControl.d.ts","sourceRoot":"","sources":["EditorFilterControl.js"],"names":[],"mappings":"AAOA;IAeE,sBA2BC;IAED;;;OAGG;IACH,2BAHW,yBAAyB,EAAE,YAC3B,oBAAoB,iBAuB9B;IAfG,yCAA4B;IAoC1B,+BAA0B;IAC1B,4BAAqB;IAMzB,4CAEE;IAGF,kBAA+B;CAgDlC;;;;oCA3JmC,0BAA0B"}