storybook 10.0.0-beta.4 → 10.0.0-beta.6
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.
- package/assets/server/openBrowser.applescript +94 -0
- package/dist/_browser-chunks/Color-KPLIACXP.js +1569 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-YY5GICNT.js → chunk-6E2SHJSL.js} +175 -32
- package/dist/_browser-chunks/{chunk-MZNYTCNT.js → chunk-AM4PZYVQ.js} +10 -63
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YWDKX534.js → chunk-FA42P6MO.js} +49 -4
- package/dist/_browser-chunks/chunk-G33S6YM3.js +521 -0
- package/dist/_browser-chunks/chunk-GJ67EE65.js +67 -0
- package/dist/_browser-chunks/{chunk-4QPX7WIQ.js → chunk-JJZMHC3A.js} +57 -166
- package/dist/_browser-chunks/{chunk-MD2FTHCZ.js → chunk-JVSKG4YS.js} +3 -16
- package/dist/_browser-chunks/{chunk-E7VLET3C.js → chunk-KSCAWCCE.js} +3947 -4291
- package/dist/_browser-chunks/chunk-QK3L5AXO.js +372 -0
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +20 -0
- package/dist/_browser-chunks/{chunk-T7RCAJIX.js → chunk-Y3M7TW6K.js} +43 -47
- package/dist/_browser-chunks/{chunk-PYK5ZTFK.js → chunk-YQV3EGQ5.js} +5 -5
- package/dist/_browser-chunks/{syntaxhighlighter-YYAA4CS4.js → syntaxhighlighter-RJW7FE3A.js} +3 -2
- package/dist/_node-chunks/{builder-manager-IKHPPPFE.js → builder-manager-V33CQT2M.js} +26 -151
- package/dist/_node-chunks/camelcase-BZ55OCHI.js +18 -0
- package/dist/_node-chunks/{chunk-5OILJTZE.js → chunk-2DMFI367.js} +7 -7
- package/dist/_node-chunks/{chunk-DCHFG5TX.js → chunk-4TOI4VSK.js} +7 -7
- package/dist/_node-chunks/{chunk-XA4TAMUS.js → chunk-55VWKF63.js} +710 -935
- package/dist/_node-chunks/{chunk-N3GFXZDP.js → chunk-5IEY46LQ.js} +7 -7
- package/dist/_node-chunks/{chunk-YRPXGWKW.js → chunk-6PTV7XGR.js} +8 -8
- package/dist/_node-chunks/{chunk-4FMOVB65.js → chunk-7NJGTQ3W.js} +223 -243
- package/dist/_node-chunks/{chunk-4VGW2SQA.js → chunk-7WH7AGOR.js} +7 -7
- package/dist/_node-chunks/{camelcase-O2O7JODG.js → chunk-A7CUP23N.js} +9 -8
- package/dist/_node-chunks/{chunk-XT6O5CVI.js → chunk-B3AMFGAL.js} +30 -21
- package/dist/_node-chunks/{chunk-IB5AEYPX.js → chunk-BNOZ3EKF.js} +7 -7
- package/dist/_node-chunks/{chunk-TTQRDWDJ.js → chunk-DC7OWBHB.js} +12 -12
- package/dist/_node-chunks/{chunk-3J7DQ6TI.js → chunk-E6TLN2J2.js} +7 -7
- package/dist/_node-chunks/{chunk-JP4LEAXM.js → chunk-EAOPWIKA.js} +623 -750
- package/dist/_node-chunks/{chunk-YJHXEN7U.js → chunk-EY5PTUZL.js} +583 -180
- package/dist/_node-chunks/{chunk-JSSBBVU5.js → chunk-F3PO67U3.js} +7 -7
- package/dist/_node-chunks/chunk-FDDJHDCE.js +62 -0
- package/dist/_node-chunks/{chunk-6COBULLV.js → chunk-HEBHWRWL.js} +162 -103
- package/dist/_node-chunks/{chunk-USDZSU5L.js → chunk-HPFXREVG.js} +7 -7
- package/dist/_node-chunks/{chunk-JECCFKKM.js → chunk-IINJT47N.js} +7 -7
- package/dist/_node-chunks/{chunk-OL2HWCBH.js → chunk-JNHUDBJL.js} +7 -7
- package/dist/_node-chunks/{chunk-NF3GXIEK.js → chunk-JOXYGIZK.js} +9 -9
- package/dist/_node-chunks/{chunk-NOSGJ5PL.js → chunk-MLBTKECD.js} +7 -7
- package/dist/_node-chunks/{chunk-TYGVOW7L.js → chunk-NJXBURX7.js} +8 -8
- package/dist/_node-chunks/{chunk-AXFNB3AN.js → chunk-NKZ4UPPV.js} +7 -7
- package/dist/_node-chunks/{chunk-HAVE6SGK.js → chunk-NUVGSFQI.js} +7 -7
- package/dist/_node-chunks/chunk-R5DIBOM6.js +18 -0
- package/dist/_node-chunks/{chunk-AC3BNULF.js → chunk-RIPA4LFD.js} +22 -22
- package/dist/_node-chunks/{chunk-TBAIXCHN.js → chunk-TJIMCNYJ.js} +8 -8
- package/dist/_node-chunks/{chunk-SF2IETZ2.js → chunk-UYKQJMQY.js} +36 -23
- package/dist/_node-chunks/{chunk-7IIAUEWB.js → chunk-VQH4ZFTS.js} +8 -8
- package/dist/_node-chunks/{chunk-FWFQ2GU7.js → chunk-VSC6LSCQ.js} +6 -6
- package/dist/_node-chunks/{chunk-MOO2Y4GI.js → chunk-XZTBG2TG.js} +6 -6
- package/dist/_node-chunks/{dist-BMKSKYDI.js → dist-CGGAYWME.js} +9 -9
- package/dist/_node-chunks/{globby-DASPUXWI.js → globby-3IFB7BJC.js} +17 -13
- package/dist/_node-chunks/{lib-L6BIH4EV.js → lib-IT6OBSID.js} +36 -12
- package/dist/_node-chunks/{mdx-N42X6CFJ-2COTUDSL.js → mdx-N42X6CFJ-WM36SSZ6.js} +8 -8
- package/dist/_node-chunks/{p-limit-HVR3I7TJ.js → p-limit-3V5XIKA7.js} +7 -7
- package/dist/_node-chunks/{plugin-FZOHPRK7.js → plugin-3YREMMJJ.js} +10 -10
- package/dist/_node-chunks/{plugin-2XPSFYWZ.js → plugin-GJUBUKCT.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-FGQM2EPC.js → webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js} +1307 -847
- package/dist/_node-chunks/{webpack-mock-plugin-4HOAIYSX.js → webpack-mock-plugin-XJNFAHBI.js} +9 -9
- package/dist/babel/index.d.ts +1 -1
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +638 -187
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.d.ts +61 -74
- package/dist/cli/index.js +56 -44
- package/dist/common/index.js +21 -21
- package/dist/components/index.js +27 -23
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +4545 -4115
- package/dist/core-server/presets/common-manager.js +507 -747
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -29
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.js +6 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +4 -4
- package/dist/instrumenter/index.js +1 -1
- package/dist/manager/globals-runtime.js +9164 -18083
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +12967 -11396
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +303 -64
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +1136 -661
- package/dist/preview/runtime.js +12068 -21585
- package/dist/preview-api/index.d.ts +68 -67
- package/dist/preview-api/index.js +6 -6
- package/dist/router/index.js +2 -2
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +1872 -4023
- package/dist/theming/index.d.ts +2 -2
- package/dist/theming/index.js +6 -6
- package/dist/types/index.d.ts +4 -0
- package/package.json +7 -6
- package/dist/_browser-chunks/Color-SFYJJKWL.js +0 -605
- package/dist/_browser-chunks/chunk-DHO2SA6L.js +0 -12
- package/dist/_browser-chunks/chunk-WPHPDNUA.js +0 -974
- package/dist/_node-chunks/chunk-CHJLO2LV.js +0 -62
- package/dist/_node-chunks/chunk-MNG223PY.js +0 -18
- package/dist/_node-chunks/default-browser-id-J4OIAAJ5.js +0 -1719
|
@@ -483,6 +483,8 @@ interface API_Shortcuts {
|
|
|
483
483
|
collapseAll: API_KeyCollection;
|
|
484
484
|
expandAll: API_KeyCollection;
|
|
485
485
|
remount: API_KeyCollection;
|
|
486
|
+
openInEditor: API_KeyCollection;
|
|
487
|
+
copyStoryLink: API_KeyCollection;
|
|
486
488
|
}
|
|
487
489
|
type API_Action = keyof API_Shortcuts;
|
|
488
490
|
interface API_AddonShortcut {
|
|
@@ -15,19 +15,22 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
dequal
|
|
17
17
|
} from "../_browser-chunks/chunk-2DK2T7MP.js";
|
|
18
|
+
import "../_browser-chunks/chunk-G33S6YM3.js";
|
|
19
|
+
import {
|
|
20
|
+
require_picocolors_browser
|
|
21
|
+
} from "../_browser-chunks/chunk-VUAFL5XK.js";
|
|
18
22
|
import {
|
|
19
23
|
mergeWith,
|
|
20
|
-
pick
|
|
21
|
-
|
|
24
|
+
pick,
|
|
25
|
+
toMerged
|
|
26
|
+
} from "../_browser-chunks/chunk-FA42P6MO.js";
|
|
22
27
|
import "../_browser-chunks/chunk-WKCVJYVJ.js";
|
|
23
28
|
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
toMerged
|
|
27
|
-
} from "../_browser-chunks/chunk-E7VLET3C.js";
|
|
29
|
+
mapValues
|
|
30
|
+
} from "../_browser-chunks/chunk-QK3L5AXO.js";
|
|
28
31
|
import {
|
|
29
32
|
isEqual
|
|
30
|
-
} from "../_browser-chunks/chunk-
|
|
33
|
+
} from "../_browser-chunks/chunk-JJZMHC3A.js";
|
|
31
34
|
import {
|
|
32
35
|
require_memoizerific
|
|
33
36
|
} from "../_browser-chunks/chunk-NVV6MIOE.js";
|
|
@@ -41,22 +44,147 @@ import {
|
|
|
41
44
|
__toESM
|
|
42
45
|
} from "../_browser-chunks/chunk-MM7DTO55.js";
|
|
43
46
|
|
|
44
|
-
// ../node_modules/
|
|
45
|
-
var
|
|
46
|
-
"../node_modules/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
// ../node_modules/toggle-selection/index.js
|
|
48
|
+
var require_toggle_selection = __commonJS({
|
|
49
|
+
"../node_modules/toggle-selection/index.js"(exports, module) {
|
|
50
|
+
module.exports = function() {
|
|
51
|
+
var selection = document.getSelection();
|
|
52
|
+
if (!selection.rangeCount) {
|
|
53
|
+
return function() {
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var active = document.activeElement;
|
|
57
|
+
var ranges = [];
|
|
58
|
+
for (var i = 0; i < selection.rangeCount; i++) {
|
|
59
|
+
ranges.push(selection.getRangeAt(i));
|
|
60
|
+
}
|
|
61
|
+
switch (active.tagName.toUpperCase()) {
|
|
62
|
+
// .toUpperCase handles XHTML
|
|
63
|
+
case "INPUT":
|
|
64
|
+
case "TEXTAREA":
|
|
65
|
+
active.blur();
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
active = null;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
selection.removeAllRanges();
|
|
72
|
+
return function() {
|
|
73
|
+
selection.type === "Caret" && selection.removeAllRanges();
|
|
74
|
+
if (!selection.rangeCount) {
|
|
75
|
+
ranges.forEach(function(range) {
|
|
76
|
+
selection.addRange(range);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
active && active.focus();
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// ../node_modules/copy-to-clipboard/index.js
|
|
86
|
+
var require_copy_to_clipboard = __commonJS({
|
|
87
|
+
"../node_modules/copy-to-clipboard/index.js"(exports, module) {
|
|
88
|
+
"use strict";
|
|
89
|
+
var deselectCurrent = require_toggle_selection();
|
|
90
|
+
var clipboardToIE11Formatting = {
|
|
91
|
+
"text/plain": "Text",
|
|
92
|
+
"text/html": "Url",
|
|
93
|
+
"default": "Text"
|
|
94
|
+
};
|
|
95
|
+
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
96
|
+
function format(message) {
|
|
97
|
+
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C";
|
|
98
|
+
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
99
|
+
}
|
|
100
|
+
__name(format, "format");
|
|
101
|
+
function copy2(text, options) {
|
|
102
|
+
var debug, message, reselectPrevious, range, selection, mark, success = false;
|
|
103
|
+
if (!options) {
|
|
104
|
+
options = {};
|
|
105
|
+
}
|
|
106
|
+
debug = options.debug || false;
|
|
107
|
+
try {
|
|
108
|
+
reselectPrevious = deselectCurrent();
|
|
109
|
+
range = document.createRange();
|
|
110
|
+
selection = document.getSelection();
|
|
111
|
+
mark = document.createElement("span");
|
|
112
|
+
mark.textContent = text;
|
|
113
|
+
mark.ariaHidden = "true";
|
|
114
|
+
mark.style.all = "unset";
|
|
115
|
+
mark.style.position = "fixed";
|
|
116
|
+
mark.style.top = 0;
|
|
117
|
+
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
118
|
+
mark.style.whiteSpace = "pre";
|
|
119
|
+
mark.style.webkitUserSelect = "text";
|
|
120
|
+
mark.style.MozUserSelect = "text";
|
|
121
|
+
mark.style.msUserSelect = "text";
|
|
122
|
+
mark.style.userSelect = "text";
|
|
123
|
+
mark.addEventListener("copy", function(e) {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
if (options.format) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
if (typeof e.clipboardData === "undefined") {
|
|
128
|
+
debug && console.warn("unable to use e.clipboardData");
|
|
129
|
+
debug && console.warn("trying IE specific stuff");
|
|
130
|
+
window.clipboardData.clearData();
|
|
131
|
+
var format2 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
|
|
132
|
+
window.clipboardData.setData(format2, text);
|
|
133
|
+
} else {
|
|
134
|
+
e.clipboardData.clearData();
|
|
135
|
+
e.clipboardData.setData(options.format, text);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (options.onCopy) {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
options.onCopy(e.clipboardData);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
document.body.appendChild(mark);
|
|
144
|
+
range.selectNodeContents(mark);
|
|
145
|
+
selection.addRange(range);
|
|
146
|
+
var successful = document.execCommand("copy");
|
|
147
|
+
if (!successful) {
|
|
148
|
+
throw new Error("copy command was unsuccessful");
|
|
149
|
+
}
|
|
150
|
+
success = true;
|
|
151
|
+
} catch (err) {
|
|
152
|
+
debug && console.error("unable to copy using execCommand: ", err);
|
|
153
|
+
debug && console.warn("trying IE specific stuff");
|
|
154
|
+
try {
|
|
155
|
+
window.clipboardData.setData(options.format || "text", text);
|
|
156
|
+
options.onCopy && options.onCopy(window.clipboardData);
|
|
157
|
+
success = true;
|
|
158
|
+
} catch (err2) {
|
|
159
|
+
debug && console.error("unable to copy using clipboardData: ", err2);
|
|
160
|
+
debug && console.error("falling back to prompt");
|
|
161
|
+
message = format("message" in options ? options.message : defaultMessage);
|
|
162
|
+
window.prompt(message, text);
|
|
163
|
+
}
|
|
164
|
+
} finally {
|
|
165
|
+
if (selection) {
|
|
166
|
+
if (typeof selection.removeRange == "function") {
|
|
167
|
+
selection.removeRange(range);
|
|
168
|
+
} else {
|
|
169
|
+
selection.removeAllRanges();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (mark) {
|
|
173
|
+
document.body.removeChild(mark);
|
|
174
|
+
}
|
|
175
|
+
reselectPrevious();
|
|
176
|
+
}
|
|
177
|
+
return success;
|
|
178
|
+
}
|
|
179
|
+
__name(copy2, "copy");
|
|
180
|
+
module.exports = copy2;
|
|
53
181
|
}
|
|
54
182
|
});
|
|
55
183
|
|
|
56
184
|
// ../node_modules/store2/dist/store2.js
|
|
57
185
|
var require_store2 = __commonJS({
|
|
58
186
|
"../node_modules/store2/dist/store2.js"(exports, module) {
|
|
59
|
-
(function(
|
|
187
|
+
(function(window2, define) {
|
|
60
188
|
var _ = {
|
|
61
189
|
version: "2.14.4",
|
|
62
190
|
areas: {},
|
|
@@ -383,17 +511,17 @@ var require_store2 = __commonJS({
|
|
|
383
511
|
} else if (typeof module !== "undefined" && module.exports) {
|
|
384
512
|
module.exports = store2;
|
|
385
513
|
} else {
|
|
386
|
-
if (
|
|
387
|
-
_.conflict =
|
|
514
|
+
if (window2.store) {
|
|
515
|
+
_.conflict = window2.store;
|
|
388
516
|
}
|
|
389
|
-
|
|
517
|
+
window2.store = store2;
|
|
390
518
|
}
|
|
391
519
|
})(exports, exports && exports.define);
|
|
392
520
|
}
|
|
393
521
|
});
|
|
394
522
|
|
|
395
523
|
// src/manager-api/root.tsx
|
|
396
|
-
import
|
|
524
|
+
import React4, {
|
|
397
525
|
Component,
|
|
398
526
|
Fragment,
|
|
399
527
|
useCallback as useCallback2,
|
|
@@ -683,6 +811,18 @@ import { global as global2 } from "@storybook/global";
|
|
|
683
811
|
// src/manager-api/lib/stories.ts
|
|
684
812
|
import { sanitize } from "storybook/internal/csf";
|
|
685
813
|
|
|
814
|
+
// ../node_modules/es-toolkit/dist/array/countBy.mjs
|
|
815
|
+
function countBy(arr, mapper) {
|
|
816
|
+
const result = {};
|
|
817
|
+
for (let i = 0; i < arr.length; i++) {
|
|
818
|
+
const item = arr[i];
|
|
819
|
+
const key = mapper(item);
|
|
820
|
+
result[key] = (result[key] ?? 0) + 1;
|
|
821
|
+
}
|
|
822
|
+
return result;
|
|
823
|
+
}
|
|
824
|
+
__name(countBy, "countBy");
|
|
825
|
+
|
|
686
826
|
// ../node_modules/es-toolkit/dist/array/partition.mjs
|
|
687
827
|
function partition(arr, isInTruthy) {
|
|
688
828
|
const truthy = [];
|
|
@@ -940,6 +1080,9 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input, { provider
|
|
|
940
1080
|
return currentTags === null ? child.tags : intersect_default(currentTags, child.tags);
|
|
941
1081
|
}, null);
|
|
942
1082
|
}
|
|
1083
|
+
if (item.type === "component") {
|
|
1084
|
+
item.importPath = acc[item.children[0]].importPath;
|
|
1085
|
+
}
|
|
943
1086
|
return acc;
|
|
944
1087
|
}
|
|
945
1088
|
__name(addItem, "addItem");
|
|
@@ -1323,7 +1466,7 @@ __export(layout_exports, {
|
|
|
1323
1466
|
import { SET_CONFIG as SET_CONFIG2 } from "storybook/internal/core-events";
|
|
1324
1467
|
import { global as global3 } from "@storybook/global";
|
|
1325
1468
|
import { create } from "storybook/theming/create";
|
|
1326
|
-
var { document } = global3;
|
|
1469
|
+
var { document: document2 } = global3;
|
|
1327
1470
|
var isFunction = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction");
|
|
1328
1471
|
var ActiveTabs = {
|
|
1329
1472
|
SIDEBAR: "sidebar",
|
|
@@ -1517,7 +1660,7 @@ var init5 = /* @__PURE__ */ __name(({ store: store2, provider, singleStory }) =>
|
|
|
1517
1660
|
if (!elementId) {
|
|
1518
1661
|
return;
|
|
1519
1662
|
}
|
|
1520
|
-
const element =
|
|
1663
|
+
const element = document2.getElementById(elementId);
|
|
1521
1664
|
if (element) {
|
|
1522
1665
|
element.focus();
|
|
1523
1666
|
if (select) {
|
|
@@ -1652,15 +1795,68 @@ var init6 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
|
1652
1795
|
}, "clearNotification")
|
|
1653
1796
|
};
|
|
1654
1797
|
const state = { notifications: [] };
|
|
1655
|
-
return {
|
|
1798
|
+
return {
|
|
1799
|
+
api,
|
|
1800
|
+
state
|
|
1801
|
+
};
|
|
1802
|
+
}, "init");
|
|
1803
|
+
|
|
1804
|
+
// src/manager-api/modules/open-in-editor.tsx
|
|
1805
|
+
var open_in_editor_exports = {};
|
|
1806
|
+
__export(open_in_editor_exports, {
|
|
1807
|
+
init: () => init7
|
|
1808
|
+
});
|
|
1809
|
+
import React from "react";
|
|
1810
|
+
import {
|
|
1811
|
+
OPEN_IN_EDITOR_REQUEST,
|
|
1812
|
+
OPEN_IN_EDITOR_RESPONSE
|
|
1813
|
+
} from "storybook/internal/core-events";
|
|
1814
|
+
import { FailedIcon } from "@storybook/icons";
|
|
1815
|
+
import { color } from "storybook/theming";
|
|
1816
|
+
var init7 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
1817
|
+
const api = {
|
|
1818
|
+
openInEditor(payload) {
|
|
1819
|
+
return new Promise((resolve) => {
|
|
1820
|
+
const { file, line, column } = payload;
|
|
1821
|
+
const handler = /* @__PURE__ */ __name((res) => {
|
|
1822
|
+
if (res.file === file && res.line === line && res.column === column) {
|
|
1823
|
+
provider.channel?.off(OPEN_IN_EDITOR_RESPONSE, handler);
|
|
1824
|
+
resolve(res);
|
|
1825
|
+
}
|
|
1826
|
+
}, "handler");
|
|
1827
|
+
provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, handler);
|
|
1828
|
+
provider.channel?.emit(OPEN_IN_EDITOR_REQUEST, payload);
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
const state = { notifications: [] };
|
|
1833
|
+
return {
|
|
1834
|
+
api,
|
|
1835
|
+
state,
|
|
1836
|
+
init: /* @__PURE__ */ __name(async () => {
|
|
1837
|
+
provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, (payload) => {
|
|
1838
|
+
if (payload.error !== null) {
|
|
1839
|
+
fullAPI.addNotification({
|
|
1840
|
+
id: "open-in-editor-error",
|
|
1841
|
+
content: {
|
|
1842
|
+
headline: "Failed to open in editor",
|
|
1843
|
+
subHeadline: payload.error || "Check the Storybook process on the command line for more details."
|
|
1844
|
+
},
|
|
1845
|
+
icon: React.createElement(FailedIcon, { color: color.negative }),
|
|
1846
|
+
duration: 8e3
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
});
|
|
1850
|
+
}, "init")
|
|
1851
|
+
};
|
|
1656
1852
|
}, "init");
|
|
1657
1853
|
|
|
1658
1854
|
// src/manager-api/modules/provider.ts
|
|
1659
1855
|
var provider_exports = {};
|
|
1660
1856
|
__export(provider_exports, {
|
|
1661
|
-
init: () =>
|
|
1857
|
+
init: () => init8
|
|
1662
1858
|
});
|
|
1663
|
-
var
|
|
1859
|
+
var init8 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
1664
1860
|
return {
|
|
1665
1861
|
api: provider.renderPreview ? { renderPreview: provider.renderPreview } : {},
|
|
1666
1862
|
state: {},
|
|
@@ -1673,9 +1869,9 @@ var init7 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
|
1673
1869
|
// src/manager-api/modules/settings.ts
|
|
1674
1870
|
var settings_exports = {};
|
|
1675
1871
|
__export(settings_exports, {
|
|
1676
|
-
init: () =>
|
|
1872
|
+
init: () => init9
|
|
1677
1873
|
});
|
|
1678
|
-
var
|
|
1874
|
+
var init9 = /* @__PURE__ */ __name(({ store: store2, navigate, fullAPI }) => {
|
|
1679
1875
|
const isSettingsScreenActive = /* @__PURE__ */ __name(() => {
|
|
1680
1876
|
const { path } = fullAPI.getUrlState();
|
|
1681
1877
|
return !!(path || "").match(/^\/settings/);
|
|
@@ -1717,10 +1913,11 @@ var shortcuts_exports = {};
|
|
|
1717
1913
|
__export(shortcuts_exports, {
|
|
1718
1914
|
controlOrMetaKey: () => controlOrMetaKey2,
|
|
1719
1915
|
defaultShortcuts: () => defaultShortcuts,
|
|
1720
|
-
init: () =>
|
|
1916
|
+
init: () => init10,
|
|
1721
1917
|
isMacLike: () => isMacLike2,
|
|
1722
1918
|
keys: () => keys
|
|
1723
1919
|
});
|
|
1920
|
+
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
1724
1921
|
import {
|
|
1725
1922
|
FORCE_REMOUNT,
|
|
1726
1923
|
PREVIEW_KEYDOWN,
|
|
@@ -1731,8 +1928,8 @@ import { global as global5 } from "@storybook/global";
|
|
|
1731
1928
|
|
|
1732
1929
|
// src/manager-api/lib/shortcut.ts
|
|
1733
1930
|
import { global as global4 } from "@storybook/global";
|
|
1734
|
-
var { navigator } = global4;
|
|
1735
|
-
var isMacLike = /* @__PURE__ */ __name(() =>
|
|
1931
|
+
var { navigator: navigator2 } = global4;
|
|
1932
|
+
var isMacLike = /* @__PURE__ */ __name(() => navigator2 && navigator2.platform ? !!navigator2.platform.match(/(Mac|iPhone|iPod|iPad)/i) : false, "isMacLike");
|
|
1736
1933
|
var controlOrMetaSymbol = /* @__PURE__ */ __name(() => isMacLike() ? "\u2318" : "ctrl", "controlOrMetaSymbol");
|
|
1737
1934
|
var controlOrMetaKey = /* @__PURE__ */ __name(() => isMacLike() ? "meta" : "control", "controlOrMetaKey");
|
|
1738
1935
|
var optionOrAltSymbol = /* @__PURE__ */ __name(() => isMacLike() ? "\u2325" : "alt", "optionOrAltSymbol");
|
|
@@ -1754,14 +1951,31 @@ var eventToShortcut = /* @__PURE__ */ __name((e) => {
|
|
|
1754
1951
|
if (e.shiftKey) {
|
|
1755
1952
|
keys2.push("shift");
|
|
1756
1953
|
}
|
|
1954
|
+
const codeUpper = e.code?.toUpperCase();
|
|
1955
|
+
const codeToCharMap = {
|
|
1956
|
+
MINUS: "-",
|
|
1957
|
+
EQUAL: "=",
|
|
1958
|
+
BRACKETLEFT: "[",
|
|
1959
|
+
BRACKETRIGHT: "]",
|
|
1960
|
+
BACKSLASH: "\\",
|
|
1961
|
+
SEMICOLON: ";",
|
|
1962
|
+
QUOTE: "'",
|
|
1963
|
+
BACKQUOTE: "`",
|
|
1964
|
+
COMMA: ",",
|
|
1965
|
+
PERIOD: ".",
|
|
1966
|
+
SLASH: "/"
|
|
1967
|
+
};
|
|
1968
|
+
const codeChar = codeUpper ? codeUpper.startsWith("KEY") && codeUpper.length === 4 ? codeUpper.replace("KEY", "") : codeUpper.startsWith("DIGIT") ? codeUpper.replace("DIGIT", "") : codeToCharMap[codeUpper] : void 0;
|
|
1757
1969
|
if (e.key && e.key.length === 1 && e.key !== " ") {
|
|
1758
1970
|
const key = e.key.toUpperCase();
|
|
1759
|
-
const code =
|
|
1971
|
+
const code = codeChar;
|
|
1760
1972
|
if (code && code.length === 1 && code !== key) {
|
|
1761
1973
|
keys2.push([key, code]);
|
|
1762
1974
|
} else {
|
|
1763
1975
|
keys2.push(key);
|
|
1764
1976
|
}
|
|
1977
|
+
} else if (e.key === "Dead" && codeChar) {
|
|
1978
|
+
keys2.push(codeChar);
|
|
1765
1979
|
}
|
|
1766
1980
|
if (e.key === " ") {
|
|
1767
1981
|
keys2.push("space");
|
|
@@ -1834,15 +2048,15 @@ var keyToSymbol = /* @__PURE__ */ __name((key) => {
|
|
|
1834
2048
|
if (key === "ArrowRight") {
|
|
1835
2049
|
return "\u2192";
|
|
1836
2050
|
}
|
|
1837
|
-
return key
|
|
2051
|
+
return key?.toUpperCase();
|
|
1838
2052
|
}, "keyToSymbol");
|
|
1839
2053
|
var shortcutToHumanString = /* @__PURE__ */ __name((shortcut) => {
|
|
1840
2054
|
return shortcut.map(keyToSymbol).join(" ");
|
|
1841
2055
|
}, "shortcutToHumanString");
|
|
1842
2056
|
|
|
1843
2057
|
// src/manager-api/modules/shortcuts.ts
|
|
1844
|
-
var { navigator:
|
|
1845
|
-
var isMacLike2 = /* @__PURE__ */ __name(() =>
|
|
2058
|
+
var { navigator: navigator3, document: document3 } = global5;
|
|
2059
|
+
var isMacLike2 = /* @__PURE__ */ __name(() => navigator3 && navigator3.platform ? !!navigator3.platform.match(/(Mac|iPhone|iPod|iPad)/i) : false, "isMacLike");
|
|
1846
2060
|
var controlOrMetaKey2 = /* @__PURE__ */ __name(() => isMacLike2() ? "meta" : "control", "controlOrMetaKey");
|
|
1847
2061
|
function keys(o) {
|
|
1848
2062
|
return Object.keys(o);
|
|
@@ -1868,7 +2082,11 @@ var defaultShortcuts = Object.freeze({
|
|
|
1868
2082
|
// This one is not customizable
|
|
1869
2083
|
collapseAll: [controlOrMetaKey2(), "shift", "ArrowUp"],
|
|
1870
2084
|
expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
|
|
1871
|
-
remount: ["alt", "R"]
|
|
2085
|
+
remount: ["alt", "R"],
|
|
2086
|
+
openInEditor: ["alt", "shift", "E"],
|
|
2087
|
+
copyStoryLink: ["alt", "shift", "L"]
|
|
2088
|
+
// TODO: bring this back once we want to add shortcuts for this
|
|
2089
|
+
// copyStoryName: ['alt', 'shift', 'C'],
|
|
1872
2090
|
});
|
|
1873
2091
|
var addonsShortcuts = {};
|
|
1874
2092
|
function shouldSkipShortcut(event) {
|
|
@@ -1883,7 +2101,7 @@ function shouldSkipShortcut(event) {
|
|
|
1883
2101
|
return false;
|
|
1884
2102
|
}
|
|
1885
2103
|
__name(shouldSkipShortcut, "shouldSkipShortcut");
|
|
1886
|
-
var
|
|
2104
|
+
var init10 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
1887
2105
|
const api = {
|
|
1888
2106
|
// Getting and setting shortcuts
|
|
1889
2107
|
getShortcutKeys() {
|
|
@@ -1993,7 +2211,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
1993
2211
|
break;
|
|
1994
2212
|
}
|
|
1995
2213
|
case "focusIframe": {
|
|
1996
|
-
const element =
|
|
2214
|
+
const element = document3.getElementById("storybook-preview-iframe");
|
|
1997
2215
|
if (element) {
|
|
1998
2216
|
try {
|
|
1999
2217
|
element.contentWindow.focus();
|
|
@@ -2074,6 +2292,26 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2074
2292
|
fullAPI.emit(FORCE_REMOUNT, { storyId });
|
|
2075
2293
|
break;
|
|
2076
2294
|
}
|
|
2295
|
+
case "openInEditor": {
|
|
2296
|
+
if (global5.CONFIG_TYPE === "DEVELOPMENT") {
|
|
2297
|
+
fullAPI.openInEditor({
|
|
2298
|
+
file: fullAPI.getCurrentStoryData().importPath
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
break;
|
|
2302
|
+
}
|
|
2303
|
+
// TODO: bring this back once we want to add shortcuts for this
|
|
2304
|
+
// case 'copyStoryName': {
|
|
2305
|
+
// const storyData = fullAPI.getCurrentStoryData();
|
|
2306
|
+
// if (storyData.type === 'story') {
|
|
2307
|
+
// copy(storyData.exportName);
|
|
2308
|
+
// }
|
|
2309
|
+
// break;
|
|
2310
|
+
// }
|
|
2311
|
+
case "copyStoryLink": {
|
|
2312
|
+
(0, import_copy_to_clipboard.default)(window.location.href);
|
|
2313
|
+
break;
|
|
2314
|
+
}
|
|
2077
2315
|
default:
|
|
2078
2316
|
addonsShortcuts[feature].action();
|
|
2079
2317
|
break;
|
|
@@ -2089,7 +2327,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2089
2327
|
)
|
|
2090
2328
|
};
|
|
2091
2329
|
const initModule = /* @__PURE__ */ __name(() => {
|
|
2092
|
-
|
|
2330
|
+
document3.addEventListener("keydown", (event) => {
|
|
2093
2331
|
if (!shouldSkipShortcut(event)) {
|
|
2094
2332
|
api.handleKeydownEvent(event);
|
|
2095
2333
|
}
|
|
@@ -2104,7 +2342,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2104
2342
|
// src/manager-api/modules/stories.ts
|
|
2105
2343
|
var stories_exports = {};
|
|
2106
2344
|
__export(stories_exports, {
|
|
2107
|
-
init: () =>
|
|
2345
|
+
init: () => init11
|
|
2108
2346
|
});
|
|
2109
2347
|
import { logger as logger5 } from "storybook/internal/client-logger";
|
|
2110
2348
|
import {
|
|
@@ -2272,12 +2510,12 @@ function createStatusStore({
|
|
|
2272
2510
|
__name(createStatusStore, "createStatusStore");
|
|
2273
2511
|
|
|
2274
2512
|
// src/shared/universal-store/use-universal-store-manager.ts
|
|
2275
|
-
import * as
|
|
2513
|
+
import * as React2 from "react";
|
|
2276
2514
|
var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
2277
|
-
const snapshotRef =
|
|
2515
|
+
const snapshotRef = React2.useRef(
|
|
2278
2516
|
selector ? selector(universalStore.getState()) : universalStore.getState()
|
|
2279
2517
|
);
|
|
2280
|
-
const subscribe =
|
|
2518
|
+
const subscribe = React2.useCallback(
|
|
2281
2519
|
(listener) => universalStore.onStateChange((state2, previousState) => {
|
|
2282
2520
|
if (!selector) {
|
|
2283
2521
|
snapshotRef.current = state2;
|
|
@@ -2294,7 +2532,7 @@ var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
|
2294
2532
|
}),
|
|
2295
2533
|
[universalStore, selector]
|
|
2296
2534
|
);
|
|
2297
|
-
const getSnapshot =
|
|
2535
|
+
const getSnapshot = React2.useCallback(() => {
|
|
2298
2536
|
const currentState = universalStore.getState();
|
|
2299
2537
|
const selectedState = selector ? selector(currentState) : currentState;
|
|
2300
2538
|
if (isEqual(selectedState, snapshotRef.current)) {
|
|
@@ -2303,7 +2541,7 @@ var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
|
2303
2541
|
snapshotRef.current = selectedState;
|
|
2304
2542
|
return snapshotRef.current;
|
|
2305
2543
|
}, [universalStore, selector]);
|
|
2306
|
-
const state =
|
|
2544
|
+
const state = React2.useSyncExternalStore(subscribe, getSnapshot);
|
|
2307
2545
|
return [state, universalStore.setState];
|
|
2308
2546
|
}, "useUniversalStore");
|
|
2309
2547
|
|
|
@@ -2335,7 +2573,7 @@ function removeRemovedOptions(options) {
|
|
|
2335
2573
|
return result;
|
|
2336
2574
|
}
|
|
2337
2575
|
__name(removeRemovedOptions, "removeRemovedOptions");
|
|
2338
|
-
var
|
|
2576
|
+
var init11 = /* @__PURE__ */ __name(({
|
|
2339
2577
|
fullAPI,
|
|
2340
2578
|
store: store2,
|
|
2341
2579
|
navigate,
|
|
@@ -2836,7 +3074,7 @@ var init10 = /* @__PURE__ */ __name(({
|
|
|
2836
3074
|
// src/manager-api/modules/url.ts
|
|
2837
3075
|
var url_exports = {};
|
|
2838
3076
|
__export(url_exports, {
|
|
2839
|
-
init: () =>
|
|
3077
|
+
init: () => init12
|
|
2840
3078
|
});
|
|
2841
3079
|
import {
|
|
2842
3080
|
GLOBALS_UPDATED as GLOBALS_UPDATED2,
|
|
@@ -2913,7 +3151,7 @@ var initialUrlSupport = /* @__PURE__ */ __name(({
|
|
|
2913
3151
|
prevParams = customQueryParams;
|
|
2914
3152
|
return { viewMode, layout, ui, selectedPanel, location: location2, path, customQueryParams, storyId };
|
|
2915
3153
|
}, "initialUrlSupport");
|
|
2916
|
-
var
|
|
3154
|
+
var init12 = /* @__PURE__ */ __name((moduleArgs) => {
|
|
2917
3155
|
const { store: store2, navigate, provider, fullAPI } = moduleArgs;
|
|
2918
3156
|
const navigateTo = /* @__PURE__ */ __name((path, queryParams = {}, options = {}) => {
|
|
2919
3157
|
const params = Object.entries(queryParams).filter(([, v]) => v).sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${k}=${v}`);
|
|
@@ -3009,14 +3247,14 @@ var init11 = /* @__PURE__ */ __name((moduleArgs) => {
|
|
|
3009
3247
|
// src/manager-api/modules/versions.ts
|
|
3010
3248
|
var versions_exports = {};
|
|
3011
3249
|
__export(versions_exports, {
|
|
3012
|
-
init: () =>
|
|
3250
|
+
init: () => init13
|
|
3013
3251
|
});
|
|
3014
3252
|
var import_memoizerific2 = __toESM(require_memoizerific(), 1);
|
|
3015
3253
|
import { global as global8 } from "@storybook/global";
|
|
3016
3254
|
import semver from "semver";
|
|
3017
3255
|
|
|
3018
3256
|
// src/manager-api/version.ts
|
|
3019
|
-
var version = "10.0.0-beta.
|
|
3257
|
+
var version = "10.0.0-beta.6";
|
|
3020
3258
|
|
|
3021
3259
|
// src/manager-api/modules/versions.ts
|
|
3022
3260
|
var { VERSIONCHECK } = global8;
|
|
@@ -3033,7 +3271,7 @@ var normalizeRendererName = /* @__PURE__ */ __name((renderer) => {
|
|
|
3033
3271
|
}
|
|
3034
3272
|
return renderer;
|
|
3035
3273
|
}, "normalizeRendererName");
|
|
3036
|
-
var
|
|
3274
|
+
var init13 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
3037
3275
|
const { dismissedVersionNotification } = store2.getState();
|
|
3038
3276
|
const state = {
|
|
3039
3277
|
versions: {
|
|
@@ -3122,9 +3360,9 @@ var init12 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
|
3122
3360
|
// src/manager-api/modules/whatsnew.tsx
|
|
3123
3361
|
var whatsnew_exports = {};
|
|
3124
3362
|
__export(whatsnew_exports, {
|
|
3125
|
-
init: () =>
|
|
3363
|
+
init: () => init14
|
|
3126
3364
|
});
|
|
3127
|
-
import
|
|
3365
|
+
import React3 from "react";
|
|
3128
3366
|
import {
|
|
3129
3367
|
REQUEST_WHATS_NEW_DATA,
|
|
3130
3368
|
RESULT_WHATS_NEW_DATA,
|
|
@@ -3133,8 +3371,8 @@ import {
|
|
|
3133
3371
|
} from "storybook/internal/core-events";
|
|
3134
3372
|
import { global as global9 } from "@storybook/global";
|
|
3135
3373
|
var WHATS_NEW_NOTIFICATION_ID = "whats-new";
|
|
3136
|
-
var StorybookIcon = /* @__PURE__ */ __name(({ color = "currentColor", size = 14 }) => {
|
|
3137
|
-
return
|
|
3374
|
+
var StorybookIcon = /* @__PURE__ */ __name(({ color: color2 = "currentColor", size = 14 }) => {
|
|
3375
|
+
return React3.createElement(
|
|
3138
3376
|
"svg",
|
|
3139
3377
|
{
|
|
3140
3378
|
width: size,
|
|
@@ -3143,18 +3381,18 @@ var StorybookIcon = /* @__PURE__ */ __name(({ color = "currentColor", size = 14
|
|
|
3143
3381
|
fill: "none",
|
|
3144
3382
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3145
3383
|
},
|
|
3146
|
-
|
|
3384
|
+
React3.createElement(
|
|
3147
3385
|
"path",
|
|
3148
3386
|
{
|
|
3149
3387
|
fillRule: "evenodd",
|
|
3150
3388
|
clipRule: "evenodd",
|
|
3151
3389
|
d: "M2.042.616a.704.704 0 00-.66.729L1.816 12.9c.014.367.306.66.672.677l9.395.422h.032a.704.704 0 00.704-.703V.704c0-.015 0-.03-.002-.044a.704.704 0 00-.746-.659l-.773.049.057 1.615a.105.105 0 01-.17.086l-.52-.41-.617.468a.105.105 0 01-.168-.088L9.746.134 2.042.616zm8.003 4.747c-.247.192-2.092.324-2.092.05.04-1.045-.429-1.091-.689-1.091-.247 0-.662.075-.662.634 0 .57.607.893 1.32 1.27 1.014.538 2.24 1.188 2.24 2.823 0 1.568-1.273 2.433-2.898 2.433-1.676 0-3.141-.678-2.976-3.03.065-.275 2.197-.21 2.197 0-.026.971.195 1.256.753 1.256.43 0 .624-.236.624-.634 0-.602-.633-.958-1.361-1.367-.987-.554-2.148-1.205-2.148-2.7 0-1.494 1.027-2.489 2.86-2.489 1.832 0 2.832.98 2.832 2.845z",
|
|
3152
|
-
fill:
|
|
3390
|
+
fill: color2
|
|
3153
3391
|
}
|
|
3154
3392
|
)
|
|
3155
3393
|
);
|
|
3156
3394
|
}, "StorybookIcon");
|
|
3157
|
-
var
|
|
3395
|
+
var init14 = /* @__PURE__ */ __name(({ fullAPI, store: store2, provider }) => {
|
|
3158
3396
|
const state = {
|
|
3159
3397
|
whatsNewData: void 0
|
|
3160
3398
|
};
|
|
@@ -3216,7 +3454,7 @@ var init13 = /* @__PURE__ */ __name(({ fullAPI, store: store2, provider }) => {
|
|
|
3216
3454
|
headline: whatsNewData.title,
|
|
3217
3455
|
subHeadline: "Learn what's new in Storybook"
|
|
3218
3456
|
},
|
|
3219
|
-
icon:
|
|
3457
|
+
icon: React3.createElement(StorybookIcon, null),
|
|
3220
3458
|
onClear({ dismissed }) {
|
|
3221
3459
|
if (dismissed) {
|
|
3222
3460
|
setWhatsNewCache({ lastDismissedPost: whatsNewData.url });
|
|
@@ -3409,7 +3647,8 @@ var _ManagerProvider = class _ManagerProvider extends Component {
|
|
|
3409
3647
|
globals_exports,
|
|
3410
3648
|
url_exports,
|
|
3411
3649
|
versions_exports,
|
|
3412
|
-
whatsnew_exports
|
|
3650
|
+
whatsnew_exports,
|
|
3651
|
+
open_in_editor_exports
|
|
3413
3652
|
].map(
|
|
3414
3653
|
(m) => m.init({ ...routeData, ...optionsData, ...apiData, state: this.state, fullAPI: this.api })
|
|
3415
3654
|
);
|
|
@@ -3442,14 +3681,14 @@ var _ManagerProvider = class _ManagerProvider extends Component {
|
|
|
3442
3681
|
state: this.state,
|
|
3443
3682
|
api: this.api
|
|
3444
3683
|
};
|
|
3445
|
-
return
|
|
3684
|
+
return React4.createElement(EffectOnMount, { effect: this.initModules }, React4.createElement(ManagerContext.Provider, { value }, React4.createElement(ManagerConsumer, null, children)));
|
|
3446
3685
|
}
|
|
3447
3686
|
};
|
|
3448
3687
|
__name(_ManagerProvider, "ManagerProvider");
|
|
3449
3688
|
_ManagerProvider.displayName = "Manager";
|
|
3450
3689
|
var ManagerProvider = _ManagerProvider;
|
|
3451
3690
|
var EffectOnMount = /* @__PURE__ */ __name(({ children, effect }) => {
|
|
3452
|
-
|
|
3691
|
+
React4.useEffect(effect, []);
|
|
3453
3692
|
return children;
|
|
3454
3693
|
}, "EffectOnMount");
|
|
3455
3694
|
var defaultFilter = /* @__PURE__ */ __name((c) => c, "defaultFilter");
|
|
@@ -3462,7 +3701,7 @@ function ManagerConsumer({
|
|
|
3462
3701
|
const renderer = useRef2(children);
|
|
3463
3702
|
const filterer = useRef2(filter);
|
|
3464
3703
|
if (typeof renderer.current !== "function") {
|
|
3465
|
-
return
|
|
3704
|
+
return React4.createElement(Fragment, null, renderer.current);
|
|
3466
3705
|
}
|
|
3467
3706
|
const comboData = filterer.current(managerContext);
|
|
3468
3707
|
const comboDataArray = useMemo(() => {
|
|
@@ -3470,7 +3709,7 @@ function ManagerConsumer({
|
|
|
3470
3709
|
}, [managerContext.state]);
|
|
3471
3710
|
return useMemo(() => {
|
|
3472
3711
|
const Child = renderer.current;
|
|
3473
|
-
return
|
|
3712
|
+
return React4.createElement(Child, { ...comboData });
|
|
3474
3713
|
}, comboDataArray);
|
|
3475
3714
|
}
|
|
3476
3715
|
__name(ManagerConsumer, "ManagerConsumer");
|