ablok-components 0.3.1 → 0.3.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.
@@ -0,0 +1,46 @@
1
+ export declare function useFileUpload(props?: any, emit?: any): {
2
+ pending: import('../../vue/dist/vue.esm-bundler.js').Ref<boolean, boolean>;
3
+ files: import('../../vue/dist/vue.esm-bundler.js').Ref<{
4
+ readonly lastModified: number;
5
+ readonly name: string;
6
+ readonly webkitRelativePath: string;
7
+ readonly size: number;
8
+ readonly type: string;
9
+ arrayBuffer: () => Promise<ArrayBuffer>;
10
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
11
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
12
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
13
+ text: () => Promise<string>;
14
+ }[], File[] | {
15
+ readonly lastModified: number;
16
+ readonly name: string;
17
+ readonly webkitRelativePath: string;
18
+ readonly size: number;
19
+ readonly type: string;
20
+ arrayBuffer: () => Promise<ArrayBuffer>;
21
+ bytes: () => Promise<Uint8Array<ArrayBuffer>>;
22
+ slice: (start?: number, end?: number, contentType?: string) => Blob;
23
+ stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
24
+ text: () => Promise<string>;
25
+ }[]>;
26
+ dataUrls: import('../../vue/dist/vue.esm-bundler.js').Ref<{
27
+ type: string;
28
+ src: string;
29
+ }[], {
30
+ type: string;
31
+ src: string;
32
+ }[] | {
33
+ type: string;
34
+ src: string;
35
+ }[]>;
36
+ imgLoaded: import('../../vue/dist/vue.esm-bundler.js').Ref<boolean, boolean>;
37
+ isDragging: import('../../vue/dist/vue.esm-bundler.js').Ref<boolean, boolean>;
38
+ thumbnails: import('../../vue/dist/vue.esm-bundler.js').ComputedRef<any>;
39
+ uploadFile: (file: File) => Promise<string>;
40
+ removeFile: (index: number | string) => void;
41
+ dragStart: (event: DragEvent) => void;
42
+ dragStop: (event: DragEvent) => void;
43
+ dragDrop: (event: DragEvent) => void;
44
+ setupDragAndDrop: () => void;
45
+ cleanupDragAndDrop: () => void;
46
+ };
package/dist/i18n.d.ts CHANGED
@@ -46,6 +46,7 @@ declare const i18n: import('vue-i18n').I18n<{
46
46
  readMore: string;
47
47
  download: string;
48
48
  selectFile: string;
49
+ apply: string;
49
50
  };
50
51
  form: {
51
52
  mandatoryNote: string;
package/dist/index.d.ts CHANGED
@@ -41,3 +41,7 @@ export { default as PopoverDialog } from './components/templates/popover-dialog/
41
41
  export { default as SortableList } from './components/templates/sortable-list/sortable-list.vue';
42
42
  export { default as TouchWrapper } from './components/templates/touch-wrapper/touch-wrapper.vue';
43
43
  export { default as CanvasConfetti } from './components/atoms/canvas-confetti/canvas-confetti.vue';
44
+ export { default as ImageCrop } from './components/molecules/image-crop/image-crop.vue';
45
+ export { default as ImageResize } from './components/molecules/image-resize/image-resize.vue';
46
+ export { default as ImageCropResize } from './components/molecules/image-crop-resize/image-crop-resize.vue';
47
+ export { default as ImageUpload } from './components/molecules/image-upload/image-upload.vue';
@@ -45,6 +45,7 @@ export declare const messages: {
45
45
  readMore: string;
46
46
  download: string;
47
47
  selectFile: string;
48
+ apply: string;
48
49
  };
49
50
  form: {
50
51
  mandatoryNote: string;
@@ -876,5 +876,14 @@
876
876
  <symbol id="icon-drag" viewBox="0 0 32 32">
877
877
  <path d="M12.16 10.48c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM19.84 10.48c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM22 16c0 1.193-0.967 2.16-2.16 2.16s-2.16-0.967-2.16-2.16c0-1.193 0.967-2.16 2.16-2.16s2.16 0.967 2.16 2.16zM12.16 18.16c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM22 23.68c0 1.193-0.967 2.16-2.16 2.16s-2.16-0.967-2.16-2.16c0-1.193 0.967-2.16 2.16-2.16s2.16 0.967 2.16 2.16zM12.16 25.84c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16z"></path>
878
878
  </symbol>
879
+ <symbol id="icon-drag" viewBox="0 0 32 32">
880
+ <path d="M12.16 10.48c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM19.84 10.48c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM22 16c0 1.193-0.967 2.16-2.16 2.16s-2.16-0.967-2.16-2.16c0-1.193 0.967-2.16 2.16-2.16s2.16 0.967 2.16 2.16zM12.16 18.16c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16zM22 23.68c0 1.193-0.967 2.16-2.16 2.16s-2.16-0.967-2.16-2.16c0-1.193 0.967-2.16 2.16-2.16s2.16 0.967 2.16 2.16zM12.16 25.84c1.193 0 2.16-0.967 2.16-2.16s-0.967-2.16-2.16-2.16c-1.193 0-2.16 0.967-2.16 2.16s0.967 2.16 2.16 2.16z"></path>
881
+ </symbol>
882
+ <symbol id="icon-image-upscale" viewBox="0 0 32 32">
883
+ <path d="M5.999 2.724c-1.488 0.249-2.717 1.34-3.18 2.823-0.121 0.388-0.125 0.457-0.125 2.297v1.897l0.161 0.263c0.536 0.871 1.755 0.871 2.291 0l0.161-0.261 0.027-1.712c0.031-1.904 0.035-1.929 0.401-2.296 0.253-0.252 0.459-0.337 0.969-0.403 0.485-0.061 0.804-0.229 1.032-0.544 0.54-0.745 0.193-1.784-0.683-2.048-0.267-0.080-0.639-0.085-1.055-0.016zM11.593 2.743c-0.305 0.096-0.585 0.323-0.756 0.612-0.121 0.208-0.144 0.307-0.144 0.645 0 0.341 0.021 0.437 0.148 0.652 0.167 0.284 0.424 0.5 0.719 0.605 0.291 0.104 4.589 0.104 4.88 0 0.295-0.105 0.552-0.321 0.719-0.605 0.127-0.215 0.148-0.311 0.148-0.652 0-0.339-0.023-0.437-0.144-0.645-0.176-0.297-0.452-0.517-0.776-0.615-0.34-0.103-4.465-0.1-4.793 0.003zM20.927 2.743c-0.305 0.096-0.585 0.323-0.756 0.612-0.121 0.208-0.144 0.307-0.144 0.645 0 0.341 0.021 0.437 0.148 0.652 0.081 0.137 0.231 0.315 0.333 0.392 0.359 0.275 0.447 0.284 2.424 0.287l1.84 0.003-2.273 2.28c-1.251 1.255-2.315 2.361-2.364 2.46-0.305 0.607-0.060 1.395 0.543 1.749 0.22 0.129 0.312 0.151 0.656 0.149 0.283 0 0.455-0.029 0.587-0.099 0.103-0.053 1.212-1.12 2.464-2.369l2.277-2.271 0.016 1.921 0.016 1.92 0.161 0.263c0.536 0.871 1.755 0.871 2.291 0l0.161-0.263 0.015-3.657c0.015-3.299 0.007-3.68-0.073-3.889-0.121-0.321-0.372-0.589-0.688-0.736l-0.267-0.124-3.573 0.003c-2.765 0.003-3.623 0.019-3.793 0.072zM4.636 13.431c-0.895 0.235-1.652 1-1.889 1.913-0.068 0.261-0.080 1.123-0.080 5.989 0 6.187-0.011 5.961 0.3 6.573 0.181 0.359 0.768 0.945 1.127 1.127 0.612 0.311 0.387 0.3 6.573 0.3s5.961 0.011 6.573-0.3c0.355-0.18 0.944-0.767 1.121-1.117 0.316-0.621 0.305-0.404 0.304-6.564 0-6.117 0.005-5.992-0.291-6.575-0.18-0.356-0.645-0.845-1.019-1.069-0.637-0.384-0.355-0.368-6.689-0.368-5.197 0-5.709 0.007-6.031 0.091zM27.593 14.743c-0.305 0.096-0.585 0.323-0.756 0.612l-0.144 0.245v4.808l0.161 0.263c0.536 0.871 1.755 0.871 2.291 0l0.161-0.263v-4.808l-0.144-0.245c-0.325-0.553-0.963-0.801-1.569-0.612zM16 19.047v3.045l-0.469-0.445c-0.735-0.7-1.319-0.953-2.197-0.953-0.252 0-0.599 0.037-0.771 0.081-0.727 0.189-0.765 0.221-3.711 3.156l-2.748 2.736h-0.771v-10.667h10.667v3.047zM14.733 24.627l1.267 1.265v0.775h-6.107l1.653-1.653c1.287-1.287 1.683-1.653 1.785-1.653 0.104 0 0.424 0.289 1.401 1.267zM27.593 24.076c-0.529 0.165-0.844 0.579-0.924 1.212-0.028 0.219-0.076 0.464-0.107 0.545-0.095 0.248-0.327 0.511-0.584 0.663l-0.245 0.144-1.707 0.028c-1.165 0.020-1.755 0.049-1.857 0.093-0.261 0.113-0.517 0.341-0.665 0.593-0.121 0.208-0.144 0.307-0.144 0.645 0 0.343 0.021 0.436 0.151 0.656 0.173 0.295 0.492 0.545 0.799 0.628 0.14 0.039 0.828 0.051 2.005 0.037 1.692-0.020 1.813-0.028 2.165-0.143 1.311-0.429 2.303-1.431 2.7-2.725 0.093-0.305 0.123-0.533 0.124-0.96 0.003-0.515-0.009-0.58-0.141-0.805-0.325-0.553-0.963-0.801-1.569-0.612z"></path>
884
+ </symbol>
885
+ <symbol id="icon-crop" viewBox="0 0 32 32">
886
+ <path d="M7.593 1.409c-0.305 0.096-0.585 0.323-0.756 0.612l-0.144 0.245-0.016 2.2-0.015 2.2h-2.069c-2.249 0-2.383 0.015-2.751 0.295-0.107 0.081-0.26 0.259-0.339 0.393-0.121 0.208-0.144 0.307-0.144 0.645 0 0.341 0.021 0.437 0.148 0.652 0.081 0.137 0.231 0.315 0.333 0.392 0.364 0.277 0.425 0.284 2.704 0.287l2.119 0.003 0.029 12.773 0.125 0.373c0.439 1.307 1.395 2.263 2.701 2.701l0.373 0.125 12.769 0.029 0.015 2.203 0.016 2.203 0.161 0.263c0.091 0.147 0.273 0.337 0.415 0.433 0.628 0.421 1.469 0.228 1.876-0.433l0.161-0.263 0.016-2.204 0.015-2.204 2.119-0.003c2.277-0.003 2.339-0.009 2.703-0.287 0.103-0.077 0.252-0.255 0.333-0.392 0.127-0.215 0.148-0.311 0.148-0.652 0-0.339-0.023-0.437-0.144-0.645-0.079-0.135-0.232-0.312-0.339-0.393-0.368-0.28-0.501-0.295-2.751-0.295h-2.071l-0.029-12.773-0.125-0.373c-0.44-1.309-1.42-2.287-2.7-2.692l-0.428-0.135-12.716-0.029-0.015-2.199-0.016-2.199-0.144-0.245c-0.325-0.553-0.963-0.801-1.569-0.612zM21.747 9.415c0.372 0.111 0.728 0.467 0.839 0.839 0.071 0.237 0.081 1.064 0.081 6.344v6.071l-12.4-0.028-0.245-0.144c-0.135-0.079-0.309-0.229-0.388-0.332-0.315-0.412-0.3-0.088-0.3-6.731v-6.1h6.071c5.279 0 6.105 0.011 6.343 0.081z"></path>
887
+ </symbol>
879
888
  </defs>
880
889
  </svg>
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Media object interface for image/file uploads
3
+ */
4
+ export interface IMediaObject {
5
+ /** The source URL or data URL of the media */
6
+ src: string;
7
+ /** The MIME type of the media (e.g., 'image/png', 'image/jpeg') */
8
+ type: string;
9
+ }
10
+ /**
11
+ * Single media value (non-array)
12
+ */
13
+ export type MediaValue = IMediaObject | string | undefined;
@@ -1,4 +1,11 @@
1
1
  export declare function uniqueId(): string;
2
+ export declare function fileToDataUrl(file: File): Promise<any>;
3
+ export declare function dataURItoBlob(dataURI: any): Blob;
4
+ export declare function getExtensionFromMimeType(mimeType: string): string;
5
+ export declare function srcToFile(src: string, fileName: string, mimeType: string): Promise<File>;
6
+ export declare function loadImageFromDataUrl(dataUrl: string): Promise<HTMLImageElement>;
7
+ export declare function resizeImageElementToDataUrl(img: HTMLImageElement, width: number, height: number, mimeType?: string, quality?: number): string;
8
+ export declare function resizeImageFileByMaxWidth(file: File, maxWidth: number, quality?: number): Promise<File>;
2
9
  /**
3
10
  * Simple input sanitizer for user input
4
11
  * Removes/escapes dangerous patterns while preserving normal text
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "scripts": {
6
6
  "dev": "vite --host",
7
7
  "story:dev": "histoire dev",
@@ -34,6 +34,7 @@
34
34
  "lodash": "^4.17.23",
35
35
  "ofetch": "^1.5.1",
36
36
  "qr-code-styling": "^1.9.2",
37
+ "vue-advanced-cropper": "^2.8.9",
37
38
  "vue-i18n": "^11.2.8"
38
39
  },
39
40
  "peerDependencies": {