@redneckz/wildless-cms-uni-blocks 0.5.6 → 0.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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +77 -106
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/AirPlaneIcon.svg +1 -1
- package/cosmos-static/icons/CarIcon.svg +1 -1
- package/cosmos-static/icons/CinemaIcon.svg +1 -1
- package/cosmos-static/icons/DocsIcon.svg +1 -1
- package/cosmos-static/icons/PackA4Icon.svg +1 -1
- package/cosmos-static/icons/PowerIcon.svg +1 -1
- package/cosmos-static/icons/PumpkinIcon.svg +1 -1
- package/cosmos-static/icons/SoundIcon.svg +1 -1
- package/cosmos-static/icons/WateringCanIcon.svg +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +1 -1
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +1 -1
- package/dist/components/ComparisonTable/TableColumn.d.ts +1 -1
- package/dist/components/Footer/FooterContent.d.ts +1 -1
- package/dist/components/Header/HeaderContent.d.ts +1 -1
- package/dist/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +1 -1
- package/dist/components/ProductTile/ProductTileContent.d.ts +1 -1
- package/dist/components/SafeDepositRental/SafeDepositRental.js +1 -6
- package/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/dist/components/SafeDepositRental/YandexMap.js +13 -6
- package/dist/components/SafeDepositRental/YandexMap.js.map +1 -1
- package/dist/components/SafeDepositRental/renderClusterer.d.ts +2 -1
- package/dist/components/SafeDepositRental/renderClusterer.js +16 -18
- package/dist/components/SafeDepositRental/renderClusterer.js.map +1 -1
- package/dist/components/SafeDepositRental/useYandexMaps.d.ts +2 -0
- package/dist/components/SafeDepositRental/useYandexMaps.js +12 -0
- package/dist/components/SafeDepositRental/useYandexMaps.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTableContent.d.ts +1 -1
- package/dist/hooks/useExternalNS.d.ts +2 -0
- package/dist/hooks/useExternalNS.js +39 -0
- package/dist/hooks/useExternalNS.js.map +1 -0
- package/dist/icons/IconName.d.ts +4 -4
- package/dist/icons/IconName.js +3 -3
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +1 -1
- package/dist/ui-kit/Select/Select.js +1 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/ui-kit/SelectCustom/SelectCustom.js +3 -3
- package/dist/ui-kit/SelectCustom/SelectCustom.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +1 -1
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +1 -1
- package/lib/components/ComparisonTable/TableColumn.d.ts +1 -1
- package/lib/components/ContentPage/computeAPIFallback.js +1 -1
- package/lib/components/Footer/FooterContent.d.ts +1 -1
- package/lib/components/Header/HeaderContent.d.ts +1 -1
- package/lib/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +1 -1
- package/lib/components/ProductTile/ProductTileContent.d.ts +1 -1
- package/lib/components/SafeDepositRental/SafeDepositRental.js +1 -6
- package/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/lib/components/SafeDepositRental/YandexMap.js +13 -6
- package/lib/components/SafeDepositRental/YandexMap.js.map +1 -1
- package/lib/components/SafeDepositRental/renderClusterer.d.ts +2 -1
- package/lib/components/SafeDepositRental/renderClusterer.js +16 -18
- package/lib/components/SafeDepositRental/renderClusterer.js.map +1 -1
- package/lib/components/SafeDepositRental/useYandexMaps.d.ts +2 -0
- package/lib/components/SafeDepositRental/useYandexMaps.js +9 -0
- package/lib/components/SafeDepositRental/useYandexMaps.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTableContent.d.ts +1 -1
- package/lib/hooks/useExternalNS.d.ts +2 -0
- package/lib/hooks/useExternalNS.js +35 -0
- package/lib/hooks/useExternalNS.js.map +1 -0
- package/lib/icons/IconName.d.ts +4 -4
- package/lib/icons/IconName.js +3 -3
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +1 -1
- package/lib/ui-kit/Select/Select.js +1 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/ui-kit/SelectCustom/SelectCustom.js +3 -3
- package/lib/ui-kit/SelectCustom/SelectCustom.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +6 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTableContent.d.ts +1 -1
- package/mobile/dist/components/ComparisonTable/TableColumn.d.ts +1 -1
- package/mobile/dist/components/Footer/FooterContent.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +1 -1
- package/mobile/dist/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +1 -1
- package/mobile/dist/components/ProductTile/ProductTileContent.d.ts +1 -1
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js +1 -6
- package/mobile/dist/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/YandexMap.js +13 -6
- package/mobile/dist/components/SafeDepositRental/YandexMap.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/renderClusterer.d.ts +2 -1
- package/mobile/dist/components/SafeDepositRental/renderClusterer.js +16 -18
- package/mobile/dist/components/SafeDepositRental/renderClusterer.js.map +1 -1
- package/mobile/dist/components/SafeDepositRental/useYandexMaps.d.ts +2 -0
- package/mobile/dist/components/SafeDepositRental/useYandexMaps.js +12 -0
- package/mobile/dist/components/SafeDepositRental/useYandexMaps.js.map +1 -0
- package/mobile/dist/components/TariffsTable/TariffsTableContent.d.ts +1 -1
- package/mobile/dist/hooks/useExternalNS.d.ts +2 -0
- package/mobile/dist/hooks/useExternalNS.js +39 -0
- package/mobile/dist/hooks/useExternalNS.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +4 -4
- package/mobile/dist/icons/IconName.js +3 -3
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItemProps.d.ts +1 -1
- package/mobile/dist/ui-kit/Select/Select.js +1 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/SelectCustom/SelectCustom.js +3 -3
- package/mobile/dist/ui-kit/SelectCustom/SelectCustom.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTableContent.d.ts +1 -1
- package/mobile/lib/components/ComparisonTable/TableColumn.d.ts +1 -1
- package/mobile/lib/components/ContentPage/computeAPIFallback.js +1 -1
- package/mobile/lib/components/Footer/FooterContent.d.ts +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +1 -1
- package/mobile/lib/components/OfficeServicesBlock/OfficeServicesBlockContent.d.ts +1 -1
- package/mobile/lib/components/ProductTile/ProductTileContent.d.ts +1 -1
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js +1 -6
- package/mobile/lib/components/SafeDepositRental/SafeDepositRental.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/YandexMap.js +13 -6
- package/mobile/lib/components/SafeDepositRental/YandexMap.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/renderClusterer.d.ts +2 -1
- package/mobile/lib/components/SafeDepositRental/renderClusterer.js +16 -18
- package/mobile/lib/components/SafeDepositRental/renderClusterer.js.map +1 -1
- package/mobile/lib/components/SafeDepositRental/useYandexMaps.d.ts +2 -0
- package/mobile/lib/components/SafeDepositRental/useYandexMaps.js +9 -0
- package/mobile/lib/components/SafeDepositRental/useYandexMaps.js.map +1 -0
- package/mobile/lib/components/TariffsTable/TariffsTableContent.d.ts +1 -1
- package/mobile/lib/hooks/useExternalNS.d.ts +2 -0
- package/mobile/lib/hooks/useExternalNS.js +35 -0
- package/mobile/lib/hooks/useExternalNS.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +4 -4
- package/mobile/lib/icons/IconName.js +3 -3
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItemProps.d.ts +1 -1
- package/mobile/lib/ui-kit/Select/Select.js +1 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/SelectCustom/SelectCustom.js +3 -3
- package/mobile/lib/ui-kit/SelectCustom/SelectCustom.js.map +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +2 -2
- package/mobile/src/components/Calculator/CalculatorContent.ts +2 -2
- package/mobile/src/components/ComparisonTable/ComparisonTableContent.ts +1 -1
- package/mobile/src/components/ComparisonTable/TableColumn.tsx +2 -2
- package/mobile/src/components/Footer/FooterContent.ts +2 -2
- package/mobile/src/components/GracePeriod/GracePeriodContent.ts +1 -1
- package/mobile/src/components/Header/HeaderContent.ts +1 -1
- package/mobile/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +1 -1
- package/mobile/src/components/OfficeServicesBlock/OfficeServicesBlockContent.ts +2 -2
- package/mobile/src/components/ProductTile/ProductTileContent.ts +1 -1
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.tsx +1 -12
- package/mobile/src/components/SafeDepositRental/YandexMap.tsx +17 -10
- package/mobile/src/components/SafeDepositRental/renderClusterer.ts +29 -23
- package/mobile/src/components/SafeDepositRental/useYandexMaps.ts +13 -0
- package/mobile/src/components/StepsBlock/StepsBlockContent.ts +1 -1
- package/mobile/src/components/TariffsTable/TariffsTableContent.ts +1 -1
- package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +2 -6
- package/mobile/src/hooks/useExternalNS.ts +44 -0
- package/mobile/src/icons/AirPlaneIcon.svg +1 -98
- package/mobile/src/icons/CarIcon.svg +1 -466
- package/mobile/src/icons/CinemaIcon.svg +1 -274
- package/mobile/src/icons/DocsIcon.svg +1 -238
- package/mobile/src/icons/IconName.ts +2 -2
- package/mobile/src/icons/PackA4Icon.svg +1 -1
- package/mobile/src/icons/PowerIcon.svg +1 -135
- package/mobile/src/icons/PumpkinIcon.svg +1 -236
- package/mobile/src/icons/SoundIcon.svg +1 -113
- package/mobile/src/icons/WateringCanIcon.svg +1 -497
- package/mobile/src/ui-kit/BenefitItem/BenefitItemProps.ts +2 -2
- package/mobile/src/ui-kit/Select/Select.tsx +1 -1
- package/mobile/src/ui-kit/SelectCustom/SelectCustom.tsx +9 -2
- package/package.json +4 -2
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +2 -2
- package/src/components/Calculator/CalculatorContent.ts +2 -2
- package/src/components/ComparisonTable/ComparisonTableContent.ts +1 -1
- package/src/components/ComparisonTable/TableColumn.tsx +2 -2
- package/src/components/Footer/FooterContent.ts +2 -2
- package/src/components/GracePeriod/GracePeriodContent.ts +1 -1
- package/src/components/Header/HeaderContent.ts +1 -1
- package/src/components/InsuranceAmountBlock/InsuranceAmountBlockContent.ts +1 -1
- package/src/components/OfficeServicesBlock/OfficeServicesBlockContent.ts +2 -2
- package/src/components/ProductTile/ProductTileContent.ts +1 -1
- package/src/components/SafeDepositRental/SafeDepositRental.tsx +1 -12
- package/src/components/SafeDepositRental/YandexMap.tsx +17 -10
- package/src/components/SafeDepositRental/renderClusterer.ts +29 -23
- package/src/components/SafeDepositRental/useYandexMaps.ts +13 -0
- package/src/components/StepsBlock/StepsBlockContent.ts +1 -1
- package/src/components/TariffsTable/TariffsTableContent.ts +1 -1
- package/src/components/__snapshots__/Blocks.spec.tsx.snap +2 -6
- package/src/hooks/useExternalNS.ts +44 -0
- package/src/icons/AirPlaneIcon.svg +1 -98
- package/src/icons/CarIcon.svg +1 -466
- package/src/icons/CinemaIcon.svg +1 -274
- package/src/icons/DocsIcon.svg +1 -238
- package/src/icons/IconName.ts +4 -4
- package/src/icons/PackA4Icon.svg +1 -1
- package/src/icons/PowerIcon.svg +1 -135
- package/src/icons/PumpkinIcon.svg +1 -236
- package/src/icons/SoundIcon.svg +1 -113
- package/src/icons/WateringCanIcon.svg +1 -497
- package/src/ui-kit/BenefitItem/BenefitItemProps.ts +2 -2
- package/src/ui-kit/Select/Select.tsx +1 -1
- package/src/ui-kit/SelectCustom/SelectCustom.tsx +9 -2
- package/tailwind.config.cjs +253 -0
- package/dist/hooks/useScript.d.ts +0 -6
- package/dist/hooks/useScript.js +0 -75
- package/dist/hooks/useScript.js.map +0 -1
- package/lib/hooks/useScript.d.ts +0 -6
- package/lib/hooks/useScript.js +0 -72
- package/lib/hooks/useScript.js.map +0 -1
- package/mobile/dist/hooks/useScript.d.ts +0 -6
- package/mobile/dist/hooks/useScript.js +0 -75
- package/mobile/dist/hooks/useScript.js.map +0 -1
- package/mobile/lib/hooks/useScript.d.ts +0 -6
- package/mobile/lib/hooks/useScript.js +0 -72
- package/mobile/lib/hooks/useScript.js.map +0 -1
- package/mobile/src/hooks/useScript.ts +0 -97
- package/src/hooks/useScript.ts +0 -97
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconProps
|
|
1
|
+
import type { IconProps } from '../../model/Picture';
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
3
|
import type { IconVersion } from '../../model/IconVersion';
|
|
4
4
|
import type { DescriptionProps, LabelProps } from '../../model/HeadlineType';
|
|
@@ -11,7 +11,7 @@ export interface BenefitItemCommonProps {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export type BenefitItemProps = DescriptionProps & LabelProps & IconProps
|
|
14
|
+
export type BenefitItemProps = DescriptionProps & LabelProps & IconProps;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @title Преимущество
|
|
@@ -9,7 +9,7 @@ export interface SelectProps {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const selectStyle = {
|
|
12
|
-
background: `url('/icons/ArrowDownIcon.svg')
|
|
12
|
+
background: `url('/icons/ArrowDownIcon.svg') right 16px top 50% / 21px no-repeat`,
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const Select = JSX<SelectProps>(
|
|
@@ -38,12 +38,17 @@ export const SelectCustom = JSX<SelectCustomProps>(
|
|
|
38
38
|
{label ? <span className="mb-2">{label}</span> : null}
|
|
39
39
|
<div className={`relative w-fit`}>
|
|
40
40
|
<div
|
|
41
|
-
className={`text-m-light flex justify-between min-h-[56px] mb-0.5 p-4 pr-8 text-primary-text cursor-pointer
|
|
41
|
+
className={`text-m-light flex justify-between items-center min-h-[56px] mb-0.5 p-4 pr-8 text-primary-text cursor-pointer
|
|
42
42
|
${getBorderStyle(isBorder)}`}
|
|
43
43
|
onClick={() => setIsOpen(!isOpen)}
|
|
44
44
|
>
|
|
45
45
|
{selectedItem.text}
|
|
46
|
-
<Icon
|
|
46
|
+
<Icon
|
|
47
|
+
name="ArrowUpIcon"
|
|
48
|
+
width="16"
|
|
49
|
+
height="16"
|
|
50
|
+
className={`absolute right-3 ${isOpen ? '' : 'rotate-180'}`}
|
|
51
|
+
/>
|
|
47
52
|
</div>
|
|
48
53
|
{options.length > 0 ? (
|
|
49
54
|
<div className={`h-0 ${isOpen ? '' : 'overflow-hidden'}`}>
|
|
@@ -71,6 +76,8 @@ const renderOption =
|
|
|
71
76
|
<span>{option.text}</span>
|
|
72
77
|
<Icon
|
|
73
78
|
name="DoneSimpleIcon"
|
|
79
|
+
width="16"
|
|
80
|
+
height="16"
|
|
74
81
|
className={['absolute right-4 pt-0.5', isSelected(option) && isOpen ? '' : 'hidden'].join(
|
|
75
82
|
' ',
|
|
76
83
|
)}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
3
|
+
|
|
4
|
+
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
content: ['./src/**/*.{js,jsx,ts,tsx,json}'],
|
|
8
|
+
corePlugins: {
|
|
9
|
+
filter: true,
|
|
10
|
+
},
|
|
11
|
+
theme: {
|
|
12
|
+
screens: {
|
|
13
|
+
sm: { min: '640px', max: '767px' },
|
|
14
|
+
// => @media (min-width: 640px and max-width: 767px) { ... }
|
|
15
|
+
|
|
16
|
+
md: { min: '768px', max: '1023px' },
|
|
17
|
+
// => @media (min-width: 768px and max-width: 1023px) { ... }
|
|
18
|
+
|
|
19
|
+
lg: { min: '1024px', max: '1279px' },
|
|
20
|
+
// => @media (min-width: 1024px and max-width: 1279px) { ... }
|
|
21
|
+
|
|
22
|
+
xl: { min: '1280px', max: '1535px' },
|
|
23
|
+
// => @media (min-width: 1280px and max-width: 1535px) { ... }
|
|
24
|
+
},
|
|
25
|
+
container: {
|
|
26
|
+
center: true,
|
|
27
|
+
},
|
|
28
|
+
extend: {
|
|
29
|
+
transitionProperty: {
|
|
30
|
+
height: 'height',
|
|
31
|
+
},
|
|
32
|
+
backgroundColor: {
|
|
33
|
+
'white/10': 'rgba(255,255,255,0.1);',
|
|
34
|
+
},
|
|
35
|
+
backgroundImage: {
|
|
36
|
+
'opacity-to-white':
|
|
37
|
+
'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%);',
|
|
38
|
+
'opacity-from-white':
|
|
39
|
+
'linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.7) 25%, rgba(255,255,255,0) 80%);',
|
|
40
|
+
'opacity-to-main':
|
|
41
|
+
'linear-gradient(270deg, rgba(var(--color-primary-main), 1) 34.89%, rgba(var(--color-primary-main), 0) 92.52%);',
|
|
42
|
+
'opacity-from-main':
|
|
43
|
+
'linear-gradient(90deg, rgba(var(--color-primary-main), 1) 0%, rgba(var(--color-primary-main), 0) 80%);',
|
|
44
|
+
'green-to-yellow': 'linear-gradient(180deg, #42AB44 0%, #F6DB7D 100%)',
|
|
45
|
+
},
|
|
46
|
+
fontFamily: {
|
|
47
|
+
sans: ['Ubuntu', ...defaultTheme.fontFamily.sans],
|
|
48
|
+
mohave: ['Mohave', ...defaultTheme.fontFamily.sans],
|
|
49
|
+
},
|
|
50
|
+
fontSize: {
|
|
51
|
+
'm-title': ['1.375rem', '1.8125rem'], // 22px 29px // Временно оставлен до готовности нового мобильного дизайна
|
|
52
|
+
'm-title-xs': ['1.0625rem', '1.375rem'], // 17px 22px // Временно оставлен до готовности нового мобильного дизайна
|
|
53
|
+
|
|
54
|
+
'title-extra': ['15.625rem', '14.687rem'], // 250px 235px
|
|
55
|
+
'title-huge': ['12.5rem', '15.625rem'], // 200px 250px
|
|
56
|
+
'title-error': ['76.75rem', '107rem'], // 307px 428px
|
|
57
|
+
h0: [
|
|
58
|
+
'3.5rem',
|
|
59
|
+
{
|
|
60
|
+
// 56px 56px
|
|
61
|
+
lineHeight: '3.5rem',
|
|
62
|
+
fontWeight: '400',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
h1: [
|
|
66
|
+
'3.125rem',
|
|
67
|
+
{
|
|
68
|
+
// 50px 52px
|
|
69
|
+
lineHeight: '3.25rem',
|
|
70
|
+
fontWeight: '400',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
h2: [
|
|
74
|
+
'2.5rem',
|
|
75
|
+
{
|
|
76
|
+
// 40px 48px
|
|
77
|
+
lineHeight: '3rem',
|
|
78
|
+
fontWeight: '400',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
h3: [
|
|
82
|
+
'2rem',
|
|
83
|
+
{
|
|
84
|
+
// 32px 40px
|
|
85
|
+
lineHeight: '2.5rem',
|
|
86
|
+
fontWeight: '400',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
h4: [
|
|
90
|
+
'1.75rem',
|
|
91
|
+
{
|
|
92
|
+
// 28px 36px
|
|
93
|
+
lineHeight: '2.25rem',
|
|
94
|
+
fontWeight: '400',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
h5: [
|
|
98
|
+
'1.5rem',
|
|
99
|
+
{
|
|
100
|
+
// 24px 30px
|
|
101
|
+
lineHeight: '1.875rem',
|
|
102
|
+
fontWeight: '400',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
'h5-light': [
|
|
106
|
+
'1.5rem',
|
|
107
|
+
{
|
|
108
|
+
// 24px 30px
|
|
109
|
+
lineHeight: '1.875rem',
|
|
110
|
+
fontWeight: '300',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
h6: [
|
|
114
|
+
'1.25rem',
|
|
115
|
+
{
|
|
116
|
+
// 20px 28px
|
|
117
|
+
lineHeight: '1.75rem',
|
|
118
|
+
fontWeight: '400',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
xl: [
|
|
122
|
+
'1.125rem',
|
|
123
|
+
{
|
|
124
|
+
// 18px 24px
|
|
125
|
+
lineHeight: '1.5rem',
|
|
126
|
+
fontWeight: '400',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
'xl-light': [
|
|
130
|
+
'1.125rem',
|
|
131
|
+
{
|
|
132
|
+
// 18px 24px
|
|
133
|
+
lineHeight: '1.5rem',
|
|
134
|
+
fontWeight: '300',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
l: [
|
|
138
|
+
'1rem',
|
|
139
|
+
{
|
|
140
|
+
// 16px 24px
|
|
141
|
+
lineHeight: '1.5rem',
|
|
142
|
+
fontWeight: '400',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
'l-light': [
|
|
146
|
+
'1rem',
|
|
147
|
+
{
|
|
148
|
+
// 16px 24px
|
|
149
|
+
lineHeight: '1.5rem',
|
|
150
|
+
fontWeight: '300',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
m: [
|
|
154
|
+
'0.9375rem',
|
|
155
|
+
{
|
|
156
|
+
// 15px 20px
|
|
157
|
+
lineHeight: '1.25rem',
|
|
158
|
+
fontWeight: '400',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
'm-light': [
|
|
162
|
+
'0.9375rem',
|
|
163
|
+
{
|
|
164
|
+
// 15px 20px
|
|
165
|
+
lineHeight: '1.25rem',
|
|
166
|
+
fontWeight: '300',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
s: [
|
|
170
|
+
'0.875rem',
|
|
171
|
+
{
|
|
172
|
+
// 14px 20px
|
|
173
|
+
lineHeight: '1.25rem',
|
|
174
|
+
fontWeight: '400',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
's-light': [
|
|
178
|
+
'0.875rem',
|
|
179
|
+
{
|
|
180
|
+
// 14px 20px
|
|
181
|
+
lineHeight: '1.25rem',
|
|
182
|
+
fontWeight: '300',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
'xs-light': [
|
|
186
|
+
'0.75rem',
|
|
187
|
+
{
|
|
188
|
+
// 12px 18px
|
|
189
|
+
lineHeight: '1.125rem',
|
|
190
|
+
fontWeight: '300',
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
colors: {
|
|
195
|
+
main: {
|
|
196
|
+
DEFAULT: 'rgba(240, 244, 240, <alpha-value>)',
|
|
197
|
+
divider: 'rgba(235, 237, 240, <alpha-value>)',
|
|
198
|
+
gradient: {
|
|
199
|
+
start: 'rgba(var(--color-gradient-from), <alpha-value>)',
|
|
200
|
+
end: 'rgba(var(--color-gradient-to), <alpha-value>)',
|
|
201
|
+
},
|
|
202
|
+
stroke: 'rgba(201, 202, 204, <alpha-value>)',
|
|
203
|
+
disabled: 'rgba(187, 187, 187, <alpha-value>)',
|
|
204
|
+
},
|
|
205
|
+
primary: {
|
|
206
|
+
main: 'rgba(var(--color-primary-main), <alpha-value>)',
|
|
207
|
+
hover: 'rgba(var(--color-primary-hover), <alpha-value>)',
|
|
208
|
+
active: 'rgba(var(--color-primary-active), <alpha-value>)',
|
|
209
|
+
// Text
|
|
210
|
+
text: 'rgba(28, 28, 28, <alpha-value>)',
|
|
211
|
+
},
|
|
212
|
+
secondary: {
|
|
213
|
+
hover: 'rgba(var(--color-secondary-hover), <alpha-value>)',
|
|
214
|
+
active: 'rgba(var(--color-secondary-active), <alpha-value>)',
|
|
215
|
+
// Gray
|
|
216
|
+
light: 'rgba(245, 247, 249, <alpha-value>)',
|
|
217
|
+
dark: 'rgba(226, 228, 229, <alpha-value>)',
|
|
218
|
+
// Text
|
|
219
|
+
text: 'rgba(125, 126, 127, <alpha-value>)',
|
|
220
|
+
},
|
|
221
|
+
gray: 'rgba(201, 202, 204, <alpha-value>)',
|
|
222
|
+
},
|
|
223
|
+
minHeight: (theme) => ({
|
|
224
|
+
...theme('spacing'),
|
|
225
|
+
}),
|
|
226
|
+
minWidth: (theme) => ({
|
|
227
|
+
...theme('spacing'),
|
|
228
|
+
}),
|
|
229
|
+
animation: {
|
|
230
|
+
expansion: 'expansion 0.3s ease-out',
|
|
231
|
+
},
|
|
232
|
+
keyframes: {
|
|
233
|
+
expansion: {
|
|
234
|
+
from: { transform: 'scaleY(0)' },
|
|
235
|
+
to: { transform: 'scaleY(1)' },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
boxShadow: {
|
|
239
|
+
'dark-blue/42': '0 18px 36px -4px rgba(24, 39, 75, 0.42);',
|
|
240
|
+
'blue-gray/24': '0 14px 36px -4px rgba(21, 40, 90, 0.24);',
|
|
241
|
+
},
|
|
242
|
+
borderColor: {
|
|
243
|
+
'white/50': 'rgba(255,255,255,.5);',
|
|
244
|
+
'gray/100': 'rgba(235, 237, 240, 1);',
|
|
245
|
+
'primary-hover': 'rgba(134, 134, 134, 1);',
|
|
246
|
+
'primary-focus': 'rgba(28, 28, 28, 1);',
|
|
247
|
+
'checkbox-hover': 'rgba(134, 134, 134, 1);',
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
plugins: [],
|
|
252
|
+
safelist: [],
|
|
253
|
+
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type ScriptStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
2
|
-
export interface UseScriptOptions {
|
|
3
|
-
shouldPreventLoad?: boolean;
|
|
4
|
-
removeOnUnmount?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function useScript(src: string | null, options?: UseScriptOptions): ScriptStatus;
|
package/dist/hooks/useScript.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useScript = void 0;
|
|
3
|
-
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
-
const cachedScriptStatuses = {};
|
|
5
|
-
function getScriptNode(src) {
|
|
6
|
-
const node = document.querySelector(`script[src="${src}"]`);
|
|
7
|
-
const status = node?.getAttribute('data-status');
|
|
8
|
-
return {
|
|
9
|
-
node,
|
|
10
|
-
status,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function getScriptStatus(type) {
|
|
14
|
-
return type === 'load' ? 'ready' : 'error';
|
|
15
|
-
}
|
|
16
|
-
function getInitialValueStatus(src, options) {
|
|
17
|
-
if (!src || options?.shouldPreventLoad) {
|
|
18
|
-
return 'idle';
|
|
19
|
-
}
|
|
20
|
-
if (typeof window === 'undefined') {
|
|
21
|
-
return 'loading';
|
|
22
|
-
}
|
|
23
|
-
return cachedScriptStatuses[src] ?? 'loading';
|
|
24
|
-
}
|
|
25
|
-
function useScript(src, options) {
|
|
26
|
-
const [status, setStatus] = (0, hooks_1.useState)(getInitialValueStatus(src, options));
|
|
27
|
-
// eslint-disable-next-line complexity
|
|
28
|
-
(0, hooks_1.useEffect)(() => {
|
|
29
|
-
if (!src || options?.shouldPreventLoad) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const cachedScriptStatus = cachedScriptStatuses[src];
|
|
33
|
-
if (cachedScriptStatus === 'ready' || cachedScriptStatus === 'error') {
|
|
34
|
-
setStatus(cachedScriptStatus);
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
const script = getScriptNode(src);
|
|
38
|
-
let scriptNode = script.node;
|
|
39
|
-
if (!scriptNode) {
|
|
40
|
-
scriptNode = document.createElement('script');
|
|
41
|
-
scriptNode.src = src;
|
|
42
|
-
scriptNode.async = true;
|
|
43
|
-
scriptNode.setAttribute('data-status', 'loading');
|
|
44
|
-
document.body.appendChild(scriptNode);
|
|
45
|
-
const setAttributeFromEvent = (event) => {
|
|
46
|
-
const scriptStatus = getScriptStatus(event.type);
|
|
47
|
-
scriptNode?.setAttribute('data-status', scriptStatus);
|
|
48
|
-
};
|
|
49
|
-
scriptNode.addEventListener('load', setAttributeFromEvent);
|
|
50
|
-
scriptNode.addEventListener('error', setAttributeFromEvent);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
setStatus(script.status ?? cachedScriptStatus ?? 'loading');
|
|
54
|
-
}
|
|
55
|
-
const setStateFromEvent = (event) => {
|
|
56
|
-
const newStatus = getScriptStatus(event.type);
|
|
57
|
-
setStatus(newStatus);
|
|
58
|
-
cachedScriptStatuses[src] = newStatus;
|
|
59
|
-
};
|
|
60
|
-
scriptNode.addEventListener('load', setStateFromEvent);
|
|
61
|
-
scriptNode.addEventListener('error', setStateFromEvent);
|
|
62
|
-
return () => {
|
|
63
|
-
if (scriptNode) {
|
|
64
|
-
scriptNode.removeEventListener('load', setStateFromEvent);
|
|
65
|
-
scriptNode.removeEventListener('error', setStateFromEvent);
|
|
66
|
-
}
|
|
67
|
-
if (scriptNode && options?.removeOnUnmount) {
|
|
68
|
-
scriptNode.remove();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}, [src, options?.shouldPreventLoad, options?.removeOnUnmount]);
|
|
72
|
-
return status;
|
|
73
|
-
}
|
|
74
|
-
exports.useScript = useScript;
|
|
75
|
-
//# sourceMappingURL=useScript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScript.js","sourceRoot":"","sources":["../../src/hooks/useScript.ts"],"names":[],"mappings":";;AAAA,uDAAkE;AAQlE,MAAM,oBAAoB,GAA6C,EAAE,CAAC;AAE1E,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,IAAI,GAA6B,QAAQ,CAAC,aAAa,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,IAAI,EAAE,YAAY,CAAC,aAAa,CAA6B,CAAC;IAE7E,OAAO;QACL,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAI;IAC3B,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAkB,EAAE,OAA0B;IAC3E,IAAI,CAAC,GAAG,IAAI,OAAO,EAAE,iBAAiB,EAAE;QACtC,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,oBAAoB,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;AAChD,CAAC;AAED,SAAgB,SAAS,CAAC,GAAkB,EAAE,OAA0B;IACtE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAe,qBAAqB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAExF,sCAAsC;IACtC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,IAAI,OAAO,EAAE,iBAAiB,EAAE;YACtC,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,kBAA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UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QACvD,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAExD,OAAO,GAAG,EAAE;YACV,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;gBAC1D,UAAU,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;aAC5D;YAED,IAAI,UAAU,IAAI,OAAO,EAAE,eAAe,EAAE;gBAC1C,UAAU,CAAC,MAAM,EAAE,CAAC;aACrB;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC;AA5DD,8BA4DC"}
|
package/lib/hooks/useScript.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type ScriptStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
2
|
-
export interface UseScriptOptions {
|
|
3
|
-
shouldPreventLoad?: boolean;
|
|
4
|
-
removeOnUnmount?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function useScript(src: string | null, options?: UseScriptOptions): ScriptStatus;
|
package/lib/hooks/useScript.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
const cachedScriptStatuses = {};
|
|
3
|
-
function getScriptNode(src) {
|
|
4
|
-
const node = document.querySelector(`script[src="${src}"]`);
|
|
5
|
-
const status = node?.getAttribute('data-status');
|
|
6
|
-
return {
|
|
7
|
-
node,
|
|
8
|
-
status,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function getScriptStatus(type) {
|
|
12
|
-
return type === 'load' ? 'ready' : 'error';
|
|
13
|
-
}
|
|
14
|
-
function getInitialValueStatus(src, options) {
|
|
15
|
-
if (!src || options?.shouldPreventLoad) {
|
|
16
|
-
return 'idle';
|
|
17
|
-
}
|
|
18
|
-
if (typeof window === 'undefined') {
|
|
19
|
-
return 'loading';
|
|
20
|
-
}
|
|
21
|
-
return cachedScriptStatuses[src] ?? 'loading';
|
|
22
|
-
}
|
|
23
|
-
export function useScript(src, options) {
|
|
24
|
-
const [status, setStatus] = useState(getInitialValueStatus(src, options));
|
|
25
|
-
// eslint-disable-next-line complexity
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (!src || options?.shouldPreventLoad) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
const cachedScriptStatus = cachedScriptStatuses[src];
|
|
31
|
-
if (cachedScriptStatus === 'ready' || cachedScriptStatus === 'error') {
|
|
32
|
-
setStatus(cachedScriptStatus);
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
const script = getScriptNode(src);
|
|
36
|
-
let scriptNode = script.node;
|
|
37
|
-
if (!scriptNode) {
|
|
38
|
-
scriptNode = document.createElement('script');
|
|
39
|
-
scriptNode.src = src;
|
|
40
|
-
scriptNode.async = true;
|
|
41
|
-
scriptNode.setAttribute('data-status', 'loading');
|
|
42
|
-
document.body.appendChild(scriptNode);
|
|
43
|
-
const setAttributeFromEvent = (event) => {
|
|
44
|
-
const scriptStatus = getScriptStatus(event.type);
|
|
45
|
-
scriptNode?.setAttribute('data-status', scriptStatus);
|
|
46
|
-
};
|
|
47
|
-
scriptNode.addEventListener('load', setAttributeFromEvent);
|
|
48
|
-
scriptNode.addEventListener('error', setAttributeFromEvent);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
setStatus(script.status ?? cachedScriptStatus ?? 'loading');
|
|
52
|
-
}
|
|
53
|
-
const setStateFromEvent = (event) => {
|
|
54
|
-
const newStatus = getScriptStatus(event.type);
|
|
55
|
-
setStatus(newStatus);
|
|
56
|
-
cachedScriptStatuses[src] = newStatus;
|
|
57
|
-
};
|
|
58
|
-
scriptNode.addEventListener('load', setStateFromEvent);
|
|
59
|
-
scriptNode.addEventListener('error', setStateFromEvent);
|
|
60
|
-
return () => {
|
|
61
|
-
if (scriptNode) {
|
|
62
|
-
scriptNode.removeEventListener('load', setStateFromEvent);
|
|
63
|
-
scriptNode.removeEventListener('error', setStateFromEvent);
|
|
64
|
-
}
|
|
65
|
-
if (scriptNode && options?.removeOnUnmount) {
|
|
66
|
-
scriptNode.remove();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}, [src, options?.shouldPreventLoad, options?.removeOnUnmount]);
|
|
70
|
-
return status;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=useScript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScript.js","sourceRoot":"","sources":["../../src/hooks/useScript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAQlE,MAAM,oBAAoB,GAA6C,EAAE,CAAC;AAE1E,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,IAAI,GAA6B,QAAQ,CAAC,aAAa,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,IAAI,EAAE,YAAY,CAAC,aAAa,CAA6B,CAAC;IAE7E,OAAO;QACL,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAI;IAC3B,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAkB,EAAE,OAA0B;IAC3E,IAAI,CAAC,GAAG,IAAI,OAAO,EAAE,iBAAiB,EAAE;QACtC,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,SAAS,CAAC;KAClB;IAED,OAAO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AgB,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;SAC7D;aAAM;YACL,SAAS,CAAC,MAAM,CAAC,MAAM,IAAI,kBAAkB,IAAI,SAAS,CAAC,CAAC;SAC7D;QAED,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAE,EAAE;YACzC,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9C,SAAS,CAAC,SAAS,CAAC,CAAC;YACrB,oBAAoB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;QACxC,CAAC,CAAC;QAEF,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QACvD,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAExD,OAAO,GAAG,EAAE;YACV,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;gBAC1D,UAAU,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;aAC5D;YAED,IAAI,UAAU,IAAI,OAAO,EAAE,eAAe,EAAE;gBAC1C,UAAU,CAAC,MAAM,EAAE,CAAC;aACrB;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type ScriptStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
2
|
-
export interface UseScriptOptions {
|
|
3
|
-
shouldPreventLoad?: boolean;
|
|
4
|
-
removeOnUnmount?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function useScript(src: string | null, options?: UseScriptOptions): ScriptStatus;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.useScript = void 0;
|
|
3
|
-
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
4
|
-
const cachedScriptStatuses = {};
|
|
5
|
-
function getScriptNode(src) {
|
|
6
|
-
const node = document.querySelector(`script[src="${src}"]`);
|
|
7
|
-
const status = node?.getAttribute('data-status');
|
|
8
|
-
return {
|
|
9
|
-
node,
|
|
10
|
-
status,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function getScriptStatus(type) {
|
|
14
|
-
return type === 'load' ? 'ready' : 'error';
|
|
15
|
-
}
|
|
16
|
-
function getInitialValueStatus(src, options) {
|
|
17
|
-
if (!src || options?.shouldPreventLoad) {
|
|
18
|
-
return 'idle';
|
|
19
|
-
}
|
|
20
|
-
if (typeof window === 'undefined') {
|
|
21
|
-
return 'loading';
|
|
22
|
-
}
|
|
23
|
-
return cachedScriptStatuses[src] ?? 'loading';
|
|
24
|
-
}
|
|
25
|
-
function useScript(src, options) {
|
|
26
|
-
const [status, setStatus] = (0, hooks_1.useState)(getInitialValueStatus(src, options));
|
|
27
|
-
// eslint-disable-next-line complexity
|
|
28
|
-
(0, hooks_1.useEffect)(() => {
|
|
29
|
-
if (!src || options?.shouldPreventLoad) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const cachedScriptStatus = cachedScriptStatuses[src];
|
|
33
|
-
if (cachedScriptStatus === 'ready' || cachedScriptStatus === 'error') {
|
|
34
|
-
setStatus(cachedScriptStatus);
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
const script = getScriptNode(src);
|
|
38
|
-
let scriptNode = script.node;
|
|
39
|
-
if (!scriptNode) {
|
|
40
|
-
scriptNode = document.createElement('script');
|
|
41
|
-
scriptNode.src = src;
|
|
42
|
-
scriptNode.async = true;
|
|
43
|
-
scriptNode.setAttribute('data-status', 'loading');
|
|
44
|
-
document.body.appendChild(scriptNode);
|
|
45
|
-
const setAttributeFromEvent = (event) => {
|
|
46
|
-
const scriptStatus = getScriptStatus(event.type);
|
|
47
|
-
scriptNode?.setAttribute('data-status', scriptStatus);
|
|
48
|
-
};
|
|
49
|
-
scriptNode.addEventListener('load', setAttributeFromEvent);
|
|
50
|
-
scriptNode.addEventListener('error', setAttributeFromEvent);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
setStatus(script.status ?? cachedScriptStatus ?? 'loading');
|
|
54
|
-
}
|
|
55
|
-
const setStateFromEvent = (event) => {
|
|
56
|
-
const newStatus = getScriptStatus(event.type);
|
|
57
|
-
setStatus(newStatus);
|
|
58
|
-
cachedScriptStatuses[src] = newStatus;
|
|
59
|
-
};
|
|
60
|
-
scriptNode.addEventListener('load', setStateFromEvent);
|
|
61
|
-
scriptNode.addEventListener('error', setStateFromEvent);
|
|
62
|
-
return () => {
|
|
63
|
-
if (scriptNode) {
|
|
64
|
-
scriptNode.removeEventListener('load', setStateFromEvent);
|
|
65
|
-
scriptNode.removeEventListener('error', setStateFromEvent);
|
|
66
|
-
}
|
|
67
|
-
if (scriptNode && options?.removeOnUnmount) {
|
|
68
|
-
scriptNode.remove();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}, [src, options?.shouldPreventLoad, options?.removeOnUnmount]);
|
|
72
|
-
return status;
|
|
73
|
-
}
|
|
74
|
-
exports.useScript = useScript;
|
|
75
|
-
//# sourceMappingURL=useScript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScript.js","sourceRoot":"","sources":["../../src/hooks/useScript.ts"],"names":[],"mappings":";;AAAA,uDAAkE;AAQlE,MAAM,oBAAoB,GAA6C,EAAE,CAAC;AAE1E,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,IAAI,GAA6B,QAAQ,CAAC,aAAa,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACtF,MAAM,MAAM,GAAG,IAAI,EAAE,YAAY,CAAC,aAAa,CAA6B,CAAC;IAE7E,OAAO;QACL,IAAI;QACJ,MAAM;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AAe,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC;AA5DD,8BA4DC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type ScriptStatus = 'idle' | 'loading' | 'ready' | 'error';
|
|
2
|
-
export interface UseScriptOptions {
|
|
3
|
-
shouldPreventLoad?: boolean;
|
|
4
|
-
removeOnUnmount?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function useScript(src: string | null, options?: UseScriptOptions): ScriptStatus;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
const cachedScriptStatuses = {};
|
|
3
|
-
function getScriptNode(src) {
|
|
4
|
-
const node = document.querySelector(`script[src="${src}"]`);
|
|
5
|
-
const status = node?.getAttribute('data-status');
|
|
6
|
-
return {
|
|
7
|
-
node,
|
|
8
|
-
status,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function getScriptStatus(type) {
|
|
12
|
-
return type === 'load' ? 'ready' : 'error';
|
|
13
|
-
}
|
|
14
|
-
function getInitialValueStatus(src, options) {
|
|
15
|
-
if (!src || options?.shouldPreventLoad) {
|
|
16
|
-
return 'idle';
|
|
17
|
-
}
|
|
18
|
-
if (typeof window === 'undefined') {
|
|
19
|
-
return 'loading';
|
|
20
|
-
}
|
|
21
|
-
return cachedScriptStatuses[src] ?? 'loading';
|
|
22
|
-
}
|
|
23
|
-
export function useScript(src, options) {
|
|
24
|
-
const [status, setStatus] = useState(getInitialValueStatus(src, options));
|
|
25
|
-
// eslint-disable-next-line complexity
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (!src || options?.shouldPreventLoad) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
const cachedScriptStatus = cachedScriptStatuses[src];
|
|
31
|
-
if (cachedScriptStatus === 'ready' || cachedScriptStatus === 'error') {
|
|
32
|
-
setStatus(cachedScriptStatus);
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
const script = getScriptNode(src);
|
|
36
|
-
let scriptNode = script.node;
|
|
37
|
-
if (!scriptNode) {
|
|
38
|
-
scriptNode = document.createElement('script');
|
|
39
|
-
scriptNode.src = src;
|
|
40
|
-
scriptNode.async = true;
|
|
41
|
-
scriptNode.setAttribute('data-status', 'loading');
|
|
42
|
-
document.body.appendChild(scriptNode);
|
|
43
|
-
const setAttributeFromEvent = (event) => {
|
|
44
|
-
const scriptStatus = getScriptStatus(event.type);
|
|
45
|
-
scriptNode?.setAttribute('data-status', scriptStatus);
|
|
46
|
-
};
|
|
47
|
-
scriptNode.addEventListener('load', setAttributeFromEvent);
|
|
48
|
-
scriptNode.addEventListener('error', setAttributeFromEvent);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
setStatus(script.status ?? cachedScriptStatus ?? 'loading');
|
|
52
|
-
}
|
|
53
|
-
const setStateFromEvent = (event) => {
|
|
54
|
-
const newStatus = getScriptStatus(event.type);
|
|
55
|
-
setStatus(newStatus);
|
|
56
|
-
cachedScriptStatuses[src] = newStatus;
|
|
57
|
-
};
|
|
58
|
-
scriptNode.addEventListener('load', setStateFromEvent);
|
|
59
|
-
scriptNode.addEventListener('error', setStateFromEvent);
|
|
60
|
-
return () => {
|
|
61
|
-
if (scriptNode) {
|
|
62
|
-
scriptNode.removeEventListener('load', setStateFromEvent);
|
|
63
|
-
scriptNode.removeEventListener('error', setStateFromEvent);
|
|
64
|
-
}
|
|
65
|
-
if (scriptNode && options?.removeOnUnmount) {
|
|
66
|
-
scriptNode.remove();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}, [src, options?.shouldPreventLoad, options?.removeOnUnmount]);
|
|
70
|
-
return status;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=useScript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScript.js","sourceRoot":"","sources":["../../src/hooks/useScript.ts"],"names":[],"mappings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