@storybook/addon-links
Advanced tools
Comparing version 0.0.0-pr-26557-sha-7290a2c2 to 0.0.0-pr-26654-sha-49d01553
@@ -1,2 +0,2 @@ | ||
import { ComponentTitle, StoryName, StoryId, StoryKind } from '@storybook/types'; | ||
import { ComponentTitle, StoryName, StoryId, StoryKind } from 'storybook/internal/types'; | ||
@@ -14,5 +14,5 @@ interface ParamsId { | ||
declare const hrefTo: (title: ComponentTitle, name: StoryName) => Promise<string>; | ||
declare const linkTo: (idOrTitle: string | ((...args: any[]) => string), nameInput?: string | ((...args: any[]) => string) | undefined) => (...args: any[]) => void; | ||
declare const linkTo: (idOrTitle: string | ((...args: any[]) => string), nameInput?: string | ((...args: any[]) => string)) => (...args: any[]) => void; | ||
declare const withLinks: (...args: any) => any; | ||
export { hrefTo, linkTo, navigate, withLinks }; |
'use strict'; | ||
var global = require('@storybook/global'); | ||
var previewApi = require('@storybook/preview-api'); | ||
var coreEvents = require('@storybook/core-events'); | ||
var previewApi = require('storybook/internal/preview-api'); | ||
var coreEvents = require('storybook/internal/core-events'); | ||
var csf = require('@storybook/csf'); | ||
@@ -7,0 +7,0 @@ |
@@ -1,3 +0,3 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import { addons } from 'storybook/internal/manager-api'; | ||
var ADDON_ID="storybook/links";var constants_default={NAVIGATE:`${ADDON_ID}/navigate`,REQUEST:`${ADDON_ID}/request`,RECEIVE:`${ADDON_ID}/receive`};addons.register(ADDON_ID,api=>{api.on(constants_default.REQUEST,({kind,name})=>{let id=api.storyId(kind,name);api.emit(constants_default.RECEIVE,id);});}); |
@@ -1,8 +0,10 @@ | ||
import { global } from '@storybook/global'; | ||
import { makeDecorator, addons } from '@storybook/preview-api'; | ||
import { STORY_CHANGED, SELECT_STORY } from '@storybook/core-events'; | ||
import '@storybook/csf'; | ||
'use strict'; | ||
var PARAM_KEY="links";var{document,HTMLElement}=global;var navigate=params=>addons.getChannel().emit(SELECT_STORY,params);var linksListener=e=>{let{target}=e;if(!(target instanceof HTMLElement))return;let element=target,{sbKind:kind,sbStory:story}=element.dataset;(kind||story)&&(e.preventDefault(),navigate({kind,story}));},hasListener=!1,on=()=>{hasListener||(hasListener=!0,document.addEventListener("click",linksListener));},off=()=>{hasListener&&(hasListener=!1,document.removeEventListener("click",linksListener));},withLinks=makeDecorator({name:"withLinks",parameterName:PARAM_KEY,wrapper:(getStory,context)=>(on(),addons.getChannel().once(STORY_CHANGED,off),getStory(context))});var decorators=[withLinks]; | ||
var global = require('@storybook/global'); | ||
var previewApi = require('storybook/internal/preview-api'); | ||
var coreEvents = require('storybook/internal/core-events'); | ||
require('@storybook/csf'); | ||
export { decorators }; | ||
var PARAM_KEY="links";var{document,HTMLElement}=global.global;var navigate=params=>previewApi.addons.getChannel().emit(coreEvents.SELECT_STORY,params);var linksListener=e=>{let{target}=e;if(!(target instanceof HTMLElement))return;let element=target,{sbKind:kind,sbStory:story}=element.dataset;(kind||story)&&(e.preventDefault(),navigate({kind,story}));},hasListener=!1,on=()=>{hasListener||(hasListener=!0,document.addEventListener("click",linksListener));},off=()=>{hasListener&&(hasListener=!1,document.removeEventListener("click",linksListener));},withLinks=previewApi.makeDecorator({name:"withLinks",parameterName:PARAM_KEY,wrapper:(getStory,context)=>(on(),previewApi.addons.getChannel().once(coreEvents.STORY_CHANGED,off),getStory(context))});var decorators=[withLinks]; | ||
exports.decorators = decorators; |
@@ -1,2 +0,2 @@ | ||
import { StoryKind, ComponentTitle, StoryName } from '@storybook/types'; | ||
import { StoryKind, ComponentTitle, StoryName } from 'storybook/internal/types'; | ||
import React, { PureComponent, ReactNode } from 'react'; | ||
@@ -3,0 +3,0 @@ |
@@ -5,4 +5,4 @@ 'use strict'; | ||
var global = require('@storybook/global'); | ||
var previewApi = require('@storybook/preview-api'); | ||
var coreEvents = require('@storybook/core-events'); | ||
var previewApi = require('storybook/internal/preview-api'); | ||
var coreEvents = require('storybook/internal/core-events'); | ||
var csf = require('@storybook/csf'); | ||
@@ -9,0 +9,0 @@ |
{ | ||
"name": "@storybook/addon-links", | ||
"version": "0.0.0-pr-26557-sha-7290a2c2", | ||
"version": "0.0.0-pr-26654-sha-49d01553", | ||
"description": "Link stories together to build demos and prototypes with your UI components", | ||
@@ -28,12 +28,16 @@ "keywords": [ | ||
"node": "./dist/index.js", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
}, | ||
"./react": { | ||
"types": "./dist/react/index.d.ts", | ||
"require": "./dist/react/index.js", | ||
"import": "./dist/react/index.mjs" | ||
"import": "./dist/react/index.mjs", | ||
"require": "./dist/react/index.js" | ||
}, | ||
"./preview": { | ||
"types": "./dist/preview.d.ts", | ||
"import": "./dist/preview.mjs", | ||
"require": "./dist/preview.js" | ||
}, | ||
"./manager": "./dist/manager.js", | ||
"./preview": "./dist/preview.js", | ||
"./register": "./dist/manager.js", | ||
@@ -67,3 +71,3 @@ "./package.json": "./package.json" | ||
"dependencies": { | ||
"@storybook/csf": "^0.1.2", | ||
"@storybook/csf": "^0.1.11", | ||
"@storybook/global": "^5.0.0", | ||
@@ -73,8 +77,2 @@ "ts-dedent": "^2.0.0" | ||
"devDependencies": { | ||
"@storybook/client-logger": "0.0.0-pr-26557-sha-7290a2c2", | ||
"@storybook/core-events": "0.0.0-pr-26557-sha-7290a2c2", | ||
"@storybook/manager-api": "0.0.0-pr-26557-sha-7290a2c2", | ||
"@storybook/preview-api": "0.0.0-pr-26557-sha-7290a2c2", | ||
"@storybook/router": "0.0.0-pr-26557-sha-7290a2c2", | ||
"@storybook/types": "0.0.0-pr-26557-sha-7290a2c2", | ||
"fs-extra": "^11.1.0", | ||
@@ -84,3 +82,4 @@ "typescript": "^5.3.2" | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", | ||
"storybook": "^0.0.0-pr-26654-sha-49d01553" | ||
}, | ||
@@ -108,3 +107,3 @@ "peerDependenciesMeta": { | ||
}, | ||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", | ||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", | ||
"storybook": { | ||
@@ -111,0 +110,0 @@ "displayName": "Links", |
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
19276
2
17
121
5
4
+ Addedreact@19.0.0-rc-fb9a90fa48-20240614(transitive)
+ Addedstorybook@0.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)
Updated@storybook/csf@^0.1.11