@histoire/shared 0.10.6 → 0.11.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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/story.d.ts +1 -0
- package/dist/story.js +10 -0
- package/dist/types/config.d.ts +15 -2
- package/dist/types/story.d.ts +4 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/story.ts +10 -0
- package/src/types/config.ts +15 -2
- package/src/types/story.ts +2 -1
- package/tsconfig.json +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/story.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const omitInheritStoryProps: string[];
|
package/dist/story.js
ADDED
package/dist/types/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UserConfig as ViteConfig, ConfigEnv as ViteConfigEnv } from 'vite';
|
|
2
2
|
import type MarkdownIt from 'markdown-it';
|
|
3
|
-
import type { ServerTreeFile } from './story.js';
|
|
3
|
+
import type { ServerTreeFile, StoryProps } from './story.js';
|
|
4
4
|
import type { Plugin } from './plugin.js';
|
|
5
5
|
export interface SupportMatchPattern {
|
|
6
6
|
id: string;
|
|
@@ -114,7 +114,16 @@ export interface HistoireConfig {
|
|
|
114
114
|
*
|
|
115
115
|
* Example: `'/src/histoire-setup.ts'`
|
|
116
116
|
*/
|
|
117
|
-
setupFile?: string
|
|
117
|
+
setupFile?: string | {
|
|
118
|
+
/**
|
|
119
|
+
* Only loaded in the browser client.
|
|
120
|
+
*/
|
|
121
|
+
browser: string;
|
|
122
|
+
/**
|
|
123
|
+
* Only loaded while collecting stories in the node server.
|
|
124
|
+
*/
|
|
125
|
+
server: string;
|
|
126
|
+
};
|
|
118
127
|
/**
|
|
119
128
|
* Setup code created by plugins
|
|
120
129
|
*/
|
|
@@ -131,6 +140,10 @@ export interface HistoireConfig {
|
|
|
131
140
|
* Class added to the html root of the story preview when dark mode is enabled.
|
|
132
141
|
*/
|
|
133
142
|
sandboxDarkClass?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Default props for stories.
|
|
145
|
+
*/
|
|
146
|
+
defaultStoryProps?: Omit<StoryProps, 'id' | 'setupApp' | 'title' | 'source'>;
|
|
134
147
|
/**
|
|
135
148
|
* Customize the markdown-it renderer
|
|
136
149
|
*/
|
package/dist/types/story.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export interface StoryFile {
|
|
|
5
5
|
story: Story;
|
|
6
6
|
path: string[];
|
|
7
7
|
filePath: string;
|
|
8
|
+
source: () => Promise<{
|
|
9
|
+
default: string;
|
|
10
|
+
}>;
|
|
8
11
|
}
|
|
9
12
|
export declare type StoryLayout = {
|
|
10
13
|
type: 'single';
|
|
@@ -54,6 +57,7 @@ export interface Variant {
|
|
|
54
57
|
slots?: () => {
|
|
55
58
|
default: any;
|
|
56
59
|
controls: any;
|
|
60
|
+
source: any;
|
|
57
61
|
};
|
|
58
62
|
state: any;
|
|
59
63
|
source?: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/story.ts
ADDED
package/src/types/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
ConfigEnv as ViteConfigEnv,
|
|
4
4
|
} from 'vite'
|
|
5
5
|
import type MarkdownIt from 'markdown-it'
|
|
6
|
-
import type { ServerTreeFile } from './story.js'
|
|
6
|
+
import type { ServerTreeFile, StoryProps } from './story.js'
|
|
7
7
|
import type { Plugin } from './plugin.js'
|
|
8
8
|
|
|
9
9
|
export interface SupportMatchPattern {
|
|
@@ -123,7 +123,16 @@ export interface HistoireConfig {
|
|
|
123
123
|
*
|
|
124
124
|
* Example: `'/src/histoire-setup.ts'`
|
|
125
125
|
*/
|
|
126
|
-
setupFile?: string
|
|
126
|
+
setupFile?: string | {
|
|
127
|
+
/**
|
|
128
|
+
* Only loaded in the browser client.
|
|
129
|
+
*/
|
|
130
|
+
browser: string
|
|
131
|
+
/**
|
|
132
|
+
* Only loaded while collecting stories in the node server.
|
|
133
|
+
*/
|
|
134
|
+
server: string
|
|
135
|
+
}
|
|
127
136
|
/**
|
|
128
137
|
* Setup code created by plugins
|
|
129
138
|
*/
|
|
@@ -140,6 +149,10 @@ export interface HistoireConfig {
|
|
|
140
149
|
* Class added to the html root of the story preview when dark mode is enabled.
|
|
141
150
|
*/
|
|
142
151
|
sandboxDarkClass?: string
|
|
152
|
+
/**
|
|
153
|
+
* Default props for stories.
|
|
154
|
+
*/
|
|
155
|
+
defaultStoryProps?: Omit<StoryProps, 'id' | 'setupApp' | 'title' | 'source'>
|
|
143
156
|
/**
|
|
144
157
|
* Customize the markdown-it renderer
|
|
145
158
|
*/
|
package/src/types/story.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface StoryFile {
|
|
|
5
5
|
story: Story
|
|
6
6
|
path: string[]
|
|
7
7
|
filePath: string
|
|
8
|
+
source: () => Promise<{ default: string }>
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export type StoryLayout = {
|
|
@@ -59,7 +60,7 @@ export interface Variant {
|
|
|
59
60
|
icon?: string
|
|
60
61
|
iconColor?: string
|
|
61
62
|
setupApp?: (payload: any) => unknown
|
|
62
|
-
slots?: () => { default: any, controls: any }
|
|
63
|
+
slots?: () => { default: any, controls: any, source: any }
|
|
63
64
|
state: any
|
|
64
65
|
source?: string
|
|
65
66
|
responsiveDisabled?: boolean
|