@storybook/web-components 11.0.0-beta.5 → 11.0.0-rc.1

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.
@@ -11,7 +11,6 @@ __export(entry_preview_exports, {
11
11
  });
12
12
 
13
13
  // src/render.ts
14
- import { global } from "@storybook/global";
15
14
  import { render as litRender } from "lit";
16
15
  import { isTemplateResult } from "lit/directive-helpers.js";
17
16
  import { simulateDOMContentLoaded, simulatePageLoad } from "storybook/preview-api";
@@ -125,14 +124,14 @@ function styleRule(selector, value) {
125
124
  }
126
125
 
127
126
  // src/render.ts
128
- var { Node: Node2 } = global, render = (args, context) => {
127
+ var render = (args, context) => {
129
128
  let { id, component } = context;
130
129
  if (!component)
131
130
  throw new Error(
132
131
  `Unable to render story ${id} as the component annotation is missing from the default export`
133
132
  );
134
133
  let element = document.createElement(component);
135
- if (!global.FEATURES?.docgenServer)
134
+ if (!globalThis.FEATURES?.docgenServer)
136
135
  return Object.assign(element, args);
137
136
  let styleRules = bindArgs(element, args), fragment = document.createDocumentFragment();
138
137
  if (styleRules.length > 0) {
@@ -152,7 +151,7 @@ function renderToCanvas({ storyFn, title, name, showMain, showError, forceRemoun
152
151
  litRender(element, renderTo), simulatePageLoad(canvasElement);
153
152
  } else if (typeof element == "string")
154
153
  canvasElement.innerHTML = element, simulatePageLoad(canvasElement);
155
- else if (element instanceof Node2) {
154
+ else if (element instanceof globalThis.Node) {
156
155
  if (canvasElement.firstChild === element && !forceRemount)
157
156
  return;
158
157
  canvasElement.innerHTML = "", canvasElement.appendChild(element), simulateDOMContentLoaded();
@@ -1,20 +1,14 @@
1
1
  import {
2
2
  entry_preview_exports
3
- } from "./chunk-XOX44XZE.js";
3
+ } from "./chunk-4V46YO6H.js";
4
4
  import {
5
5
  entry_preview_docs_exports
6
6
  } from "./chunk-YZWJIPOA.js";
7
7
 
8
- // src/index.ts
9
- import { global as global3 } from "@storybook/global";
10
-
11
8
  // src/globals.ts
12
- import { global } from "@storybook/global";
13
- var { window: globalWindow } = global;
14
- globalWindow.STORYBOOK_ENV = "web-components";
9
+ globalThis.STORYBOOK_ENV = "web-components";
15
10
 
16
11
  // src/framework-api.ts
17
- import { global as global2 } from "@storybook/global";
18
12
  import { deprecate } from "storybook/internal/client-logger";
19
13
  var RUNTIME_MANIFEST_DEPRECATION = "The runtime Custom Elements Manifest is deprecated and will be removed in Storybook 12. Set framework.options.customElementsManifest in .storybook/main and enable features.docgenServer instead.";
20
14
  function isValidComponent(tagName) {
@@ -34,13 +28,13 @@ function isValidMetaData(customElements) {
34
28
  );
35
29
  }
36
30
  function setCustomElements(customElements) {
37
- deprecate(`setCustomElements() is deprecated: ${RUNTIME_MANIFEST_DEPRECATION}`), global2.__STORYBOOK_CUSTOM_ELEMENTS__ = customElements;
31
+ deprecate(`setCustomElements() is deprecated: ${RUNTIME_MANIFEST_DEPRECATION}`), globalThis.__STORYBOOK_CUSTOM_ELEMENTS__ = customElements;
38
32
  }
39
33
  function setCustomElementsManifest(customElements) {
40
- deprecate(`setCustomElementsManifest() is deprecated: ${RUNTIME_MANIFEST_DEPRECATION}`), global2.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__ = customElements;
34
+ deprecate(`setCustomElementsManifest() is deprecated: ${RUNTIME_MANIFEST_DEPRECATION}`), globalThis.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__ = customElements;
41
35
  }
42
36
  function getCustomElements() {
43
- return global2.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__ || global2.__STORYBOOK_CUSTOM_ELEMENTS__;
37
+ return globalThis.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__ || globalThis.__STORYBOOK_CUSTOM_ELEMENTS__;
44
38
  }
45
39
 
46
40
  // src/portable-stories.ts
@@ -68,11 +62,10 @@ function __definePreview(input) {
68
62
  }
69
63
 
70
64
  // src/index.ts
71
- var { window, EventSource } = global3;
72
- typeof module < "u" && module?.hot?.decline && (module.hot.decline(), new EventSource("__webpack_hmr").addEventListener("message", function(event) {
65
+ typeof module < "u" && module?.hot?.decline && (module.hot.decline(), new globalThis.EventSource("__webpack_hmr").addEventListener("message", function(event) {
73
66
  try {
74
67
  let { action } = JSON.parse(event.data);
75
- action === "built" && window.location.reload();
68
+ action === "built" && globalThis.window.location.reload();
76
69
  } catch {
77
70
  }
78
71
  }));
@@ -2,8 +2,8 @@ import {
2
2
  getCustomElements,
3
3
  isValidComponent,
4
4
  isValidMetaData
5
- } from "./_browser-chunks/chunk-OL6OKC2Z.js";
6
- import "./_browser-chunks/chunk-XOX44XZE.js";
5
+ } from "./_browser-chunks/chunk-OP7DF6LE.js";
6
+ import "./_browser-chunks/chunk-4V46YO6H.js";
7
7
  import "./_browser-chunks/chunk-YZWJIPOA.js";
8
8
  import "./_browser-chunks/chunk-4BE7D4DS.js";
9
9
 
@@ -2,7 +2,7 @@ import {
2
2
  parameters,
3
3
  render,
4
4
  renderToCanvas
5
- } from "./_browser-chunks/chunk-XOX44XZE.js";
5
+ } from "./_browser-chunks/chunk-4V46YO6H.js";
6
6
  import "./_browser-chunks/chunk-4BE7D4DS.js";
7
7
  export {
8
8
  parameters,
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import {
6
6
  setCustomElements,
7
7
  setCustomElementsManifest,
8
8
  setProjectAnnotations
9
- } from "./_browser-chunks/chunk-OL6OKC2Z.js";
10
- import "./_browser-chunks/chunk-XOX44XZE.js";
9
+ } from "./_browser-chunks/chunk-OP7DF6LE.js";
10
+ import "./_browser-chunks/chunk-4V46YO6H.js";
11
11
  import "./_browser-chunks/chunk-YZWJIPOA.js";
12
12
  import "./_browser-chunks/chunk-4BE7D4DS.js";
13
13
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/web-components",
3
- "version": "11.0.0-beta.5",
3
+ "version": "11.0.0-rc.1",
4
4
  "description": "Storybook Web Components renderer: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -53,7 +53,6 @@
53
53
  "!src/**/*"
54
54
  ],
55
55
  "dependencies": {
56
- "@storybook/global": "^5.0.0",
57
56
  "@wc-toolkit/cem-generator": "^0.2.1",
58
57
  "@wc-toolkit/cem-generator-lit": "^0.1.16",
59
58
  "custom-elements-manifest": "^2.1.0",
@@ -74,7 +73,7 @@
74
73
  },
75
74
  "peerDependencies": {
76
75
  "lit": "^2.0.0 || ^3.0.0",
77
- "storybook": "^11.0.0-beta.5",
76
+ "storybook": "^11.0.0-rc.1",
78
77
  "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
79
78
  },
80
79
  "publishConfig": {
@@ -1,5 +1,3 @@
1
- import { global as globalThis } from '@storybook/global';
2
-
3
1
  import { LitElement, html } from 'lit';
4
2
 
5
3
  const { CustomEvent, customElements } = globalThis;
@@ -1,5 +1,3 @@
1
- import { global as globalThis } from '@storybook/global';
2
-
3
1
  import { LitElement, html } from 'lit';
4
2
 
5
3
  const { CustomEvent, customElements } = globalThis;
@@ -1,5 +1,3 @@
1
- import { global as globalThis } from '@storybook/global';
2
-
3
1
  import { LitElement } from 'lit';
4
2
 
5
3
  const { customElements } = globalThis;
@@ -1,5 +1,3 @@
1
- import { global as globalThis } from '@storybook/global';
2
-
3
1
  import { LitElement, html } from 'lit';
4
2
  import { styleMap } from 'lit/directives/style-map.js';
5
3
 
@@ -1,5 +1,3 @@
1
- import { global as globalThis } from '@storybook/global';
2
-
3
1
  import { ButtonTag } from './Button';
4
2
  import { FormTag } from './Form';
5
3
  import { HtmlTag } from './Html';
@@ -1,11 +1,7 @@
1
- import { global } from '@storybook/global';
2
-
3
1
  import { LitElement, html } from 'lit';
4
2
 
5
3
  import { demoWcCardStyle } from './demoWcCardStyle.css.js';
6
4
 
7
- const { CustomEvent } = global;
8
-
9
5
  /**
10
6
  * This is a container looking like a card with a back and front side you can switch
11
7
  *