storyloco 1.1.0 → 1.2.0
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/README.md +39 -0
- package/package.json +79 -73
- package/packages/vite/dist/components.schema.d.ts +160 -0
- package/packages/vite/dist/components.schema.js +6 -0
- package/packages/vite/dist/components.schema.json +797 -0
- package/packages/vite/dist/index.d.ts +1 -0
- package/packages/vite/dist/index.js +2 -0
- package/packages/vite/dist/schema.plugin.d.ts +40 -0
- package/packages/vite/dist/schema.plugin.js +136 -0
- package/packages/vite/dist/shell.d.ts +14 -0
- package/packages/vite/dist/shell.js +51 -0
- package/packages/vite/dist/x.d.ts +3 -0
- package/packages/vite/dist/x.js +12 -0
- package/packages/heading/README.md +0 -68
- package/packages/mux/README.md +0 -68
- package/packages/shared/README.md +0 -58
- package/packages/theme/README.md +0 -68
package/README.md
CHANGED
|
@@ -11,6 +11,10 @@ A collection of slick Storyblok field plugins built with Svelte 5, TypeScript, a
|
|
|
11
11
|
- **🎨 Theme** - Color theme selector with visual previews
|
|
12
12
|
- **🔗 Link** - Link editor with support for internal, external, email, and asset links
|
|
13
13
|
|
|
14
|
+
### Vite Plugins
|
|
15
|
+
|
|
16
|
+
- **📋 Storyblok Schema** - Automatically generate TypeScript types from your Storyblok components
|
|
17
|
+
|
|
14
18
|
### Shared Components
|
|
15
19
|
|
|
16
20
|
A comprehensive UI component library built with:
|
|
@@ -47,6 +51,41 @@ import { Input, Label, Switch, Skeleton, Select, Separator } from 'storyloco/sha
|
|
|
47
51
|
import { cn } from 'storyloco/shared/utils'
|
|
48
52
|
```
|
|
49
53
|
|
|
54
|
+
### Vite Plugins
|
|
55
|
+
|
|
56
|
+
#### Storyblok Schema Plugin
|
|
57
|
+
|
|
58
|
+
Automatically generate TypeScript types from your Storyblok components during development:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// vite.config.ts
|
|
62
|
+
import { storyblok_schema } from 'storyloco/vite'
|
|
63
|
+
|
|
64
|
+
export default defineConfig({
|
|
65
|
+
plugins: [
|
|
66
|
+
storyblok_schema({
|
|
67
|
+
output_path: 'src/lib/storyblok',
|
|
68
|
+
interval_ms: 60000 // regenerate every minute
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Options:**
|
|
75
|
+
|
|
76
|
+
- `storyblok_personal_access_token` - Your Storyblok personal access token (defaults to `STORYBLOK_PERSONAL_ACCESS_TOKEN` env var)
|
|
77
|
+
- `storyblok_space_id` - Your Storyblok space ID (defaults to `STORYBLOK_SPACE_ID` env var)
|
|
78
|
+
- `output_path` - Where to output generated files (defaults to `src/lib`)
|
|
79
|
+
- `interval_ms` - How often to regenerate types (defaults to 60000ms)
|
|
80
|
+
|
|
81
|
+
The plugin will:
|
|
82
|
+
|
|
83
|
+
- Pull your component schema from Storyblok
|
|
84
|
+
- Generate TypeScript definitions
|
|
85
|
+
- Format the output with Prettier
|
|
86
|
+
- Lock the generated file to prevent manual edits
|
|
87
|
+
- Regenerate automatically when components change
|
|
88
|
+
|
|
50
89
|
## 🔧 Development
|
|
51
90
|
|
|
52
91
|
### Prerequisites
|
package/package.json
CHANGED
|
@@ -1,75 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
"name": "storyloco",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "A collection of slick Storyblok field plugins built with Svelte 5, TypeScript, and Tailwind CSS",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"storyblok",
|
|
7
|
+
"field-plugin",
|
|
8
|
+
"svelte",
|
|
9
|
+
"typescript",
|
|
10
|
+
"tailwind",
|
|
11
|
+
"cms",
|
|
12
|
+
"headless"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/darbymanning/storyloco.git"
|
|
18
|
+
},
|
|
19
|
+
"main": "./src/index.ts",
|
|
20
|
+
"types": "./src/index.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"packages/mux/src/app.svelte",
|
|
24
|
+
"packages/mux/types.ts",
|
|
25
|
+
"packages/heading/src/app.svelte",
|
|
26
|
+
"packages/heading/types.ts",
|
|
27
|
+
"packages/theme/src/app.svelte",
|
|
28
|
+
"packages/shared/dist",
|
|
29
|
+
"packages/vite/dist"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./src/index.ts",
|
|
34
|
+
"import": "./src/index.ts"
|
|
35
|
+
},
|
|
36
|
+
"./mux": {
|
|
37
|
+
"types": "./packages/mux/types.ts",
|
|
38
|
+
"import": "./packages/mux/src/app.svelte"
|
|
39
|
+
},
|
|
40
|
+
"./heading": {
|
|
41
|
+
"types": "./packages/heading/types.ts",
|
|
42
|
+
"import": "./packages/heading/src/app.svelte"
|
|
43
|
+
},
|
|
44
|
+
"./shared": {
|
|
45
|
+
"types": "./packages/shared/dist/index.d.ts",
|
|
46
|
+
"svelte": "./packages/shared/dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./shared/utils": {
|
|
49
|
+
"types": "./packages/shared/dist/utils.d.ts",
|
|
50
|
+
"svelte": "./packages/shared/dist/utils.js"
|
|
51
|
+
},
|
|
52
|
+
"./vite": {
|
|
53
|
+
"types": "./packages/vite/dist/index.d.ts",
|
|
54
|
+
"import": "./packages/vite/dist/index.js"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "24.0.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "8.34.0",
|
|
60
|
+
"@typescript-eslint/parser": "8.34.0",
|
|
61
|
+
"eslint": "9.28.0",
|
|
62
|
+
"eslint-plugin-prettier": "5.4.1",
|
|
63
|
+
"kitto": "1.0.0-rc.12",
|
|
64
|
+
"prettier": "3.5.3",
|
|
65
|
+
"typescript": "5.8.3",
|
|
66
|
+
"vite": "6.3.5"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"add-plugin": "npx @storyblok/field-plugin-cli@latest add --dir \"./packages\" --structure monorepo",
|
|
70
|
+
"build": "cd packages/vite && npm run build && cd ../../packages/shared && npm run build",
|
|
71
|
+
"lint": "eslint --ext .js .",
|
|
72
|
+
"format": "prettier . --write"
|
|
73
|
+
},
|
|
74
|
+
"type": "module",
|
|
75
|
+
"workspaces": [
|
|
76
|
+
"packages/*"
|
|
77
|
+
],
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"color": "5.0.0"
|
|
80
|
+
}
|
|
75
81
|
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE. DO NOT EDIT.
|
|
3
|
+
* Generated by the generate script on 2025-06-23T18:21:25.609Z.
|
|
4
|
+
* Any changes will be overwritten.
|
|
5
|
+
*/
|
|
6
|
+
import type { SbBlokData } from "@storyblok/svelte";
|
|
7
|
+
export type Blok<T> = SbBlokData & T;
|
|
8
|
+
export type { StoryblokStory } from "storyblok-generate-ts";
|
|
9
|
+
export interface ActionsStoryblok {
|
|
10
|
+
title?: string;
|
|
11
|
+
items?: LinkStoryblok[];
|
|
12
|
+
anchor?: string;
|
|
13
|
+
_uid: string;
|
|
14
|
+
component: "actions";
|
|
15
|
+
}
|
|
16
|
+
export interface AssetStoryblok {
|
|
17
|
+
_uid?: string;
|
|
18
|
+
id: number | null;
|
|
19
|
+
alt: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
focus: string | null;
|
|
22
|
+
source: string | null;
|
|
23
|
+
title: string | null;
|
|
24
|
+
filename: string;
|
|
25
|
+
copyright: string | null;
|
|
26
|
+
fieldtype?: string;
|
|
27
|
+
meta_data?: null | {};
|
|
28
|
+
is_external_url?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface CardStoryblok {
|
|
31
|
+
image?: AssetStoryblok;
|
|
32
|
+
title?: string;
|
|
33
|
+
subtitle?: string;
|
|
34
|
+
_uid: string;
|
|
35
|
+
component: "card";
|
|
36
|
+
}
|
|
37
|
+
export interface CardsStoryblok {
|
|
38
|
+
title?: string;
|
|
39
|
+
subtitle?: string;
|
|
40
|
+
items?: CardStoryblok[];
|
|
41
|
+
anchor?: string;
|
|
42
|
+
_uid: string;
|
|
43
|
+
component: "cards";
|
|
44
|
+
}
|
|
45
|
+
export interface RichtextStoryblok {
|
|
46
|
+
type: string;
|
|
47
|
+
content?: RichtextStoryblok[];
|
|
48
|
+
marks?: RichtextStoryblok[];
|
|
49
|
+
attrs?: unknown;
|
|
50
|
+
text?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface HeroStoryblok {
|
|
53
|
+
anchor?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
subtitle?: string;
|
|
56
|
+
body?: RichtextStoryblok;
|
|
57
|
+
title_tag?: "" | "h1" | "h2" | "h3";
|
|
58
|
+
subtitle_tag?: number | string;
|
|
59
|
+
_uid: string;
|
|
60
|
+
component: "hero";
|
|
61
|
+
}
|
|
62
|
+
export type MultiassetStoryblok = {
|
|
63
|
+
alt?: string;
|
|
64
|
+
copyright?: string;
|
|
65
|
+
id: number;
|
|
66
|
+
filename: string;
|
|
67
|
+
name: string;
|
|
68
|
+
title?: string;
|
|
69
|
+
}[];
|
|
70
|
+
export interface LayoutStoryblok {
|
|
71
|
+
footer_title?: string;
|
|
72
|
+
footer_links?: LinkStoryblok[];
|
|
73
|
+
social_links?: SocialMediaStoryblok[];
|
|
74
|
+
contact_email?: string;
|
|
75
|
+
contact_tel?: string;
|
|
76
|
+
address?: string;
|
|
77
|
+
partners?: MultiassetStoryblok;
|
|
78
|
+
header_links?: LinkStoryblok[];
|
|
79
|
+
_uid: string;
|
|
80
|
+
component: "layout";
|
|
81
|
+
}
|
|
82
|
+
export interface LinkStoryblok {
|
|
83
|
+
_uid: string;
|
|
84
|
+
component: "link";
|
|
85
|
+
}
|
|
86
|
+
export interface NewsStoryblok {
|
|
87
|
+
anchor?: string;
|
|
88
|
+
_uid: string;
|
|
89
|
+
component: "news";
|
|
90
|
+
}
|
|
91
|
+
export interface PageStoryblok {
|
|
92
|
+
blocks?: unknown[];
|
|
93
|
+
_uid: string;
|
|
94
|
+
component: "page";
|
|
95
|
+
uuid?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface QuoteStoryblok {
|
|
98
|
+
suptitle?: string;
|
|
99
|
+
title?: string;
|
|
100
|
+
subtitle?: string;
|
|
101
|
+
image?: AssetStoryblok;
|
|
102
|
+
_uid: string;
|
|
103
|
+
component: "quote";
|
|
104
|
+
}
|
|
105
|
+
export interface QuotesStoryblok {
|
|
106
|
+
items?: QuoteStoryblok[];
|
|
107
|
+
_uid: string;
|
|
108
|
+
component: "quotes";
|
|
109
|
+
}
|
|
110
|
+
export interface SocialMediaStoryblok {
|
|
111
|
+
platform: "" | "facebook" | "instagram" | "linkedin" | "whatsapp";
|
|
112
|
+
link: string;
|
|
113
|
+
_uid: string;
|
|
114
|
+
component: "social_media";
|
|
115
|
+
}
|
|
116
|
+
export type MultilinkStoryblok = {
|
|
117
|
+
id?: string;
|
|
118
|
+
cached_url?: string;
|
|
119
|
+
anchor?: string;
|
|
120
|
+
linktype?: "story";
|
|
121
|
+
target?: "_self" | "_blank";
|
|
122
|
+
} | {
|
|
123
|
+
url?: string;
|
|
124
|
+
cached_url?: string;
|
|
125
|
+
anchor?: string;
|
|
126
|
+
linktype?: "asset" | "url";
|
|
127
|
+
target?: "_self" | "_blank";
|
|
128
|
+
} | {
|
|
129
|
+
email?: string;
|
|
130
|
+
linktype?: "email";
|
|
131
|
+
target?: "_self" | "_blank";
|
|
132
|
+
};
|
|
133
|
+
export interface TabStoryblok {
|
|
134
|
+
image?: AssetStoryblok;
|
|
135
|
+
title?: string;
|
|
136
|
+
subtitle?: string;
|
|
137
|
+
body?: RichtextStoryblok;
|
|
138
|
+
cta?: string;
|
|
139
|
+
link?: Exclude<MultilinkStoryblok, {
|
|
140
|
+
linktype?: "email";
|
|
141
|
+
} | {
|
|
142
|
+
linktype?: "asset";
|
|
143
|
+
}>;
|
|
144
|
+
_uid: string;
|
|
145
|
+
component: "tab";
|
|
146
|
+
}
|
|
147
|
+
export interface TabsStoryblok {
|
|
148
|
+
items?: TabStoryblok[];
|
|
149
|
+
_uid: string;
|
|
150
|
+
component: "tabs";
|
|
151
|
+
}
|
|
152
|
+
export interface TextImageStoryblok {
|
|
153
|
+
anchor?: string;
|
|
154
|
+
image?: AssetStoryblok;
|
|
155
|
+
title?: string;
|
|
156
|
+
body?: RichtextStoryblok;
|
|
157
|
+
theme?: number | string;
|
|
158
|
+
_uid: string;
|
|
159
|
+
component: "text_image";
|
|
160
|
+
}
|