storybook-addon-sdc 0.4.2 → 0.4.4

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 +43 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -298,6 +298,49 @@ export default {
298
298
  export const Basic = {}
299
299
  ```
300
300
 
301
+ ## Configuration Options
302
+
303
+ In addition to the standard configuration options, you can also specify customDefs and externalDefs to provide additional schema definitions. These options are optional and can be used to extend or override the default definitions.
304
+
305
+ #### `customDefs`
306
+
307
+ The `customDefs` option allows you to define custom schema definitions directly within your configuration. This can be a link to an external file, a link to a local file, or an object with custom definitions.
308
+
309
+ Example:
310
+
311
+ ```typescript
312
+ const options = {
313
+ sdcStorybookOptions: {
314
+ customDefs: {
315
+ 'json-schema-definitions://experience_builder.module/column-width': {
316
+ title: 'Column Width',
317
+ type: 'integer',
318
+ enum: [25, 33, 50],
319
+ },
320
+ },
321
+ },
322
+ }
323
+ ```
324
+
325
+ #### `externalDefs`
326
+
327
+ The `externalDefs` option allows you to specify an array of paths to external definition files. These paths can be URLs to CDN-hosted files or local file paths.
328
+
329
+ Example:
330
+
331
+ ```typescript
332
+ const options = {
333
+ sdcStorybookOptions: {
334
+ externalDefs: [
335
+ 'https://example.com/path/to/definitions.yml',
336
+ './local/path/to/definitions.yml',
337
+ ],
338
+ },
339
+ }
340
+ ```
341
+
342
+ When using externalDefs, the definitions will be fetched and registered automatically.
343
+
301
344
  ## Dependencies
302
345
 
303
346
  - [vite-plugin-twig-drupal](https://github.com/larowlan/vite-plugin-twig-drupal): Loads Twig with Drupal functions.
@@ -305,7 +348,6 @@ export const Basic = {}
305
348
 
306
349
  ## Known Issues
307
350
 
308
- - `$ref: json-schema-definitions://` for SDC from Experience Builder is unsupported.
309
351
  - The addon relies on [Experimental indexers](https://storybook.js.org/docs/api/main-config/main-config-indexers).
310
352
 
311
353
  ## UI Patterns
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-sdc",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Drupal Single Directory Components as stories",
5
5
  "keywords": [
6
6
  "SDC",