storybook-addon-sdc 0.1.13 → 0.1.15

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.
Files changed (2) hide show
  1. package/README.md +32 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,6 +13,7 @@ This addon streamlines the integration of Drupal Single Directory Components (SD
13
13
  - [Configuration](#configuration)
14
14
  - [Setting Default Values](#setting-default-values)
15
15
  - [Creating Experimental Stories](#creating-experimental-stories)
16
+ - [Regular Storybook](#regular-storybook)
16
17
  - [Known Issues](#known-issues)
17
18
  - [UI Patterns](#ui-patterns)
18
19
 
@@ -188,12 +189,41 @@ thirdPartySettings:
188
189
  label: test2
189
190
  ```
190
191
 
191
- Alternatively, you can import the YAML file in a `.stories.js` file within Storybook.
192
-
193
192
  ### Why stories experimental?
194
193
 
195
194
  The [community will have to decide](https://docs.google.com/document/d/1wCQLXrK1lrV2gYlqmqD2pybTql6_H1dByWIKB5xQFcQ/edit?tab=t.0#heading=h.3949vjfiqczr) what format the YAML stories should be.
196
195
 
196
+
197
+ ## Regular storybook
198
+ All storybook functions works as usual and you can import SDC YAML into `.stories.js`
199
+
200
+ [example](https://github.com/iberdinsky-skilld/sdc-addon/blob/main/stories/page-example.stories.js)
201
+
202
+ ```js
203
+ import header, {
204
+ preview as HeaderPreview,
205
+ } from '../components/header/header.component.yml'
206
+ import banner, {
207
+ preview as BannerPreview,
208
+ } from '../components/banner/banner.component.yml'
209
+
210
+ export default {
211
+ title: 'Regular Storybook Page',
212
+ render: () => {
213
+ return `
214
+ ${header.component({ ...HeaderPreview.args })}
215
+ ${banner.component({ ...BannerPreview.args })}
216
+ `
217
+ },
218
+ play: async ({ canvasElement }) => {
219
+ Drupal.attachBehaviors(canvasElement, window.drupalSettings)
220
+ },
221
+ }
222
+
223
+ export const Basic = {}
224
+ ```
225
+
226
+
197
227
  ## Known Issues
198
228
  - `$ref: json-schema-definitions://` for SDC from Experience Builder is unsupported.
199
229
  - The addon relies on [Experimental indexers](https://storybook.js.org/docs/api/main-config/main-config-indexers).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-sdc",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Drupal Single Directory Components as stories",
5
5
  "keywords": [
6
6
  "SDC",