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

@storybook/addon-links

Package Overview
Dependencies
Maintainers
7
Versions
1925
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/addon-links - npm Package Compare versions

Comparing version 7.0.24 to 8.0.0-alpha.10

dist/chunk-6GSMXRCY.mjs

12

dist/index.d.ts

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

import * as lib_preview_api_dist_storybook_channel_mock_a19cd233 from '@storybook/preview-api/dist/storybook-channel-mock-a19cd233';
import { ComponentTitle, StoryName, StoryId, StoryKind } from '@storybook/types';
import { C as ComponentTitle, a as StoryName, b as StoryId, S as StoryKind } from './index.d-3adcfc00.js';

@@ -16,9 +15,4 @@ interface ParamsId {

declare const linkTo: (idOrTitle: string | ((...args: any[]) => string), nameInput?: string | ((...args: any[]) => string) | undefined) => (...args: any[]) => void;
declare const withLinks: lib_preview_api_dist_storybook_channel_mock_a19cd233.M;
declare const withLinks: (...args: any) => any;
/**
* @deprecated please import this specific function from @storybook/addon-links/react
*/
declare function LinkTo(): null;
export { LinkTo, hrefTo, linkTo, navigate, withLinks };
export { hrefTo, linkTo, navigate, withLinks };

@@ -1,1 +0,3 @@

"use strict";var import_manager_api=require("@storybook/manager-api");var ADDON_ID="storybook/links";var constants_default={NAVIGATE:`${ADDON_ID}/navigate`,REQUEST:`${ADDON_ID}/request`,RECEIVE:`${ADDON_ID}/receive`};import_manager_api.addons.register(ADDON_ID,api=>{import_manager_api.addons.getChannel().on(constants_default.REQUEST,({kind,name})=>{let id=api.storyId(kind,name);api.emit(constants_default.RECEIVE,id)})});
import { addons } from '@storybook/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,1 +0,8 @@

"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 preview_exports={};__export(preview_exports,{decorators:()=>decorators});module.exports=__toCommonJS(preview_exports);var import_ts_dedent=require("ts-dedent");var import_global=require("@storybook/global"),import_preview_api=require("@storybook/preview-api"),import_core_events=require("@storybook/core-events"),import_csf=require("@storybook/csf");var ADDON_ID="storybook/links",PARAM_KEY="links",constants_default={NAVIGATE:`${ADDON_ID}/navigate`,REQUEST:`${ADDON_ID}/request`,RECEIVE:`${ADDON_ID}/receive`};var{document,HTMLElement}=import_global.global;var navigate=params=>import_preview_api.addons.getChannel().emit(import_core_events.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=(0,import_preview_api.makeDecorator)({name:"withLinks",parameterName:PARAM_KEY,wrapper:(getStory,context)=>(on(),import_preview_api.addons.getChannel().once(import_core_events.STORY_CHANGED,off),getStory(context))});var decorators=[withLinks];0&&(module.exports={decorators});
import { global } from '@storybook/global';
import { makeDecorator, addons } from '@storybook/preview-api';
import { STORY_CHANGED, SELECT_STORY } from '@storybook/core-events';
import '@storybook/csf';
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];
export { decorators };

@@ -1,3 +0,3 @@

import { StoryKind, ComponentTitle, StoryName } from '@storybook/types';
import { PureComponent, ReactNode } from 'react';
import { S as StoryKind, C as ComponentTitle, a as StoryName } from '../index.d-3adcfc00.js';
import React, { PureComponent, ReactNode } from 'react';

@@ -21,5 +21,5 @@ interface Props {

handleClick: () => void;
render(): JSX.Element;
render(): React.JSX.Element;
}
export { LinkTo as default };
{
"name": "@storybook/addon-links",
"version": "7.0.24",
"version": "8.0.0-alpha.10",
"description": "Link stories together to build demos and prototypes with your UI components",

@@ -31,12 +31,2 @@ "keywords": [

},
"./manager": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./preview": {
"types": "./dist/preview.d.ts",
"require": "./dist/preview.js",
"import": "./dist/preview.mjs"
},
"./react": {

@@ -47,7 +37,5 @@ "types": "./dist/react/index.d.ts",

},
"./register": {
"types": "./dist/manager.d.ts",
"require": "./dist/manager.js",
"import": "./dist/manager.mjs"
},
"./manager": "./dist/manager.js",
"./preview": "./dist/preview.js",
"./register": "./dist/manager.js",
"./package.json": "./package.json"

@@ -63,8 +51,2 @@ },

],
"manager": [
"dist/manager.d.ts"
],
"preview": [
"dist/preview.d.ts"
],
"react": [

@@ -79,27 +61,26 @@ "dist/react/index.d.ts"

"*.js",
"*.d.ts"
"*.d.ts",
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"prep": "../../../scripts/prepare/bundle.ts"
"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/addon-bundle.ts"
},
"dependencies": {
"@storybook/client-logger": "7.0.24",
"@storybook/core-events": "7.0.24",
"@storybook/csf": "^0.1.0",
"@storybook/csf": "^0.1.2",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "7.0.24",
"@storybook/preview-api": "7.0.24",
"@storybook/router": "7.0.24",
"@storybook/types": "7.0.24",
"prop-types": "^15.7.2",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@storybook/client-logger": "8.0.0-alpha.10",
"@storybook/core-events": "8.0.0-alpha.10",
"@storybook/manager-api": "8.0.0-alpha.10",
"@storybook/preview-api": "8.0.0-alpha.10",
"@storybook/router": "8.0.0-alpha.10",
"@storybook/types": "8.0.0-alpha.10",
"fs-extra": "^11.1.0",
"typescript": "~4.9.3"
"typescript": "^5.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},

@@ -109,5 +90,2 @@ "peerDependenciesMeta": {

"optional": true
},
"react-dom": {
"optional": true
}

@@ -119,11 +97,15 @@ },

"bundler": {
"entries": [
"./src/index.ts",
"./src/manager.ts",
"./src/preview.ts",
"./src/react/index.ts"
"exportEntries": [
"./src/react/index.ts",
"./src/index.ts"
],
"managerEntries": [
"./src/manager.ts"
],
"previewEntries": [
"./src/preview.ts"
],
"post": "./scripts/fix-preview-api-reference.ts"
},
"gitHead": "9fb2573aa274f3f69d3358050e8df9c903e8245f",
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
"storybook": {

@@ -130,0 +112,0 @@ "displayName": "Links",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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