@rokkit/core 1.0.0-next.70 → 1.0.0-next.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/core",
3
- "version": "1.0.0-next.70",
3
+ "version": "1.0.0-next.72",
4
4
  "description": "Core components, actions and stores for svelte apps.",
5
5
  "author": "Jerry Thomas <me@jerrythomas.name>",
6
6
  "license": "MIT",
@@ -20,10 +20,10 @@
20
20
  "jsdom": "^24.0.0",
21
21
  "svelte": "^4.2.9",
22
22
  "typescript": "^5.3.3",
23
- "validators": "latest",
24
23
  "vite": "^5.0.12",
25
24
  "vitest": "~1.2.2",
26
- "shared-config": "1.0.0-next.70"
25
+ "shared-config": "1.0.0-next.72",
26
+ "validators": "1.0.0-next.72"
27
27
  },
28
28
  "files": [
29
29
  "src/**/*.js",
package/src/constants.js CHANGED
@@ -10,6 +10,7 @@ export const defaultFields = {
10
10
  text: 'text',
11
11
  children: 'children',
12
12
  icon: 'icon',
13
+ iconPrefix: null,
13
14
  image: 'image',
14
15
  component: 'component',
15
16
  summary: 'summary',
package/src/mapping.js CHANGED
@@ -24,9 +24,11 @@ export function getComponent(value, fields, using) {
24
24
  export function getIcon(value, fields = defaultFields) {
25
25
  if (fields.icon === undefined || typeof (value ?? '') !== 'object') return null
26
26
  // console.log(fields.icon, fields.state, value[fields.icon][value[fields.state]])
27
- return typeof value[fields.icon] == 'object'
28
- ? value[fields.icon][value[fields.state]]
29
- : value[fields.icon]
27
+ const name =
28
+ typeof value[fields.icon] == 'object'
29
+ ? value[fields.icon][value[fields.state]]
30
+ : value[fields.icon]
31
+ return fields.iconPrefix ? [fields.iconPrefix, name].join('-') : name
30
32
  }
31
33
 
32
34
  /**