storybook-addon-pseudo-states 1.15.2 → 1.15.3

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.
@@ -1,129 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.withPseudoState = void 0;
7
- var _addons = require("@storybook/addons");
8
- var _coreEvents = require("@storybook/core-events");
9
- var _constants = require("./constants");
10
- var _rewriteStyleSheet = require("./rewriteStyleSheet");
11
- /* eslint-env browser */
12
-
13
- const channel = _addons.addons.getChannel();
14
- const shadowHosts = new Set();
15
-
16
- // Drops any existing pseudo state classnames that carried over from a previously viewed story
17
- // before adding the new classnames. We do this the old-fashioned way, for IE compatibility.
18
- const applyClasses = (element, classnames) => {
19
- element.className = element.className.split(" ").filter(classname => classname && classname.indexOf("pseudo-") !== 0).concat(...classnames).join(" ");
20
- };
21
- const applyParameter = (rootElement, parameter) => {
22
- const map = new Map([[rootElement, new Set()]]);
23
- const add = (target, state) => map.set(target, new Set([...(map.get(target) || []), state]));
24
- Object.entries(parameter || {}).forEach(_ref => {
25
- let [state, value] = _ref;
26
- if (typeof value === "boolean") {
27
- // default API - applying pseudo class to root element.
28
- add(rootElement, value && state);
29
- } else if (typeof value === "string") {
30
- // explicit selectors API - applying pseudo class to a specific element
31
- rootElement.querySelectorAll(value).forEach(el => add(el, state));
32
- } else if (Array.isArray(value)) {
33
- // explicit selectors API - we have an array (of strings) recursively handle each one
34
- value.forEach(sel => rootElement.querySelectorAll(sel).forEach(el => add(el, state)));
35
- }
36
- });
37
- map.forEach((states, target) => {
38
- const classnames = [];
39
- states.forEach(key => _constants.PSEUDO_STATES[key] && classnames.push(`pseudo-${_constants.PSEUDO_STATES[key]}`));
40
- applyClasses(target, classnames);
41
- });
42
- };
43
-
44
- // Traverses ancestry to collect relevant pseudo classnames, and applies them to the shadow host.
45
- // Shadow DOM can only access classes on its host. Traversing is needed to mimic the CSS cascade.
46
- const updateShadowHost = shadowHost => {
47
- const classnames = new Set();
48
- for (let element = shadowHost.parentElement; element; element = element.parentElement) {
49
- if (!element.className) continue;
50
- element.className.split(" ").filter(classname => classname.indexOf("pseudo-") === 0).forEach(classname => classnames.add(classname));
51
- }
52
- applyClasses(shadowHost, classnames);
53
- };
54
-
55
- // Global decorator that rewrites stylesheets and applies classnames to render pseudo styles
56
- const withPseudoState = (StoryFn, _ref2) => {
57
- let {
58
- viewMode,
59
- parameters,
60
- id,
61
- globals: globalsArgs
62
- } = _ref2;
63
- const {
64
- pseudo: parameter
65
- } = parameters;
66
- const {
67
- pseudo: globals
68
- } = globalsArgs;
69
-
70
- // Sync parameter to globals, used by the toolbar (only in canvas as this
71
- // doesn't make sense for docs because many stories are displayed at once)
72
- (0, _addons.useEffect)(() => {
73
- if (parameter !== globals && viewMode === "story") {
74
- channel.emit(_coreEvents.UPDATE_GLOBALS, {
75
- globals: {
76
- pseudo: parameter
77
- }
78
- });
79
- }
80
- }, [parameter, viewMode]);
81
-
82
- // Convert selected states to classnames and apply them to the story root element.
83
- // Then update each shadow host to redetermine its own pseudo classnames.
84
- (0, _addons.useEffect)(() => {
85
- const timeout = setTimeout(() => {
86
- const element = document.getElementById(viewMode === "docs" ? `story--${id}` : `root`);
87
- applyParameter(element, globals || parameter);
88
- shadowHosts.forEach(updateShadowHost);
89
- }, 0);
90
- return () => clearTimeout(timeout);
91
- }, [globals, parameter, viewMode]);
92
- return StoryFn();
93
- };
94
-
95
- // Rewrite CSS rules for pseudo-states on all stylesheets to add an alternative selector
96
- exports.withPseudoState = withPseudoState;
97
- const rewriteStyleSheets = shadowRoot => {
98
- let styleSheets = shadowRoot ? shadowRoot.styleSheets : document.styleSheets;
99
- if (shadowRoot?.adoptedStyleSheets?.length) styleSheets = shadowRoot.adoptedStyleSheets;
100
- Array.from(styleSheets).forEach(sheet => (0, _rewriteStyleSheet.rewriteStyleSheet)(sheet, shadowRoot, shadowHosts));
101
- };
102
-
103
- // Only track shadow hosts for the current story
104
- channel.on(_coreEvents.STORY_CHANGED, () => shadowHosts.clear());
105
-
106
- // Reinitialize CSS enhancements every time the story changes
107
- channel.on(_coreEvents.STORY_RENDERED, () => rewriteStyleSheets());
108
-
109
- // Reinitialize CSS enhancements every time a docs page is rendered
110
- channel.on(_coreEvents.DOCS_RENDERED, () => rewriteStyleSheets());
111
-
112
- // IE doesn't support shadow DOM
113
- if (Element.prototype.attachShadow) {
114
- // Monkeypatch the attachShadow method so we can handle pseudo styles inside shadow DOM
115
- Element.prototype._attachShadow = Element.prototype.attachShadow;
116
- Element.prototype.attachShadow = function attachShadow(init) {
117
- // Force "open" mode, so we can access the shadowRoot
118
- const shadowRoot = this._attachShadow({
119
- ...init,
120
- mode: "open"
121
- });
122
- // Wait for it to render and apply its styles before rewriting them
123
- requestAnimationFrame(() => {
124
- rewriteStyleSheets(shadowRoot);
125
- updateShadowHost(shadowRoot.host);
126
- });
127
- return shadowRoot;
128
- };
129
- }
@@ -1,63 +0,0 @@
1
- import React, { useCallback, useMemo } from "react";
2
- import { useGlobals } from "@storybook/api";
3
- import { Icons, IconButton, WithTooltip, TooltipLinkList } from "@storybook/components";
4
- import { styled, color } from "@storybook/theming";
5
- import { PSEUDO_STATES } from "./constants";
6
- const LinkTitle = styled.span(_ref => {
7
- let {
8
- active
9
- } = _ref;
10
- return {
11
- color: active ? color.secondary : "inherit"
12
- };
13
- });
14
- const LinkIcon = styled(Icons)(_ref2 => {
15
- let {
16
- active
17
- } = _ref2;
18
- return {
19
- opacity: active ? 1 : 0,
20
- path: {
21
- fill: active ? color.secondary : "inherit"
22
- }
23
- };
24
- });
25
- const options = Object.keys(PSEUDO_STATES).sort();
26
- export const PseudoStateTool = () => {
27
- const [{
28
- pseudo
29
- }, updateGlobals] = useGlobals();
30
- const isActive = useCallback(option => pseudo?.[option] === true, [pseudo]);
31
- const toggleOption = useCallback(option => () => updateGlobals({
32
- pseudo: {
33
- ...pseudo,
34
- [option]: !isActive(option)
35
- }
36
- }), [pseudo]);
37
- return /*#__PURE__*/React.createElement(WithTooltip, {
38
- placement: "top",
39
- trigger: "click",
40
- tooltip: () => /*#__PURE__*/React.createElement(TooltipLinkList, {
41
- links: options.map(option => ({
42
- id: option,
43
- title: /*#__PURE__*/React.createElement(LinkTitle, {
44
- active: isActive(option)
45
- }, ":", PSEUDO_STATES[option]),
46
- right: /*#__PURE__*/React.createElement(LinkIcon, {
47
- icon: "check",
48
- width: 12,
49
- height: 12,
50
- active: isActive(option)
51
- }),
52
- onClick: toggleOption(option),
53
- active: isActive(option)
54
- }))
55
- })
56
- }, /*#__PURE__*/React.createElement(IconButton, {
57
- key: "pseudo-state",
58
- title: "Select CSS pseudo states",
59
- active: options.some(isActive)
60
- }, /*#__PURE__*/React.createElement(Icons, {
61
- icon: "button"
62
- })));
63
- };
@@ -1,20 +0,0 @@
1
- export const ADDON_ID = "storybook/pseudo-states";
2
- export const TOOL_ID = `${ADDON_ID}/tool`;
3
-
4
- // Pseudo-elements which are not allowed to have classes applied on them
5
- // E.g. ::-webkit-scrollbar-thumb.pseudo-hover is not a valid selector
6
- export const EXCLUDED_PSEUDO_ELEMENTS = ["::-webkit-scrollbar-thumb"];
7
-
8
- // Dynamic pseudo-classes
9
- // @see https://www.w3.org/TR/2018/REC-selectors-3-20181106/#dynamic-pseudos
10
- export const PSEUDO_STATES = {
11
- hover: "hover",
12
- active: "active",
13
- focusVisible: "focus-visible",
14
- focusWithin: "focus-within",
15
- focus: "focus",
16
- // must come after its alternatives
17
- visited: "visited",
18
- link: "link",
19
- target: "target"
20
- };
@@ -1,16 +0,0 @@
1
- import { addons, types } from "@storybook/addons";
2
- import { ADDON_ID, TOOL_ID } from "../constants";
3
- import { PseudoStateTool } from "../PseudoStateTool";
4
- addons.register(ADDON_ID, () => {
5
- addons.add(TOOL_ID, {
6
- type: types.TOOL,
7
- title: "CSS pseudo states",
8
- match: _ref => {
9
- let {
10
- viewMode
11
- } = _ref;
12
- return viewMode === "story";
13
- },
14
- render: PseudoStateTool
15
- });
16
- });
@@ -1,2 +0,0 @@
1
- import { withPseudoState } from "../withPseudoState";
2
- export const decorators = [withPseudoState];
@@ -1,67 +0,0 @@
1
- import { PSEUDO_STATES, EXCLUDED_PSEUDO_ELEMENTS } from "./constants";
2
- import { splitSelectors } from "./splitSelectors";
3
- const pseudoStates = Object.values(PSEUDO_STATES);
4
- const matchOne = new RegExp(`:(${pseudoStates.join("|")})`);
5
- const matchAll = new RegExp(`:(${pseudoStates.join("|")})`, "g");
6
- const warnings = new Set();
7
- const warnOnce = message => {
8
- if (warnings.has(message)) return;
9
- // eslint-disable-next-line no-console
10
- console.warn(message);
11
- warnings.add(message);
12
- };
13
- const isExcludedPseudoElement = (selector, pseudoState) => EXCLUDED_PSEUDO_ELEMENTS.some(element => selector.endsWith(`${element}:${pseudoState}`));
14
- const rewriteRule = (cssText, selectorText, shadowRoot) => {
15
- return cssText.replace(selectorText, splitSelectors(selectorText).flatMap(selector => {
16
- if (selector.includes(".pseudo-")) {
17
- return [];
18
- }
19
- if (!matchOne.test(selector)) {
20
- return [selector];
21
- }
22
- const states = [];
23
- const plainSelector = selector.replace(matchAll, (_, state) => {
24
- states.push(state);
25
- return "";
26
- });
27
- const classSelector = states.reduce((acc, state) => !isExcludedPseudoElement(selector, state) && acc.replace(new RegExp(`(?<!Y):${state}`, "g"), `.pseudo-${state}`), selector);
28
- if (selector.startsWith(":host(") || selector.startsWith("::slotted(")) {
29
- return [selector, classSelector].filter(Boolean);
30
- }
31
- const ancestorSelector = shadowRoot ? `:host(${states.map(s => `.pseudo-${s}`).join("")}) ${plainSelector}` : `${states.map(s => `.pseudo-${s}`).join("")} ${plainSelector}`;
32
- return [selector, classSelector, ancestorSelector].filter(selector => selector && !selector.includes(":not()"));
33
- }).join(", "));
34
- };
35
-
36
- // Rewrites the style sheet to add alternative selectors for any rule that targets a pseudo state.
37
- // A sheet can only be rewritten once, and may carry over between stories.
38
- export const rewriteStyleSheet = (sheet, shadowRoot, shadowHosts) => {
39
- if (sheet.__pseudoStatesRewritten) return;
40
- sheet.__pseudoStatesRewritten = true;
41
- try {
42
- let index = 0;
43
- for (const {
44
- cssText,
45
- selectorText
46
- } of sheet.cssRules) {
47
- if (matchOne.test(selectorText)) {
48
- const newRule = rewriteRule(cssText, selectorText, shadowRoot);
49
- sheet.deleteRule(index);
50
- sheet.insertRule(newRule, index);
51
- if (shadowRoot) shadowHosts.add(shadowRoot.host);
52
- }
53
- index++;
54
- if (index > 1000) {
55
- warnOnce("Reached maximum of 1000 pseudo selectors per sheet, skipping the rest.");
56
- break;
57
- }
58
- }
59
- } catch (e) {
60
- if (e.toString().includes("cssRules")) {
61
- warnOnce(`Can't access cssRules, likely due to CORS restrictions: ${sheet.href}`);
62
- } else {
63
- // eslint-disable-next-line no-console
64
- console.error(e, sheet.href);
65
- }
66
- }
67
- };
@@ -1,67 +0,0 @@
1
- import { rewriteStyleSheet } from "./rewriteStyleSheet";
2
- class Sheet {
3
- constructor() {
4
- this.__pseudoStatesRewritten = false;
5
- for (var _len = arguments.length, rules = new Array(_len), _key = 0; _key < _len; _key++) {
6
- rules[_key] = arguments[_key];
7
- }
8
- this.cssRules = rules.map(cssText => ({
9
- cssText,
10
- selectorText: cssText.slice(0, cssText.indexOf(" {"))
11
- }));
12
- }
13
- deleteRule(index) {
14
- this.cssRules.splice(index, 1);
15
- }
16
- insertRule(cssText, index) {
17
- this.cssRules.splice(index, 0, cssText);
18
- }
19
- }
20
- describe("rewriteStyleSheet", () => {
21
- it("adds alternative selector targeting the element directly", () => {
22
- const sheet = new Sheet("a:hover { color: red }");
23
- rewriteStyleSheet(sheet);
24
- expect(sheet.cssRules[0]).toContain("a.pseudo-hover");
25
- });
26
- it("adds alternative selector targeting an ancestor", () => {
27
- const sheet = new Sheet("a:hover { color: red }");
28
- rewriteStyleSheet(sheet);
29
- expect(sheet.cssRules[0]).toContain(".pseudo-hover a");
30
- });
31
- it("does not add .pseudo-<class> to pseudo-class, which does not support classes", () => {
32
- const sheet = new Sheet("::-webkit-scrollbar-thumb:hover { border-color: transparent; }");
33
- rewriteStyleSheet(sheet);
34
- console.log(sheet.cssRules[0]);
35
- expect(sheet.cssRules[0]).not.toContain("::-webkit-scrollbar-thumb.pseudo-hover");
36
- });
37
- it("adds alternative selector for each pseudo selector", () => {
38
- const sheet = new Sheet("a:hover, a:focus { color: red }");
39
- rewriteStyleSheet(sheet);
40
- expect(sheet.cssRules[0]).toContain("a.pseudo-hover");
41
- expect(sheet.cssRules[0]).toContain("a.pseudo-focus");
42
- expect(sheet.cssRules[0]).toContain(".pseudo-hover a");
43
- expect(sheet.cssRules[0]).toContain(".pseudo-focus a");
44
- });
45
- it("keeps non-pseudo selectors as-is", () => {
46
- const sheet = new Sheet("a.class, a:hover, a:focus, a#id { color: red }");
47
- rewriteStyleSheet(sheet);
48
- expect(sheet.cssRules[0]).toContain("a.class");
49
- expect(sheet.cssRules[0]).toContain("a#id");
50
- });
51
- it("supports combined pseudo selectors", () => {
52
- const sheet = new Sheet("a:hover:focus { color: red }");
53
- rewriteStyleSheet(sheet);
54
- expect(sheet.cssRules[0]).toContain("a.pseudo-hover.pseudo-focus");
55
- expect(sheet.cssRules[0]).toContain(".pseudo-hover.pseudo-focus a");
56
- });
57
- it('supports ":host"', () => {
58
- const sheet = new Sheet(":host(:hover) { color: red }");
59
- rewriteStyleSheet(sheet);
60
- expect(sheet.cssRules[0]).toEqual(":host(:hover), :host(.pseudo-hover) { color: red }");
61
- });
62
- it('supports ":not"', () => {
63
- const sheet = new Sheet(":not(:hover) { color: red }");
64
- rewriteStyleSheet(sheet);
65
- expect(sheet.cssRules[0]).toEqual(":not(:hover), :not(.pseudo-hover) { color: red }");
66
- });
67
- });
@@ -1,29 +0,0 @@
1
- const isAtRule = selector => selector.indexOf("@") === 0;
2
- export const splitSelectors = selectors => {
3
- if (isAtRule(selectors)) return [selectors];
4
- let result = [];
5
- let parentheses = 0;
6
- let brackets = 0;
7
- let selector = "";
8
- for (let i = 0, len = selectors.length; i < len; i++) {
9
- const char = selectors[i];
10
- if (char === "(") {
11
- parentheses += 1;
12
- } else if (char === ")") {
13
- parentheses -= 1;
14
- } else if (char === "[") {
15
- brackets += 1;
16
- } else if (char === "]") {
17
- brackets -= 1;
18
- } else if (char === ",") {
19
- if (!parentheses && !brackets) {
20
- result.push(selector.trim());
21
- selector = "";
22
- continue;
23
- }
24
- }
25
- selector += char;
26
- }
27
- result.push(selector.trim());
28
- return result;
29
- };
@@ -1,15 +0,0 @@
1
- import { splitSelectors } from "./splitSelectors";
2
- describe("splitSelectors", () => {
3
- test("handles basic selectors", () => {
4
- expect(splitSelectors(".a")).toEqual([".a"]);
5
- expect(splitSelectors(".a, .b")).toEqual([".a", ".b"]);
6
- });
7
- test("supports ::slotted and :is", () => {
8
- expect(splitSelectors("::slotted(:is(button, a):active)")).toEqual(["::slotted(:is(button, a):active)"]);
9
- expect(splitSelectors("::slotted(:is(button, a):active), ::slotted(:is(button, a):hover)")).toEqual(["::slotted(:is(button, a):active)", "::slotted(:is(button, a):hover)"]);
10
- });
11
- test("supports :host", () => {
12
- expect(splitSelectors(":host([type='secondary']) ::slotted(:is(button, a)), :host([type='primary']) ::slotted(:is(button, a):active)")).toEqual([":host([type='secondary']) ::slotted(:is(button, a))", ":host([type='primary']) ::slotted(:is(button, a):active)"]);
13
- expect(splitSelectors(":host([outline]) ::slotted(:is(button, a):focus-within:focus-visible:not(:active))")).toEqual([":host([outline]) ::slotted(:is(button, a):focus-within:focus-visible:not(:active))"]);
14
- });
15
- });
@@ -1,121 +0,0 @@
1
- /* eslint-env browser */
2
- import { addons, useEffect } from "@storybook/addons";
3
- import { DOCS_RENDERED, STORY_CHANGED, STORY_RENDERED, UPDATE_GLOBALS } from "@storybook/core-events";
4
- import { PSEUDO_STATES } from "./constants";
5
- import { rewriteStyleSheet } from "./rewriteStyleSheet";
6
- const channel = addons.getChannel();
7
- const shadowHosts = new Set();
8
-
9
- // Drops any existing pseudo state classnames that carried over from a previously viewed story
10
- // before adding the new classnames. We do this the old-fashioned way, for IE compatibility.
11
- const applyClasses = (element, classnames) => {
12
- element.className = element.className.split(" ").filter(classname => classname && classname.indexOf("pseudo-") !== 0).concat(...classnames).join(" ");
13
- };
14
- const applyParameter = (rootElement, parameter) => {
15
- const map = new Map([[rootElement, new Set()]]);
16
- const add = (target, state) => map.set(target, new Set([...(map.get(target) || []), state]));
17
- Object.entries(parameter || {}).forEach(_ref => {
18
- let [state, value] = _ref;
19
- if (typeof value === "boolean") {
20
- // default API - applying pseudo class to root element.
21
- add(rootElement, value && state);
22
- } else if (typeof value === "string") {
23
- // explicit selectors API - applying pseudo class to a specific element
24
- rootElement.querySelectorAll(value).forEach(el => add(el, state));
25
- } else if (Array.isArray(value)) {
26
- // explicit selectors API - we have an array (of strings) recursively handle each one
27
- value.forEach(sel => rootElement.querySelectorAll(sel).forEach(el => add(el, state)));
28
- }
29
- });
30
- map.forEach((states, target) => {
31
- const classnames = [];
32
- states.forEach(key => PSEUDO_STATES[key] && classnames.push(`pseudo-${PSEUDO_STATES[key]}`));
33
- applyClasses(target, classnames);
34
- });
35
- };
36
-
37
- // Traverses ancestry to collect relevant pseudo classnames, and applies them to the shadow host.
38
- // Shadow DOM can only access classes on its host. Traversing is needed to mimic the CSS cascade.
39
- const updateShadowHost = shadowHost => {
40
- const classnames = new Set();
41
- for (let element = shadowHost.parentElement; element; element = element.parentElement) {
42
- if (!element.className) continue;
43
- element.className.split(" ").filter(classname => classname.indexOf("pseudo-") === 0).forEach(classname => classnames.add(classname));
44
- }
45
- applyClasses(shadowHost, classnames);
46
- };
47
-
48
- // Global decorator that rewrites stylesheets and applies classnames to render pseudo styles
49
- export const withPseudoState = (StoryFn, _ref2) => {
50
- let {
51
- viewMode,
52
- parameters,
53
- id,
54
- globals: globalsArgs
55
- } = _ref2;
56
- const {
57
- pseudo: parameter
58
- } = parameters;
59
- const {
60
- pseudo: globals
61
- } = globalsArgs;
62
-
63
- // Sync parameter to globals, used by the toolbar (only in canvas as this
64
- // doesn't make sense for docs because many stories are displayed at once)
65
- useEffect(() => {
66
- if (parameter !== globals && viewMode === "story") {
67
- channel.emit(UPDATE_GLOBALS, {
68
- globals: {
69
- pseudo: parameter
70
- }
71
- });
72
- }
73
- }, [parameter, viewMode]);
74
-
75
- // Convert selected states to classnames and apply them to the story root element.
76
- // Then update each shadow host to redetermine its own pseudo classnames.
77
- useEffect(() => {
78
- const timeout = setTimeout(() => {
79
- const element = document.getElementById(viewMode === "docs" ? `story--${id}` : `root`);
80
- applyParameter(element, globals || parameter);
81
- shadowHosts.forEach(updateShadowHost);
82
- }, 0);
83
- return () => clearTimeout(timeout);
84
- }, [globals, parameter, viewMode]);
85
- return StoryFn();
86
- };
87
-
88
- // Rewrite CSS rules for pseudo-states on all stylesheets to add an alternative selector
89
- const rewriteStyleSheets = shadowRoot => {
90
- let styleSheets = shadowRoot ? shadowRoot.styleSheets : document.styleSheets;
91
- if (shadowRoot?.adoptedStyleSheets?.length) styleSheets = shadowRoot.adoptedStyleSheets;
92
- Array.from(styleSheets).forEach(sheet => rewriteStyleSheet(sheet, shadowRoot, shadowHosts));
93
- };
94
-
95
- // Only track shadow hosts for the current story
96
- channel.on(STORY_CHANGED, () => shadowHosts.clear());
97
-
98
- // Reinitialize CSS enhancements every time the story changes
99
- channel.on(STORY_RENDERED, () => rewriteStyleSheets());
100
-
101
- // Reinitialize CSS enhancements every time a docs page is rendered
102
- channel.on(DOCS_RENDERED, () => rewriteStyleSheets());
103
-
104
- // IE doesn't support shadow DOM
105
- if (Element.prototype.attachShadow) {
106
- // Monkeypatch the attachShadow method so we can handle pseudo styles inside shadow DOM
107
- Element.prototype._attachShadow = Element.prototype.attachShadow;
108
- Element.prototype.attachShadow = function attachShadow(init) {
109
- // Force "open" mode, so we can access the shadowRoot
110
- const shadowRoot = this._attachShadow({
111
- ...init,
112
- mode: "open"
113
- });
114
- // Wait for it to render and apply its styles before rewriting them
115
- requestAnimationFrame(() => {
116
- rewriteStyleSheets(shadowRoot);
117
- updateShadowHost(shadowRoot.host);
118
- });
119
- return shadowRoot;
120
- };
121
- }
package/preset.js DELETED
@@ -1,9 +0,0 @@
1
- function managerEntries(entry = []) {
2
- return [...entry, require.resolve("./dist/esm/preset/manager")]
3
- }
4
-
5
- function config(entry = []) {
6
- return [...entry, require.resolve("./dist/esm/preset/preview")]
7
- }
8
-
9
- module.exports = { managerEntries, config };