@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.
Files changed (3) hide show
  1. package/index.cjs +22 -30
  2. package/index.js +22 -30
  3. 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 || '10vh';
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 || '10vh';
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 || '10vh';
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 || '10vh';
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.width = `calc(100% - ${buttonStyle.cornerRadius * 2}px)`;
1156
- dom.style.maxWidth = `327px`;
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="49" height="48" viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2786
- <rect x="0.5" width="48" height="48" rx="24" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
2787
- <g clip-path="url(#clip0_21855_2149)">
2788
- <path d="M16.25 25.5L21.5 30.75L33.5 18.75" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
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="clip0_21855_2149">
2792
- <rect width="24" height="24" fill="white" transform="translate(12.5 12)"/>
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="49" height="48" viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2799
- <rect x="0.5" width="48" height="48" rx="24" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
2800
- <g clip-path="url(#clip0_21855_2690)">
2801
- <path d="M31.25 17.25L17.75 30.75" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
2802
- <path d="M31.25 30.75L17.75 17.25" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
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="clip0_21855_2690">
2806
- <rect width="24" height="24" fill="white" transform="translate(12.5 12)"/>
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.26";
3255
- var date = "2025-09-30T03:00:07+0000";
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 || '10vh';
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 || '10vh';
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 || '10vh';
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 || '10vh';
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.width = `calc(100% - ${buttonStyle.cornerRadius * 2}px)`;
1146
- dom.style.maxWidth = `327px`;
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="49" height="48" viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2776
- <rect x="0.5" width="48" height="48" rx="24" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
2777
- <g clip-path="url(#clip0_21855_2149)">
2778
- <path d="M16.25 25.5L21.5 30.75L33.5 18.75" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
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="clip0_21855_2149">
2782
- <rect width="24" height="24" fill="white" transform="translate(12.5 12)"/>
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="49" height="48" viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">
2789
- <rect x="0.5" width="48" height="48" rx="24" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
2790
- <g clip-path="url(#clip0_21855_2690)">
2791
- <path d="M31.25 17.25L17.75 30.75" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
2792
- <path d="M31.25 30.75L17.75 17.25" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
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="clip0_21855_2690">
2796
- <rect width="24" height="24" fill="white" transform="translate(12.5 12)"/>
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.26";
3245
- var date = "2025-09-30T03:00:07+0000";
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authme/util",
3
- "version": "2.8.26",
3
+ "version": "2.8.28",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0",
6
6
  "file-saver": "2.0.5",