@mptw/skylens-ui 1.4.66 → 1.4.68

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/.env.local ADDED
@@ -0,0 +1 @@
1
+ NUXT_PUBLIC_ICO_URL=https://skylens-mng-dev-1087511617183.asia-east1.run.app
package/.env.stage ADDED
@@ -0,0 +1 @@
1
+ NUXT_PUBLIC_ICO_URL=https://skylens-mng-dev-1087511617183.asia-east1.run.app
@@ -1,5 +1,7 @@
1
1
  <template lang="pug">
2
2
  .card
3
+ .card-prepend(v-if='$slots.prepend')
4
+ slot(name='prepend')
3
5
  .card-header(
4
6
  v-if='title !== "" || $slots.header || $slots.title || $slots["title-container"] || desc !== "" || $slots.desc || $slots["header-left"] || $slots["header-right"]'
5
7
  )
@@ -75,6 +77,9 @@ export default defineComponent({
75
77
  .card
76
78
  @apply p-4 border border-primary-600 rounded bg-white shadow
77
79
 
80
+ .card-prepend
81
+ @apply mb-4
82
+
78
83
  .card-header
79
84
  @apply flex justify-between mb-4
80
85
 
package/nuxt.config.ts CHANGED
@@ -10,6 +10,7 @@ export default defineNuxtConfig({
10
10
  runtimeConfig: {
11
11
  public: {
12
12
  defaultMobileEndDateBeforeNow: 4,
13
+ icoUrl: 'https://skylens-mng-dev-1087511617183.asia-east1.run.app',
13
14
  },
14
15
  },
15
16
  components: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mptw/skylens-ui",
3
3
  "type": "module",
4
- "version": "1.4.66",
4
+ "version": "1.4.68",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",
package/utils/index.ts CHANGED
@@ -486,11 +486,10 @@ export const ga4ev = ({ category, action, label, value, cb }: {
486
486
  };
487
487
 
488
488
  export const getWebsiteFavico = (domain: string): Promise<{ domain: string; icoUrl: string; }> => {
489
+ const runtimeConfig = useRuntimeConfig();
490
+
489
491
  return new Promise((resolve) => {
490
- const icoUrl = `https://storage.googleapis.com/domains-favicon/${domain.replaceAll(
491
- '.',
492
- '_'
493
- )}.ico`;
492
+ const icoUrl = `${runtimeConfig.public.icoUrl}/api/4.0/domain_ico?domain=${domain}`;
494
493
  const canvas = document.createElement('canvas');
495
494
  canvas.width = 26;
496
495
  canvas.height = 26;
@@ -513,9 +512,6 @@ export const getWebsiteFavico = (domain: string): Promise<{ domain: string; icoU
513
512
 
514
513
  resolve({ domain, icoUrl: canvas.toDataURL('image/png', 1.0) });
515
514
  };
516
- image.onerror = () => {
517
- image.src = `${window.location.protocol}//${window.location.host}/assets/images/commons/default-favico.png`;
518
- };
519
515
  image.src = icoUrl;
520
516
  });
521
517
  };