FIX dependencies cycle in addons/actions

This commit is contained in:
Norbert de Langen 2018-08-05 20:35:15 +02:00
parent 5a9834c4ed
commit c1f212c167
No known key found for this signature in database
GPG Key ID: 976651DA156C2825
5 changed files with 19 additions and 7 deletions

View File

@ -0,0 +1,4 @@
export const ADDON_ID = 'storybook/actions';
export const PANEL_ID = `${ADDON_ID}/actions-panel`;
export const EVENT_ID = `${ADDON_ID}/action-event`;
export const CYCLIC_KEY = '$___storybook.isCyclic';

View File

@ -8,8 +8,16 @@ import {
} from './preview'; } from './preview';
// addons, panels and events get unique names using a prefix // addons, panels and events get unique names using a prefix
export const ADDON_ID = 'storybook/actions'; import { ADDON_ID, PANEL_ID, EVENT_ID } from './constants';
export const PANEL_ID = `${ADDON_ID}/actions-panel`;
export const EVENT_ID = `${ADDON_ID}/action-event`;
export { action, actions, decorate, configureActions, decorateAction, withActions }; export {
action,
actions,
decorate,
configureActions,
decorateAction,
withActions,
ADDON_ID,
PANEL_ID,
EVENT_ID,
};

View File

@ -2,7 +2,7 @@ import { DecycleError } from './errors';
import { getPropertiesList, typeReplacer, omitProperty } from './util'; import { getPropertiesList, typeReplacer, omitProperty } from './util';
import { CYCLIC_KEY } from '.'; import { CYCLIC_KEY } from '../constants';
import { objectType } from './types'; import { objectType } from './types';

View File

@ -1,6 +1,6 @@
import reviver from './reviver'; import reviver from './reviver';
import { muteProperty } from './util'; import { muteProperty } from './util';
import { CYCLIC_KEY } from '.'; import { CYCLIC_KEY } from '../constants';
// eslint-disable-next-line no-control-regex // eslint-disable-next-line no-control-regex
const pathReg = /^\$(?:\[(?:\d+|"(?:[^\\"\u0000-\u001f]|\\([\\"/bfnrt]|u[0-9a-zA-Z]{4}))*")])*$/; const pathReg = /^\$(?:\[(?:\d+|"(?:[^\\"\u0000-\u001f]|\\([\\"/bfnrt]|u[0-9a-zA-Z]{4}))*")])*$/;

View File

@ -1,6 +1,6 @@
import uuid from 'uuid/v1'; import uuid from 'uuid/v1';
import addons from '@storybook/addons'; import addons from '@storybook/addons';
import { EVENT_ID } from '..'; import { EVENT_ID } from '../constants';
import { canConfigureName, prepareArguments } from '../lib/util'; import { canConfigureName, prepareArguments } from '../lib/util';
import { config } from './configureActions'; import { config } from './configureActions';