storyloco 1.11.0 → 1.11.2

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": "storyloco",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "A collection of slick Storyblok field plugins built with Svelte 5, TypeScript, and Tailwind CSS",
5
5
  "keywords": [
6
6
  "storyblok",
@@ -17,10 +17,11 @@ const types = [
17
17
  'hidden',
18
18
  ] as const
19
19
 
20
- namespace Input {
20
+ namespace Field {
21
21
  export type Type = (typeof types)[number]
22
22
 
23
23
  export type Base = {
24
+ label: string
24
25
  name: string
25
26
  type: Type
26
27
  required: boolean
@@ -41,18 +42,37 @@ namespace Input {
41
42
 
42
43
  export type Select = Placeholderable & {
43
44
  type: 'select'
44
- options: Array<{ value: string; disabled: boolean; selected: boolean }>
45
+ options: Array<{
46
+ value: string
47
+ disabled: boolean
48
+ selected: boolean
49
+ label: string
50
+ _id: string
51
+ }>
45
52
  multiple: boolean
46
53
  }
47
54
 
48
55
  export type Checkbox = Omit<Base, 'required' | 'disabled'> & {
49
56
  type: 'checkbox'
50
- options: Array<{ value: string; required: boolean; disabled: boolean; checked: boolean }>
57
+ options: Array<{
58
+ value: string
59
+ required: boolean
60
+ disabled: boolean
61
+ checked: boolean
62
+ label: string
63
+ _id: string
64
+ }>
51
65
  }
52
66
 
53
67
  export type Radio = Base & {
54
68
  type: 'radio'
55
- options: Array<{ value: string; disabled: boolean; checked: boolean }>
69
+ options: Array<{
70
+ value: string
71
+ disabled: boolean
72
+ checked: boolean
73
+ label: string
74
+ _id: string
75
+ }>
56
76
  }
57
77
 
58
78
  export type Text = Placeholderable & {
@@ -122,7 +142,7 @@ namespace Input {
122
142
  | Hidden
123
143
  }
124
144
 
125
- export const types_map = new Map<Input.Type, string>([
145
+ export const types_map = new Map<Field.Type, string>([
126
146
  ['text', 'Text'],
127
147
  ['email', 'Email'],
128
148
  ['number', 'Number'],
@@ -142,4 +162,4 @@ export const types_map = new Map<Input.Type, string>([
142
162
  ] as const)
143
163
 
144
164
  // convenient re-export to keep existing imports working
145
- export type Input = Input.Input
165
+ export type Input = Field.Input