storybook 9.0.0-alpha.20 → 9.0.0-alpha.21

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.
Files changed (72) hide show
  1. package/assets/server/base-preview-head.html +1 -3
  2. package/dist/actions/decorator.js +34 -38
  3. package/dist/actions/index.cjs +1 -4
  4. package/dist/actions/index.js +1 -4
  5. package/dist/actions/preview.cjs +1 -4
  6. package/dist/actions/preview.js +1 -4
  7. package/dist/babel/index.cjs +822 -816
  8. package/dist/babel/index.js +822 -816
  9. package/dist/backgrounds/index.cjs +16 -16
  10. package/dist/backgrounds/index.js +14 -14
  11. package/dist/backgrounds/preview.cjs +34 -34
  12. package/dist/backgrounds/preview.js +29 -29
  13. package/dist/bin/index.cjs +67 -65
  14. package/dist/bin/index.js +61 -59
  15. package/dist/builder-manager/index.cjs +482 -472
  16. package/dist/builder-manager/index.js +283 -273
  17. package/dist/channels/index.js +941 -919
  18. package/dist/cli/bin/index.cjs +1 -1
  19. package/dist/cli/bin/index.js +1 -1
  20. package/dist/cli/index.cjs +61752 -7591
  21. package/dist/cli/index.d.ts +22 -14
  22. package/dist/cli/index.js +61775 -7614
  23. package/dist/common/index.cjs +16015 -8979
  24. package/dist/common/index.d.ts +30 -1
  25. package/dist/common/index.js +16105 -9063
  26. package/dist/components/index.cjs +3694 -3643
  27. package/dist/components/index.d.ts +5 -2
  28. package/dist/components/index.js +2352 -2294
  29. package/dist/core-server/index.cjs +3540 -3540
  30. package/dist/core-server/index.js +730 -730
  31. package/dist/core-server/presets/common-manager.js +2642 -2592
  32. package/dist/core-server/presets/common-preset.cjs +723 -715
  33. package/dist/core-server/presets/common-preset.js +10 -2
  34. package/dist/docs-tools/index.js +640 -632
  35. package/dist/highlight/index.cjs +16 -16
  36. package/dist/highlight/index.d.ts +45 -1
  37. package/dist/highlight/index.js +2 -2
  38. package/dist/highlight/preview.cjs +522 -68
  39. package/dist/highlight/preview.js +508 -56
  40. package/dist/instrumenter/index.js +1179 -1170
  41. package/dist/manager/globals-module-info.cjs +1 -0
  42. package/dist/manager/globals-module-info.js +1 -0
  43. package/dist/manager/globals-runtime.js +19385 -19190
  44. package/dist/manager/runtime.js +2084 -2079
  45. package/dist/manager-api/index.cjs +352 -352
  46. package/dist/manager-api/index.js +1694 -1663
  47. package/dist/manager-errors.js +41 -37
  48. package/dist/measure/index.cjs +99 -97
  49. package/dist/measure/index.js +95 -93
  50. package/dist/measure/preview.cjs +127 -125
  51. package/dist/measure/preview.js +125 -123
  52. package/dist/outline/index.cjs +41 -41
  53. package/dist/outline/index.js +12 -12
  54. package/dist/outline/preview.cjs +23 -23
  55. package/dist/outline/preview.js +7 -7
  56. package/dist/preview/runtime.js +13577 -12959
  57. package/dist/preview-api/index.cjs +0 -1
  58. package/dist/preview-api/index.d.ts +120 -385
  59. package/dist/preview-api/index.js +827 -812
  60. package/dist/preview-errors.cjs +65 -51
  61. package/dist/preview-errors.d.ts +6 -2
  62. package/dist/preview-errors.js +176 -142
  63. package/dist/server-errors.cjs +105 -72
  64. package/dist/server-errors.d.ts +9 -1
  65. package/dist/server-errors.js +87 -54
  66. package/dist/telemetry/index.cjs +374 -370
  67. package/dist/telemetry/index.js +460 -456
  68. package/dist/test/index.js +9831 -9743
  69. package/dist/test/preview.d.ts +0 -6
  70. package/dist/test/preview.js +3628 -3568
  71. package/dist/types/index.d.ts +72 -6
  72. package/package.json +1 -1
@@ -1,27 +1,27 @@
1
1
  "use strict";
2
- var H = Object.defineProperty;
3
- var T = Object.getOwnPropertyDescriptor;
2
+ var I = Object.defineProperty;
3
+ var G = Object.getOwnPropertyDescriptor;
4
4
  var _ = Object.getOwnPropertyNames;
5
- var i = Object.prototype.hasOwnProperty;
6
- var x = (o, t) => {
7
- for (var r in t)
8
- H(o, r, { get: t[r], enumerable: !0 });
9
- }, E = (o, t, r, s) => {
5
+ var n = Object.prototype.hasOwnProperty;
6
+ var L = (o, t) => {
7
+ for (var H in t)
8
+ I(o, H, { get: t[H], enumerable: !0 });
9
+ }, T = (o, t, H, s) => {
10
10
  if (t && typeof t == "object" || typeof t == "function")
11
11
  for (let e of _(t))
12
- !i.call(o, e) && e !== r && H(o, e, { get: () => t[e], enumerable: !(s = T(t, e)) || s.enumerable });
12
+ !n.call(o, e) && e !== H && I(o, e, { get: () => t[e], enumerable: !(s = G(t, e)) || s.enumerable });
13
13
  return o;
14
14
  };
15
- var c = (o) => E(H({}, "__esModule", { value: !0 }), o);
15
+ var c = (o) => T(I({}, "__esModule", { value: !0 }), o);
16
16
 
17
17
  // src/highlight/index.ts
18
- var h = {};
19
- x(h, {
20
- HIGHLIGHT: () => p,
21
- RESET_HIGHLIGHT: () => G,
22
- SCROLL_INTO_VIEW: () => L
18
+ var x = {};
19
+ L(x, {
20
+ HIGHLIGHT: () => i,
21
+ RESET_HIGHLIGHT: () => p,
22
+ SCROLL_INTO_VIEW: () => E
23
23
  });
24
- module.exports = c(h);
24
+ module.exports = c(x);
25
25
 
26
26
  // src/highlight/constants.ts
27
- var I = "storybook/highlight", p = `${I}/add`, G = `${I}/reset`, L = `${I}/scroll-into-view`;
27
+ var r = "storybook/highlight", i = `${r}/add`, l = `${r}/remove`, p = `${r}/reset`, E = `${r}/scroll-into-view`;
@@ -13,5 +13,49 @@ interface HighlightParameters {
13
13
  disable?: boolean;
14
14
  };
15
15
  }
16
+ interface HighlightOptions {
17
+ /** Unique identifier for the highlight, required if you want to remove the highlight later */
18
+ id?: string;
19
+ /** HTML selectors of the elements */
20
+ selectors: string[];
21
+ /** Priority of the highlight, higher takes precedence, defaults to 0 */
22
+ priority?: number;
23
+ /** Whether the highlight is selectable (reveals the element's HTML) */
24
+ selectable?: boolean;
25
+ /** CSS styles to apply to the highlight */
26
+ styles: Record<string, string>;
27
+ /** CSS styles to apply to the highlight when it is hovered */
28
+ hoverStyles?: Record<string, string>;
29
+ /** CSS styles to apply to the highlight when it is focused or selected */
30
+ focusStyles?: Record<string, string>;
31
+ /** Keyframes required for animations */
32
+ keyframes?: string;
33
+ /** Menu items to show when the highlight is selected (implies selectable: true) */
34
+ menu?: {
35
+ /** Unique identifier for the menu item */
36
+ id: string;
37
+ /** Title of the menu item */
38
+ title: string;
39
+ /** Description of the menu item */
40
+ description?: string;
41
+ /** Name for a channel event to trigger when the menu item is clicked */
42
+ clickEvent?: string;
43
+ /** HTML selectors for which this menu item should show (subset of `selectors`) */
44
+ selectors?: string[];
45
+ }[];
46
+ }
47
+ interface ClickEventDetails {
48
+ top: number;
49
+ left: number;
50
+ width: number;
51
+ height: number;
52
+ selectors: string[];
53
+ element: {
54
+ attributes: Record<string, string>;
55
+ localName: string;
56
+ tagName: string;
57
+ outerHTML: string;
58
+ };
59
+ }
16
60
 
17
- export { HIGHLIGHT, type HighlightParameters, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
61
+ export { type ClickEventDetails, HIGHLIGHT, type HighlightOptions, type HighlightParameters, RESET_HIGHLIGHT, SCROLL_INTO_VIEW };
@@ -1,7 +1,7 @@
1
1
  // src/highlight/constants.ts
2
- var t = "storybook/highlight", o = `${t}/add`, e = `${t}/reset`, r = `${t}/scroll-into-view`;
2
+ var t = "storybook/highlight", o = `${t}/add`, r = `${t}/remove`, e = `${t}/reset`, H = `${t}/scroll-into-view`;
3
3
  export {
4
4
  o as HIGHLIGHT,
5
5
  e as RESET_HIGHLIGHT,
6
- r as SCROLL_INTO_VIEW
6
+ H as SCROLL_INTO_VIEW
7
7
  };