@hkdigital/lib-core 0.5.72 → 0.5.74

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.
@@ -16,6 +16,7 @@
16
16
 
17
17
  // Create the state context at this level to ensure all children
18
18
  // have access to the same state instance
19
+ // svelte-ignore state_referenced_locally
19
20
  const dragState = createOrGetDragState(contextKey);
20
21
 
21
22
  /**
@@ -83,6 +83,7 @@
83
83
  ...attrs
84
84
  } = $props();
85
85
 
86
+ // svelte-ignore state_referenced_locally
86
87
  const dragState = createOrGetDragState(contextKey);
87
88
 
88
89
  const draggableId = dragState.newDraggableId();
@@ -84,6 +84,7 @@
84
84
  ...attrs
85
85
  } = $props();
86
86
 
87
+ // svelte-ignore state_referenced_locally
87
88
  const dragState = createOrGetDragState(contextKey);
88
89
  const dropZoneId = generateLocalId();
89
90
 
@@ -26,6 +26,7 @@
26
26
 
27
27
  let show = $state(false);
28
28
 
29
+ // svelte-ignore state_referenced_locally
29
30
  let controller = getLoadingController();
30
31
 
31
32
  async function progressListener(progress, id) {
@@ -54,6 +54,7 @@
54
54
  ...attrs
55
55
  } = $props();
56
56
 
57
+ // svelte-ignore state_referenced_locally
57
58
  createOrGetState(contextKey);
58
59
 
59
60
  //grid-cols-[repeat({cols},minmax(0,auto))]
@@ -33,6 +33,7 @@
33
33
  contextKey
34
34
  } = $props();
35
35
 
36
+ // svelte-ignore state_referenced_locally
36
37
  const selectorState = createOrGetState(contextKey);
37
38
  </script>
38
39
 
@@ -45,23 +45,24 @@
45
45
  icon = src?.[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
46
46
  });
47
47
 
48
- if (size !== '100%') {
49
- if (size.slice(-1) !== '%') {
48
+ let normalizedSize = $derived.by(() => {
49
+ if (size !== '100%' && size.slice(-1) !== '%') {
50
50
  try {
51
- size = parseInt(size, 10) + 'px';
51
+ return parseInt(size, 10) + 'px';
52
52
  } catch (error) {
53
- size = '100%';
53
+ return '100%';
54
54
  }
55
55
  }
56
- }
56
+ return size;
57
+ });
57
58
  </script>
58
59
 
59
60
  <svg
60
61
  data-hk-icon
61
62
  {...icon?.a}
62
63
  xmlns="http://www.w3.org/2000/svg"
63
- width={size}
64
- height={size}
64
+ width={normalizedSize}
65
+ height={normalizedSize}
65
66
  class="{base} {classes}"
66
67
  {...attrs}
67
68
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -78,7 +78,7 @@
78
78
  "./*": "./dist/*"
79
79
  },
80
80
  "dependencies": {
81
- "@tailwindcss/postcss": "^4.1.11",
81
+ "@tailwindcss/postcss": "^4.1.18",
82
82
  "postcss": "^8.5.6"
83
83
  },
84
84
  "peerDependencies": {
@@ -99,45 +99,45 @@
99
99
  "vite-imagetools": "^8.0.0"
100
100
  },
101
101
  "devDependencies": {
102
- "@eslint/js": "^9.37.0",
103
- "@playwright/test": "^1.56.0",
102
+ "@eslint/js": "^9.39.2",
103
+ "@playwright/test": "^1.57.0",
104
104
  "@skeletonlabs/skeleton": "3.1.7",
105
105
  "@skeletonlabs/skeleton-svelte": "1.3.1",
106
106
  "@steeze-ui/heroicons": "^2.4.2",
107
107
  "@sveltejs/adapter-auto": "^6.1.1",
108
- "@sveltejs/adapter-node": "^5.4.0",
109
- "@sveltejs/kit": "^2.47.0",
110
- "@sveltejs/package": "^2.5.4",
111
- "@sveltejs/vite-plugin-svelte": "^6.2.1",
108
+ "@sveltejs/adapter-node": "^5.5.0",
109
+ "@sveltejs/kit": "^2.49.4",
110
+ "@sveltejs/package": "^2.5.7",
111
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
112
112
  "@tailwindcss/typography": "^0.5.19",
113
- "@testing-library/svelte": "^5.2.8",
113
+ "@testing-library/svelte": "^5.3.1",
114
114
  "@testing-library/user-event": "^14.6.1",
115
115
  "@types/eslint": "^9.6.1",
116
- "@types/node": "^24.8.0",
117
- "autoprefixer": "^10.4.21",
118
- "eslint": "^9.37.0",
116
+ "@types/node": "^24.10.8",
117
+ "autoprefixer": "^10.4.23",
118
+ "eslint": "^9.39.2",
119
119
  "eslint-config-prettier": "^10.1.8",
120
120
  "eslint-plugin-import": "^2.32.0",
121
- "eslint-plugin-svelte": "^3.12.4",
122
- "fake-indexeddb": "^6.2.3",
123
- "globals": "^16.4.0",
121
+ "eslint-plugin-svelte": "^3.14.0",
122
+ "fake-indexeddb": "^6.2.5",
123
+ "globals": "^16.5.0",
124
124
  "jsdom": "^26.1.0",
125
- "jsonwebtoken": "^9.0.2",
125
+ "jsonwebtoken": "^9.0.3",
126
126
  "npm-check-updates": "^18.3.1",
127
127
  "npm-run-all": "^4.1.5",
128
- "pino": "^9.13.1",
129
- "pino-pretty": "^13.1.2",
130
- "prettier": "^3.6.2",
131
- "prettier-plugin-svelte": "^3.4.0",
128
+ "pino": "^9.14.0",
129
+ "pino-pretty": "^13.1.3",
130
+ "prettier": "^3.7.4",
131
+ "prettier-plugin-svelte": "^3.4.1",
132
132
  "prettier-plugin-tailwindcss": "^0.6.14",
133
- "publint": "^0.3.14",
133
+ "publint": "^0.3.16",
134
134
  "standardized-audio-context-mock": "^9.7.24",
135
- "svelte": "^5.40.1",
136
- "svelte-check": "^4.3.3",
135
+ "svelte": "^5.46.3",
136
+ "svelte-check": "^4.3.5",
137
137
  "svelte-preprocess": "^6.0.3",
138
- "tailwindcss": "^4.1.14",
138
+ "tailwindcss": "^4.1.18",
139
139
  "typescript": "^5.9.3",
140
- "vite": "^7.1.10",
140
+ "vite": "^7.3.1",
141
141
  "vite-imagetools": "^8.0.0",
142
142
  "vitest": "^3.2.4"
143
143
  }
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { readdir, readFile, stat } from 'node:fs/promises';
4
- import { join, relative, resolve, dirname } from 'node:path';
4
+ import { join, relative, resolve, dirname, isAbsolute } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
5
6
 
6
7
  const PROJECT_ROOT = process.cwd();
7
8
  const SRC_DIR = join(PROJECT_ROOT, 'src');
9
+ const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
10
+ const LIB_ROOT = dirname(SCRIPT_DIR);
8
11
 
9
12
  /**
10
13
  * Scopes to validate for barrel exports
@@ -55,6 +58,12 @@ function resolveAliasPath(aliasPath) {
55
58
  for (const [alias, target] of Object.entries(PROJECT_ALIASES)) {
56
59
  if (aliasPath === alias || aliasPath.startsWith(alias + '/')) {
57
60
  const pathAfterAlias = aliasPath.slice(alias.length);
61
+
62
+ // If target is already absolute, use it directly
63
+ if (isAbsolute(target)) {
64
+ return join(target, pathAfterAlias);
65
+ }
66
+
58
67
  return join(PROJECT_ROOT, target, pathAfterAlias);
59
68
  }
60
69
  }
@@ -889,7 +898,13 @@ async function validateFile(filePath) {
889
898
  * Main validation function
890
899
  */
891
900
  async function main() {
892
- console.log('Validating import paths...\n');
901
+ // Load package version from lib-core's package.json
902
+ const pkgJsonPath = join(LIB_ROOT, 'package.json');
903
+ const pkgJsonContent = await readFile(pkgJsonPath, 'utf-8');
904
+ const pkgJson = JSON.parse(pkgJsonContent);
905
+
906
+ console.log(`Using script from @hkdigital/lib-core v${pkgJson.version}`);
907
+ console.log(`Validating import paths...`);
893
908
 
894
909
  // Load project aliases from svelte.config.js
895
910
  PROJECT_ALIASES = await loadAliases();
@@ -917,7 +932,7 @@ async function main() {
917
932
  process.exit(1);
918
933
  }
919
934
 
920
- console.log(' All import paths are valid!');
935
+ console.log('\x1b[32m✔ All import paths are valid!\x1b[0m');
921
936
  }
922
937
 
923
938
  main().catch(error => {