@storybook-tiny/webcomponent 1.1.5 → 1.2.1
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/bin/storybook-tiny.js +1 -1
- package/package.json +6 -6
- package/src/Storybook.js +23 -17
- package/stories/stories.js +1 -1
package/bin/storybook-tiny.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook-tiny/webcomponent",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A tiny storybook for web-components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"vite.config.js"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"mi-element": "^0.
|
|
37
|
+
"mi-element": "^0.8.0",
|
|
38
38
|
"split.js": "^1.6.5",
|
|
39
39
|
"@storybook-tiny/setup": "1.0.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@eslint/js": "^9.
|
|
43
|
-
"eslint": "^9.
|
|
44
|
-
"globals": "^16.
|
|
45
|
-
"vite": "^7.1
|
|
42
|
+
"@eslint/js": "^9.39.2",
|
|
43
|
+
"eslint": "^9.39.2",
|
|
44
|
+
"globals": "^16.5.0",
|
|
45
|
+
"vite": "^7.3.1"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20.0.0"
|
package/src/Storybook.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styles from './Storybook.module.css'
|
|
2
2
|
import split from 'split.js'
|
|
3
|
-
import { MiElement, define,
|
|
3
|
+
import { MiElement, define, html } from 'mi-element'
|
|
4
4
|
|
|
5
5
|
const getLocationHash = () => decodeURIComponent(location.hash.substring(1))
|
|
6
6
|
|
|
@@ -24,18 +24,18 @@ const defaultStory = html`
|
|
|
24
24
|
class Storybook extends MiElement {
|
|
25
25
|
state = {}
|
|
26
26
|
|
|
27
|
-
static
|
|
27
|
+
static shadowRootInit = null
|
|
28
28
|
|
|
29
|
-
static get
|
|
29
|
+
static get properties() {
|
|
30
30
|
return {
|
|
31
|
-
header: 'Storybook Tiny',
|
|
32
|
-
href: '/stories/index.html',
|
|
33
|
-
width: 130,
|
|
34
|
-
stories: []
|
|
31
|
+
header: { initial: 'Storybook Tiny' },
|
|
32
|
+
href: { initial: '/stories/index.html' },
|
|
33
|
+
width: { initial: 130, type: Number },
|
|
34
|
+
stories: { initial: [], attribute: false }
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
static template = `
|
|
38
|
+
static template = html`
|
|
39
39
|
<style>
|
|
40
40
|
.${styles.storybook} > .gutter {
|
|
41
41
|
background-color: #eee;
|
|
@@ -76,7 +76,7 @@ class Storybook extends MiElement {
|
|
|
76
76
|
localStorage.setItem(STORE_ITEM, xperc)
|
|
77
77
|
}
|
|
78
78
|
})
|
|
79
|
-
this.refs = refsBySelector(
|
|
79
|
+
this.refs = this.refsBySelector({
|
|
80
80
|
aside: 'main > aside',
|
|
81
81
|
h4: 'main > aside h4 a',
|
|
82
82
|
nav: 'main > aside nav',
|
|
@@ -152,12 +152,12 @@ class Storybook extends MiElement {
|
|
|
152
152
|
define('storybook-tiny', Storybook)
|
|
153
153
|
|
|
154
154
|
class Story extends MiElement {
|
|
155
|
-
static
|
|
155
|
+
static shadowRootInit = null
|
|
156
156
|
|
|
157
|
-
static get
|
|
157
|
+
static get properties() {
|
|
158
158
|
return {
|
|
159
|
-
active: false,
|
|
160
|
-
story: ''
|
|
159
|
+
active: { initial: false, type: Boolean },
|
|
160
|
+
story: { initial: '' }
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -182,10 +182,13 @@ class Story extends MiElement {
|
|
|
182
182
|
define('storybook-tiny-story', Story)
|
|
183
183
|
|
|
184
184
|
class StoryError extends MiElement {
|
|
185
|
-
static
|
|
185
|
+
static shadowRootInit = null
|
|
186
186
|
|
|
187
|
-
static get
|
|
188
|
-
return {
|
|
187
|
+
static get properties() {
|
|
188
|
+
return {
|
|
189
|
+
message: { initial: '' },
|
|
190
|
+
stack: { initial: '' }
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
static template = `
|
|
@@ -198,7 +201,10 @@ class StoryError extends MiElement {
|
|
|
198
201
|
`
|
|
199
202
|
|
|
200
203
|
render() {
|
|
201
|
-
this.refs =
|
|
204
|
+
this.refs = this.refsBySelector({
|
|
205
|
+
message: '#message',
|
|
206
|
+
stack: '#stack'
|
|
207
|
+
})
|
|
202
208
|
}
|
|
203
209
|
|
|
204
210
|
update() {
|