@social-mail/social-mail-client 1.8.321 → 1.8.322

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 (33) hide show
  1. package/dist/admin/AdminAppIndex.pack.global.css +1 -1
  2. package/dist/admin/AdminAppIndex.pack.global.css.map +1 -1
  3. package/dist/admin/AdminAppIndex.pack.js +44 -30
  4. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  5. package/dist/admin/AdminAppIndex.pack.min.js +1 -1
  6. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  7. package/dist/common/controls/drag-drop/FilesDragDrop.js +19 -25
  8. package/dist/common/controls/drag-drop/FilesDragDrop.js.map +1 -1
  9. package/dist/common/controls/file-preview/FilePreview.d.ts.map +1 -1
  10. package/dist/common/controls/file-preview/FilePreview.global.css +1 -1
  11. package/dist/common/controls/file-preview/FilePreview.global.css.map +1 -1
  12. package/dist/common/controls/file-preview/FilePreview.js +24 -4
  13. package/dist/common/controls/file-preview/FilePreview.js.map +1 -1
  14. package/dist/services/files/LocalFileService.js +1 -1
  15. package/dist/services/files/LocalFileService.js.map +1 -1
  16. package/dist/site-editor-app/SiteEditorApp.pack.global.css +1 -1
  17. package/dist/site-editor-app/SiteEditorApp.pack.global.css.map +1 -1
  18. package/dist/site-editor-app/SiteEditorApp.pack.js +44 -30
  19. package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
  20. package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
  21. package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/web/AppIndex.pack.global.css +1 -1
  24. package/dist/web/AppIndex.pack.global.css.map +1 -1
  25. package/dist/web/AppIndex.pack.js +44 -30
  26. package/dist/web/AppIndex.pack.js.map +1 -1
  27. package/dist/web/AppIndex.pack.min.js +1 -1
  28. package/dist/web/AppIndex.pack.min.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/common/controls/drag-drop/FilesDragDrop.ts +5 -5
  31. package/src/common/controls/file-preview/FilePreview.global.css +25 -4
  32. package/src/common/controls/file-preview/FilePreview.tsx +24 -0
  33. package/src/services/files/LocalFileService.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.8.321",
3
+ "version": "1.8.322",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -67,12 +67,12 @@ const eventDrop = (e: DragEvent) => {
67
67
  const control = AtomControl.from(e.currentTarget);
68
68
  control.app.runAsync(async() => {
69
69
 
70
- const draggedFiles = e.dataTransfer.files?.length > 0 && e.dataTransfer.files;
70
+ // const draggedFiles = e.dataTransfer.files?.length > 0 && e.dataTransfer.files;
71
71
 
72
72
 
73
- if (draggedFiles) {
74
- files.push( ... [... draggedFiles as any]);
75
- } else {
73
+ // if (draggedFiles) {
74
+ // files.push( ... [... draggedFiles as any]);
75
+ // } else {
76
76
 
77
77
  const fileHandlesPromises = [...e.dataTransfer.items as any]
78
78
  .filter((item) => item.kind === "file")
@@ -90,7 +90,7 @@ const eventDrop = (e: DragEvent) => {
90
90
  files.push(handle.getFile ? await handle.getFile(): handle);
91
91
  }
92
92
  }
93
- }
93
+ // }
94
94
  const detail = {
95
95
  files,
96
96
  extra,
@@ -6,13 +6,13 @@
6
6
  width: 180px;
7
7
  contain: content;
8
8
  text-decoration: none;
9
- grid-template-columns: auto 1fr auto;
10
- grid-template-rows: 1fr auto;
9
+ grid-template-columns: auto 1fr auto auto;
10
+ grid-template-rows: 1fr auto auto;
11
11
  & a {
12
12
  text-decoration: none;
13
13
  }
14
14
  & > [data-element=preview] {
15
- grid-column: 1 / span 3;
15
+ grid-column: 1 / span 4;
16
16
  grid-row: 1;
17
17
  overflow: hidden;
18
18
  justify-self: stretch;
@@ -25,7 +25,7 @@
25
25
  }
26
26
  & > [data-element=file-name] {
27
27
  grid-column: 1 / span 3;
28
- grid-row: 2;
28
+ grid-row: 3;
29
29
  padding: 5px;
30
30
  font-size: smaller;
31
31
  text-overflow: ellipsis;
@@ -34,6 +34,27 @@
34
34
  background-color: var(--accent-color);
35
35
  color: var(--accent-text-color);
36
36
  }
37
+ & > [data-element=size] {
38
+ grid-column: 3 / span 2;
39
+ grid-row: 2;
40
+ font-size: x-small;
41
+ background-color: rgb(226, 226, 226);
42
+ color: rgb(49, 49, 49);
43
+ padding: 2px;
44
+ padding-left: 5px;
45
+ padding-right: 5px;
46
+ border-top-left-radius: 5px;
47
+ }
48
+ & > [data-element=ext] {
49
+ background-color: var(--accent-color);
50
+ color: var(--accent-text-color);
51
+ font-size: small;
52
+ grid-column: 4;
53
+ grid-row: 3;
54
+ justify-self: stretch;
55
+ align-self: stretch;
56
+ padding: 5px;
57
+ }
37
58
  & > [data-element=file-size] {
38
59
  grid-column: 3;
39
60
  grid-row: 2;
@@ -7,6 +7,14 @@ import { FileUrlService } from "../../FileUrlService";
7
7
 
8
8
  import "./FilePreview.global.css";
9
9
 
10
+ const ext = (name: string) => {
11
+ const i = name.lastIndexOf(".");
12
+ if (i === -1) {
13
+ return "UNK";
14
+ }
15
+ return name.substring(i + 1).toUpperCase();
16
+ };
17
+
10
18
  export default function FilePreview(a: IAppFile) {
11
19
 
12
20
 
@@ -33,6 +41,14 @@ export default function FilePreview(a: IAppFile) {
33
41
  data-element="file-name">
34
42
  {name}
35
43
  </label>
44
+ { size && <label
45
+ data-element="size"
46
+ text={size}
47
+ />}
48
+ <label
49
+ data-element="ext"
50
+ text={ext(name)}
51
+ />
36
52
  </a>;
37
53
  }
38
54
 
@@ -46,5 +62,13 @@ export default function FilePreview(a: IAppFile) {
46
62
  data-element="file-name">
47
63
  {name}
48
64
  </label>
65
+ { size && <label
66
+ data-element="size"
67
+ text={size}
68
+ />}
69
+ <label
70
+ data-element="ext"
71
+ text={ext(name)}
72
+ />
49
73
  </a>;
50
74
  }
@@ -98,7 +98,7 @@ export default class LocalFileService extends TaskManager {
98
98
  const fud = new FileUploader(this);
99
99
  while(size > 0) {
100
100
  const blobSize = Math.min(maxSize, file.size - start);
101
- const part = new File([file.slice( start, start + blobSize)], "file.dat");
101
+ const part = new File([file.slice( start, blobSize === maxSize ? blobSize : void 0)], "file.dat");
102
102
  size -= blobSize;
103
103
  start += blobSize;
104
104
  const uploadRequest = fud.upload({