vgapp 1.5.6 → 1.5.8

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 (109) hide show
  1. package/app/langs/en/buttons.json +17 -17
  2. package/app/langs/en/messages.json +36 -36
  3. package/app/langs/ru/buttons.json +17 -17
  4. package/app/langs/ru/messages.json +1 -1
  5. package/app/modules/vgalert/js/vgalert.js +6 -3
  6. package/app/modules/vgalert/scss/_variables.scss +16 -16
  7. package/app/modules/vgcollapse/scss/_variables.scss +7 -7
  8. package/app/modules/vgcollapse/scss/vgcollapse.scss +5 -5
  9. package/app/modules/vgdropdown/scss/_variables.scss +14 -14
  10. package/app/modules/vgdropdown/scss/vgdropdown.scss +5 -5
  11. package/app/modules/vgfilepreview/js/i18n.js +56 -56
  12. package/app/modules/vgfilepreview/js/renderers/image-modal.js +145 -145
  13. package/app/modules/vgfilepreview/js/renderers/image.js +92 -92
  14. package/app/modules/vgfilepreview/js/renderers/index.js +19 -19
  15. package/app/modules/vgfilepreview/js/renderers/office-modal.js +168 -168
  16. package/app/modules/vgfilepreview/js/renderers/office.js +79 -79
  17. package/app/modules/vgfilepreview/js/renderers/pdf-modal.js +260 -260
  18. package/app/modules/vgfilepreview/js/renderers/pdf.js +76 -76
  19. package/app/modules/vgfilepreview/js/renderers/playlist.js +71 -71
  20. package/app/modules/vgfilepreview/js/renderers/text-modal.js +343 -343
  21. package/app/modules/vgfilepreview/js/renderers/text.js +83 -83
  22. package/app/modules/vgfilepreview/js/renderers/zip-modal.js +522 -522
  23. package/app/modules/vgfilepreview/js/renderers/zip.js +89 -89
  24. package/app/modules/vgfilepreview/readme.md +68 -68
  25. package/app/modules/vgfiles/js/base.js +189 -194
  26. package/app/modules/vgfiles/js/droppable.js +17 -17
  27. package/app/modules/vgfiles/js/render.js +153 -153
  28. package/app/modules/vgfiles/js/sortable.js +52 -52
  29. package/app/modules/vgfiles/js/vgfiles.js +43 -43
  30. package/app/modules/vgfiles/readme.md +123 -123
  31. package/app/modules/vgfiles/scss/_mixins.scss +13 -13
  32. package/app/modules/vgfiles/scss/_variables.scss +10 -10
  33. package/app/modules/vgfiles/scss/vgfiles.scss +28 -28
  34. package/app/modules/vgformsender/js/hideshowpass.js +22 -22
  35. package/app/modules/vgformsender/readme.md +1 -1
  36. package/app/modules/vgformsender/scss/_variables.scss +5 -5
  37. package/app/modules/vgformsender/scss/vgformsender.scss +42 -42
  38. package/app/modules/vglawcookie/js/vglawcookie.js +19 -19
  39. package/app/modules/vglawcookie/scss/_variables.scss +13 -13
  40. package/app/modules/vglawcookie/scss/vglawcookie.scss +5 -5
  41. package/app/modules/vgmodal/js/vgmodal.interaction.js +216 -216
  42. package/app/modules/vgmodal/js/vgmodal.js +6 -0
  43. package/app/modules/vgmodal/js/vgmodal.minimized.js +227 -227
  44. package/app/modules/vgmodal/scss/_variables.scss +17 -17
  45. package/app/modules/vgmodal/scss/vgmodal.scss +77 -77
  46. package/app/modules/vgnav/js/vgnav.js +62 -62
  47. package/app/modules/vgnav/scss/_breakpoints.scss +36 -36
  48. package/app/modules/vgnav/scss/_hamburger.scss +5 -5
  49. package/app/modules/vgnav/scss/_placement.scss +5 -5
  50. package/app/modules/vgnav/scss/_toggle.scss +5 -5
  51. package/app/modules/vgnav/scss/_variables.scss +26 -26
  52. package/app/modules/vgnav/scss/vgnav.scss +41 -41
  53. package/app/modules/vgnestable/README.md +39 -39
  54. package/app/modules/vgrangeslider/js/skins.js +8 -8
  55. package/app/modules/vgrangeslider/js/vgrangeslider.js +29 -29
  56. package/app/modules/vgrangeslider/scss/_variables.scss +55 -55
  57. package/app/modules/vgrangeslider/scss/vgrangeslider.scss +239 -239
  58. package/app/modules/vgrollup/js/vgrollup.js +15 -15
  59. package/app/modules/vgrollup/scss/_variables.scss +15 -15
  60. package/app/modules/vgrollup/scss/vgrollup.scss +6 -6
  61. package/app/modules/vgselect/js/handlers.js +5 -52
  62. package/app/modules/vgselect/js/vgselect.js +128 -40
  63. package/app/modules/vgselect/readme.md +11 -11
  64. package/app/modules/vgselect/scss/_variables.scss +51 -51
  65. package/app/modules/vgselect/scss/vgselect.scss +1 -1
  66. package/app/modules/vgsidebar/js/vgsidebar.js +16 -5
  67. package/app/modules/vgsidebar/scss/_variables.scss +10 -10
  68. package/app/modules/vgsidebar/scss/vgsidebar.scss +5 -5
  69. package/app/modules/vgspy/js/vgspy.js +28 -7
  70. package/app/modules/vgtable/js/_filters.js +10 -6
  71. package/app/modules/vgtable/js/_options.js +16 -16
  72. package/app/modules/vgtable/js/_pagination.js +118 -118
  73. package/app/modules/vgtable/js/_responsive.js +79 -79
  74. package/app/modules/vgtable/js/_sticky-header.js +349 -280
  75. package/app/modules/vgtable/js/vgtable.js +98 -98
  76. package/app/modules/vgtable/scss/_sorting.scss +6 -6
  77. package/app/modules/vgtable/scss/_sticky-header.scss +31 -31
  78. package/app/modules/vgtable/scss/_variables.scss +6 -4
  79. package/app/modules/vgtable/scss/vgtable.scss +8 -4
  80. package/app/modules/vgtabs/js/vgtabs.js +82 -57
  81. package/app/modules/vgtabs/scss/_variables.scss +23 -23
  82. package/app/modules/vgtabs/scss/vgtabs.scss +5 -5
  83. package/app/modules/vgtoast/js/vgtoast.js +11 -5
  84. package/app/modules/vgtoast/scss/_variables.scss +13 -13
  85. package/app/modules/vgtoast/scss/vgtoast.scss +5 -5
  86. package/app/modules/vgtooltip/js/vgtooltip.js +121 -111
  87. package/app/modules/vgtooltip/scss/_variables.scss +10 -10
  88. package/app/modules/vgtooltip/scss/vgtooltip.scss +5 -5
  89. package/app/utils/js/components/audio-metadata.js +240 -240
  90. package/app/utils/js/components/backdrop.js +116 -116
  91. package/app/utils/js/components/file-icon.js +5 -0
  92. package/app/utils/js/components/file-preview.js +304 -304
  93. package/app/utils/js/components/responsive.js +165 -165
  94. package/app/utils/js/components/sanitize.js +150 -150
  95. package/app/utils/js/components/video-metadata.js +140 -140
  96. package/app/utils/scss/_backdrop.scss +5 -5
  97. package/app/utils/scss/_theme-default.scss +12 -12
  98. package/app/utils/scss/_theme.scss +7 -7
  99. package/app/utils/scss/default.scss +9 -9
  100. package/app/utils/scss/functions.scss +21 -21
  101. package/app/utils/scss/index.scss +4 -4
  102. package/app/utils/scss/mixin.scss +16 -16
  103. package/app/utils/scss/variables.scss +147 -147
  104. package/build/vgapp.css +1 -1
  105. package/build/vgapp.css.map +1 -1
  106. package/build/vgapp.js +1 -1
  107. package/build/vgapp.js.map +1 -1
  108. package/index.js +7 -7
  109. package/package.json +1 -1
@@ -1,140 +1,140 @@
1
- const VIDEO_EXTENSIONS = new Set([
2
- 'mp4',
3
- 'webm',
4
- 'mov',
5
- 'mkv',
6
- 'avi',
7
- 'm4v',
8
- 'ogv'
9
- ]);
10
-
11
- const getFileExtension = (file) => {
12
- const fileName = String(file?.name || '').toLowerCase();
13
- const dot = fileName.lastIndexOf('.');
14
- if (dot < 0 || dot >= fileName.length - 1) {
15
- return '';
16
- }
17
- return fileName.slice(dot + 1);
18
- };
19
-
20
- const waitEvent = (node, eventName) => new Promise((resolve, reject) => {
21
- const onResolve = () => {
22
- cleanup();
23
- resolve(true);
24
- };
25
-
26
- const onReject = () => {
27
- cleanup();
28
- reject(new Error(eventName));
29
- };
30
-
31
- const cleanup = () => {
32
- node.removeEventListener(eventName, onResolve);
33
- node.removeEventListener('error', onReject);
34
- };
35
-
36
- node.addEventListener(eventName, onResolve, { once: true });
37
- node.addEventListener('error', onReject, { once: true });
38
- });
39
-
40
- const seekVideo = (video, time) => new Promise((resolve, reject) => {
41
- const onSeeked = () => {
42
- cleanup();
43
- resolve(true);
44
- };
45
-
46
- const onError = () => {
47
- cleanup();
48
- reject(new Error('seek'));
49
- };
50
-
51
- const cleanup = () => {
52
- video.removeEventListener('seeked', onSeeked);
53
- video.removeEventListener('error', onError);
54
- };
55
-
56
- video.addEventListener('seeked', onSeeked, { once: true });
57
- video.addEventListener('error', onError, { once: true });
58
- video.currentTime = time;
59
- });
60
-
61
- const canvasToBlob = (canvas, type = 'image/jpeg', quality = 0.92) => new Promise((resolve) => {
62
- canvas.toBlob((blob) => resolve(blob || null), type, quality);
63
- });
64
-
65
- const extractVideoMetadata = async (file) => {
66
- if (!(file instanceof File)) {
67
- return null;
68
- }
69
-
70
- const ext = getFileExtension(file);
71
- const isVideoType = String(file.type || '').toLowerCase().startsWith('video/');
72
- if (!isVideoType && !VIDEO_EXTENSIONS.has(ext)) {
73
- return null;
74
- }
75
-
76
- if (!file.size) {
77
- return null;
78
- }
79
-
80
- let objectUrl = '';
81
- try {
82
- objectUrl = URL.createObjectURL(file);
83
-
84
- const video = document.createElement('video');
85
- video.preload = 'metadata';
86
- video.muted = true;
87
- video.playsInline = true;
88
- video.crossOrigin = 'anonymous';
89
- video.src = objectUrl;
90
-
91
- await waitEvent(video, 'loadedmetadata');
92
-
93
- const width = Number(video.videoWidth || 0);
94
- const height = Number(video.videoHeight || 0);
95
- const duration = Number(video.duration || 0);
96
-
97
- if (!width || !height || !Number.isFinite(width) || !Number.isFinite(height)) {
98
- return {
99
- duration: Number.isFinite(duration) ? duration : 0,
100
- width: 0,
101
- height: 0
102
- };
103
- }
104
-
105
- const seekTime = duration > 1 ? Math.min(1, Math.max(0, duration / 2)) : 0;
106
- await seekVideo(video, seekTime);
107
-
108
- const canvas = document.createElement('canvas');
109
- canvas.width = width;
110
- canvas.height = height;
111
- const ctx = canvas.getContext('2d');
112
- if (!ctx) {
113
- return {
114
- duration: Number.isFinite(duration) ? duration : 0,
115
- width,
116
- height
117
- };
118
- }
119
-
120
- ctx.drawImage(video, 0, 0, width, height);
121
- const posterBlob = await canvasToBlob(canvas, 'image/jpeg', 0.92);
122
-
123
- return {
124
- duration: Number.isFinite(duration) ? duration : 0,
125
- width,
126
- height,
127
- posterBlob: posterBlob || null
128
- };
129
- } catch {
130
- return null;
131
- } finally {
132
- if (objectUrl) {
133
- URL.revokeObjectURL(objectUrl);
134
- }
135
- }
136
- };
137
-
138
- export {
139
- extractVideoMetadata
140
- };
1
+ const VIDEO_EXTENSIONS = new Set([
2
+ 'mp4',
3
+ 'webm',
4
+ 'mov',
5
+ 'mkv',
6
+ 'avi',
7
+ 'm4v',
8
+ 'ogv'
9
+ ]);
10
+
11
+ const getFileExtension = (file) => {
12
+ const fileName = String(file?.name || '').toLowerCase();
13
+ const dot = fileName.lastIndexOf('.');
14
+ if (dot < 0 || dot >= fileName.length - 1) {
15
+ return '';
16
+ }
17
+ return fileName.slice(dot + 1);
18
+ };
19
+
20
+ const waitEvent = (node, eventName) => new Promise((resolve, reject) => {
21
+ const onResolve = () => {
22
+ cleanup();
23
+ resolve(true);
24
+ };
25
+
26
+ const onReject = () => {
27
+ cleanup();
28
+ reject(new Error(eventName));
29
+ };
30
+
31
+ const cleanup = () => {
32
+ node.removeEventListener(eventName, onResolve);
33
+ node.removeEventListener('error', onReject);
34
+ };
35
+
36
+ node.addEventListener(eventName, onResolve, { once: true });
37
+ node.addEventListener('error', onReject, { once: true });
38
+ });
39
+
40
+ const seekVideo = (video, time) => new Promise((resolve, reject) => {
41
+ const onSeeked = () => {
42
+ cleanup();
43
+ resolve(true);
44
+ };
45
+
46
+ const onError = () => {
47
+ cleanup();
48
+ reject(new Error('seek'));
49
+ };
50
+
51
+ const cleanup = () => {
52
+ video.removeEventListener('seeked', onSeeked);
53
+ video.removeEventListener('error', onError);
54
+ };
55
+
56
+ video.addEventListener('seeked', onSeeked, { once: true });
57
+ video.addEventListener('error', onError, { once: true });
58
+ video.currentTime = time;
59
+ });
60
+
61
+ const canvasToBlob = (canvas, type = 'image/jpeg', quality = 0.92) => new Promise((resolve) => {
62
+ canvas.toBlob((blob) => resolve(blob || null), type, quality);
63
+ });
64
+
65
+ const extractVideoMetadata = async (file) => {
66
+ if (!(file instanceof File)) {
67
+ return null;
68
+ }
69
+
70
+ const ext = getFileExtension(file);
71
+ const isVideoType = String(file.type || '').toLowerCase().startsWith('video/');
72
+ if (!isVideoType && !VIDEO_EXTENSIONS.has(ext)) {
73
+ return null;
74
+ }
75
+
76
+ if (!file.size) {
77
+ return null;
78
+ }
79
+
80
+ let objectUrl = '';
81
+ try {
82
+ objectUrl = URL.createObjectURL(file);
83
+
84
+ const video = document.createElement('video');
85
+ video.preload = 'metadata';
86
+ video.muted = true;
87
+ video.playsInline = true;
88
+ video.crossOrigin = 'anonymous';
89
+ video.src = objectUrl;
90
+
91
+ await waitEvent(video, 'loadedmetadata');
92
+
93
+ const width = Number(video.videoWidth || 0);
94
+ const height = Number(video.videoHeight || 0);
95
+ const duration = Number(video.duration || 0);
96
+
97
+ if (!width || !height || !Number.isFinite(width) || !Number.isFinite(height)) {
98
+ return {
99
+ duration: Number.isFinite(duration) ? duration : 0,
100
+ width: 0,
101
+ height: 0
102
+ };
103
+ }
104
+
105
+ const seekTime = duration > 1 ? Math.min(1, Math.max(0, duration / 2)) : 0;
106
+ await seekVideo(video, seekTime);
107
+
108
+ const canvas = document.createElement('canvas');
109
+ canvas.width = width;
110
+ canvas.height = height;
111
+ const ctx = canvas.getContext('2d');
112
+ if (!ctx) {
113
+ return {
114
+ duration: Number.isFinite(duration) ? duration : 0,
115
+ width,
116
+ height
117
+ };
118
+ }
119
+
120
+ ctx.drawImage(video, 0, 0, width, height);
121
+ const posterBlob = await canvasToBlob(canvas, 'image/jpeg', 0.92);
122
+
123
+ return {
124
+ duration: Number.isFinite(duration) ? duration : 0,
125
+ width,
126
+ height,
127
+ posterBlob: posterBlob || null
128
+ };
129
+ } catch {
130
+ return null;
131
+ } finally {
132
+ if (objectUrl) {
133
+ URL.revokeObjectURL(objectUrl);
134
+ }
135
+ }
136
+ };
137
+
138
+ export {
139
+ extractVideoMetadata
140
+ };
@@ -1,6 +1,6 @@
1
1
  @use "mixin" as mix;
2
2
  @use "variables" as vars;
3
-
3
+
4
4
  .vg-backdrop {
5
5
  @include mix.mix-vars('backdrop', vars.$backdrop-map);
6
6
  position: fixed;
@@ -11,9 +11,9 @@
11
11
  background: var(--vg-backdrop-bg);
12
12
  transition: var(--vg-backdrop-transition);
13
13
  opacity: 0;
14
- z-index: var(--vg-backdrop-z-index);
15
-
16
- &.fade.show {
14
+ z-index: var(--vg-backdrop-z-index);
15
+
16
+ &.fade.show {
17
17
  opacity: var(--vg-backdrop-opacity);
18
18
  }
19
- }
19
+ }
@@ -1,12 +1,12 @@
1
- @use "theme";
2
-
3
- // Default adapter for the ready-made VGApp stylesheet. Projects that own
4
- // their theme selector can use vgapp/theme and emit the same variables there.
5
- :root,
6
- [data-vg-theme="light"] {
7
- @include theme.theme-variables(theme.$theme-light);
8
- }
9
-
10
- [data-vg-theme="dark"] {
11
- @include theme.theme-variables(theme.$theme-dark);
12
- }
1
+ @use "theme";
2
+
3
+ // Default adapter for the ready-made VGApp stylesheet. Projects that own
4
+ // their theme selector can use vgapp/theme and emit the same variables there.
5
+ :root,
6
+ [data-vg-theme="light"] {
7
+ @include theme.theme-variables(theme.$theme-light);
8
+ }
9
+
10
+ [data-vg-theme="dark"] {
11
+ @include theme.theme-variables(theme.$theme-dark);
12
+ }
@@ -1,7 +1,7 @@
1
- @forward "tokens";
2
-
3
- @mixin theme-variables($theme) {
4
- @each $token, $value in $theme {
5
- --vg-#{$token}: #{$value};
6
- }
7
- }
1
+ @forward "tokens";
2
+
3
+ @mixin theme-variables($theme) {
4
+ @each $token, $value in $theme {
5
+ --vg-#{$token}: #{$value};
6
+ }
7
+ }
@@ -1,11 +1,11 @@
1
1
  @forward "index";
2
2
 
3
- @forward "index";
4
-
5
- @use "animation";
6
- @use "placement";
7
- @use "theme-default";
8
- @use "backdrop";
9
- @use "closable";
10
- @use "collapsable";
11
- @use "loaders";
3
+ @forward "index";
4
+
5
+ @use "animation";
6
+ @use "placement";
7
+ @use "theme-default";
8
+ @use "backdrop";
9
+ @use "closable";
10
+ @use "collapsable";
11
+ @use "loaders";
@@ -1,26 +1,26 @@
1
- @use "sass:color";
2
- @use "sass:map";
3
- @use "sass:meta";
4
-
5
- @function is-map($var){
6
- @return meta.type-of($var) == 'map';
7
- }
1
+ @use "sass:color";
2
+ @use "sass:map";
3
+ @use "sass:meta";
4
+
5
+ @function is-map($var){
6
+ @return meta.type-of($var) == 'map';
7
+ }
8
8
 
9
9
  // Merge multiple maps
10
10
  @function map-merge-multiple($maps...) {
11
- $merged-maps: ();
12
-
13
- @each $map in $maps {
14
- $merged-maps: map.merge($merged-maps, $map);
15
- }
16
- @return $merged-maps;
17
- }
11
+ $merged-maps: ();
12
+
13
+ @each $map in $maps {
14
+ $merged-maps: map.merge($merged-maps, $map);
15
+ }
16
+ @return $merged-maps;
17
+ }
18
18
 
19
19
  // mix colors
20
- @function shade-color($color, $weight) {
21
- @return color.mix(black, $color, $weight);
22
- }
23
-
24
- @function tint-color($color, $weight) {
25
- @return color.mix(white, $color, $weight);
26
- }
20
+ @function shade-color($color, $weight) {
21
+ @return color.mix(black, $color, $weight);
22
+ }
23
+
24
+ @function tint-color($color, $weight) {
25
+ @return color.mix(white, $color, $weight);
26
+ }
@@ -1,4 +1,4 @@
1
- @forward "theme";
2
- @forward "functions";
3
- @forward "variables";
4
- @forward "mixin";
1
+ @forward "theme";
2
+ @forward "functions";
3
+ @forward "variables";
4
+ @forward "mixin";
@@ -1,26 +1,26 @@
1
- @use "sass:meta";
2
- @use "variables" as vars;
3
-
4
- @mixin mix-vars($module, $properties) {
5
- @each $key, $value in $properties {
6
- @if (meta.type-of($value) == 'map') {
7
- @each $k, $v in $value {
8
- --vg-#{$module}-#{$key}-#{$k}: #{$v};
9
- }
10
- } @else {
11
- --vg-#{$module}-#{$key}: #{$value};
12
- }
1
+ @use "sass:meta";
2
+ @use "variables" as vars;
3
+
4
+ @mixin mix-vars($module, $properties) {
5
+ @each $key, $value in $properties {
6
+ @if (meta.type-of($value) == 'map') {
7
+ @each $k, $v in $value {
8
+ --vg-#{$module}-#{$key}-#{$k}: #{$v};
9
+ }
10
+ } @else {
11
+ --vg-#{$module}-#{$key}: #{$value};
12
+ }
13
13
  }
14
14
  }
15
15
 
16
16
  @mixin mix-alert-color-mode($class) {
17
17
  $colors: ['success', 'info', 'warning', 'danger', 'dark'];
18
18
 
19
- @each $value in $colors {
20
- &.#{$class}-#{$value} {
21
- @each $property, $val in vars.get-alert-color($value) {
19
+ @each $value in $colors {
20
+ &.#{$class}-#{$value} {
21
+ @each $property, $val in vars.get-alert-color($value) {
22
22
  --#{$class}-#{$property}: #{$val};
23
23
  }
24
24
  }
25
25
  }
26
- }
26
+ }