@stencil/storybook-plugin 0.4.1 → 0.4.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.
- package/dist/docs/index.d.cts +1 -1
- package/dist/docs/index.d.ts +1 -1
- package/dist/entry-preview-B91w5aFH.cjs.map +1 -1
- package/dist/entry-preview-DWaghsKM.js.map +1 -1
- package/dist/entry-preview-docs.cjs.map +1 -1
- package/dist/entry-preview-docs.d.cts +3 -14
- package/dist/entry-preview-docs.d.ts +3 -14
- package/dist/entry-preview-docs.js.map +1 -1
- package/dist/entry-preview.d.cts +2 -2
- package/dist/entry-preview.d.ts +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/preset.cjs +4 -6
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.d.cts +1 -1
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +4 -6
- package/dist/preset.js.map +1 -1
- package/dist/{types-Dzw-ZY4t.d.ts → types-BZP9npQ9.d.cts} +3 -3
- package/dist/{types-BjBqnnWi.d.cts → types-C-2oudGU.d.ts} +3 -3
- package/package.json +2 -2
package/dist/docs/index.d.cts
CHANGED
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-B91w5aFH.cjs","names":["render: ArgsStoryFn<StencilRenderer<unknown>>","children: any[]","parameters","canvasElement: StencilRenderer<unknown>['canvasElement']","parameters: Parameters","argTypesEnhancers: ArgTypesEnhancer[]","enhanceArgTypes"],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":["import { h, render as renderStencil, VNode } from '@stencil/core';\nimport { ArgsStoryFn, RenderContext } from 'storybook/internal/types';\nimport { simulatePageLoad } from 'storybook/preview-api';\n\nimport type { StencilRenderer } from './types';\n\nexport const render: ArgsStoryFn<StencilRenderer<unknown>> = (args, context) => {\n const { component, parameters } = context;\n\n if (Array.isArray(component)) {\n throw new Error('If your story does not contain a render function, you must provide a component property!');\n }\n if (typeof component === 'string' && !customElements.get(component)) {\n throw new Error(\n `Stencil component not found. If you are not lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a constructor value for component in your story \\`component: MyComponent\\``,\n );\n } else if (typeof component !== 'string' && !customElements.getName(component)) {\n throw new Error(\n `Stencil component not found. If you are lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a string value for component in your story \\`component: 'my-component'\\``,\n );\n }\n const cmpName = typeof component === 'string' ? component : customElements.getName(component);\n\n const children: any[] = Object.entries<VNode>(parameters.slots || []).map(([key, value]) => {\n // if the parameter key is 'default' don't give it a slot name so it renders just as a child\n const slot = key === 'default' ? undefined : key;\n // if the value it s a string, create a vnode with the string as the children\n const child =\n typeof value === 'string'\n ? h(undefined, { slot }, value)\n : {\n ...value,\n $attrs$: {\n ...value.$attrs$,\n slot,\n },\n };\n // if the value is a fragment and it is a named slot, create a span element with the slot name\n child.$tag$ = child.$tag$ || (slot ? 'span' : null);\n return child.$tag$ ? child : child.$children$;\n });\n\n const Component = `${cmpName}`;\n return h(Component, { ...args }, children);\n};\n\nexport function renderToCanvas(\n { storyFn, showMain, storyContext }: RenderContext<StencilRenderer<unknown>>,\n canvasElement: StencilRenderer<unknown>['canvasElement'],\n) {\n const vdom = storyFn();\n showMain();\n\n /**\n * If the component is not automatically registered after import, register it here\n */\n if (storyContext.component && storyContext.component.is && !customElements.get(storyContext.component.is)) {\n customElements.define(storyContext.component.is, storyContext.component);\n }\n\n if (canvasElement.firstChild) {\n canvasElement.removeChild(canvasElement.firstChild);\n }\n\n const element = document.createElement('div');\n canvasElement.appendChild(element);\n renderStencil(vdom, element);\n simulatePageLoad(element);\n}\n","import { enhanceArgTypes } from 'storybook/internal/docs-tools';\nimport type { ArgTypesEnhancer } from 'storybook/internal/types';\
|
|
1
|
+
{"version":3,"file":"entry-preview-B91w5aFH.cjs","names":["render: ArgsStoryFn<StencilRenderer<unknown>>","children: any[]","parameters","canvasElement: StencilRenderer<unknown>['canvasElement']","parameters: Parameters","argTypesEnhancers: ArgTypesEnhancer[]","enhanceArgTypes"],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":["import { h, render as renderStencil, VNode } from '@stencil/core';\nimport { ArgsStoryFn, RenderContext } from 'storybook/internal/types';\nimport { simulatePageLoad } from 'storybook/preview-api';\n\nimport type { StencilRenderer } from './types';\n\nexport const render: ArgsStoryFn<StencilRenderer<unknown>> = (args, context) => {\n const { component, parameters } = context;\n\n if (Array.isArray(component)) {\n throw new Error('If your story does not contain a render function, you must provide a component property!');\n }\n if (typeof component === 'string' && !customElements.get(component)) {\n throw new Error(\n `Stencil component not found. If you are not lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a constructor value for component in your story \\`component: MyComponent\\``,\n );\n } else if (typeof component !== 'string' && !customElements.getName(component)) {\n throw new Error(\n `Stencil component not found. If you are lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a string value for component in your story \\`component: 'my-component'\\``,\n );\n }\n const cmpName = typeof component === 'string' ? component : customElements.getName(component);\n\n const children: any[] = Object.entries<VNode>(parameters.slots || []).map(([key, value]) => {\n // if the parameter key is 'default' don't give it a slot name so it renders just as a child\n const slot = key === 'default' ? undefined : key;\n // if the value it s a string, create a vnode with the string as the children\n const child =\n typeof value === 'string'\n ? h(undefined, { slot }, value)\n : {\n ...value,\n $attrs$: {\n ...value.$attrs$,\n slot,\n },\n };\n // if the value is a fragment and it is a named slot, create a span element with the slot name\n child.$tag$ = child.$tag$ || (slot ? 'span' : null);\n return child.$tag$ ? child : child.$children$;\n });\n\n const Component = `${cmpName}`;\n return h(Component, { ...args }, children);\n};\n\nexport function renderToCanvas(\n { storyFn, showMain, storyContext }: RenderContext<StencilRenderer<unknown>>,\n canvasElement: StencilRenderer<unknown>['canvasElement'],\n) {\n const vdom = storyFn();\n showMain();\n\n /**\n * If the component is not automatically registered after import, register it here\n */\n if (storyContext.component && storyContext.component.is && !customElements.get(storyContext.component.is)) {\n customElements.define(storyContext.component.is, storyContext.component);\n }\n\n if (canvasElement.firstChild) {\n canvasElement.removeChild(canvasElement.firstChild);\n }\n\n const element = document.createElement('div');\n canvasElement.appendChild(element);\n renderStencil(vdom, element);\n simulatePageLoad(element);\n}\n","import { enhanceArgTypes } from 'storybook/internal/docs-tools';\nimport type { ArgTypesEnhancer, Parameters } from 'storybook/internal/types';\n\nexport const parameters: Parameters = { renderer: 'stencil' };\n\nexport { render, renderToCanvas } from './render';\n\nexport const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes];\n"],"mappings":";;;;;;AAMA,MAAaA,SAAgD,CAAC,MAAM,YAAY;CAC9E,MAAM,EAAE,WAAW,0BAAY,GAAG;AAElC,KAAI,MAAM,QAAQ,UAAU,CAC1B,OAAM,IAAI,MAAM;AAElB,YAAW,cAAc,aAAa,eAAe,IAAI,UAAU,CACjE,OAAM,IAAI,OACP;iBAEa,cAAc,aAAa,eAAe,QAAQ,UAAU,CAC5E,OAAM,IAAI,OACP;CAGL,MAAM,iBAAiB,cAAc,WAAW,YAAY,eAAe,QAAQ,UAAU;CAE7F,MAAMC,WAAkB,OAAO,QAAeC,aAAW,SAAS,CAAE,EAAC,CAAC,IAAI,CAAC,CAAC,KAAK,MAAM,KAAK;EAE1F,MAAM,OAAO,QAAQ,qBAAwB;EAE7C,MAAM,eACG,UAAU,WACb,8BAAa,EAAE,KAAM,GAAE,MAAM,GAC7B;GACE,GAAG;GACH,SAAS;IACP,GAAG,MAAM;IACT;GACD;EACF;AAEP,QAAM,QAAQ,MAAM,UAAU,OAAO,SAAS;AAC9C,SAAO,MAAM,QAAQ,QAAQ,MAAM;CACpC,EAAC;CAEF,MAAM,aAAa,EAAE,QAAQ;AAC7B,QAAO,sBAAE,WAAW,EAAE,GAAG,KAAM,GAAE,SAAS;AAC3C;AAED,SAAgB,eACd,EAAE,SAAS,UAAU,cAAuD,EAC5EC,eACA;CACA,MAAM,OAAO,SAAS;AACtB,WAAU;;;;AAKV,KAAI,aAAa,aAAa,aAAa,UAAU,OAAO,eAAe,IAAI,aAAa,UAAU,GAAG,CACvG,gBAAe,OAAO,aAAa,UAAU,IAAI,aAAa,UAAU;AAG1E,KAAI,cAAc,WAChB,eAAc,YAAY,cAAc,WAAW;CAGrD,MAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,eAAc,YAAY,QAAQ;AAClC,4BAAc,MAAM,QAAQ;AAC5B,6CAAiB,QAAQ;AAC1B;;;;;;;;;;;ACjED,MAAaC,aAAyB,EAAE,UAAU,UAAW;AAI7D,MAAaC,oBAAwC,CAACC,6CAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-DWaghsKM.js","names":["render: ArgsStoryFn<StencilRenderer<unknown>>","children: any[]","parameters","canvasElement: StencilRenderer<unknown>['canvasElement']","parameters: Parameters","argTypesEnhancers: ArgTypesEnhancer[]"],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":["import { h, render as renderStencil, VNode } from '@stencil/core';\nimport { ArgsStoryFn, RenderContext } from 'storybook/internal/types';\nimport { simulatePageLoad } from 'storybook/preview-api';\n\nimport type { StencilRenderer } from './types';\n\nexport const render: ArgsStoryFn<StencilRenderer<unknown>> = (args, context) => {\n const { component, parameters } = context;\n\n if (Array.isArray(component)) {\n throw new Error('If your story does not contain a render function, you must provide a component property!');\n }\n if (typeof component === 'string' && !customElements.get(component)) {\n throw new Error(\n `Stencil component not found. If you are not lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a constructor value for component in your story \\`component: MyComponent\\``,\n );\n } else if (typeof component !== 'string' && !customElements.getName(component)) {\n throw new Error(\n `Stencil component not found. If you are lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a string value for component in your story \\`component: 'my-component'\\``,\n );\n }\n const cmpName = typeof component === 'string' ? component : customElements.getName(component);\n\n const children: any[] = Object.entries<VNode>(parameters.slots || []).map(([key, value]) => {\n // if the parameter key is 'default' don't give it a slot name so it renders just as a child\n const slot = key === 'default' ? undefined : key;\n // if the value it s a string, create a vnode with the string as the children\n const child =\n typeof value === 'string'\n ? h(undefined, { slot }, value)\n : {\n ...value,\n $attrs$: {\n ...value.$attrs$,\n slot,\n },\n };\n // if the value is a fragment and it is a named slot, create a span element with the slot name\n child.$tag$ = child.$tag$ || (slot ? 'span' : null);\n return child.$tag$ ? child : child.$children$;\n });\n\n const Component = `${cmpName}`;\n return h(Component, { ...args }, children);\n};\n\nexport function renderToCanvas(\n { storyFn, showMain, storyContext }: RenderContext<StencilRenderer<unknown>>,\n canvasElement: StencilRenderer<unknown>['canvasElement'],\n) {\n const vdom = storyFn();\n showMain();\n\n /**\n * If the component is not automatically registered after import, register it here\n */\n if (storyContext.component && storyContext.component.is && !customElements.get(storyContext.component.is)) {\n customElements.define(storyContext.component.is, storyContext.component);\n }\n\n if (canvasElement.firstChild) {\n canvasElement.removeChild(canvasElement.firstChild);\n }\n\n const element = document.createElement('div');\n canvasElement.appendChild(element);\n renderStencil(vdom, element);\n simulatePageLoad(element);\n}\n","import { enhanceArgTypes } from 'storybook/internal/docs-tools';\nimport type { ArgTypesEnhancer } from 'storybook/internal/types';\
|
|
1
|
+
{"version":3,"file":"entry-preview-DWaghsKM.js","names":["render: ArgsStoryFn<StencilRenderer<unknown>>","children: any[]","parameters","canvasElement: StencilRenderer<unknown>['canvasElement']","parameters: Parameters","argTypesEnhancers: ArgTypesEnhancer[]"],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":["import { h, render as renderStencil, VNode } from '@stencil/core';\nimport { ArgsStoryFn, RenderContext } from 'storybook/internal/types';\nimport { simulatePageLoad } from 'storybook/preview-api';\n\nimport type { StencilRenderer } from './types';\n\nexport const render: ArgsStoryFn<StencilRenderer<unknown>> = (args, context) => {\n const { component, parameters } = context;\n\n if (Array.isArray(component)) {\n throw new Error('If your story does not contain a render function, you must provide a component property!');\n }\n if (typeof component === 'string' && !customElements.get(component)) {\n throw new Error(\n `Stencil component not found. If you are not lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a constructor value for component in your story \\`component: MyComponent\\``,\n );\n } else if (typeof component !== 'string' && !customElements.getName(component)) {\n throw new Error(\n `Stencil component not found. If you are lazy loading your components with \\`defineCustomElements()\\` in preview.ts, pass a string value for component in your story \\`component: 'my-component'\\``,\n );\n }\n const cmpName = typeof component === 'string' ? component : customElements.getName(component);\n\n const children: any[] = Object.entries<VNode>(parameters.slots || []).map(([key, value]) => {\n // if the parameter key is 'default' don't give it a slot name so it renders just as a child\n const slot = key === 'default' ? undefined : key;\n // if the value it s a string, create a vnode with the string as the children\n const child =\n typeof value === 'string'\n ? h(undefined, { slot }, value)\n : {\n ...value,\n $attrs$: {\n ...value.$attrs$,\n slot,\n },\n };\n // if the value is a fragment and it is a named slot, create a span element with the slot name\n child.$tag$ = child.$tag$ || (slot ? 'span' : null);\n return child.$tag$ ? child : child.$children$;\n });\n\n const Component = `${cmpName}`;\n return h(Component, { ...args }, children);\n};\n\nexport function renderToCanvas(\n { storyFn, showMain, storyContext }: RenderContext<StencilRenderer<unknown>>,\n canvasElement: StencilRenderer<unknown>['canvasElement'],\n) {\n const vdom = storyFn();\n showMain();\n\n /**\n * If the component is not automatically registered after import, register it here\n */\n if (storyContext.component && storyContext.component.is && !customElements.get(storyContext.component.is)) {\n customElements.define(storyContext.component.is, storyContext.component);\n }\n\n if (canvasElement.firstChild) {\n canvasElement.removeChild(canvasElement.firstChild);\n }\n\n const element = document.createElement('div');\n canvasElement.appendChild(element);\n renderStencil(vdom, element);\n simulatePageLoad(element);\n}\n","import { enhanceArgTypes } from 'storybook/internal/docs-tools';\nimport type { ArgTypesEnhancer, Parameters } from 'storybook/internal/types';\n\nexport const parameters: Parameters = { renderer: 'stencil' };\n\nexport { render, renderToCanvas } from './render';\n\nexport const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes];\n"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAaA,WAAgD,CAAC,MAAM,YAAY;CAC9E,MAAM,EAAE,WAAW,0BAAY,GAAG;AAElC,KAAI,MAAM,QAAQ,UAAU,CAC1B,OAAM,IAAI,MAAM;AAElB,YAAW,cAAc,aAAa,eAAe,IAAI,UAAU,CACjE,OAAM,IAAI,OACP;iBAEa,cAAc,aAAa,eAAe,QAAQ,UAAU,CAC5E,OAAM,IAAI,OACP;CAGL,MAAM,iBAAiB,cAAc,WAAW,YAAY,eAAe,QAAQ,UAAU;CAE7F,MAAMC,WAAkB,OAAO,QAAeC,aAAW,SAAS,CAAE,EAAC,CAAC,IAAI,CAAC,CAAC,KAAK,MAAM,KAAK;EAE1F,MAAM,OAAO,QAAQ,qBAAwB;EAE7C,MAAM,eACG,UAAU,WACb,UAAa,EAAE,KAAM,GAAE,MAAM,GAC7B;GACE,GAAG;GACH,SAAS;IACP,GAAG,MAAM;IACT;GACD;EACF;AAEP,QAAM,QAAQ,MAAM,UAAU,OAAO,SAAS;AAC9C,SAAO,MAAM,QAAQ,QAAQ,MAAM;CACpC,EAAC;CAEF,MAAM,aAAa,EAAE,QAAQ;AAC7B,QAAO,EAAE,WAAW,EAAE,GAAG,KAAM,GAAE,SAAS;AAC3C;AAED,SAAgB,eACd,EAAE,SAAS,UAAU,cAAuD,EAC5EC,eACA;CACA,MAAM,OAAO,SAAS;AACtB,WAAU;;;;AAKV,KAAI,aAAa,aAAa,aAAa,UAAU,OAAO,eAAe,IAAI,aAAa,UAAU,GAAG,CACvG,gBAAe,OAAO,aAAa,UAAU,IAAI,aAAa,UAAU;AAG1E,KAAI,cAAc,WAChB,eAAc,YAAY,cAAc,WAAW;CAGrD,MAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,eAAc,YAAY,QAAQ;AAClC,QAAc,MAAM,QAAQ;AAC5B,kBAAiB,QAAQ;AAC1B;;;;;;;;;;;ACjED,MAAaC,aAAyB,EAAE,UAAU,UAAW;AAI7D,MAAaC,oBAAwC,CAAC,eAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.cjs","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]","sourceDecorator","SourceType"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction } from 'storybook/internal/types';\
|
|
1
|
+
{"version":3,"file":"entry-preview-docs.cjs","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]","sourceDecorator","parameters: Parameters","SourceType"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction, Parameters } from 'storybook/internal/types';\nimport { sourceDecorator } from './docs';\nimport type { StencilRenderer } from './types';\n\nexport const decorators: DecoratorFunction<StencilRenderer<unknown>>[] = [sourceDecorator];\n\nexport const parameters: Parameters = {\n docs: {\n story: { inline: true },\n source: {\n type: SourceType.DYNAMIC,\n language: 'html',\n },\n },\n};\n"],"mappings":";;;;;AAKA,MAAaA,aAA4D,CAACC,4BAAgB;AAE1F,MAAaC,aAAyB,EACpC,MAAM;CACJ,OAAO,EAAE,QAAQ,KAAM;CACvB,QAAQ;EACN,MAAMC,yCAAW;EACjB,UAAU;CACX;AACF,EACF"}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { StencilRenderer } from "./types-
|
|
2
|
-
import { DecoratorFunction } from "storybook/internal/types";
|
|
3
|
-
import { SourceType } from "storybook/internal/docs-tools";
|
|
1
|
+
import { StencilRenderer } from "./types-BZP9npQ9.cjs";
|
|
2
|
+
import { DecoratorFunction, Parameters } from "storybook/internal/types";
|
|
4
3
|
|
|
5
4
|
//#region src/entry-preview-docs.d.ts
|
|
6
5
|
declare const decorators: DecoratorFunction<StencilRenderer<unknown>>[];
|
|
7
|
-
declare const parameters:
|
|
8
|
-
docs: {
|
|
9
|
-
story: {
|
|
10
|
-
inline: boolean;
|
|
11
|
-
};
|
|
12
|
-
source: {
|
|
13
|
-
type: SourceType;
|
|
14
|
-
language: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
6
|
+
declare const parameters: Parameters;
|
|
18
7
|
//#endregion
|
|
19
8
|
export { decorators, parameters };
|
|
20
9
|
//# sourceMappingURL=entry-preview-docs.d.cts.map
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { StencilRenderer } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { DecoratorFunction } from "storybook/internal/types";
|
|
1
|
+
import { StencilRenderer } from "./types-C-2oudGU.js";
|
|
2
|
+
import { DecoratorFunction, Parameters } from "storybook/internal/types";
|
|
4
3
|
|
|
5
4
|
//#region src/entry-preview-docs.d.ts
|
|
6
5
|
declare const decorators: DecoratorFunction<StencilRenderer<unknown>>[];
|
|
7
|
-
declare const parameters:
|
|
8
|
-
docs: {
|
|
9
|
-
story: {
|
|
10
|
-
inline: boolean;
|
|
11
|
-
};
|
|
12
|
-
source: {
|
|
13
|
-
type: SourceType;
|
|
14
|
-
language: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
6
|
+
declare const parameters: Parameters;
|
|
18
7
|
//#endregion
|
|
19
8
|
export { decorators, parameters };
|
|
20
9
|
//# sourceMappingURL=entry-preview-docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.js","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction } from 'storybook/internal/types';\
|
|
1
|
+
{"version":3,"file":"entry-preview-docs.js","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]","parameters: Parameters"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction, Parameters } from 'storybook/internal/types';\nimport { sourceDecorator } from './docs';\nimport type { StencilRenderer } from './types';\n\nexport const decorators: DecoratorFunction<StencilRenderer<unknown>>[] = [sourceDecorator];\n\nexport const parameters: Parameters = {\n docs: {\n story: { inline: true },\n source: {\n type: SourceType.DYNAMIC,\n language: 'html',\n },\n },\n};\n"],"mappings":";;;;AAKA,MAAaA,aAA4D,CAAC,eAAgB;AAE1F,MAAaC,aAAyB,EACpC,MAAM;CACJ,OAAO,EAAE,QAAQ,KAAM;CACvB,QAAQ;EACN,MAAM,WAAW;EACjB,UAAU;CACX;AACF,EACF"}
|
package/dist/entry-preview.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArgTypesEnhancer, ArgsStoryFn, RenderContext } from "storybook/internal/types";
|
|
1
|
+
import { StencilRenderer } from "./types-BZP9npQ9.cjs";
|
|
2
|
+
import { ArgTypesEnhancer, ArgsStoryFn, Parameters, RenderContext } from "storybook/internal/types";
|
|
3
3
|
|
|
4
4
|
//#region src/render.d.ts
|
|
5
5
|
declare const render: ArgsStoryFn<StencilRenderer<unknown>>;
|
package/dist/entry-preview.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArgTypesEnhancer, ArgsStoryFn, RenderContext } from "storybook/internal/types";
|
|
1
|
+
import { StencilRenderer } from "./types-C-2oudGU.js";
|
|
2
|
+
import { ArgTypesEnhancer, ArgsStoryFn, Parameters, RenderContext } from "storybook/internal/types";
|
|
3
3
|
|
|
4
4
|
//#region src/render.d.ts
|
|
5
5
|
declare const render: ArgsStoryFn<StencilRenderer<unknown>>;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig } from "./types-BZP9npQ9.cjs";
|
|
2
2
|
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "storybook/internal/types";
|
|
3
3
|
|
|
4
4
|
//#region @types/rollup-parseAst.d.ts
|
|
@@ -48,5 +48,5 @@ declare module 'rollup/parseAst' {
|
|
|
48
48
|
*/
|
|
49
49
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<StencilRenderer<unknown>>;
|
|
50
50
|
//#endregion
|
|
51
|
-
export {
|
|
51
|
+
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig, setProjectAnnotations };
|
|
52
52
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rollup-parseAst-DXE9IfcK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig } from "./types-C-2oudGU.js";
|
|
3
3
|
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "storybook/internal/types";
|
|
4
4
|
|
|
5
5
|
//#region src/portable-stories.d.ts
|
|
@@ -25,5 +25,5 @@ import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "
|
|
|
25
25
|
*/
|
|
26
26
|
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<StencilRenderer<unknown>>;
|
|
27
27
|
//#endregion
|
|
28
|
-
export {
|
|
28
|
+
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig, setProjectAnnotations };
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.cts
CHANGED
package/dist/node/index.d.ts
CHANGED
package/dist/preset.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CsX-DzYB.cjs');
|
|
2
2
|
const module$1 = require_chunk.__toESM(require("module"));
|
|
3
3
|
const path = require_chunk.__toESM(require("path"));
|
|
4
|
-
const url = require_chunk.__toESM(require("url"));
|
|
5
4
|
const unplugin_stencil_vite = require_chunk.__toESM(require("unplugin-stencil/vite"));
|
|
5
|
+
const url = require_chunk.__toESM(require("url"));
|
|
6
6
|
const vite = require_chunk.__toESM(require("vite"));
|
|
7
7
|
|
|
8
8
|
//#region src/preset.ts
|
|
@@ -14,14 +14,12 @@ const core = {
|
|
|
14
14
|
builder: getAbsolutePath("@storybook/builder-vite"),
|
|
15
15
|
renderer
|
|
16
16
|
};
|
|
17
|
-
const viteFinal = async (defaultConfig) => {
|
|
17
|
+
const viteFinal = async (defaultConfig, { configType }) => {
|
|
18
18
|
const config = (0, vite.mergeConfig)(defaultConfig, {
|
|
19
|
-
build: {
|
|
20
|
-
target: "es2020",
|
|
21
|
-
rollupOptions: { external: ["@stencil/core"] }
|
|
22
|
-
},
|
|
19
|
+
build: { target: "es2020" },
|
|
23
20
|
plugins: [(0, unplugin_stencil_vite.default)({ rootPath: defaultConfig.root })]
|
|
24
21
|
});
|
|
22
|
+
if (configType === "DEVELOPMENT") return (0, vite.mergeConfig)(config, { build: { rollupOptions: { external: ["@stencil/core"] } } });
|
|
25
23
|
return config;
|
|
26
24
|
};
|
|
27
25
|
const previewAnnotations = async (input = [], options) => {
|
package/dist/preset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.cjs","names":["require","input: I","__dirname","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport
|
|
1
|
+
{"version":3,"file":"preset.cjs","names":["require","input: I","__dirname","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport stencil from 'unplugin-stencil/vite';\nimport { fileURLToPath } from 'url';\nimport { mergeConfig } from 'vite';\nimport { StorybookConfig } from './types';\n\nconst require = createRequire(import.meta.url);\nconst getAbsolutePath = <I extends string>(input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any;\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst renderer = join(__dirname, 'entry-preview.js');\n\nexport const core: StorybookConfig['core'] = {\n builder: getAbsolutePath('@storybook/builder-vite'),\n renderer,\n};\n\nexport const viteFinal: StorybookConfig['viteFinal'] = async (defaultConfig, { configType }) => {\n const config = mergeConfig(defaultConfig, {\n build: {\n target: 'es2020',\n },\n plugins: [\n stencil({\n rootPath: defaultConfig.root,\n }),\n ],\n });\n if (configType === 'DEVELOPMENT') {\n return mergeConfig(config, {\n build: {\n rollupOptions: {\n external: ['@stencil/core'],\n },\n },\n });\n }\n\n return config;\n};\n\nexport const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input = [], options) => {\n const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;\n const result: string[] = [];\n\n return result\n .concat(input)\n .concat([renderer])\n .concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.js')] : []);\n};\n"],"mappings":";;;;;;;;AAWA,MAAMA,YAAU,0EAA8B;AAC9C,MAAM,kBAAkB,CAAmBC,UAAgB,kBAAQ,UAAQ,QAAQ,eAAK,OAAO,eAAe,CAAC,CAAC;AAEhH,MAAMC,cAAY,kBAAQ,qEAA8B,CAAC;AAEzD,MAAM,WAAW,eAAKA,aAAW,mBAAmB;AAEpD,MAAaC,OAAgC;CAC3C,SAAS,gBAAgB,0BAA0B;CACnD;AACD;AAED,MAAaC,YAA0C,OAAO,eAAe,EAAE,YAAY,KAAK;CAC9F,MAAM,SAAS,sBAAY,eAAe;EACxC,OAAO,EACL,QAAQ,SACT;EACD,SAAS,CACP,mCAAQ,EACN,UAAU,cAAc,KACzB,EAAC,AACH;CACF,EAAC;AACF,KAAI,eAAe,cACjB,QAAO,sBAAY,QAAQ,EACzB,OAAO,EACL,eAAe,EACb,UAAU,CAAC,eAAgB,EAC5B,EACF,EACF,EAAC;AAGJ,QAAO;AACR;AAED,MAAaC,qBAA4D,OAAO,QAAQ,CAAE,GAAE,YAAY;CACtG,MAAM,cAAc,OAAO,KAAK,MAAM,QAAQ,QAAQ,MAAM,QAAQ,CAAE,GAAE,QAAQ,CAAC,CAAC,SAAS;CAC3F,MAAMC,SAAmB,CAAE;AAE3B,QAAO,OACJ,OAAO,MAAM,CACb,OAAO,CAAC,QAAS,EAAC,CAClB,OAAO,cAAc,CAAC,eAAKJ,aAAW,wBAAwB,AAAC,IAAG,CAAE,EAAC;AACzE"}
|
package/dist/preset.d.cts
CHANGED
package/dist/preset.d.ts
CHANGED
package/dist/preset.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
2
|
import { dirname, join } from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
3
|
import stencil from "unplugin-stencil/vite";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
5
|
import { mergeConfig } from "vite";
|
|
6
6
|
|
|
7
7
|
//#region src/preset.ts
|
|
@@ -13,14 +13,12 @@ const core = {
|
|
|
13
13
|
builder: getAbsolutePath("@storybook/builder-vite"),
|
|
14
14
|
renderer
|
|
15
15
|
};
|
|
16
|
-
const viteFinal = async (defaultConfig) => {
|
|
16
|
+
const viteFinal = async (defaultConfig, { configType }) => {
|
|
17
17
|
const config = mergeConfig(defaultConfig, {
|
|
18
|
-
build: {
|
|
19
|
-
target: "es2020",
|
|
20
|
-
rollupOptions: { external: ["@stencil/core"] }
|
|
21
|
-
},
|
|
18
|
+
build: { target: "es2020" },
|
|
22
19
|
plugins: [stencil({ rootPath: defaultConfig.root })]
|
|
23
20
|
});
|
|
21
|
+
if (configType === "DEVELOPMENT") return mergeConfig(config, { build: { rollupOptions: { external: ["@stencil/core"] } } });
|
|
24
22
|
return config;
|
|
25
23
|
};
|
|
26
24
|
const previewAnnotations = async (input = [], options) => {
|
package/dist/preset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.js","names":["input: I","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport
|
|
1
|
+
{"version":3,"file":"preset.js","names":["input: I","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport stencil from 'unplugin-stencil/vite';\nimport { fileURLToPath } from 'url';\nimport { mergeConfig } from 'vite';\nimport { StorybookConfig } from './types';\n\nconst require = createRequire(import.meta.url);\nconst getAbsolutePath = <I extends string>(input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any;\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst renderer = join(__dirname, 'entry-preview.js');\n\nexport const core: StorybookConfig['core'] = {\n builder: getAbsolutePath('@storybook/builder-vite'),\n renderer,\n};\n\nexport const viteFinal: StorybookConfig['viteFinal'] = async (defaultConfig, { configType }) => {\n const config = mergeConfig(defaultConfig, {\n build: {\n target: 'es2020',\n },\n plugins: [\n stencil({\n rootPath: defaultConfig.root,\n }),\n ],\n });\n if (configType === 'DEVELOPMENT') {\n return mergeConfig(config, {\n build: {\n rollupOptions: {\n external: ['@stencil/core'],\n },\n },\n });\n }\n\n return config;\n};\n\nexport const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input = [], options) => {\n const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;\n const result: string[] = [];\n\n return result\n .concat(input)\n .concat([renderer])\n .concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.js')] : []);\n};\n"],"mappings":";;;;;;;AAWA,MAAM,UAAU,cAAc,OAAO,KAAK,IAAI;AAC9C,MAAM,kBAAkB,CAAmBA,UAAgB,QAAQ,QAAQ,QAAQ,KAAK,OAAO,eAAe,CAAC,CAAC;AAEhH,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAM,WAAW,KAAK,WAAW,mBAAmB;AAEpD,MAAaC,OAAgC;CAC3C,SAAS,gBAAgB,0BAA0B;CACnD;AACD;AAED,MAAaC,YAA0C,OAAO,eAAe,EAAE,YAAY,KAAK;CAC9F,MAAM,SAAS,YAAY,eAAe;EACxC,OAAO,EACL,QAAQ,SACT;EACD,SAAS,CACP,QAAQ,EACN,UAAU,cAAc,KACzB,EAAC,AACH;CACF,EAAC;AACF,KAAI,eAAe,cACjB,QAAO,YAAY,QAAQ,EACzB,OAAO,EACL,eAAe,EACb,UAAU,CAAC,eAAgB,EAC5B,EACF,EACF,EAAC;AAGJ,QAAO;AACR;AAED,MAAaC,qBAA4D,OAAO,QAAQ,CAAE,GAAE,YAAY;CACtG,MAAM,cAAc,OAAO,KAAK,MAAM,QAAQ,QAAQ,MAAM,QAAQ,CAAE,GAAE,QAAQ,CAAC,CAAC,SAAS;CAC3F,MAAMC,SAAmB,CAAE;AAE3B,QAAO,OACJ,OAAO,MAAM,CACb,OAAO,CAAC,QAAS,EAAC,CAClB,OAAO,cAAc,CAAC,KAAK,WAAW,wBAAwB,AAAC,IAAG,CAAE,EAAC;AACzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, VNode } from "@stencil/core";
|
|
2
|
-
import { AnnotatedStoryFn,
|
|
2
|
+
import { AnnotatedStoryFn, Args, ComponentAnnotations, DecoratorFunction, LoaderFunction, ProjectAnnotations, StoryAnnotations, StoryContext, StorybookConfig, StrictArgs, WebRenderer } from "storybook/internal/types";
|
|
3
3
|
import { StorybookConfigVite } from "@storybook/builder-vite";
|
|
4
4
|
|
|
5
5
|
//#region src/types.d.ts
|
|
@@ -67,5 +67,5 @@ declare global {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
|
-
export {
|
|
71
|
-
//# sourceMappingURL=types-
|
|
70
|
+
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext$1 as StoryContext, StoryFn, StoryObj, StorybookConfig$1 as StorybookConfig };
|
|
71
|
+
//# sourceMappingURL=types-BZP9npQ9.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX, VNode } from "@stencil/core";
|
|
2
|
-
import { AnnotatedStoryFn,
|
|
2
|
+
import { AnnotatedStoryFn, Args, ComponentAnnotations, DecoratorFunction, LoaderFunction, ProjectAnnotations, StoryAnnotations, StoryContext, StorybookConfig, StrictArgs, WebRenderer } from "storybook/internal/types";
|
|
3
3
|
import { StorybookConfigVite } from "@storybook/builder-vite";
|
|
4
4
|
|
|
5
5
|
//#region src/types.d.ts
|
|
@@ -67,5 +67,5 @@ declare global {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
|
-
export {
|
|
71
|
-
//# sourceMappingURL=types-
|
|
70
|
+
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext$1 as StoryContext, StoryFn, StoryObj, StorybookConfig$1 as StorybookConfig };
|
|
71
|
+
//# sourceMappingURL=types-C-2oudGU.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/storybook-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Storybook plugin for Stencil",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/stenciljs/storybook",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@storybook/html": "^9.0.8",
|
|
71
71
|
"preact-render-to-string": "^6.5.13",
|
|
72
72
|
"react-docgen-typescript": "^2.4.0",
|
|
73
|
-
"unplugin-stencil": "^0.3.
|
|
73
|
+
"unplugin-stencil": "^0.3.5"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@stencil/core": "^4.30.0",
|