@uploadcare/file-uploader 1.13.0-alpha.1 → 1.13.0-alpha.2

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 (42) hide show
  1. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  2. package/abstract/UploaderPublicApi.js +11 -4
  3. package/blocks/CameraSource/CameraSource.d.ts +22 -12
  4. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  5. package/blocks/CameraSource/CameraSource.js +83 -81
  6. package/blocks/CameraSource/camera-source.css +0 -1
  7. package/blocks/CloudImageEditor/src/lib/parseTabs.js +2 -2
  8. package/blocks/Config/Config.d.ts +3 -3
  9. package/blocks/Config/Config.d.ts.map +1 -1
  10. package/blocks/Config/Config.js +3 -13
  11. package/blocks/Config/initialConfig.d.ts.map +1 -1
  12. package/blocks/Config/initialConfig.js +3 -4
  13. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  14. package/blocks/Config/normalizeConfigValue.js +7 -20
  15. package/blocks/UploadList/upload-list.css +1 -0
  16. package/blocks/utils/comma-separated.d.ts +1 -1
  17. package/blocks/utils/comma-separated.d.ts.map +1 -1
  18. package/blocks/utils/comma-separated.js +2 -5
  19. package/index.ssr.d.ts +14 -0
  20. package/index.ssr.d.ts.map +1 -1
  21. package/index.ssr.js +14 -5
  22. package/package.json +4 -2
  23. package/types/exported.d.ts +64 -81
  24. package/web/file-uploader.iife.min.js +4 -4
  25. package/web/file-uploader.min.js +4 -4
  26. package/web/uc-basic.min.css +1 -1
  27. package/web/uc-cloud-image-editor.min.js +4 -4
  28. package/web/uc-file-uploader-inline.min.css +1 -1
  29. package/web/uc-file-uploader-inline.min.js +4 -4
  30. package/web/uc-file-uploader-minimal.min.css +1 -1
  31. package/web/uc-file-uploader-minimal.min.js +3 -3
  32. package/web/uc-file-uploader-regular.min.css +1 -1
  33. package/web/uc-file-uploader-regular.min.js +4 -4
  34. package/blocks/CameraSource/constants.d.ts +0 -15
  35. package/blocks/CameraSource/constants.d.ts.map +0 -1
  36. package/blocks/CameraSource/constants.js +0 -17
  37. package/blocks/Config/assertions.d.ts +0 -5
  38. package/blocks/Config/assertions.d.ts.map +0 -1
  39. package/blocks/Config/assertions.js +0 -37
  40. package/blocks/Config/side-effects.d.ts +0 -7
  41. package/blocks/Config/side-effects.d.ts.map +0 -1
  42. package/blocks/Config/side-effects.js +0 -32
@@ -1,15 +0,0 @@
1
- export const CameraSourceTypes: Readonly<{
2
- PHOTO: "photo";
3
- VIDEO: "video";
4
- }>;
5
- export const CameraSourceEvents: Readonly<{
6
- IDLE: "idle";
7
- SHOT: "shot";
8
- PLAY: "play";
9
- PAUSE: "pause";
10
- RESUME: "resume";
11
- STOP: "stop";
12
- RETAKE: "retake";
13
- ACCEPT: "accept";
14
- }>;
15
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GAWG"}
@@ -1,17 +0,0 @@
1
- export const CameraSourceTypes = Object.freeze({
2
- PHOTO: 'photo',
3
- VIDEO: 'video',
4
- });
5
-
6
- export const CameraSourceEvents = Object.freeze({
7
- IDLE: 'idle',
8
- SHOT: 'shot',
9
-
10
- PLAY: 'play',
11
- PAUSE: 'pause',
12
- RESUME: 'resume',
13
- STOP: 'stop',
14
-
15
- RETAKE: 'retake',
16
- ACCEPT: 'accept',
17
- });
@@ -1,5 +0,0 @@
1
- /** Runs on every config change and warns about potential issues. */
2
- export const runAssertions: ((cfg: import('../../types').ConfigType) => void) & {
3
- cancel: () => void;
4
- };
5
- //# sourceMappingURL=assertions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["assertions.js"],"names":[],"mappings":"AAyBA,oEAAoE;AACpE,mCACc,OAAO,aAAa,EAAE,UAAU;;EAS5C"}
@@ -1,37 +0,0 @@
1
- import { warnOnce } from '../../utils/warnOnce.js';
2
- import { debounce } from '../utils/debounce.js';
3
-
4
- const ASSERTIONS = [
5
- {
6
- test: (cfg) => cfg.accept && !!cfg.imgOnly,
7
- message:
8
- 'There could be a mistake.\n' +
9
- 'Both `accept` and `imgOnly` parameters are set.\n' +
10
- 'The value of `accept` will be concatenated with the internal image mime types list.',
11
- },
12
- {
13
- test: (cfg) => cfg.enableVideoRecording !== null,
14
- message:
15
- 'The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\n' +
16
- 'Please use the `cameraModes` parameter instead.',
17
- },
18
- {
19
- test: (cfg) => cfg.defaultCameraMode !== null,
20
- message:
21
- 'The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\n' +
22
- 'Please use the `cameraModes` parameter instead.',
23
- },
24
- ];
25
-
26
- /** Runs on every config change and warns about potential issues. */
27
- export const runAssertions = debounce(
28
- /** @param {import('../../types').ConfigType} cfg */
29
- (cfg) => {
30
- for (const { test, message } of ASSERTIONS) {
31
- if (test(cfg)) {
32
- warnOnce(message);
33
- }
34
- }
35
- },
36
- 0,
37
- );
@@ -1,7 +0,0 @@
1
- export function runSideEffects<T extends keyof import("../../types").ConfigType>({ key, value, setValue, getValue }: {
2
- key: T;
3
- value: import("../../types").ConfigType[T];
4
- setValue: (key: T, value: import("../../types").ConfigType[T]) => void;
5
- getValue: (key: T) => import("../../types").ConfigType[T];
6
- }): void;
7
- //# sourceMappingURL=side-effects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"side-effects.d.ts","sourceRoot":"","sources":["side-effects.js"],"names":[],"mappings":"AAWO;;;sEAJgE,IAAI;;SAwB1E"}
@@ -1,32 +0,0 @@
1
- import { deserializeCsv, serializeCsv } from '../utils/comma-separated.js';
2
-
3
- /**
4
- * @template {keyof import('../../types').ConfigType} T
5
- * @param {{
6
- * key: T;
7
- * value: import('../../types').ConfigType[T];
8
- * setValue: (key: T, value: import('../../types').ConfigType[T]) => void;
9
- * getValue: (key: T) => import('../../types').ConfigType[T];
10
- * }} options
11
- */
12
- export const runSideEffects = ({ key, value, setValue, getValue }) => {
13
- if (key === 'enableVideoRecording' && value !== null) {
14
- let cameraModes = deserializeCsv(getValue('cameraModes'));
15
- if (value && !cameraModes.includes('video')) {
16
- cameraModes = cameraModes.concat('video');
17
- } else if (!value) {
18
- cameraModes = cameraModes.filter((mode) => mode !== 'video');
19
- }
20
- setValue('cameraModes', serializeCsv(cameraModes));
21
- }
22
-
23
- if (key === 'defaultCameraMode' && value !== null) {
24
- let cameraModes = deserializeCsv(getValue('cameraModes'));
25
- cameraModes = cameraModes.sort((a, b) => {
26
- if (a === value) return -1;
27
- if (b === value) return 1;
28
- return 0;
29
- });
30
- setValue('cameraModes', serializeCsv(cameraModes));
31
- }
32
- };