@storybook-tiny/webcomponent 1.1.5 → 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.
@@ -7,7 +7,7 @@ const config = {
7
7
  rootDir: fileURLToPath(new URL('..', import.meta.url)),
8
8
  devDependencies: [
9
9
  '@storybook-tiny/webcomponent',
10
- 'mi-element',
10
+ 'mi-element@0.7.x',
11
11
  'vite',
12
12
  'split.js@^1'
13
13
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook-tiny/webcomponent",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
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.6.0",
37
+ "mi-element": "^0.7.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.33.0",
43
- "eslint": "^9.33.0",
44
- "globals": "^16.3.0",
45
- "vite": "^7.1.2"
42
+ "@eslint/js": "^9.39.2",
43
+ "eslint": "^9.39.2",
44
+ "globals": "^16.5.0",
45
+ "vite": "^7.3.0"
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, refsBySelector, esc as html, refsById } from 'mi-element'
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 shadowRootOptions = null
27
+ static shadowRootInit = null
28
28
 
29
- static get attributes() {
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(this.renderRoot, {
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 shadowRootOptions = null
155
+ static shadowRootInit = null
156
156
 
157
- static get attributes() {
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 shadowRootOptions = null
185
+ static shadowRootInit = null
186
186
 
187
- static get attributes() {
188
- return { message: '', stack: '' }
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 = refsById(this.renderRoot)
204
+ this.refs = this.refsBySelector({
205
+ message: '#message',
206
+ stack: '#stack'
207
+ })
202
208
  }
203
209
 
204
210
  update() {
@@ -3,7 +3,7 @@ import {
3
3
  storyButton,
4
4
  storyCounter,
5
5
  storyError
6
- } from './some.stories'
6
+ } from './some.stories.js'
7
7
 
8
8
  const storybook = document.createElement('storybook-tiny')
9
9
  storybook.stories = [