@v1nt1248/3nclient-lib 0.1.57 → 0.1.59

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 (38) hide show
  1. package/README.md +2 -0
  2. package/dist/directives/index.d.ts +2 -1
  3. package/dist/directives/ui3n-title.d.ts +3 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/style.css +1 -1
  6. package/dist/ui3n-components.d.ts +2 -0
  7. package/dist/ui3n-components.js +7248 -7126
  8. package/dist/ui3n-plugins.js +29 -29
  9. package/dist/ui3n-utils.js +1338 -1236
  10. package/dist/utils/files/b64-to-blob.d.ts +1 -0
  11. package/dist/utils/files/blob-to-b64.d.ts +1 -0
  12. package/dist/utils/files/create-video-thumbnail.d.ts +2 -0
  13. package/dist/utils/files/format-file-size.d.ts +1 -0
  14. package/dist/utils/files/get-file-extension.d.ts +1 -0
  15. package/dist/utils/files/is-file-image.d.ts +1 -0
  16. package/dist/utils/files/is-file-video.d.ts +1 -0
  17. package/dist/utils/files/resize-image.d.ts +7 -0
  18. package/dist/utils/files/uint8-to-b64.d.ts +1 -0
  19. package/dist/utils/for-we3n.d.ts +2 -0
  20. package/dist/utils/get-random-id.d.ts +1 -0
  21. package/dist/utils/index.d.ts +20 -3
  22. package/dist/utils/round.d.ts +8 -0
  23. package/dist/utils/ui/capitalize.d.ts +1 -0
  24. package/dist/utils/ui/get-element-color.d.ts +1 -0
  25. package/dist/utils/ui/has-slot-content.d.ts +2 -0
  26. package/dist/utils/ui/html2text.d.ts +1 -0
  27. package/dist/utils/ui/invert-color.d.ts +1 -0
  28. package/dist/utils/ui/mark-search.d.ts +1 -0
  29. package/dist/utils/ui/prepare-date-as-string.d.ts +8 -0
  30. package/dist/variables.css +9 -7
  31. package/package.json +1 -1
  32. package/src/components/ui3n-button/ui3n-button.vue +6 -1
  33. package/src/components/ui3n-drop-files/ui3n-drop-files.vue +27 -23
  34. package/src/components/ui3n-emoji/ui3n-emoji.vue +1 -1
  35. package/src/components/ui3n-table/ui3n-table-sort-icon.vue +2 -2
  36. package/dist/utils/common.d.ts +0 -12
  37. package/dist/utils/ui.d.ts +0 -15
  38. /package/dist/utils/{selection.d.ts → ui/selection.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ export declare function b64ToBlob(b64: string, type?: string): Blob;
@@ -0,0 +1 @@
1
+ export declare function blobToB64(blob: Blob): Promise<string>;
@@ -0,0 +1,2 @@
1
+ import { Nullable } from '../../components/types';
2
+ export declare function createVideoThumbnail(file: File, targetSize: number, seekTo: number): Promise<Nullable<string>>;
@@ -0,0 +1 @@
1
+ export declare function formatFileSize(size?: number): string;
@@ -0,0 +1 @@
1
+ export declare function getFileExtension(fullName?: string): string;
@@ -0,0 +1 @@
1
+ export declare function isFileImage(type: string, fullName?: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function isFileVideo(type: string, fullName?: string): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * resize image
3
+ * @param imageBase64 {string} - image (base64)
4
+ * @param targetSize {number} - target size of the smaller side of the image
5
+ * @return {string} (base64)
6
+ */
7
+ export declare function resizeImage(imageBase64: string, targetSize: number): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function uint8ToBase64(inputData: Uint8Array, type?: string): string;
@@ -0,0 +1,2 @@
1
+ export declare function getDeliveryErrors(progress: web3n.asmail.DeliveryProgress): Record<string, string>;
2
+ export declare function transformFileToWeb3NFile(file: File): Promise<web3n.files.File | undefined>;
@@ -0,0 +1 @@
1
+ export declare function getRandomId(numOfChars: number): string;
@@ -2,9 +2,26 @@ export * from './processes/deferred';
2
2
  export * from './processes/sleep';
3
3
  export * from './processes/single';
4
4
  export * from './processes/named-procs';
5
+ export * from './round';
6
+ export * from './get-random-id';
5
7
  export * from './textarea-max-rows';
6
- export * from './common';
7
- export * from './ui';
8
- export * from './selection';
8
+ export * from './for-we3n';
9
+ export * from './ui/selection';
10
+ export * from './ui/mark-search';
11
+ export * from './ui/has-slot-content';
12
+ export * from './ui/get-element-color';
13
+ export * from './ui/invert-color';
14
+ export * from './ui/html2text';
15
+ export * from './ui/prepare-date-as-string';
16
+ export * from './ui/capitalize';
17
+ export * from './files/format-file-size';
18
+ export * from './files/get-file-extension';
19
+ export * from './files/is-file-image';
20
+ export * from './files/is-file-video';
21
+ export * from './files/blob-to-b64';
22
+ export * from './files/b64-to-blob';
23
+ export * from './files/uint8-to-b64';
24
+ export * from './files/resize-image';
25
+ export * from './files/create-video-thumbnail';
9
26
  export { SQLiteOn3NStorage } from './sqlite-on-3nstorage';
10
27
  export type { BindParams, Database, QueryExecResult } from './sqlite-on-3nstorage';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Rounding with a given accuracy
3
+ * @param num {number}
4
+ * @param precision {number} - rounding accuracy (number of digits after the decimal point
5
+ * indicated with the "-" sign)
6
+ * @return {number}
7
+ */
8
+ export declare function round(num: number, precision: number): number;
@@ -0,0 +1 @@
1
+ export declare function capitalize(text: string): string;
@@ -0,0 +1 @@
1
+ export declare function getElementColor(initials?: string): string;
@@ -0,0 +1,2 @@
1
+ import { Slot } from 'vue';
2
+ export declare function hasSlotContent(slot?: Slot, slotProps?: {}): boolean;
@@ -0,0 +1 @@
1
+ export declare function html2text(html: string): string;
@@ -0,0 +1 @@
1
+ export declare function invertColor(color: string): string;
@@ -0,0 +1 @@
1
+ export declare function markSearch(str: string, search: string): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @param {number} ts - timestamp
3
+ * @return {string} - times as string%
4
+ * If TS is today, then Date returns as a string 'HH:mm'
5
+ * If ts is period between 3 day before today and today, then Date returns as a string '{1|2|3} days ago'
6
+ * Else Date returns as a string 'YYYY-MM-DD'
7
+ */
8
+ export declare function prepareDateAsSting(ts: number): string;
@@ -6,9 +6,12 @@
6
6
  --spacing-l: 32px;
7
7
  --spacing-xl: 40px;
8
8
  --spacing-xxl: 48px;
9
-
10
9
  --white-inf: rgba(255, 255, 255, 0);
11
10
  --white-100: #fff;
11
+ --white-4: rgba(250, 250, 250, 0.04);
12
+ --white-8: rgba(250, 250, 250, 0.08);
13
+ --white-12: rgba(250, 250, 250, 0.12);
14
+ --white-24: rgba(250, 250, 250, 0.24);
12
15
  --black-inf: rgba(0, 0, 0, 0);
13
16
  --black-4: rgba(0, 0, 0, 0.04);
14
17
  --black-8: rgba(0, 0, 0, 0.08);
@@ -100,7 +103,6 @@
100
103
  --files-pdf-secondary: #fdc7c3;
101
104
  --files-image-primary: #4744e4;
102
105
  --files-image-secondary: #c9c8ff;
103
-
104
106
  --font-6: 6px;
105
107
  --font-8: 8px;
106
108
  --font-9: 9px;
@@ -744,7 +746,6 @@
744
746
  --color-icon-chat-bubble-user-selected: var(--accent-content-default);
745
747
  --color-icon-chat-bubble-other-default: var(--default-content-default);
746
748
  --color-icon-chat-bubble-other-selected: var(--accent-content-selected);
747
-
748
749
  --effect-dropdown-shadow: 0 0 4px 0 var(--shadow-close), 0 4px 12px 0 var(--shadow-far);
749
750
  }
750
751
 
@@ -752,7 +753,7 @@ html {
752
753
  --shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2);
753
754
  --shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14);
754
755
  --shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);
755
-
756
+
756
757
  overflow: hidden;
757
758
  font-family: Manrope, sans-serif;
758
759
  }
@@ -815,7 +816,7 @@ div {
815
816
  .ui3n-ripple {
816
817
  --ui3n-ripple-duration: 400ms;
817
818
  --ui3n-ripple-bg-color: rgba(255, 255, 255, 0.7);
818
-
819
+
819
820
  position: absolute;
820
821
  border-radius: 50%;
821
822
  transform: scale(0);
@@ -833,9 +834,10 @@ div {
833
834
  font-size: var(--font-11);
834
835
  line-height: var(--font-12);
835
836
  font-weight: 400;
836
- background-color: var(--color-bg-control-secondary-default);
837
- color: var(--color-text-control-primary-default);
837
+ word-wrap: break-word;
838
+ white-space: break-spaces;
838
839
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2),
839
840
  0 1px 1px 0 rgba(0, 0, 0, 0.14),
840
841
  0 1px 3px 0 rgba(0, 0, 0, 0.12);
842
+ z-index: 1000;
841
843
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.1.57",
5
+ "version": "0.1.59",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [
@@ -290,8 +290,13 @@ onMounted(() => {
290
290
  flex-direction: row-reverse;
291
291
  }
292
292
 
293
- .buttonIcon,
293
+ .buttonIcon {
294
+ pointer-events: none;
295
+ }
296
+
294
297
  .text {
298
+ display: inline-block;
299
+ max-width: 100%;
295
300
  pointer-events: none;
296
301
  }
297
302
 
@@ -75,41 +75,45 @@
75
75
  :class="[
76
76
  $style.ui3nDropFiles,
77
77
  permanentDisplay && $style.ui3nDropFilesWithBorder,
78
- isOverDropPlace || isOverDropZone && $style.ui3nDropFilesWithAccentBorder
78
+ (isOverDropPlace || isOverDropZone) && $style.ui3nDropFilesWithAccentBorder
79
79
  ]"
80
80
  @dragenter="onDragenter"
81
81
  @dragleave="onDragleave"
82
82
  >
83
83
  <slot />
84
+
84
85
  <div
86
+ v-if="permanentDisplay || isOverDropPlace || isOverDropZone"
85
87
  :class="$style.ui3nDropFilesDropzone"
86
88
  @dragenter="onDropzoneDragenter"
87
89
  @dragover="onDropzoneDragover"
88
90
  @dragleave="onDropzoneDragleave"
89
91
  @drop="onDrop"
90
92
  >
91
- <template v-if="permanentDisplay || isOverDropPlace || isOverDropZone">
92
- <h3 :class="$style.ui3nDropFilesDropzoneTitle">
93
- {{ title }}
94
- </h3>
95
-
96
- <div :class="$style.ui3nDropFilesDropzoneIcon">
97
- <svg
98
- :width="wrapperElementMinSize * 0.35"
99
- :height="wrapperElementMinSize * 0.35"
100
- viewBox="0 0 192 192"
101
- fill="none"
102
- xmlns="http://www.w3.org/2000/svg"
103
- >
104
- <path
105
- d="M51 152C47.9333 152 45.3333 150.934 43.2 148.8C41.0667 146.667 40 144.067 40 141V119.8H46.2V141C46.2 142.2 46.7 143.3 47.7 144.3C48.7 145.3 49.8 145.8 51 145.8H141C142.2 145.8 143.3 145.3 144.3 144.3C145.3 143.3 145.8 142.2 145.8 141V119.8H152V141C152 144.067 150.933 146.667 148.8 148.8C146.667 150.934 144.067 152 141 152H51ZM93 122.4V49.2002L72.8 69.2002L68.4 65.0002L96 37.2002L123.6 65.0002L119.2 69.2002L99 49.2002V122.4H93Z"
106
- fill="var(--color-icon-control-primary-default)"
107
- />
108
- </svg>
109
- </div>
110
- </template>
111
-
112
- <div :class="$style.ui3nDropFilesDropzoneAdditional">
93
+ <h3 :class="$style.ui3nDropFilesDropzoneTitle">
94
+ {{ title }}
95
+ </h3>
96
+
97
+ <div :class="$style.ui3nDropFilesDropzoneIcon">
98
+ <svg
99
+ :width="wrapperElementMinSize * 0.35"
100
+ :height="wrapperElementMinSize * 0.35"
101
+ viewBox="0 0 192 192"
102
+ fill="none"
103
+ xmlns="http://www.w3.org/2000/svg"
104
+ >
105
+ <path
106
+ d="M51 152C47.9333 152 45.3333 150.934 43.2 148.8C41.0667 146.667 40 144.067 40 141V119.8H46.2V141C46.2 142.2 46.7 143.3 47.7 144.3C48.7 145.3 49.8 145.8 51 145.8H141C142.2 145.8 143.3 145.3 144.3 144.3C145.3 143.3 145.8 142.2 145.8 141V119.8H152V141C152 144.067 150.933 146.667 148.8 148.8C146.667 150.934 144.067 152 141 152H51ZM93 122.4V49.2002L72.8 69.2002L68.4 65.0002L96 37.2002L123.6 65.0002L119.2 69.2002L99 49.2002V122.4H93Z"
107
+ fill="var(--color-icon-control-primary-default)"
108
+ />
109
+ </svg>
110
+ </div>
111
+
112
+ <div
113
+ :class="$style.ui3nDropFilesDropzoneAdditional"
114
+ @dragenter.stop.prevent
115
+ @dragleave.stop.prevent
116
+ >
113
117
  <slot name="additional-text" />
114
118
  </div>
115
119
  </div>
@@ -17,7 +17,7 @@
17
17
 
18
18
  onMounted(() => {
19
19
  if (emojiElement.value) {
20
- emojiElement.value.style.setProperty('--emoji-size', `${props.size}px`);
20
+ emojiElement.value.style.setProperty('--ui3n-emoji-size', `${props.size}px`);
21
21
  }
22
22
  });
23
23
 
@@ -12,8 +12,8 @@
12
12
  <template>
13
13
  <transition mode="out-in" name="fade">
14
14
  <ui3n-icon
15
- :key="value === 'asc' ? 'round-arrow-downward' : 'round-arrow-upward'"
16
- :icon="value === 'asc' ? 'round-arrow-downward' : 'round-arrow-upward'"
15
+ :key="value === 'asc' ? 'round-arrow-upward' : 'round-arrow-downward'"
16
+ :icon="value === 'asc' ? 'round-arrow-upward' : 'round-arrow-downward'"
17
17
  :width="iconSize"
18
18
  :height="iconSize"
19
19
  :color="iconColor"
@@ -1,12 +0,0 @@
1
- export declare function getRandomId(numOfChars: number): string;
2
- export declare function getDeliveryErrors(progress: web3n.asmail.DeliveryProgress): Record<string, string>;
3
- export declare function transformFileToWeb3NFile(file: File): Promise<web3n.files.File | undefined>;
4
- export declare function markSearch(str: string, search: string): string;
5
- /**
6
- * Rounding with a given accuracy
7
- * @param num {number}
8
- * @param precision {number} - rounding accuracy (number of digits after the decimal point
9
- * indicated with the "-" sign)
10
- * @return {number}
11
- */
12
- export declare function round(num: number, precision: number): number;
@@ -1,15 +0,0 @@
1
- import { Slot } from 'vue';
2
- export declare function hasSlotContent(slot?: Slot, slotProps?: {}): boolean;
3
- export declare function getElementColor(initials?: string): string;
4
- export declare function invertColor(color: string): string;
5
- export declare function html2text(html: string): string;
6
- /**
7
- * @param {number} ts - timestamp
8
- * @return {string} - times as string%
9
- * If TS is today, then Date returns as a string 'HH:mm'
10
- * If ts is period between 3 day before today and today, then Date returns as a string '{1|2|3} days ago'
11
- * Else Date returns as a string 'YYYY-MM-DD'
12
- */
13
- export declare function prepareDateAsSting(ts: number): string;
14
- export declare function capitalize(text: string): string;
15
- export declare function formatFileSize(size: number): string;