@yatoday/astro-ui 0.18.2 → 0.18.4
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/components/Analytics/AnalyticsGTM.astro +3 -3
- package/components/Analytics/AnalyticsGTMBody.astro +16 -12
- package/components/Analytics/AnalyticsGoogle.astro +3 -1
- package/components/BreadcrumbsItem/BreadcrumbsItem.astro +8 -1
- package/components/Button/types.ts +2 -1
- package/components/CallToAction/CallToAction.astro +1 -1
- package/components/Card0/Card0.astro +20 -32
- package/components/Card1/Card1.astro +11 -19
- package/components/Card2/Card2.astro +10 -14
- package/components/Card3/Card3.astro +15 -20
- package/components/Card4/Card4.astro +6 -2
- package/components/Card5/Card5.astro +8 -1
- package/components/Card6/Card6.astro +76 -59
- package/components/Card7/Card7.astro +27 -18
- package/components/CookieConsent/CookieConsent.astro +323 -308
- package/components/CopyToClipboard/CopyToClipboard.astro +6 -14
- package/components/CopyToClipboard/copy.ts +1 -1
- package/components/DarkMode/__tests__/DarkMode.test.ts +8 -8
- package/components/Headline/Headline.astro +4 -1
- package/components/HeroSection/HeroSection.astro +13 -16
- package/components/Image/Image.astro +1 -7
- package/components/ImageGallery/ImageGallery.astro +85 -90
- package/components/ImageGalleryIkea/ImageGalleryIkea.astro +3 -2
- package/components/ImagePreload/ImagePreload.astro +22 -20
- package/components/ItemGrid1/ItemGrid1.astro +34 -24
- package/components/Metadata/Metadata.astro +1 -5
- package/components/PointMap/PointMap.astro +62 -48
- package/components/PointMap/types.ts +3 -3
- package/components/SEO/SEO.astro +34 -33
- package/components/WidgetBrands/WidgetBrands.astro +8 -1
- package/components/WidgetContent/WidgetContent.astro +22 -9
- package/components/WidgetContent/types.ts +1 -1
- package/components/WidgetFeaturesCard/WidgetFeaturesCard.astro +10 -2
- package/components/WidgetHeroSlider/WidgetHeroSlider.astro +6 -1
- package/components/WidgetNavbarFlyout/WidgetNavbarFlyout.astro +16 -7
- package/components/WidgetSwiperPhotoSlider/WidgetSwiperPhotoSlider.astro +18 -7
- package/components/WidgetTestimonials/WidgetTestimonials.astro +8 -1
- package/components/WidgetWrapper/WidgetWrapper.astro +11 -2
- package/index.d.ts +20 -20
- package/package.json +11 -9
- package/styles/styles.css +303 -160
- package/utils/i18n.ts +2 -2
- package/utils/images.ts +0 -1
- package/utils/slugify.ts +3 -0
- package/vendor-config/config.example.yaml +0 -1
- package/vendor-config/index.ts +1 -1
- package/vendor-config/utils/loadConfig.ts +15 -18
package/utils/i18n.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Dynamic imports to handle case when i18n is not enabled
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const i18nConfig: { locales?: unknown[]; defaultLocale?: string } | null = null;
|
|
8
|
+
const toCodesFunction: ((locales: unknown[]) => string[]) | null = null;
|
|
9
9
|
|
|
10
10
|
// Try to load i18n modules - they may not be available if i18n is not configured
|
|
11
11
|
try {
|
package/utils/images.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { ImageMetadata } from 'astro';
|
|
|
6
6
|
const load = async function () {
|
|
7
7
|
let images: Record<string, () => Promise<unknown>> | undefined;
|
|
8
8
|
try {
|
|
9
|
-
// @ts-ignore
|
|
10
9
|
images = import.meta.glob(
|
|
11
10
|
'/src/assets/images/**/*.{jpeg,jpg,png,tiff,webp,gif,svg,JPEG,JPG,PNG,TIFF,WEBP,GIF,SVG}'
|
|
12
11
|
);
|
package/utils/slugify.ts
CHANGED
|
@@ -16,6 +16,9 @@ interface CharMap {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const charMap: CharMap = JSON.parse(
|
|
19
|
+
// The \" sequences are redundant for this single-quoted JS string but are part of the
|
|
20
|
+
// embedded JSON payload (they encode a literal " for the smart-quote entries); leave them.
|
|
21
|
+
// eslint-disable-next-line no-useless-escape
|
|
19
22
|
'{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\\"","”":"\\\"","„":"\\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}'
|
|
20
23
|
);
|
|
21
24
|
|
package/vendor-config/index.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default ({ config: _themeConfig = 'src/config.yaml' } = {}): AstroIntegra
|
|
|
26
26
|
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
27
27
|
|
|
28
28
|
const rawJsonConfig = (await loadConfig(_themeConfig)) as Config;
|
|
29
|
-
const { SITE, I18N, METADATA, APP_BLOG, UI, ANALYTICS} = configBuilder(rawJsonConfig);
|
|
29
|
+
const { SITE, I18N, METADATA, APP_BLOG, UI, ANALYTICS } = configBuilder(rawJsonConfig);
|
|
30
30
|
|
|
31
31
|
updateConfig({
|
|
32
32
|
site: SITE.site,
|
|
@@ -18,25 +18,22 @@ import fs from 'node:fs';
|
|
|
18
18
|
* // Returns: 'https://example.com'
|
|
19
19
|
*/
|
|
20
20
|
const interpolateEnvVars = (content: string): string => {
|
|
21
|
-
return content.replace(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (defaultValue !== '') {
|
|
33
|
-
return defaultValue;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Otherwise, keep the original placeholder
|
|
37
|
-
return match;
|
|
21
|
+
return content.replace(/\$\{([A-Z_][A-Z0-9_]*):?([^}]*)\}/g, (match, varName, defaultValue) => {
|
|
22
|
+
const envValue = process.env[varName];
|
|
23
|
+
|
|
24
|
+
// If env var exists, use it
|
|
25
|
+
if (envValue !== undefined) {
|
|
26
|
+
return envValue;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// If default value provided, use it
|
|
30
|
+
if (defaultValue !== '') {
|
|
31
|
+
return defaultValue;
|
|
38
32
|
}
|
|
39
|
-
|
|
33
|
+
|
|
34
|
+
// Otherwise, keep the original placeholder
|
|
35
|
+
return match;
|
|
36
|
+
});
|
|
40
37
|
};
|
|
41
38
|
|
|
42
39
|
const loadConfig = async (configPathOrData: string | object) => {
|