@authme/util 2.8.26 → 2.8.28
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.
- package/index.cjs +22 -30
- package/index.js +22 -30
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -25,7 +25,6 @@ require('core-js/modules/es.array.includes.js');
|
|
|
25
25
|
require('core-js/modules/es.string.includes.js');
|
|
26
26
|
var fileSaver = require('file-saver');
|
|
27
27
|
var JSZip = require('jszip');
|
|
28
|
-
require('core-js/modules/es.number.to-fixed.js');
|
|
29
28
|
require('core-js/modules/es.parse-int.js');
|
|
30
29
|
var Lottie = require('lottie-web');
|
|
31
30
|
require('core-js/modules/es.array.sort.js');
|
|
@@ -977,8 +976,6 @@ function getCanvasSize(video) {
|
|
|
977
976
|
videoWidth = video.videoWidth;
|
|
978
977
|
videoHeight = video.videoHeight;
|
|
979
978
|
}
|
|
980
|
-
console.log('=== 相機解析度 ===', videoWidth, 'x', videoHeight);
|
|
981
|
-
console.log('視窗尺寸:', window.innerWidth, 'x', window.innerHeight);
|
|
982
979
|
const result = {
|
|
983
980
|
height: 0,
|
|
984
981
|
width: 0,
|
|
@@ -1012,12 +1009,6 @@ function getCanvasSize(video) {
|
|
|
1012
1009
|
const resizeRatio = Math.min(1, maxDimension / Math.max(result.width, result.height));
|
|
1013
1010
|
result.canvasWidth = Math.floor(result.width * resizeRatio);
|
|
1014
1011
|
result.canvasHeight = Math.floor(result.height * resizeRatio);
|
|
1015
|
-
console.log('調整比例:', resizeRatio.toFixed(3));
|
|
1016
|
-
console.log('=== 最終輸出解析度 ===', result.canvasWidth, 'x', result.canvasHeight);
|
|
1017
|
-
console.log('裁切區域:', `${result.width}x${result.height} 起始點:(${result.startX}, ${result.startY})`);
|
|
1018
|
-
const totalPixels = result.canvasWidth * result.canvasHeight;
|
|
1019
|
-
const estimatedMB = totalPixels * 4 / 1024 / 1024; // 4 bytes per pixel (RGBA)
|
|
1020
|
-
console.log('估計記憶體用量:', estimatedMB.toFixed(2), 'MB (未壓縮)');
|
|
1021
1012
|
return result;
|
|
1022
1013
|
});
|
|
1023
1014
|
}
|
|
@@ -1065,13 +1056,14 @@ const uiThemeText = (dom, textStyle, distance) => {
|
|
|
1065
1056
|
const parent = dom.parentElement;
|
|
1066
1057
|
parent.style.position = 'absolute';
|
|
1067
1058
|
parent.style.display = 'block';
|
|
1059
|
+
parent.style.padding = '24px 32px';
|
|
1068
1060
|
// Adjust based on direction if provided
|
|
1069
1061
|
if (textStyle.direction === 'top') {
|
|
1070
|
-
parent.style.top = distance || '
|
|
1062
|
+
parent.style.top = distance || '5vh';
|
|
1071
1063
|
parent.style.bottom = 'unset';
|
|
1072
1064
|
} else if (textStyle.direction === 'bottom') {
|
|
1073
1065
|
parent.style.top = 'unset';
|
|
1074
|
-
parent.style.bottom = distance || '
|
|
1066
|
+
parent.style.bottom = distance || '5vh';
|
|
1075
1067
|
}
|
|
1076
1068
|
}
|
|
1077
1069
|
};
|
|
@@ -1089,11 +1081,11 @@ const uiThemeHint = (dom, hintStyle, distance) => {
|
|
|
1089
1081
|
parent.style.position = 'absolute';
|
|
1090
1082
|
// Adjust based on direction if provided
|
|
1091
1083
|
if (hintStyle.direction === 'top') {
|
|
1092
|
-
parent.style.top = distance || '
|
|
1084
|
+
parent.style.top = distance || '5vh';
|
|
1093
1085
|
parent.style.bottom = 'unset';
|
|
1094
1086
|
} else {
|
|
1095
1087
|
parent.style.top = 'unset';
|
|
1096
|
-
parent.style.bottom = distance || '
|
|
1088
|
+
parent.style.bottom = distance || '5vh';
|
|
1097
1089
|
}
|
|
1098
1090
|
}
|
|
1099
1091
|
};
|
|
@@ -1152,8 +1144,8 @@ const uiThemeButton = (dom, buttonStyle, disabled) => {
|
|
|
1152
1144
|
dom.style.borderStyle = 'solid';
|
|
1153
1145
|
// dom.style.height = `${buttonStyle.cornerRadius * 2}px`;
|
|
1154
1146
|
dom.style.height = `48px`;
|
|
1155
|
-
dom.style.
|
|
1156
|
-
dom.style.
|
|
1147
|
+
dom.style.maxWidth = `774px`;
|
|
1148
|
+
dom.style.width = `100%`;
|
|
1157
1149
|
};
|
|
1158
1150
|
const uiThemeSmallButton = (dom, buttonStyle) => {
|
|
1159
1151
|
dom.style.borderRadius = `${buttonStyle.cornerRadius}px`;
|
|
@@ -2782,28 +2774,28 @@ const uploadModal = arg => {
|
|
|
2782
2774
|
uiThemeText(domTitle, uiThemeConfig.titleTwo);
|
|
2783
2775
|
uiThemeText(domMessage, uiThemeConfig.bodyOne);
|
|
2784
2776
|
if (arg.type === 'success') {
|
|
2785
|
-
domIcon.innerHTML = `<svg width="
|
|
2786
|
-
<rect
|
|
2787
|
-
<g clip-path="url(#
|
|
2788
|
-
<path d="
|
|
2777
|
+
domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2778
|
+
<rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
|
|
2779
|
+
<g clip-path="url(#clip0_success)">
|
|
2780
|
+
<path d="M32 51L43 62L67 38" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2789
2781
|
</g>
|
|
2790
2782
|
<defs>
|
|
2791
|
-
<clipPath id="
|
|
2792
|
-
<rect width="
|
|
2783
|
+
<clipPath id="clip0_success">
|
|
2784
|
+
<rect width="48" height="48" fill="white" transform="translate(24 24)"/>
|
|
2793
2785
|
</clipPath>
|
|
2794
2786
|
</defs>
|
|
2795
2787
|
</svg>`;
|
|
2796
2788
|
}
|
|
2797
2789
|
if (arg.type === 'error') {
|
|
2798
|
-
domIcon.innerHTML = `<svg width="
|
|
2799
|
-
<rect
|
|
2800
|
-
<g clip-path="url(#
|
|
2801
|
-
<path d="
|
|
2802
|
-
<path d="
|
|
2790
|
+
domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2791
|
+
<rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
|
|
2792
|
+
<g clip-path="url(#clip0_error)">
|
|
2793
|
+
<path d="M62 34L34 62" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2794
|
+
<path d="M62 62L34 34" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2803
2795
|
</g>
|
|
2804
2796
|
<defs>
|
|
2805
|
-
<clipPath id="
|
|
2806
|
-
<rect width="
|
|
2797
|
+
<clipPath id="clip0_error">
|
|
2798
|
+
<rect width="48" height="48" fill="white" transform="translate(24 24)"/>
|
|
2807
2799
|
</clipPath>
|
|
2808
2800
|
</defs>
|
|
2809
2801
|
</svg>
|
|
@@ -3251,8 +3243,8 @@ const themeConfigDefault = {
|
|
|
3251
3243
|
};
|
|
3252
3244
|
|
|
3253
3245
|
var name = "authme/sdk";
|
|
3254
|
-
var version$1 = "2.8.
|
|
3255
|
-
var date = "2025-
|
|
3246
|
+
var version$1 = "2.8.28";
|
|
3247
|
+
var date = "2025-10-08T04:07:48+0000";
|
|
3256
3248
|
var packageInfo = {
|
|
3257
3249
|
name: name,
|
|
3258
3250
|
version: version$1,
|
package/index.js
CHANGED
|
@@ -21,7 +21,6 @@ import 'core-js/modules/es.array.includes.js';
|
|
|
21
21
|
import 'core-js/modules/es.string.includes.js';
|
|
22
22
|
import { saveAs } from 'file-saver';
|
|
23
23
|
import JSZip from 'jszip';
|
|
24
|
-
import 'core-js/modules/es.number.to-fixed.js';
|
|
25
24
|
import 'core-js/modules/es.parse-int.js';
|
|
26
25
|
import Lottie from 'lottie-web';
|
|
27
26
|
import 'core-js/modules/es.array.sort.js';
|
|
@@ -967,8 +966,6 @@ function getCanvasSize(video) {
|
|
|
967
966
|
videoWidth = video.videoWidth;
|
|
968
967
|
videoHeight = video.videoHeight;
|
|
969
968
|
}
|
|
970
|
-
console.log('=== 相機解析度 ===', videoWidth, 'x', videoHeight);
|
|
971
|
-
console.log('視窗尺寸:', window.innerWidth, 'x', window.innerHeight);
|
|
972
969
|
const result = {
|
|
973
970
|
height: 0,
|
|
974
971
|
width: 0,
|
|
@@ -1002,12 +999,6 @@ function getCanvasSize(video) {
|
|
|
1002
999
|
const resizeRatio = Math.min(1, maxDimension / Math.max(result.width, result.height));
|
|
1003
1000
|
result.canvasWidth = Math.floor(result.width * resizeRatio);
|
|
1004
1001
|
result.canvasHeight = Math.floor(result.height * resizeRatio);
|
|
1005
|
-
console.log('調整比例:', resizeRatio.toFixed(3));
|
|
1006
|
-
console.log('=== 最終輸出解析度 ===', result.canvasWidth, 'x', result.canvasHeight);
|
|
1007
|
-
console.log('裁切區域:', `${result.width}x${result.height} 起始點:(${result.startX}, ${result.startY})`);
|
|
1008
|
-
const totalPixels = result.canvasWidth * result.canvasHeight;
|
|
1009
|
-
const estimatedMB = totalPixels * 4 / 1024 / 1024; // 4 bytes per pixel (RGBA)
|
|
1010
|
-
console.log('估計記憶體用量:', estimatedMB.toFixed(2), 'MB (未壓縮)');
|
|
1011
1002
|
return result;
|
|
1012
1003
|
});
|
|
1013
1004
|
}
|
|
@@ -1055,13 +1046,14 @@ const uiThemeText = (dom, textStyle, distance) => {
|
|
|
1055
1046
|
const parent = dom.parentElement;
|
|
1056
1047
|
parent.style.position = 'absolute';
|
|
1057
1048
|
parent.style.display = 'block';
|
|
1049
|
+
parent.style.padding = '24px 32px';
|
|
1058
1050
|
// Adjust based on direction if provided
|
|
1059
1051
|
if (textStyle.direction === 'top') {
|
|
1060
|
-
parent.style.top = distance || '
|
|
1052
|
+
parent.style.top = distance || '5vh';
|
|
1061
1053
|
parent.style.bottom = 'unset';
|
|
1062
1054
|
} else if (textStyle.direction === 'bottom') {
|
|
1063
1055
|
parent.style.top = 'unset';
|
|
1064
|
-
parent.style.bottom = distance || '
|
|
1056
|
+
parent.style.bottom = distance || '5vh';
|
|
1065
1057
|
}
|
|
1066
1058
|
}
|
|
1067
1059
|
};
|
|
@@ -1079,11 +1071,11 @@ const uiThemeHint = (dom, hintStyle, distance) => {
|
|
|
1079
1071
|
parent.style.position = 'absolute';
|
|
1080
1072
|
// Adjust based on direction if provided
|
|
1081
1073
|
if (hintStyle.direction === 'top') {
|
|
1082
|
-
parent.style.top = distance || '
|
|
1074
|
+
parent.style.top = distance || '5vh';
|
|
1083
1075
|
parent.style.bottom = 'unset';
|
|
1084
1076
|
} else {
|
|
1085
1077
|
parent.style.top = 'unset';
|
|
1086
|
-
parent.style.bottom = distance || '
|
|
1078
|
+
parent.style.bottom = distance || '5vh';
|
|
1087
1079
|
}
|
|
1088
1080
|
}
|
|
1089
1081
|
};
|
|
@@ -1142,8 +1134,8 @@ const uiThemeButton = (dom, buttonStyle, disabled) => {
|
|
|
1142
1134
|
dom.style.borderStyle = 'solid';
|
|
1143
1135
|
// dom.style.height = `${buttonStyle.cornerRadius * 2}px`;
|
|
1144
1136
|
dom.style.height = `48px`;
|
|
1145
|
-
dom.style.
|
|
1146
|
-
dom.style.
|
|
1137
|
+
dom.style.maxWidth = `774px`;
|
|
1138
|
+
dom.style.width = `100%`;
|
|
1147
1139
|
};
|
|
1148
1140
|
const uiThemeSmallButton = (dom, buttonStyle) => {
|
|
1149
1141
|
dom.style.borderRadius = `${buttonStyle.cornerRadius}px`;
|
|
@@ -2772,28 +2764,28 @@ const uploadModal = arg => {
|
|
|
2772
2764
|
uiThemeText(domTitle, uiThemeConfig.titleTwo);
|
|
2773
2765
|
uiThemeText(domMessage, uiThemeConfig.bodyOne);
|
|
2774
2766
|
if (arg.type === 'success') {
|
|
2775
|
-
domIcon.innerHTML = `<svg width="
|
|
2776
|
-
<rect
|
|
2777
|
-
<g clip-path="url(#
|
|
2778
|
-
<path d="
|
|
2767
|
+
domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2768
|
+
<rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
|
|
2769
|
+
<g clip-path="url(#clip0_success)">
|
|
2770
|
+
<path d="M32 51L43 62L67 38" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2779
2771
|
</g>
|
|
2780
2772
|
<defs>
|
|
2781
|
-
<clipPath id="
|
|
2782
|
-
<rect width="
|
|
2773
|
+
<clipPath id="clip0_success">
|
|
2774
|
+
<rect width="48" height="48" fill="white" transform="translate(24 24)"/>
|
|
2783
2775
|
</clipPath>
|
|
2784
2776
|
</defs>
|
|
2785
2777
|
</svg>`;
|
|
2786
2778
|
}
|
|
2787
2779
|
if (arg.type === 'error') {
|
|
2788
|
-
domIcon.innerHTML = `<svg width="
|
|
2789
|
-
<rect
|
|
2790
|
-
<g clip-path="url(#
|
|
2791
|
-
<path d="
|
|
2792
|
-
<path d="
|
|
2780
|
+
domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2781
|
+
<rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
|
|
2782
|
+
<g clip-path="url(#clip0_error)">
|
|
2783
|
+
<path d="M62 34L34 62" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2784
|
+
<path d="M62 62L34 34" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2793
2785
|
</g>
|
|
2794
2786
|
<defs>
|
|
2795
|
-
<clipPath id="
|
|
2796
|
-
<rect width="
|
|
2787
|
+
<clipPath id="clip0_error">
|
|
2788
|
+
<rect width="48" height="48" fill="white" transform="translate(24 24)"/>
|
|
2797
2789
|
</clipPath>
|
|
2798
2790
|
</defs>
|
|
2799
2791
|
</svg>
|
|
@@ -3241,8 +3233,8 @@ const themeConfigDefault = {
|
|
|
3241
3233
|
};
|
|
3242
3234
|
|
|
3243
3235
|
var name = "authme/sdk";
|
|
3244
|
-
var version$1 = "2.8.
|
|
3245
|
-
var date = "2025-
|
|
3236
|
+
var version$1 = "2.8.28";
|
|
3237
|
+
var date = "2025-10-08T04:07:48+0000";
|
|
3246
3238
|
var packageInfo = {
|
|
3247
3239
|
name: name,
|
|
3248
3240
|
version: version$1,
|