@iress-oss/ids-storybook-config 0.2.6 → 0.2.8
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/index.d.ts +1 -0
- package/dist/main.js +112 -89
- package/dist/types.d.ts +34 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -19,13 +19,13 @@ function Ze(e) {
|
|
|
19
19
|
e !== null && (e < 32 || e === 127)
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function z(e) {
|
|
23
23
|
return e !== null && e < -2;
|
|
24
24
|
}
|
|
25
25
|
function A(e) {
|
|
26
26
|
return e !== null && (e < 0 || e === 32);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function E(e) {
|
|
29
29
|
return e === -2 || e === -1 || e === 32;
|
|
30
30
|
}
|
|
31
31
|
const W = /* @__PURE__ */ N(new RegExp("\\p{P}|\\p{S}", "u")), L = /* @__PURE__ */ N(/\s/);
|
|
@@ -380,10 +380,10 @@ function St(e) {
|
|
|
380
380
|
this.sliceSerialize(e)
|
|
381
381
|
).toLowerCase(), t.label = n;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Et(e) {
|
|
384
384
|
this.exit(e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Dt(e) {
|
|
387
387
|
const n = this.resume(), t = this.stack[this.stack.length - 1];
|
|
388
388
|
t.type, t.identifier = M(
|
|
389
389
|
this.sliceSerialize(e)
|
|
@@ -413,13 +413,13 @@ function Lt() {
|
|
|
413
413
|
},
|
|
414
414
|
exit: {
|
|
415
415
|
gfmFootnoteCallString: St,
|
|
416
|
-
gfmFootnoteCall:
|
|
417
|
-
gfmFootnoteDefinitionLabelString:
|
|
416
|
+
gfmFootnoteCall: Et,
|
|
417
|
+
gfmFootnoteDefinitionLabelString: Dt,
|
|
418
418
|
gfmFootnoteDefinition: Tt
|
|
419
419
|
}
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function It(e) {
|
|
423
423
|
let n = !1;
|
|
424
424
|
return e && e.firstLineBlank && (n = !0), {
|
|
425
425
|
handlers: { footnoteDefinition: t, footnoteReference: we },
|
|
@@ -436,12 +436,12 @@ function zt(e) {
|
|
|
436
436
|
(n ? `
|
|
437
437
|
` : " ") + a.indentLines(
|
|
438
438
|
a.containerFlow(i, u.current()),
|
|
439
|
-
n ? ye :
|
|
439
|
+
n ? ye : zt
|
|
440
440
|
)
|
|
441
441
|
)), s(), o;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function zt(e, n, t) {
|
|
445
445
|
return n === 0 ? e : ye(e, n, t);
|
|
446
446
|
}
|
|
447
447
|
function ye(e, n, t) {
|
|
@@ -455,7 +455,7 @@ const Pt = [
|
|
|
455
455
|
"titleQuote",
|
|
456
456
|
"titleApostrophe"
|
|
457
457
|
];
|
|
458
|
-
Ce.peek =
|
|
458
|
+
Ce.peek = Ht;
|
|
459
459
|
function _t() {
|
|
460
460
|
return {
|
|
461
461
|
canContainEols: ["delete"],
|
|
@@ -490,13 +490,13 @@ function Ce(e, n, t, i) {
|
|
|
490
490
|
after: "~"
|
|
491
491
|
}), r += l.move("~~"), a(), r;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Ht() {
|
|
494
494
|
return "~";
|
|
495
495
|
}
|
|
496
496
|
function Bt(e) {
|
|
497
497
|
return e.length;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function jt(e, n) {
|
|
500
500
|
const t = n || {}, i = (t.align || []).concat(), l = t.stringLength || Bt, a = [], r = [], u = [], o = [];
|
|
501
501
|
let s = 0, f = -1;
|
|
502
502
|
for (; ++f < e.length; ) {
|
|
@@ -844,15 +844,15 @@ function rn(e, n, t, i) {
|
|
|
844
844
|
});
|
|
845
845
|
return /^[\t ]/.test(s) && (s = R(s.charCodeAt(0)) + s.slice(1)), s = s ? r + " " + s : r, t.options.closeAtx && (s += " " + r), o(), u(), s;
|
|
846
846
|
}
|
|
847
|
-
|
|
848
|
-
function
|
|
847
|
+
Ee.peek = on;
|
|
848
|
+
function Ee(e) {
|
|
849
849
|
return e.value || "";
|
|
850
850
|
}
|
|
851
851
|
function on() {
|
|
852
852
|
return "<";
|
|
853
853
|
}
|
|
854
|
-
|
|
855
|
-
function
|
|
854
|
+
De.peek = ln;
|
|
855
|
+
function De(e, n, t, i) {
|
|
856
856
|
const l = te(t), a = l === '"' ? "Quote" : "Apostrophe", r = t.enter("image");
|
|
857
857
|
let u = t.enter("label");
|
|
858
858
|
const o = t.createTracker(i);
|
|
@@ -934,8 +934,8 @@ function Le(e, n) {
|
|
|
934
934
|
// references don’t work), space, or angle brackets…
|
|
935
935
|
!/[\0- <>\u007F]/.test(e.url));
|
|
936
936
|
}
|
|
937
|
-
|
|
938
|
-
function
|
|
937
|
+
Ie.peek = sn;
|
|
938
|
+
function Ie(e, n, t, i) {
|
|
939
939
|
const l = te(t), a = l === '"' ? "Quote" : "Apostrophe", r = t.createTracker(i);
|
|
940
940
|
let u, o;
|
|
941
941
|
if (Le(e, t)) {
|
|
@@ -979,8 +979,8 @@ function ze(e, n, t, i) {
|
|
|
979
979
|
function sn(e, n, t) {
|
|
980
980
|
return Le(e, t) ? "<" : "[";
|
|
981
981
|
}
|
|
982
|
-
|
|
983
|
-
function
|
|
982
|
+
ze.peek = cn;
|
|
983
|
+
function ze(e, n, t, i) {
|
|
984
984
|
const l = e.referenceType, a = t.enter("linkReference");
|
|
985
985
|
let r = t.enter("label");
|
|
986
986
|
const u = t.createTracker(i);
|
|
@@ -1187,12 +1187,12 @@ const Re = {
|
|
|
1187
1187
|
emphasis: Ae,
|
|
1188
1188
|
hardBreak: fe,
|
|
1189
1189
|
heading: rn,
|
|
1190
|
-
html:
|
|
1191
|
-
image:
|
|
1190
|
+
html: Ee,
|
|
1191
|
+
image: De,
|
|
1192
1192
|
imageReference: Te,
|
|
1193
1193
|
inlineCode: Fe,
|
|
1194
|
-
link:
|
|
1195
|
-
linkReference:
|
|
1194
|
+
link: Ie,
|
|
1195
|
+
linkReference: ze,
|
|
1196
1196
|
list: mn,
|
|
1197
1197
|
listItem: gn,
|
|
1198
1198
|
paragraph: kn,
|
|
@@ -1207,11 +1207,11 @@ function vn() {
|
|
|
1207
1207
|
table: Sn,
|
|
1208
1208
|
tableData: me,
|
|
1209
1209
|
tableHeader: me,
|
|
1210
|
-
tableRow:
|
|
1210
|
+
tableRow: Dn
|
|
1211
1211
|
},
|
|
1212
1212
|
exit: {
|
|
1213
1213
|
codeText: Tn,
|
|
1214
|
-
table:
|
|
1214
|
+
table: En,
|
|
1215
1215
|
tableData: J,
|
|
1216
1216
|
tableHeader: J,
|
|
1217
1217
|
tableRow: J
|
|
@@ -1231,10 +1231,10 @@ function Sn(e) {
|
|
|
1231
1231
|
e
|
|
1232
1232
|
), this.data.inTable = !0;
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function En(e) {
|
|
1235
1235
|
this.exit(e), this.data.inTable = void 0;
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function Dn(e) {
|
|
1238
1238
|
this.enter({ type: "tableRow", children: [] }, e);
|
|
1239
1239
|
}
|
|
1240
1240
|
function J(e) {
|
|
@@ -1298,7 +1298,7 @@ function Ln(e) {
|
|
|
1298
1298
|
return x(), k(), w;
|
|
1299
1299
|
}
|
|
1300
1300
|
function s(g, m) {
|
|
1301
|
-
return
|
|
1301
|
+
return jt(g, {
|
|
1302
1302
|
align: m,
|
|
1303
1303
|
// @ts-expect-error: `markdown-table` types should support `null`.
|
|
1304
1304
|
alignDelimiters: i,
|
|
@@ -1329,7 +1329,7 @@ function Ln(e) {
|
|
|
1329
1329
|
return d.stack.includes("tableCell") && (b = b.replace(/\|/g, "\\$&")), b;
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function In() {
|
|
1333
1333
|
return {
|
|
1334
1334
|
exit: {
|
|
1335
1335
|
taskListCheckValueChecked: pe,
|
|
@@ -1338,7 +1338,7 @@ function zn() {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
};
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function zn() {
|
|
1342
1342
|
return {
|
|
1343
1343
|
unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
|
|
1344
1344
|
handlers: { listItem: _n }
|
|
@@ -1387,21 +1387,21 @@ function Rn() {
|
|
|
1387
1387
|
Lt(),
|
|
1388
1388
|
_t(),
|
|
1389
1389
|
vn(),
|
|
1390
|
-
|
|
1390
|
+
In()
|
|
1391
1391
|
];
|
|
1392
1392
|
}
|
|
1393
1393
|
function Mn(e) {
|
|
1394
1394
|
return {
|
|
1395
1395
|
extensions: [
|
|
1396
1396
|
ct(),
|
|
1397
|
-
|
|
1397
|
+
It(e),
|
|
1398
1398
|
Rt(),
|
|
1399
1399
|
Ln(e),
|
|
1400
|
-
|
|
1400
|
+
zn()
|
|
1401
1401
|
]
|
|
1402
1402
|
};
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1404
|
+
function j(e, n, t, i) {
|
|
1405
1405
|
const l = e.length;
|
|
1406
1406
|
let a = 0, r;
|
|
1407
1407
|
if (n < 0 ? n = -n > l ? 0 : l + n : n = n > l ? l : n, t = t > 0 ? t : 0, i.length < 1e4)
|
|
@@ -1415,10 +1415,10 @@ function On(e) {
|
|
|
1415
1415
|
const n = {};
|
|
1416
1416
|
let t = -1;
|
|
1417
1417
|
for (; ++t < e.length; )
|
|
1418
|
-
|
|
1418
|
+
Hn(n, e[t]);
|
|
1419
1419
|
return n;
|
|
1420
1420
|
}
|
|
1421
|
-
function
|
|
1421
|
+
function Hn(e, n) {
|
|
1422
1422
|
let t;
|
|
1423
1423
|
for (t in n) {
|
|
1424
1424
|
const l = (ge.call(e, t) ? e[t] : void 0) || (e[t] = {}), a = n[t];
|
|
@@ -1440,9 +1440,9 @@ function Bn(e, n) {
|
|
|
1440
1440
|
const i = [];
|
|
1441
1441
|
for (; ++t < n.length; )
|
|
1442
1442
|
(n[t].add === "after" ? e : i).push(n[t]);
|
|
1443
|
-
|
|
1443
|
+
j(e, 0, 0, i);
|
|
1444
1444
|
}
|
|
1445
|
-
const
|
|
1445
|
+
const jn = {
|
|
1446
1446
|
tokenize: Vn,
|
|
1447
1447
|
partial: !0
|
|
1448
1448
|
}, Me = {
|
|
@@ -1451,7 +1451,7 @@ const Hn = {
|
|
|
1451
1451
|
}, Oe = {
|
|
1452
1452
|
tokenize: Qn,
|
|
1453
1453
|
partial: !0
|
|
1454
|
-
},
|
|
1454
|
+
}, He = {
|
|
1455
1455
|
tokenize: Zn,
|
|
1456
1456
|
partial: !0
|
|
1457
1457
|
}, $n = {
|
|
@@ -1461,7 +1461,7 @@ const Hn = {
|
|
|
1461
1461
|
name: "wwwAutolink",
|
|
1462
1462
|
tokenize: Nn,
|
|
1463
1463
|
previous: $e
|
|
1464
|
-
},
|
|
1464
|
+
}, je = {
|
|
1465
1465
|
name: "protocolAutolink",
|
|
1466
1466
|
tokenize: Un,
|
|
1467
1467
|
previous: qe
|
|
@@ -1482,8 +1482,8 @@ S[43] = T;
|
|
|
1482
1482
|
S[45] = T;
|
|
1483
1483
|
S[46] = T;
|
|
1484
1484
|
S[95] = T;
|
|
1485
|
-
S[72] = [T,
|
|
1486
|
-
S[104] = [T,
|
|
1485
|
+
S[72] = [T, je];
|
|
1486
|
+
S[104] = [T, je];
|
|
1487
1487
|
S[87] = [T, Be];
|
|
1488
1488
|
S[119] = [T, Be];
|
|
1489
1489
|
function Wn(e, n, t) {
|
|
@@ -1510,7 +1510,7 @@ function Nn(e, n, t) {
|
|
|
1510
1510
|
const i = this;
|
|
1511
1511
|
return l;
|
|
1512
1512
|
function l(r) {
|
|
1513
|
-
return r !== 87 && r !== 119 || !$e.call(i, i.previous) || re(i.events) ? t(r) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(
|
|
1513
|
+
return r !== 87 && r !== 119 || !$e.call(i, i.previous) || re(i.events) ? t(r) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(jn, e.attempt(Me, e.attempt(Oe, a), t), t)(r));
|
|
1514
1514
|
}
|
|
1515
1515
|
function a(r) {
|
|
1516
1516
|
return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), n(r);
|
|
@@ -1557,7 +1557,7 @@ function Gn(e, n, t) {
|
|
|
1557
1557
|
let i, l, a;
|
|
1558
1558
|
return r;
|
|
1559
1559
|
function r(s) {
|
|
1560
|
-
return s === 46 || s === 95 ? e.check(
|
|
1560
|
+
return s === 46 || s === 95 ? e.check(He, o, u)(s) : s === null || A(s) || L(s) || s !== 45 && W(s) ? o(s) : (a = !0, e.consume(s), r);
|
|
1561
1561
|
}
|
|
1562
1562
|
function u(s) {
|
|
1563
1563
|
return s === 95 ? i = !0 : (l = i, i = void 0), e.consume(s), r;
|
|
@@ -1570,7 +1570,7 @@ function Qn(e, n) {
|
|
|
1570
1570
|
let t = 0, i = 0;
|
|
1571
1571
|
return l;
|
|
1572
1572
|
function l(r) {
|
|
1573
|
-
return r === 40 ? (t++, e.consume(r), l) : r === 41 && i < t ? a(r) : r === 33 || r === 34 || r === 38 || r === 39 || r === 41 || r === 42 || r === 44 || r === 46 || r === 58 || r === 59 || r === 60 || r === 63 || r === 93 || r === 95 || r === 126 ? e.check(
|
|
1573
|
+
return r === 40 ? (t++, e.consume(r), l) : r === 41 && i < t ? a(r) : r === 33 || r === 34 || r === 38 || r === 39 || r === 41 || r === 42 || r === 44 || r === 46 || r === 58 || r === 59 || r === 60 || r === 63 || r === 93 || r === 95 || r === 126 ? e.check(He, n, a)(r) : r === null || A(r) || L(r) ? n(r) : (e.consume(r), l);
|
|
1574
1574
|
}
|
|
1575
1575
|
function a(r) {
|
|
1576
1576
|
return r === 41 && i++, e.consume(r), l;
|
|
@@ -1640,15 +1640,15 @@ function Jn(e, n, t) {
|
|
|
1640
1640
|
}
|
|
1641
1641
|
return n;
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1643
|
+
function D(e, n, t, i) {
|
|
1644
1644
|
const l = i ? i - 1 : Number.POSITIVE_INFINITY;
|
|
1645
1645
|
let a = 0;
|
|
1646
1646
|
return r;
|
|
1647
1647
|
function r(o) {
|
|
1648
|
-
return
|
|
1648
|
+
return E(o) ? (e.enter(t), u(o)) : n(o);
|
|
1649
1649
|
}
|
|
1650
1650
|
function u(o) {
|
|
1651
|
-
return
|
|
1651
|
+
return E(o) && a++ < l ? (e.consume(o), u) : (e.exit(t), n(o));
|
|
1652
1652
|
}
|
|
1653
1653
|
}
|
|
1654
1654
|
const Xn = {
|
|
@@ -1658,10 +1658,10 @@ const Xn = {
|
|
|
1658
1658
|
function Yn(e, n, t) {
|
|
1659
1659
|
return i;
|
|
1660
1660
|
function i(a) {
|
|
1661
|
-
return
|
|
1661
|
+
return E(a) ? D(e, l, "linePrefix")(a) : l(a);
|
|
1662
1662
|
}
|
|
1663
1663
|
function l(a) {
|
|
1664
|
-
return a === null ||
|
|
1664
|
+
return a === null || z(a) ? n(a) : t(a);
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
const er = {
|
|
@@ -1829,7 +1829,7 @@ function or(e, n, t) {
|
|
|
1829
1829
|
return m === 91 || m === 92 || m === 93 ? (e.consume(m), r++, f) : f(m);
|
|
1830
1830
|
}
|
|
1831
1831
|
function p(m) {
|
|
1832
|
-
return m === 58 ? (e.enter("definitionMarker"), e.consume(m), e.exit("definitionMarker"), l.includes(a) || l.push(a),
|
|
1832
|
+
return m === 58 ? (e.enter("definitionMarker"), e.consume(m), e.exit("definitionMarker"), l.includes(a) || l.push(a), D(e, g, "gfmFootnoteDefinitionWhitespace")) : t(m);
|
|
1833
1833
|
}
|
|
1834
1834
|
function g(m) {
|
|
1835
1835
|
return n(m);
|
|
@@ -1843,7 +1843,7 @@ function ar(e) {
|
|
|
1843
1843
|
}
|
|
1844
1844
|
function ur(e, n, t) {
|
|
1845
1845
|
const i = this;
|
|
1846
|
-
return
|
|
1846
|
+
return D(e, l, "gfmFootnoteDefinitionIndent", 5);
|
|
1847
1847
|
function l(a) {
|
|
1848
1848
|
const r = i.events[i.events.length - 1];
|
|
1849
1849
|
return r && r[1].type === "gfmFootnoteDefinitionIndent" && r[2].sliceSerialize(r[1], !0).length === 4 ? n(a) : t(a);
|
|
@@ -1885,7 +1885,7 @@ function sr(e) {
|
|
|
1885
1885
|
start: Object.assign({}, r[s][1].end),
|
|
1886
1886
|
end: Object.assign({}, r[o][1].start)
|
|
1887
1887
|
}, p = [["enter", f, u], ["enter", r[s][1], u], ["exit", r[s][1], u], ["enter", c, u]], g = u.parser.constructs.insideSpan.null;
|
|
1888
|
-
g &&
|
|
1888
|
+
g && j(p, p.length, 0, Jn(g, r.slice(s + 1, o), u)), j(p, p.length, 0, [["exit", c, u], ["enter", r[o][1], u], ["exit", r[o][1], u], ["exit", f, u]]), j(r, s - 1, o - s + 3, p), o = s + p.length - 2;
|
|
1889
1889
|
break;
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
@@ -2031,7 +2031,7 @@ function pr(e, n, t) {
|
|
|
2031
2031
|
return h === 124 || (r = !0, a += 1), f(h);
|
|
2032
2032
|
}
|
|
2033
2033
|
function f(h) {
|
|
2034
|
-
return h === null ? t(h) :
|
|
2034
|
+
return h === null ? t(h) : z(h) ? a > 1 ? (a = 0, i.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), g) : t(h) : E(h) ? D(e, f, "whitespace")(h) : (a += 1, r && (r = !1, l += 1), h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), r = !0, f) : (e.enter("data"), c(h)));
|
|
2035
2035
|
}
|
|
2036
2036
|
function c(h) {
|
|
2037
2037
|
return h === null || h === 124 || A(h) ? (e.exit("data"), f(h)) : (e.consume(h), h === 92 ? p : c);
|
|
@@ -2040,16 +2040,16 @@ function pr(e, n, t) {
|
|
|
2040
2040
|
return h === 92 || h === 124 ? (e.consume(h), c) : c(h);
|
|
2041
2041
|
}
|
|
2042
2042
|
function g(h) {
|
|
2043
|
-
return i.interrupt = !1, i.parser.lazy[i.now().line] ? t(h) : (e.enter("tableDelimiterRow"), r = !1,
|
|
2043
|
+
return i.interrupt = !1, i.parser.lazy[i.now().line] ? t(h) : (e.enter("tableDelimiterRow"), r = !1, E(h) ? D(e, m, "linePrefix", i.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : m(h));
|
|
2044
2044
|
}
|
|
2045
2045
|
function m(h) {
|
|
2046
2046
|
return h === 45 || h === 58 ? b(h) : h === 124 ? (r = !0, e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), d) : C(h);
|
|
2047
2047
|
}
|
|
2048
2048
|
function d(h) {
|
|
2049
|
-
return
|
|
2049
|
+
return E(h) ? D(e, b, "whitespace")(h) : b(h);
|
|
2050
2050
|
}
|
|
2051
2051
|
function b(h) {
|
|
2052
|
-
return h === 58 ? (a += 1, r = !0, e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), k) : h === 45 ? (a += 1, k(h)) : h === null ||
|
|
2052
|
+
return h === 58 ? (a += 1, r = !0, e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), k) : h === 45 ? (a += 1, k(h)) : h === null || z(h) ? v(h) : C(h);
|
|
2053
2053
|
}
|
|
2054
2054
|
function k(h) {
|
|
2055
2055
|
return h === 45 ? (e.enter("tableDelimiterFiller"), x(h)) : C(h);
|
|
@@ -2058,10 +2058,10 @@ function pr(e, n, t) {
|
|
|
2058
2058
|
return h === 45 ? (e.consume(h), x) : h === 58 ? (r = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), w) : (e.exit("tableDelimiterFiller"), w(h));
|
|
2059
2059
|
}
|
|
2060
2060
|
function w(h) {
|
|
2061
|
-
return
|
|
2061
|
+
return E(h) ? D(e, v, "whitespace")(h) : v(h);
|
|
2062
2062
|
}
|
|
2063
2063
|
function v(h) {
|
|
2064
|
-
return h === 124 ? m(h) : h === null ||
|
|
2064
|
+
return h === 124 ? m(h) : h === null || z(h) ? !r || l !== a ? C(h) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(h)) : C(h);
|
|
2065
2065
|
}
|
|
2066
2066
|
function C(h) {
|
|
2067
2067
|
return t(h);
|
|
@@ -2070,13 +2070,13 @@ function pr(e, n, t) {
|
|
|
2070
2070
|
return e.enter("tableRow"), O(h);
|
|
2071
2071
|
}
|
|
2072
2072
|
function O(h) {
|
|
2073
|
-
return h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), O) : h === null ||
|
|
2073
|
+
return h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), O) : h === null || z(h) ? (e.exit("tableRow"), n(h)) : E(h) ? D(e, O, "whitespace")(h) : (e.enter("data"), H(h));
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2076
|
-
return h === null || h === 124 || A(h) ? (e.exit("data"), O(h)) : (e.consume(h), h === 92 ? Ne :
|
|
2075
|
+
function H(h) {
|
|
2076
|
+
return h === null || h === 124 || A(h) ? (e.exit("data"), O(h)) : (e.consume(h), h === 92 ? Ne : H);
|
|
2077
2077
|
}
|
|
2078
2078
|
function Ne(h) {
|
|
2079
|
-
return h === 92 || h === 124 ? (e.consume(h),
|
|
2079
|
+
return h === 92 || h === 124 ? (e.consume(h), H) : H(h);
|
|
2080
2080
|
}
|
|
2081
2081
|
}
|
|
2082
2082
|
function gr(e, n) {
|
|
@@ -2104,15 +2104,15 @@ function gr(e, n) {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
function B(e, n, t, i, l, a) {
|
|
2106
2106
|
const r = i === 1 ? "tableHeader" : i === 2 ? "tableDelimiter" : "tableData", u = "tableContent";
|
|
2107
|
-
t[0] !== 0 && (a.end = Object.assign({},
|
|
2108
|
-
const o =
|
|
2107
|
+
t[0] !== 0 && (a.end = Object.assign({}, I(n.events, t[0])), e.add(t[0], 0, [["exit", a, n]]));
|
|
2108
|
+
const o = I(n.events, t[1]);
|
|
2109
2109
|
if (a = {
|
|
2110
2110
|
type: r,
|
|
2111
2111
|
start: Object.assign({}, o),
|
|
2112
2112
|
// Note: correct end is set later.
|
|
2113
2113
|
end: Object.assign({}, o)
|
|
2114
2114
|
}, e.add(t[1], 0, [["enter", a, n]]), t[2] !== 0) {
|
|
2115
|
-
const s =
|
|
2115
|
+
const s = I(n.events, t[2]), f = I(n.events, t[3]), c = {
|
|
2116
2116
|
type: u,
|
|
2117
2117
|
start: Object.assign({}, s),
|
|
2118
2118
|
end: Object.assign({}, f)
|
|
@@ -2126,13 +2126,13 @@ function B(e, n, t, i, l, a) {
|
|
|
2126
2126
|
}
|
|
2127
2127
|
e.add(t[3] + 1, 0, [["exit", c, n]]);
|
|
2128
2128
|
}
|
|
2129
|
-
return l !== void 0 && (a.end = Object.assign({},
|
|
2129
|
+
return l !== void 0 && (a.end = Object.assign({}, I(n.events, l)), e.add(l, 0, [["exit", a, n]]), a = void 0), a;
|
|
2130
2130
|
}
|
|
2131
2131
|
function ke(e, n, t, i, l) {
|
|
2132
|
-
const a = [], r =
|
|
2132
|
+
const a = [], r = I(n.events, t);
|
|
2133
2133
|
l && (l.end = Object.assign({}, r), a.push(["exit", l, n])), i.end = Object.assign({}, r), a.push(["exit", i, n]), e.add(t + 1, 0, a);
|
|
2134
2134
|
}
|
|
2135
|
-
function
|
|
2135
|
+
function I(e, n) {
|
|
2136
2136
|
const t = e[n], i = t[0] === "enter" ? "start" : "end";
|
|
2137
2137
|
return t[1][i];
|
|
2138
2138
|
}
|
|
@@ -2165,13 +2165,13 @@ function br(e, n, t) {
|
|
|
2165
2165
|
return o === 93 ? (e.enter("taskListCheckMarker"), e.consume(o), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(o);
|
|
2166
2166
|
}
|
|
2167
2167
|
function u(o) {
|
|
2168
|
-
return
|
|
2168
|
+
return z(o) ? n(o) : E(o) ? e.check({
|
|
2169
2169
|
tokenize: xr
|
|
2170
2170
|
}, n, t)(o) : t(o);
|
|
2171
2171
|
}
|
|
2172
2172
|
}
|
|
2173
2173
|
function xr(e, n, t) {
|
|
2174
|
-
return
|
|
2174
|
+
return D(e, i, "whitespace");
|
|
2175
2175
|
function i(l) {
|
|
2176
2176
|
return l === null ? t(l) : n(l);
|
|
2177
2177
|
}
|
|
@@ -2309,7 +2309,7 @@ const Ar = /* @__PURE__ */ Qe(import.meta.url), vr = /* @__PURE__ */ Ue(Ar), Sr
|
|
|
2309
2309
|
const frames = document.querySelectorAll('iframe');
|
|
2310
2310
|
frames.forEach((f) => {
|
|
2311
2311
|
try {
|
|
2312
|
-
f.contentWindow?.postMessage({ type: 'LOAD_THEME', data }, '*');
|
|
2312
|
+
f.contentWindow?.postMessage({ type: 'LOAD_THEME', ...data }, '*');
|
|
2313
2313
|
} catch (err) {
|
|
2314
2314
|
console.debug('[Storybook Host] Skipped frame broadcast:', err);
|
|
2315
2315
|
}
|
|
@@ -2329,33 +2329,56 @@ const Ar = /* @__PURE__ */ Qe(import.meta.url), vr = /* @__PURE__ */ Ue(Ar), Sr
|
|
|
2329
2329
|
return;
|
|
2330
2330
|
}
|
|
2331
2331
|
|
|
2332
|
-
const { name, href, css } = event.data;
|
|
2332
|
+
const { name, href, css, fonts = [] } = event.data;
|
|
2333
2333
|
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2334
|
+
let existingHref = document.getElementById('storybook-config-theme-href');
|
|
2335
|
+
let existingCss = document.getElementById('storybook-config-theme-css');
|
|
2336
|
+
const existingTheme = document.documentElement.getAttribute('data-theme');
|
|
2337
|
+
|
|
2338
|
+
if (existingTheme) {
|
|
2339
|
+
document.documentElement.classList.remove(existingTheme);
|
|
2339
2340
|
}
|
|
2340
2341
|
|
|
2341
|
-
if (
|
|
2342
|
-
|
|
2342
|
+
if (!name) {
|
|
2343
|
+
existingHref?.remove();
|
|
2344
|
+
existingCss?.remove();
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2343
2347
|
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
+
if (href) {
|
|
2349
|
+
if (!existingHref) {
|
|
2350
|
+
existingHref = document.createElement('link');
|
|
2351
|
+
existingHref.rel = 'stylesheet';
|
|
2352
|
+
existingHref.id = 'storybook-config-theme-href';
|
|
2353
|
+
document.head.appendChild(existingHref);
|
|
2348
2354
|
}
|
|
2349
2355
|
|
|
2350
|
-
|
|
2356
|
+
existingHref.href = href;
|
|
2351
2357
|
}
|
|
2352
2358
|
|
|
2353
|
-
|
|
2359
|
+
if (css) {
|
|
2360
|
+
if (!existingCss) {
|
|
2361
|
+
existingCss = document.createElement('style');
|
|
2362
|
+
existingCss.id = 'storybook-config-theme-css';
|
|
2363
|
+
document.head.appendChild(existingCss);
|
|
2364
|
+
}
|
|
2354
2365
|
|
|
2355
|
-
|
|
2356
|
-
document.documentElement.classList.remove(currentTheme);
|
|
2366
|
+
existingCss.innerHTML = css;
|
|
2357
2367
|
}
|
|
2358
2368
|
|
|
2369
|
+
fonts?.forEach((font) => {
|
|
2370
|
+
const existingFont = document.querySelector(\`link[href="\${font}"]\`);
|
|
2371
|
+
|
|
2372
|
+
if (existingFont) {
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
const link = document.createElement('link');
|
|
2377
|
+
link.rel = 'stylesheet';
|
|
2378
|
+
link.href = font;
|
|
2379
|
+
document.head.appendChild(link);
|
|
2380
|
+
});
|
|
2381
|
+
|
|
2359
2382
|
document.documentElement.setAttribute('data-theme', name);
|
|
2360
2383
|
document.documentElement.classList.add(name);
|
|
2361
2384
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -9,3 +9,37 @@ export interface ParametersConfig {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export type ReactElementToJSXStringOptions = Exclude<Parameters<typeof reactElementToJSXString>[1], undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Event for broadcasting hash changes from a parent window to an iframe Storybook instance.
|
|
14
|
+
* Used to communicate hash changes between Storybook compositions.
|
|
15
|
+
*/
|
|
16
|
+
export interface BroadcastHashEvent {
|
|
17
|
+
type: 'UPDATE_HASH';
|
|
18
|
+
hash: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Event for passing theme data between the parent window and iframe Storybook instances.
|
|
22
|
+
* Used to synchronize themes across Storybook compositions.
|
|
23
|
+
*/
|
|
24
|
+
export interface PassThemeEvent {
|
|
25
|
+
type: 'PASS_THEME';
|
|
26
|
+
/**
|
|
27
|
+
* Name of the theme.
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional href to a CSS file for the theme.
|
|
32
|
+
*/
|
|
33
|
+
href?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional raw CSS string for the theme.
|
|
36
|
+
*/
|
|
37
|
+
css?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Event for loading a theme in an iframe Storybook instance.
|
|
41
|
+
* Sent from the parent window to apply the selected theme.
|
|
42
|
+
*/
|
|
43
|
+
export interface LoadThemeEvent extends Omit<PassThemeEvent, 'type'> {
|
|
44
|
+
type: 'LOAD_THEME';
|
|
45
|
+
}
|