histoire 0.16.1 → 0.16.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.
|
@@ -125,7 +125,7 @@ export default {
|
|
|
125
125
|
}, ({ color}) => h('div', {
|
|
126
126
|
class: '__hst-shade',
|
|
127
127
|
style: {
|
|
128
|
-
backgroundColor: color,
|
|
128
|
+
backgroundColor: color.replace('<alpha-value>', 1),
|
|
129
129
|
},
|
|
130
130
|
})))),
|
|
131
131
|
onMountControls: (api) => mountApp(api, () => [
|
|
@@ -148,7 +148,7 @@ export default {
|
|
|
148
148
|
}, ({ color}) => h('div', {
|
|
149
149
|
class: '__hst-shade __hst-text',
|
|
150
150
|
style: {
|
|
151
|
-
color,
|
|
151
|
+
color: color.replace('<alpha-value>', 1),
|
|
152
152
|
},
|
|
153
153
|
}, 'Aa')))),
|
|
154
154
|
onMountControls: (api) => mountApp(api, () => [
|
|
@@ -171,7 +171,7 @@ export default {
|
|
|
171
171
|
}, ({ color}) => h('div', {
|
|
172
172
|
class: '__hst-shade __hst-border',
|
|
173
173
|
style: {
|
|
174
|
-
borderColor: color,
|
|
174
|
+
borderColor: color.replace('<alpha-value>', 1),
|
|
175
175
|
},
|
|
176
176
|
})))),
|
|
177
177
|
onMountControls: (api) => mountApp(api, () => [
|
package/dist/node/config.js
CHANGED
|
@@ -167,15 +167,15 @@ export const mergeBuildConfig = createDefu((obj, key, value) => {
|
|
|
167
167
|
export const mergeConfig = createDefu((obj, key, value) => {
|
|
168
168
|
if (obj[key] && key === 'vite') {
|
|
169
169
|
const initialValue = obj[key];
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
170
|
+
// Convert to functions
|
|
171
|
+
const initialFn = typeof initialValue === 'function' ? initialValue : async () => initialValue;
|
|
172
|
+
const valueFn = typeof value === 'function' ? value : async () => value;
|
|
173
|
+
obj[key] = async (...args) => {
|
|
174
|
+
// `mergeViteConfig` doesn't accept functions so we need to call them
|
|
175
|
+
const initialResult = await initialFn(...args);
|
|
176
|
+
const valueResult = await valueFn(...args);
|
|
177
|
+
return mergeViteConfig(initialResult, valueResult);
|
|
178
|
+
};
|
|
179
179
|
return true;
|
|
180
180
|
}
|
|
181
181
|
if (obj[key] && key === 'plugins') {
|
package/dist/node/tree.js
CHANGED
|
@@ -4,10 +4,8 @@ export function createPath(config, file) {
|
|
|
4
4
|
return file.title.split('/');
|
|
5
5
|
}
|
|
6
6
|
if (config.tree.file === 'path') {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
path.push(file.title);
|
|
10
|
-
return path;
|
|
7
|
+
const paths = file.path.split('/').slice(0, -1);
|
|
8
|
+
return [...paths, file.title];
|
|
11
9
|
}
|
|
12
10
|
return config.tree.file(file);
|
|
13
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "histoire",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "A fast story book powered by Vite",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"sirv": "^2.0.2",
|
|
66
66
|
"vite-node": "0.28.4",
|
|
67
67
|
"@histoire/app": "^0.16.1",
|
|
68
|
-
"@histoire/
|
|
68
|
+
"@histoire/shared": "^0.16.1",
|
|
69
69
|
"@histoire/vendors": "^0.16.0",
|
|
70
|
-
"@histoire/
|
|
70
|
+
"@histoire/controls": "^0.16.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0"
|
|
@@ -136,7 +136,7 @@ export default {
|
|
|
136
136
|
}, ({ color}) => h('div', {
|
|
137
137
|
class: '__hst-shade',
|
|
138
138
|
style: {
|
|
139
|
-
backgroundColor: color,
|
|
139
|
+
backgroundColor: color.replace('<alpha-value>', 1),
|
|
140
140
|
},
|
|
141
141
|
})))),
|
|
142
142
|
onMountControls: (api) => mountApp(api, () => [
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
159
159
|
}, ({ color}) => h('div', {
|
|
160
160
|
class: '__hst-shade __hst-text',
|
|
161
161
|
style: {
|
|
162
|
-
color,
|
|
162
|
+
color: color.replace('<alpha-value>', 1),
|
|
163
163
|
},
|
|
164
164
|
}, 'Aa')))),
|
|
165
165
|
onMountControls: (api) => mountApp(api, () => [
|
|
@@ -182,7 +182,7 @@ export default {
|
|
|
182
182
|
}, ({ color}) => h('div', {
|
|
183
183
|
class: '__hst-shade __hst-border',
|
|
184
184
|
style: {
|
|
185
|
-
borderColor: color,
|
|
185
|
+
borderColor: color.replace('<alpha-value>', 1),
|
|
186
186
|
},
|
|
187
187
|
})))),
|
|
188
188
|
onMountControls: (api) => mountApp(api, () => [
|
package/src/node/config.ts
CHANGED
|
@@ -184,14 +184,18 @@ export const mergeBuildConfig = createDefu((obj: any, key, value) => {
|
|
|
184
184
|
export const mergeConfig = createDefu((obj: any, key, value) => {
|
|
185
185
|
if (obj[key] && key === 'vite') {
|
|
186
186
|
const initialValue = obj[key]
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
|
|
188
|
+
// Convert to functions
|
|
189
|
+
const initialFn: (...args: any[]) => Promise<any> = typeof initialValue === 'function' ? initialValue : async () => initialValue
|
|
190
|
+
const valueFn: (...args: any[]) => Promise<any> = typeof value === 'function' ? value : async () => value
|
|
191
|
+
|
|
192
|
+
obj[key] = async (...args) => {
|
|
193
|
+
// `mergeViteConfig` doesn't accept functions so we need to call them
|
|
194
|
+
const initialResult = await initialFn(...args)
|
|
195
|
+
const valueResult = await valueFn(...args)
|
|
196
|
+
return mergeViteConfig(initialResult, valueResult)
|
|
194
197
|
}
|
|
198
|
+
|
|
195
199
|
return true
|
|
196
200
|
}
|
|
197
201
|
|
package/src/node/tree.ts
CHANGED
|
@@ -13,10 +13,8 @@ export function createPath (config: HistoireConfig, file: ServerTreeFile) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
if (config.tree.file === 'path') {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
path.push(file.title)
|
|
19
|
-
return path
|
|
16
|
+
const paths = file.path.split('/').slice(0, -1)
|
|
17
|
+
return [...paths, file.title]
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
return config.tree.file(file)
|