storybook 9.0.0-rc.0 → 9.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -151,7 +151,7 @@ declare enum SourceType {
151
151
  * Use the DYNAMIC rendered snippet if the story is an args story
152
152
  */
153
153
  AUTO = "auto",
154
- /** Render the code extracted by source-loader */
154
+ /** Render the code extracted by csf-plugin */
155
155
  CODE = "code",
156
156
  /** Render dynamically-rendered source snippet from the story's virtual DOM (currently React only) */
157
157
  DYNAMIC = "dynamic"
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
  var r = Object.defineProperty;
3
- var _ = Object.getOwnPropertyDescriptor;
4
- var L = Object.getOwnPropertyNames;
3
+ var G = Object.getOwnPropertyDescriptor;
4
+ var n = Object.getOwnPropertyNames;
5
5
  var T = Object.prototype.hasOwnProperty;
6
- var n = (o, t) => {
7
- for (var e in t)
8
- r(o, e, { get: t[e], enumerable: !0 });
9
- }, c = (o, t, e, s) => {
6
+ var L = (o, t) => {
7
+ for (var H in t)
8
+ r(o, H, { get: t[H], enumerable: !0 });
9
+ }, c = (o, t, H, s) => {
10
10
  if (t && typeof t == "object" || typeof t == "function")
11
- for (let H of L(t))
12
- !T.call(o, H) && H !== e && r(o, H, { get: () => t[H], enumerable: !(s = _(t, H)) || s.enumerable });
11
+ for (let e of n(t))
12
+ !T.call(o, e) && e !== H && r(o, e, { get: () => t[e], enumerable: !(s = G(t, e)) || s.enumerable });
13
13
  return o;
14
14
  };
15
- var x = (o) => c(r({}, "__esModule", { value: !0 }), o);
15
+ var h = (o) => c(r({}, "__esModule", { value: !0 }), o);
16
16
 
17
17
  // src/highlight/index.ts
18
- var O = {};
19
- n(O, {
18
+ var x = {};
19
+ L(x, {
20
20
  HIGHLIGHT: () => E,
21
- REMOVE_HIGHLIGHT: () => G,
21
+ REMOVE_HIGHLIGHT: () => _,
22
22
  RESET_HIGHLIGHT: () => i,
23
23
  SCROLL_INTO_VIEW: () => p
24
24
  });
25
- module.exports = x(O);
25
+ module.exports = h(x);
26
26
 
27
27
  // src/highlight/constants.ts
28
- var I = "storybook/highlight", E = `${I}/add`, G = `${I}/remove`, i = `${I}/reset`, p = `${I}/scroll-into-view`;
28
+ var I = "storybook/highlight", E = `${I}/add`, _ = `${I}/remove`, i = `${I}/reset`, p = `${I}/scroll-into-view`;
@@ -3,6 +3,14 @@ declare const REMOVE_HIGHLIGHT = "storybook/highlight/remove";
3
3
  declare const RESET_HIGHLIGHT = "storybook/highlight/reset";
4
4
  declare const SCROLL_INTO_VIEW = "storybook/highlight/scroll-into-view";
5
5
 
6
+ declare const iconPaths: {
7
+ chevronLeft: string[];
8
+ chevronRight: string[];
9
+ info: string[];
10
+ shareAlt: string[];
11
+ };
12
+ type IconName = keyof typeof iconPaths;
13
+
6
14
  interface HighlightParameters {
7
15
  /**
8
16
  * Highlight configuration
@@ -14,6 +22,22 @@ interface HighlightParameters {
14
22
  disable?: boolean;
15
23
  };
16
24
  }
25
+ interface HighlightMenuItem {
26
+ /** Unique identifier for the menu item */
27
+ id: string;
28
+ /** Title of the menu item */
29
+ title: string;
30
+ /** Description of the menu item */
31
+ description?: string;
32
+ /** Icon for the menu item, left side */
33
+ iconLeft?: IconName;
34
+ /** Icon for the menu item, right side */
35
+ iconRight?: IconName;
36
+ /** Name for a channel event to trigger when the menu item is clicked */
37
+ clickEvent?: string;
38
+ /** HTML selectors for which this menu item should show (subset of `selectors`) */
39
+ selectors?: HighlightOptions['selectors'];
40
+ }
17
41
  interface HighlightOptions {
18
42
  /** Unique identifier for the highlight, required if you want to remove the highlight later */
19
43
  id?: string;
@@ -29,19 +53,8 @@ interface HighlightOptions {
29
53
  focusStyles?: Record<string, string>;
30
54
  /** Keyframes required for animations */
31
55
  keyframes?: string;
32
- /** Menu items to show when the highlight is selected */
33
- menu?: {
34
- /** Unique identifier for the menu item */
35
- id: string;
36
- /** Title of the menu item */
37
- title: string;
38
- /** Description of the menu item */
39
- description?: string;
40
- /** Name for a channel event to trigger when the menu item is clicked */
41
- clickEvent?: string;
42
- /** HTML selectors for which this menu item should show (subset of `selectors`) */
43
- selectors?: string[];
44
- }[];
56
+ /** Groups of menu items to show when the highlight is selected */
57
+ menu?: HighlightMenuItem[][];
45
58
  }
46
59
  interface ClickEventDetails {
47
60
  top: number;
@@ -57,4 +70,4 @@ interface ClickEventDetails {
57
70
  };
58
71
  }
59
72
 
60
- export { type ClickEventDetails, HIGHLIGHT, type HighlightOptions, type HighlightParameters, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
73
+ export { type ClickEventDetails, HIGHLIGHT, type HighlightMenuItem, type HighlightOptions, type HighlightParameters, REMOVE_HIGHLIGHT, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
@@ -1,8 +1,8 @@
1
1
  // src/highlight/constants.ts
2
- var t = "storybook/highlight", o = `${t}/add`, H = `${t}/remove`, e = `${t}/reset`, I = `${t}/scroll-into-view`;
2
+ var t = "storybook/highlight", o = `${t}/add`, e = `${t}/remove`, H = `${t}/reset`, I = `${t}/scroll-into-view`;
3
3
  export {
4
4
  o as HIGHLIGHT,
5
- H as REMOVE_HIGHLIGHT,
6
- e as RESET_HIGHLIGHT,
5
+ e as REMOVE_HIGHLIGHT,
6
+ H as RESET_HIGHLIGHT,
7
7
  I as SCROLL_INTO_VIEW
8
8
  };