storybook 9.1.0-beta.2 → 9.1.0
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/dist/bin/index.cjs +55 -55
- package/dist/bin/index.js +51 -51
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +697 -697
- package/dist/common/index.js +681 -681
- package/dist/core-server/presets/common-manager.js +2034 -2069
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/runtime.js +8 -8
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.js +1 -1
- package/dist/preview/runtime.js +19 -13
- package/dist/preview-api/index.cjs +18 -14
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +19 -13
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/package.json +1 -1
|
@@ -69014,7 +69014,7 @@ Ct();
|
|
|
69014
69014
|
var Ome = N(Wa(), 1), Nn = N(Pme(), 1);
|
|
69015
69015
|
|
|
69016
69016
|
// src/manager-api/version.ts
|
|
69017
|
-
var Tme = "9.1.0
|
|
69017
|
+
var Tme = "9.1.0";
|
|
69018
69018
|
|
|
69019
69019
|
// src/manager-api/modules/versions.ts
|
|
69020
69020
|
var { VERSIONCHECK: bst } = Z, Ame = (0, Ome.default)(1)(() => {
|
package/dist/manager/runtime.js
CHANGED
|
@@ -11560,19 +11560,19 @@ var qI = ["active", "critical", "negative", "positive", "warning"], $o, YI = /*
|
|
|
11560
11560
|
r.onload = () => i({ href: o, status: t }), r.onerror = () => i({ href: $o, status: t }), r.src = o;
|
|
11561
11561
|
});
|
|
11562
11562
|
}, "getFaviconUrl"), zd = /* @__PURE__ */ a((e) => {
|
|
11563
|
-
let t = U(document.head.
|
|
11563
|
+
let t = U(document.head.querySelectorAll("link[rel*='icon']"));
|
|
11564
11564
|
H(() => {
|
|
11565
|
-
let o = t.current;
|
|
11566
|
-
if (
|
|
11567
|
-
return YI(
|
|
11568
|
-
(
|
|
11569
|
-
|
|
11565
|
+
let o = !0, [i, ...r] = t.current;
|
|
11566
|
+
if (i && !r.length)
|
|
11567
|
+
return YI(i.href, e).then(
|
|
11568
|
+
(n) => {
|
|
11569
|
+
o && n.status === e && i.dataset.status !== e && (i.href = n.href, n.status ? i.dataset.status = n.status : delete i.dataset.status);
|
|
11570
11570
|
},
|
|
11571
11571
|
() => {
|
|
11572
|
-
o.href = $o;
|
|
11572
|
+
o && (i.href = $o);
|
|
11573
11573
|
}
|
|
11574
11574
|
), () => {
|
|
11575
|
-
o.href = $o;
|
|
11575
|
+
o = !1, i.href = $o;
|
|
11576
11576
|
};
|
|
11577
11577
|
}, [e]);
|
|
11578
11578
|
}, "useDynamicFavicon");
|
|
@@ -4403,7 +4403,7 @@ U(wr, {
|
|
|
4403
4403
|
var kt = require("@storybook/global"), on = L(rr(), 1), $ = L(require("semver"), 1);
|
|
4404
4404
|
|
|
4405
4405
|
// src/manager-api/version.ts
|
|
4406
|
-
var tn = "9.1.0
|
|
4406
|
+
var tn = "9.1.0";
|
|
4407
4407
|
|
|
4408
4408
|
// src/manager-api/modules/versions.ts
|
|
4409
4409
|
var { VERSIONCHECK: Qs } = kt.global, rn = (0, on.default)(1)(() => {
|
|
@@ -3217,7 +3217,7 @@ import { global as Sr } from "@storybook/global";
|
|
|
3217
3217
|
import $ from "semver";
|
|
3218
3218
|
|
|
3219
3219
|
// src/manager-api/version.ts
|
|
3220
|
-
var No = "9.1.0
|
|
3220
|
+
var No = "9.1.0";
|
|
3221
3221
|
|
|
3222
3222
|
// src/manager-api/modules/versions.ts
|
|
3223
3223
|
var { VERSIONCHECK: ca } = Sr, jo = (0, ko.default)(1)(() => {
|
package/dist/preview/runtime.js
CHANGED
|
@@ -41682,13 +41682,21 @@ var NR = class NR {
|
|
|
41682
41682
|
this.teardownRender = /* @__PURE__ */ o(() => {
|
|
41683
41683
|
}, "teardownRender");
|
|
41684
41684
|
this.torndown = !1;
|
|
41685
|
-
this.abortController = new NU(), u && (this.story = u, this.phase = "preparing");
|
|
41685
|
+
this.abortController = new NU(), this.renderId = Date.now(), u && (this.story = u, this.phase = "preparing");
|
|
41686
41686
|
}
|
|
41687
41687
|
async runPhase(t, r, n) {
|
|
41688
|
-
this.phase = r, this.channel.emit(jt, {
|
|
41688
|
+
this.phase = r, this.channel.emit(jt, {
|
|
41689
|
+
newPhase: this.phase,
|
|
41690
|
+
renderId: this.renderId,
|
|
41691
|
+
storyId: this.id
|
|
41692
|
+
}), n && (await n(), this.checkIfAborted(t));
|
|
41689
41693
|
}
|
|
41690
41694
|
checkIfAborted(t) {
|
|
41691
|
-
return t.aborted ? (this.phase = "aborted", this.channel.emit(jt, {
|
|
41695
|
+
return t.aborted ? (this.phase = "aborted", this.channel.emit(jt, {
|
|
41696
|
+
newPhase: this.phase,
|
|
41697
|
+
renderId: this.renderId,
|
|
41698
|
+
storyId: this.id
|
|
41699
|
+
}), !0) : !1;
|
|
41692
41700
|
}
|
|
41693
41701
|
async prepare() {
|
|
41694
41702
|
if (await this.runPhase(this.abortController.signal, "preparing", async () => {
|
|
@@ -42321,7 +42329,7 @@ var LR = class LR {
|
|
|
42321
42329
|
this.torndown = !1;
|
|
42322
42330
|
this.disableKeyListeners = !1;
|
|
42323
42331
|
this.preparing = !1;
|
|
42324
|
-
this.id = n.id;
|
|
42332
|
+
this.id = n.id, this.renderId = Date.now();
|
|
42325
42333
|
}
|
|
42326
42334
|
isPreparing() {
|
|
42327
42335
|
return this.preparing;
|
|
@@ -42390,7 +42398,7 @@ var FR = class FR {
|
|
|
42390
42398
|
this.torndown = !1;
|
|
42391
42399
|
this.disableKeyListeners = !1;
|
|
42392
42400
|
this.preparing = !1;
|
|
42393
|
-
this.id = n.id;
|
|
42401
|
+
this.id = n.id, this.renderId = Date.now();
|
|
42394
42402
|
}
|
|
42395
42403
|
isPreparing() {
|
|
42396
42404
|
return this.preparing;
|
|
@@ -42681,18 +42689,16 @@ var $R = class $R extends Qn {
|
|
|
42681
42689
|
}
|
|
42682
42690
|
// renderException is used if we fail to render the story and it is uncaught by the app layer
|
|
42683
42691
|
renderException(r, n) {
|
|
42684
|
-
let { name: i = "Error", message: s = String(n), stack: a } = n;
|
|
42685
|
-
this.channel.emit(rb, { name: i, message: s, stack: a }), this.channel.emit(jt, { newPhase: "errored", storyId: r }), this.
|
|
42686
|
-
n), se.error(`Error rendering story '${r}':`), se.error(n);
|
|
42692
|
+
let { name: i = "Error", message: s = String(n), stack: a } = n, l = this.currentRender?.renderId;
|
|
42693
|
+
this.channel.emit(rb, { name: i, message: s, stack: a }), this.channel.emit(jt, { newPhase: "errored", renderId: l, storyId: r }), this.
|
|
42694
|
+
view.showErrorDisplay(n), se.error(`Error rendering story '${r}':`), se.error(n);
|
|
42687
42695
|
}
|
|
42688
42696
|
// renderError is used by the various app layers to inform the user they have done something
|
|
42689
42697
|
// wrong -- for instance returned the wrong thing from a story
|
|
42690
42698
|
renderError(r, { title: n, description: i }) {
|
|
42691
|
-
|
|
42692
|
-
|
|
42693
|
-
|
|
42694
|
-
stack: i
|
|
42695
|
-
});
|
|
42699
|
+
let s = this.currentRender?.renderId;
|
|
42700
|
+
this.channel.emit(Qy, { title: n, description: i }), this.channel.emit(jt, { newPhase: "errored", renderId: s, storyId: r }), this.view.
|
|
42701
|
+
showErrorDisplay({ message: n, stack: i }), se.error(`Error rendering story ${n}: ${i}`);
|
|
42696
42702
|
}
|
|
42697
42703
|
};
|
|
42698
42704
|
o($R, "PreviewWithSelection");
|
|
@@ -3851,18 +3851,24 @@ var be = class {
|
|
|
3851
3851
|
this.teardownRender = /* @__PURE__ */ s(() => {
|
|
3852
3852
|
}, "teardownRender");
|
|
3853
3853
|
this.torndown = !1;
|
|
3854
|
-
this.abortController = new yn(), d && (this.story = d, this.phase = "preparing");
|
|
3854
|
+
this.abortController = new yn(), this.renderId = Date.now(), d && (this.story = d, this.phase = "preparing");
|
|
3855
3855
|
}
|
|
3856
3856
|
static {
|
|
3857
3857
|
s(this, "StoryRender");
|
|
3858
3858
|
}
|
|
3859
3859
|
async runPhase(e, t, o) {
|
|
3860
|
-
this.phase = t, this.channel.emit(z.STORY_RENDER_PHASE_CHANGED, {
|
|
3861
|
-
|
|
3860
|
+
this.phase = t, this.channel.emit(z.STORY_RENDER_PHASE_CHANGED, {
|
|
3861
|
+
newPhase: this.phase,
|
|
3862
|
+
renderId: this.renderId,
|
|
3863
|
+
storyId: this.id
|
|
3864
|
+
}), o && (await o(), this.checkIfAborted(e));
|
|
3862
3865
|
}
|
|
3863
3866
|
checkIfAborted(e) {
|
|
3864
|
-
return e.aborted ? (this.phase = "aborted", this.channel.emit(z.STORY_RENDER_PHASE_CHANGED, {
|
|
3865
|
-
|
|
3867
|
+
return e.aborted ? (this.phase = "aborted", this.channel.emit(z.STORY_RENDER_PHASE_CHANGED, {
|
|
3868
|
+
newPhase: this.phase,
|
|
3869
|
+
renderId: this.renderId,
|
|
3870
|
+
storyId: this.id
|
|
3871
|
+
}), !0) : !1;
|
|
3866
3872
|
}
|
|
3867
3873
|
async prepare() {
|
|
3868
3874
|
if (await this.runPhase(this.abortController.signal, "preparing", async () => {
|
|
@@ -4518,7 +4524,7 @@ var Ye = class {
|
|
|
4518
4524
|
this.torndown = !1;
|
|
4519
4525
|
this.disableKeyListeners = !1;
|
|
4520
4526
|
this.preparing = !1;
|
|
4521
|
-
this.id = o.id;
|
|
4527
|
+
this.id = o.id, this.renderId = Date.now();
|
|
4522
4528
|
}
|
|
4523
4529
|
static {
|
|
4524
4530
|
s(this, "CsfDocsRender");
|
|
@@ -4589,7 +4595,7 @@ var Ke = class {
|
|
|
4589
4595
|
this.torndown = !1;
|
|
4590
4596
|
this.disableKeyListeners = !1;
|
|
4591
4597
|
this.preparing = !1;
|
|
4592
|
-
this.id = o.id;
|
|
4598
|
+
this.id = o.id, this.renderId = Date.now();
|
|
4593
4599
|
}
|
|
4594
4600
|
static {
|
|
4595
4601
|
s(this, "MdxDocsRender");
|
|
@@ -4885,18 +4891,16 @@ var Te = class extends Se {
|
|
|
4885
4891
|
}
|
|
4886
4892
|
// renderException is used if we fail to render the story and it is uncaught by the app layer
|
|
4887
4893
|
renderException(t, o) {
|
|
4888
|
-
let { name: n = "Error", message: i = String(o), stack: a } = o;
|
|
4894
|
+
let { name: n = "Error", message: i = String(o), stack: a } = o, l = this.currentRender?.renderId;
|
|
4889
4895
|
this.channel.emit(E.STORY_THREW_EXCEPTION, { name: n, message: i, stack: a }), this.channel.emit(E.STORY_RENDER_PHASE_CHANGED, { newPhase: "\
|
|
4890
|
-
errored", storyId: t }), this.view.showErrorDisplay(o), Xe.logger.error(`Error rendering story '${t}':`), Xe.logger.error(o);
|
|
4896
|
+
errored", renderId: l, storyId: t }), this.view.showErrorDisplay(o), Xe.logger.error(`Error rendering story '${t}':`), Xe.logger.error(o);
|
|
4891
4897
|
}
|
|
4892
4898
|
// renderError is used by the various app layers to inform the user they have done something
|
|
4893
4899
|
// wrong -- for instance returned the wrong thing from a story
|
|
4894
4900
|
renderError(t, { title: o, description: n }) {
|
|
4895
|
-
|
|
4896
|
-
E.
|
|
4897
|
-
|
|
4898
|
-
stack: n
|
|
4899
|
-
});
|
|
4901
|
+
let i = this.currentRender?.renderId;
|
|
4902
|
+
this.channel.emit(E.STORY_ERRORED, { title: o, description: n }), this.channel.emit(E.STORY_RENDER_PHASE_CHANGED, { newPhase: "errored",
|
|
4903
|
+
renderId: i, storyId: t }), this.view.showErrorDisplay({ message: o, stack: n }), Xe.logger.error(`Error rendering story ${o}: ${n}`);
|
|
4900
4904
|
}
|
|
4901
4905
|
};
|
|
4902
4906
|
|
|
@@ -638,6 +638,7 @@ type RenderType = 'story' | 'docs';
|
|
|
638
638
|
* - Tracking what is rendered to know if a change requires re-rendering or teardown + recreation.
|
|
639
639
|
*/
|
|
640
640
|
interface Render<TRenderer extends Renderer> {
|
|
641
|
+
renderId: number;
|
|
641
642
|
type: RenderType;
|
|
642
643
|
id: StoryId;
|
|
643
644
|
isPreparing: () => boolean;
|
|
@@ -666,6 +667,7 @@ declare class CsfDocsRender<TRenderer extends Renderer> implements Render<TRende
|
|
|
666
667
|
protected store: StoryStore<TRenderer>;
|
|
667
668
|
entry: IndexEntry;
|
|
668
669
|
private callbacks;
|
|
670
|
+
readonly renderId: number;
|
|
669
671
|
readonly type: RenderType;
|
|
670
672
|
readonly subtype = "csf";
|
|
671
673
|
readonly id: StoryId;
|
|
@@ -704,6 +706,7 @@ declare class MdxDocsRender<TRenderer extends Renderer> implements Render<TRende
|
|
|
704
706
|
protected store: StoryStore<TRenderer>;
|
|
705
707
|
entry: IndexEntry;
|
|
706
708
|
private callbacks;
|
|
709
|
+
readonly renderId: number;
|
|
707
710
|
readonly type: RenderType;
|
|
708
711
|
readonly subtype = "mdx";
|
|
709
712
|
readonly id: StoryId;
|
|
@@ -736,6 +739,7 @@ declare class StoryRender<TRenderer extends Renderer> implements Render<TRendere
|
|
|
736
739
|
id: StoryId;
|
|
737
740
|
viewMode: StoryContext<TRenderer>['viewMode'];
|
|
738
741
|
renderOptions: StoryRenderOptions;
|
|
742
|
+
readonly renderId: number;
|
|
739
743
|
type: RenderType;
|
|
740
744
|
story?: PreparedStory<TRenderer>;
|
|
741
745
|
phase?: RenderPhase;
|
|
@@ -3851,13 +3851,21 @@ var Jr = class Jr {
|
|
|
3851
3851
|
this.teardownRender = /* @__PURE__ */ n(() => {
|
|
3852
3852
|
}, "teardownRender");
|
|
3853
3853
|
this.torndown = !1;
|
|
3854
|
-
this.abortController = new Io(), c && (this.story = c, this.phase = "preparing");
|
|
3854
|
+
this.abortController = new Io(), this.renderId = Date.now(), c && (this.story = c, this.phase = "preparing");
|
|
3855
3855
|
}
|
|
3856
3856
|
async runPhase(e, t, o) {
|
|
3857
|
-
this.phase = t, this.channel.emit(Fo, {
|
|
3857
|
+
this.phase = t, this.channel.emit(Fo, {
|
|
3858
|
+
newPhase: this.phase,
|
|
3859
|
+
renderId: this.renderId,
|
|
3860
|
+
storyId: this.id
|
|
3861
|
+
}), o && (await o(), this.checkIfAborted(e));
|
|
3858
3862
|
}
|
|
3859
3863
|
checkIfAborted(e) {
|
|
3860
|
-
return e.aborted ? (this.phase = "aborted", this.channel.emit(Fo, {
|
|
3864
|
+
return e.aborted ? (this.phase = "aborted", this.channel.emit(Fo, {
|
|
3865
|
+
newPhase: this.phase,
|
|
3866
|
+
renderId: this.renderId,
|
|
3867
|
+
storyId: this.id
|
|
3868
|
+
}), !0) : !1;
|
|
3861
3869
|
}
|
|
3862
3870
|
async prepare() {
|
|
3863
3871
|
if (await this.runPhase(this.abortController.signal, "preparing", async () => {
|
|
@@ -4535,7 +4543,7 @@ var rt = class rt {
|
|
|
4535
4543
|
this.torndown = !1;
|
|
4536
4544
|
this.disableKeyListeners = !1;
|
|
4537
4545
|
this.preparing = !1;
|
|
4538
|
-
this.id = o.id;
|
|
4546
|
+
this.id = o.id, this.renderId = Date.now();
|
|
4539
4547
|
}
|
|
4540
4548
|
isPreparing() {
|
|
4541
4549
|
return this.preparing;
|
|
@@ -4605,7 +4613,7 @@ var tt = class tt {
|
|
|
4605
4613
|
this.torndown = !1;
|
|
4606
4614
|
this.disableKeyListeners = !1;
|
|
4607
4615
|
this.preparing = !1;
|
|
4608
|
-
this.id = o.id;
|
|
4616
|
+
this.id = o.id, this.renderId = Date.now();
|
|
4609
4617
|
}
|
|
4610
4618
|
isPreparing() {
|
|
4611
4619
|
return this.preparing;
|
|
@@ -4896,18 +4904,16 @@ var st = class st extends Te {
|
|
|
4896
4904
|
}
|
|
4897
4905
|
// renderException is used if we fail to render the story and it is uncaught by the app layer
|
|
4898
4906
|
renderException(t, o) {
|
|
4899
|
-
let { name: s = "Error", message: i = String(o), stack: a } = o;
|
|
4900
|
-
this.channel.emit(Vi, { name: s, message: i, stack: a }), this.channel.emit(Lo, { newPhase: "errored", storyId: t }), this.
|
|
4901
|
-
o), or.error(`Error rendering story '${t}':`), or.error(o);
|
|
4907
|
+
let { name: s = "Error", message: i = String(o), stack: a } = o, l = this.currentRender?.renderId;
|
|
4908
|
+
this.channel.emit(Vi, { name: s, message: i, stack: a }), this.channel.emit(Lo, { newPhase: "errored", renderId: l, storyId: t }), this.
|
|
4909
|
+
view.showErrorDisplay(o), or.error(`Error rendering story '${t}':`), or.error(o);
|
|
4902
4910
|
}
|
|
4903
4911
|
// renderError is used by the various app layers to inform the user they have done something
|
|
4904
4912
|
// wrong -- for instance returned the wrong thing from a story
|
|
4905
4913
|
renderError(t, { title: o, description: s }) {
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
stack: s
|
|
4910
|
-
});
|
|
4914
|
+
let i = this.currentRender?.renderId;
|
|
4915
|
+
this.channel.emit(Gi, { title: o, description: s }), this.channel.emit(Lo, { newPhase: "errored", renderId: i, storyId: t }), this.view.
|
|
4916
|
+
showErrorDisplay({ message: o, stack: s }), or.error(`Error rendering story ${o}: ${s}`);
|
|
4911
4917
|
}
|
|
4912
4918
|
};
|
|
4913
4919
|
n(st, "PreviewWithSelection");
|
package/dist/telemetry/index.cjs
CHANGED
|
@@ -4128,7 +4128,7 @@ async function Gn(t) {
|
|
|
4128
4128
|
i(Gn, "findPackage");
|
|
4129
4129
|
|
|
4130
4130
|
// package.json
|
|
4131
|
-
var wt = "9.1.0
|
|
4131
|
+
var wt = "9.1.0";
|
|
4132
4132
|
|
|
4133
4133
|
// src/cli/globalSettings.ts
|
|
4134
4134
|
var Rt = T(require("node:fs/promises"), 1), ws = require("node:os"), Zt = require("node:path"), Ne = T(gs(), 1);
|
package/dist/telemetry/index.js
CHANGED