@storybook/server
Advanced tools
Comparing version 0.0.0-pr-28800-sha-2528064a to 0.0.0-pr-28882-sha-2310d8df
@@ -1,4 +0,4 @@ | ||
"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 entry_preview_exports={};__export(entry_preview_exports,{parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});module.exports=__toCommonJS(entry_preview_exports);var import_global=require("@storybook/global"),import_ts_dedent=require("ts-dedent"),import_preview_api=require("storybook/internal/preview-api"),{fetch,Node}=import_global.global,defaultFetchStoryHtml=async(url,path,params,storyContext)=>{let fetchUrl=new URL(`${url}/${path}`);return fetchUrl.search=new URLSearchParams({...storyContext.globals,...params}).toString(),(await fetch(fetchUrl)).text()},buildStoryArgs=(args,argTypes)=>{let storyArgs={...args};return Object.keys(argTypes).forEach(key=>{let argType=argTypes[key],{control}=argType,controlType=control&&typeof control=="object"&&"type"in control&&control.type?.toLowerCase(),argValue=storyArgs[key];switch(controlType){case"date":storyArgs[key]=new Date(argValue).toISOString();break;case"object":storyArgs[key]=JSON.stringify(argValue);break;default:}}),storyArgs},render=args=>{};async function renderToCanvas({id,title,name,showMain,showError,forceRemount,storyFn,storyContext,storyContext:{parameters:parameters2,args,argTypes}},canvasElement){storyFn();let storyArgs=buildStoryArgs(args,argTypes),{server:{url,id:storyId,fetchStoryHtml=defaultFetchStoryHtml,params}}=parameters2,fetchId=storyId||id,storyParams={...params,...storyArgs},element=await fetchStoryHtml(url,fetchId,storyParams,storyContext);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 "${title}".`,description:import_ts_dedent.dedent` | ||
"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 entry_preview_exports={};__export(entry_preview_exports,{parameters:()=>parameters,render:()=>render,renderToCanvas:()=>renderToCanvas});module.exports=__toCommonJS(entry_preview_exports);var import_preview_api=require("storybook/internal/preview-api"),import_global=require("@storybook/global"),import_ts_dedent=require("ts-dedent"),{fetch,Node}=import_global.global,defaultFetchStoryHtml=async(url,path,params,storyContext)=>{let fetchUrl=new URL(`${url}/${path}`);return fetchUrl.search=new URLSearchParams({...storyContext.globals,...params}).toString(),(await fetch(fetchUrl)).text()},buildStoryArgs=(args,argTypes)=>{let storyArgs={...args};return Object.keys(argTypes).forEach(key=>{let argType=argTypes[key],{control}=argType,controlType=control&&typeof control=="object"&&"type"in control&&control.type?.toLowerCase(),argValue=storyArgs[key];switch(controlType){case"date":storyArgs[key]=new Date(argValue).toISOString();break;case"object":storyArgs[key]=JSON.stringify(argValue);break;default:}}),storyArgs},render=args=>{};async function renderToCanvas({id,title,name,showMain,showError,forceRemount,storyFn,storyContext,storyContext:{parameters:parameters2,args,argTypes}},canvasElement){storyFn();let storyArgs=buildStoryArgs(args,argTypes),{server:{url,id:storyId,fetchStoryHtml=defaultFetchStoryHtml,params}}=parameters2,fetchId=storyId||id,storyParams={...params,...storyArgs},element=await fetchStoryHtml(url,fetchId,storyParams,storyContext);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 "${title}".`,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:"server"};0&&(module.exports={parameters,render,renderToCanvas}); |
@@ -1,1 +0,1 @@ | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__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 __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{experimental_indexers:()=>experimental_indexers,previewAnnotations:()=>previewAnnotations});module.exports=__toCommonJS(preset_exports);var import_fs_extra=__toESM(require("fs-extra")),import_yaml=__toESM(require("yaml")),import_path=require("path"),experimental_indexers=existingIndexers=>[{test:/(stories|story)\.(json|ya?ml)$/,createIndex:async fileName=>{let content=fileName.endsWith(".json")?await import_fs_extra.default.readJson(fileName,"utf-8"):import_yaml.default.parse((await import_fs_extra.default.readFile(fileName,"utf-8")).toString());return content.stories.map(story=>{let tags=Array.from(new Set([...content.tags??[],...story.tags??[]]));return{importPath:fileName,exportName:story.name,name:story.name,title:content.title,tags,type:"story"}})}},...existingIndexers||[]],previewAnnotations=async(input=[],options)=>{let{presetsList}=options;return presetsList?[].concat(input).concat([(0,import_path.join)(__dirname,"entry-preview.mjs")]):input};0&&(module.exports={experimental_indexers,previewAnnotations}); | ||
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__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 __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{experimental_indexers:()=>experimental_indexers,previewAnnotations:()=>previewAnnotations});module.exports=__toCommonJS(preset_exports);var import_node_path=require("path"),import_fs_extra=__toESM(require("fs-extra")),import_yaml=__toESM(require("yaml")),experimental_indexers=existingIndexers=>[{test:/(stories|story)\.(json|ya?ml)$/,createIndex:async fileName=>{let content=fileName.endsWith(".json")?await import_fs_extra.default.readJson(fileName,"utf-8"):import_yaml.default.parse((await import_fs_extra.default.readFile(fileName,"utf-8")).toString());return content.stories.map(story=>{let tags=Array.from(new Set([...content.tags??[],...story.tags??[]]));return{importPath:fileName,exportName:story.name,name:story.name,title:content.title,tags,type:"story"}})}},...existingIndexers||[]],previewAnnotations=async(input=[],options)=>{let{presetsList}=options;return presetsList?[].concat(input).concat([(0,import_node_path.join)(__dirname,"entry-preview.mjs")]):input};0&&(module.exports={experimental_indexers,previewAnnotations}); |
{ | ||
"name": "@storybook/server", | ||
"version": "0.0.0-pr-28800-sha-2528064a", | ||
"version": "0.0.0-pr-28882-sha-2310d8df", | ||
"description": "Storybook Server renderer", | ||
@@ -25,5 +25,5 @@ "keywords": [ | ||
"types": "./dist/index.d.ts", | ||
"node": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
"require": "./dist/index.js", | ||
"node": "./dist/index.js" | ||
}, | ||
@@ -46,12 +46,12 @@ "./preset": "./preset.js", | ||
"scripts": { | ||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts", | ||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts" | ||
"check": "jiti ../../../scripts/prepare/check.ts", | ||
"prep": "jiti ../../../scripts/prepare/bundle.ts" | ||
}, | ||
"dependencies": { | ||
"@storybook/components": "^0.0.0-pr-28800-sha-2528064a", | ||
"@storybook/components": "^0.0.0-pr-28882-sha-2310d8df", | ||
"@storybook/csf": "^0.1.11", | ||
"@storybook/global": "^5.0.0", | ||
"@storybook/manager-api": "^0.0.0-pr-28800-sha-2528064a", | ||
"@storybook/preview-api": "^0.0.0-pr-28800-sha-2528064a", | ||
"@storybook/theming": "^0.0.0-pr-28800-sha-2528064a", | ||
"@storybook/manager-api": "^0.0.0-pr-28882-sha-2310d8df", | ||
"@storybook/preview-api": "^0.0.0-pr-28882-sha-2310d8df", | ||
"@storybook/theming": "^0.0.0-pr-28882-sha-2310d8df", | ||
"@types/fs-extra": "^11.0.1", | ||
@@ -66,3 +66,3 @@ "fs-extra": "^11.1.0", | ||
"peerDependencies": { | ||
"storybook": "^0.0.0-pr-28800-sha-2528064a" | ||
"storybook": "^0.0.0-pr-28882-sha-2310d8df" | ||
}, | ||
@@ -69,0 +69,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13478