storyloco 1.0.0 → 1.0.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/README.md +9 -8
- package/package.json +5 -7
- package/packages/heading/src/app.svelte +1 -7
- package/packages/heading/types.ts +4 -0
- package/packages/mux/src/app.svelte +1 -14
- package/packages/mux/types.ts +16 -0
- package/src/index.ts +3 -2
package/README.md
CHANGED
|
@@ -90,12 +90,13 @@ storyloco/
|
|
|
90
90
|
|
|
91
91
|
2. **Export types** in your plugin:
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
Create a `types.ts` file in your plugin package:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
// packages/your-plugin/types.ts
|
|
97
|
+
export interface YourType {
|
|
98
|
+
// your interface here
|
|
99
|
+
}
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
3. **Add to root exports** in `package.json`:
|
|
@@ -104,7 +105,7 @@ storyloco/
|
|
|
104
105
|
{
|
|
105
106
|
"exports": {
|
|
106
107
|
"./your-plugin": {
|
|
107
|
-
"types": "./packages/your-plugin/
|
|
108
|
+
"types": "./packages/your-plugin/types.ts",
|
|
108
109
|
"import": "./packages/your-plugin/src/app.svelte"
|
|
109
110
|
}
|
|
110
111
|
}
|
|
@@ -113,7 +114,7 @@ storyloco/
|
|
|
113
114
|
|
|
114
115
|
4. **Re-export in `src/index.ts`**:
|
|
115
116
|
```typescript
|
|
116
|
-
export type { YourType } from '../packages/your-plugin/
|
|
117
|
+
export type { YourType } from '../packages/your-plugin/types'
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
## 🎨 Shared Components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storyloco",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.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",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"src",
|
|
23
23
|
"packages/mux/src/app.svelte",
|
|
24
|
+
"packages/mux/types.ts",
|
|
24
25
|
"packages/heading/src/app.svelte",
|
|
26
|
+
"packages/heading/types.ts",
|
|
25
27
|
"packages/theme/src/app.svelte",
|
|
26
28
|
"packages/shared/dist"
|
|
27
29
|
],
|
|
@@ -31,17 +33,13 @@
|
|
|
31
33
|
"import": "./src/index.ts"
|
|
32
34
|
},
|
|
33
35
|
"./mux": {
|
|
34
|
-
"types": "./packages/mux/
|
|
36
|
+
"types": "./packages/mux/types.ts",
|
|
35
37
|
"import": "./packages/mux/src/app.svelte"
|
|
36
38
|
},
|
|
37
39
|
"./heading": {
|
|
38
|
-
"types": "./packages/heading/
|
|
40
|
+
"types": "./packages/heading/types.ts",
|
|
39
41
|
"import": "./packages/heading/src/app.svelte"
|
|
40
42
|
},
|
|
41
|
-
"./theme": {
|
|
42
|
-
"types": "./packages/theme/src/app.svelte",
|
|
43
|
-
"import": "./packages/theme/src/app.svelte"
|
|
44
|
-
},
|
|
45
43
|
"./shared": {
|
|
46
44
|
"types": "./packages/shared/dist/index.d.ts",
|
|
47
45
|
"svelte": "./packages/shared/dist/index.js"
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
export interface Heading {
|
|
3
|
-
text: string
|
|
4
|
-
level: 1 | 2 | 3 | 4 | 5 | 6
|
|
5
|
-
}
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
1
|
<script lang="ts">
|
|
9
2
|
import { createFieldPlugin, type FieldPluginResponse } from '@storyblok/field-plugin'
|
|
10
3
|
import { onMount } from 'svelte'
|
|
11
4
|
import { Input } from 'shared'
|
|
5
|
+
import type { Heading } from '../types.js'
|
|
12
6
|
|
|
13
7
|
type Plugin = FieldPluginResponse<Heading | null>
|
|
14
8
|
|
|
@@ -18,20 +18,7 @@
|
|
|
18
18
|
import '@mux/mux-uploader'
|
|
19
19
|
import { cn } from 'shared/utils'
|
|
20
20
|
import { Input, Label, Skeleton, Switch } from 'shared'
|
|
21
|
-
|
|
22
|
-
export interface Video {
|
|
23
|
-
mux_video?: Mux.Video.Assets.Asset
|
|
24
|
-
playback_id?: string
|
|
25
|
-
m3u8_url?: string
|
|
26
|
-
title?: string
|
|
27
|
-
autoplay?: boolean
|
|
28
|
-
muted?: boolean
|
|
29
|
-
loop?: boolean
|
|
30
|
-
playsinline?: boolean
|
|
31
|
-
controls?: boolean
|
|
32
|
-
preload?: 'auto' | 'metadata' | 'none'
|
|
33
|
-
poster?: string
|
|
34
|
-
}
|
|
21
|
+
import type { Video } from '../types.js'
|
|
35
22
|
|
|
36
23
|
type MuxAsset = Mux.Video.Assets.Asset
|
|
37
24
|
type Plugin = FieldPluginResponse<Video | null>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type Mux from '@mux/mux-node'
|
|
2
|
+
|
|
3
|
+
export interface Video {
|
|
4
|
+
mux_video?: Mux.Video.Assets.Asset
|
|
5
|
+
playback_id?: string
|
|
6
|
+
m3u8_url?: string
|
|
7
|
+
title?: string
|
|
8
|
+
autoplay?: boolean
|
|
9
|
+
muted?: boolean
|
|
10
|
+
loop?: boolean
|
|
11
|
+
playsinline?: boolean
|
|
12
|
+
controls?: boolean
|
|
13
|
+
preload?: 'auto' | 'metadata' | 'none'
|
|
14
|
+
poster?: string
|
|
15
|
+
}
|
|
16
|
+
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type {
|
|
1
|
+
// Re-export types from all packages
|
|
2
|
+
export type { Video } from '../packages/mux/types'
|
|
3
|
+
export type { Heading } from '../packages/heading/types'
|
|
3
4
|
// Add more exports as you create more packages
|