@authme/util 2.8.54 → 2.8.57

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.js CHANGED
@@ -15252,14 +15252,14 @@ function debugTools() {
15252
15252
  const info = `{"behavior":<span style="color:green;">"${behavior}"</span>, "start": ${interiaTimeObj[behavior].start}, "duration": ${interiaTimeObj[behavior].duration}, "end": ${interiaTimeObj[behavior].end}}`;
15253
15253
  // const info = `<span style="color:green;">${behavior}</span>: Duration: ${interiaTimeObj[behavior].duration}s`;
15254
15254
  if (dom) {
15255
- dom.innerHTML = info;
15255
+ dom.textContent = info;
15256
15256
  return;
15257
15257
  }
15258
15258
  const debugUI = document.getElementById('debug-ui');
15259
15259
  const div = document.createElement('div');
15260
15260
  div.setAttribute('class', 'debug-ui-item');
15261
15261
  div.setAttribute('id', `debug-ui-${behavior}`);
15262
- div.innerHTML = info;
15262
+ div.textContent = info;
15263
15263
  debugUI.appendChild(div);
15264
15264
  }
15265
15265
  function functionRunTime() {
@@ -33200,6 +33200,16 @@ async function _requestCamera(video, facingMode, translate) {
33200
33200
  const aScore = a.device.label.includes(samsungCamera) ? 1 : 0;
33201
33201
  samsungCondition = bScore - aScore;
33202
33202
  }
33203
+ // 後鏡頭模式下,超廣角鏡頭 (zoom.min < 1) 排後面
33204
+ let ultraWideCondition = 0;
33205
+ if (facingMode === 'back') {
33206
+ var _a$capabilities$zoom$, _a$capabilities, _b$capabilities$zoom$, _b$capabilities;
33207
+ const aZoomMin = (_a$capabilities$zoom$ = (_a$capabilities = a.capabilities) == null || (_a$capabilities = _a$capabilities.zoom) == null ? void 0 : _a$capabilities.min) != null ? _a$capabilities$zoom$ : 1;
33208
+ const bZoomMin = (_b$capabilities$zoom$ = (_b$capabilities = b.capabilities) == null || (_b$capabilities = _b$capabilities.zoom) == null ? void 0 : _b$capabilities.min) != null ? _b$capabilities$zoom$ : 1;
33209
+ const aIsUltraWide = aZoomMin < 1 ? 1 : 0;
33210
+ const bIsUltraWide = bZoomMin < 1 ? 1 : 0;
33211
+ ultraWideCondition = aIsUltraWide - bIsUltraWide;
33212
+ }
33203
33213
  let cameraFacingCondition = 0;
33204
33214
  {
33205
33215
  const aFacingMode = a.meta.facingMode;
@@ -33209,7 +33219,7 @@ async function _requestCamera(video, facingMode, translate) {
33209
33219
  cameraFacingCondition = bScore - aScore;
33210
33220
  }
33211
33221
  const resolutionCondition = b.meta.resolution - a.meta.resolution;
33212
- return samsungCondition || cameraFacingCondition || resolutionCondition;
33222
+ return samsungCondition || cameraFacingCondition || ultraWideCondition || resolutionCondition;
33213
33223
  });
33214
33224
  const cameraIndex = window.localStorage.getItem('camera') || '0';
33215
33225
  const firstDevice = devices[parseInt(cameraIndex, 10)];
@@ -34366,7 +34376,8 @@ const uploadModal = arg => {
34366
34376
  uiThemeText(domTitle, uiThemeConfig.titleTwo);
34367
34377
  uiThemeText(domMessage, uiThemeConfig.bodyOne);
34368
34378
  if (arg.type === 'success') {
34369
- domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34379
+ domIcon.textContent = '';
34380
+ domIcon.insertAdjacentHTML('beforeend', `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34370
34381
  <rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
34371
34382
  <g clip-path="url(#clip0_success)">
34372
34383
  <path d="M32 51L43 62L67 38" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -34376,10 +34387,11 @@ const uploadModal = arg => {
34376
34387
  <rect width="48" height="48" fill="white" transform="translate(24 24)"/>
34377
34388
  </clipPath>
34378
34389
  </defs>
34379
- </svg>`;
34390
+ </svg>`);
34380
34391
  }
34381
34392
  if (arg.type === 'error') {
34382
- domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34393
+ domIcon.textContent = '';
34394
+ domIcon.insertAdjacentHTML('beforeend', `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34383
34395
  <rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
34384
34396
  <g clip-path="url(#clip0_error)">
34385
34397
  <path d="M62 34L34 62" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -34391,7 +34403,7 @@ const uploadModal = arg => {
34391
34403
  </clipPath>
34392
34404
  </defs>
34393
34405
  </svg>
34394
- `;
34406
+ `);
34395
34407
  }
34396
34408
  if (arg.type === 'success') {
34397
34409
  domTitle.innerText = arg.titleSuccess || '';
@@ -34901,7 +34913,7 @@ const themeConfigDefault = {
34901
34913
  };
34902
34914
 
34903
34915
  var name = "authme/sdk";
34904
- var version$1 = "2.8.54";
34916
+ var version$1 = "2.8.57";
34905
34917
  var packageInfo = {
34906
34918
  name: name,
34907
34919
  version: version$1};
package/index.esm.js CHANGED
@@ -15250,14 +15250,14 @@ function debugTools() {
15250
15250
  const info = `{"behavior":<span style="color:green;">"${behavior}"</span>, "start": ${interiaTimeObj[behavior].start}, "duration": ${interiaTimeObj[behavior].duration}, "end": ${interiaTimeObj[behavior].end}}`;
15251
15251
  // const info = `<span style="color:green;">${behavior}</span>: Duration: ${interiaTimeObj[behavior].duration}s`;
15252
15252
  if (dom) {
15253
- dom.innerHTML = info;
15253
+ dom.textContent = info;
15254
15254
  return;
15255
15255
  }
15256
15256
  const debugUI = document.getElementById('debug-ui');
15257
15257
  const div = document.createElement('div');
15258
15258
  div.setAttribute('class', 'debug-ui-item');
15259
15259
  div.setAttribute('id', `debug-ui-${behavior}`);
15260
- div.innerHTML = info;
15260
+ div.textContent = info;
15261
15261
  debugUI.appendChild(div);
15262
15262
  }
15263
15263
  function functionRunTime() {
@@ -33198,6 +33198,16 @@ async function _requestCamera(video, facingMode, translate) {
33198
33198
  const aScore = a.device.label.includes(samsungCamera) ? 1 : 0;
33199
33199
  samsungCondition = bScore - aScore;
33200
33200
  }
33201
+ // 後鏡頭模式下,超廣角鏡頭 (zoom.min < 1) 排後面
33202
+ let ultraWideCondition = 0;
33203
+ if (facingMode === 'back') {
33204
+ var _a$capabilities$zoom$, _a$capabilities, _b$capabilities$zoom$, _b$capabilities;
33205
+ const aZoomMin = (_a$capabilities$zoom$ = (_a$capabilities = a.capabilities) == null || (_a$capabilities = _a$capabilities.zoom) == null ? void 0 : _a$capabilities.min) != null ? _a$capabilities$zoom$ : 1;
33206
+ const bZoomMin = (_b$capabilities$zoom$ = (_b$capabilities = b.capabilities) == null || (_b$capabilities = _b$capabilities.zoom) == null ? void 0 : _b$capabilities.min) != null ? _b$capabilities$zoom$ : 1;
33207
+ const aIsUltraWide = aZoomMin < 1 ? 1 : 0;
33208
+ const bIsUltraWide = bZoomMin < 1 ? 1 : 0;
33209
+ ultraWideCondition = aIsUltraWide - bIsUltraWide;
33210
+ }
33201
33211
  let cameraFacingCondition = 0;
33202
33212
  {
33203
33213
  const aFacingMode = a.meta.facingMode;
@@ -33207,7 +33217,7 @@ async function _requestCamera(video, facingMode, translate) {
33207
33217
  cameraFacingCondition = bScore - aScore;
33208
33218
  }
33209
33219
  const resolutionCondition = b.meta.resolution - a.meta.resolution;
33210
- return samsungCondition || cameraFacingCondition || resolutionCondition;
33220
+ return samsungCondition || cameraFacingCondition || ultraWideCondition || resolutionCondition;
33211
33221
  });
33212
33222
  const cameraIndex = window.localStorage.getItem('camera') || '0';
33213
33223
  const firstDevice = devices[parseInt(cameraIndex, 10)];
@@ -34364,7 +34374,8 @@ const uploadModal = arg => {
34364
34374
  uiThemeText(domTitle, uiThemeConfig.titleTwo);
34365
34375
  uiThemeText(domMessage, uiThemeConfig.bodyOne);
34366
34376
  if (arg.type === 'success') {
34367
- domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34377
+ domIcon.textContent = '';
34378
+ domIcon.insertAdjacentHTML('beforeend', `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34368
34379
  <rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadCompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadCompleteView.backgroundOpacity}" />
34369
34380
  <g clip-path="url(#clip0_success)">
34370
34381
  <path d="M32 51L43 62L67 38" stroke="${uiThemeConfig.uploadCompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadCompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -34374,10 +34385,11 @@ const uploadModal = arg => {
34374
34385
  <rect width="48" height="48" fill="white" transform="translate(24 24)"/>
34375
34386
  </clipPath>
34376
34387
  </defs>
34377
- </svg>`;
34388
+ </svg>`);
34378
34389
  }
34379
34390
  if (arg.type === 'error') {
34380
- domIcon.innerHTML = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34391
+ domIcon.textContent = '';
34392
+ domIcon.insertAdjacentHTML('beforeend', `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
34381
34393
  <rect width="96" height="96" rx="48" fill="${uiThemeConfig.uploadIncompleteView.backgroundColor}" fill-opacity="${uiThemeConfig.uploadIncompleteView.backgroundOpacity}"/>
34382
34394
  <g clip-path="url(#clip0_error)">
34383
34395
  <path d="M62 34L34 62" stroke="${uiThemeConfig.uploadIncompleteView.contentColor}" stroke-opacity="${uiThemeConfig.uploadIncompleteView.contentOpacity}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -34389,7 +34401,7 @@ const uploadModal = arg => {
34389
34401
  </clipPath>
34390
34402
  </defs>
34391
34403
  </svg>
34392
- `;
34404
+ `);
34393
34405
  }
34394
34406
  if (arg.type === 'success') {
34395
34407
  domTitle.innerText = arg.titleSuccess || '';
@@ -34899,7 +34911,7 @@ const themeConfigDefault = {
34899
34911
  };
34900
34912
 
34901
34913
  var name = "authme/sdk";
34902
- var version$1 = "2.8.54";
34914
+ var version$1 = "2.8.57";
34903
34915
  var packageInfo = {
34904
34916
  name: name,
34905
34917
  version: version$1};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authme/util",
3
- "version": "2.8.54",
3
+ "version": "2.8.57",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0"
6
6
  },