Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/html

Package Overview
Dependencies
Maintainers
11
Versions
1854
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/html - npm Package Compare versions

Comparing version 0.0.0-pr-28920-sha-f4db6c03 to 0.0.0-pr-28975-sha-896e3f06

dist/chunk-CEH6MNVV.mjs

25

dist/index.d.ts

@@ -1,2 +0,2 @@

import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from 'storybook/internal/types';
import { Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from 'storybook/internal/types';
export { ArgTypes, Args, Parameters, StrictArgs } from 'storybook/internal/types';

@@ -29,2 +29,23 @@ import { H as HtmlRenderer } from './types-19e12ec7.js';

export { Decorator, HtmlRenderer, Loader, Meta, Preview, StoryContext, StoryFn, StoryObj };
/**
* Function that sets the globalConfig of your storybook. The global config is the preview module of
* your .storybook folder.
*
* It should be run a single time, so that your global config (e.g. decorators) is applied to your
* stories when using `composeStories` or `composeStory`.
*
* Example:
*
* ```jsx
* // setup-file.js
* import { setProjectAnnotations } from '@storybook/preact';
* import projectAnnotations from './.storybook/preview';
*
* setProjectAnnotations(projectAnnotations);
* ```
*
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
*/
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<HtmlRenderer>;
export { Decorator, HtmlRenderer, Loader, Meta, Preview, StoryContext, StoryFn, StoryObj, setProjectAnnotations };

@@ -1,1 +0,7 @@

"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="HTML";typeof module<"u"&&module?.hot?.decline();
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{setProjectAnnotations:()=>setProjectAnnotations});module.exports=__toCommonJS(src_exports);var import_global=require("@storybook/global"),{window:globalWindow}=import_global.global;globalWindow.STORYBOOK_ENV="HTML";var import_preview_api2=require("storybook/internal/preview-api");var entry_preview_exports={};__export(entry_preview_exports,{parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});var import_preview_api=require("storybook/internal/preview-api"),import_global2=require("@storybook/global"),import_ts_dedent=require("ts-dedent"),{Node}=import_global2.global,render=(args,context)=>{let{id,component:Component}=context;if(typeof Component=="string"){let output=Component;return Object.keys(args).forEach(key=>{output=output.replace(`{{${key}}}`,args[key])}),output}if(Component instanceof HTMLElement){let output=Component.cloneNode(!0);return Object.keys(args).forEach(key=>{output.setAttribute(key,typeof args[key]=="string"?args[key]:JSON.stringify(args[key]))}),output}if(typeof Component=="function")return Component(args,context);throw console.warn(import_ts_dedent.dedent`
Storybook's HTML renderer only supports rendering DOM elements and strings.
Received: ${Component}
`),new Error(`Unable to render story ${id}`)};function renderToCanvas({storyFn,kind,name,showMain,showError,forceRemount},canvasElement){let element=storyFn();if(showMain(),typeof element=="string")canvasElement.innerHTML=element,(0,import_preview_api.simulatePageLoad)(canvasElement);else if(element instanceof Node){if(canvasElement.firstChild===element&&forceRemount===!1)return;canvasElement.innerHTML="",canvasElement.appendChild(element),(0,import_preview_api.simulateDOMContentLoaded)()}else showError({title:`Expecting an HTML snippet or DOM node from the story: "${name}" of "${kind}".`,description:import_ts_dedent.dedent`
Did you forget to return the HTML snippet from the story?
Use "() => <your snippet or node>" or when defining the story.
`})}var parameters={renderer:"html"};function setProjectAnnotations(projectAnnotations){return(0,import_preview_api2.setDefaultProjectAnnotations)(entry_preview_exports),(0,import_preview_api2.setProjectAnnotations)(projectAnnotations)}typeof module<"u"&&module?.hot?.decline();0&&(module.exports={setProjectAnnotations});

12

package.json
{
"name": "@storybook/html",
"version": "0.0.0-pr-28920-sha-f4db6c03",
"version": "0.0.0-pr-28975-sha-896e3f06",
"description": "Storybook HTML renderer",

@@ -50,7 +50,7 @@ "keywords": [

"dependencies": {
"@storybook/components": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/components": "^0.0.0-pr-28975-sha-896e3f06",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/preview-api": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/theming": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/manager-api": "^0.0.0-pr-28975-sha-896e3f06",
"@storybook/preview-api": "^0.0.0-pr-28975-sha-896e3f06",
"@storybook/theming": "^0.0.0-pr-28975-sha-896e3f06",
"ts-dedent": "^2.0.0"

@@ -62,3 +62,3 @@ },

"peerDependencies": {
"storybook": "^0.0.0-pr-28920-sha-f4db6c03"
"storybook": "^0.0.0-pr-28975-sha-896e3f06"
},

@@ -65,0 +65,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc