@hkdigital/lib-core 0.5.95 → 0.5.97

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 (38) hide show
  1. package/README.md +12 -46
  2. package/dist/config/generators/imagetools.d.ts +4 -10
  3. package/dist/config/generators/imagetools.js +43 -25
  4. package/dist/config/imagetools.d.ts +2 -2
  5. package/dist/meta/components/Favicons.svelte +1 -1
  6. package/dist/meta/components/Favicons.svelte.d.ts +9 -5
  7. package/dist/meta/components/PWA.svelte +2 -2
  8. package/dist/meta/components/PWA.svelte.d.ts +9 -5
  9. package/dist/meta/components/SEO.svelte +113 -77
  10. package/dist/meta/components/SEO.svelte.d.ts +28 -28
  11. package/dist/meta/config.d.ts +56 -0
  12. package/dist/meta/config.js +121 -0
  13. package/dist/meta/favicon.png +0 -0
  14. package/dist/meta/preview-landscape.png +0 -0
  15. package/dist/meta/preview-square.png +0 -0
  16. package/dist/meta/templates/README.md +3 -3
  17. package/dist/meta/templates/lib/{config/meta.d.ts → meta/config.d.ts} +22 -29
  18. package/dist/meta/templates/lib/{config/meta.js → meta/config.js} +48 -39
  19. package/dist/meta/templates/lib/meta/favicon.png +0 -0
  20. package/dist/meta/templates/lib/meta/preview-landscape.png +0 -0
  21. package/dist/meta/templates/lib/meta/preview-square.png +0 -0
  22. package/dist/meta/templates/routes/(meta)/manifest.json/+server.js +1 -1
  23. package/dist/meta/templates/routes/(meta)/robots.txt/+server.js +1 -1
  24. package/dist/meta/templates/routes/(meta)/sitemap.xml/+server.js +1 -1
  25. package/dist/meta/typedef.d.ts +100 -1
  26. package/dist/meta/typedef.js +45 -5
  27. package/dist/meta/utils/sitemap/typedef.d.ts +1 -1
  28. package/dist/meta.d.ts +8 -0
  29. package/dist/{meta/templates/lib/meta.js → meta.js} +3 -3
  30. package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +1 -1
  31. package/dist/ui/primitives/inputs/text-input/TextInput.svelte.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/dist/meta/config.typedef.d.ts +0 -98
  34. package/dist/meta/config.typedef.js +0 -44
  35. package/dist/meta/templates/lib/meta.d.ts +0 -7
  36. /package/dist/{meta/templates/lib/assets → assets}/meta/favicon.png +0 -0
  37. /package/dist/{meta/templates/lib/assets → assets}/meta/preview-landscape.png +0 -0
  38. /package/dist/{meta/templates/lib/assets → assets}/meta/preview-square.png +0 -0
@@ -1,3 +1,102 @@
1
- export * from "./config.typedef.js";
2
1
  export * from "./utils/robots/typedef.js";
3
2
  export * from "./utils/sitemap/typedef.js";
3
+ /**
4
+ * App identity
5
+ */
6
+ export type MetaConfig = {
7
+ /**
8
+ * - Full app name
9
+ */
10
+ name: string;
11
+ /**
12
+ * - Short app name (max 12 characters)
13
+ */
14
+ shortName: string;
15
+ /**
16
+ * - App description for search engines
17
+ *
18
+ * Language and locale
19
+ */
20
+ description: string;
21
+ /**
22
+ * Language configurations
23
+ */
24
+ languages: Record<string, {
25
+ lang: string;
26
+ locale: string;
27
+ }>;
28
+ /**
29
+ * - Default language code
30
+ */
31
+ defaultLanguage: string;
32
+ /**
33
+ * - Default locale
34
+ *
35
+ * PWA theme and colors
36
+ */
37
+ defaultLocale: string;
38
+ /**
39
+ * - Theme color
40
+ */
41
+ backgroundAndThemeColor: string;
42
+ /**
43
+ * - Theme color for browser UI
44
+ */
45
+ themeColor: string;
46
+ /**
47
+ * - Background color
48
+ */
49
+ backgroundColor: string;
50
+ /**
51
+ * - iOS status bar style
52
+ */
53
+ statusBarStyle: string;
54
+ /**
55
+ * - Screen orientation
56
+ */
57
+ orientation: string;
58
+ /**
59
+ * - Disable pinch-to-zoom
60
+ *
61
+ * SEO images
62
+ */
63
+ disablePageZoom: boolean;
64
+ /**
65
+ * Landscape SEO image URL (1200×630)
66
+ */
67
+ previewImageLandscape?: import("../config/typedef.js").ImageSource | undefined;
68
+ /**
69
+ * Square SEO image URL (1200×1200)
70
+ */
71
+ previewImageSquare?: import("../config/typedef.js").ImageSource | undefined;
72
+ /**
73
+ * - Alt text for social media image
74
+ *
75
+ * Favicon images (processed by imagetools)
76
+ */
77
+ previewImageAltText?: string | undefined;
78
+ /**
79
+ * Processed favicon images
80
+ */
81
+ faviconImages: Array<{
82
+ src: string;
83
+ width: number;
84
+ }>;
85
+ /**
86
+ * Processed apple-touch-icon images
87
+ *
88
+ * Site configuration
89
+ */
90
+ appleTouchIcons: Array<{
91
+ src: string;
92
+ width: number;
93
+ }>;
94
+ /**
95
+ * Routes for sitemap.xml
96
+ */
97
+ siteRoutes: import("./utils/sitemap/typedef.js").SitemapRoute[];
98
+ /**
99
+ * Robots.txt configuration
100
+ */
101
+ robotsConfig: import("./utils/robots/typedef.js").RobotsConfig;
102
+ };
@@ -1,14 +1,54 @@
1
1
  /**
2
2
  * Type definitions for meta utilities
3
- *
4
- * Re-exports all typedefs from utils subfolder for convenient importing
5
3
  */
6
4
 
7
- // Re-export config typedefs
8
- export * from './config.typedef.js';
9
-
10
5
  // Re-export robots typedefs
11
6
  export * from './utils/robots/typedef.js';
12
7
 
13
8
  // Re-export sitemap typedefs
14
9
  export * from './utils/sitemap/typedef.js';
10
+
11
+ /**
12
+ * @typedef {Object} MetaConfig
13
+ *
14
+ * App identity
15
+ * @property {string} name - Full app name
16
+ * @property {string} shortName - Short app name (max 12 characters)
17
+ * @property {string} description - App description for search engines
18
+ *
19
+ * Language and locale
20
+ * @property {Record<string, {lang: string, locale: string}>} languages
21
+ * Language configurations
22
+ * @property {string} defaultLanguage - Default language code
23
+ * @property {string} defaultLocale - Default locale
24
+ *
25
+ * PWA theme and colors
26
+ * @property {string} backgroundAndThemeColor - Theme color
27
+ * @property {string} themeColor - Theme color for browser UI
28
+ * @property {string} backgroundColor - Background color
29
+ * @property {string} statusBarStyle - iOS status bar style
30
+ * @property {string} orientation - Screen orientation
31
+ * @property {boolean} disablePageZoom - Disable pinch-to-zoom
32
+ *
33
+ * SEO images
34
+ * @property {import('../config/typedef.js').ImageSource} [previewImageLandscape]
35
+ * Landscape SEO image URL (1200×630)
36
+ *
37
+ * @property {import('../config/typedef.js').ImageSource} [previewImageSquare]
38
+ * Square SEO image URL (1200×1200)
39
+ *
40
+ * @property {string} [previewImageAltText] - Alt text for social media image
41
+ *
42
+ * Favicon images (processed by imagetools)
43
+ * @property {Array<{src: string, width: number}>} faviconImages
44
+ * Processed favicon images
45
+ * @property {Array<{src: string, width: number}>} appleTouchIcons
46
+ * Processed apple-touch-icon images
47
+ *
48
+ * Site configuration
49
+ * @property {import('./utils/sitemap/typedef.js').SitemapRoute[]} siteRoutes
50
+ * Routes for sitemap.xml
51
+ *
52
+ * @property {import('./utils/robots/typedef.js').RobotsConfig} robotsConfig
53
+ * Robots.txt configuration
54
+ */
@@ -12,7 +12,7 @@ export type SitemapRouteObject = {
12
12
  /**
13
13
  * - Change frequency
14
14
  */
15
- changefreq?: "hourly" | "daily" | "weekly" | "always" | "monthly" | "yearly" | "never" | undefined;
15
+ changefreq?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never" | undefined;
16
16
  };
17
17
  /**
18
18
  * Route can be a simple string path or an object with details
package/dist/meta.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { Favicons } from './meta/components.js';
2
+ import { PWA } from './meta/components.js';
3
+ import { SEO } from './meta/components.js';
4
+ export const getLangFromPath: Function;
5
+ export const injectLang: Function;
6
+ export const handleLang: Function;
7
+ import * as config from './meta/config.js';
8
+ export { Favicons, PWA, SEO, config };
@@ -6,9 +6,9 @@
6
6
  * @hkdigital/lib-core library.
7
7
  */
8
8
 
9
- import { Favicons, PWA, SEO } from '../../components.js';
10
- import { createLangUtils } from '../../utils.js';
11
- import * as config from '../../../config/meta.js';
9
+ import { Favicons, PWA, SEO } from './meta/components.js';
10
+ import { createLangUtils } from './meta/utils.js';
11
+ import * as config from './meta/config.js';
12
12
 
13
13
  // Create configured language utilities
14
14
  const { getLangFromPath, injectLang, handleLang } = createLangUtils(config);
@@ -12,7 +12,7 @@ type Button = {
12
12
  size?: "sm" | "md" | "lg" | undefined;
13
13
  variant?: string | undefined;
14
14
  mode?: "light" | "dark" | undefined;
15
- buttonType?: "reset" | "submit" | "button" | undefined;
15
+ buttonType?: "button" | "reset" | "submit" | undefined;
16
16
  active?: boolean | undefined;
17
17
  selected?: boolean | undefined;
18
18
  loading?: boolean | undefined;
@@ -12,7 +12,7 @@ type TextInput = {
12
12
  iconClasses?: string | undefined;
13
13
  initialValue?: string | undefined;
14
14
  value?: string | undefined;
15
- type?: "number" | "email" | "url" | "text" | undefined;
15
+ type?: "number" | "url" | "email" | "text" | undefined;
16
16
  pattern?: string | undefined;
17
17
  required?: boolean | undefined;
18
18
  title?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.95",
3
+ "version": "0.5.97",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -1,98 +0,0 @@
1
- declare const _default: {};
2
- export default _default;
3
- /**
4
- * App identity
5
- */
6
- export type MetaConfig = {
7
- /**
8
- * - Full app name
9
- */
10
- name: string;
11
- /**
12
- * - Short app name (max 12 characters)
13
- */
14
- shortName: string;
15
- /**
16
- * - App description for search engines
17
- *
18
- * Language and locale
19
- */
20
- description: string;
21
- /**
22
- * Language configurations
23
- */
24
- languages: Record<string, {
25
- lang: string;
26
- locale: string;
27
- }>;
28
- /**
29
- * - Default language code
30
- */
31
- defaultLanguage: string;
32
- /**
33
- * - Default locale
34
- *
35
- * PWA theme and colors
36
- */
37
- defaultLocale: string;
38
- /**
39
- * - Theme color
40
- */
41
- backgroundAndThemeColor: string;
42
- /**
43
- * - Theme color for browser UI
44
- */
45
- themeColor: string;
46
- /**
47
- * - Background color
48
- */
49
- backgroundColor: string;
50
- /**
51
- * - iOS status bar style
52
- */
53
- statusBarStyle: string;
54
- /**
55
- * - Screen orientation
56
- */
57
- orientation: string;
58
- /**
59
- * - Disable pinch-to-zoom
60
- *
61
- * SEO images
62
- */
63
- disablePageZoom: boolean;
64
- /**
65
- * - Landscape SEO image URL (1200×630)
66
- */
67
- SeoImageLandscape?: string | undefined;
68
- /**
69
- * - Square SEO image URL (1200×1200)
70
- *
71
- * Favicon images (processed by imagetools)
72
- */
73
- SeoImageSquare?: string | undefined;
74
- /**
75
- * Processed favicon images
76
- */
77
- faviconImages: Array<{
78
- src: string;
79
- width: number;
80
- }>;
81
- /**
82
- * Processed apple-touch-icon images
83
- *
84
- * Site configuration
85
- */
86
- appleTouchIcons: Array<{
87
- src: string;
88
- width: number;
89
- }>;
90
- /**
91
- * Routes for sitemap.xml
92
- */
93
- siteRoutes: import("./utils/sitemap/typedef.js").SitemapRoute[];
94
- /**
95
- * Robots.txt configuration
96
- */
97
- robotsConfig: import("./utils/robots/typedef.js").RobotsConfig;
98
- };
@@ -1,44 +0,0 @@
1
- /**
2
- * Meta configuration type definitions
3
- */
4
-
5
- /**
6
- * @typedef {Object} MetaConfig
7
- *
8
- * App identity
9
- * @property {string} name - Full app name
10
- * @property {string} shortName - Short app name (max 12 characters)
11
- * @property {string} description - App description for search engines
12
- *
13
- * Language and locale
14
- * @property {Record<string, {lang: string, locale: string}>} languages
15
- * Language configurations
16
- * @property {string} defaultLanguage - Default language code
17
- * @property {string} defaultLocale - Default locale
18
- *
19
- * PWA theme and colors
20
- * @property {string} backgroundAndThemeColor - Theme color
21
- * @property {string} themeColor - Theme color for browser UI
22
- * @property {string} backgroundColor - Background color
23
- * @property {string} statusBarStyle - iOS status bar style
24
- * @property {string} orientation - Screen orientation
25
- * @property {boolean} disablePageZoom - Disable pinch-to-zoom
26
- *
27
- * SEO images
28
- * @property {string} [SeoImageLandscape] - Landscape SEO image URL (1200×630)
29
- * @property {string} [SeoImageSquare] - Square SEO image URL (1200×1200)
30
- *
31
- * Favicon images (processed by imagetools)
32
- * @property {Array<{src: string, width: number}>} faviconImages
33
- * Processed favicon images
34
- * @property {Array<{src: string, width: number}>} appleTouchIcons
35
- * Processed apple-touch-icon images
36
- *
37
- * Site configuration
38
- * @property {import('./utils/sitemap/typedef.js').SitemapRoute[]} siteRoutes
39
- * Routes for sitemap.xml
40
- * @property {import('./utils/robots/typedef.js').RobotsConfig} robotsConfig
41
- * Robots.txt configuration
42
- */
43
-
44
- export default {};
@@ -1,7 +0,0 @@
1
- import { Favicons } from '../../components.js';
2
- import { PWA } from '../../components.js';
3
- import { SEO } from '../../components.js';
4
- export const getLangFromPath: Function;
5
- export const injectLang: Function;
6
- export const handleLang: Function;
7
- export { Favicons, PWA, SEO, config };