react-blockkit 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/Elements.d.ts +1 -1
- package/dist/elements/Elements.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +945 -920
- package/dist/index.js.map +1 -1
- package/dist/text/Mrkdwn.d.ts.map +1 -1
- package/dist/text/RichText.d.ts.map +1 -1
- package/dist/text/date.d.ts.map +1 -1
- package/dist/types.d.ts +57 -57
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@stylexjs+stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
4
|
+
var f = {}, p;
|
|
5
|
+
function m() {
|
|
6
|
+
if (p) return f;
|
|
7
|
+
p = 1, Object.defineProperty(f, "__esModule", { value: !0 }), f.styleq = void 0;
|
|
8
8
|
var e = /* @__PURE__ */ new WeakMap(), t = "$$css";
|
|
9
9
|
function n(n) {
|
|
10
10
|
var r, i, a;
|
|
@@ -24,35 +24,35 @@ function p() {
|
|
|
24
24
|
var g = l.get(m);
|
|
25
25
|
g != null && (h = g[0], c = g[2], n.push.apply(n, g[1]), l = g[3]);
|
|
26
26
|
} else {
|
|
27
|
-
var
|
|
28
|
-
for (var
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
|
|
27
|
+
var _ = [];
|
|
28
|
+
for (var v in m) {
|
|
29
|
+
var y = m[v];
|
|
30
|
+
if (v === t) {
|
|
31
|
+
var b = m[v];
|
|
32
|
+
b !== !0 && (c = c ? b + "; " + c : b);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
typeof
|
|
35
|
+
typeof y == "string" || y === null ? n.includes(v) || (n.push(v), l != null && _.push(v), typeof y == "string" && (h += h ? " " + y : y)) : console.error(`styleq: ${v} typeof ${String(y)} is not "string" or "null".`);
|
|
36
36
|
}
|
|
37
37
|
if (l != null) {
|
|
38
|
-
var
|
|
38
|
+
var x = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
l.set(m, [
|
|
40
40
|
h,
|
|
41
|
-
|
|
41
|
+
_,
|
|
42
42
|
c,
|
|
43
|
-
|
|
44
|
-
]), l =
|
|
43
|
+
x
|
|
44
|
+
]), l = x;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
h && (o = o ? h + " " + o : h);
|
|
48
48
|
} else if (i) s ??= {}, s = Object.assign({}, m, s);
|
|
49
49
|
else {
|
|
50
|
-
var
|
|
51
|
-
for (var
|
|
52
|
-
var
|
|
53
|
-
|
|
50
|
+
var S = null;
|
|
51
|
+
for (var C in m) {
|
|
52
|
+
var w = m[C];
|
|
53
|
+
w !== void 0 && (n.includes(C) || (w != null && (s ??= {}, S ??= {}, S[C] = w), n.push(C), l = null));
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
S != null && (s = Object.assign(S, s));
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -63,29 +63,29 @@ function p() {
|
|
|
63
63
|
];
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
var r =
|
|
67
|
-
return r.factory = n,
|
|
66
|
+
var r = f.styleq = n();
|
|
67
|
+
return r.factory = n, f;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
let [t, n, r] =
|
|
69
|
+
var h = /*@__PURE__*/ m();
|
|
70
|
+
function g(...e) {
|
|
71
|
+
let [t, n, r] = h.styleq(e), i = {};
|
|
72
72
|
return t != null && t !== "" && (i.className = t), n != null && Object.keys(n).length > 0 && (i.style = n), r != null && r !== "" && (i["data-style-src"] = r), i;
|
|
73
73
|
}
|
|
74
74
|
Object.freeze({});
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/assert-never.ts
|
|
77
|
-
function
|
|
77
|
+
function _(e) {
|
|
78
78
|
throw TypeError(`Unreachable value: ${JSON.stringify(e)}`);
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/context.tsx
|
|
82
|
-
var
|
|
82
|
+
var v = {}, y = e({
|
|
83
83
|
onAction: void 0,
|
|
84
|
-
resolvers:
|
|
84
|
+
resolvers: v,
|
|
85
85
|
surface: "message"
|
|
86
86
|
});
|
|
87
|
-
function
|
|
88
|
-
let i =
|
|
87
|
+
function b({ children: e, onAction: t, resolvers: n = v, surface: r = "message" }) {
|
|
88
|
+
let i = o(() => ({
|
|
89
89
|
onAction: t,
|
|
90
90
|
resolvers: n,
|
|
91
91
|
surface: r
|
|
@@ -94,27 +94,27 @@ function v({ children: e, onAction: t, resolvers: n = ee, surface: r = "message"
|
|
|
94
94
|
n,
|
|
95
95
|
r
|
|
96
96
|
]);
|
|
97
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ u(y.Provider, {
|
|
98
98
|
value: i,
|
|
99
99
|
children: e
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return r(
|
|
102
|
+
function x() {
|
|
103
|
+
return r(y);
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/runtime.ts
|
|
107
|
-
function
|
|
107
|
+
function S(e) {
|
|
108
108
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
110
|
+
function C(e) {
|
|
111
|
+
if (S(e)) return typeof e.type == "string" ? e.type : void 0;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
113
|
+
function w(e) {
|
|
114
|
+
if (S(e)) return typeof e.block_id == "string" ? e.block_id : void 0;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
if (!
|
|
116
|
+
function T(e, t) {
|
|
117
|
+
if (!S(e)) return `Unsupported ${t}`;
|
|
118
118
|
for (let t of [
|
|
119
119
|
"text",
|
|
120
120
|
"label",
|
|
@@ -125,17 +125,17 @@ function C(e, t) {
|
|
|
125
125
|
let n = e[t];
|
|
126
126
|
if (typeof n == "string" && n.length > 0) return n;
|
|
127
127
|
}
|
|
128
|
-
let n =
|
|
128
|
+
let n = C(e);
|
|
129
129
|
return n === void 0 ? `Unsupported ${t}` : `Unsupported ${t}: ${n}`;
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/safe-url.ts
|
|
133
|
-
function
|
|
133
|
+
function E(e) {
|
|
134
134
|
return e !== void 0 && /^(?:https?:|mailto:)/i.test(e) ? e : void 0;
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
137
|
//#region src/tokens.stylex.ts
|
|
138
|
-
var
|
|
138
|
+
var ee = {
|
|
139
139
|
surface: "var(--xf210bc)",
|
|
140
140
|
surfaceRaised: "var(--xop8b6t)",
|
|
141
141
|
surfaceSunken: "var(--xajfn77)",
|
|
@@ -206,13 +206,13 @@ var te = {
|
|
|
206
206
|
chartSeriesTint5: "var(--x1nud87m)",
|
|
207
207
|
chartSeriesTint6: "var(--x1t1bkho)",
|
|
208
208
|
__varGroupHash__: "xpd22m1"
|
|
209
|
-
},
|
|
209
|
+
}, te = {
|
|
210
210
|
xpd22m1: "x1l73jb5 xpd22m1",
|
|
211
211
|
$$css: !0
|
|
212
|
-
},
|
|
212
|
+
}, ne = {
|
|
213
213
|
xpd22m1: "xky7mqn xpd22m1",
|
|
214
214
|
$$css: !0
|
|
215
|
-
},
|
|
215
|
+
}, D = {
|
|
216
216
|
root: {
|
|
217
217
|
kWkggS: "xfs8zev",
|
|
218
218
|
kMwMTN: "xr3bju4",
|
|
@@ -1263,7 +1263,7 @@ var te = {
|
|
|
1263
1263
|
kzqmXN: "x1i1rx1s",
|
|
1264
1264
|
$$css: !0
|
|
1265
1265
|
}
|
|
1266
|
-
},
|
|
1266
|
+
}, O = {
|
|
1267
1267
|
fill1: {
|
|
1268
1268
|
kDwRjp: "xtzl89e",
|
|
1269
1269
|
$$css: !0
|
|
@@ -1432,86 +1432,86 @@ var te = {
|
|
|
1432
1432
|
kDwRjp: "x1mnwzol",
|
|
1433
1433
|
$$css: !0
|
|
1434
1434
|
}
|
|
1435
|
-
},
|
|
1436
|
-
fill:
|
|
1437
|
-
stroke:
|
|
1438
|
-
swatch:
|
|
1439
|
-
tint:
|
|
1440
|
-
},
|
|
1441
|
-
|
|
1435
|
+
}, re = {
|
|
1436
|
+
fill: O.fill1,
|
|
1437
|
+
stroke: O.stroke1,
|
|
1438
|
+
swatch: O.swatch1,
|
|
1439
|
+
tint: O.tint1
|
|
1440
|
+
}, ie = [
|
|
1441
|
+
re,
|
|
1442
1442
|
{
|
|
1443
|
-
fill:
|
|
1444
|
-
stroke:
|
|
1445
|
-
swatch:
|
|
1446
|
-
tint:
|
|
1443
|
+
fill: O.fill2,
|
|
1444
|
+
stroke: O.stroke2,
|
|
1445
|
+
swatch: O.swatch2,
|
|
1446
|
+
tint: O.tint2
|
|
1447
1447
|
},
|
|
1448
1448
|
{
|
|
1449
|
-
fill:
|
|
1450
|
-
stroke:
|
|
1451
|
-
swatch:
|
|
1452
|
-
tint:
|
|
1449
|
+
fill: O.fill3,
|
|
1450
|
+
stroke: O.stroke3,
|
|
1451
|
+
swatch: O.swatch3,
|
|
1452
|
+
tint: O.tint3
|
|
1453
1453
|
},
|
|
1454
1454
|
{
|
|
1455
|
-
fill:
|
|
1456
|
-
stroke:
|
|
1457
|
-
swatch:
|
|
1458
|
-
tint:
|
|
1455
|
+
fill: O.fill4,
|
|
1456
|
+
stroke: O.stroke4,
|
|
1457
|
+
swatch: O.swatch4,
|
|
1458
|
+
tint: O.tint4
|
|
1459
1459
|
},
|
|
1460
1460
|
{
|
|
1461
|
-
fill:
|
|
1462
|
-
stroke:
|
|
1463
|
-
swatch:
|
|
1464
|
-
tint:
|
|
1461
|
+
fill: O.fill5,
|
|
1462
|
+
stroke: O.stroke5,
|
|
1463
|
+
swatch: O.swatch5,
|
|
1464
|
+
tint: O.tint5
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
1467
|
-
fill:
|
|
1468
|
-
stroke:
|
|
1469
|
-
swatch:
|
|
1470
|
-
tint:
|
|
1467
|
+
fill: O.fill6,
|
|
1468
|
+
stroke: O.stroke6,
|
|
1469
|
+
swatch: O.swatch6,
|
|
1470
|
+
tint: O.tint6
|
|
1471
1471
|
},
|
|
1472
1472
|
{
|
|
1473
|
-
fill:
|
|
1474
|
-
stroke:
|
|
1475
|
-
swatch:
|
|
1476
|
-
tint:
|
|
1473
|
+
fill: O.fill7,
|
|
1474
|
+
stroke: O.stroke7,
|
|
1475
|
+
swatch: O.swatch7,
|
|
1476
|
+
tint: O.fill7
|
|
1477
1477
|
},
|
|
1478
1478
|
{
|
|
1479
|
-
fill:
|
|
1480
|
-
stroke:
|
|
1481
|
-
swatch:
|
|
1482
|
-
tint:
|
|
1479
|
+
fill: O.fill8,
|
|
1480
|
+
stroke: O.stroke8,
|
|
1481
|
+
swatch: O.swatch8,
|
|
1482
|
+
tint: O.fill8
|
|
1483
1483
|
},
|
|
1484
1484
|
{
|
|
1485
|
-
fill:
|
|
1486
|
-
stroke:
|
|
1487
|
-
swatch:
|
|
1488
|
-
tint:
|
|
1485
|
+
fill: O.fill9,
|
|
1486
|
+
stroke: O.stroke9,
|
|
1487
|
+
swatch: O.swatch9,
|
|
1488
|
+
tint: O.fill9
|
|
1489
1489
|
},
|
|
1490
1490
|
{
|
|
1491
|
-
fill:
|
|
1492
|
-
stroke:
|
|
1493
|
-
swatch:
|
|
1494
|
-
tint:
|
|
1491
|
+
fill: O.fill10,
|
|
1492
|
+
stroke: O.stroke10,
|
|
1493
|
+
swatch: O.swatch10,
|
|
1494
|
+
tint: O.fill10
|
|
1495
1495
|
},
|
|
1496
1496
|
{
|
|
1497
|
-
fill:
|
|
1498
|
-
stroke:
|
|
1499
|
-
swatch:
|
|
1500
|
-
tint:
|
|
1497
|
+
fill: O.fill11,
|
|
1498
|
+
stroke: O.stroke11,
|
|
1499
|
+
swatch: O.swatch11,
|
|
1500
|
+
tint: O.fill11
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
|
-
fill:
|
|
1504
|
-
stroke:
|
|
1505
|
-
swatch:
|
|
1506
|
-
tint:
|
|
1503
|
+
fill: O.fill12,
|
|
1504
|
+
stroke: O.stroke12,
|
|
1505
|
+
swatch: O.swatch12,
|
|
1506
|
+
tint: O.fill12
|
|
1507
1507
|
}
|
|
1508
1508
|
];
|
|
1509
|
-
function
|
|
1509
|
+
function k(e, t) {
|
|
1510
1510
|
return e === void 0 ? t : t === void 0 || t.length === 0 ? e : `${e} ${t}`;
|
|
1511
1511
|
}
|
|
1512
1512
|
//#endregion
|
|
1513
1513
|
//#region src/text/date.ts
|
|
1514
|
-
var
|
|
1514
|
+
var ae = /\{([a-z_]+)\}/g, oe = [
|
|
1515
1515
|
"January",
|
|
1516
1516
|
"February",
|
|
1517
1517
|
"March",
|
|
@@ -1524,7 +1524,7 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1524
1524
|
"October",
|
|
1525
1525
|
"November",
|
|
1526
1526
|
"December"
|
|
1527
|
-
],
|
|
1527
|
+
], se = [
|
|
1528
1528
|
"Jan",
|
|
1529
1529
|
"Feb",
|
|
1530
1530
|
"Mar",
|
|
@@ -1537,7 +1537,7 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1537
1537
|
"Oct",
|
|
1538
1538
|
"Nov",
|
|
1539
1539
|
"Dec"
|
|
1540
|
-
],
|
|
1540
|
+
], ce = [
|
|
1541
1541
|
"Sunday",
|
|
1542
1542
|
"Monday",
|
|
1543
1543
|
"Tuesday",
|
|
@@ -1546,10 +1546,10 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1546
1546
|
"Friday",
|
|
1547
1547
|
"Saturday"
|
|
1548
1548
|
];
|
|
1549
|
-
function
|
|
1549
|
+
function A(e) {
|
|
1550
1550
|
return String(e).padStart(2, "0");
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function le(e) {
|
|
1553
1553
|
let t = e % 100;
|
|
1554
1554
|
if (t >= 11 && t <= 13) return `${String(e)}th`;
|
|
1555
1555
|
switch (e % 10) {
|
|
@@ -1559,36 +1559,36 @@ function ue(e) {
|
|
|
1559
1559
|
default: return `${String(e)}th`;
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1563
|
-
let n = t.getUTCDate(), r =
|
|
1562
|
+
function ue(e, t) {
|
|
1563
|
+
let n = t.getUTCDate(), r = oe[t.getUTCMonth()] ?? "", i = se[t.getUTCMonth()] ?? "", a = ce[t.getUTCDay()] ?? "", o = t.getUTCFullYear();
|
|
1564
1564
|
switch (e) {
|
|
1565
|
-
case "date_num": return `${String(o)}-${
|
|
1566
|
-
case "date_slash": return `${
|
|
1565
|
+
case "date_num": return `${String(o)}-${A(t.getUTCMonth() + 1)}-${A(n)}`;
|
|
1566
|
+
case "date_slash": return `${A(t.getUTCMonth() + 1)}/${A(n)}/${String(o)}`;
|
|
1567
1567
|
case "date_long":
|
|
1568
1568
|
case "date_long_pretty":
|
|
1569
|
-
case "day_divider_pretty": return `${a}, ${r} ${
|
|
1569
|
+
case "day_divider_pretty": return `${a}, ${r} ${le(n)}, ${String(o)}`;
|
|
1570
1570
|
case "date_long_full": return `${r} ${String(n)}, ${String(o)}`;
|
|
1571
1571
|
case "date":
|
|
1572
|
-
case "date_pretty": return `${r} ${
|
|
1572
|
+
case "date_pretty": return `${r} ${le(n)}, ${String(o)}`;
|
|
1573
1573
|
case "date_short":
|
|
1574
1574
|
case "date_short_pretty": return `${i} ${String(n)}, ${String(o)}`;
|
|
1575
|
-
case "time": return `${
|
|
1576
|
-
case "time_secs": return `${
|
|
1575
|
+
case "time": return `${A(t.getUTCHours())}:${A(t.getUTCMinutes())}`;
|
|
1576
|
+
case "time_secs": return `${A(t.getUTCHours())}:${A(t.getUTCMinutes())}:${A(t.getUTCSeconds())}`;
|
|
1577
1577
|
default: return;
|
|
1578
1578
|
}
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function de(e, t, n) {
|
|
1581
1581
|
let r = /* @__PURE__ */ new Date(e * 1e3);
|
|
1582
1582
|
if (!Number.isFinite(e) || Number.isNaN(r.getTime())) return n ?? String(e);
|
|
1583
|
-
let i = !1, a = t.replace(
|
|
1584
|
-
let n =
|
|
1583
|
+
let i = !1, a = t.replace(ae, (e, t) => {
|
|
1584
|
+
let n = ue(t, r);
|
|
1585
1585
|
return n === void 0 ? (i = !0, "") : n;
|
|
1586
1586
|
});
|
|
1587
1587
|
return t.length === 0 || i ? n ?? r.toISOString().slice(0, 10) : a;
|
|
1588
1588
|
}
|
|
1589
1589
|
//#endregion
|
|
1590
1590
|
//#region src/text/emoji.ts
|
|
1591
|
-
var
|
|
1591
|
+
var fe = {
|
|
1592
1592
|
"+1": "👍",
|
|
1593
1593
|
"-1": "👎",
|
|
1594
1594
|
100: "💯",
|
|
@@ -1625,12 +1625,12 @@ var pe = {
|
|
|
1625
1625
|
wink: "😉",
|
|
1626
1626
|
x: "❌",
|
|
1627
1627
|
zap: "⚡"
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1628
|
+
}, pe = /^[0-9a-f]{1,6}(?:-[0-9a-f]{1,6})*$/i;
|
|
1629
|
+
function me(e) {
|
|
1630
|
+
return fe[e];
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1633
|
-
if (e === void 0 || !
|
|
1632
|
+
function he(e) {
|
|
1633
|
+
if (e === void 0 || !pe.test(e)) return;
|
|
1634
1634
|
let t = e.split("-").map((e) => Number.parseInt(e, 16));
|
|
1635
1635
|
if (!t.some((e) => !Number.isFinite(e))) try {
|
|
1636
1636
|
return String.fromCodePoint(...t);
|
|
@@ -1640,7 +1640,7 @@ function ge(e) {
|
|
|
1640
1640
|
}
|
|
1641
1641
|
//#endregion
|
|
1642
1642
|
//#region src/text/RichText.tsx
|
|
1643
|
-
var
|
|
1643
|
+
var ge = {
|
|
1644
1644
|
attachment_mention: !0,
|
|
1645
1645
|
broadcast: !0,
|
|
1646
1646
|
canvas: !0,
|
|
@@ -1663,13 +1663,13 @@ var _e = {
|
|
|
1663
1663
|
usergroup: !0,
|
|
1664
1664
|
work_object_mention: !0,
|
|
1665
1665
|
workflow_mention: !0
|
|
1666
|
-
},
|
|
1666
|
+
}, _e = {
|
|
1667
1667
|
rich_text_list: !0,
|
|
1668
1668
|
rich_text_preformatted: !0,
|
|
1669
1669
|
rich_text_quote: !0,
|
|
1670
1670
|
rich_text_section: !0
|
|
1671
1671
|
};
|
|
1672
|
-
function
|
|
1672
|
+
function ve(e) {
|
|
1673
1673
|
switch (e.type) {
|
|
1674
1674
|
case "broadcast":
|
|
1675
1675
|
case "channel":
|
|
@@ -1694,11 +1694,11 @@ function ye(e) {
|
|
|
1694
1694
|
case "work_object_mention":
|
|
1695
1695
|
case "workflow_mention": return;
|
|
1696
1696
|
}
|
|
1697
|
-
return
|
|
1697
|
+
return _(e);
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1700
|
-
let t =
|
|
1701
|
-
if (t === void 0 || !(t in
|
|
1699
|
+
function ye(e) {
|
|
1700
|
+
let t = C(e);
|
|
1701
|
+
if (t === void 0 || !(t in ge) || !S(e)) return !1;
|
|
1702
1702
|
switch (t) {
|
|
1703
1703
|
case "text": return typeof e.text == "string";
|
|
1704
1704
|
case "link": return typeof e.url == "string";
|
|
@@ -1713,92 +1713,92 @@ function be(e) {
|
|
|
1713
1713
|
default: return !0;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1717
|
-
let t =
|
|
1718
|
-
return t === void 0 || !(t in
|
|
1716
|
+
function be(e) {
|
|
1717
|
+
let t = C(e);
|
|
1718
|
+
return t === void 0 || !(t in _e) || !S(e) || !Array.isArray(e.elements) ? !1 : t !== "rich_text_list" || e.elements.every((e) => S(e) && e.type === "rich_text_section" && Array.isArray(e.elements));
|
|
1719
1719
|
}
|
|
1720
|
-
function
|
|
1720
|
+
function j(e, t) {
|
|
1721
1721
|
let n = e;
|
|
1722
|
-
return t?.bold === !0 && (n = /* @__PURE__ */
|
|
1723
|
-
...
|
|
1722
|
+
return t?.bold === !0 && (n = /* @__PURE__ */ u("strong", {
|
|
1723
|
+
...g(D.bold),
|
|
1724
1724
|
children: n
|
|
1725
|
-
})), t?.italic === !0 && (n = /* @__PURE__ */
|
|
1726
|
-
...
|
|
1725
|
+
})), t?.italic === !0 && (n = /* @__PURE__ */ u("em", {
|
|
1726
|
+
...g(D.italic),
|
|
1727
1727
|
children: n
|
|
1728
|
-
})), t?.strike === !0 && (n = /* @__PURE__ */
|
|
1729
|
-
...
|
|
1728
|
+
})), t?.strike === !0 && (n = /* @__PURE__ */ u("s", {
|
|
1729
|
+
...g(D.strike),
|
|
1730
1730
|
children: n
|
|
1731
|
-
})), t?.underline === !0 && (n = /* @__PURE__ */
|
|
1732
|
-
...
|
|
1731
|
+
})), t?.underline === !0 && (n = /* @__PURE__ */ u("span", {
|
|
1732
|
+
...g(D.underline),
|
|
1733
1733
|
children: n
|
|
1734
|
-
})), t?.code === !0 && (n = /* @__PURE__ */
|
|
1735
|
-
...
|
|
1734
|
+
})), t?.code === !0 && (n = /* @__PURE__ */ u("code", {
|
|
1735
|
+
...g(D.inlineCode),
|
|
1736
1736
|
children: n
|
|
1737
1737
|
})), n;
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function xe(e) {
|
|
1740
1740
|
return e.text ?? e.id ?? e.user_id ?? e.channel_id ?? e.team_id ?? e.file_id ?? e.canvas_id ?? e.record_id ?? e.message_ts ?? e.workflow_id ?? e.type;
|
|
1741
1741
|
}
|
|
1742
|
-
function
|
|
1743
|
-
let { resolvers: t } =
|
|
1744
|
-
if (!
|
|
1745
|
-
...
|
|
1746
|
-
"data-unhandled-rich-text-element":
|
|
1747
|
-
children:
|
|
1742
|
+
function Se({ element: e }) {
|
|
1743
|
+
let { resolvers: t } = x();
|
|
1744
|
+
if (!ye(e)) return /* @__PURE__ */ u("span", {
|
|
1745
|
+
...g(D.reference),
|
|
1746
|
+
"data-unhandled-rich-text-element": C(e) ?? "unknown",
|
|
1747
|
+
children: T(e, "rich text element")
|
|
1748
1748
|
});
|
|
1749
|
-
let n =
|
|
1749
|
+
let n = ve(e);
|
|
1750
1750
|
switch (e.type) {
|
|
1751
|
-
case "text": return
|
|
1751
|
+
case "text": return j(e.text, n);
|
|
1752
1752
|
case "link": {
|
|
1753
|
-
let t =
|
|
1754
|
-
return t === void 0 ?
|
|
1755
|
-
...
|
|
1753
|
+
let t = E(e.url), r = e.text ?? e.url;
|
|
1754
|
+
return t === void 0 ? j(r, n) : /* @__PURE__ */ u("a", {
|
|
1755
|
+
...g(D.link),
|
|
1756
1756
|
href: t,
|
|
1757
1757
|
rel: "noreferrer",
|
|
1758
|
-
children:
|
|
1758
|
+
children: j(r, n)
|
|
1759
1759
|
});
|
|
1760
1760
|
}
|
|
1761
|
-
case "emoji": return /* @__PURE__ */
|
|
1761
|
+
case "emoji": return /* @__PURE__ */ u("span", {
|
|
1762
1762
|
"aria-label": `:${e.name}:`,
|
|
1763
1763
|
role: "img",
|
|
1764
|
-
children:
|
|
1764
|
+
children: j(t.emoji?.(e.name, e.unicode) ?? he(e.unicode) ?? me(e.name) ?? `:${e.name}:`, n)
|
|
1765
1765
|
});
|
|
1766
|
-
case "user": return /* @__PURE__ */
|
|
1767
|
-
...
|
|
1768
|
-
children:
|
|
1766
|
+
case "user": return /* @__PURE__ */ u("span", {
|
|
1767
|
+
...g(D.mention),
|
|
1768
|
+
children: j(/* @__PURE__ */ d(l, { children: ["@", t.user?.(e.user_id) ?? e.user_id] }), n)
|
|
1769
1769
|
});
|
|
1770
|
-
case "usergroup": return /* @__PURE__ */
|
|
1771
|
-
...
|
|
1772
|
-
children:
|
|
1770
|
+
case "usergroup": return /* @__PURE__ */ u("span", {
|
|
1771
|
+
...g(D.mention),
|
|
1772
|
+
children: j(/* @__PURE__ */ d(l, { children: ["@", t.usergroup?.(e.usergroup_id) ?? e.usergroup_id] }), n)
|
|
1773
1773
|
});
|
|
1774
|
-
case "channel": return /* @__PURE__ */
|
|
1775
|
-
...
|
|
1776
|
-
children:
|
|
1774
|
+
case "channel": return /* @__PURE__ */ u("span", {
|
|
1775
|
+
...g(D.mention),
|
|
1776
|
+
children: j(/* @__PURE__ */ d(l, { children: ["#", t.channel?.(e.channel_id) ?? e.channel_id] }), n)
|
|
1777
1777
|
});
|
|
1778
|
-
case "team": return /* @__PURE__ */
|
|
1779
|
-
...
|
|
1780
|
-
children:
|
|
1778
|
+
case "team": return /* @__PURE__ */ u("span", {
|
|
1779
|
+
...g(D.mention),
|
|
1780
|
+
children: j(/* @__PURE__ */ d(l, { children: ["@", t.team?.(e.team_id) ?? e.team_id] }), n)
|
|
1781
1781
|
});
|
|
1782
|
-
case "broadcast": return /* @__PURE__ */
|
|
1783
|
-
...
|
|
1784
|
-
children:
|
|
1782
|
+
case "broadcast": return /* @__PURE__ */ u("span", {
|
|
1783
|
+
...g(D.mention),
|
|
1784
|
+
children: j(`@${e.range}`, n)
|
|
1785
1785
|
});
|
|
1786
1786
|
case "date": {
|
|
1787
|
-
let r = t.date?.(e.timestamp, e.format) ??
|
|
1788
|
-
return i === void 0 ?
|
|
1789
|
-
...
|
|
1787
|
+
let r = t.date?.(e.timestamp, e.format) ?? de(e.timestamp, e.format, e.fallback), i = E(e.url);
|
|
1788
|
+
return i === void 0 ? j(r, n) : /* @__PURE__ */ u("a", {
|
|
1789
|
+
...g(D.link),
|
|
1790
1790
|
href: i,
|
|
1791
1791
|
rel: "noreferrer",
|
|
1792
|
-
children:
|
|
1792
|
+
children: j(r, n)
|
|
1793
1793
|
});
|
|
1794
1794
|
}
|
|
1795
|
-
case "color": return /* @__PURE__ */
|
|
1796
|
-
...
|
|
1795
|
+
case "color": return /* @__PURE__ */ d("span", { children: [/* @__PURE__ */ u("span", {
|
|
1796
|
+
...g(D.colorSwatch),
|
|
1797
1797
|
"aria-hidden": "true",
|
|
1798
1798
|
style: { backgroundColor: e.value }
|
|
1799
|
-
}),
|
|
1800
|
-
case "citation": return /* @__PURE__ */
|
|
1801
|
-
...
|
|
1799
|
+
}), j(e.value, n)] });
|
|
1800
|
+
case "citation": return /* @__PURE__ */ d("span", {
|
|
1801
|
+
...g(D.reference),
|
|
1802
1802
|
children: [
|
|
1803
1803
|
"[",
|
|
1804
1804
|
e.index ?? e.text ?? "source",
|
|
@@ -1815,99 +1815,120 @@ function Ce({ element: e }) {
|
|
|
1815
1815
|
case "salesforce_data_field":
|
|
1816
1816
|
case "tag":
|
|
1817
1817
|
case "work_object_mention":
|
|
1818
|
-
case "workflow_mention": return /* @__PURE__ */
|
|
1819
|
-
...
|
|
1820
|
-
children:
|
|
1818
|
+
case "workflow_mention": return /* @__PURE__ */ u("span", {
|
|
1819
|
+
...g(D.reference),
|
|
1820
|
+
children: xe(e)
|
|
1821
1821
|
});
|
|
1822
1822
|
}
|
|
1823
|
-
return
|
|
1824
|
-
}
|
|
1825
|
-
function
|
|
1826
|
-
let
|
|
1827
|
-
if ((
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1823
|
+
return _(e);
|
|
1824
|
+
}
|
|
1825
|
+
function Ce({ element: e }) {
|
|
1826
|
+
let { resolvers: t } = x();
|
|
1827
|
+
if (ye(e)) {
|
|
1828
|
+
switch (e.type) {
|
|
1829
|
+
case "text": return e.text;
|
|
1830
|
+
case "link": return e.text ?? e.url;
|
|
1831
|
+
case "user": return /* @__PURE__ */ d(l, { children: ["@", t.user?.(e.user_id) ?? e.user_id] });
|
|
1832
|
+
case "usergroup": return /* @__PURE__ */ d(l, { children: ["@", t.usergroup?.(e.usergroup_id) ?? e.usergroup_id] });
|
|
1833
|
+
case "channel": return /* @__PURE__ */ d(l, { children: ["#", t.channel?.(e.channel_id) ?? e.channel_id] });
|
|
1834
|
+
case "team": return /* @__PURE__ */ d(l, { children: ["@", t.team?.(e.team_id) ?? e.team_id] });
|
|
1835
|
+
case "broadcast": return `@${e.range}`;
|
|
1836
|
+
case "emoji": return `:${e.name}:`;
|
|
1837
|
+
case "date": return t.date?.(e.timestamp, e.format) ?? de(e.timestamp, e.format, e.fallback);
|
|
1838
|
+
case "color": return e.value;
|
|
1839
|
+
case "citation": return `[${e.index ?? e.text ?? "source"}]`;
|
|
1840
|
+
case "attachment_mention":
|
|
1841
|
+
case "canvas":
|
|
1842
|
+
case "canvas_message_unfurl":
|
|
1843
|
+
case "canvas_user_mention":
|
|
1844
|
+
case "file":
|
|
1845
|
+
case "list_record":
|
|
1846
|
+
case "message_mention":
|
|
1847
|
+
case "salesforce_data_field":
|
|
1848
|
+
case "tag":
|
|
1849
|
+
case "work_object_mention":
|
|
1850
|
+
case "workflow_mention": return xe(e);
|
|
1851
|
+
}
|
|
1852
|
+
return _(e);
|
|
1832
1853
|
}
|
|
1833
|
-
return /* @__PURE__ */
|
|
1834
|
-
...
|
|
1835
|
-
"data-unhandled-rich-text-element":
|
|
1836
|
-
|
|
1837
|
-
}
|
|
1854
|
+
return /* @__PURE__ */ u("span", {
|
|
1855
|
+
...g(D.reference),
|
|
1856
|
+
"data-unhandled-rich-text-element": C(e) ?? "unknown",
|
|
1857
|
+
children: T(e, "rich text element")
|
|
1858
|
+
});
|
|
1838
1859
|
}
|
|
1839
|
-
function
|
|
1860
|
+
function we(e) {
|
|
1840
1861
|
let t = e % 3;
|
|
1841
|
-
return t === 1 ?
|
|
1862
|
+
return t === 1 ? D.listOrderedAlpha : t === 2 ? D.listOrderedRoman : D.listOrdered;
|
|
1842
1863
|
}
|
|
1843
|
-
function
|
|
1864
|
+
function Te(e) {
|
|
1844
1865
|
let t = e % 3;
|
|
1845
|
-
return t === 1 ?
|
|
1866
|
+
return t === 1 ? D.listBulletAlternate : t === 2 ? D.listBulletSquare : D.listBullet;
|
|
1846
1867
|
}
|
|
1847
|
-
function
|
|
1848
|
-
if (!
|
|
1849
|
-
...
|
|
1850
|
-
"data-unhandled-rich-text-container":
|
|
1851
|
-
children:
|
|
1868
|
+
function Ee({ element: e, path: n }) {
|
|
1869
|
+
if (!be(e)) return /* @__PURE__ */ u("div", {
|
|
1870
|
+
...g(D.unhandled),
|
|
1871
|
+
"data-unhandled-rich-text-container": C(e) ?? "unknown",
|
|
1872
|
+
children: T(e, "rich text container")
|
|
1852
1873
|
});
|
|
1853
1874
|
switch (e.type) {
|
|
1854
|
-
case "rich_text_section": return /* @__PURE__ */
|
|
1855
|
-
...
|
|
1875
|
+
case "rich_text_section": return /* @__PURE__ */ u("div", {
|
|
1876
|
+
...g(D.richSection),
|
|
1856
1877
|
"data-rich-text-section": !0,
|
|
1857
|
-
children: e.elements.map((e, t) => /* @__PURE__ */
|
|
1878
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(Se, { element: e }, `${C(e) ?? "unknown"}-${String(t)}`))
|
|
1858
1879
|
});
|
|
1859
|
-
case "rich_text_quote": return /* @__PURE__ */
|
|
1860
|
-
...
|
|
1880
|
+
case "rich_text_quote": return /* @__PURE__ */ u("blockquote", {
|
|
1881
|
+
...g(D.quote, e.border === 1 && D.richBorder),
|
|
1861
1882
|
"data-border": e.border ?? 0,
|
|
1862
|
-
children: e.elements.map((e, t) => /* @__PURE__ */
|
|
1883
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(Se, { element: e }, `${C(e) ?? "unknown"}-${String(t)}`))
|
|
1863
1884
|
});
|
|
1864
|
-
case "rich_text_preformatted": return /* @__PURE__ */
|
|
1865
|
-
...
|
|
1885
|
+
case "rich_text_preformatted": return /* @__PURE__ */ u("pre", {
|
|
1886
|
+
...g(D.pre, e.border === 1 && D.richBorder),
|
|
1866
1887
|
"data-border": e.border ?? 0,
|
|
1867
1888
|
"data-language": e.language,
|
|
1868
|
-
children: e.elements.map((e, t) =>
|
|
1889
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(Ce, { element: e }, `${C(e) ?? "unknown"}-${String(t)}`))
|
|
1869
1890
|
});
|
|
1870
1891
|
case "rich_text_list": {
|
|
1871
|
-
let r = Number.isFinite(e.indent) ? Math.trunc(e.indent ?? 0) : 0, i = Math.min(8, Math.max(0, r)), a = Number.isFinite(e.offset) ? Math.trunc(e.offset ?? 0) : 0, o = Math.max(1, a + 1), s = { marginInlineStart: i * 28 }, c = e.style === "ordered" ?
|
|
1872
|
-
...
|
|
1892
|
+
let r = Number.isFinite(e.indent) ? Math.trunc(e.indent ?? 0) : 0, i = Math.min(8, Math.max(0, r)), a = Number.isFinite(e.offset) ? Math.trunc(e.offset ?? 0) : 0, o = Math.max(1, a + 1), s = { marginInlineStart: i * 28 }, c = e.style === "ordered" ? D.listItemOrdered : [D.listItemBullet, Te(i)], l = e.elements.map((e, r) => /* @__PURE__ */ t("li", {
|
|
1893
|
+
...g(c),
|
|
1873
1894
|
key: `${n}.elements[${String(r)}]`
|
|
1874
|
-
}, e.elements.map((e, t) => /* @__PURE__ */
|
|
1875
|
-
return e.style === "ordered" ? /* @__PURE__ */
|
|
1876
|
-
...
|
|
1895
|
+
}, e.elements.map((e, t) => /* @__PURE__ */ u(Se, { element: e }, `${C(e) ?? "unknown"}-${String(t)}`))));
|
|
1896
|
+
return e.style === "ordered" ? /* @__PURE__ */ u("ol", {
|
|
1897
|
+
...g(D.list, we(i), e.border === 1 && D.richBorder),
|
|
1877
1898
|
"data-border": e.border ?? 0,
|
|
1878
1899
|
"data-indent": i,
|
|
1879
1900
|
start: o,
|
|
1880
1901
|
style: s,
|
|
1881
|
-
children:
|
|
1882
|
-
}) : /* @__PURE__ */
|
|
1883
|
-
...
|
|
1902
|
+
children: l
|
|
1903
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
1904
|
+
...g(D.list, e.border === 1 && D.richBorder),
|
|
1884
1905
|
"data-border": e.border ?? 0,
|
|
1885
1906
|
"data-indent": i,
|
|
1886
1907
|
style: s,
|
|
1887
|
-
children:
|
|
1908
|
+
children: l
|
|
1888
1909
|
});
|
|
1889
1910
|
}
|
|
1890
1911
|
}
|
|
1891
|
-
return
|
|
1912
|
+
return _(e);
|
|
1892
1913
|
}
|
|
1893
|
-
function
|
|
1894
|
-
let r =
|
|
1895
|
-
return /* @__PURE__ */
|
|
1914
|
+
function M({ block: e, className: t, path: n = "block" }) {
|
|
1915
|
+
let r = g(D.richText), i = e, a = S(i) ? i.elements : void 0;
|
|
1916
|
+
return /* @__PURE__ */ u("div", {
|
|
1896
1917
|
...r,
|
|
1897
|
-
className:
|
|
1898
|
-
children: Array.isArray(a) ? a.map((e, t) => /* @__PURE__ */
|
|
1918
|
+
className: k(r.className, t),
|
|
1919
|
+
children: Array.isArray(a) ? a.map((e, t) => /* @__PURE__ */ u(Ee, {
|
|
1899
1920
|
element: e,
|
|
1900
1921
|
path: `${n}.elements[${String(t)}]`
|
|
1901
|
-
}, `${
|
|
1902
|
-
...
|
|
1922
|
+
}, `${C(e) ?? "unknown"}-${String(t)}`)) : /* @__PURE__ */ u("div", {
|
|
1923
|
+
...g(D.unhandled),
|
|
1903
1924
|
"data-unhandled-rich-text-block": !0,
|
|
1904
|
-
children:
|
|
1925
|
+
children: T(i, "rich text block")
|
|
1905
1926
|
})
|
|
1906
1927
|
});
|
|
1907
1928
|
}
|
|
1908
1929
|
//#endregion
|
|
1909
1930
|
//#region src/elements/Elements.tsx
|
|
1910
|
-
var
|
|
1931
|
+
var De = {
|
|
1911
1932
|
button: !0,
|
|
1912
1933
|
channels_select: !0,
|
|
1913
1934
|
checkboxes: !0,
|
|
@@ -1934,68 +1955,68 @@ var Oe = {
|
|
|
1934
1955
|
users_select: !0,
|
|
1935
1956
|
workflow_button: !0
|
|
1936
1957
|
};
|
|
1937
|
-
function
|
|
1938
|
-
let t =
|
|
1939
|
-
return t !== void 0 && t in
|
|
1958
|
+
function Oe(e) {
|
|
1959
|
+
let t = C(e);
|
|
1960
|
+
return t !== void 0 && t in De;
|
|
1940
1961
|
}
|
|
1941
|
-
function
|
|
1942
|
-
if (!
|
|
1962
|
+
function ke(e) {
|
|
1963
|
+
if (!S(e)) return;
|
|
1943
1964
|
if ("image_url" in e) return typeof e.image_url == "string" ? e.image_url : void 0;
|
|
1944
1965
|
let t = e.slack_file;
|
|
1945
|
-
if (
|
|
1966
|
+
if (S(t) && typeof t.url == "string") return t.url;
|
|
1967
|
+
}
|
|
1968
|
+
function Ae(e) {
|
|
1969
|
+
return S(e) && typeof e.text == "string";
|
|
1946
1970
|
}
|
|
1947
1971
|
function je(e) {
|
|
1948
|
-
return
|
|
1972
|
+
return e === void 0 || typeof e == "string";
|
|
1949
1973
|
}
|
|
1950
1974
|
function Me(e) {
|
|
1951
|
-
return e === void 0 ||
|
|
1975
|
+
return S(e) && Ae(e.text) && je(e.value) && (e.description === void 0 || Ae(e.description));
|
|
1952
1976
|
}
|
|
1953
1977
|
function Ne(e) {
|
|
1954
|
-
return
|
|
1955
|
-
}
|
|
1956
|
-
function j(e) {
|
|
1957
|
-
return Array.isArray(e) && e.every(Ne);
|
|
1978
|
+
return Array.isArray(e) && e.every(Me);
|
|
1958
1979
|
}
|
|
1959
1980
|
function Pe(e) {
|
|
1960
1981
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1961
1982
|
}
|
|
1962
1983
|
function Fe(e) {
|
|
1963
|
-
return
|
|
1984
|
+
return S(e) && Ae(e.text);
|
|
1964
1985
|
}
|
|
1965
1986
|
function Ie(e) {
|
|
1966
|
-
return !
|
|
1987
|
+
return !S(e) || !Ne(e.options) ? !1 : C(e) === "checkboxes" ? e.initial_options === void 0 || Ne(e.initial_options) : e.initial_option === void 0 || Me(e.initial_option);
|
|
1967
1988
|
}
|
|
1968
1989
|
function Le(e) {
|
|
1969
|
-
return e.placeholder === void 0 ||
|
|
1990
|
+
return e.placeholder === void 0 || Ae(e.placeholder);
|
|
1970
1991
|
}
|
|
1971
1992
|
function Re(e) {
|
|
1972
1993
|
let t = e.option_groups;
|
|
1973
|
-
return (e.options === void 0 ||
|
|
1994
|
+
return (e.options === void 0 || Ne(e.options)) && (t === void 0 || Array.isArray(t) && t.every((e) => S(e) && Ne(e.options)));
|
|
1974
1995
|
}
|
|
1975
1996
|
function ze(e) {
|
|
1976
|
-
if (!
|
|
1977
|
-
switch (
|
|
1978
|
-
case "static_select": return Re(e) && (e.initial_option === void 0 ||
|
|
1979
|
-
case "multi_static_select": return Re(e) && (e.initial_options === void 0 ||
|
|
1980
|
-
case "external_select": return e.initial_option === void 0 ||
|
|
1981
|
-
case "multi_external_select": return e.initial_options === void 0 ||
|
|
1982
|
-
case "users_select": return
|
|
1997
|
+
if (!S(e) || !Le(e)) return !1;
|
|
1998
|
+
switch (C(e) ?? "") {
|
|
1999
|
+
case "static_select": return Re(e) && (e.initial_option === void 0 || Me(e.initial_option));
|
|
2000
|
+
case "multi_static_select": return Re(e) && (e.initial_options === void 0 || Ne(e.initial_options));
|
|
2001
|
+
case "external_select": return e.initial_option === void 0 || Me(e.initial_option);
|
|
2002
|
+
case "multi_external_select": return e.initial_options === void 0 || Ne(e.initial_options);
|
|
2003
|
+
case "users_select": return je(e.initial_user);
|
|
1983
2004
|
case "multi_users_select": return e.initial_users === void 0 || Pe(e.initial_users);
|
|
1984
|
-
case "channels_select": return
|
|
2005
|
+
case "channels_select": return je(e.initial_channel);
|
|
1985
2006
|
case "multi_channels_select": return e.initial_channels === void 0 || Pe(e.initial_channels);
|
|
1986
|
-
case "conversations_select": return
|
|
2007
|
+
case "conversations_select": return je(e.initial_conversation);
|
|
1987
2008
|
case "multi_conversations_select": return e.initial_conversations === void 0 || Pe(e.initial_conversations);
|
|
1988
2009
|
default: return !1;
|
|
1989
2010
|
}
|
|
1990
2011
|
}
|
|
1991
2012
|
function Be(e) {
|
|
1992
|
-
if (!
|
|
1993
|
-
switch (
|
|
2013
|
+
if (!S(e)) return !1;
|
|
2014
|
+
switch (C(e) ?? "") {
|
|
1994
2015
|
case "plain_text_input":
|
|
1995
2016
|
case "email_text_input":
|
|
1996
2017
|
case "url_text_input":
|
|
1997
2018
|
case "number_input": return Le(e);
|
|
1998
|
-
case "datepicker": return
|
|
2019
|
+
case "datepicker": return je(e.initial_date);
|
|
1999
2020
|
case "file_input": return e.filetypes === void 0 || Array.isArray(e.filetypes);
|
|
2000
2021
|
case "datetimepicker":
|
|
2001
2022
|
case "timepicker":
|
|
@@ -2003,54 +2024,54 @@ function Be(e) {
|
|
|
2003
2024
|
default: return !1;
|
|
2004
2025
|
}
|
|
2005
2026
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let n =
|
|
2008
|
-
return /* @__PURE__ */
|
|
2027
|
+
function N({ className: e, element: t }) {
|
|
2028
|
+
let n = g(D.unhandled);
|
|
2029
|
+
return /* @__PURE__ */ u("span", {
|
|
2009
2030
|
...n,
|
|
2010
|
-
className:
|
|
2011
|
-
"data-unhandled-element":
|
|
2012
|
-
children:
|
|
2031
|
+
className: k(n.className, e),
|
|
2032
|
+
"data-unhandled-element": C(t) ?? "unknown",
|
|
2033
|
+
children: T(t, "Block Kit element")
|
|
2013
2034
|
});
|
|
2014
2035
|
}
|
|
2015
|
-
function
|
|
2016
|
-
let r =
|
|
2017
|
-
return o === void 0 ? /* @__PURE__ */
|
|
2036
|
+
function P({ className: e, element: t, variant: n }) {
|
|
2037
|
+
let r = g(D.image, n === "accessory" && D.accessoryImage, n === "cardHero" && D.cardHero, n === "cardIcon" && D.cardIcon, n === "context" && D.contextImage), i = t, a = S(i) && typeof i.alt_text == "string" ? i.alt_text : T(i, "image"), o = ke(t);
|
|
2038
|
+
return o === void 0 ? /* @__PURE__ */ u("div", {
|
|
2018
2039
|
...r,
|
|
2019
2040
|
"aria-label": a,
|
|
2020
|
-
className:
|
|
2041
|
+
className: k(r.className, e),
|
|
2021
2042
|
role: "img"
|
|
2022
|
-
}) : /* @__PURE__ */
|
|
2043
|
+
}) : /* @__PURE__ */ u("img", {
|
|
2023
2044
|
...r,
|
|
2024
2045
|
alt: a,
|
|
2025
|
-
className:
|
|
2046
|
+
className: k(r.className, e),
|
|
2026
2047
|
src: o
|
|
2027
2048
|
});
|
|
2028
2049
|
}
|
|
2029
2050
|
function Ve({ blockId: e, className: t, element: n }) {
|
|
2030
|
-
let { onAction: r } =
|
|
2031
|
-
if (!Fe(n)) return /* @__PURE__ */
|
|
2051
|
+
let { onAction: r } = x();
|
|
2052
|
+
if (!Fe(n)) return /* @__PURE__ */ u(N, {
|
|
2032
2053
|
className: t,
|
|
2033
2054
|
element: n
|
|
2034
2055
|
});
|
|
2035
|
-
let i =
|
|
2056
|
+
let i = g(D.button, n.style === "primary" && D.buttonPrimary, n.style === "danger" && D.buttonDanger), a = () => {
|
|
2036
2057
|
n.action_id !== void 0 && r?.({
|
|
2037
2058
|
actionId: n.action_id,
|
|
2038
2059
|
type: n.type,
|
|
2039
2060
|
...e === void 0 ? {} : { blockId: e },
|
|
2040
2061
|
...n.value === void 0 ? {} : { value: n.value }
|
|
2041
2062
|
});
|
|
2042
|
-
}, o =
|
|
2043
|
-
return o === void 0 ? /* @__PURE__ */
|
|
2063
|
+
}, o = E(n.url);
|
|
2064
|
+
return o === void 0 ? /* @__PURE__ */ u("button", {
|
|
2044
2065
|
...i,
|
|
2045
2066
|
"aria-label": n.accessibility_label,
|
|
2046
|
-
className:
|
|
2067
|
+
className: k(i.className, t),
|
|
2047
2068
|
onClick: a,
|
|
2048
2069
|
type: "button",
|
|
2049
2070
|
children: n.text.text
|
|
2050
|
-
}) : /* @__PURE__ */
|
|
2071
|
+
}) : /* @__PURE__ */ u("a", {
|
|
2051
2072
|
...i,
|
|
2052
2073
|
"aria-label": n.accessibility_label,
|
|
2053
|
-
className:
|
|
2074
|
+
className: k(i.className, t),
|
|
2054
2075
|
href: o,
|
|
2055
2076
|
onClick: a,
|
|
2056
2077
|
rel: "noreferrer",
|
|
@@ -2058,16 +2079,16 @@ function Ve({ blockId: e, className: t, element: n }) {
|
|
|
2058
2079
|
});
|
|
2059
2080
|
}
|
|
2060
2081
|
function He({ blockId: e, className: t, element: n }) {
|
|
2061
|
-
let { onAction: r } =
|
|
2062
|
-
if (!
|
|
2082
|
+
let { onAction: r } = x();
|
|
2083
|
+
if (!S(n)) return /* @__PURE__ */ u(N, {
|
|
2063
2084
|
className: t,
|
|
2064
2085
|
element: n
|
|
2065
2086
|
});
|
|
2066
|
-
let i =
|
|
2067
|
-
return /* @__PURE__ */
|
|
2087
|
+
let i = g(D.button, D.overflowButton);
|
|
2088
|
+
return /* @__PURE__ */ u("button", {
|
|
2068
2089
|
...i,
|
|
2069
2090
|
"aria-label": "More options",
|
|
2070
|
-
className:
|
|
2091
|
+
className: k(i.className, t),
|
|
2071
2092
|
onClick: () => {
|
|
2072
2093
|
n.action_id !== void 0 && r?.({
|
|
2073
2094
|
actionId: n.action_id,
|
|
@@ -2086,24 +2107,24 @@ function We(e, t) {
|
|
|
2086
2107
|
return t?.some((t) => t.value === e.value && t.text.text === e.text.text) ?? !1;
|
|
2087
2108
|
}
|
|
2088
2109
|
function Ge({ blockId: e, className: n, element: r }) {
|
|
2089
|
-
let { onAction: i } =
|
|
2090
|
-
if (!Ie(r)) return /* @__PURE__ */
|
|
2110
|
+
let { onAction: i } = x(), o = a();
|
|
2111
|
+
if (!Ie(r)) return /* @__PURE__ */ u(N, {
|
|
2091
2112
|
className: n,
|
|
2092
2113
|
element: r
|
|
2093
2114
|
});
|
|
2094
|
-
let
|
|
2095
|
-
return /* @__PURE__ */
|
|
2096
|
-
...
|
|
2097
|
-
className:
|
|
2115
|
+
let s = g(D.choiceGroup), c = r.type === "checkboxes" ? r.initial_options : r.initial_option === void 0 ? void 0 : [r.initial_option];
|
|
2116
|
+
return /* @__PURE__ */ u("fieldset", {
|
|
2117
|
+
...s,
|
|
2118
|
+
className: k(s.className, n),
|
|
2098
2119
|
"data-element-type": r.type,
|
|
2099
2120
|
children: r.options.map((n, a) => {
|
|
2100
2121
|
let s = Ue(n, a);
|
|
2101
2122
|
return /* @__PURE__ */ t("label", {
|
|
2102
|
-
...
|
|
2123
|
+
...g(D.choice),
|
|
2103
2124
|
key: s
|
|
2104
|
-
}, /* @__PURE__ */
|
|
2105
|
-
defaultChecked: We(n,
|
|
2106
|
-
name:
|
|
2125
|
+
}, /* @__PURE__ */ u("input", {
|
|
2126
|
+
defaultChecked: We(n, c),
|
|
2127
|
+
name: o,
|
|
2107
2128
|
onChange: (t) => {
|
|
2108
2129
|
if (r.action_id !== void 0) {
|
|
2109
2130
|
let n = r.type === "checkboxes" ? Array.from(t.currentTarget.closest("fieldset")?.querySelectorAll("input[type=\"checkbox\"]:checked") ?? [], (e) => e.value) : void 0;
|
|
@@ -2117,8 +2138,8 @@ function Ge({ blockId: e, className: n, element: r }) {
|
|
|
2117
2138
|
},
|
|
2118
2139
|
type: r.type === "checkboxes" ? "checkbox" : "radio",
|
|
2119
2140
|
value: s
|
|
2120
|
-
}), /* @__PURE__ */
|
|
2121
|
-
...
|
|
2141
|
+
}), /* @__PURE__ */ d("span", { children: [n.text.text, n.description === void 0 ? null : /* @__PURE__ */ d("span", {
|
|
2142
|
+
...g(D.smallText),
|
|
2122
2143
|
children: [" ", n.description.text]
|
|
2123
2144
|
})] }));
|
|
2124
2145
|
})
|
|
@@ -2152,7 +2173,7 @@ function Ye(e) {
|
|
|
2152
2173
|
case "conversations_select": return Je(e.initial_conversation === void 0 ? [] : [e.initial_conversation]);
|
|
2153
2174
|
case "multi_conversations_select": return Je(e.initial_conversations ?? []);
|
|
2154
2175
|
}
|
|
2155
|
-
return
|
|
2176
|
+
return _(e);
|
|
2156
2177
|
}
|
|
2157
2178
|
function Xe(e, t) {
|
|
2158
2179
|
return e.flatMap((e, n) => We(e, t) ? [Ue(e, n)] : []);
|
|
@@ -2170,7 +2191,7 @@ function Ze(e, t) {
|
|
|
2170
2191
|
case "conversations_select":
|
|
2171
2192
|
case "multi_conversations_select": return t.map((e) => e.value);
|
|
2172
2193
|
}
|
|
2173
|
-
return
|
|
2194
|
+
return _(e);
|
|
2174
2195
|
}
|
|
2175
2196
|
function Qe(e) {
|
|
2176
2197
|
if ("placeholder" in e && e.placeholder !== void 0) return e.placeholder.text;
|
|
@@ -2186,15 +2207,15 @@ function Qe(e) {
|
|
|
2186
2207
|
case "multi_static_select":
|
|
2187
2208
|
case "static_select": return "Select an option";
|
|
2188
2209
|
}
|
|
2189
|
-
return
|
|
2210
|
+
return _(e);
|
|
2190
2211
|
}
|
|
2191
2212
|
function $e({ blockId: e, className: t, element: n }) {
|
|
2192
|
-
let { onAction: r } =
|
|
2193
|
-
if (!ze(n)) return /* @__PURE__ */
|
|
2213
|
+
let { onAction: r } = x();
|
|
2214
|
+
if (!ze(n)) return /* @__PURE__ */ u(N, {
|
|
2194
2215
|
className: t,
|
|
2195
2216
|
element: n
|
|
2196
2217
|
});
|
|
2197
|
-
let i =
|
|
2218
|
+
let i = g(D.select), a = n.type.startsWith("multi_"), o = Ye(n), s = Ze(n, o), c = (t) => {
|
|
2198
2219
|
if (n.action_id !== void 0) {
|
|
2199
2220
|
let i = Array.from(t.currentTarget.selectedOptions, (e) => e.value);
|
|
2200
2221
|
r?.({
|
|
@@ -2205,21 +2226,21 @@ function $e({ blockId: e, className: t, element: n }) {
|
|
|
2205
2226
|
});
|
|
2206
2227
|
}
|
|
2207
2228
|
};
|
|
2208
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ d("select", {
|
|
2209
2230
|
...i,
|
|
2210
2231
|
"aria-label": Qe(n),
|
|
2211
|
-
className:
|
|
2232
|
+
className: k(i.className, t),
|
|
2212
2233
|
defaultValue: a ? s : s[0] ?? "",
|
|
2213
2234
|
multiple: a,
|
|
2214
2235
|
onChange: c,
|
|
2215
|
-
children: [/* @__PURE__ */
|
|
2236
|
+
children: [/* @__PURE__ */ u("option", {
|
|
2216
2237
|
disabled: !0,
|
|
2217
2238
|
value: "",
|
|
2218
2239
|
children: Qe(n)
|
|
2219
|
-
}), o.length === 0 ? /* @__PURE__ */
|
|
2240
|
+
}), o.length === 0 ? /* @__PURE__ */ u("option", {
|
|
2220
2241
|
value: "preview",
|
|
2221
2242
|
children: "Preview option"
|
|
2222
|
-
}) : o.map((e) => /* @__PURE__ */
|
|
2243
|
+
}) : o.map((e) => /* @__PURE__ */ u("option", {
|
|
2223
2244
|
value: e.value,
|
|
2224
2245
|
children: e.label
|
|
2225
2246
|
}, e.value))]
|
|
@@ -2243,12 +2264,12 @@ function rt(e) {
|
|
|
2243
2264
|
if (!Number.isNaN(t.getTime())) return `${String(t.getFullYear())}-${et(t.getMonth() + 1)}-${et(t.getDate())}T${et(t.getHours())}:${et(t.getMinutes())}`;
|
|
2244
2265
|
}
|
|
2245
2266
|
function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
2246
|
-
let { onAction: i } =
|
|
2247
|
-
if (!Be(n)) return /* @__PURE__ */
|
|
2267
|
+
let { onAction: i } = x();
|
|
2268
|
+
if (!Be(n)) return /* @__PURE__ */ u(N, {
|
|
2248
2269
|
className: t,
|
|
2249
2270
|
element: n
|
|
2250
2271
|
});
|
|
2251
|
-
let a =
|
|
2272
|
+
let a = g(D.input), o = (t) => {
|
|
2252
2273
|
n.action_id !== void 0 && i?.({
|
|
2253
2274
|
actionId: n.action_id,
|
|
2254
2275
|
type: n.type,
|
|
@@ -2259,18 +2280,18 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2259
2280
|
o(e.currentTarget.value);
|
|
2260
2281
|
};
|
|
2261
2282
|
switch (n.type) {
|
|
2262
|
-
case "plain_text_input": return n.multiline === !0 ? /* @__PURE__ */
|
|
2283
|
+
case "plain_text_input": return n.multiline === !0 ? /* @__PURE__ */ u("textarea", {
|
|
2263
2284
|
...a,
|
|
2264
|
-
className:
|
|
2285
|
+
className: k(a.className, t),
|
|
2265
2286
|
defaultValue: n.initial_value,
|
|
2266
2287
|
maxLength: n.max_length,
|
|
2267
2288
|
minLength: n.min_length,
|
|
2268
2289
|
onChange: s,
|
|
2269
2290
|
placeholder: n.placeholder?.text,
|
|
2270
2291
|
rows: 4
|
|
2271
|
-
}) : /* @__PURE__ */
|
|
2292
|
+
}) : /* @__PURE__ */ u("input", {
|
|
2272
2293
|
...a,
|
|
2273
|
-
className:
|
|
2294
|
+
className: k(a.className, t),
|
|
2274
2295
|
defaultValue: n.initial_value,
|
|
2275
2296
|
maxLength: n.max_length,
|
|
2276
2297
|
minLength: n.min_length,
|
|
@@ -2278,25 +2299,25 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2278
2299
|
placeholder: n.placeholder?.text,
|
|
2279
2300
|
type: "text"
|
|
2280
2301
|
});
|
|
2281
|
-
case "email_text_input": return /* @__PURE__ */
|
|
2302
|
+
case "email_text_input": return /* @__PURE__ */ u("input", {
|
|
2282
2303
|
...a,
|
|
2283
|
-
className:
|
|
2304
|
+
className: k(a.className, t),
|
|
2284
2305
|
defaultValue: n.initial_value,
|
|
2285
2306
|
onChange: s,
|
|
2286
2307
|
placeholder: n.placeholder?.text,
|
|
2287
2308
|
type: "email"
|
|
2288
2309
|
});
|
|
2289
|
-
case "url_text_input": return /* @__PURE__ */
|
|
2310
|
+
case "url_text_input": return /* @__PURE__ */ u("input", {
|
|
2290
2311
|
...a,
|
|
2291
|
-
className:
|
|
2312
|
+
className: k(a.className, t),
|
|
2292
2313
|
defaultValue: n.initial_value,
|
|
2293
2314
|
onChange: s,
|
|
2294
2315
|
placeholder: n.placeholder?.text,
|
|
2295
2316
|
type: "url"
|
|
2296
2317
|
});
|
|
2297
|
-
case "number_input": return /* @__PURE__ */
|
|
2318
|
+
case "number_input": return /* @__PURE__ */ u("input", {
|
|
2298
2319
|
...a,
|
|
2299
|
-
className:
|
|
2320
|
+
className: k(a.className, t),
|
|
2300
2321
|
defaultValue: n.initial_value,
|
|
2301
2322
|
max: n.max_value,
|
|
2302
2323
|
min: n.min_value,
|
|
@@ -2306,93 +2327,93 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2306
2327
|
type: "number"
|
|
2307
2328
|
});
|
|
2308
2329
|
case "datepicker": {
|
|
2309
|
-
let e =
|
|
2310
|
-
return /* @__PURE__ */
|
|
2330
|
+
let e = g(D.button, D.picker);
|
|
2331
|
+
return /* @__PURE__ */ d("button", {
|
|
2311
2332
|
...e,
|
|
2312
2333
|
"aria-label": "Date",
|
|
2313
|
-
className:
|
|
2334
|
+
className: k(e.className, t),
|
|
2314
2335
|
onClick: () => {
|
|
2315
2336
|
o(n.initial_date ?? "");
|
|
2316
2337
|
},
|
|
2317
2338
|
type: "button",
|
|
2318
2339
|
children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
...
|
|
2340
|
+
/* @__PURE__ */ u("span", {
|
|
2341
|
+
...g(D.pickerIcon),
|
|
2321
2342
|
"aria-hidden": "true",
|
|
2322
2343
|
children: "▦"
|
|
2323
2344
|
}),
|
|
2324
2345
|
nt(n.initial_date),
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
...
|
|
2346
|
+
/* @__PURE__ */ u("span", {
|
|
2347
|
+
...g(D.pickerChevron),
|
|
2327
2348
|
"aria-hidden": "true",
|
|
2328
2349
|
children: "⌄"
|
|
2329
2350
|
})
|
|
2330
2351
|
]
|
|
2331
2352
|
});
|
|
2332
2353
|
}
|
|
2333
|
-
case "datetimepicker": return /* @__PURE__ */
|
|
2354
|
+
case "datetimepicker": return /* @__PURE__ */ u("input", {
|
|
2334
2355
|
...a,
|
|
2335
|
-
className:
|
|
2356
|
+
className: k(a.className, t),
|
|
2336
2357
|
defaultValue: rt(n.initial_date_time),
|
|
2337
2358
|
onChange: s,
|
|
2338
2359
|
type: "datetime-local"
|
|
2339
2360
|
});
|
|
2340
|
-
case "timepicker": return /* @__PURE__ */
|
|
2361
|
+
case "timepicker": return /* @__PURE__ */ u("input", {
|
|
2341
2362
|
...a,
|
|
2342
|
-
className:
|
|
2363
|
+
className: k(a.className, t),
|
|
2343
2364
|
defaultValue: n.initial_time,
|
|
2344
2365
|
onChange: s,
|
|
2345
2366
|
type: "time"
|
|
2346
2367
|
});
|
|
2347
|
-
case "file_input": return /* @__PURE__ */
|
|
2368
|
+
case "file_input": return /* @__PURE__ */ u("input", {
|
|
2348
2369
|
...a,
|
|
2349
2370
|
accept: n.filetypes?.map((e) => `.${e}`).join(","),
|
|
2350
|
-
className:
|
|
2371
|
+
className: k(a.className, t),
|
|
2351
2372
|
multiple: (n.max_files ?? 10) > 1,
|
|
2352
2373
|
onChange: (e) => {
|
|
2353
2374
|
o(e.currentTarget.files?.[0]?.name ?? "");
|
|
2354
2375
|
},
|
|
2355
2376
|
type: "file"
|
|
2356
2377
|
});
|
|
2357
|
-
case "rich_text_input": return /* @__PURE__ */
|
|
2378
|
+
case "rich_text_input": return /* @__PURE__ */ u("div", {
|
|
2358
2379
|
...a,
|
|
2359
|
-
className:
|
|
2380
|
+
className: k(a.className, t),
|
|
2360
2381
|
contentEditable: !0,
|
|
2361
2382
|
onInput: (e) => {
|
|
2362
2383
|
o(e.currentTarget.textContent ?? "");
|
|
2363
2384
|
},
|
|
2364
2385
|
role: "textbox",
|
|
2365
2386
|
suppressContentEditableWarning: !0,
|
|
2366
|
-
children: n.initial_value === void 0 ? null : /* @__PURE__ */
|
|
2387
|
+
children: n.initial_value === void 0 ? null : /* @__PURE__ */ u(M, {
|
|
2367
2388
|
block: n.initial_value,
|
|
2368
2389
|
path: `${r}.initial_value`
|
|
2369
2390
|
})
|
|
2370
2391
|
});
|
|
2371
2392
|
}
|
|
2372
|
-
return
|
|
2393
|
+
return _(n);
|
|
2373
2394
|
}
|
|
2374
2395
|
function at({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
2375
|
-
if (!
|
|
2396
|
+
if (!Oe(n)) return /* @__PURE__ */ u(N, {
|
|
2376
2397
|
className: t,
|
|
2377
2398
|
element: n
|
|
2378
2399
|
});
|
|
2379
|
-
if (n.type === "image") return /* @__PURE__ */
|
|
2400
|
+
if (n.type === "image") return /* @__PURE__ */ u(P, {
|
|
2380
2401
|
className: t,
|
|
2381
2402
|
element: n
|
|
2382
2403
|
});
|
|
2383
2404
|
switch (n.type) {
|
|
2384
|
-
case "button": return /* @__PURE__ */
|
|
2405
|
+
case "button": return /* @__PURE__ */ u(Ve, {
|
|
2385
2406
|
blockId: e,
|
|
2386
2407
|
className: t,
|
|
2387
2408
|
element: n
|
|
2388
2409
|
});
|
|
2389
2410
|
case "checkboxes":
|
|
2390
|
-
case "radio_buttons": return /* @__PURE__ */
|
|
2411
|
+
case "radio_buttons": return /* @__PURE__ */ u(Ge, {
|
|
2391
2412
|
blockId: e,
|
|
2392
2413
|
className: t,
|
|
2393
2414
|
element: n
|
|
2394
2415
|
});
|
|
2395
|
-
case "overflow": return /* @__PURE__ */
|
|
2416
|
+
case "overflow": return /* @__PURE__ */ u(He, {
|
|
2396
2417
|
blockId: e,
|
|
2397
2418
|
className: t,
|
|
2398
2419
|
element: n
|
|
@@ -2406,7 +2427,7 @@ function at({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2406
2427
|
case "multi_static_select":
|
|
2407
2428
|
case "multi_users_select":
|
|
2408
2429
|
case "static_select":
|
|
2409
|
-
case "users_select": return /* @__PURE__ */
|
|
2430
|
+
case "users_select": return /* @__PURE__ */ u($e, {
|
|
2410
2431
|
blockId: e,
|
|
2411
2432
|
className: t,
|
|
2412
2433
|
element: n
|
|
@@ -2419,27 +2440,27 @@ function at({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2419
2440
|
case "plain_text_input":
|
|
2420
2441
|
case "rich_text_input":
|
|
2421
2442
|
case "timepicker":
|
|
2422
|
-
case "url_text_input": return /* @__PURE__ */
|
|
2443
|
+
case "url_text_input": return /* @__PURE__ */ u(it, {
|
|
2423
2444
|
blockId: e,
|
|
2424
2445
|
className: t,
|
|
2425
2446
|
element: n,
|
|
2426
2447
|
path: r
|
|
2427
2448
|
});
|
|
2428
2449
|
case "workflow_button": {
|
|
2429
|
-
if (!Fe(n)) return /* @__PURE__ */
|
|
2450
|
+
if (!Fe(n)) return /* @__PURE__ */ u(N, {
|
|
2430
2451
|
className: t,
|
|
2431
2452
|
element: n
|
|
2432
2453
|
});
|
|
2433
|
-
let e =
|
|
2434
|
-
return /* @__PURE__ */
|
|
2454
|
+
let e = g(D.button);
|
|
2455
|
+
return /* @__PURE__ */ u("button", {
|
|
2435
2456
|
...e,
|
|
2436
|
-
className:
|
|
2457
|
+
className: k(e.className, t),
|
|
2437
2458
|
type: "button",
|
|
2438
2459
|
children: n.text.text
|
|
2439
2460
|
});
|
|
2440
2461
|
}
|
|
2441
2462
|
}
|
|
2442
|
-
return
|
|
2463
|
+
return _(n);
|
|
2443
2464
|
}
|
|
2444
2465
|
//#endregion
|
|
2445
2466
|
//#region src/text/Mrkdwn.tsx
|
|
@@ -2456,10 +2477,14 @@ function lt(e) {
|
|
|
2456
2477
|
}
|
|
2457
2478
|
function ut(e) {
|
|
2458
2479
|
let t = lt(e);
|
|
2459
|
-
if (t.startsWith("@"))
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2480
|
+
if (t.startsWith("@")) {
|
|
2481
|
+
let [e = "", n] = t.slice(1).split("|", 2);
|
|
2482
|
+
return {
|
|
2483
|
+
id: e,
|
|
2484
|
+
kind: "user",
|
|
2485
|
+
...n === void 0 ? {} : { fallback: n }
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2463
2488
|
if (t.startsWith("#")) {
|
|
2464
2489
|
let [e = "", n] = t.slice(1).split("|", 2);
|
|
2465
2490
|
return {
|
|
@@ -2486,10 +2511,13 @@ function ut(e) {
|
|
|
2486
2511
|
...a === void 0 ? {} : { href: a }
|
|
2487
2512
|
};
|
|
2488
2513
|
}
|
|
2489
|
-
if (t
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2514
|
+
if (t.startsWith("!")) {
|
|
2515
|
+
let [e = ""] = t.slice(1).split("|", 2);
|
|
2516
|
+
if (e === "here" || e === "channel" || e === "everyone") return {
|
|
2517
|
+
kind: "broadcast",
|
|
2518
|
+
range: e
|
|
2519
|
+
};
|
|
2520
|
+
}
|
|
2493
2521
|
let n = t.indexOf("|");
|
|
2494
2522
|
if (n >= 0) return {
|
|
2495
2523
|
href: t.slice(0, n),
|
|
@@ -2577,95 +2605,95 @@ function pt(e) {
|
|
|
2577
2605
|
return ft(e, 0);
|
|
2578
2606
|
}
|
|
2579
2607
|
function mt({ token: e }) {
|
|
2580
|
-
let { resolvers: t } =
|
|
2608
|
+
let { resolvers: t } = x();
|
|
2581
2609
|
switch (e.kind) {
|
|
2582
2610
|
case "text": return e.value;
|
|
2583
|
-
case "bold": return /* @__PURE__ */
|
|
2584
|
-
...
|
|
2585
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
2611
|
+
case "bold": return /* @__PURE__ */ u("strong", {
|
|
2612
|
+
...g(D.bold),
|
|
2613
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(mt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2586
2614
|
});
|
|
2587
|
-
case "italic": return /* @__PURE__ */
|
|
2588
|
-
...
|
|
2589
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
2615
|
+
case "italic": return /* @__PURE__ */ u("em", {
|
|
2616
|
+
...g(D.italic),
|
|
2617
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(mt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2590
2618
|
});
|
|
2591
|
-
case "strike": return /* @__PURE__ */
|
|
2592
|
-
...
|
|
2593
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
2619
|
+
case "strike": return /* @__PURE__ */ u("s", {
|
|
2620
|
+
...g(D.strike),
|
|
2621
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(mt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2594
2622
|
});
|
|
2595
|
-
case "code": return /* @__PURE__ */
|
|
2596
|
-
...
|
|
2623
|
+
case "code": return /* @__PURE__ */ u("code", {
|
|
2624
|
+
...g(D.inlineCode),
|
|
2597
2625
|
children: e.value
|
|
2598
2626
|
});
|
|
2599
|
-
case "code_block": return /* @__PURE__ */
|
|
2600
|
-
...
|
|
2627
|
+
case "code_block": return /* @__PURE__ */ u("pre", {
|
|
2628
|
+
...g(D.pre),
|
|
2601
2629
|
children: e.value
|
|
2602
2630
|
});
|
|
2603
|
-
case "emoji": return /* @__PURE__ */
|
|
2631
|
+
case "emoji": return /* @__PURE__ */ u("span", {
|
|
2604
2632
|
"aria-label": `:${e.name}:`,
|
|
2605
2633
|
role: "img",
|
|
2606
|
-
children: t.emoji?.(e.name) ??
|
|
2634
|
+
children: t.emoji?.(e.name) ?? me(e.name) ?? `:${e.name}:`
|
|
2607
2635
|
});
|
|
2608
2636
|
case "link": {
|
|
2609
|
-
let t =
|
|
2610
|
-
return t === void 0 ? e.label : /* @__PURE__ */
|
|
2611
|
-
...
|
|
2637
|
+
let t = E(e.href);
|
|
2638
|
+
return t === void 0 ? e.label : /* @__PURE__ */ u("a", {
|
|
2639
|
+
...g(D.link),
|
|
2612
2640
|
href: t,
|
|
2613
2641
|
rel: "noreferrer",
|
|
2614
2642
|
children: e.label
|
|
2615
2643
|
});
|
|
2616
2644
|
}
|
|
2617
|
-
case "user": return /* @__PURE__ */
|
|
2618
|
-
...
|
|
2619
|
-
children: ["@", t.user?.(e.id) ?? e.id]
|
|
2645
|
+
case "user": return /* @__PURE__ */ d("span", {
|
|
2646
|
+
...g(D.mention),
|
|
2647
|
+
children: ["@", t.user?.(e.id) ?? e.fallback ?? e.id]
|
|
2620
2648
|
});
|
|
2621
|
-
case "channel": return /* @__PURE__ */
|
|
2622
|
-
...
|
|
2649
|
+
case "channel": return /* @__PURE__ */ d("span", {
|
|
2650
|
+
...g(D.mention),
|
|
2623
2651
|
children: ["#", t.channel?.(e.id) ?? e.fallback ?? e.id]
|
|
2624
2652
|
});
|
|
2625
|
-
case "usergroup": return /* @__PURE__ */
|
|
2626
|
-
...
|
|
2653
|
+
case "usergroup": return /* @__PURE__ */ d("span", {
|
|
2654
|
+
...g(D.mention),
|
|
2627
2655
|
children: ["@", t.usergroup?.(e.id) ?? e.fallback ?? e.id]
|
|
2628
2656
|
});
|
|
2629
|
-
case "team": return /* @__PURE__ */
|
|
2630
|
-
...
|
|
2657
|
+
case "team": return /* @__PURE__ */ d("span", {
|
|
2658
|
+
...g(D.mention),
|
|
2631
2659
|
children: ["@", t.team?.(e.id) ?? e.id]
|
|
2632
2660
|
});
|
|
2633
|
-
case "broadcast": return /* @__PURE__ */
|
|
2634
|
-
...
|
|
2661
|
+
case "broadcast": return /* @__PURE__ */ d("span", {
|
|
2662
|
+
...g(D.mention),
|
|
2635
2663
|
children: ["@", e.range]
|
|
2636
2664
|
});
|
|
2637
2665
|
case "date": {
|
|
2638
|
-
let n = Number(e.id), r = Number.isFinite(n) ? t.date?.(n, e.format ?? "") ??
|
|
2639
|
-
return i === void 0 ? r : /* @__PURE__ */
|
|
2640
|
-
...
|
|
2666
|
+
let n = Number(e.id), r = Number.isFinite(n) ? t.date?.(n, e.format ?? "") ?? de(n, e.format ?? "", e.fallback) : e.fallback ?? e.id, i = E(e.href);
|
|
2667
|
+
return i === void 0 ? r : /* @__PURE__ */ u("a", {
|
|
2668
|
+
...g(D.link),
|
|
2641
2669
|
href: i,
|
|
2642
2670
|
rel: "noreferrer",
|
|
2643
2671
|
children: r
|
|
2644
2672
|
});
|
|
2645
2673
|
}
|
|
2646
2674
|
}
|
|
2647
|
-
return
|
|
2675
|
+
return _(e);
|
|
2648
2676
|
}
|
|
2649
|
-
function
|
|
2650
|
-
let n =
|
|
2651
|
-
return /* @__PURE__ */
|
|
2677
|
+
function F({ className: e, text: t }) {
|
|
2678
|
+
let n = g(D.text);
|
|
2679
|
+
return /* @__PURE__ */ u("div", {
|
|
2652
2680
|
...n,
|
|
2653
|
-
className:
|
|
2654
|
-
children: pt(t).map((e, t) => /* @__PURE__ */
|
|
2681
|
+
className: k(n.className, e),
|
|
2682
|
+
children: pt(t).map((e, t) => /* @__PURE__ */ u(mt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2655
2683
|
});
|
|
2656
2684
|
}
|
|
2657
2685
|
//#endregion
|
|
2658
2686
|
//#region src/text/Text.tsx
|
|
2659
|
-
function
|
|
2660
|
-
let n = t, r =
|
|
2661
|
-
if (
|
|
2687
|
+
function I({ className: e, text: t }) {
|
|
2688
|
+
let n = t, r = S(n) && typeof n.text == "string" ? n.text : T(n, "text");
|
|
2689
|
+
if (C(n) === "mrkdwn") return /* @__PURE__ */ u(F, {
|
|
2662
2690
|
className: e,
|
|
2663
2691
|
text: r
|
|
2664
2692
|
});
|
|
2665
|
-
let i =
|
|
2666
|
-
return /* @__PURE__ */
|
|
2693
|
+
let i = g(D.text);
|
|
2694
|
+
return /* @__PURE__ */ u("div", {
|
|
2667
2695
|
...i,
|
|
2668
|
-
className:
|
|
2696
|
+
className: k(i.className, e),
|
|
2669
2697
|
children: r
|
|
2670
2698
|
});
|
|
2671
2699
|
}
|
|
@@ -2781,80 +2809,80 @@ function yt(e) {
|
|
|
2781
2809
|
}
|
|
2782
2810
|
return n;
|
|
2783
2811
|
}
|
|
2784
|
-
function
|
|
2812
|
+
function L(e) {
|
|
2785
2813
|
return e.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, "<$2|$1>").replaceAll("**", "*").replaceAll("__", "*").replaceAll("~~", "~");
|
|
2786
2814
|
}
|
|
2787
2815
|
function bt(e) {
|
|
2788
|
-
return e <= 1 ?
|
|
2816
|
+
return e <= 1 ? D.heading1 : e === 2 ? D.heading2 : e === 3 ? D.heading3 : D.heading4;
|
|
2789
2817
|
}
|
|
2790
2818
|
function xt({ token: e }) {
|
|
2791
2819
|
switch (e.kind) {
|
|
2792
|
-
case "paragraph": return /* @__PURE__ */
|
|
2793
|
-
case "quote": return /* @__PURE__ */
|
|
2794
|
-
...
|
|
2795
|
-
children: /* @__PURE__ */
|
|
2820
|
+
case "paragraph": return /* @__PURE__ */ u(F, { text: L(e.text) });
|
|
2821
|
+
case "quote": return /* @__PURE__ */ u("blockquote", {
|
|
2822
|
+
...g(D.quote),
|
|
2823
|
+
children: /* @__PURE__ */ u(F, { text: L(e.text) })
|
|
2796
2824
|
});
|
|
2797
|
-
case "heading": return /* @__PURE__ */
|
|
2798
|
-
...
|
|
2799
|
-
children: /* @__PURE__ */
|
|
2825
|
+
case "heading": return /* @__PURE__ */ u("div", {
|
|
2826
|
+
...g(D.heading, bt(e.level)),
|
|
2827
|
+
children: /* @__PURE__ */ u(F, { text: L(e.text) })
|
|
2800
2828
|
});
|
|
2801
|
-
case "divider": return /* @__PURE__ */
|
|
2802
|
-
case "code": return /* @__PURE__ */
|
|
2803
|
-
...
|
|
2829
|
+
case "divider": return /* @__PURE__ */ u("hr", { ...g(D.divider) });
|
|
2830
|
+
case "code": return /* @__PURE__ */ u("pre", {
|
|
2831
|
+
...g(D.pre),
|
|
2804
2832
|
"data-language": e.language,
|
|
2805
2833
|
children: e.text
|
|
2806
2834
|
});
|
|
2807
2835
|
case "list": {
|
|
2808
|
-
let n = e.ordered ?
|
|
2809
|
-
...
|
|
2836
|
+
let n = e.ordered ? D.listItemOrdered : [D.listItemBullet, D.listBullet], r = e.items.map((e, r) => /* @__PURE__ */ t("li", {
|
|
2837
|
+
...g(n),
|
|
2810
2838
|
key: `${e.text}-${String(r)}`
|
|
2811
|
-
}, e.task ? /* @__PURE__ */
|
|
2839
|
+
}, e.task ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("input", {
|
|
2812
2840
|
checked: e.checked,
|
|
2813
2841
|
disabled: !0,
|
|
2814
2842
|
readOnly: !0,
|
|
2815
2843
|
type: "checkbox"
|
|
2816
|
-
}), " "] }) : null, /* @__PURE__ */
|
|
2817
|
-
return e.ordered ? /* @__PURE__ */
|
|
2818
|
-
...
|
|
2844
|
+
}), " "] }) : null, /* @__PURE__ */ u(F, { text: L(e.text) })));
|
|
2845
|
+
return e.ordered ? /* @__PURE__ */ u("ol", {
|
|
2846
|
+
...g(D.list, D.listOrdered),
|
|
2819
2847
|
children: r
|
|
2820
|
-
}) : /* @__PURE__ */
|
|
2821
|
-
...
|
|
2848
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
2849
|
+
...g(D.list),
|
|
2822
2850
|
children: r
|
|
2823
2851
|
});
|
|
2824
2852
|
}
|
|
2825
|
-
case "table": return /* @__PURE__ */
|
|
2826
|
-
...
|
|
2827
|
-
children: /* @__PURE__ */
|
|
2828
|
-
...
|
|
2829
|
-
children: [/* @__PURE__ */
|
|
2830
|
-
...
|
|
2853
|
+
case "table": return /* @__PURE__ */ u("div", {
|
|
2854
|
+
...g(D.tableScroller),
|
|
2855
|
+
children: /* @__PURE__ */ d("table", {
|
|
2856
|
+
...g(D.table),
|
|
2857
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.headers.map((e, n) => /* @__PURE__ */ t("th", {
|
|
2858
|
+
...g(D.tableCell, D.tableHeader, n === 0 && D.tableCellFirstColumn),
|
|
2831
2859
|
key: `${e}-${String(n)}`,
|
|
2832
2860
|
scope: "col"
|
|
2833
|
-
}, /* @__PURE__ */
|
|
2834
|
-
...
|
|
2861
|
+
}, /* @__PURE__ */ u(F, { text: L(e) }))) }) }), /* @__PURE__ */ u("tbody", { children: e.rows.map((e, n) => /* @__PURE__ */ u("tr", { children: e.map((e, n) => /* @__PURE__ */ t("td", {
|
|
2862
|
+
...g(D.tableCell, n === 0 && D.tableCellFirstColumn),
|
|
2835
2863
|
key: `${e}-${String(n)}`
|
|
2836
|
-
}, /* @__PURE__ */
|
|
2864
|
+
}, /* @__PURE__ */ u(F, { text: L(e) }))) }, `row-${String(n)}`)) })]
|
|
2837
2865
|
})
|
|
2838
2866
|
});
|
|
2839
2867
|
}
|
|
2840
|
-
return
|
|
2868
|
+
return _(e);
|
|
2841
2869
|
}
|
|
2842
2870
|
function St({ markdown: e }) {
|
|
2843
|
-
return /* @__PURE__ */
|
|
2844
|
-
...
|
|
2845
|
-
children: yt(e).map((e, t) => /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ u("div", {
|
|
2872
|
+
...g(D.markdown),
|
|
2873
|
+
children: yt(e).map((e, t) => /* @__PURE__ */ u(xt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2846
2874
|
});
|
|
2847
2875
|
}
|
|
2848
2876
|
//#endregion
|
|
2849
2877
|
//#region src/blocks/BasicBlocks.tsx
|
|
2850
2878
|
function Ct(e) {
|
|
2851
|
-
return
|
|
2879
|
+
return S(e) && e.type === "image";
|
|
2852
2880
|
}
|
|
2853
|
-
function
|
|
2854
|
-
let i =
|
|
2855
|
-
return /* @__PURE__ */
|
|
2881
|
+
function R({ blockId: e, blockType: t, children: n, className: r }) {
|
|
2882
|
+
let i = g(D.block);
|
|
2883
|
+
return /* @__PURE__ */ u("div", {
|
|
2856
2884
|
...i,
|
|
2857
|
-
className:
|
|
2885
|
+
className: k(i.className, r),
|
|
2858
2886
|
"data-block-id": e,
|
|
2859
2887
|
"data-block-type": t,
|
|
2860
2888
|
children: n
|
|
@@ -2862,27 +2890,27 @@ function L({ blockId: e, blockType: t, children: n, className: r }) {
|
|
|
2862
2890
|
}
|
|
2863
2891
|
function wt({ block: e, className: t, path: n = "block" }) {
|
|
2864
2892
|
let r = e.accessory, i = Array.isArray(e.fields) ? e.fields : void 0;
|
|
2865
|
-
return /* @__PURE__ */
|
|
2893
|
+
return /* @__PURE__ */ u(R, {
|
|
2866
2894
|
blockId: e.block_id,
|
|
2867
2895
|
blockType: e.type,
|
|
2868
2896
|
className: t,
|
|
2869
|
-
children: /* @__PURE__ */
|
|
2870
|
-
...
|
|
2871
|
-
children: [/* @__PURE__ */
|
|
2872
|
-
...
|
|
2873
|
-
children: [e.text === void 0 ? null : /* @__PURE__ */
|
|
2874
|
-
...
|
|
2875
|
-
children: i.map((e, t) => /* @__PURE__ */
|
|
2897
|
+
children: /* @__PURE__ */ d("div", {
|
|
2898
|
+
...g(D.section),
|
|
2899
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2900
|
+
...g(D.sectionContent),
|
|
2901
|
+
children: [e.text === void 0 ? null : /* @__PURE__ */ u(I, { text: e.text }), i === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
2902
|
+
...g(D.fields),
|
|
2903
|
+
children: i.map((e, t) => /* @__PURE__ */ u(I, { text: e }, `${C(e) ?? "unknown"}-${String(t)}`))
|
|
2876
2904
|
})]
|
|
2877
|
-
}), r === void 0 ? null : Ct(r) ? /* @__PURE__ */
|
|
2878
|
-
...
|
|
2879
|
-
children: /* @__PURE__ */
|
|
2905
|
+
}), r === void 0 ? null : Ct(r) ? /* @__PURE__ */ u("div", {
|
|
2906
|
+
...g(D.accessory),
|
|
2907
|
+
children: /* @__PURE__ */ u(P, {
|
|
2880
2908
|
element: r,
|
|
2881
2909
|
variant: "accessory"
|
|
2882
2910
|
})
|
|
2883
|
-
}) : /* @__PURE__ */
|
|
2911
|
+
}) : /* @__PURE__ */ u(at, {
|
|
2884
2912
|
blockId: e.block_id,
|
|
2885
|
-
className:
|
|
2913
|
+
className: g(D.accessory).className,
|
|
2886
2914
|
element: e.accessory,
|
|
2887
2915
|
path: `${n}.accessory`
|
|
2888
2916
|
})]
|
|
@@ -2890,11 +2918,11 @@ function wt({ block: e, className: t, path: n = "block" }) {
|
|
|
2890
2918
|
});
|
|
2891
2919
|
}
|
|
2892
2920
|
function Tt({ block: e, className: t }) {
|
|
2893
|
-
let n = e.level === void 0 ? void 0 : Math.trunc(e.level), r = n === void 0 || Number.isNaN(n) ? void 0 : Math.min(4, Math.max(1, n)), i = e.text, a =
|
|
2921
|
+
let n = e.level === void 0 ? void 0 : Math.trunc(e.level), r = n === void 0 || Number.isNaN(n) ? void 0 : Math.min(4, Math.max(1, n)), i = e.text, a = S(i) && typeof i.text == "string" ? i.text : T(e, "header"), o = g(D.heading, r === 1 && D.heading1, (r === void 0 || r === 2) && D.heading2, r === 3 && D.heading3, r === 4 && D.heading4), s = u(r === 1 ? "h1" : r === 3 ? "h3" : r === 4 ? "h4" : "h2", {
|
|
2894
2922
|
...o,
|
|
2895
2923
|
children: a
|
|
2896
2924
|
});
|
|
2897
|
-
return /* @__PURE__ */
|
|
2925
|
+
return /* @__PURE__ */ u(R, {
|
|
2898
2926
|
blockId: e.block_id,
|
|
2899
2927
|
blockType: e.type,
|
|
2900
2928
|
className: t,
|
|
@@ -2902,119 +2930,119 @@ function Tt({ block: e, className: t }) {
|
|
|
2902
2930
|
});
|
|
2903
2931
|
}
|
|
2904
2932
|
function Et({ block: e, className: t }) {
|
|
2905
|
-
return /* @__PURE__ */
|
|
2933
|
+
return /* @__PURE__ */ u(R, {
|
|
2906
2934
|
blockId: e.block_id,
|
|
2907
2935
|
blockType: e.type,
|
|
2908
2936
|
className: t,
|
|
2909
|
-
children: /* @__PURE__ */
|
|
2937
|
+
children: /* @__PURE__ */ u("hr", { ...g(D.divider) })
|
|
2910
2938
|
});
|
|
2911
2939
|
}
|
|
2912
2940
|
function Dt({ block: e, className: t }) {
|
|
2913
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ d(R, {
|
|
2914
2942
|
blockId: e.block_id,
|
|
2915
2943
|
blockType: e.type,
|
|
2916
2944
|
className: t,
|
|
2917
|
-
children: [/* @__PURE__ */
|
|
2918
|
-
className:
|
|
2945
|
+
children: [/* @__PURE__ */ u(P, { element: e }), e.title === void 0 ? null : /* @__PURE__ */ u(I, {
|
|
2946
|
+
className: g(D.smallText).className,
|
|
2919
2947
|
text: e.title
|
|
2920
2948
|
})]
|
|
2921
2949
|
});
|
|
2922
2950
|
}
|
|
2923
2951
|
function Ot(e) {
|
|
2924
|
-
return
|
|
2952
|
+
return S(e) && (e.type === "mrkdwn" || e.type === "plain_text") && typeof e.text == "string";
|
|
2925
2953
|
}
|
|
2926
2954
|
function kt({ block: e, className: n }) {
|
|
2927
2955
|
let r = e.elements;
|
|
2928
|
-
return /* @__PURE__ */
|
|
2956
|
+
return /* @__PURE__ */ u(R, {
|
|
2929
2957
|
blockId: e.block_id,
|
|
2930
2958
|
blockType: e.type,
|
|
2931
2959
|
className: n,
|
|
2932
|
-
children: /* @__PURE__ */
|
|
2933
|
-
...
|
|
2934
|
-
children: Array.isArray(r) ? r.map((e, n) => Ct(e) ? /* @__PURE__ */
|
|
2960
|
+
children: /* @__PURE__ */ u("div", {
|
|
2961
|
+
...g(D.context),
|
|
2962
|
+
children: Array.isArray(r) ? r.map((e, n) => Ct(e) ? /* @__PURE__ */ u(P, {
|
|
2935
2963
|
element: e,
|
|
2936
2964
|
variant: "context"
|
|
2937
2965
|
}, `${e.type}-${String(n)}`) : Ot(e) ? /* @__PURE__ */ t("div", {
|
|
2938
|
-
...
|
|
2966
|
+
...g(D.contextElement),
|
|
2939
2967
|
key: `${e.type}-${String(n)}`
|
|
2940
|
-
}, /* @__PURE__ */
|
|
2941
|
-
className:
|
|
2968
|
+
}, /* @__PURE__ */ u(I, {
|
|
2969
|
+
className: g(D.contextText).className,
|
|
2942
2970
|
text: e
|
|
2943
2971
|
})) : /* @__PURE__ */ t("span", {
|
|
2944
|
-
...
|
|
2945
|
-
"data-unhandled-element":
|
|
2972
|
+
...g(D.unhandled),
|
|
2973
|
+
"data-unhandled-element": C(e) ?? "unknown",
|
|
2946
2974
|
key: `unhandled-${String(n)}`
|
|
2947
|
-
},
|
|
2948
|
-
...
|
|
2975
|
+
}, T(e, "context element"))) : /* @__PURE__ */ u("span", {
|
|
2976
|
+
...g(D.unhandled),
|
|
2949
2977
|
"data-unhandled-element": "context",
|
|
2950
|
-
children:
|
|
2978
|
+
children: T(e, "context block")
|
|
2951
2979
|
})
|
|
2952
2980
|
})
|
|
2953
2981
|
});
|
|
2954
2982
|
}
|
|
2955
2983
|
function At({ block: e, className: t, path: n = "block" }) {
|
|
2956
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ u(R, {
|
|
2957
2985
|
blockId: e.block_id,
|
|
2958
2986
|
blockType: e.type,
|
|
2959
2987
|
className: t,
|
|
2960
|
-
children: /* @__PURE__ */
|
|
2988
|
+
children: /* @__PURE__ */ u(M, {
|
|
2961
2989
|
block: e,
|
|
2962
2990
|
path: n
|
|
2963
2991
|
})
|
|
2964
2992
|
});
|
|
2965
2993
|
}
|
|
2966
2994
|
function jt({ block: e, className: t }) {
|
|
2967
|
-
let n = typeof e.text == "string" ? e.text :
|
|
2968
|
-
return /* @__PURE__ */
|
|
2995
|
+
let n = typeof e.text == "string" ? e.text : T(e, "markdown block");
|
|
2996
|
+
return /* @__PURE__ */ u(R, {
|
|
2969
2997
|
blockId: e.block_id,
|
|
2970
2998
|
blockType: e.type,
|
|
2971
2999
|
className: t,
|
|
2972
|
-
children: /* @__PURE__ */
|
|
3000
|
+
children: /* @__PURE__ */ u(St, { markdown: n })
|
|
2973
3001
|
});
|
|
2974
3002
|
}
|
|
2975
3003
|
function Mt({ block: e, className: t }) {
|
|
2976
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ u(R, {
|
|
2977
3005
|
blockId: e.block_id,
|
|
2978
3006
|
blockType: e.type,
|
|
2979
3007
|
className: t,
|
|
2980
|
-
children: /* @__PURE__ */
|
|
2981
|
-
...
|
|
2982
|
-
children: [/* @__PURE__ */
|
|
3008
|
+
children: /* @__PURE__ */ d("div", {
|
|
3009
|
+
...g(D.file),
|
|
3010
|
+
children: [/* @__PURE__ */ u("span", {
|
|
2983
3011
|
"aria-hidden": "true",
|
|
2984
3012
|
children: "📎"
|
|
2985
|
-
}), /* @__PURE__ */
|
|
2986
|
-
...
|
|
3013
|
+
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("strong", { children: "Remote file" }), /* @__PURE__ */ u("div", {
|
|
3014
|
+
...g(D.smallText),
|
|
2987
3015
|
children: e.external_id
|
|
2988
3016
|
})] })]
|
|
2989
3017
|
})
|
|
2990
3018
|
});
|
|
2991
3019
|
}
|
|
2992
3020
|
function Nt({ block: e, className: t }) {
|
|
2993
|
-
let n =
|
|
2994
|
-
...
|
|
3021
|
+
let n = E(typeof e.title_url == "string" ? e.title_url : typeof e.video_url == "string" ? e.video_url : void 0), r = e.title, i = S(r) && typeof r.text == "string" ? r.text : T(e, "video"), a = e.description, o = S(a) && typeof a.text == "string" ? a.text : void 0, s = typeof e.alt_text == "string" ? e.alt_text : T(e, "video"), c = typeof e.thumbnail_url == "string" ? e.thumbnail_url : void 0, f = /* @__PURE__ */ d(l, { children: [c === void 0 ? null : /* @__PURE__ */ u("img", {
|
|
3022
|
+
...g(D.image, D.cardHero),
|
|
2995
3023
|
alt: s,
|
|
2996
|
-
src:
|
|
2997
|
-
}), /* @__PURE__ */
|
|
2998
|
-
...
|
|
3024
|
+
src: c
|
|
3025
|
+
}), /* @__PURE__ */ d("div", {
|
|
3026
|
+
...g(D.cardContent),
|
|
2999
3027
|
children: [
|
|
3000
|
-
/* @__PURE__ */
|
|
3028
|
+
/* @__PURE__ */ u("strong", { children: i }),
|
|
3001
3029
|
o,
|
|
3002
|
-
typeof e.provider_name == "string" ? /* @__PURE__ */
|
|
3003
|
-
...
|
|
3030
|
+
typeof e.provider_name == "string" ? /* @__PURE__ */ u("span", {
|
|
3031
|
+
...g(D.smallText),
|
|
3004
3032
|
children: e.provider_name
|
|
3005
3033
|
}) : null
|
|
3006
3034
|
]
|
|
3007
3035
|
})] });
|
|
3008
|
-
return /* @__PURE__ */
|
|
3036
|
+
return /* @__PURE__ */ u(R, {
|
|
3009
3037
|
blockId: e.block_id,
|
|
3010
3038
|
blockType: e.type,
|
|
3011
3039
|
className: t,
|
|
3012
|
-
children: n === void 0 ? /* @__PURE__ */
|
|
3013
|
-
...
|
|
3040
|
+
children: n === void 0 ? /* @__PURE__ */ u("div", {
|
|
3041
|
+
...g(D.card),
|
|
3014
3042
|
"aria-label": s,
|
|
3015
3043
|
children: f
|
|
3016
|
-
}) : /* @__PURE__ */
|
|
3017
|
-
...
|
|
3044
|
+
}) : /* @__PURE__ */ u("a", {
|
|
3045
|
+
...g(D.card),
|
|
3018
3046
|
"aria-label": s,
|
|
3019
3047
|
href: n,
|
|
3020
3048
|
rel: "noreferrer",
|
|
@@ -3025,34 +3053,34 @@ function Nt({ block: e, className: t }) {
|
|
|
3025
3053
|
//#endregion
|
|
3026
3054
|
//#region src/blocks/AdvancedBlocks.tsx
|
|
3027
3055
|
function Pt({ align: e = "left", cell: t, className: n, firstColumn: r = !1, header: i = !1, path: a = "cell", scope: o = "col", wrapped: s = !1 }) {
|
|
3028
|
-
let c =
|
|
3029
|
-
if (!
|
|
3056
|
+
let c = g(D.tableCell, i && D.tableHeader, r && D.tableCellFirstColumn, s && D.tableCellWrapped), l;
|
|
3057
|
+
if (!S(t)) l = T(t, "table cell");
|
|
3030
3058
|
else switch (t.type) {
|
|
3031
3059
|
case "rich_text":
|
|
3032
|
-
|
|
3060
|
+
l = /* @__PURE__ */ u(M, {
|
|
3033
3061
|
block: t,
|
|
3034
3062
|
path: a
|
|
3035
3063
|
});
|
|
3036
3064
|
break;
|
|
3037
3065
|
case "raw_number":
|
|
3038
|
-
|
|
3066
|
+
l = t.text ?? String(t.value);
|
|
3039
3067
|
break;
|
|
3040
3068
|
case "raw_text":
|
|
3041
|
-
|
|
3069
|
+
l = t.text;
|
|
3042
3070
|
break;
|
|
3043
|
-
default:
|
|
3071
|
+
default: l = T(t, "table cell");
|
|
3044
3072
|
}
|
|
3045
|
-
return i ? /* @__PURE__ */
|
|
3073
|
+
return i ? /* @__PURE__ */ u("th", {
|
|
3046
3074
|
...c,
|
|
3047
|
-
className:
|
|
3075
|
+
className: k(c.className, n),
|
|
3048
3076
|
scope: o,
|
|
3049
3077
|
style: { textAlign: e },
|
|
3050
|
-
children:
|
|
3051
|
-
}) : /* @__PURE__ */
|
|
3078
|
+
children: l
|
|
3079
|
+
}) : /* @__PURE__ */ u("td", {
|
|
3052
3080
|
...c,
|
|
3053
|
-
className:
|
|
3081
|
+
className: k(c.className, n),
|
|
3054
3082
|
style: { textAlign: e },
|
|
3055
|
-
children:
|
|
3083
|
+
children: l
|
|
3056
3084
|
});
|
|
3057
3085
|
}
|
|
3058
3086
|
function Ft(e) {
|
|
@@ -3060,22 +3088,22 @@ function Ft(e) {
|
|
|
3060
3088
|
}
|
|
3061
3089
|
function It({ block: e, className: t, path: n = "block" }) {
|
|
3062
3090
|
let r = Array.isArray(e.rows) ? e.rows.filter(Ft) : [], i = e.column_settings;
|
|
3063
|
-
return /* @__PURE__ */
|
|
3091
|
+
return /* @__PURE__ */ u(R, {
|
|
3064
3092
|
blockId: e.block_id,
|
|
3065
3093
|
blockType: e.type,
|
|
3066
3094
|
className: t,
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3068
|
-
...
|
|
3069
|
-
children: /* @__PURE__ */
|
|
3070
|
-
...
|
|
3071
|
-
children: [/* @__PURE__ */
|
|
3095
|
+
children: /* @__PURE__ */ u("div", {
|
|
3096
|
+
...g(D.tableScroller),
|
|
3097
|
+
children: /* @__PURE__ */ d("table", {
|
|
3098
|
+
...g(D.table),
|
|
3099
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: (r[0] ?? []).map((e, t) => /* @__PURE__ */ u(Pt, {
|
|
3072
3100
|
align: i?.[t]?.align,
|
|
3073
3101
|
cell: e,
|
|
3074
3102
|
firstColumn: t === 0,
|
|
3075
3103
|
header: !0,
|
|
3076
3104
|
path: `${n}.rows[0][${String(t)}]`,
|
|
3077
3105
|
wrapped: i?.[t]?.is_wrapped
|
|
3078
|
-
}, `header-${String(t)}`)) }) }), /* @__PURE__ */
|
|
3106
|
+
}, `header-${String(t)}`)) }) }), /* @__PURE__ */ u("tbody", { children: r.slice(1).map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, r) => /* @__PURE__ */ u(Pt, {
|
|
3079
3107
|
align: i?.[r]?.align,
|
|
3080
3108
|
cell: e,
|
|
3081
3109
|
firstColumn: r === 0,
|
|
@@ -3087,20 +3115,20 @@ function It({ block: e, className: t, path: n = "block" }) {
|
|
|
3087
3115
|
});
|
|
3088
3116
|
}
|
|
3089
3117
|
function Lt({ cell: e, path: t }) {
|
|
3090
|
-
if (!
|
|
3118
|
+
if (!S(e)) return T(e, "table cell");
|
|
3091
3119
|
switch (e.type) {
|
|
3092
|
-
case "rich_text": return /* @__PURE__ */
|
|
3120
|
+
case "rich_text": return /* @__PURE__ */ u(M, {
|
|
3093
3121
|
block: e,
|
|
3094
3122
|
path: t
|
|
3095
3123
|
});
|
|
3096
3124
|
case "raw_number": return e.text ?? String(e.value);
|
|
3097
3125
|
case "raw_text": return e.text;
|
|
3098
|
-
default: return
|
|
3126
|
+
default: return T(e, "table cell");
|
|
3099
3127
|
}
|
|
3100
3128
|
}
|
|
3101
3129
|
function Rt(e) {
|
|
3102
3130
|
let t = e;
|
|
3103
|
-
if (!
|
|
3131
|
+
if (!S(t)) return "";
|
|
3104
3132
|
if (e.type === "raw_text") {
|
|
3105
3133
|
let e = t.text;
|
|
3106
3134
|
return typeof e == "string" ? e : "";
|
|
@@ -3118,124 +3146,124 @@ function Rt(e) {
|
|
|
3118
3146
|
return "";
|
|
3119
3147
|
}
|
|
3120
3148
|
function zt({ block: e, className: n, path: r = "block" }) {
|
|
3121
|
-
let i = e.page_size ?? 5, a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.trunc(i)) : 5, o = Array.isArray(e.rows) ? e.rows.filter(Ft) : [],
|
|
3122
|
-
return /* @__PURE__ */
|
|
3149
|
+
let i = e.page_size ?? 5, a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.trunc(i)) : 5, o = Array.isArray(e.rows) ? e.rows.filter(Ft) : [], s = e.row_header_column_index ?? 0, l = typeof e.caption == "string" ? e.caption : void 0, [f, p] = c(0), [m, h] = c(""), _ = o[0] ?? [], v = m.trim().toLowerCase(), y = v === "" ? o.slice(1) : o.slice(1).filter((e) => e.some((e) => Rt(e).toLowerCase().includes(v))), b = Math.max(1, Math.ceil(y.length / a)), x = Math.min(f, b - 1), S = y.slice(x * a, (x + 1) * a), C = S.length - 1;
|
|
3150
|
+
return /* @__PURE__ */ u(R, {
|
|
3123
3151
|
blockId: e.block_id,
|
|
3124
3152
|
blockType: e.type,
|
|
3125
3153
|
className: n,
|
|
3126
|
-
children: /* @__PURE__ */
|
|
3127
|
-
...
|
|
3128
|
-
children: [/* @__PURE__ */
|
|
3129
|
-
...
|
|
3154
|
+
children: /* @__PURE__ */ d("div", {
|
|
3155
|
+
...g(D.dataTable),
|
|
3156
|
+
children: [/* @__PURE__ */ d("div", {
|
|
3157
|
+
...g(D.dataTableHeaderBar),
|
|
3130
3158
|
children: [
|
|
3131
|
-
/* @__PURE__ */ l("span", {
|
|
3132
|
-
...h(T.dataTableTitle),
|
|
3133
|
-
children: d
|
|
3134
|
-
}),
|
|
3135
3159
|
/* @__PURE__ */ u("span", {
|
|
3136
|
-
...
|
|
3137
|
-
children:
|
|
3160
|
+
...g(D.dataTableTitle),
|
|
3161
|
+
children: l
|
|
3162
|
+
}),
|
|
3163
|
+
/* @__PURE__ */ d("span", {
|
|
3164
|
+
...g(D.dataTableFilter),
|
|
3165
|
+
children: [/* @__PURE__ */ u("span", {
|
|
3138
3166
|
"aria-hidden": "true",
|
|
3139
3167
|
children: "⌕"
|
|
3140
|
-
}), /* @__PURE__ */
|
|
3141
|
-
...
|
|
3142
|
-
"aria-label":
|
|
3168
|
+
}), /* @__PURE__ */ u("input", {
|
|
3169
|
+
...g(D.dataTableFilterInput),
|
|
3170
|
+
"aria-label": l === void 0 ? "Filter table" : `Filter ${l}`,
|
|
3143
3171
|
onChange: (e) => {
|
|
3144
|
-
|
|
3172
|
+
h(e.target.value), p(0);
|
|
3145
3173
|
},
|
|
3146
3174
|
placeholder: "Filter table...",
|
|
3147
3175
|
type: "text",
|
|
3148
3176
|
value: m
|
|
3149
3177
|
})]
|
|
3150
3178
|
}),
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
...
|
|
3153
|
-
"aria-label":
|
|
3179
|
+
/* @__PURE__ */ u("button", {
|
|
3180
|
+
...g(D.dataTableIconButton),
|
|
3181
|
+
"aria-label": l === void 0 ? "Expand table" : `View ${l}`,
|
|
3154
3182
|
type: "button",
|
|
3155
|
-
children: /* @__PURE__ */
|
|
3183
|
+
children: /* @__PURE__ */ u("span", {
|
|
3156
3184
|
"aria-hidden": "true",
|
|
3157
3185
|
children: "⤢"
|
|
3158
3186
|
})
|
|
3159
3187
|
}),
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
...
|
|
3188
|
+
/* @__PURE__ */ u("button", {
|
|
3189
|
+
...g(D.dataTableIconButton),
|
|
3162
3190
|
"aria-label": "More actions",
|
|
3163
3191
|
type: "button",
|
|
3164
|
-
children: /* @__PURE__ */
|
|
3192
|
+
children: /* @__PURE__ */ u("span", {
|
|
3165
3193
|
"aria-hidden": "true",
|
|
3166
3194
|
children: "⋮"
|
|
3167
3195
|
})
|
|
3168
3196
|
})
|
|
3169
3197
|
]
|
|
3170
|
-
}), /* @__PURE__ */
|
|
3171
|
-
...
|
|
3172
|
-
children: [/* @__PURE__ */
|
|
3173
|
-
...
|
|
3198
|
+
}), /* @__PURE__ */ d("div", {
|
|
3199
|
+
...g(D.dataTableBand, b <= 1 && D.dataTableBandUnpaginated),
|
|
3200
|
+
children: [/* @__PURE__ */ d("table", {
|
|
3201
|
+
...g(D.dataTableTable),
|
|
3174
3202
|
children: [
|
|
3175
|
-
|
|
3176
|
-
...
|
|
3177
|
-
children:
|
|
3203
|
+
l === void 0 ? null : /* @__PURE__ */ u("caption", {
|
|
3204
|
+
...g(D.visuallyHidden),
|
|
3205
|
+
children: l
|
|
3178
3206
|
}),
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
...
|
|
3207
|
+
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: _.map((e, n) => /* @__PURE__ */ t("th", {
|
|
3208
|
+
...g(D.dataTableTh),
|
|
3181
3209
|
key: `header-${String(n)}`,
|
|
3182
3210
|
scope: "col"
|
|
3183
|
-
}, /* @__PURE__ */
|
|
3211
|
+
}, /* @__PURE__ */ u(Lt, {
|
|
3184
3212
|
cell: e,
|
|
3185
3213
|
path: `${r}.rows[0][${String(n)}]`
|
|
3186
3214
|
}))) }) }),
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
let i =
|
|
3189
|
-
return /* @__PURE__ */
|
|
3190
|
-
let
|
|
3215
|
+
/* @__PURE__ */ u("tbody", { children: S.map((e, n) => {
|
|
3216
|
+
let i = x * a + n + 1, o = e.length - 1;
|
|
3217
|
+
return /* @__PURE__ */ u("tr", { children: e.map((e, a) => {
|
|
3218
|
+
let c = g(D.dataTableTd, n === 0 && a === 0 && D.dataTableRadiusTopStart, n === 0 && a === o && D.dataTableRadiusTopEnd, n === C && a === 0 && D.dataTableRadiusBottomStart, n === C && a === o && D.dataTableRadiusBottomEnd), l = /* @__PURE__ */ u(Lt, {
|
|
3191
3219
|
cell: e,
|
|
3192
3220
|
path: `${r}.rows[${String(i)}][${String(a)}]`
|
|
3193
3221
|
});
|
|
3194
|
-
return a ===
|
|
3195
|
-
...
|
|
3222
|
+
return a === s ? /* @__PURE__ */ t("th", {
|
|
3223
|
+
...c,
|
|
3196
3224
|
key: `cell-${String(a)}`,
|
|
3197
3225
|
scope: "row"
|
|
3198
|
-
},
|
|
3199
|
-
...
|
|
3226
|
+
}, l) : /* @__PURE__ */ t("td", {
|
|
3227
|
+
...c,
|
|
3200
3228
|
key: `cell-${String(a)}`
|
|
3201
|
-
},
|
|
3229
|
+
}, l);
|
|
3202
3230
|
}) }, `row-${String(i)}`);
|
|
3203
3231
|
}) })
|
|
3204
3232
|
]
|
|
3205
|
-
}),
|
|
3206
|
-
...
|
|
3233
|
+
}), b <= 1 ? null : /* @__PURE__ */ d("div", {
|
|
3234
|
+
...g(D.dataTablePagination),
|
|
3207
3235
|
children: [
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
...
|
|
3236
|
+
/* @__PURE__ */ u("button", {
|
|
3237
|
+
...g(D.dataTablePageChevron),
|
|
3210
3238
|
"aria-label": "Previous",
|
|
3211
|
-
disabled:
|
|
3239
|
+
disabled: x === 0,
|
|
3212
3240
|
onClick: () => {
|
|
3213
3241
|
p((e) => Math.max(0, e - 1));
|
|
3214
3242
|
},
|
|
3215
3243
|
type: "button",
|
|
3216
|
-
children: /* @__PURE__ */
|
|
3244
|
+
children: /* @__PURE__ */ u("span", {
|
|
3217
3245
|
"aria-hidden": "true",
|
|
3218
3246
|
children: "‹"
|
|
3219
3247
|
})
|
|
3220
3248
|
}),
|
|
3221
|
-
Array.from({ length:
|
|
3222
|
-
...
|
|
3223
|
-
"aria-current": n ===
|
|
3249
|
+
Array.from({ length: b }, (e, n) => /* @__PURE__ */ t("button", {
|
|
3250
|
+
...g(D.dataTablePageButton, n === x && D.dataTablePageButtonActive),
|
|
3251
|
+
"aria-current": n === x ? "page" : void 0,
|
|
3224
3252
|
key: `page-${String(n)}`,
|
|
3225
3253
|
onClick: () => {
|
|
3226
3254
|
p(n);
|
|
3227
3255
|
},
|
|
3228
3256
|
type: "button"
|
|
3229
3257
|
}, n + 1)),
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
...
|
|
3258
|
+
/* @__PURE__ */ u("button", {
|
|
3259
|
+
...g(D.dataTablePageChevron),
|
|
3232
3260
|
"aria-label": "Next",
|
|
3233
|
-
disabled:
|
|
3261
|
+
disabled: x === b - 1,
|
|
3234
3262
|
onClick: () => {
|
|
3235
|
-
p((e) => Math.min(
|
|
3263
|
+
p((e) => Math.min(b - 1, e + 1));
|
|
3236
3264
|
},
|
|
3237
3265
|
type: "button",
|
|
3238
|
-
children: /* @__PURE__ */
|
|
3266
|
+
children: /* @__PURE__ */ u("span", {
|
|
3239
3267
|
"aria-hidden": "true",
|
|
3240
3268
|
children: "›"
|
|
3241
3269
|
})
|
|
@@ -3248,133 +3276,133 @@ function zt({ block: e, className: n, path: r = "block" }) {
|
|
|
3248
3276
|
}
|
|
3249
3277
|
function Bt({ block: e, className: t }) {
|
|
3250
3278
|
let n = Array.isArray(e.actions) ? e.actions : void 0;
|
|
3251
|
-
return /* @__PURE__ */
|
|
3279
|
+
return /* @__PURE__ */ u(R, {
|
|
3252
3280
|
blockId: e.block_id,
|
|
3253
3281
|
blockType: e.type,
|
|
3254
3282
|
className: t,
|
|
3255
|
-
children: /* @__PURE__ */
|
|
3256
|
-
...
|
|
3283
|
+
children: /* @__PURE__ */ d("div", {
|
|
3284
|
+
...g(D.card),
|
|
3257
3285
|
children: [
|
|
3258
|
-
e.hero_image === void 0 ? null : /* @__PURE__ */
|
|
3286
|
+
e.hero_image === void 0 ? null : /* @__PURE__ */ u(P, {
|
|
3259
3287
|
element: e.hero_image,
|
|
3260
3288
|
variant: "cardHero"
|
|
3261
3289
|
}),
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
...
|
|
3290
|
+
/* @__PURE__ */ d("div", {
|
|
3291
|
+
...g(D.cardContent),
|
|
3264
3292
|
children: [
|
|
3265
|
-
e.icon === void 0 && e.slack_icon === void 0 && e.title === void 0 && e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
3266
|
-
...
|
|
3267
|
-
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */
|
|
3293
|
+
e.icon === void 0 && e.slack_icon === void 0 && e.title === void 0 && e.subtitle === void 0 ? null : /* @__PURE__ */ d("div", {
|
|
3294
|
+
...g(D.cardHeading),
|
|
3295
|
+
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */ u("span", {
|
|
3268
3296
|
"aria-hidden": "true",
|
|
3269
3297
|
children: "◆"
|
|
3270
|
-
}) : /* @__PURE__ */
|
|
3298
|
+
}) : /* @__PURE__ */ u(P, {
|
|
3271
3299
|
element: e.icon,
|
|
3272
3300
|
variant: "cardIcon"
|
|
3273
|
-
}), /* @__PURE__ */
|
|
3274
|
-
className:
|
|
3301
|
+
}), /* @__PURE__ */ d("div", { children: [e.title === void 0 ? null : /* @__PURE__ */ u(I, {
|
|
3302
|
+
className: g(D.cardTitle).className,
|
|
3275
3303
|
text: e.title
|
|
3276
|
-
}), e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
3277
|
-
className:
|
|
3304
|
+
}), e.subtitle === void 0 ? null : /* @__PURE__ */ u(I, {
|
|
3305
|
+
className: g(D.smallText).className,
|
|
3278
3306
|
text: e.subtitle
|
|
3279
3307
|
})] })]
|
|
3280
3308
|
}),
|
|
3281
|
-
e.body === void 0 ? null : /* @__PURE__ */
|
|
3282
|
-
e.subtext === void 0 ? null : /* @__PURE__ */
|
|
3283
|
-
className:
|
|
3309
|
+
e.body === void 0 ? null : /* @__PURE__ */ u(I, { text: e.body }),
|
|
3310
|
+
e.subtext === void 0 ? null : /* @__PURE__ */ u(I, {
|
|
3311
|
+
className: g(D.smallText).className,
|
|
3284
3312
|
text: e.subtext
|
|
3285
3313
|
})
|
|
3286
3314
|
]
|
|
3287
3315
|
}),
|
|
3288
|
-
n === void 0 ? null : /* @__PURE__ */
|
|
3289
|
-
...
|
|
3290
|
-
children: n.map((t, n) => /* @__PURE__ */
|
|
3316
|
+
n === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3317
|
+
...g(D.cardActions),
|
|
3318
|
+
children: n.map((t, n) => /* @__PURE__ */ u(Ve, {
|
|
3291
3319
|
blockId: e.block_id,
|
|
3292
3320
|
element: t
|
|
3293
|
-
}, `${
|
|
3321
|
+
}, `${S(t) && typeof t.action_id == "string" ? t.action_id : "button"}-${String(n)}`))
|
|
3294
3322
|
})
|
|
3295
3323
|
]
|
|
3296
3324
|
})
|
|
3297
3325
|
});
|
|
3298
3326
|
}
|
|
3299
3327
|
function Vt(e) {
|
|
3300
|
-
return
|
|
3328
|
+
return S(e) && e.type === "card";
|
|
3301
3329
|
}
|
|
3302
3330
|
function Ht({ block: e, className: n, path: r = "block" }) {
|
|
3303
3331
|
let i = e.elements;
|
|
3304
|
-
return /* @__PURE__ */
|
|
3332
|
+
return /* @__PURE__ */ u(R, {
|
|
3305
3333
|
blockId: e.block_id,
|
|
3306
3334
|
blockType: e.type,
|
|
3307
3335
|
className: n,
|
|
3308
|
-
children: /* @__PURE__ */
|
|
3309
|
-
...
|
|
3310
|
-
children: Array.isArray(i) ? i.map((e, n) => Vt(e) ? /* @__PURE__ */
|
|
3336
|
+
children: /* @__PURE__ */ u("div", {
|
|
3337
|
+
...g(D.carousel),
|
|
3338
|
+
children: Array.isArray(i) ? i.map((e, n) => Vt(e) ? /* @__PURE__ */ u(Bt, {
|
|
3311
3339
|
block: e,
|
|
3312
|
-
className:
|
|
3340
|
+
className: g(D.carouselCard).className,
|
|
3313
3341
|
path: `${r}.elements[${String(n)}]`
|
|
3314
|
-
}, `${
|
|
3315
|
-
...
|
|
3342
|
+
}, `${w(e) ?? "card"}-${String(n)}`) : /* @__PURE__ */ t("div", {
|
|
3343
|
+
...g(D.unhandled),
|
|
3316
3344
|
"data-unhandled-block": !0,
|
|
3317
3345
|
key: `unknown-${String(n)}`
|
|
3318
|
-
},
|
|
3346
|
+
}, T(e, "carousel card"))) : null
|
|
3319
3347
|
})
|
|
3320
3348
|
});
|
|
3321
3349
|
}
|
|
3322
3350
|
function Ut({ block: e, className: t }) {
|
|
3323
3351
|
let n = e.level ?? "default";
|
|
3324
|
-
return /* @__PURE__ */
|
|
3352
|
+
return /* @__PURE__ */ u(R, {
|
|
3325
3353
|
blockId: e.block_id,
|
|
3326
3354
|
blockType: e.type,
|
|
3327
3355
|
className: t,
|
|
3328
|
-
children: /* @__PURE__ */
|
|
3329
|
-
...
|
|
3330
|
-
children: [/* @__PURE__ */
|
|
3356
|
+
children: /* @__PURE__ */ d("div", {
|
|
3357
|
+
...g(D.alert, n === "info" && D.alertInfo, n === "warning" && D.alertWarning, n === "error" && D.alertError, n === "success" && D.alertSuccess),
|
|
3358
|
+
children: [/* @__PURE__ */ u("span", {
|
|
3331
3359
|
"aria-hidden": "true",
|
|
3332
3360
|
children: n === "warning" ? "⚠" : n === "error" ? "!" : n === "success" ? "✓" : "i"
|
|
3333
|
-
}), /* @__PURE__ */
|
|
3361
|
+
}), /* @__PURE__ */ u(I, { text: e.text })]
|
|
3334
3362
|
})
|
|
3335
3363
|
});
|
|
3336
3364
|
}
|
|
3337
3365
|
function Wt({ block: e, className: n, path: r = "block" }) {
|
|
3338
|
-
let i = e.sources, a = typeof e.status == "string" ? e.status : "unknown", o = typeof e.title == "string" ? e.title :
|
|
3339
|
-
return /* @__PURE__ */
|
|
3366
|
+
let i = e.sources, a = typeof e.status == "string" ? e.status : "unknown", o = typeof e.title == "string" ? e.title : T(e, "task");
|
|
3367
|
+
return /* @__PURE__ */ u(R, {
|
|
3340
3368
|
blockId: e.block_id,
|
|
3341
3369
|
blockType: e.type,
|
|
3342
3370
|
className: n,
|
|
3343
|
-
children: /* @__PURE__ */
|
|
3344
|
-
...
|
|
3371
|
+
children: /* @__PURE__ */ d("div", {
|
|
3372
|
+
...g(D.task),
|
|
3345
3373
|
children: [
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
...
|
|
3374
|
+
/* @__PURE__ */ d("div", {
|
|
3375
|
+
...g(D.taskHeading),
|
|
3348
3376
|
children: [
|
|
3349
|
-
/* @__PURE__ */
|
|
3377
|
+
/* @__PURE__ */ u("span", {
|
|
3350
3378
|
"aria-hidden": "true",
|
|
3351
3379
|
children: a === "complete" ? "✓" : a === "error" ? "!" : a === "in_progress" ? "◌" : "○"
|
|
3352
3380
|
}),
|
|
3353
|
-
/* @__PURE__ */
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
...
|
|
3381
|
+
/* @__PURE__ */ u("span", { children: o }),
|
|
3382
|
+
/* @__PURE__ */ u("span", {
|
|
3383
|
+
...g(D.taskStatus),
|
|
3356
3384
|
children: a
|
|
3357
3385
|
})
|
|
3358
3386
|
]
|
|
3359
3387
|
}),
|
|
3360
|
-
e.details === void 0 ? null : /* @__PURE__ */
|
|
3388
|
+
e.details === void 0 ? null : /* @__PURE__ */ u(M, {
|
|
3361
3389
|
block: e.details,
|
|
3362
3390
|
path: `${r}.details`
|
|
3363
3391
|
}),
|
|
3364
|
-
e.output === void 0 ? null : /* @__PURE__ */
|
|
3392
|
+
e.output === void 0 ? null : /* @__PURE__ */ u(M, {
|
|
3365
3393
|
block: e.output,
|
|
3366
3394
|
path: `${r}.output`
|
|
3367
3395
|
}),
|
|
3368
|
-
Array.isArray(i) ? /* @__PURE__ */
|
|
3369
|
-
...
|
|
3396
|
+
Array.isArray(i) ? /* @__PURE__ */ u("div", {
|
|
3397
|
+
...g(D.context),
|
|
3370
3398
|
children: i.map((e, n) => {
|
|
3371
|
-
if (!
|
|
3372
|
-
...
|
|
3399
|
+
if (!S(e)) return /* @__PURE__ */ t("span", {
|
|
3400
|
+
...g(D.unhandled),
|
|
3373
3401
|
key: `unknown-${String(n)}`
|
|
3374
|
-
},
|
|
3375
|
-
let r =
|
|
3376
|
-
return r === void 0 ? /* @__PURE__ */
|
|
3377
|
-
...
|
|
3402
|
+
}, T(e, "task source"));
|
|
3403
|
+
let r = E(typeof e.url == "string" ? e.url : void 0), i = typeof e.text == "string" ? e.text : T(e, "task source"), a = `${typeof e.url == "string" ? e.url : `source-${String(n)}`}-${String(n)}`;
|
|
3404
|
+
return r === void 0 ? /* @__PURE__ */ u("span", { children: i }, a) : /* @__PURE__ */ t("a", {
|
|
3405
|
+
...g(D.link),
|
|
3378
3406
|
href: r,
|
|
3379
3407
|
key: a,
|
|
3380
3408
|
rel: "noreferrer"
|
|
@@ -3386,24 +3414,24 @@ function Wt({ block: e, className: n, path: r = "block" }) {
|
|
|
3386
3414
|
});
|
|
3387
3415
|
}
|
|
3388
3416
|
function Gt(e) {
|
|
3389
|
-
return
|
|
3417
|
+
return S(e) && e.type === "task_card";
|
|
3390
3418
|
}
|
|
3391
3419
|
function Kt({ block: e, className: n, path: r = "block" }) {
|
|
3392
|
-
let i = e.tasks, a = typeof e.title == "string" ? e.title :
|
|
3393
|
-
return /* @__PURE__ */
|
|
3420
|
+
let i = e.tasks, a = typeof e.title == "string" ? e.title : T(e, "plan");
|
|
3421
|
+
return /* @__PURE__ */ u(R, {
|
|
3394
3422
|
blockId: e.block_id,
|
|
3395
3423
|
blockType: e.type,
|
|
3396
3424
|
className: n,
|
|
3397
|
-
children: /* @__PURE__ */
|
|
3398
|
-
...
|
|
3399
|
-
children: [/* @__PURE__ */
|
|
3425
|
+
children: /* @__PURE__ */ d("div", {
|
|
3426
|
+
...g(D.plan),
|
|
3427
|
+
children: [/* @__PURE__ */ u("strong", { children: a }), Array.isArray(i) ? i.map((e, n) => Gt(e) ? /* @__PURE__ */ u(Wt, {
|
|
3400
3428
|
block: e,
|
|
3401
3429
|
path: `${r}.tasks[${String(n)}]`
|
|
3402
3430
|
}, `${typeof e.task_id == "string" ? e.task_id : "task"}-${String(n)}`) : /* @__PURE__ */ t("div", {
|
|
3403
|
-
...
|
|
3431
|
+
...g(D.unhandled),
|
|
3404
3432
|
"data-unhandled-block": !0,
|
|
3405
3433
|
key: `unknown-${String(n)}`
|
|
3406
|
-
},
|
|
3434
|
+
}, T(e, "plan task"))) : null]
|
|
3407
3435
|
})
|
|
3408
3436
|
});
|
|
3409
3437
|
}
|
|
@@ -3433,7 +3461,7 @@ var qt = 3e3, Jt = 3e3, Yt = 2e3, Xt = 3e3, Zt = 2e3, Qt = 2e3, $t = 12e3, en =
|
|
|
3433
3461
|
"video"
|
|
3434
3462
|
], on = 554;
|
|
3435
3463
|
function sn() {
|
|
3436
|
-
let [e, t] =
|
|
3464
|
+
let [e, t] = c(on + 26), r = s(void 0), a = n((e) => {
|
|
3437
3465
|
if (r.current?.disconnect(), r.current = void 0, e === null) return;
|
|
3438
3466
|
let n = () => {
|
|
3439
3467
|
let n = e.getBoundingClientRect().width;
|
|
@@ -3473,7 +3501,7 @@ function dn(e, t) {
|
|
|
3473
3501
|
};
|
|
3474
3502
|
}
|
|
3475
3503
|
function fn(e) {
|
|
3476
|
-
return
|
|
3504
|
+
return ie[e % ie.length] ?? re;
|
|
3477
3505
|
}
|
|
3478
3506
|
function pn(e, t) {
|
|
3479
3507
|
let n = new Map(e.data.map((e) => [e.label, e]));
|
|
@@ -3521,16 +3549,16 @@ function hn(e) {
|
|
|
3521
3549
|
}
|
|
3522
3550
|
function gn({ geometry: e }) {
|
|
3523
3551
|
let { plotLeft: n, plotRight: r, ticks: i, y: a } = e;
|
|
3524
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ d(l, { children: [i.map((e) => {
|
|
3525
3553
|
let i = un(a(e));
|
|
3526
3554
|
return /* @__PURE__ */ t("path", {
|
|
3527
|
-
...
|
|
3555
|
+
...g(D.chartGridline),
|
|
3528
3556
|
d: `M${String(n)} ${String(i)}L${String(r)} ${String(i)}`,
|
|
3529
3557
|
fill: "none",
|
|
3530
3558
|
key: `grid-${String(e)}`
|
|
3531
3559
|
});
|
|
3532
3560
|
}), i.map((e) => /* @__PURE__ */ t("text", {
|
|
3533
|
-
...
|
|
3561
|
+
...g(D.chartTickText),
|
|
3534
3562
|
dy: "0.32em",
|
|
3535
3563
|
key: `tick-${String(e)}`,
|
|
3536
3564
|
textAnchor: "end",
|
|
@@ -3539,8 +3567,8 @@ function gn({ geometry: e }) {
|
|
|
3539
3567
|
}, e))] });
|
|
3540
3568
|
}
|
|
3541
3569
|
function _n({ categories: e, tickX: n }) {
|
|
3542
|
-
return /* @__PURE__ */ l
|
|
3543
|
-
...
|
|
3570
|
+
return /* @__PURE__ */ u(l, { children: e.map((e, r) => /* @__PURE__ */ t("text", {
|
|
3571
|
+
...g(D.chartTickText),
|
|
3544
3572
|
key: `${e}-${String(r)}`,
|
|
3545
3573
|
textAnchor: "middle",
|
|
3546
3574
|
x: n(r),
|
|
@@ -3558,15 +3586,15 @@ function yn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3558
3586
|
let i = e.axis_config.categories, a = e.series.map((e) => ({
|
|
3559
3587
|
points: pn(e, i),
|
|
3560
3588
|
series: e
|
|
3561
|
-
})), o = dn(n, a.flatMap(({ points: e }) => e.flatMap((e) => e === void 0 ? [] : [e.value]))), { plotLeft: s, plotRight: c, y:
|
|
3589
|
+
})), o = dn(n, a.flatMap(({ points: e }) => e.flatMap((e) => e === void 0 ? [] : [e.value]))), { plotLeft: s, plotRight: c, y: l } = o, f, p;
|
|
3562
3590
|
if (e.type === "bar") {
|
|
3563
3591
|
let n = (c - s) / Math.max(1, i.length), { barWidth: r, outer: o } = vn(n, Math.max(1, e.series.length));
|
|
3564
3592
|
p = (e) => s + n * (e + .5), f = a.map(({ points: e, series: i }, a) => e.map((e, c) => {
|
|
3565
3593
|
if (e === void 0) return null;
|
|
3566
|
-
let
|
|
3594
|
+
let u = s + c * n + o + 1.1 * r * a;
|
|
3567
3595
|
return /* @__PURE__ */ t("path", {
|
|
3568
|
-
...
|
|
3569
|
-
d: mn(
|
|
3596
|
+
...g(fn(a).fill),
|
|
3597
|
+
d: mn(u, r, l(e.value), 334),
|
|
3570
3598
|
"data-category": e.label,
|
|
3571
3599
|
"data-series": i.name,
|
|
3572
3600
|
key: `${i.name}-${String(a)}-${e.label}-${String(c)}`
|
|
@@ -3577,32 +3605,32 @@ function yn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3577
3605
|
p = n, f = a.map(({ points: t, series: r }, i) => {
|
|
3578
3606
|
let a = t.flatMap((e, t) => e === void 0 ? [] : [{
|
|
3579
3607
|
x: n(t),
|
|
3580
|
-
y:
|
|
3608
|
+
y: l(e.value)
|
|
3581
3609
|
}]), o = hn(a);
|
|
3582
3610
|
if (o === "") return null;
|
|
3583
3611
|
let s = a[a.length - 1], c = a[0];
|
|
3584
|
-
return /* @__PURE__ */
|
|
3585
|
-
...
|
|
3612
|
+
return /* @__PURE__ */ d("g", { children: [e.type === "area" && c !== void 0 && s !== void 0 ? /* @__PURE__ */ u("path", {
|
|
3613
|
+
...g(fn(i).tint, D.chartAreaFill, i >= 6 && D.chartAreaFallbackFill),
|
|
3586
3614
|
d: `${o}L${String(s.x)} 334L${String(c.x)} 334Z`,
|
|
3587
3615
|
"data-series-area": r.name
|
|
3588
|
-
}) : null, /* @__PURE__ */
|
|
3589
|
-
...
|
|
3616
|
+
}) : null, /* @__PURE__ */ u("path", {
|
|
3617
|
+
...g(fn(i).stroke, D.chartLinePath),
|
|
3590
3618
|
d: o,
|
|
3591
3619
|
"data-series": r.name,
|
|
3592
3620
|
fill: "none"
|
|
3593
3621
|
})] }, `${r.name}-${String(i)}`);
|
|
3594
3622
|
});
|
|
3595
3623
|
}
|
|
3596
|
-
return /* @__PURE__ */
|
|
3597
|
-
...
|
|
3624
|
+
return /* @__PURE__ */ d("svg", {
|
|
3625
|
+
...g(D.chartSvg),
|
|
3598
3626
|
"aria-label": r,
|
|
3599
3627
|
height: 360,
|
|
3600
3628
|
role: "img",
|
|
3601
3629
|
width: n,
|
|
3602
3630
|
children: [
|
|
3603
|
-
/* @__PURE__ */
|
|
3631
|
+
/* @__PURE__ */ u(gn, { geometry: o }),
|
|
3604
3632
|
f,
|
|
3605
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ u(_n, {
|
|
3606
3634
|
categories: i,
|
|
3607
3635
|
tickX: p
|
|
3608
3636
|
})
|
|
@@ -3617,8 +3645,8 @@ function bn(e, t, n, r) {
|
|
|
3617
3645
|
}
|
|
3618
3646
|
function xn({ chart: e, svgWidth: n, title: r }) {
|
|
3619
3647
|
let i = e.segments.map((e) => Number.isFinite(e.value) ? Math.max(0, e.value) : 0), a = i.reduce((e, t) => e + t, 0);
|
|
3620
|
-
if (a <= 0) return /* @__PURE__ */
|
|
3621
|
-
...
|
|
3648
|
+
if (a <= 0) return /* @__PURE__ */ u("div", {
|
|
3649
|
+
...g(D.unhandled),
|
|
3622
3650
|
"aria-label": `${r}: no chart data`,
|
|
3623
3651
|
"data-empty-chart": !0,
|
|
3624
3652
|
role: "img",
|
|
@@ -3629,14 +3657,14 @@ function xn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3629
3657
|
s += r;
|
|
3630
3658
|
let l = s * 2 * Math.PI, u = bn(o, 180, 144, c), d = bn(o, 180, 144, l), f = +(l - c > Math.PI), p = r >= 1 ? `M${String(o)} 36A144 144 0 1 1 ${String(o)} 324A144 144 0 1 1 ${String(o)} 36Z` : `M${String(u.x)} ${String(u.y)}A144 144 0 ${String(f)} 1 ${String(d.x)} ${String(d.y)}L${String(o)} 180Z`;
|
|
3631
3659
|
return r <= 0 ? null : /* @__PURE__ */ t("path", {
|
|
3632
|
-
...
|
|
3660
|
+
...g(fn(n).fill, D.pieSlice),
|
|
3633
3661
|
d: p,
|
|
3634
3662
|
"data-segment": e.label,
|
|
3635
3663
|
key: `${e.label}-${String(n)}`
|
|
3636
3664
|
});
|
|
3637
3665
|
});
|
|
3638
|
-
return /* @__PURE__ */
|
|
3639
|
-
...
|
|
3666
|
+
return /* @__PURE__ */ u("svg", {
|
|
3667
|
+
...g(D.chartSvg),
|
|
3640
3668
|
"aria-label": r,
|
|
3641
3669
|
height: 360,
|
|
3642
3670
|
role: "img",
|
|
@@ -3650,78 +3678,78 @@ var Sn = {
|
|
|
3650
3678
|
line: !0
|
|
3651
3679
|
};
|
|
3652
3680
|
function Cn(e) {
|
|
3653
|
-
return
|
|
3681
|
+
return S(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
3654
3682
|
}
|
|
3655
3683
|
function wn(e) {
|
|
3656
|
-
return
|
|
3684
|
+
return S(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
3657
3685
|
}
|
|
3658
3686
|
function Tn(e) {
|
|
3659
|
-
return
|
|
3687
|
+
return S(e) && typeof e.name == "string" && Array.isArray(e.data) && e.data.every(wn);
|
|
3660
3688
|
}
|
|
3661
3689
|
function En(e) {
|
|
3662
|
-
return
|
|
3690
|
+
return S(e) && e.type === "pie" && Array.isArray(e.segments) && e.segments.every(Cn);
|
|
3663
3691
|
}
|
|
3664
3692
|
function Dn(e) {
|
|
3665
|
-
if (!
|
|
3693
|
+
if (!S(e)) return !1;
|
|
3666
3694
|
let t = e.type;
|
|
3667
3695
|
if (typeof t != "string" || !(t in Sn)) return !1;
|
|
3668
3696
|
let n = e.axis_config;
|
|
3669
|
-
return Array.isArray(e.series) && e.series.every(Tn) &&
|
|
3697
|
+
return Array.isArray(e.series) && e.series.every(Tn) && S(n) && Array.isArray(n.categories) && n.categories.every((e) => typeof e == "string");
|
|
3670
3698
|
}
|
|
3671
3699
|
function On({ block: e, className: n }) {
|
|
3672
|
-
let r = e.chart, i = typeof e.title == "string" ? e.title :
|
|
3673
|
-
|
|
3674
|
-
...
|
|
3675
|
-
"data-unhandled-chart-type":
|
|
3676
|
-
children:
|
|
3677
|
-
}), p = []) : (f = /* @__PURE__ */
|
|
3700
|
+
let r = e.chart, i = typeof e.title == "string" ? e.title : T(e, "chart"), { ref: a, width: o } = sn(), s = Math.min(624, Math.max(400, o)) - 26, c = Dn(r) ? r : void 0, l = c === void 0 && En(r) ? r : void 0, f, p;
|
|
3701
|
+
l === void 0 ? c === void 0 ? (f = /* @__PURE__ */ u("div", {
|
|
3702
|
+
...g(D.unhandled),
|
|
3703
|
+
"data-unhandled-chart-type": C(r) ?? "unknown",
|
|
3704
|
+
children: T(r, "chart")
|
|
3705
|
+
}), p = []) : (f = /* @__PURE__ */ u(yn, {
|
|
3678
3706
|
chart: c,
|
|
3679
3707
|
svgWidth: s,
|
|
3680
3708
|
title: i
|
|
3681
|
-
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */
|
|
3682
|
-
chart:
|
|
3709
|
+
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */ u(xn, {
|
|
3710
|
+
chart: l,
|
|
3683
3711
|
svgWidth: s,
|
|
3684
3712
|
title: i
|
|
3685
|
-
}), p =
|
|
3686
|
-
let m = c?.axis_config.x_label,
|
|
3687
|
-
return /* @__PURE__ */
|
|
3713
|
+
}), p = l.segments.map((e) => e.label));
|
|
3714
|
+
let m = c?.axis_config.x_label, h = c?.axis_config.y_label;
|
|
3715
|
+
return /* @__PURE__ */ u(R, {
|
|
3688
3716
|
blockId: e.block_id,
|
|
3689
3717
|
blockType: e.type,
|
|
3690
3718
|
className: n,
|
|
3691
|
-
children: /* @__PURE__ */
|
|
3692
|
-
...
|
|
3693
|
-
children: /* @__PURE__ */
|
|
3694
|
-
...
|
|
3719
|
+
children: /* @__PURE__ */ u("div", {
|
|
3720
|
+
...g(D.chartScroller),
|
|
3721
|
+
children: /* @__PURE__ */ u("div", {
|
|
3722
|
+
...g(D.chartCard),
|
|
3695
3723
|
ref: a,
|
|
3696
|
-
children: /* @__PURE__ */
|
|
3697
|
-
...
|
|
3698
|
-
children: [/* @__PURE__ */
|
|
3699
|
-
...
|
|
3724
|
+
children: /* @__PURE__ */ d("div", {
|
|
3725
|
+
...g(D.chartContent),
|
|
3726
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
3727
|
+
...g(D.chartTitle),
|
|
3700
3728
|
children: i
|
|
3701
|
-
}), /* @__PURE__ */
|
|
3702
|
-
...
|
|
3729
|
+
}), /* @__PURE__ */ d("div", {
|
|
3730
|
+
...g(D.chartPlotArea),
|
|
3703
3731
|
children: [
|
|
3704
|
-
/* @__PURE__ */
|
|
3705
|
-
...
|
|
3706
|
-
children: [f,
|
|
3707
|
-
...
|
|
3708
|
-
children: /* @__PURE__ */
|
|
3709
|
-
...
|
|
3710
|
-
children:
|
|
3732
|
+
/* @__PURE__ */ d("div", {
|
|
3733
|
+
...g(D.chartCanvas),
|
|
3734
|
+
children: [f, h === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3735
|
+
...g(D.chartYAxisLabel),
|
|
3736
|
+
children: /* @__PURE__ */ u("span", {
|
|
3737
|
+
...g(D.chartYAxisLabelText),
|
|
3738
|
+
children: h
|
|
3711
3739
|
})
|
|
3712
3740
|
})]
|
|
3713
3741
|
}),
|
|
3714
|
-
c === void 0 ? null : /* @__PURE__ */
|
|
3715
|
-
...
|
|
3742
|
+
c === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3743
|
+
...g(D.chartXAxisLabel),
|
|
3716
3744
|
children: m
|
|
3717
3745
|
}),
|
|
3718
|
-
p.length === 0 ? null : /* @__PURE__ */
|
|
3719
|
-
...
|
|
3746
|
+
p.length === 0 ? null : /* @__PURE__ */ u("div", {
|
|
3747
|
+
...g(D.chartLegend, c !== void 0 && D.chartLegendCartesian),
|
|
3720
3748
|
children: p.map((e, n) => /* @__PURE__ */ t("span", {
|
|
3721
|
-
...
|
|
3749
|
+
...g(D.chartLegendItem),
|
|
3722
3750
|
key: `${e}-${String(n)}`
|
|
3723
|
-
}, /* @__PURE__ */
|
|
3724
|
-
...
|
|
3751
|
+
}, /* @__PURE__ */ u("span", {
|
|
3752
|
+
...g(D.chartLegendSwatch, fn(n).swatch),
|
|
3725
3753
|
"aria-hidden": "true"
|
|
3726
3754
|
}), e))
|
|
3727
3755
|
})
|
|
@@ -3735,52 +3763,52 @@ function On({ block: e, className: n }) {
|
|
|
3735
3763
|
//#endregion
|
|
3736
3764
|
//#region src/blocks/InteractiveBlocks.tsx
|
|
3737
3765
|
function kn(e) {
|
|
3738
|
-
return
|
|
3766
|
+
return S(e) && S(e.text) && typeof e.text.text == "string";
|
|
3739
3767
|
}
|
|
3740
3768
|
function An(e) {
|
|
3741
|
-
return
|
|
3769
|
+
return S(e) && e.type === "feedback_buttons" && kn(e.positive_button) && kn(e.negative_button);
|
|
3742
3770
|
}
|
|
3743
3771
|
function jn(e) {
|
|
3744
|
-
return
|
|
3772
|
+
return S(e) && e.type === "icon_button" && kn(e);
|
|
3745
3773
|
}
|
|
3746
3774
|
function Mn({ block: e, className: t, path: n = "block" }) {
|
|
3747
|
-
let r =
|
|
3748
|
-
return /* @__PURE__ */
|
|
3775
|
+
let r = g(D.block, D.actions), i = Array.isArray(e.elements) ? e.elements : [];
|
|
3776
|
+
return /* @__PURE__ */ u("div", {
|
|
3749
3777
|
...r,
|
|
3750
|
-
className:
|
|
3778
|
+
className: k(r.className, t),
|
|
3751
3779
|
"data-block-id": e.block_id,
|
|
3752
3780
|
"data-block-type": e.type,
|
|
3753
|
-
children: i.map((t, r) => /* @__PURE__ */
|
|
3781
|
+
children: i.map((t, r) => /* @__PURE__ */ u(at, {
|
|
3754
3782
|
blockId: e.block_id,
|
|
3755
3783
|
element: t,
|
|
3756
3784
|
path: `${n}.elements[${String(r)}]`
|
|
3757
|
-
}, `${
|
|
3785
|
+
}, `${C(t) ?? "unknown"}-${S(t) && typeof t.action_id == "string" ? t.action_id : "action"}-${String(r)}`))
|
|
3758
3786
|
});
|
|
3759
3787
|
}
|
|
3760
3788
|
function Nn({ block: e, className: t, path: n = "block" }) {
|
|
3761
|
-
let r =
|
|
3762
|
-
return /* @__PURE__ */
|
|
3789
|
+
let r = g(D.block, D.inputBlock), i = e.label;
|
|
3790
|
+
return /* @__PURE__ */ d("div", {
|
|
3763
3791
|
...r,
|
|
3764
|
-
className:
|
|
3792
|
+
className: k(r.className, t),
|
|
3765
3793
|
"data-block-id": e.block_id,
|
|
3766
3794
|
"data-block-type": e.type,
|
|
3767
3795
|
children: [
|
|
3768
|
-
/* @__PURE__ */
|
|
3769
|
-
...
|
|
3770
|
-
children: [
|
|
3771
|
-
...
|
|
3796
|
+
/* @__PURE__ */ d("div", {
|
|
3797
|
+
...g(D.inputLabel),
|
|
3798
|
+
children: [S(i) && typeof i.text == "string" ? i.text : T(i, "input label"), e.optional === !0 ? null : /* @__PURE__ */ u("span", {
|
|
3799
|
+
...g(D.required),
|
|
3772
3800
|
"aria-hidden": "true",
|
|
3773
3801
|
children: "*"
|
|
3774
3802
|
})]
|
|
3775
3803
|
}),
|
|
3776
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ u(at, {
|
|
3777
3805
|
blockId: e.block_id,
|
|
3778
3806
|
element: e.element,
|
|
3779
3807
|
path: `${n}.element`
|
|
3780
3808
|
}),
|
|
3781
|
-
e.hint === void 0 ? null : /* @__PURE__ */
|
|
3782
|
-
...
|
|
3783
|
-
children:
|
|
3809
|
+
e.hint === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3810
|
+
...g(D.smallText),
|
|
3811
|
+
children: S(e.hint) && typeof e.hint.text == "string" ? e.hint.text : T(e.hint, "input hint")
|
|
3784
3812
|
})
|
|
3785
3813
|
]
|
|
3786
3814
|
});
|
|
@@ -3789,14 +3817,14 @@ function Pn(e, t) {
|
|
|
3789
3817
|
return t === "positive" ? e.positive_button.text.text : e.negative_button.text.text;
|
|
3790
3818
|
}
|
|
3791
3819
|
function Fn({ block: e, className: n }) {
|
|
3792
|
-
let { onAction: r } =
|
|
3793
|
-
return /* @__PURE__ */
|
|
3820
|
+
let { onAction: r } = x(), i = g(D.block, D.actions), a = e.elements;
|
|
3821
|
+
return /* @__PURE__ */ u("div", {
|
|
3794
3822
|
...i,
|
|
3795
|
-
className:
|
|
3823
|
+
className: k(i.className, n),
|
|
3796
3824
|
"data-block-id": e.block_id,
|
|
3797
3825
|
"data-block-type": e.type,
|
|
3798
3826
|
children: Array.isArray(a) ? a.map((n, i) => jn(n) ? /* @__PURE__ */ t("button", {
|
|
3799
|
-
...
|
|
3827
|
+
...g(D.button, D.iconButton),
|
|
3800
3828
|
"aria-label": n.accessibility_label ?? n.text.text,
|
|
3801
3829
|
key: `${n.type}-${n.action_id ?? "button"}-${String(i)}`,
|
|
3802
3830
|
onClick: () => {
|
|
@@ -3810,10 +3838,10 @@ function Fn({ block: e, className: n }) {
|
|
|
3810
3838
|
title: n.text.text,
|
|
3811
3839
|
type: "button"
|
|
3812
3840
|
}, n.icon === "trash" ? "⌫" : n.icon) : An(n) ? /* @__PURE__ */ t("div", {
|
|
3813
|
-
...
|
|
3841
|
+
...g(D.actions),
|
|
3814
3842
|
key: `${n.type}-${n.action_id ?? "feedback"}-${String(i)}`
|
|
3815
|
-
}, /* @__PURE__ */
|
|
3816
|
-
...
|
|
3843
|
+
}, /* @__PURE__ */ u("button", {
|
|
3844
|
+
...g(D.button, D.iconButton),
|
|
3817
3845
|
"aria-label": Pn(n, "positive"),
|
|
3818
3846
|
onClick: () => {
|
|
3819
3847
|
n.action_id !== void 0 && r?.({
|
|
@@ -3825,8 +3853,8 @@ function Fn({ block: e, className: n }) {
|
|
|
3825
3853
|
},
|
|
3826
3854
|
type: "button",
|
|
3827
3855
|
children: "👍"
|
|
3828
|
-
}), /* @__PURE__ */
|
|
3829
|
-
...
|
|
3856
|
+
}), /* @__PURE__ */ u("button", {
|
|
3857
|
+
...g(D.button, D.iconButton),
|
|
3830
3858
|
"aria-label": Pn(n, "negative"),
|
|
3831
3859
|
onClick: () => {
|
|
3832
3860
|
n.action_id !== void 0 && r?.({
|
|
@@ -3839,13 +3867,13 @@ function Fn({ block: e, className: n }) {
|
|
|
3839
3867
|
type: "button",
|
|
3840
3868
|
children: "👎"
|
|
3841
3869
|
})) : /* @__PURE__ */ t("div", {
|
|
3842
|
-
...
|
|
3843
|
-
"data-unhandled-element":
|
|
3870
|
+
...g(D.unhandled),
|
|
3871
|
+
"data-unhandled-element": C(n) ?? "unknown",
|
|
3844
3872
|
key: `unhandled-${String(i)}`
|
|
3845
|
-
},
|
|
3846
|
-
...
|
|
3873
|
+
}, T(n, "context action"))) : /* @__PURE__ */ u("div", {
|
|
3874
|
+
...g(D.unhandled),
|
|
3847
3875
|
"data-unhandled-element": "context_actions",
|
|
3848
|
-
children:
|
|
3876
|
+
children: T(e, "context actions block")
|
|
3849
3877
|
})
|
|
3850
3878
|
});
|
|
3851
3879
|
}
|
|
@@ -3853,133 +3881,133 @@ function Fn({ block: e, className: n }) {
|
|
|
3853
3881
|
//#region src/Block.tsx
|
|
3854
3882
|
var In = new Set(an);
|
|
3855
3883
|
function Ln(e) {
|
|
3856
|
-
let t =
|
|
3884
|
+
let t = C(e);
|
|
3857
3885
|
return t !== void 0 && In.has(t);
|
|
3858
3886
|
}
|
|
3859
3887
|
function Rn({ block: e, className: t, path: n = "block" }) {
|
|
3860
|
-
let r =
|
|
3888
|
+
let r = C(e);
|
|
3861
3889
|
if (!Ln(e)) {
|
|
3862
|
-
let n =
|
|
3863
|
-
return /* @__PURE__ */
|
|
3890
|
+
let n = g(D.block, D.unhandled);
|
|
3891
|
+
return /* @__PURE__ */ u("div", {
|
|
3864
3892
|
...n,
|
|
3865
|
-
className:
|
|
3893
|
+
className: k(n.className, t),
|
|
3866
3894
|
"data-block-type": r ?? "unknown",
|
|
3867
3895
|
"data-unhandled-block": !0,
|
|
3868
3896
|
role: "note",
|
|
3869
|
-
children:
|
|
3897
|
+
children: T(e, "Slack block")
|
|
3870
3898
|
});
|
|
3871
3899
|
}
|
|
3872
3900
|
switch (e.type) {
|
|
3873
|
-
case "actions": return /* @__PURE__ */
|
|
3901
|
+
case "actions": return /* @__PURE__ */ u(Mn, {
|
|
3874
3902
|
block: e,
|
|
3875
3903
|
className: t,
|
|
3876
3904
|
path: n
|
|
3877
3905
|
});
|
|
3878
|
-
case "alert": return /* @__PURE__ */
|
|
3906
|
+
case "alert": return /* @__PURE__ */ u(Ut, {
|
|
3879
3907
|
block: e,
|
|
3880
3908
|
className: t,
|
|
3881
3909
|
path: n
|
|
3882
3910
|
});
|
|
3883
|
-
case "card": return /* @__PURE__ */
|
|
3911
|
+
case "card": return /* @__PURE__ */ u(Bt, {
|
|
3884
3912
|
block: e,
|
|
3885
3913
|
className: t,
|
|
3886
3914
|
path: n
|
|
3887
3915
|
});
|
|
3888
|
-
case "carousel": return /* @__PURE__ */
|
|
3916
|
+
case "carousel": return /* @__PURE__ */ u(Ht, {
|
|
3889
3917
|
block: e,
|
|
3890
3918
|
className: t,
|
|
3891
3919
|
path: n
|
|
3892
3920
|
});
|
|
3893
|
-
case "container": return /* @__PURE__ */
|
|
3921
|
+
case "container": return /* @__PURE__ */ u(Wn, {
|
|
3894
3922
|
block: e,
|
|
3895
3923
|
className: t,
|
|
3896
3924
|
path: n
|
|
3897
3925
|
});
|
|
3898
|
-
case "context": return /* @__PURE__ */
|
|
3926
|
+
case "context": return /* @__PURE__ */ u(kt, {
|
|
3899
3927
|
block: e,
|
|
3900
3928
|
className: t,
|
|
3901
3929
|
path: n
|
|
3902
3930
|
});
|
|
3903
|
-
case "context_actions": return /* @__PURE__ */
|
|
3931
|
+
case "context_actions": return /* @__PURE__ */ u(Fn, {
|
|
3904
3932
|
block: e,
|
|
3905
3933
|
className: t,
|
|
3906
3934
|
path: n
|
|
3907
3935
|
});
|
|
3908
|
-
case "data_table": return /* @__PURE__ */
|
|
3936
|
+
case "data_table": return /* @__PURE__ */ u(zt, {
|
|
3909
3937
|
block: e,
|
|
3910
3938
|
className: t,
|
|
3911
3939
|
path: n
|
|
3912
3940
|
});
|
|
3913
|
-
case "data_visualization": return /* @__PURE__ */
|
|
3941
|
+
case "data_visualization": return /* @__PURE__ */ u(On, {
|
|
3914
3942
|
block: e,
|
|
3915
3943
|
className: t,
|
|
3916
3944
|
path: n
|
|
3917
3945
|
});
|
|
3918
|
-
case "divider": return /* @__PURE__ */
|
|
3946
|
+
case "divider": return /* @__PURE__ */ u(Et, {
|
|
3919
3947
|
block: e,
|
|
3920
3948
|
className: t,
|
|
3921
3949
|
path: n
|
|
3922
3950
|
});
|
|
3923
|
-
case "file": return /* @__PURE__ */
|
|
3951
|
+
case "file": return /* @__PURE__ */ u(Mt, {
|
|
3924
3952
|
block: e,
|
|
3925
3953
|
className: t,
|
|
3926
3954
|
path: n
|
|
3927
3955
|
});
|
|
3928
|
-
case "header": return /* @__PURE__ */
|
|
3956
|
+
case "header": return /* @__PURE__ */ u(Tt, {
|
|
3929
3957
|
block: e,
|
|
3930
3958
|
className: t,
|
|
3931
3959
|
path: n
|
|
3932
3960
|
});
|
|
3933
|
-
case "image": return /* @__PURE__ */
|
|
3961
|
+
case "image": return /* @__PURE__ */ u(Dt, {
|
|
3934
3962
|
block: e,
|
|
3935
3963
|
className: t,
|
|
3936
3964
|
path: n
|
|
3937
3965
|
});
|
|
3938
|
-
case "input": return /* @__PURE__ */
|
|
3966
|
+
case "input": return /* @__PURE__ */ u(Nn, {
|
|
3939
3967
|
block: e,
|
|
3940
3968
|
className: t,
|
|
3941
3969
|
path: n
|
|
3942
3970
|
});
|
|
3943
|
-
case "markdown": return /* @__PURE__ */
|
|
3971
|
+
case "markdown": return /* @__PURE__ */ u(jt, {
|
|
3944
3972
|
block: e,
|
|
3945
3973
|
className: t,
|
|
3946
3974
|
path: n
|
|
3947
3975
|
});
|
|
3948
|
-
case "plan": return /* @__PURE__ */
|
|
3976
|
+
case "plan": return /* @__PURE__ */ u(Kt, {
|
|
3949
3977
|
block: e,
|
|
3950
3978
|
className: t,
|
|
3951
3979
|
path: n
|
|
3952
3980
|
});
|
|
3953
|
-
case "rich_text": return /* @__PURE__ */
|
|
3981
|
+
case "rich_text": return /* @__PURE__ */ u(At, {
|
|
3954
3982
|
block: e,
|
|
3955
3983
|
className: t,
|
|
3956
3984
|
path: n
|
|
3957
3985
|
});
|
|
3958
|
-
case "section": return /* @__PURE__ */
|
|
3986
|
+
case "section": return /* @__PURE__ */ u(wt, {
|
|
3959
3987
|
block: e,
|
|
3960
3988
|
className: t,
|
|
3961
3989
|
path: n
|
|
3962
3990
|
});
|
|
3963
|
-
case "table": return /* @__PURE__ */
|
|
3991
|
+
case "table": return /* @__PURE__ */ u(It, {
|
|
3964
3992
|
block: e,
|
|
3965
3993
|
className: t,
|
|
3966
3994
|
path: n
|
|
3967
3995
|
});
|
|
3968
|
-
case "task_card": return /* @__PURE__ */
|
|
3996
|
+
case "task_card": return /* @__PURE__ */ u(Wt, {
|
|
3969
3997
|
block: e,
|
|
3970
3998
|
className: t,
|
|
3971
3999
|
path: n
|
|
3972
4000
|
});
|
|
3973
|
-
case "video": return /* @__PURE__ */
|
|
4001
|
+
case "video": return /* @__PURE__ */ u(Nt, {
|
|
3974
4002
|
block: e,
|
|
3975
4003
|
className: t,
|
|
3976
4004
|
path: n
|
|
3977
4005
|
});
|
|
3978
|
-
default: return
|
|
4006
|
+
default: return _(e);
|
|
3979
4007
|
}
|
|
3980
4008
|
}
|
|
3981
4009
|
function zn(e) {
|
|
3982
|
-
return /* @__PURE__ */
|
|
4010
|
+
return /* @__PURE__ */ u(Rn, { ...e });
|
|
3983
4011
|
}
|
|
3984
4012
|
var Bn = {
|
|
3985
4013
|
actions: !0,
|
|
@@ -3995,64 +4023,64 @@ var Bn = {
|
|
|
3995
4023
|
video: !0
|
|
3996
4024
|
};
|
|
3997
4025
|
function Vn(e) {
|
|
3998
|
-
let t =
|
|
4026
|
+
let t = C(e);
|
|
3999
4027
|
return t !== void 0 && t in Bn;
|
|
4000
4028
|
}
|
|
4001
4029
|
function Hn({ block: e, path: t }) {
|
|
4002
4030
|
let n = e.title, r = e.subtitle;
|
|
4003
|
-
return /* @__PURE__ */
|
|
4031
|
+
return /* @__PURE__ */ d(l, { children: [e.icon === void 0 ? null : /* @__PURE__ */ u(P, {
|
|
4004
4032
|
element: e.icon,
|
|
4005
4033
|
variant: "cardIcon"
|
|
4006
|
-
}), /* @__PURE__ */
|
|
4034
|
+
}), /* @__PURE__ */ d("div", { children: [e.rich_text_title === void 0 ? e.title === void 0 ? null : /* @__PURE__ */ u("strong", { children: S(n) && typeof n.text == "string" ? n.text : T(n, "container title") }) : /* @__PURE__ */ u(M, {
|
|
4007
4035
|
block: e.rich_text_title,
|
|
4008
4036
|
path: `${t}.rich_text_title`
|
|
4009
|
-
}), e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
4010
|
-
...
|
|
4011
|
-
children:
|
|
4037
|
+
}), e.subtitle === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
4038
|
+
...g(D.smallText),
|
|
4039
|
+
children: S(r) && typeof r.text == "string" ? r.text : T(r, "container subtitle")
|
|
4012
4040
|
})] })] });
|
|
4013
4041
|
}
|
|
4014
4042
|
function Un({ block: e, path: n }) {
|
|
4015
4043
|
let r = e.child_blocks;
|
|
4016
|
-
return /* @__PURE__ */
|
|
4017
|
-
...
|
|
4018
|
-
children: Array.isArray(r) ? r.map((e, r) => Vn(e) ? /* @__PURE__ */
|
|
4044
|
+
return /* @__PURE__ */ u("div", {
|
|
4045
|
+
...g(D.containerBody),
|
|
4046
|
+
children: Array.isArray(r) ? r.map((e, r) => Vn(e) ? /* @__PURE__ */ u(Rn, {
|
|
4019
4047
|
block: e,
|
|
4020
4048
|
path: `${n}.child_blocks[${String(r)}]`
|
|
4021
|
-
}, `${
|
|
4022
|
-
...
|
|
4023
|
-
"data-block-type":
|
|
4049
|
+
}, `${C(e) ?? "unknown"}-${w(e) ?? "block"}-${String(r)}`) : /* @__PURE__ */ t("div", {
|
|
4050
|
+
...g(D.unhandled),
|
|
4051
|
+
"data-block-type": C(e) ?? "unknown",
|
|
4024
4052
|
"data-unhandled-block": !0,
|
|
4025
4053
|
key: `unknown-${String(r)}`
|
|
4026
|
-
},
|
|
4054
|
+
}, T(e, "Slack block"))) : null
|
|
4027
4055
|
});
|
|
4028
4056
|
}
|
|
4029
4057
|
function Wn({ block: e, className: t, path: n = "block" }) {
|
|
4030
|
-
return /* @__PURE__ */
|
|
4058
|
+
return /* @__PURE__ */ u(R, {
|
|
4031
4059
|
blockId: e.block_id,
|
|
4032
4060
|
blockType: e.type,
|
|
4033
4061
|
className: t,
|
|
4034
|
-
children: e.is_collapsible === !0 ? /* @__PURE__ */
|
|
4035
|
-
...
|
|
4062
|
+
children: e.is_collapsible === !0 ? /* @__PURE__ */ d("details", {
|
|
4063
|
+
...g(D.container),
|
|
4036
4064
|
open: e.default_collapsed !== !0,
|
|
4037
|
-
children: [/* @__PURE__ */
|
|
4038
|
-
...
|
|
4039
|
-
children: /* @__PURE__ */
|
|
4065
|
+
children: [/* @__PURE__ */ u("summary", {
|
|
4066
|
+
...g(D.containerHeader, e.has_header_divider === !0 && D.containerHeaderDivider),
|
|
4067
|
+
children: /* @__PURE__ */ u(Hn, {
|
|
4040
4068
|
block: e,
|
|
4041
4069
|
path: n
|
|
4042
4070
|
})
|
|
4043
|
-
}), /* @__PURE__ */
|
|
4071
|
+
}), /* @__PURE__ */ u(Un, {
|
|
4044
4072
|
block: e,
|
|
4045
4073
|
path: n
|
|
4046
4074
|
})]
|
|
4047
|
-
}) : /* @__PURE__ */
|
|
4048
|
-
...
|
|
4049
|
-
children: [/* @__PURE__ */
|
|
4050
|
-
...
|
|
4051
|
-
children: /* @__PURE__ */
|
|
4075
|
+
}) : /* @__PURE__ */ d("div", {
|
|
4076
|
+
...g(D.container),
|
|
4077
|
+
children: [/* @__PURE__ */ u("div", {
|
|
4078
|
+
...g(D.containerHeader, e.has_header_divider === !0 && D.containerHeaderDivider),
|
|
4079
|
+
children: /* @__PURE__ */ u(Hn, {
|
|
4052
4080
|
block: e,
|
|
4053
4081
|
path: n
|
|
4054
4082
|
})
|
|
4055
|
-
}), /* @__PURE__ */
|
|
4083
|
+
}), /* @__PURE__ */ u(Un, {
|
|
4056
4084
|
block: e,
|
|
4057
4085
|
path: n
|
|
4058
4086
|
})]
|
|
@@ -4084,7 +4112,7 @@ function Kn(e) {
|
|
|
4084
4112
|
return Array.isArray(t) ? {
|
|
4085
4113
|
blockListPath: "data",
|
|
4086
4114
|
blocks: t
|
|
4087
|
-
} :
|
|
4115
|
+
} : S(t) && Array.isArray(t.blocks) ? {
|
|
4088
4116
|
blockListPath: "data.blocks",
|
|
4089
4117
|
blocks: t.blocks
|
|
4090
4118
|
} : {
|
|
@@ -4092,40 +4120,40 @@ function Kn(e) {
|
|
|
4092
4120
|
blocks: [t]
|
|
4093
4121
|
};
|
|
4094
4122
|
}
|
|
4095
|
-
function qn({ "aria-label": e = "Slack Block Kit preview", className: t, data: n, onAction: r, resolvers: i, surface:
|
|
4096
|
-
let c =
|
|
4097
|
-
return /* @__PURE__ */
|
|
4123
|
+
function qn({ "aria-label": e = "Slack Block Kit preview", className: t, data: n, onAction: r, resolvers: i, surface: a = "message", theme: s = "light" }) {
|
|
4124
|
+
let c = o(() => Kn(n), [n]), l = g(s === "dark" ? ne : te, D.root, s === "dark" ? D.rootDark : D.rootLight);
|
|
4125
|
+
return /* @__PURE__ */ u(b, {
|
|
4098
4126
|
onAction: r,
|
|
4099
4127
|
resolvers: i,
|
|
4100
|
-
surface:
|
|
4101
|
-
children: /* @__PURE__ */
|
|
4102
|
-
...
|
|
4128
|
+
surface: a,
|
|
4129
|
+
children: /* @__PURE__ */ u("div", {
|
|
4130
|
+
...l,
|
|
4103
4131
|
"aria-label": e,
|
|
4104
|
-
className:
|
|
4132
|
+
className: k(l.className, t),
|
|
4105
4133
|
"data-block-kit-root": !0,
|
|
4106
|
-
"data-surface":
|
|
4134
|
+
"data-surface": a,
|
|
4107
4135
|
"data-theme": s,
|
|
4108
4136
|
role: "article",
|
|
4109
|
-
children: c.blocks.map((e, t) => /* @__PURE__ */
|
|
4137
|
+
children: c.blocks.map((e, t) => /* @__PURE__ */ u(Rn, {
|
|
4110
4138
|
block: e,
|
|
4111
4139
|
path: `${c.blockListPath}[${String(t)}]`
|
|
4112
|
-
}, `${
|
|
4140
|
+
}, `${C(e) ?? "unknown"}-${w(e) ?? "block"}-${String(t)}`))
|
|
4113
4141
|
})
|
|
4114
4142
|
});
|
|
4115
4143
|
}
|
|
4116
4144
|
//#endregion
|
|
4117
4145
|
//#region src/validation.ts
|
|
4118
|
-
function
|
|
4146
|
+
function Jn(e, t, n) {
|
|
4119
4147
|
throw new Gn(n, {
|
|
4120
4148
|
code: e,
|
|
4121
4149
|
path: t
|
|
4122
4150
|
});
|
|
4123
4151
|
}
|
|
4124
4152
|
function z(e, t, n, r) {
|
|
4125
|
-
e ||
|
|
4153
|
+
e || Jn(t, n, r);
|
|
4126
4154
|
}
|
|
4127
4155
|
function B(e, t) {
|
|
4128
|
-
z(
|
|
4156
|
+
z(S(e), "invalid_type", t, "expected an object");
|
|
4129
4157
|
}
|
|
4130
4158
|
function V(e, t) {
|
|
4131
4159
|
z(Array.isArray(e), "invalid_type", t, "expected an array");
|
|
@@ -4154,13 +4182,13 @@ function J(e, t) {
|
|
|
4154
4182
|
function Y(e, t, n = qt) {
|
|
4155
4183
|
B(e, t), q(e.type, ["plain_text", "mrkdwn"], `${t}.type`), H(e.text, `${t}.text`, { max: n }), e.type === "plain_text" ? (G(e.emoji, `${t}.emoji`), z(e.verbatim === void 0, "invalid_value", `${t}.verbatim`, "verbatim is only legal on mrkdwn text")) : (G(e.verbatim, `${t}.verbatim`), z(e.emoji === void 0, "invalid_value", `${t}.emoji`, "emoji is only legal on plain_text"));
|
|
4156
4184
|
}
|
|
4157
|
-
function
|
|
4185
|
+
function Yn(e, t = "text", n = qt) {
|
|
4158
4186
|
Y(e, t, n);
|
|
4159
4187
|
}
|
|
4160
4188
|
function X(e, t, n = qt) {
|
|
4161
|
-
Y(e, t, n), z(
|
|
4189
|
+
Y(e, t, n), z(S(e) && e.type === "plain_text", "invalid_value", `${t}.type`, "expected \"plain_text\"");
|
|
4162
4190
|
}
|
|
4163
|
-
function
|
|
4191
|
+
function Xn(e, t) {
|
|
4164
4192
|
B(e, t);
|
|
4165
4193
|
let n = e.id !== void 0, r = e.url !== void 0;
|
|
4166
4194
|
z(n !== r, "invalid_value", t, "must contain exactly one of id or url"), n && H(e.id, `${t}.id`), r && H(e.url, `${t}.url`, { max: Xt });
|
|
@@ -4168,50 +4196,50 @@ function Yn(e, t) {
|
|
|
4168
4196
|
function Z(e, t) {
|
|
4169
4197
|
B(e, t), K(e, "image", t), H(e.alt_text, `${t}.alt_text`, { max: Zt });
|
|
4170
4198
|
let n = e.image_url !== void 0, r = e.slack_file !== void 0;
|
|
4171
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of image_url or slack_file"), n && H(e.image_url, `${t}.image_url`, { max: Xt }), r &&
|
|
4199
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of image_url or slack_file"), n && H(e.image_url, `${t}.image_url`, { max: Xt }), r && Xn(e.slack_file, `${t}.slack_file`);
|
|
4172
4200
|
}
|
|
4173
|
-
function
|
|
4201
|
+
function Zn(e, t = "element") {
|
|
4174
4202
|
Z(e, t);
|
|
4175
4203
|
}
|
|
4176
|
-
function
|
|
4204
|
+
function Qn(e, t) {
|
|
4177
4205
|
B(e, t), Y(e.text, `${t}.text`, 75), U(e.value, `${t}.value`, { max: 75 }), U(e.url, `${t}.url`, { max: en }), e.description !== void 0 && X(e.description, `${t}.description`, 75);
|
|
4178
4206
|
}
|
|
4179
|
-
function
|
|
4207
|
+
function $n(e, t, n) {
|
|
4180
4208
|
V(e, t), z(e.length > 0, "missing_field", t, "must contain at least one option"), z(e.length <= n, "limit_exceeded", t, `must contain at most ${String(n)} options`), e.forEach((e, n) => {
|
|
4181
|
-
|
|
4209
|
+
Qn(e, `${t}[${String(n)}]`);
|
|
4182
4210
|
});
|
|
4183
4211
|
}
|
|
4184
|
-
function $n(e, t) {
|
|
4185
|
-
U(e.action_id, `${t}.action_id`, { max: 255 });
|
|
4186
|
-
}
|
|
4187
4212
|
function er(e, t) {
|
|
4188
|
-
|
|
4213
|
+
U(e.action_id, `${t}.action_id`, { max: 255 });
|
|
4189
4214
|
}
|
|
4190
4215
|
function tr(e, t) {
|
|
4191
|
-
|
|
4216
|
+
e.placeholder !== void 0 && X(e.placeholder, `${t}.placeholder`, 150);
|
|
4192
4217
|
}
|
|
4193
4218
|
function nr(e, t) {
|
|
4219
|
+
B(e, t), K(e, "button", t), er(e, t), X(e.text, `${t}.text`, 75), U(e.url, `${t}.url`, { max: en }), U(e.value, `${t}.value`, { max: tn }), U(e.accessibility_label, `${t}.accessibility_label`, { max: 75 }), e.style !== void 0 && q(e.style, ["primary", "danger"], `${t}.style`);
|
|
4220
|
+
}
|
|
4221
|
+
function rr(e, t) {
|
|
4194
4222
|
let n = e.options !== void 0, r = e.option_groups !== void 0;
|
|
4195
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n &&
|
|
4223
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n && $n(e.options, `${t}.options`, 100), r && (V(e.option_groups, `${t}.option_groups`), z(e.option_groups.length <= 100, "limit_exceeded", `${t}.option_groups`, "must contain at most 100 groups"), e.option_groups.forEach((e, n) => {
|
|
4196
4224
|
let r = `${t}.option_groups[${String(n)}]`;
|
|
4197
|
-
B(e, r), X(e.label, `${r}.label`, 75),
|
|
4225
|
+
B(e, r), X(e.label, `${r}.label`, 75), $n(e.options, `${r}.options`, 100);
|
|
4198
4226
|
}));
|
|
4199
4227
|
}
|
|
4200
|
-
function
|
|
4201
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4228
|
+
function ir(e, t) {
|
|
4229
|
+
switch (B(e, t), H(e.type, `${t}.type`), er(e, t), tr(e, t), e.type) {
|
|
4202
4230
|
case "button":
|
|
4203
|
-
|
|
4231
|
+
nr(e, t);
|
|
4204
4232
|
return;
|
|
4205
4233
|
case "checkboxes":
|
|
4206
4234
|
case "radio_buttons":
|
|
4207
|
-
|
|
4235
|
+
$n(e.options, `${t}.options`, 10);
|
|
4208
4236
|
return;
|
|
4209
4237
|
case "overflow":
|
|
4210
|
-
|
|
4238
|
+
$n(e.options, `${t}.options`, 5);
|
|
4211
4239
|
return;
|
|
4212
4240
|
case "static_select":
|
|
4213
4241
|
case "multi_static_select":
|
|
4214
|
-
|
|
4242
|
+
rr(e, t);
|
|
4215
4243
|
return;
|
|
4216
4244
|
case "external_select":
|
|
4217
4245
|
case "multi_external_select":
|
|
@@ -4257,13 +4285,13 @@ function rr(e, t) {
|
|
|
4257
4285
|
case "workflow_button":
|
|
4258
4286
|
X(e.text, `${t}.text`, 75), B(e.workflow, `${t}.workflow`), B(e.workflow.trigger, `${t}.workflow.trigger`), H(e.workflow.trigger.url, `${t}.workflow.trigger.url`);
|
|
4259
4287
|
return;
|
|
4260
|
-
default:
|
|
4288
|
+
default: Jn("unsupported_element", `${t}.type`, `unsupported element "${e.type}"`);
|
|
4261
4289
|
}
|
|
4262
4290
|
}
|
|
4263
|
-
function
|
|
4264
|
-
|
|
4291
|
+
function ar(e, t = "element") {
|
|
4292
|
+
ir(e, t);
|
|
4265
4293
|
}
|
|
4266
|
-
function
|
|
4294
|
+
function or(e, t) {
|
|
4267
4295
|
if (e !== void 0) {
|
|
4268
4296
|
B(e, t);
|
|
4269
4297
|
for (let n of [
|
|
@@ -4275,8 +4303,8 @@ function ar(e, t) {
|
|
|
4275
4303
|
]) G(e[n], `${t}.${n}`);
|
|
4276
4304
|
}
|
|
4277
4305
|
}
|
|
4278
|
-
function
|
|
4279
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4306
|
+
function sr(e, t) {
|
|
4307
|
+
switch (B(e, t), H(e.type, `${t}.type`), or(e.style, `${t}.style`), e.type) {
|
|
4280
4308
|
case "text":
|
|
4281
4309
|
H(e.text, `${t}.text`, { allowEmpty: !0 });
|
|
4282
4310
|
return;
|
|
@@ -4330,12 +4358,12 @@ function or(e, t) {
|
|
|
4330
4358
|
case "workflow_mention":
|
|
4331
4359
|
z(Object.keys(e).length > 1, "missing_field", t, `${e.type} must contain its reference fields`);
|
|
4332
4360
|
return;
|
|
4333
|
-
default:
|
|
4361
|
+
default: Jn("unsupported_element", `${t}.type`, `unsupported rich text element "${e.type}"`);
|
|
4334
4362
|
}
|
|
4335
4363
|
}
|
|
4336
|
-
function
|
|
4364
|
+
function cr(e, t) {
|
|
4337
4365
|
V(e, t), e.forEach((e, n) => {
|
|
4338
|
-
|
|
4366
|
+
sr(e, `${t}[${String(n)}]`);
|
|
4339
4367
|
});
|
|
4340
4368
|
}
|
|
4341
4369
|
function Q(e, t) {
|
|
@@ -4344,7 +4372,7 @@ function Q(e, t) {
|
|
|
4344
4372
|
switch (B(e, r), H(e.type, `${r}.type`), e.type) {
|
|
4345
4373
|
case "rich_text_section":
|
|
4346
4374
|
case "rich_text_quote":
|
|
4347
|
-
|
|
4375
|
+
cr(e.elements, `${r}.elements`);
|
|
4348
4376
|
return;
|
|
4349
4377
|
case "rich_text_list":
|
|
4350
4378
|
q(e.style, ["bullet", "ordered"], `${r}.style`), e.indent !== void 0 && W(e.indent, `${r}.indent`, {
|
|
@@ -4356,28 +4384,25 @@ function Q(e, t) {
|
|
|
4356
4384
|
min: 0
|
|
4357
4385
|
}), V(e.elements, `${r}.elements`), e.elements.forEach((e, t) => {
|
|
4358
4386
|
let n = `${r}.elements[${String(t)}]`;
|
|
4359
|
-
B(e, n), K(e, "rich_text_section", n),
|
|
4387
|
+
B(e, n), K(e, "rich_text_section", n), cr(e.elements, `${n}.elements`);
|
|
4360
4388
|
});
|
|
4361
4389
|
return;
|
|
4362
4390
|
case "rich_text_preformatted":
|
|
4363
|
-
|
|
4364
|
-
let n = `${r}.elements[${String(t)}]`;
|
|
4365
|
-
or(e, n), B(e, n), z(e.type === "text" || e.type === "link", "invalid_value", `${n}.type`, "preformatted text only accepts text or link elements");
|
|
4366
|
-
}), U(e.language, `${r}.language`);
|
|
4391
|
+
cr(e.elements, `${r}.elements`), U(e.language, `${r}.language`);
|
|
4367
4392
|
return;
|
|
4368
|
-
default:
|
|
4393
|
+
default: Jn("unsupported_element", `${r}.type`, `unsupported rich text container "${e.type}"`);
|
|
4369
4394
|
}
|
|
4370
4395
|
});
|
|
4371
4396
|
}
|
|
4372
|
-
function
|
|
4397
|
+
function lr(e, t = "block") {
|
|
4373
4398
|
Q(e, t);
|
|
4374
4399
|
}
|
|
4375
|
-
function
|
|
4400
|
+
function ur(e, t) {
|
|
4376
4401
|
B(e, t), K(e, "section", t), J(e, t);
|
|
4377
4402
|
let n = e.text !== void 0, r = e.fields !== void 0;
|
|
4378
4403
|
z(n || r, "missing_field", t, "requires text or fields"), n && Y(e.text, `${t}.text`, Jt), r && (V(e.fields, `${t}.fields`), z(e.fields.length > 0 && e.fields.length <= 10, "limit_exceeded", `${t}.fields`, "must contain 1–10 text objects"), e.fields.forEach((e, n) => {
|
|
4379
4404
|
Y(e, `${t}.fields[${String(n)}]`, Yt);
|
|
4380
|
-
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (
|
|
4405
|
+
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (ir(e.accessory, `${t}.accessory`), z(![
|
|
4381
4406
|
"datetimepicker",
|
|
4382
4407
|
"file_input",
|
|
4383
4408
|
"plain_text_input",
|
|
@@ -4387,26 +4412,26 @@ function lr(e, t) {
|
|
|
4387
4412
|
"rich_text_input"
|
|
4388
4413
|
].includes(String(e.accessory.type)), "invalid_value", `${t}.accessory.type`, "element is not legal as a section accessory"))), G(e.expand, `${t}.expand`);
|
|
4389
4414
|
}
|
|
4390
|
-
function
|
|
4415
|
+
function dr(e, t) {
|
|
4391
4416
|
B(e, t), K(e, "header", t), J(e, t), X(e.text, `${t}.text`, 150), e.level !== void 0 && W(e.level, `${t}.level`, {
|
|
4392
4417
|
integer: !0,
|
|
4393
4418
|
min: 1,
|
|
4394
4419
|
max: 4
|
|
4395
4420
|
});
|
|
4396
4421
|
}
|
|
4397
|
-
function
|
|
4422
|
+
function fr(e, t) {
|
|
4398
4423
|
Z(e, t), B(e, t), J(e, t), e.title !== void 0 && X(e.title, `${t}.title`, Qt);
|
|
4399
4424
|
}
|
|
4400
|
-
function
|
|
4425
|
+
function pr(e, t) {
|
|
4401
4426
|
B(e, t), K(e, "context", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 10, "limit_exceeded", `${t}.elements`, "must contain 1–10 elements"), e.elements.forEach((e, n) => {
|
|
4402
4427
|
let r = `${t}.elements[${String(n)}]`;
|
|
4403
4428
|
B(e, r), e.type === "image" ? Z(e, r) : Y(e, r);
|
|
4404
4429
|
});
|
|
4405
4430
|
}
|
|
4406
|
-
function
|
|
4431
|
+
function mr(e, t) {
|
|
4407
4432
|
B(e, t), K(e, "actions", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 25, "limit_exceeded", `${t}.elements`, "must contain 1–25 elements"), e.elements.forEach((e, n) => {
|
|
4408
4433
|
let r = `${t}.elements[${String(n)}]`;
|
|
4409
|
-
|
|
4434
|
+
ir(e, r), B(e, r), z([
|
|
4410
4435
|
"button",
|
|
4411
4436
|
"checkboxes",
|
|
4412
4437
|
"datepicker",
|
|
@@ -4429,8 +4454,8 @@ function pr(e, t) {
|
|
|
4429
4454
|
].includes(String(e.type)), "invalid_value", `${r}.type`, "element is not legal inside an actions block");
|
|
4430
4455
|
});
|
|
4431
4456
|
}
|
|
4432
|
-
function
|
|
4433
|
-
B(e, t), K(e, "input", t), J(e, t), X(e.label, `${t}.label`, 2e3), e.hint !== void 0 && X(e.hint, `${t}.hint`, 2e3), G(e.optional, `${t}.optional`), G(e.dispatch_action, `${t}.dispatch_action`),
|
|
4457
|
+
function hr(e, t) {
|
|
4458
|
+
B(e, t), K(e, "input", t), J(e, t), X(e.label, `${t}.label`, 2e3), e.hint !== void 0 && X(e.hint, `${t}.hint`, 2e3), G(e.optional, `${t}.optional`), G(e.dispatch_action, `${t}.dispatch_action`), ir(e.element, `${t}.element`), B(e.element, `${t}.element`), z(![
|
|
4434
4459
|
"button",
|
|
4435
4460
|
"overflow",
|
|
4436
4461
|
"workflow_button",
|
|
@@ -4438,18 +4463,18 @@ function mr(e, t) {
|
|
|
4438
4463
|
"feedback_buttons"
|
|
4439
4464
|
].includes(String(e.element.type)), "invalid_value", `${t}.element.type`, "element is not legal inside an input block"), z(!(e.dispatch_action === !0 && e.element.type === "file_input"), "invalid_value", `${t}.dispatch_action`, "dispatch_action is incompatible with file_input");
|
|
4440
4465
|
}
|
|
4441
|
-
function
|
|
4442
|
-
if (!
|
|
4466
|
+
function gr(e) {
|
|
4467
|
+
if (!S(e)) return 0;
|
|
4443
4468
|
if (e.type === "raw_text") return typeof e.text == "string" ? e.text.length : 0;
|
|
4444
4469
|
if (e.type === "raw_number") return typeof e.text == "string" ? e.text.length : typeof e.value == "number" ? String(e.value).length : 0;
|
|
4445
4470
|
if (e.type === "rich_text" && Array.isArray(e.elements)) {
|
|
4446
4471
|
let t = 0;
|
|
4447
|
-
for (let n of e.elements) if (!(!
|
|
4472
|
+
for (let n of e.elements) if (!(!S(n) || !Array.isArray(n.elements))) for (let e of n.elements) S(e) && (typeof e.text == "string" ? t += e.text.length : typeof e.url == "string" && (t += e.url.length));
|
|
4448
4473
|
return t;
|
|
4449
4474
|
}
|
|
4450
4475
|
return 0;
|
|
4451
4476
|
}
|
|
4452
|
-
function
|
|
4477
|
+
function _r(e, t, n) {
|
|
4453
4478
|
switch (B(e, t), H(e.type, `${t}.type`), e.type) {
|
|
4454
4479
|
case "raw_text":
|
|
4455
4480
|
H(e.text, `${t}.text`);
|
|
@@ -4460,21 +4485,21 @@ function gr(e, t, n) {
|
|
|
4460
4485
|
case "rich_text":
|
|
4461
4486
|
z(n, "invalid_value", t, "rich_text is not legal in this row"), Q(e, t);
|
|
4462
4487
|
return;
|
|
4463
|
-
default:
|
|
4488
|
+
default: Jn("invalid_value", `${t}.type`, `unsupported table cell "${e.type}"`);
|
|
4464
4489
|
}
|
|
4465
4490
|
}
|
|
4466
|
-
function
|
|
4491
|
+
function vr(e, t, n, r, i) {
|
|
4467
4492
|
V(e, t), z(e.length > 0, "missing_field", t, "must contain at least one row"), z(e.length <= n, "limit_exceeded", t, `must contain at most ${String(n)} rows`);
|
|
4468
4493
|
let a, o = 0;
|
|
4469
4494
|
return e.forEach((e, n) => {
|
|
4470
4495
|
let r = `${t}[${String(n)}]`;
|
|
4471
4496
|
V(e, r), z(e.length > 0 && e.length <= 20, "limit_exceeded", r, "must contain 1–20 cells"), a === void 0 ? a = e.length : z(e.length === a, "invalid_value", r, "all table rows must contain the same number of cells"), e.forEach((e, t) => {
|
|
4472
|
-
|
|
4497
|
+
_r(e, `${r}[${String(t)}]`, i || n !== 0), o += gr(e);
|
|
4473
4498
|
});
|
|
4474
4499
|
}), z(o <= r, "limit_exceeded", t, `cell content must contain at most ${String(r)} characters`), a ?? 0;
|
|
4475
4500
|
}
|
|
4476
|
-
function
|
|
4477
|
-
B(e, t), K(e, "table", t), J(e, t),
|
|
4501
|
+
function yr(e, t) {
|
|
4502
|
+
B(e, t), K(e, "table", t), J(e, t), vr(e.rows, `${t}.rows`, 100, nn, !0), e.column_settings !== void 0 && (V(e.column_settings, `${t}.column_settings`), z(e.column_settings.length <= 20, "limit_exceeded", `${t}.column_settings`, "must contain at most 20 entries"), e.column_settings.forEach((e, n) => {
|
|
4478
4503
|
if (e === null) return;
|
|
4479
4504
|
let r = `${t}.column_settings[${String(n)}]`;
|
|
4480
4505
|
B(e, r), e.align !== void 0 && q(e.align, [
|
|
@@ -4484,9 +4509,9 @@ function vr(e, t) {
|
|
|
4484
4509
|
], `${r}.align`), G(e.is_wrapped, `${r}.is_wrapped`);
|
|
4485
4510
|
}));
|
|
4486
4511
|
}
|
|
4487
|
-
function
|
|
4512
|
+
function br(e, t) {
|
|
4488
4513
|
B(e, t), K(e, "data_table", t), J(e, t), H(e.caption, `${t}.caption`);
|
|
4489
|
-
let n =
|
|
4514
|
+
let n = vr(e.rows, `${t}.rows`, 201, rn, !1);
|
|
4490
4515
|
V(e.rows, `${t}.rows`), z(e.rows.length >= 2, "invalid_value", `${t}.rows`, "requires a header row and at least one data row"), e.page_size !== void 0 && W(e.page_size, `${t}.page_size`, {
|
|
4491
4516
|
integer: !0,
|
|
4492
4517
|
min: 1,
|
|
@@ -4497,7 +4522,7 @@ function yr(e, t) {
|
|
|
4497
4522
|
max: n - 1
|
|
4498
4523
|
});
|
|
4499
4524
|
}
|
|
4500
|
-
function
|
|
4525
|
+
function xr(e, t) {
|
|
4501
4526
|
if (B(e, t), K(e, "data_visualization", t), J(e, t), H(e.title, `${t}.title`, { max: 50 }), B(e.chart, `${t}.chart`), H(e.chart.type, `${t}.chart.type`), e.chart.type === "pie") {
|
|
4502
4527
|
V(e.chart.segments, `${t}.chart.segments`), z(e.chart.segments.length > 0 && e.chart.segments.length <= 12, "limit_exceeded", `${t}.chart.segments`, "must contain 1–12 segments"), e.chart.segments.forEach((e, n) => {
|
|
4503
4528
|
let r = `${t}.chart.segments[${String(n)}]`;
|
|
@@ -4526,20 +4551,20 @@ function br(e, t) {
|
|
|
4526
4551
|
});
|
|
4527
4552
|
});
|
|
4528
4553
|
}
|
|
4529
|
-
function
|
|
4554
|
+
function Sr(e, t) {
|
|
4530
4555
|
B(e, t), K(e, "card", t), J(e, t), z(e.hero_image !== void 0 || e.title !== void 0 || e.actions !== void 0 || e.body !== void 0, "missing_field", t, "requires at least one of hero_image, title, actions, or body"), e.hero_image !== void 0 && Z(e.hero_image, `${t}.hero_image`), e.icon !== void 0 && Z(e.icon, `${t}.icon`), z(!(e.icon !== void 0 && e.slack_icon !== void 0), "invalid_value", t, "icon and slack_icon are mutually exclusive"), e.slack_icon !== void 0 && (B(e.slack_icon, `${t}.slack_icon`), K(e.slack_icon, "icon", `${t}.slack_icon`), H(e.slack_icon.name, `${t}.slack_icon.name`));
|
|
4531
4556
|
for (let n of ["title", "subtitle"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 150);
|
|
4532
4557
|
for (let n of ["body", "subtext"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 200);
|
|
4533
4558
|
e.actions !== void 0 && (V(e.actions, `${t}.actions`), z(e.actions.length > 0 && e.actions.length <= 3, "limit_exceeded", `${t}.actions`, "must contain 1–3 buttons"), e.actions.forEach((e, n) => {
|
|
4534
|
-
|
|
4559
|
+
nr(e, `${t}.actions[${String(n)}]`);
|
|
4535
4560
|
}));
|
|
4536
4561
|
}
|
|
4537
|
-
function
|
|
4562
|
+
function Cr(e, t) {
|
|
4538
4563
|
B(e, t), K(e, "carousel", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 10, "limit_exceeded", `${t}.elements`, "must contain 1–10 cards"), e.elements.forEach((e, n) => {
|
|
4539
|
-
|
|
4564
|
+
Sr(e, `${t}.elements[${String(n)}]`);
|
|
4540
4565
|
});
|
|
4541
4566
|
}
|
|
4542
|
-
function
|
|
4567
|
+
function wr(e, t, n) {
|
|
4543
4568
|
B(e, n), K(e, "alert", n), J(e, n), z(t === "modal", "surface_mismatch", n, "alert blocks are only legal on modal surfaces"), Y(e.text, `${n}.text`, 200), e.level !== void 0 && q(e.level, [
|
|
4544
4569
|
"default",
|
|
4545
4570
|
"info",
|
|
@@ -4548,10 +4573,10 @@ function Cr(e, t, n) {
|
|
|
4548
4573
|
"success"
|
|
4549
4574
|
], `${n}.level`);
|
|
4550
4575
|
}
|
|
4551
|
-
function
|
|
4576
|
+
function Tr(e, t) {
|
|
4552
4577
|
B(e, t), K(e, "context_actions", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 5, "limit_exceeded", `${t}.elements`, "must contain 1–5 elements"), e.elements.forEach((e, n) => {
|
|
4553
4578
|
let r = `${t}.elements[${String(n)}]`;
|
|
4554
|
-
if (B(e, r),
|
|
4579
|
+
if (B(e, r), er(e, r), e.type === "icon_button") {
|
|
4555
4580
|
q(e.icon, ["trash"], `${r}.icon`), X(e.text, `${r}.text`, 75), U(e.value, `${r}.value`, { max: tn });
|
|
4556
4581
|
return;
|
|
4557
4582
|
}
|
|
@@ -4562,7 +4587,7 @@ function wr(e, t) {
|
|
|
4562
4587
|
}
|
|
4563
4588
|
});
|
|
4564
4589
|
}
|
|
4565
|
-
function
|
|
4590
|
+
function Er(e, t) {
|
|
4566
4591
|
B(e, t), K(e, "task_card", t), J(e, t), H(e.task_id, `${t}.task_id`), H(e.title, `${t}.title`), q(e.status, [
|
|
4567
4592
|
"pending",
|
|
4568
4593
|
"in_progress",
|
|
@@ -4573,12 +4598,12 @@ function Tr(e, t) {
|
|
|
4573
4598
|
B(e, r), K(e, "url", r), H(e.url, `${r}.url`), H(e.text, `${r}.text`);
|
|
4574
4599
|
}));
|
|
4575
4600
|
}
|
|
4576
|
-
function
|
|
4601
|
+
function Dr(e, t) {
|
|
4577
4602
|
B(e, t), K(e, "plan", t), J(e, t), H(e.title, `${t}.title`), e.tasks !== void 0 && (V(e.tasks, `${t}.tasks`), e.tasks.forEach((e, n) => {
|
|
4578
|
-
|
|
4603
|
+
Er(e, `${t}.tasks[${String(n)}]`);
|
|
4579
4604
|
}));
|
|
4580
4605
|
}
|
|
4581
|
-
function
|
|
4606
|
+
function Or(e, t) {
|
|
4582
4607
|
B(e, t), K(e, "container", t), J(e, t), z(e.title !== void 0 || e.rich_text_title !== void 0, "missing_field", t, "requires title or rich_text_title"), e.title !== void 0 && X(e.title, `${t}.title`, 150), e.rich_text_title !== void 0 && Q(e.rich_text_title, `${t}.rich_text_title`), e.subtitle !== void 0 && X(e.subtitle, `${t}.subtitle`, 150), e.icon !== void 0 && Z(e.icon, `${t}.icon`), e.width !== void 0 && q(e.width, [
|
|
4583
4608
|
"narrow",
|
|
4584
4609
|
"standard",
|
|
@@ -4600,104 +4625,104 @@ function Dr(e, t) {
|
|
|
4600
4625
|
];
|
|
4601
4626
|
e.child_blocks.forEach((e, r) => {
|
|
4602
4627
|
let i = `${t}.child_blocks[${String(r)}]`;
|
|
4603
|
-
B(e, i), H(e.type, `${i}.type`), z(n.includes(e.type), "invalid_value", `${i}.type`, `"${e.type}" is not legal inside a container`),
|
|
4628
|
+
B(e, i), H(e.type, `${i}.type`), z(n.includes(e.type), "invalid_value", `${i}.type`, `"${e.type}" is not legal inside a container`), jr(e, "message", i);
|
|
4604
4629
|
});
|
|
4605
4630
|
}
|
|
4606
|
-
function
|
|
4631
|
+
function kr(e, t) {
|
|
4607
4632
|
B(e, t), K(e, "file", t), J(e, t), z(e.source === "remote", "invalid_value", `${t}.source`, "expected \"remote\""), H(e.external_id, `${t}.external_id`);
|
|
4608
4633
|
}
|
|
4609
|
-
function
|
|
4634
|
+
function Ar(e, t) {
|
|
4610
4635
|
B(e, t), K(e, "video", t), J(e, t), H(e.video_url, `${t}.video_url`), H(e.thumbnail_url, `${t}.thumbnail_url`), H(e.alt_text, `${t}.alt_text`, { max: Zt }), X(e.title, `${t}.title`, 199), e.description !== void 0 && X(e.description, `${t}.description`, 199), U(e.author_name, `${t}.author_name`, { max: 49 });
|
|
4611
4636
|
}
|
|
4612
4637
|
function $(e, t, n) {
|
|
4613
4638
|
z(e === "message", "surface_mismatch", t, `${n} blocks are only documented for message surfaces`);
|
|
4614
4639
|
}
|
|
4615
|
-
function
|
|
4640
|
+
function jr(e, t = "message", n = "block") {
|
|
4616
4641
|
switch (B(e, n), J(e, n), e.type) {
|
|
4617
4642
|
case "actions":
|
|
4618
|
-
|
|
4643
|
+
mr(e, n);
|
|
4619
4644
|
return;
|
|
4620
4645
|
case "alert":
|
|
4621
|
-
|
|
4646
|
+
wr(e, t, n);
|
|
4622
4647
|
return;
|
|
4623
4648
|
case "card":
|
|
4624
|
-
$(t, n, e.type),
|
|
4649
|
+
$(t, n, e.type), Sr(e, n);
|
|
4625
4650
|
return;
|
|
4626
4651
|
case "carousel":
|
|
4627
|
-
$(t, n, e.type),
|
|
4652
|
+
$(t, n, e.type), Cr(e, n);
|
|
4628
4653
|
return;
|
|
4629
4654
|
case "container":
|
|
4630
|
-
$(t, n, e.type),
|
|
4655
|
+
$(t, n, e.type), Or(e, n);
|
|
4631
4656
|
return;
|
|
4632
4657
|
case "context":
|
|
4633
|
-
|
|
4658
|
+
pr(e, n);
|
|
4634
4659
|
return;
|
|
4635
4660
|
case "context_actions":
|
|
4636
|
-
$(t, n, e.type),
|
|
4661
|
+
$(t, n, e.type), Tr(e, n);
|
|
4637
4662
|
return;
|
|
4638
4663
|
case "data_table":
|
|
4639
|
-
$(t, n, e.type),
|
|
4664
|
+
$(t, n, e.type), br(e, n);
|
|
4640
4665
|
return;
|
|
4641
4666
|
case "data_visualization":
|
|
4642
|
-
$(t, n, e.type),
|
|
4667
|
+
$(t, n, e.type), xr(e, n);
|
|
4643
4668
|
return;
|
|
4644
4669
|
case "divider":
|
|
4645
4670
|
K(e, "divider", n);
|
|
4646
4671
|
return;
|
|
4647
4672
|
case "file":
|
|
4648
|
-
$(t, n, e.type),
|
|
4673
|
+
$(t, n, e.type), kr(e, n);
|
|
4649
4674
|
return;
|
|
4650
4675
|
case "header":
|
|
4651
|
-
|
|
4676
|
+
dr(e, n);
|
|
4652
4677
|
return;
|
|
4653
4678
|
case "image":
|
|
4654
|
-
|
|
4679
|
+
fr(e, n);
|
|
4655
4680
|
return;
|
|
4656
4681
|
case "input":
|
|
4657
|
-
|
|
4682
|
+
hr(e, n);
|
|
4658
4683
|
return;
|
|
4659
4684
|
case "markdown":
|
|
4660
4685
|
$(t, n, e.type), H(e.text, `${n}.text`, { max: $t });
|
|
4661
4686
|
return;
|
|
4662
4687
|
case "plan":
|
|
4663
|
-
$(t, n, e.type),
|
|
4688
|
+
$(t, n, e.type), Dr(e, n);
|
|
4664
4689
|
return;
|
|
4665
4690
|
case "rich_text":
|
|
4666
4691
|
Q(e, n);
|
|
4667
4692
|
return;
|
|
4668
4693
|
case "section":
|
|
4669
|
-
|
|
4694
|
+
ur(e, n);
|
|
4670
4695
|
return;
|
|
4671
4696
|
case "table":
|
|
4672
|
-
$(t, n, e.type),
|
|
4697
|
+
$(t, n, e.type), yr(e, n);
|
|
4673
4698
|
return;
|
|
4674
4699
|
case "task_card":
|
|
4675
|
-
$(t, n, e.type),
|
|
4700
|
+
$(t, n, e.type), Er(e, n);
|
|
4676
4701
|
return;
|
|
4677
4702
|
case "video":
|
|
4678
|
-
|
|
4703
|
+
Ar(e, n);
|
|
4679
4704
|
return;
|
|
4680
|
-
default:
|
|
4705
|
+
default: Jn("unsupported_block", `${n}.type`, `unsupported block "${String(e.type)}"`);
|
|
4681
4706
|
}
|
|
4682
4707
|
}
|
|
4683
|
-
function
|
|
4684
|
-
|
|
4708
|
+
function Mr(e, t, n = "message", r = "block") {
|
|
4709
|
+
jr(e, n, r), z(e.type === t, "invalid_value", `${r}.type`, `expected "${t}"`);
|
|
4685
4710
|
}
|
|
4686
|
-
function
|
|
4711
|
+
function Nr(e, t) {
|
|
4687
4712
|
return Array.isArray(e) ? e : (B(e, t), V(e.blocks, `${t}.blocks`), e.blocks);
|
|
4688
4713
|
}
|
|
4689
|
-
function
|
|
4690
|
-
let r = Array.isArray(e) ? n : `${n}.blocks`, i =
|
|
4714
|
+
function Pr(e, t = "message", n = "data") {
|
|
4715
|
+
let r = Array.isArray(e) ? n : `${n}.blocks`, i = Nr(e, n), a = t === "message" ? 50 : 100;
|
|
4691
4716
|
z(i.length <= a, "limit_exceeded", r, `${t} surfaces accept at most ${String(a)} blocks`);
|
|
4692
4717
|
let o = 0, s = 0, c = 0, l = /* @__PURE__ */ new Set();
|
|
4693
4718
|
i.forEach((e, n) => {
|
|
4694
4719
|
let i = `${r}[${String(n)}]`;
|
|
4695
|
-
if (
|
|
4696
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t) s +=
|
|
4697
|
-
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c +=
|
|
4720
|
+
if (jr(e, t, i), e.block_id !== void 0 && (z(!l.has(e.block_id), "duplicate_id", `${i}.block_id`, `"${e.block_id}" is already used in this payload`), l.add(e.block_id)), e.type === "markdown") o += e.text.length;
|
|
4721
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t) s += gr(e);
|
|
4722
|
+
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c += gr(e);
|
|
4698
4723
|
}), z(o <= $t, "limit_exceeded", r, `markdown blocks exceed the cumulative ${String($t)} character limit`), z(s <= nn, "limit_exceeded", r, `table cells exceed the cumulative ${String(nn)} character limit`), z(c <= rn, "limit_exceeded", r, `data_table cells exceed the cumulative ${String(rn)} character limit`);
|
|
4699
4724
|
}
|
|
4700
|
-
function
|
|
4725
|
+
function Fr(e, t = "message") {
|
|
4701
4726
|
let n = e;
|
|
4702
4727
|
if (typeof e == "string") try {
|
|
4703
4728
|
n = JSON.parse(e);
|
|
@@ -4707,15 +4732,15 @@ function Pr(e, t = "message") {
|
|
|
4707
4732
|
path: "data"
|
|
4708
4733
|
});
|
|
4709
4734
|
}
|
|
4710
|
-
return
|
|
4711
|
-
}
|
|
4712
|
-
function Fr(e) {
|
|
4713
|
-
return Ir(e) ? e.blocks : e;
|
|
4735
|
+
return Pr(n, t), n;
|
|
4714
4736
|
}
|
|
4715
4737
|
function Ir(e) {
|
|
4738
|
+
return Lr(e) ? e.blocks : e;
|
|
4739
|
+
}
|
|
4740
|
+
function Lr(e) {
|
|
4716
4741
|
return !Array.isArray(e);
|
|
4717
4742
|
}
|
|
4718
4743
|
//#endregion
|
|
4719
|
-
export { Mn as ActionsBlock, Ut as AlertBlock, zn as Block, qn as BlockKit, Gn as BlockKitInvariantError,
|
|
4744
|
+
export { Mn as ActionsBlock, Ut as AlertBlock, zn as Block, qn as BlockKit, Gn as BlockKitInvariantError, b as BlockKitProvider, Ve as ButtonElement, Bt as CardBlock, Ht as CarouselBlock, Ge as ChoiceGroup, Wn as ContainerBlock, Fn as ContextActionsBlock, kt as ContextBlock, zt as DataTableBlock, On as DataVisualizationBlock, Et as DividerBlock, Mt as FileBlock, Tt as HeaderBlock, Dt as ImageBlock, P as ImageElement, Nn as InputBlock, it as InputElement, at as InteractiveElement, St as Markdown, jt as MarkdownBlock, F as Mrkdwn, He as OverflowElement, Kt as PlanBlock, M as RichText, At as RichTextBlock, wt as SectionBlock, $e as SelectElement, It as TableBlock, Pt as TableCell, Wt as TaskCardBlock, I as Text, Nt as VideoBlock, Pr as assertBlockKitData, Mr as assertBlockType, Zn as assertImageElementData, ar as assertInteractiveElementData, jr as assertRenderableBlock, lr as assertRichTextBlockData, Yn as assertTextObjectData, Ir as blocksOf, ne as darkTheme, te as lightTheme, Fr as parseBlockKitData, yt as tokenizeMarkdown, pt as tokenizeMrkdwn, ee as tokens, x as useBlockKitContext };
|
|
4720
4745
|
|
|
4721
4746
|
//# sourceMappingURL=index.js.map
|